sfc/controller/multitap/000700 001750 001750 00000000000 12656700342 016470 5ustar00sergiosergio000000 000000 sfc/ppu/screen/screen.cpp000664 001750 001750 00000014606 12651764221 016540 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP void PPU::Screen::scanline() { output = self.output + self.vcounter() * 1024; if(self.display.interlace && self.field()) output += 512; //the first hires pixel of each scanline is transparent //note: exact value initializations are not confirmed on hardware math.main.color = get_color(0); math.sub.color = math.main.color; math.main.color_enable = !(self.window.regs.col_main_mask & 1); math.sub.color_enable = !(self.window.regs.col_sub_mask & 1) && regs.back_color_enable; math.transparent = true; math.addsub_mode = false; math.color_halve = regs.color_halve && !regs.addsub_mode && math.main.color_enable; } void PPU::Screen::run() { if(ppu.vcounter() == 0) return; bool hires = self.regs.pseudo_hires || self.regs.bgmode == 5 || self.regs.bgmode == 6; auto sscolor = get_pixel_sub(hires); auto mscolor = get_pixel_main(); *output++ = (self.regs.display_brightness << 15) | (hires ? sscolor : mscolor); *output++ = (self.regs.display_brightness << 15) | (mscolor); } uint16 PPU::Screen::get_pixel_sub(bool hires) { if(self.regs.display_disable || (!self.regs.overscan && self.vcounter() >= 225)) return 0; unsigned priority = 0; if(self.bg1.output.sub.priority) { priority = self.bg1.output.sub.priority; if(regs.direct_color && (self.regs.bgmode == 3 || self.regs.bgmode == 4 || self.regs.bgmode == 7)) { math.sub.color = get_direct_color(self.bg1.output.sub.palette, self.bg1.output.sub.tile); } else { math.sub.color = get_color(self.bg1.output.sub.palette); } } if(self.bg2.output.sub.priority > priority) { priority = self.bg2.output.sub.priority; math.sub.color = get_color(self.bg2.output.sub.palette); } if(self.bg3.output.sub.priority > priority) { priority = self.bg3.output.sub.priority; math.sub.color = get_color(self.bg3.output.sub.palette); } if(self.bg4.output.sub.priority > priority) { priority = self.bg4.output.sub.priority; math.sub.color = get_color(self.bg4.output.sub.palette); } if(self.sprite.output.sub.priority > priority) { priority = self.sprite.output.sub.priority; math.sub.color = get_color(self.sprite.output.sub.palette); } math.transparent = (priority == 0); if(math.transparent) math.sub.color = get_color(0); if(!hires) return 0; if(!math.sub.color_enable) return math.main.color_enable ? math.sub.color : 0; return addsub( math.main.color_enable ? math.sub.color : 0, math.addsub_mode ? math.main.color : fixed_color() ); } uint16 PPU::Screen::get_pixel_main() { if(self.regs.display_disable || (!self.regs.overscan && self.vcounter() >= 225)) return 0; unsigned priority = 0; if(self.bg1.output.main.priority) { priority = self.bg1.output.main.priority; if(regs.direct_color && (self.regs.bgmode == 3 || self.regs.bgmode == 4 || self.regs.bgmode == 7)) { math.main.color = get_direct_color(self.bg1.output.main.palette, self.bg1.output.main.tile); } else { math.main.color = get_color(self.bg1.output.main.palette); } math.sub.color_enable = regs.bg1_color_enable; } if(self.bg2.output.main.priority > priority) { priority = self.bg2.output.main.priority; math.main.color = get_color(self.bg2.output.main.palette); math.sub.color_enable = regs.bg2_color_enable; } if(self.bg3.output.main.priority > priority) { priority = self.bg3.output.main.priority; math.main.color = get_color(self.bg3.output.main.palette); math.sub.color_enable = regs.bg3_color_enable; } if(self.bg4.output.main.priority > priority) { priority = self.bg4.output.main.priority; math.main.color = get_color(self.bg4.output.main.palette); math.sub.color_enable = regs.bg4_color_enable; } if(self.sprite.output.main.priority > priority) { priority = self.sprite.output.main.priority; math.main.color = get_color(self.sprite.output.main.palette); math.sub.color_enable = regs.oam_color_enable && self.sprite.output.main.palette >= 192; } if(priority == 0) { math.main.color = get_color(0); math.sub.color_enable = regs.back_color_enable; } if(!self.window.output.sub.color_enable) math.sub.color_enable = false; math.main.color_enable = self.window.output.main.color_enable; if(!math.sub.color_enable) return math.main.color_enable ? math.main.color : 0; if(regs.addsub_mode && math.transparent) { math.addsub_mode = false; math.color_halve = false; } else { math.addsub_mode = regs.addsub_mode; math.color_halve = regs.color_halve && math.main.color_enable; } return addsub( math.main.color_enable ? math.main.color : 0, math.addsub_mode ? math.sub.color : fixed_color() ); } uint16 PPU::Screen::addsub(unsigned x, unsigned y) { if(!regs.color_mode) { if(!math.color_halve) { unsigned sum = x + y; unsigned carry = (sum - ((x ^ y) & 0x0421)) & 0x8420; return (sum - carry) | (carry - (carry >> 5)); } else { return (x + y - ((x ^ y) & 0x0421)) >> 1; } } else { unsigned diff = x - y + 0x8420; unsigned borrow = (diff - ((x ^ y) & 0x8420)) & 0x8420; if(!math.color_halve) { return (diff - borrow) & (borrow - (borrow >> 5)); } else { return (((diff - borrow) & (borrow - (borrow >> 5))) & 0x7bde) >> 1; } } } uint16 PPU::Screen::get_color(unsigned palette) { palette <<= 1; self.regs.cgram_iaddr = palette; return ppu.cgram[palette + 0] + (ppu.cgram[palette + 1] << 8); } uint16 PPU::Screen::get_direct_color(unsigned palette, unsigned tile) { //palette = -------- BBGGGRRR //tile = ---bgr-- -------- //output = 0BBb00GG Gg0RRRr0 return ((palette << 7) & 0x6000) + ((tile >> 0) & 0x1000) + ((palette << 4) & 0x0380) + ((tile >> 5) & 0x0040) + ((palette << 2) & 0x001c) + ((tile >> 9) & 0x0002); } uint16 PPU::Screen::fixed_color() const { return (regs.color_b << 10) | (regs.color_g << 5) | (regs.color_r << 0); } void PPU::Screen::reset() { regs.addsub_mode = random(false); regs.direct_color = random(false); regs.color_mode = random(false); regs.color_halve = random(false); regs.bg1_color_enable = random(false); regs.bg2_color_enable = random(false); regs.bg3_color_enable = random(false); regs.bg4_color_enable = random(false); regs.oam_color_enable = random(false); regs.back_color_enable = random(false); regs.color_r = random(0); regs.color_g = random(0); regs.color_b = random(0); } PPU::Screen::Screen(PPU& self) : self(self) { } #endif phoenix/cocoa/widget/console.hpp000664 001750 001750 00000000630 12651764221 020103 0ustar00sergiosergio000000 000000 @interface CocoaConsole : NSScrollView { @public phoenix::Console* console; } -(id) initWith:(phoenix::Console&)console; @end namespace phoenix { struct pConsole : public pWidget { Console& console; CocoaConsole* cocoaConsole = nullptr; void print(string text); void reset(); pConsole(Console& console) : pWidget(console), console(console) {} void constructor(); void destructor(); }; } phoenix/gtk/widget/hex-edit.cpp000664 001750 001750 00000021564 12651764221 017655 0ustar00sergiosergio000000 000000 namespace phoenix { static bool HexEdit_keyPress(GtkWidget* widget, GdkEventKey* event, HexEdit* self) { return self->p.keyPress(event->keyval, event->state); } static bool HexEdit_mouseScroll(GtkWidget* widget, GdkEventScroll* event, HexEdit* self) { double position = gtk_range_get_value(GTK_RANGE(self->p.scrollBar)); if(event->direction == GDK_SCROLL_UP) { self->p.scroll(position - 1); } if(event->direction == GDK_SCROLL_DOWN) { self->p.scroll(position + 1); } return true; //do not propagate event further } static bool HexEdit_scroll(GtkRange* range, GtkScrollType scroll, double value, HexEdit* self) { self->p.scroll((signed)value); return true; //do not propagate event further } bool pHexEdit::focused() { return GTK_WIDGET_HAS_FOCUS(subWidget) || GTK_WIDGET_HAS_FOCUS(scrollBar); } void pHexEdit::setColumns(unsigned columns) { setScroll(); update(); } void pHexEdit::setLength(unsigned length) { setScroll(); update(); } void pHexEdit::setOffset(unsigned offset) { setScroll(); updateScroll(); update(); } void pHexEdit::setRows(unsigned rows) { setScroll(); update(); } void pHexEdit::update() { if(!hexEdit.onRead) { gtk_text_buffer_set_text(textBuffer, "", -1); return; } unsigned position = cursorPosition(); string output; unsigned offset = hexEdit.state.offset; for(unsigned row = 0; row < hexEdit.state.rows; row++) { output.append(hex<8>(offset)); output.append(" "); string hexdata; string ansidata = " "; for(unsigned column = 0; column < hexEdit.state.columns; column++) { if(offset < hexEdit.state.length) { uint8_t data = hexEdit.onRead(offset++); hexdata.append(hex<2>(data)); hexdata.append(" "); ansidata.append(data >= 0x20 && data <= 0x7e ? (char)data : '.'); } else { hexdata.append(" "); ansidata.append(" "); } } output.append(hexdata); output.append(ansidata); if(offset >= hexEdit.state.length) break; if(row != hexEdit.state.rows - 1) output.append("\n"); } gtk_text_buffer_set_text(textBuffer, output, -1); if(position == 0) position = 10; //start at first position where hex values can be entered setCursorPosition(position); } void pHexEdit::constructor() { gtkWidget = gtk_hbox_new(false, 0); container = gtk_scrolled_window_new(0, 0); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(container), GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(container), GTK_SHADOW_ETCHED_IN); subWidget = gtk_text_view_new(); gtk_text_view_set_editable(GTK_TEXT_VIEW(subWidget), false); gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(subWidget), GTK_WRAP_NONE); gtk_container_add(GTK_CONTAINER(container), subWidget); g_signal_connect(G_OBJECT(subWidget), "key-press-event", G_CALLBACK(HexEdit_keyPress), (gpointer)&hexEdit); g_signal_connect(G_OBJECT(subWidget), "scroll-event", G_CALLBACK(HexEdit_mouseScroll), (gpointer)&hexEdit); scrollBar = gtk_vscrollbar_new((GtkAdjustment*)nullptr); gtk_range_set_range(GTK_RANGE(scrollBar), 0, 255); gtk_range_set_increments(GTK_RANGE(scrollBar), 1, 16); gtk_widget_set_sensitive(scrollBar, false); g_signal_connect(G_OBJECT(scrollBar), "change-value", G_CALLBACK(HexEdit_scroll), (gpointer)&hexEdit); g_signal_connect(G_OBJECT(scrollBar), "scroll-event", G_CALLBACK(HexEdit_mouseScroll), (gpointer)&hexEdit); gtk_box_pack_start(GTK_BOX(gtkWidget), container, true, true, 0); gtk_box_pack_start(GTK_BOX(gtkWidget), scrollBar, false, false, 1); textBuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(subWidget)); textCursor = gtk_text_buffer_get_mark(textBuffer, "insert"); gtk_widget_show(scrollBar); gtk_widget_show(subWidget); gtk_widget_show(container); setColumns(hexEdit.state.columns); setRows(hexEdit.state.rows); setLength(hexEdit.state.length); setOffset(hexEdit.state.offset); update(); } void pHexEdit::destructor() { gtk_widget_destroy(scrollBar); gtk_widget_destroy(subWidget); gtk_widget_destroy(container); gtk_widget_destroy(gtkWidget); } void pHexEdit::orphan() { destructor(); constructor(); } unsigned pHexEdit::cursorPosition() { GtkTextIter iter; gtk_text_buffer_get_iter_at_mark(textBuffer, &iter, textCursor); return gtk_text_iter_get_offset(&iter); } bool pHexEdit::keyPress(unsigned scancode, unsigned mask) { if(!hexEdit.onRead) return false; if(mask & (GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_SUPER_MASK)) return false; //allow actions such as Ctrl+C (copy) signed position = cursorPosition(); signed lineWidth = 10 + (hexEdit.state.columns * 3) + 1 + hexEdit.state.columns + 1; signed cursorY = position / lineWidth; signed cursorX = position % lineWidth; if(scancode == GDK_Home) { setCursorPosition(cursorY * lineWidth + 10); return true; } if(scancode == GDK_End) { setCursorPosition(cursorY * lineWidth + 10 + (hexEdit.state.columns * 3 - 1)); return true; } if(scancode == GDK_Up) { if(cursorY != 0) return false; signed newOffset = hexEdit.state.offset - hexEdit.state.columns; if(newOffset >= 0) { hexEdit.setOffset(newOffset); update(); } return true; } if(scancode == GDK_Down) { if(cursorY >= rows() - 1) return true; if(cursorY != hexEdit.state.rows - 1) return false; signed newOffset = hexEdit.state.offset + hexEdit.state.columns; if(newOffset + hexEdit.state.columns * hexEdit.state.rows - (hexEdit.state.columns - 1) <= hexEdit.state.length) { hexEdit.setOffset(newOffset); update(); } return true; } if(scancode == GDK_Page_Up) { signed newOffset = hexEdit.state.offset - hexEdit.state.columns * hexEdit.state.rows; if(newOffset >= 0) { hexEdit.setOffset(newOffset); } else { hexEdit.setOffset(0); } update(); return true; } if(scancode == GDK_Page_Down) { signed newOffset = hexEdit.state.offset + hexEdit.state.columns * hexEdit.state.rows; for(unsigned n = 0; n < hexEdit.state.rows; n++) { if(newOffset + hexEdit.state.columns * hexEdit.state.rows - (hexEdit.state.columns - 1) <= hexEdit.state.length) { hexEdit.setOffset(newOffset); update(); break; } newOffset -= hexEdit.state.columns; } return true; } //convert scancode to hex nibble if(scancode >= '0' && scancode <= '9') scancode = scancode - '0'; else if(scancode >= 'A' && scancode <= 'F') scancode = scancode - 'A' + 10; else if(scancode >= 'a' && scancode <= 'f') scancode = scancode - 'a' + 10; else return false; //not a valid hex value if(cursorX >= 10) { //not on an offset cursorX -= 10; if((cursorX % 3) != 2) { //not on a space bool cursorNibble = (cursorX % 3) == 1; //0 = high, 1 = low cursorX /= 3; if(cursorX < hexEdit.state.columns) { //not in ANSI region unsigned offset = hexEdit.state.offset + (cursorY * hexEdit.state.columns + cursorX); if(offset >= hexEdit.state.length) return false; //do not edit past end of data uint8_t data = hexEdit.onRead(offset); //write modified value if(cursorNibble == 1) { data = (data & 0xf0) | (scancode << 0); } else { data = (data & 0x0f) | (scancode << 4); } if(hexEdit.onWrite) hexEdit.onWrite(offset, data); //auto-advance cursor to next nibble/byte position++; if(cursorNibble && cursorX != hexEdit.state.columns - 1) position++; setCursorPosition(position); //refresh output to reflect modified data update(); } } } return true; } //number of actual rows signed pHexEdit::rows() { return (max(1u, hexEdit.state.length) + hexEdit.state.columns - 1) / hexEdit.state.columns; } //number of scrollable row positions signed pHexEdit::rowsScrollable() { return max(0u, rows() - hexEdit.state.rows); } void pHexEdit::scroll(signed position) { if(position > rowsScrollable()) position = rowsScrollable(); if(position < 0) position = 0; hexEdit.setOffset(position * hexEdit.state.columns); } void pHexEdit::setCursorPosition(unsigned position) { GtkTextIter iter; gtk_text_buffer_get_iter_at_mark(textBuffer, &iter, textCursor); //GTK+ will throw many errors to the terminal if you set iterator past end of buffer GtkTextIter endIter; gtk_text_buffer_get_end_iter(textBuffer, &iter); unsigned endPosition = gtk_text_iter_get_offset(&iter); gtk_text_iter_set_offset(&iter, min(position, endPosition)); gtk_text_buffer_place_cursor(textBuffer, &iter); } void pHexEdit::setScroll() { if(rowsScrollable() > 0) { gtk_range_set_range(GTK_RANGE(scrollBar), 0, rowsScrollable()); gtk_widget_set_sensitive(scrollBar, true); } else { gtk_widget_set_sensitive(scrollBar, false); } } void pHexEdit::updateScroll() { unsigned row = hexEdit.state.offset / hexEdit.state.columns; gtk_range_set_value(GTK_RANGE(scrollBar), row); } } ananke/famicom.cpp000664 001750 001750 00000002645 12651764221 015273 0ustar00sergiosergio000000 000000 void Ananke::copyFamicomSaves(const string &pathname) { if(!file::exists({pathname, "save.ram"})) { if(file::exists({information.path, nall::basename(information.name), ".sav"})) { file::copy({information.path, nall::basename(information.name), ".srm"}, {pathname, "save.ram"}); } } } string Ananke::createFamicomHeuristic(vector &buffer) { string pathname = { libraryPath, "Famicom/", nall::basename(information.name), ".fc/" }; directory::create(pathname); FamicomCartridge info(buffer.data(), buffer.size()); string markup = {"unverified\n\n", info.markup}; markup.append("\ninformation\n title: ", nall::basename(information.name), "\n"); if(!information.manifest.empty()) markup = information.manifest; //override with embedded beat manifest, if one exists file::write({pathname, "manifest.bml"}, markup); file::write({pathname, "program.rom"}, buffer.data() + 16, info.prgrom); if(info.chrrom > 0) file::write({pathname, "character.rom"}, buffer.data() + 16 + info.prgrom, info.chrrom); copyFamicomSaves(pathname); return pathname; } string Ananke::openFamicom(vector &buffer) { return createFamicomHeuristic(buffer); } //this currently cannot work: //game folders discard iNES header required for heuristic detection //a games database of all commercial Famicom software will be required string Ananke::syncFamicom(const string &pathname) { return ""; } phoenix/windows/action/000700 001750 001750 00000000000 12656700342 016314 5ustar00sergiosergio000000 000000 gb/cartridge/huc1/huc1.hpp000664 001750 001750 00000000406 12651764221 016455 0ustar00sergiosergio000000 000000 struct HuC1 : MMIO { bool ram_writable; //$0000-1fff uint8 rom_select; //$2000-3fff uint8 ram_select; //$4000-5fff bool model; //$6000-7fff uint8 mmio_read(uint16 addr); void mmio_write(uint16 addr, uint8 data); void power(); } huc1; phoenix/windows/widget/vertical-slider.cpp000664 001750 001750 00000002435 12651764221 022140 0ustar00sergiosergio000000 000000 namespace phoenix { Size pVerticalSlider::minimumSize() { return {0, 25}; } void pVerticalSlider::setLength(unsigned length) { length += (length == 0); SendMessage(hwnd, TBM_SETRANGE, (WPARAM)true, (LPARAM)MAKELONG(0, length - 1)); SendMessage(hwnd, TBM_SETPAGESIZE, 0, (LPARAM)(length >> 3)); verticalSlider.setPosition(0); } void pVerticalSlider::setPosition(unsigned position) { SendMessage(hwnd, TBM_SETPOS, (WPARAM)true, (LPARAM)position); } void pVerticalSlider::constructor() { hwnd = CreateWindow( TRACKBAR_CLASS, L"", WS_CHILD | WS_TABSTOP | TBS_TRANSPARENTBKGND | TBS_NOTICKS | TBS_BOTH | TBS_VERT, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&verticalSlider); unsigned position = verticalSlider.state.position; setLength(verticalSlider.state.length); verticalSlider.setPosition(position); synchronize(); } void pVerticalSlider::destructor() { DestroyWindow(hwnd); } void pVerticalSlider::orphan() { destructor(); constructor(); } void pVerticalSlider::onChange() { unsigned position = SendMessage(hwnd, TBM_GETPOS, 0, 0); if(position == verticalSlider.state.position) return; verticalSlider.state.position = position; if(verticalSlider.onChange) verticalSlider.onChange(); } } phoenix/cocoa/widget/list-view.cpp000664 001750 001750 00000023037 12651764221 020365 0ustar00sergiosergio000000 000000 @implementation CocoaListView : NSScrollView -(id) initWith:(phoenix::ListView&)listViewReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { listView = &listViewReference; content = [[CocoaListViewContent alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)]; [self setDocumentView:content]; [self setBorderType:NSBezelBorder]; [self setHasVerticalScroller:YES]; [content setDataSource:self]; [content setDelegate:self]; [content setTarget:self]; [content setDoubleAction:@selector(doubleAction:)]; [content setAllowsColumnReordering:NO]; [content setAllowsColumnResizing:YES]; [content setAllowsColumnSelection:NO]; [content setAllowsEmptySelection:YES]; [content setAllowsMultipleSelection:NO]; [content setColumnAutoresizingStyle:NSTableViewLastColumnOnlyAutoresizingStyle]; font = nil; [self setFont:nil]; } return self; } -(void) dealloc { [content release]; [font release]; [super dealloc]; } -(CocoaListViewContent*) content { return content; } -(NSFont*) font { return font; } -(void) setFont:(NSFont*)fontPointer { if(!fontPointer) fontPointer = [NSFont systemFontOfSize:12]; [fontPointer retain]; if(font) [font release]; font = fontPointer; unsigned fontHeight = phoenix::pFont::size(font, " ").height; [content setFont:font]; [content setRowHeight:fontHeight]; [self reloadColumns]; } -(void) reloadColumns { while([[content tableColumns] count]) { [content removeTableColumn:[[content tableColumns] lastObject]]; } if(listView->state.checkable) { NSTableColumn *tableColumn = [[NSTableColumn alloc] initWithIdentifier:@"check"]; NSTableHeaderCell *headerCell = [[NSTableHeaderCell alloc] initTextCell:@""]; NSButtonCell *dataCell = [[NSButtonCell alloc] initTextCell:@""]; [dataCell setButtonType:NSSwitchButton]; [dataCell setControlSize:NSSmallControlSize]; [dataCell setRefusesFirstResponder:YES]; [tableColumn setResizingMask:NSTableColumnNoResizing]; [tableColumn setHeaderCell:headerCell]; [tableColumn setDataCell:dataCell]; [tableColumn setWidth:20.0]; [content addTableColumn:tableColumn]; } lstring headers = listView->state.headerText; if(headers.size() == 0) headers.append(""); [content setUsesAlternatingRowBackgroundColors:headers.size() >= 2]; for(unsigned column = 0; column < headers.size(); column++) { NSTableColumn* tableColumn = [[NSTableColumn alloc] initWithIdentifier:[[NSNumber numberWithInteger:column] stringValue]]; NSTableHeaderCell* headerCell = [[NSTableHeaderCell alloc] initTextCell:[NSString stringWithUTF8String:headers(column)]]; CocoaListViewCell* dataCell = [[CocoaListViewCell alloc] initTextCell:@""]; [dataCell setEditable:NO]; [tableColumn setResizingMask:NSTableColumnAutoresizingMask | NSTableColumnUserResizingMask]; [tableColumn setHeaderCell:headerCell]; [tableColumn setDataCell:dataCell]; [content addTableColumn:tableColumn]; } } -(NSInteger) numberOfRowsInTableView:(NSTableView*)table { return listView->state.text.size(); } -(id) tableView:(NSTableView*)table objectValueForTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row { if([[tableColumn identifier] isEqualToString:@"check"]) { auto checked = listView->state.checked(row) ? NSOnState : NSOffState; return [NSNumber numberWithInteger:checked]; } NSInteger column = [[tableColumn identifier] integerValue]; unsigned height = [table rowHeight]; NSString* text = [NSString stringWithUTF8String:listView->state.text(row)(column)]; NSImage* image = NSMakeImage(listView->state.image(row)(column), height, height); if(image) return @{ @"text":text, @"image":image }; return @{ @"text":text }; } -(BOOL) tableView:(NSTableView*)table shouldShowCellExpansionForTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row { return NO; } -(NSString*) tableView:(NSTableView*)table toolTipForCell:(NSCell*)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row mouseLocation:(NSPoint)mouseLocation { return nil; } -(void) tableView:(NSTableView*)table setObjectValue:(id)object forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row { if([[tableColumn identifier] isEqualToString:@"check"]) { listView->state.checked(row) = [object integerValue] != NSOffState; if(listView->onToggle) listView->onToggle(row); } } -(void) tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row { [cell setFont:[self font]]; } -(void) tableViewSelectionDidChange:(NSNotification*)notification { listView->state.selected = true; listView->state.selection = [content selectedRow]; if(listView->onChange) listView->onChange(); } -(IBAction) activate:(id)sender { if(listView->onActivate) listView->onActivate(); } -(IBAction) doubleAction:(id)sender { if([content clickedRow] >= 0) { [self activate:self]; } } @end @implementation CocoaListViewContent : NSTableView -(void) keyDown:(NSEvent*)event { auto character = [[event characters] characterAtIndex:0]; if(character == NSEnterCharacter || character == NSCarriageReturnCharacter) { if([self selectedRow] >= 0) { [[self delegate] activate:self]; return; } } [super keyDown:event]; } @end @implementation CocoaListViewCell : NSTextFieldCell //used by type-ahead -(NSString*) stringValue { return [[self objectValue] objectForKey:@"text"]; } -(void) drawWithFrame:(NSRect)frame inView:(NSView*)view { NSString* text = [[self objectValue] objectForKey:@"text"]; NSImage* image = [[self objectValue] objectForKey:@"image"]; unsigned textDisplacement = 0; if(image) { [[NSGraphicsContext currentContext] saveGraphicsState]; NSRect targetRect = NSMakeRect(frame.origin.x, frame.origin.y, frame.size.height, frame.size.height); NSRect sourceRect = NSMakeRect(0, 0, [image size].width, [image size].height); [image drawInRect:targetRect fromRect:sourceRect operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil]; [[NSGraphicsContext currentContext] restoreGraphicsState]; textDisplacement = frame.size.height + 2; } NSRect textRect = NSMakeRect( frame.origin.x + textDisplacement, frame.origin.y, frame.size.width - textDisplacement, frame.size.height ); NSColor* textColor = [self isHighlighted] ? [NSColor alternateSelectedControlTextColor] : [NSColor textColor]; [text drawInRect:textRect withAttributes:@{ NSForegroundColorAttributeName:textColor, NSFontAttributeName:[self font] }]; } @end namespace phoenix { void pListView::append(const lstring& text) { @autoreleasepool { [[cocoaView content] reloadData]; } } void pListView::autoSizeColumns() { @autoreleasepool { if(listView.state.checkable) { NSTableColumn* tableColumn = [[cocoaView content] tableColumnWithIdentifier:@"check"]; [tableColumn setWidth:20.0]; } unsigned height = [[cocoaView content] rowHeight]; for(unsigned column = 0; column < max(1u, listView.state.headerText.size()); column++) { NSTableColumn* tableColumn = [[cocoaView content] tableColumnWithIdentifier:[[NSNumber numberWithInteger:column] stringValue]]; unsigned minimumWidth = pFont::size([[tableColumn headerCell] font], listView.state.headerText(column)).width + 4; for(unsigned row = 0; row < listView.state.text.size(); row++) { unsigned width = pFont::size([cocoaView font], listView.state.text(row)(column)).width + 2; if(listView.state.image(row)(height).empty() == false) width += height + 2; if(width > minimumWidth) minimumWidth = width; } [tableColumn setWidth:minimumWidth]; } [[cocoaView content] sizeLastColumnToFit]; } } void pListView::remove(unsigned selection) { @autoreleasepool { [[cocoaView content] reloadData]; } } void pListView::reset() { @autoreleasepool { [[cocoaView content] reloadData]; } } void pListView::setCheckable(bool checkable) { @autoreleasepool { [cocoaView reloadColumns]; } } void pListView::setChecked(unsigned selection, bool checked) { @autoreleasepool { [[cocoaView content] reloadData]; } } void pListView::setFont(string font) { @autoreleasepool { [cocoaView setFont:pFont::cocoaFont(font)]; } } void pListView::setHeaderText(const lstring& text) { @autoreleasepool { [cocoaView reloadColumns]; } } void pListView::setHeaderVisible(bool visible) { @autoreleasepool { if(visible) { [[cocoaView content] setHeaderView:[[[NSTableHeaderView alloc] init] autorelease]]; } else { [[cocoaView content] setHeaderView:nil]; } } } void pListView::setImage(unsigned selection, unsigned position, const image& image) { @autoreleasepool { [[cocoaView content] reloadData]; } } void pListView::setSelected(bool selected) { @autoreleasepool { if(selected == false) { [[cocoaView content] deselectAll:nil]; } } } void pListView::setSelection(unsigned selection) { @autoreleasepool { [[cocoaView content] selectRowIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(selection, 1)] byExtendingSelection:NO]; } } void pListView::setText(unsigned selection, unsigned position, const string text) { @autoreleasepool { [[cocoaView content] reloadData]; } } void pListView::constructor() { @autoreleasepool { cocoaView = cocoaListView = [[CocoaListView alloc] initWith:listView]; setHeaderVisible(listView.state.headerVisible); setHeaderText(listView.state.headerText); } } void pListView::destructor() { @autoreleasepool { [cocoaView release]; } } } sfc/controller/usart/000700 001750 001750 00000000000 12656700342 015767 5ustar00sergiosergio000000 000000 ruby/input.hpp000664 001750 001750 00000001377 12651764221 014551 0ustar00sergiosergio000000 000000 struct Input { static const char* Handle; static const char* KeyboardSupport; static const char* MouseSupport; static const char* JoypadSupport; static const char* JoypadRumbleSupport; virtual bool cap(const nall::string& name) { return false; } virtual nall::any get(const nall::string& name) { return false; } virtual bool set(const nall::string& name, const nall::any& value) { return false; } virtual bool acquire() { return false; } virtual bool unacquire() { return false; } virtual bool acquired() { return false; } virtual nall::vector poll() { return {}; } virtual bool rumble(uint64_t id, bool enable) {} virtual bool init() { return true; } virtual void term() {} Input() {} virtual ~Input() {} }; phoenix/reference/widget/combo-button.cpp000664 001750 001750 00000000533 12651764221 021720 0ustar00sergiosergio000000 000000 namespace phoenix { void pComboButton::append(string text) { } void pComboButton::remove(unsigned selection) { } void pComboButton::reset() { } void pComboButton::setSelection(unsigned selection) { } void pComboButton::setText(unsigned selection, string text) { } void pComboButton::constructor() { } void pComboButton::destructor() { } } nall/group.hpp000664 001750 001750 00000004341 12651764221 014505 0ustar00sergiosergio000000 000000 #ifndef NALL_GROUP_HPP #define NALL_GROUP_HPP //group //vector of unique references #include namespace nall { template struct group : protected vector { group& operator=(const group& source) { vector::operator=(source); return *this; } group& operator=(group&& source) { vector::operator=(std::move(source)); return *this; } template group(Args&&... args) { construct(std::forward(args)...); } bool empty() const { return vector::empty(); } unsigned size() const { return vector::size(); } void reset() { vector::reset(); } T& first() const { return *vector::operator[](0); } //return true if at least one item was appended template bool append(T& value, Args&&... args) { bool result = append(value); return append(std::forward(args)...) | result; } bool append(T& value) { if(vector::find(&value)) return false; return vector::append(&value), true; } //return true if at least one item was removed template bool remove(T& value, Args&&... args) { bool result = remove(value); return remove(std::forward(args)...) | result; } bool remove(T& value) { if(auto position = vector::find(&value)) return vector::remove(position()), true; return false; } struct iterator : protected vector::constIterator { T& operator*() const { return *vector::constIterator::operator*(); } bool operator!=(const iterator& source) const { return vector::constIterator::operator!=(source); } iterator& operator++() { vector::constIterator::operator++(); return *this; } iterator(const group& source, unsigned position) : vector::constIterator(source, position) {} }; const iterator begin() const { return iterator(*this, 0); } const iterator end() const { return iterator(*this, size()); } private: void construct() {} void construct(const group& source) { vector::operator=(source); } void construct(group&& source) { vector::operator=(std::move(source)); } template void construct(T& value, Args&&... args) { append(value); construct(std::forward(args)...); } }; } #endif phoenix/windows/action/menu.cpp000664 001750 001750 00000007661 12651764221 020013 0ustar00sergiosergio000000 000000 namespace phoenix { void pMenu::append(Action& action) { action.p.parentMenu = &menu; if(parentWindow) parentWindow->p.updateMenu(); } void pMenu::remove(Action& action) { if(parentWindow) parentWindow->p.updateMenu(); action.p.parentMenu = 0; } void pMenu::setImage(const image& image) { createBitmap(); if(parentWindow) parentWindow->p.updateMenu(); } void pMenu::setText(string text) { if(parentWindow) parentWindow->p.updateMenu(); } void pMenu::constructor() { hmenu = 0; createBitmap(); } void pMenu::destructor() { if(hbitmap) { DeleteObject(hbitmap); hbitmap = 0; } if(parentMenu) { parentMenu->remove(menu); } else if(parentWindow) { //belongs to window's main menubar parentWindow->remove(menu); } } void pMenu::createBitmap() { if(hbitmap) { DeleteObject(hbitmap); hbitmap = 0; } if(menu.state.image.width && menu.state.image.height) { nall::image nallImage = menu.state.image; nallImage.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0); nallImage.alphaBlend(GetSysColor(COLOR_MENU)); //Windows does not alpha blend menu icons properly (leaves black outline) nallImage.scale(GetSystemMetrics(SM_CXMENUCHECK), GetSystemMetrics(SM_CYMENUCHECK), Interpolation::Linear); hbitmap = CreateBitmap(nallImage); } } //Windows actions lack the ability to toggle visibility. //To support this, menus must be destroyed and recreated when toggling any action's visibility. void pMenu::update(Window& parentWindow, Menu* parentMenu) { this->parentMenu = parentMenu; this->parentWindow = &parentWindow; if(hmenu) DestroyMenu(hmenu); hmenu = CreatePopupMenu(); for(auto& action : menu.state.action) { action.p.parentMenu = &menu; action.p.parentWindow = &parentWindow; unsigned enabled = action.state.enabled ? 0 : MF_GRAYED; if(dynamic_cast(&action)) { Menu& item = (Menu&)action; if(action.state.visible) { item.p.update(parentWindow, &menu); AppendMenu(hmenu, MF_STRING | MF_POPUP | enabled, (UINT_PTR)item.p.hmenu, utf16_t(item.state.text)); if(item.state.image.width && item.state.image.height) { MENUITEMINFO mii = {sizeof(MENUITEMINFO)}; //Windows XP and below displays MIIM_BITMAP + hbmpItem in its own column (separate from check/radio marks) //this causes too much spacing, so use a custom checkmark image instead mii.fMask = MIIM_CHECKMARKS; mii.hbmpUnchecked = item.p.hbitmap; SetMenuItemInfo(hmenu, (UINT_PTR)item.p.hmenu, FALSE, &mii); } } } else if(dynamic_cast(&action)) { Separator& item = (Separator&)action; if(action.state.visible) { AppendMenu(hmenu, MF_SEPARATOR | enabled, item.p.id, L""); } } else if(dynamic_cast(&action)) { Item& item = (Item&)action; if(action.state.visible) { AppendMenu(hmenu, MF_STRING | enabled, item.p.id, utf16_t(item.state.text)); if(item.state.image.width && item.state.image.height) { MENUITEMINFO mii = { sizeof(MENUITEMINFO) }; //Windows XP and below displays MIIM_BITMAP + hbmpItem in its own column (separate from check/radio marks) //this causes too much spacing, so use a custom checkmark image instead mii.fMask = MIIM_CHECKMARKS; mii.hbmpUnchecked = item.p.hbitmap; SetMenuItemInfo(hmenu, item.p.id, FALSE, &mii); } } } else if(dynamic_cast(&action)) { CheckItem& item = (CheckItem&)action; if(action.state.visible) { AppendMenu(hmenu, MF_STRING | enabled, item.p.id, utf16_t(item.state.text)); } if(item.state.checked) item.setChecked(); } else if(dynamic_cast(&action)) { RadioItem& item = (RadioItem&)action; if(action.state.visible) { AppendMenu(hmenu, MF_STRING | enabled, item.p.id, utf16_t(item.state.text)); } if(item.state.checked) item.setChecked(); } } } } sfc/scheduler/scheduler.cpp000664 001750 001750 00000001031 12651764221 017116 0ustar00sergiosergio000000 000000 #ifdef SYSTEM_CPP Scheduler scheduler; void Scheduler::enter() { host_thread = co_active(); co_switch(thread); } void Scheduler::exit(ExitReason reason) { exit_reason = reason; thread = co_active(); co_switch(host_thread); } void Scheduler::debug() { exit(ExitReason::DebuggerEvent); } void Scheduler::init() { host_thread = co_active(); thread = cpu.thread; sync = SynchronizeMode::None; } Scheduler::Scheduler() { host_thread = nullptr; thread = nullptr; exit_reason = ExitReason::UnknownEvent; } #endif phoenix/gtk/widget/button.cpp000664 001750 001750 00000003063 12651764221 017453 0ustar00sergiosergio000000 000000 namespace phoenix { static void Button_activate(Button* self) { if(self->onActivate) self->onActivate(); } Size pButton::minimumSize() { Size size = pFont::size(widget.state.font, button.state.text); if(button.state.orientation == Orientation::Horizontal) { size.width += button.state.image.width; size.height = max(button.state.image.height, size.height); } if(button.state.orientation == Orientation::Vertical) { size.width = max(button.state.image.width, size.width); size.height += button.state.image.height; } return {size.width + 24, size.height + 12}; } void pButton::setImage(const image& image, Orientation orientation) { if(image.empty() == false) { GtkImage* gtkImage = CreateImage(image); gtk_button_set_image(GTK_BUTTON(gtkWidget), (GtkWidget*)gtkImage); } else { gtk_button_set_image(GTK_BUTTON(gtkWidget), nullptr); } switch(orientation) { case Orientation::Horizontal: gtk_button_set_image_position(GTK_BUTTON(gtkWidget), GTK_POS_LEFT); break; case Orientation::Vertical: gtk_button_set_image_position(GTK_BUTTON(gtkWidget), GTK_POS_TOP); break; } } void pButton::setText(string text) { gtk_button_set_label(GTK_BUTTON(gtkWidget), text); setFont(widget.state.font); } void pButton::constructor() { gtkWidget = gtk_button_new(); g_signal_connect_swapped(G_OBJECT(gtkWidget), "clicked", G_CALLBACK(Button_activate), (gpointer)&button); setText(button.state.text); } void pButton::destructor() { gtk_widget_destroy(gtkWidget); } void pButton::orphan() { destructor(); constructor(); } } gba/system/000700 001750 001750 00000000000 12656700342 013750 5ustar00sergiosergio000000 000000 nall/xorg/xorg.hpp000664 001750 001750 00000000353 12651764221 015306 0ustar00sergiosergio000000 000000 #ifndef NALL_XORG_XORG_HPP #define NALL_XORG_XORG_HPP #include #include #include #include #include #include #include #endif phoenix/gtk/timer.cpp000664 001750 001750 00000001335 12651764221 015775 0ustar00sergiosergio000000 000000 namespace phoenix { static guint Timer_trigger(pTimer* self) { //timer may have been disabled prior to triggering, so check state if(self->timer.state.enabled) { if(self->timer.onActivate) self->timer.onActivate(); } //callback may have disabled timer, so check state again if(self->timer.state.enabled) { g_timeout_add(self->timer.state.interval, (GSourceFunc)Timer_trigger, (gpointer)self); } //kill this timer instance (it is spawned above if needed again) return false; } void pTimer::setEnabled(bool enabled) { if(enabled) { g_timeout_add(timer.state.interval, (GSourceFunc)Timer_trigger, (gpointer)this); } } void pTimer::setInterval(unsigned interval) { } void pTimer::constructor() { } } processor/r65816/registers.hpp000664 001750 001750 00000006117 12651764221 017327 0ustar00sergiosergio000000 000000 struct flag_t { bool n, v, m, x, d, i, z, c; inline operator unsigned() const { return (n << 7) + (v << 6) + (m << 5) + (x << 4) + (d << 3) + (i << 2) + (z << 1) + (c << 0); } inline unsigned operator=(uint8 data) { n = data & 0x80; v = data & 0x40; m = data & 0x20; x = data & 0x10; d = data & 0x08; i = data & 0x04; z = data & 0x02; c = data & 0x01; return data; } inline unsigned operator|=(unsigned data) { return operator=(operator unsigned() | data); } inline unsigned operator^=(unsigned data) { return operator=(operator unsigned() ^ data); } inline unsigned operator&=(unsigned data) { return operator=(operator unsigned() & data); } flag_t() : n(0), v(0), m(0), x(0), d(0), i(0), z(0), c(0) {} }; struct reg16_t { union { uint16 w; struct { uint8 order_lsb2(l, h); }; }; inline operator unsigned() const { return w; } inline unsigned operator = (unsigned i) { return w = i; } inline unsigned operator |= (unsigned i) { return w |= i; } inline unsigned operator ^= (unsigned i) { return w ^= i; } inline unsigned operator &= (unsigned i) { return w &= i; } inline unsigned operator <<= (unsigned i) { return w <<= i; } inline unsigned operator >>= (unsigned i) { return w >>= i; } inline unsigned operator += (unsigned i) { return w += i; } inline unsigned operator -= (unsigned i) { return w -= i; } inline unsigned operator *= (unsigned i) { return w *= i; } inline unsigned operator /= (unsigned i) { return w /= i; } inline unsigned operator %= (unsigned i) { return w %= i; } reg16_t() : w(0) {} }; struct reg24_t { union { uint32 d; struct { uint16 order_lsb2(w, wh); }; struct { uint8 order_lsb4(l, h, b, bh); }; }; inline operator unsigned() const { return d; } inline unsigned operator = (unsigned i) { return d = uclip<24>(i); } inline unsigned operator |= (unsigned i) { return d = uclip<24>(d | i); } inline unsigned operator ^= (unsigned i) { return d = uclip<24>(d ^ i); } inline unsigned operator &= (unsigned i) { return d = uclip<24>(d & i); } inline unsigned operator <<= (unsigned i) { return d = uclip<24>(d << i); } inline unsigned operator >>= (unsigned i) { return d = uclip<24>(d >> i); } inline unsigned operator += (unsigned i) { return d = uclip<24>(d + i); } inline unsigned operator -= (unsigned i) { return d = uclip<24>(d - i); } inline unsigned operator *= (unsigned i) { return d = uclip<24>(d * i); } inline unsigned operator /= (unsigned i) { return d = uclip<24>(d / i); } inline unsigned operator %= (unsigned i) { return d = uclip<24>(d % i); } reg24_t() : d(0) {} }; struct regs_t { reg24_t pc; reg16_t r[6], &a, &x, &y, &z, &s, &d; flag_t p; uint8 db; bool e; bool irq; //IRQ pin (0 = low, 1 = trigger) bool wai; //raised during wai, cleared after interrupt triggered uint8 mdr; //memory data register uint16 vector; //interrupt vector address regs_t(): a(r[0]), x(r[1]), y(r[2]), z(r[3]), s(r[4]), d(r[5]), db(0), e(false), irq(false), wai(false), mdr(0), vector(0) { z = 0; } }; phoenix/gtk/browser-window.cpp000664 001750 001750 00000005366 12651764221 017655 0ustar00sergiosergio000000 000000 namespace phoenix { static void BrowserWindow_addFilters(GtkWidget* dialog, lstring filters) { for(auto& filter : filters) { GtkFileFilter* gtkFilter = gtk_file_filter_new(); gtk_file_filter_set_name(gtkFilter, filter); lstring patterns = filter.split<1>("(")(1).rtrim<1>(")").split(","); for(auto& pattern : patterns) gtk_file_filter_add_pattern(gtkFilter, pattern.strip()); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), gtkFilter); } } string pBrowserWindow::directory(BrowserWindow::State& state) { string name; GtkWidget* dialog = gtk_file_chooser_dialog_new( state.title ? state.title : "Select Directory", state.parent ? GTK_WINDOW(state.parent->p.widget) : (GtkWindow*)nullptr, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, (const gchar*)nullptr ); if(state.path) gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), state.path); if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { char* temp = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); name = temp; g_free(temp); } gtk_widget_destroy(dialog); if(name && !name.endsWith("/")) name.append("/"); return name; } string pBrowserWindow::open(BrowserWindow::State& state) { string name; GtkWidget* dialog = gtk_file_chooser_dialog_new( state.title ? state.title : "Open File", state.parent ? GTK_WINDOW(state.parent->p.widget) : (GtkWindow*)nullptr, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, (const gchar*)nullptr ); if(state.path) gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), state.path); BrowserWindow_addFilters(dialog, state.filters); if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { char* temp = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); name = temp; g_free(temp); } gtk_widget_destroy(dialog); return name; } string pBrowserWindow::save(BrowserWindow::State& state) { string name; GtkWidget* dialog = gtk_file_chooser_dialog_new( state.title ? state.title : "Save File", state.parent ? GTK_WINDOW(state.parent->p.widget) : (GtkWindow*)nullptr, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, (const gchar*)nullptr ); if(state.path) gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), state.path); BrowserWindow_addFilters(dialog, state.filters); if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { char* temp = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); name = temp; g_free(temp); } gtk_widget_destroy(dialog); return name; } } ananke/super-famicom.cpp000664 001750 001750 00000020224 12651764221 016420 0ustar00sergiosergio000000 000000 void Ananke::copySuperFamicomSaves(const string &pathname) { if(!file::exists({pathname, "save.ram"})) { if(file::exists({information.path, nall::basename(information.name), ".srm"})) { file::copy({information.path, nall::basename(information.name), ".srm"}, {pathname, "save.ram"}); } } if(!file::exists({pathname, "rtc.ram"})) { if(file::exists({information.path, nall::basename(information.name), ".rtc"})) { file::copy({information.path, nall::basename(information.name), ".rtc"}, {pathname, "rtc.ram"}); } } } string Ananke::createSuperFamicomDatabase(vector &buffer, Markup::Node &document, const string &manifest) { string pathname = { libraryPath, "Super Famicom/", document["release/information/name"].text(), " (", document["release/information/region"].text(), ")", " (", document["release/information/revision"].text(), ")", ".sfc/" }; directory::create(pathname); //strip "release" root node from database entry (since a single game manifest isn't part of a database) string markup = manifest; markup.replace("\n ", "\n"); markup.replace("information", "\ninformation"); markup.ltrim<1>("release\n"); file::write({pathname, "manifest.bml"}, markup); unsigned offset = 0; for(auto &node : document["release/information/configuration"]) { if(node.name != "rom") continue; string name = node["name"].text(); unsigned size = node["size"].decimal(); file::write({pathname, name}, buffer.data() + offset, size); offset += size; } copySuperFamicomSaves(pathname); return pathname; } string Ananke::createSuperFamicomHeuristic(vector &buffer) { string pathname = { libraryPath, "Super Famicom/", nall::basename(information.name), ".sfc/" }; directory::create(pathname); if((buffer.size() & 0x7fff) == 512) buffer.remove(0, 512); //strip copier header, if present SuperFamicomCartridge info(buffer.data(), buffer.size()); string markup = {"unverified\n\n", info.markup}; markup.append("\ninformation\n title: ", nall::basename(information.name), "\n"); if(!information.manifest.empty()) markup = information.manifest; //override with embedded beat manifest, if one exists information.manifest = markup; //save for use with firmware routine below file::write({pathname, "manifest.bml"}, markup); if(!markup.find("spc7110")) { file::write({pathname, "program.rom"}, buffer.data(), info.rom_size); } else { file::write({pathname, "program.rom"}, buffer.data(), 0x100000); file::write({pathname, "data.rom"}, buffer.data() + 0x100000, info.rom_size - 0x100000); } createSuperFamicomHeuristicFirmware(buffer, pathname, info.firmware_appended); copySuperFamicomSaves(pathname); return pathname; } void Ananke::createSuperFamicomHeuristicFirmware(vector &buffer, const string &pathname, bool firmware_appended) { auto copyFirmwareInternal = [&](const string &name, unsigned programSize, unsigned dataSize, unsigned bootSize) { //firmware appended directly onto .sfc file string basename = nall::basename(name); if(programSize) file::write({pathname, basename, ".program.rom"}, buffer.data() + buffer.size() - programSize - dataSize - bootSize, programSize); if(dataSize) file::write({pathname, basename, ".data.rom"}, buffer.data() + buffer.size() - dataSize - bootSize, dataSize); if(bootSize) file::write({pathname, basename, ".boot.rom"}, buffer.data() + buffer.size() - bootSize, bootSize); }; auto copyFirmwareExternal = [&](const string &name, unsigned programSize, unsigned dataSize, unsigned bootSize) { //firmware stored in external file auto buffer = file::read({information.path, name}); //try and read from the containing directory if(buffer.size() == 0) buffer = extractFile(name); //try and read from the containing archive, if one exists if(buffer.size() == 0) { if(thread::primary()) MessageWindow().setText({ "Error: ", information.name, "\n\n", "Required firmware ", name, " not found. Game will not be playable!\n\n", "You must obtain this file, and place it in the same folder as this game." }).error(); return; } string basename = nall::basename(name); if(programSize) file::write({pathname, basename, ".program.rom"}, buffer.data(), programSize); if(dataSize) file::write({pathname, basename, ".data.rom"}, buffer.data() + programSize, dataSize); if(bootSize) file::write({pathname, basename, ".boot.rom"}, buffer.data() + programSize + dataSize, bootSize); }; auto copyFirmware = [&](const string &name, unsigned programSize, unsigned dataSize, unsigned bootSize = 0) { if(firmware_appended == 1) copyFirmwareInternal(name, programSize, dataSize, bootSize); if(firmware_appended == 0) copyFirmwareExternal(name, programSize, dataSize, bootSize); }; string markup = information.manifest; if(markup.find("dsp1.program.rom" )) copyFirmware("dsp1.rom", 0x001800, 0x000800); if(markup.find("dsp1b.program.rom")) copyFirmware("dsp1b.rom", 0x001800, 0x000800); if(markup.find("dsp2.program.rom" )) copyFirmware("dsp2.rom", 0x001800, 0x000800); if(markup.find("dsp3.program.rom" )) copyFirmware("dsp3.rom", 0x001800, 0x000800); if(markup.find("dsp4.program.rom" )) copyFirmware("dsp4.rom", 0x001800, 0x000800); if(markup.find("st010.program.rom")) copyFirmware("st010.rom", 0x00c000, 0x001000); if(markup.find("st011.program.rom")) copyFirmware("st011.rom", 0x00c000, 0x001000); if(markup.find("st018.program.rom")) copyFirmware("st018.rom", 0x020000, 0x008000); if(markup.find("cx4.data.rom" )) copyFirmware("cx4.rom", 0x000000, 0x000c00); if(markup.find("sgb.boot.rom" )) copyFirmware("sgb.rom", 0x000000, 0x000000, 0x000100); } string Ananke::openSuperFamicom(vector &buffer) { string sha256 = nall::sha256(buffer.data(), buffer.size()); string databaseText = string::read({configpath(), "ananke/database/Super Famicom.bml"}).strip(); if(databaseText.empty()) databaseText = string{Database::SuperFamicom}.strip(); lstring databaseItem = databaseText.split("\n\n"); for(auto &item : databaseItem) { item.append("\n"); auto document = Markup::Document(item); if(document["release/information/sha256"].text() == sha256) { return createSuperFamicomDatabase(buffer, document, item); } } return createSuperFamicomHeuristic(buffer); } string Ananke::syncSuperFamicom(const string &pathname) { if(file::exists({pathname, "msu1.rom"})) return ""; //cannot update MSU1 games vector buffer; auto append = [&](string filename) { filename = {pathname, filename}; auto data = file::read(filename); if(data.size() == 0) return; //file does not exist unsigned position = buffer.size(); buffer.resize(buffer.size() + data.size()); memcpy(buffer.data() + position, data.data(), data.size()); }; append("program.rom"); append("data.rom"); append("dsp1.rom"); append("dsp1.program.rom"); append("dsp1.data.rom"); append("dsp1b.rom"); append("dsp1b.program.rom"); append("dsp1b.data.rom"); append("dsp2.rom"); append("dsp2.program.rom"); append("dsp2.data.rom"); append("dsp3.rom"); append("dsp3.program.rom"); append("dsp3.data.rom"); append("dsp4.rom"); append("dsp4.program.rom"); append("dsp4.data.rom"); append("st010.rom"); append("st010.program.rom"); append("st010.data.rom"); append("st011.rom"); append("st011.program.rom"); append("st011.data.rom"); append("st018.rom"); append("st018.program.rom"); append("st018.data.rom"); append("cx4.rom"); append("cx4.data.rom"); append("sgb.rom"); append("sgb.boot.rom"); if(buffer.size() == 0) return ""; auto save = file::read({pathname, "save.ram"}); if(save.size() == 0) save = file::read({pathname, "save.rwm"}); auto rtc = file::read({pathname, "rtc.ram"}); if(rtc.size() == 0) rtc= file::read({pathname, "rtc.rwm"}); directory::remove(pathname); information.path = pathname; information.name = notdir(string{pathname}.rtrim<1>("/")); string outputPath = openSuperFamicom(buffer); if(save.size()) file::write({outputPath, "save.ram"}, save); if(rtc.size()) file::write({outputPath, "rtc.ram"}, save); return outputPath; } target-ethos/ethos.cpp000664 001750 001750 00000010232 12651764221 016142 0ustar00sergiosergio000000 000000 #include "ethos.hpp" #include "bootstrap.cpp" #include "resource/resource.cpp" Program* program = nullptr; DSP dspaudio; Emulator::Interface& system() { if(program->active == nullptr) throw; return *program->active; } bool Program::focused() { return config->input.focus.allow || presentation->focused(); } string Program::path(string name) { string path = {basepath, name}; if(file::exists(path) || directory::exists(path)) return path; path = {userpath, name}; if(file::exists(path) || directory::exists(path)) return path; path = {sharedpath, name}; if(file::exists(path) || directory::exists(path)) return path; return {userpath, name}; } void Program::main() { inputManager->poll(); utility->updateStatus(); autopause = config->input.focus.pause && presentation->focused() == false; if(active == nullptr || system().loaded() == false || pause || autopause) { audio.clear(); usleep(20 * 1000); return; } system().run(); } Program::Program(int argc, char** argv) { ananke.open("ananke"); program = this; pause = false; autopause = false; basepath = dir(realpath(argv[0])); userpath = {nall::configpath(), "higan/"}; sharedpath = {nall::sharedpath(), "higan/"}; directory::create(userpath); bootstrap(); active = nullptr; normalFont = Font::sans(8); boldFont = Font::sans(8, "Bold"); titleFont = Font::sans(16, "Bold"); monospaceFont = Font::monospace(8); config = new ConfigurationSettings; video.driver(config->video.driver); audio.driver(config->audio.driver); input.driver(config->input.driver); utility = new Utility; inputManager = new InputManager; windowManager = new WindowManager; libraryManager = new LibraryManager; presentation = new Presentation; dipSwitches = new DipSwitches; videoSettings = new VideoSettings; audioSettings = new AudioSettings; inputSettings = new InputSettings; hotkeySettings = new HotkeySettings; timingSettings = new TimingSettings; serverSettings = new ServerSettings; advancedSettings = new AdvancedSettings; settings = new Settings; cheatDatabase = new CheatDatabase; cheatEditor = new CheatEditor; stateManager = new StateManager; tools = new Tools; windowManager->loadGeometry(); presentation->setVisible(); utility->resize(); if(argc == 1 && config->library.showOnStartup) libraryManager->show(); video.set(Video::Handle, presentation->viewport.handle()); if(!video.cap(Video::Depth) || !video.set(Video::Depth, depth = 30u)) { video.set(Video::Depth, depth = 24u); } if(video.init() == false) { video.driver("None"); video.init(); } audio.set(Audio::Handle, presentation->viewport.handle()); if(audio.init() == false) { audio.driver("None"); audio.init(); } input.set(Input::Handle, presentation->viewport.handle()); if(input.init() == false) { input.driver("None"); input.init(); } dspaudio.setPrecision(16); dspaudio.setBalance(0.0); dspaudio.setFrequency(96000); utility->synchronizeRuby(); utility->updateShader(); if(config->video.startFullScreen && argc >= 2) utility->toggleFullScreen(); Application::processEvents(); if(argc >= 2) utility->loadMedia(argv[1]); Application::main = {&Program::main, this}; Application::run(); utility->unload(); config->save(); inputManager->saveConfiguration(); windowManager->saveGeometry(); ananke.close(); } int main(int argc, char** argv) { #if defined(PLATFORM_WINDOWS) utf8_args(argc, argv); #endif Application::setName("higan"); Application::Windows::onModalBegin = [&] { audio.clear(); }; Application::Cocoa::onActivate = [&] { presentation->setVisible(); }; Application::Cocoa::onAbout = [&] { MessageWindow() .setTitle({"About ", Emulator::Name}) .setText({ Emulator::Name, " v", Emulator::Version, "\n", Emulator::Profile, " Profile\n", "Author: ", Emulator::Author, "\n", "License: ", Emulator::License, "\n", "Website: ", Emulator::Website }) .information(); }; Application::Cocoa::onPreferences = [&] { settings->setVisible(); }; Application::Cocoa::onQuit = [&] { Application::quit(); }; new Program(argc, argv); delete program; return 0; } target-ethos/interface/interface.hpp000664 001750 001750 00000001415 12651764221 020730 0ustar00sergiosergio000000 000000 struct Interface : Emulator::Interface::Bind { void loadRequest(unsigned id, string name, string type); void loadRequest(unsigned id, string path); void saveRequest(unsigned id, string path); uint32_t videoColor(unsigned source, uint16_t alpha, uint16_t red, uint16_t green, uint16_t blue); void videoRefresh(const uint32_t* palette, const uint32_t* data, unsigned pitch, unsigned width, unsigned height); void audioSample(int16_t lsample, int16_t rsample); int16_t inputPoll(unsigned port, unsigned device, unsigned input); void inputRumble(unsigned port, unsigned device, unsigned input, bool enable); unsigned dipSettings(const Markup::Node& node); string path(unsigned group); string server(); void notify(string text); }; extern Interface* interface; target-libretro/jni/000700 001750 001750 00000000000 12656700342 015561 5ustar00sergiosergio000000 000000 sfc/chip/superfx/bus/bus.hpp000664 001750 001750 00000000347 12651764221 017201 0ustar00sergiosergio000000 000000 struct CPUROM : Memory { unsigned size() const; uint8 read(unsigned); void write(unsigned, uint8); } cpurom; struct CPURAM : Memory { unsigned size() const; uint8 read(unsigned); void write(unsigned, uint8); } cpuram; sfc/chip/superfx/timing/timing.hpp000664 001750 001750 00000000574 12651764221 020377 0ustar00sergiosergio000000 000000 unsigned cache_access_speed; unsigned memory_access_speed; bool r15_modified; void step(unsigned clocks); void rombuffer_sync(); void rombuffer_update(); uint8 rombuffer_read(); void rambuffer_sync(); uint8 rambuffer_read(uint16 addr); void rambuffer_write(uint16 addr, uint8 data); void r14_modify(uint16); void r15_modify(uint16); void update_speed(); void timing_reset(); fc/ppu/ppu.cpp000664 001750 001750 00000031502 12651764221 014415 0ustar00sergiosergio000000 000000 #include namespace Famicom { #include "serialization.cpp" PPU ppu; void PPU::Main() { ppu.main(); } void PPU::main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::PPU) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } raster_scanline(); } } void PPU::tick() { if(status.ly == 240 && status.lx == 340) status.nmi_hold = 1; if(status.ly == 241 && status.lx == 0) status.nmi_flag = status.nmi_hold; if(status.ly == 241 && status.lx == 2) cpu.set_nmi_line(status.nmi_enable && status.nmi_flag); if(status.ly == 260 && status.lx == 340) status.sprite_zero_hit = 0, status.sprite_overflow = 0; if(status.ly == 260 && status.lx == 340) status.nmi_hold = 0; if(status.ly == 261 && status.lx == 0) status.nmi_flag = status.nmi_hold; if(status.ly == 261 && status.lx == 2) cpu.set_nmi_line(status.nmi_enable && status.nmi_flag); clock += 4; if(clock >= 0) co_switch(cpu.thread); status.lx++; } void PPU::scanline() { status.lx = 0; if(++status.ly == 262) { status.ly = 0; frame(); } cartridge.scanline(status.ly); } void PPU::frame() { status.field ^= 1; scheduler.exit(Scheduler::ExitReason::FrameEvent); } void PPU::power() { } void PPU::reset() { create(PPU::Main, 21477272); status.mdr = 0x00; status.field = 0; status.ly = 0; status.bus_data = 0x00; status.address_latch = 0; status.vaddr = 0x0000; status.taddr = 0x0000; status.xaddr = 0x00; status.nmi_hold = 0; status.nmi_flag = 0; //$2000 status.nmi_enable = false; status.master_select = 0; status.sprite_size = 0; status.bg_addr = 0x0000; status.sprite_addr = 0x0000; status.vram_increment = 1; //$2001 status.emphasis = 0; status.sprite_enable = false; status.bg_enable = false; status.sprite_edge_enable = false; status.bg_edge_enable = false; status.grayscale = false; //$2002 status.sprite_zero_hit = false; status.sprite_overflow = false; //$2003 status.oam_addr = 0x00; for(auto& n : buffer) n = 0; for(auto& n : ciram ) n = 0; for(auto& n : cgram ) n = 0; for(auto& n : oam ) n = 0; } uint8 PPU::read(uint16 addr) { uint8 result = 0x00; switch(addr & 7) { case 2: //PPUSTATUS result |= status.nmi_flag << 7; result |= status.sprite_zero_hit << 6; result |= status.sprite_overflow << 5; result |= status.mdr & 0x1f; status.address_latch = 0; status.nmi_hold = 0; cpu.set_nmi_line(status.nmi_flag = 0); break; case 4: //OAMDATA result = oam[status.oam_addr]; if((status.oam_addr & 3) == 3) result &= 0xe3; break; case 7: //PPUDATA if(raster_enable() && (status.ly <= 240 || status.ly == 261)) return 0x00; addr = status.vaddr & 0x3fff; if(addr <= 0x1fff) { result = status.bus_data; status.bus_data = cartridge.chr_read(addr); } else if(addr <= 0x3eff) { result = status.bus_data; status.bus_data = cartridge.chr_read(addr); } else if(addr <= 0x3fff) { result = cgram_read(addr); status.bus_data = cartridge.chr_read(addr); } status.vaddr += status.vram_increment; break; } return result; } void PPU::write(uint16 addr, uint8 data) { status.mdr = data; switch(addr & 7) { case 0: //PPUCTRL status.nmi_enable = data & 0x80; status.master_select = data & 0x40; status.sprite_size = data & 0x20; status.bg_addr = (data & 0x10) ? 0x1000 : 0x0000; status.sprite_addr = (data & 0x08) ? 0x1000 : 0x0000; status.vram_increment = (data & 0x04) ? 32 : 1; status.taddr = (status.taddr & 0x73ff) | ((data & 0x03) << 10); cpu.set_nmi_line(status.nmi_enable && status.nmi_hold && status.nmi_flag); return; case 1: //PPUMASK status.emphasis = data >> 5; status.sprite_enable = data & 0x10; status.bg_enable = data & 0x08; status.sprite_edge_enable = data & 0x04; status.bg_edge_enable = data & 0x02; status.grayscale = data & 0x01; return; case 2: //PPUSTATUS return; case 3: //OAMADDR status.oam_addr = data; return; case 4: //OAMDATA oam[status.oam_addr++] = data; return; case 5: //PPUSCROLL if(status.address_latch == 0) { status.xaddr = data & 0x07; status.taddr = (status.taddr & 0x7fe0) | (data >> 3); } else { status.taddr = (status.taddr & 0x0c1f) | ((data & 0x07) << 12) | ((data >> 3) << 5); } status.address_latch ^= 1; return; case 6: //PPUADDR if(status.address_latch == 0) { status.taddr = (status.taddr & 0x00ff) | ((data & 0x3f) << 8); } else { status.taddr = (status.taddr & 0x7f00) | data; status.vaddr = status.taddr; } status.address_latch ^= 1; return; case 7: //PPUDATA if(raster_enable() && (status.ly <= 240 || status.ly == 261)) return; addr = status.vaddr & 0x3fff; if(addr <= 0x1fff) { cartridge.chr_write(addr, data); } else if(addr <= 0x3eff) { cartridge.chr_write(addr, data); } else if(addr <= 0x3fff) { cgram_write(addr, data); } status.vaddr += status.vram_increment; return; } } uint8 PPU::ciram_read(uint16 addr) { return ciram[addr & 0x07ff]; } void PPU::ciram_write(uint16 addr, uint8 data) { ciram[addr & 0x07ff] = data; } uint8 PPU::cgram_read(uint16 addr) { if((addr & 0x13) == 0x10) addr &= ~0x10; uint8 data = cgram[addr & 0x1f]; if(status.grayscale) data &= 0x30; return data; } void PPU::cgram_write(uint16 addr, uint8 data) { if((addr & 0x13) == 0x10) addr &= ~0x10; cgram[addr & 0x1f] = data; } // //vaddr = 0yyy VHYY YYYX XXXX //yyy = fine Yscroll (y:d0-d2) //V = V nametable (y:d8) //H = H nametable (x:d8) //YYYYY = Y nametable (y:d3-d7) //XXXXX = X nametable (x:d3-d7) bool PPU::raster_enable() const { return (status.bg_enable || status.sprite_enable); } unsigned PPU::nametable_addr() const { return 0x2000 + (status.vaddr & 0x0c00); } unsigned PPU::scrollx() const { return ((status.vaddr & 0x1f) << 3) | status.xaddr; } unsigned PPU::scrolly() const { return (((status.vaddr >> 5) & 0x1f) << 3) | ((status.vaddr >> 12) & 7); } unsigned PPU::sprite_height() const { return status.sprite_size == 0 ? 8 : 16; } // uint8 PPU::chr_load(uint16 addr) { if(raster_enable() == false) return 0x00; return cartridge.chr_read(addr); } // void PPU::scrollx_increment() { if(raster_enable() == false) return; status.vaddr = (status.vaddr & 0x7fe0) | ((status.vaddr + 0x0001) & 0x001f); if((status.vaddr & 0x001f) == 0x0000) { status.vaddr ^= 0x0400; } } void PPU::scrolly_increment() { if(raster_enable() == false) return; status.vaddr = (status.vaddr & 0x0fff) | ((status.vaddr + 0x1000) & 0x7000); if((status.vaddr & 0x7000) == 0x0000) { status.vaddr = (status.vaddr & 0x7c1f) | ((status.vaddr + 0x0020) & 0x03e0); if((status.vaddr & 0x03e0) == 0x03c0) { //0x03c0 == 30 << 5; 30 * 8 = 240 status.vaddr &= 0x7c1f; status.vaddr ^= 0x0800; } } } // void PPU::raster_pixel() { uint32* output = buffer + status.ly * 256; unsigned mask = 0x8000 >> (status.xaddr + (status.lx & 7)); unsigned palette = 0, object_palette = 0; bool object_priority = 0; palette |= (raster.tiledatalo & mask) ? 1 : 0; palette |= (raster.tiledatahi & mask) ? 2 : 0; if(palette) { unsigned attr = raster.attribute; if(mask >= 256) attr >>= 2; palette |= (attr & 3) << 2; } if(status.bg_enable == false) palette = 0; if(status.bg_edge_enable == false && status.lx < 8) palette = 0; if(status.sprite_enable == true) for(signed sprite = 7; sprite >= 0; sprite--) { if(status.sprite_edge_enable == false && status.lx < 8) continue; if(raster.oam[sprite].id == 64) continue; unsigned spritex = status.lx - raster.oam[sprite].x; if(spritex >= 8) continue; if(raster.oam[sprite].attr & 0x40) spritex ^= 7; unsigned mask = 0x80 >> spritex; unsigned sprite_palette = 0; sprite_palette |= (raster.oam[sprite].tiledatalo & mask) ? 1 : 0; sprite_palette |= (raster.oam[sprite].tiledatahi & mask) ? 2 : 0; if(sprite_palette == 0) continue; if(raster.oam[sprite].id == 0 && palette && status.lx != 255) status.sprite_zero_hit = 1; sprite_palette |= (raster.oam[sprite].attr & 3) << 2; object_priority = raster.oam[sprite].attr & 0x20; object_palette = 16 + sprite_palette; } if(object_palette) { if(palette == 0 || object_priority == 0) palette = object_palette; } if(raster_enable() == false) palette = 0; output[status.lx] = (status.emphasis << 6) | cgram_read(palette); } void PPU::raster_sprite() { if(raster_enable() == false) return; unsigned n = raster.oam_iterator++; signed ly = (status.ly == 261 ? -1 : status.ly); unsigned y = ly - oam[(n * 4) + 0]; if(y >= sprite_height()) return; if(raster.oam_counter == 8) { status.sprite_overflow = 1; return; } raster.soam[raster.oam_counter].id = n; raster.soam[raster.oam_counter].y = oam[(n * 4) + 0]; raster.soam[raster.oam_counter].tile = oam[(n * 4) + 1]; raster.soam[raster.oam_counter].attr = oam[(n * 4) + 2]; raster.soam[raster.oam_counter].x = oam[(n * 4) + 3]; raster.oam_counter++; } void PPU::raster_scanline() { if((status.ly >= 240 && status.ly <= 260)) { for(unsigned x = 0; x < 341; x++) tick(); return scanline(); } raster.oam_iterator = 0; raster.oam_counter = 0; for(unsigned n = 0; n < 8; n++) { raster.soam[n].id = 64; raster.soam[n].y = 0xff; raster.soam[n].tile = 0xff; raster.soam[n].attr = 0xff; raster.soam[n].x = 0xff; raster.soam[n].tiledatalo = 0; raster.soam[n].tiledatahi = 0; } for(unsigned tile = 0; tile < 32; tile++) { // 0-255 unsigned nametable = chr_load(0x2000 | (status.vaddr & 0x0fff)); unsigned tileaddr = status.bg_addr + (nametable << 4) + (scrolly() & 7); raster_pixel(); tick(); raster_pixel(); tick(); unsigned attribute = chr_load(0x23c0 | (status.vaddr & 0x0fc0) | ((scrolly() >> 5) << 3) | (scrollx() >> 5)); if(scrolly() & 16) attribute >>= 4; if(scrollx() & 16) attribute >>= 2; raster_pixel(); tick(); scrollx_increment(); if(tile == 31) scrolly_increment(); raster_pixel(); raster_sprite(); tick(); unsigned tiledatalo = chr_load(tileaddr + 0); raster_pixel(); tick(); raster_pixel(); tick(); unsigned tiledatahi = chr_load(tileaddr + 8); raster_pixel(); tick(); raster_pixel(); raster_sprite(); tick(); raster.nametable = (raster.nametable << 8) | nametable; raster.attribute = (raster.attribute << 2) | (attribute & 3); raster.tiledatalo = (raster.tiledatalo << 8) | tiledatalo; raster.tiledatahi = (raster.tiledatahi << 8) | tiledatahi; } for(unsigned n = 0; n < 8; n++) raster.oam[n] = raster.soam[n]; for(unsigned sprite = 0; sprite < 8; sprite++) { //256-319 unsigned nametable = chr_load(0x2000 | (status.vaddr & 0x0fff)); tick(); if(raster_enable() && sprite == 0) status.vaddr = (status.vaddr & 0x7be0) | (status.taddr & 0x041f); //257 tick(); unsigned attribute = chr_load(0x23c0 | (status.vaddr & 0x0fc0) | ((scrolly() >> 5) << 3) | (scrollx() >> 5)); unsigned tileaddr = (sprite_height() == 8) ? status.sprite_addr + raster.oam[sprite].tile * 16 : ((raster.oam[sprite].tile & ~1) * 16) + ((raster.oam[sprite].tile & 1) * 0x1000); tick(); tick(); unsigned spritey = (status.ly - raster.oam[sprite].y) & (sprite_height() - 1); if(raster.oam[sprite].attr & 0x80) spritey ^= (sprite_height() - 1); tileaddr += spritey + (spritey & 8); raster.oam[sprite].tiledatalo = chr_load(tileaddr + 0); tick(); tick(); raster.oam[sprite].tiledatahi = chr_load(tileaddr + 8); tick(); tick(); if(raster_enable() && sprite == 6 && status.ly == 261) status.vaddr = status.taddr; //304 } for(unsigned tile = 0; tile < 2; tile++) { //320-335 unsigned nametable = chr_load(0x2000 | (status.vaddr & 0x0fff)); unsigned tileaddr = status.bg_addr + (nametable << 4) + (scrolly() & 7); tick(); tick(); unsigned attribute = chr_load(0x23c0 | (status.vaddr & 0x0fc0) | ((scrolly() >> 5) << 3) | (scrollx() >> 5)); if(scrolly() & 16) attribute >>= 4; if(scrollx() & 16) attribute >>= 2; tick(); scrollx_increment(); tick(); unsigned tiledatalo = chr_load(tileaddr + 0); tick(); tick(); unsigned tiledatahi = chr_load(tileaddr + 8); tick(); tick(); raster.nametable = (raster.nametable << 8) | nametable; raster.attribute = (raster.attribute << 2) | (attribute & 3); raster.tiledatalo = (raster.tiledatalo << 8) | tiledatalo; raster.tiledatahi = (raster.tiledatahi << 8) | tiledatahi; } //336-339 chr_load(0x2000 | (status.vaddr & 0x0fff)); tick(); bool skip = (raster_enable() && status.field == 1 && status.ly == 261); tick(); chr_load(0x2000 | (status.vaddr & 0x0fff)); tick(); tick(); //340 if(skip == false) tick(); return scanline(); } } sfc/chip/sdd1/sdd1.hpp000664 001750 001750 00000001536 12651764221 015612 0ustar00sergiosergio000000 000000 struct SDD1 { MappedRAM rom; MappedRAM ram; void init(); void load(); void unload(); void power(); void reset(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); uint8 mmc_read(unsigned addr); uint8 mcurom_read(unsigned addr); void mcurom_write(unsigned addr, uint8 data); uint8 mcuram_read(unsigned addr); void mcuram_write(unsigned addr, uint8 data); void serialize(serializer&); private: uint8 sdd1_enable; //channel bit-mask uint8 xfer_enable; //channel bit-mask bool dma_ready; //used to initialize decompression module unsigned mmc[4]; //memory map controller ROM indices struct { unsigned addr; //$43x2-$43x4 -- DMA transfer address uint16 size; //$43x5-$43x6 -- DMA transfer size } dma[8]; public: #include "decomp.hpp" Decomp decomp; }; extern SDD1 sdd1; nall/varint.hpp000664 001750 001750 00000020557 12651764221 014663 0ustar00sergiosergio000000 000000 #ifndef NALL_VARINT_HPP #define NALL_VARINT_HPP #include #include #include #include namespace nall { struct varint { virtual uint8_t read() = 0; virtual void write(uint8_t) = 0; uintmax_t readvu() { uintmax_t data = 0, shift = 1; while(true) { uint8_t x = read(); data += (x & 0x7f) * shift; if(x & 0x80) break; shift <<= 7; data += shift; } return data; } intmax_t readvs() { uintmax_t data = readvu(); bool sign = data & 1; data >>= 1; if(sign) data = -data; return data; } void writevu(uintmax_t data) { while(true) { uint8_t x = data & 0x7f; data >>= 7; if(data == 0) return write(0x80 | x); write(x); data--; } } void writevs(intmax_t data) { bool sign = data < 0; if(sign) data = -data; data = (data << 1) | sign; writevu(data); } }; template struct uint_t { private: typedef typename type_if::type type_t; type_t data; public: inline operator type_t() const { return data; } inline type_t operator ++(int) { type_t r = data; data = uclip(data + 1); return r; } inline type_t operator --(int) { type_t r = data; data = uclip(data - 1); return r; } inline type_t operator ++() { return data = uclip(data + 1); } inline type_t operator --() { return data = uclip(data - 1); } inline type_t operator =(const type_t i) { return data = uclip(i); } inline type_t operator |=(const type_t i) { return data = uclip(data | i); } inline type_t operator ^=(const type_t i) { return data = uclip(data ^ i); } inline type_t operator &=(const type_t i) { return data = uclip(data & i); } inline type_t operator<<=(const type_t i) { return data = uclip(data << i); } inline type_t operator>>=(const type_t i) { return data = uclip(data >> i); } inline type_t operator +=(const type_t i) { return data = uclip(data + i); } inline type_t operator -=(const type_t i) { return data = uclip(data - i); } inline type_t operator *=(const type_t i) { return data = uclip(data * i); } inline type_t operator /=(const type_t i) { return data = uclip(data / i); } inline type_t operator %=(const type_t i) { return data = uclip(data % i); } inline uint_t() : data(0) {} inline uint_t(const type_t i) : data(uclip(i)) {} template inline type_t operator=(const uint_t &i) { return data = uclip((type_t)i); } template inline uint_t(const uint_t &i) : data(uclip(i)) {} void serialize(serializer& s) { s(data); } }; template struct int_t { private: typedef typename type_if::type type_t; type_t data; public: inline operator type_t() const { return data; } inline type_t operator ++(int) { type_t r = data; data = sclip(data + 1); return r; } inline type_t operator --(int) { type_t r = data; data = sclip(data - 1); return r; } inline type_t operator ++() { return data = sclip(data + 1); } inline type_t operator --() { return data = sclip(data - 1); } inline type_t operator =(const type_t i) { return data = sclip(i); } inline type_t operator |=(const type_t i) { return data = sclip(data | i); } inline type_t operator ^=(const type_t i) { return data = sclip(data ^ i); } inline type_t operator &=(const type_t i) { return data = sclip(data & i); } inline type_t operator<<=(const type_t i) { return data = sclip(data << i); } inline type_t operator>>=(const type_t i) { return data = sclip(data >> i); } inline type_t operator +=(const type_t i) { return data = sclip(data + i); } inline type_t operator -=(const type_t i) { return data = sclip(data - i); } inline type_t operator *=(const type_t i) { return data = sclip(data * i); } inline type_t operator /=(const type_t i) { return data = sclip(data / i); } inline type_t operator %=(const type_t i) { return data = sclip(data % i); } inline int_t() : data(0) {} inline int_t(const type_t i) : data(sclip(i)) {} template inline type_t operator=(const int_t &i) { return data = sclip((type_t)i); } template inline int_t(const int_t &i) : data(sclip(i)) {} void serialize(serializer& s) { s(data); } }; template struct varuint_t { private: type_t data; type_t mask; public: inline operator type_t() const { return data; } inline type_t operator ++(int) { type_t r = data; data = (data + 1) & mask; return r; } inline type_t operator --(int) { type_t r = data; data = (data - 1) & mask; return r; } inline type_t operator ++() { return data = (data + 1) & mask; } inline type_t operator --() { return data = (data - 1) & mask; } inline type_t operator =(const type_t i) { return data = (i) & mask; } inline type_t operator |=(const type_t i) { return data = (data | i) & mask; } inline type_t operator ^=(const type_t i) { return data = (data ^ i) & mask; } inline type_t operator &=(const type_t i) { return data = (data & i) & mask; } inline type_t operator<<=(const type_t i) { return data = (data << i) & mask; } inline type_t operator>>=(const type_t i) { return data = (data >> i) & mask; } inline type_t operator +=(const type_t i) { return data = (data + i) & mask; } inline type_t operator -=(const type_t i) { return data = (data - i) & mask; } inline type_t operator *=(const type_t i) { return data = (data * i) & mask; } inline type_t operator /=(const type_t i) { return data = (data / i) & mask; } inline type_t operator %=(const type_t i) { return data = (data % i) & mask; } inline void bits(type_t bits) { mask = (1ull << (bits - 1)) + ((1ull << (bits - 1)) - 1); data &= mask; } inline varuint_t() : data(0ull), mask((type_t)~0ull) {} inline varuint_t(const type_t i) : data(i), mask((type_t)~0ull) {} void serialize(serializer& s) { s(data); s(mask); } }; } //typedefs typedef nall::uint_t< 1> uint1_t; typedef nall::uint_t< 2> uint2_t; typedef nall::uint_t< 3> uint3_t; typedef nall::uint_t< 4> uint4_t; typedef nall::uint_t< 5> uint5_t; typedef nall::uint_t< 6> uint6_t; typedef nall::uint_t< 7> uint7_t; //typedef nall::uint_t< 8> uint8_t; typedef nall::uint_t< 9> uint9_t; typedef nall::uint_t<10> uint10_t; typedef nall::uint_t<11> uint11_t; typedef nall::uint_t<12> uint12_t; typedef nall::uint_t<13> uint13_t; typedef nall::uint_t<14> uint14_t; typedef nall::uint_t<15> uint15_t; //typedef nall::uint_t<16> uint16_t; typedef nall::uint_t<17> uint17_t; typedef nall::uint_t<18> uint18_t; typedef nall::uint_t<19> uint19_t; typedef nall::uint_t<20> uint20_t; typedef nall::uint_t<21> uint21_t; typedef nall::uint_t<22> uint22_t; typedef nall::uint_t<23> uint23_t; typedef nall::uint_t<24> uint24_t; typedef nall::uint_t<25> uint25_t; typedef nall::uint_t<26> uint26_t; typedef nall::uint_t<27> uint27_t; typedef nall::uint_t<28> uint28_t; typedef nall::uint_t<29> uint29_t; typedef nall::uint_t<30> uint30_t; typedef nall::uint_t<31> uint31_t; //typedef nall::uint_t<32> uint32_t; typedef nall::int_t< 1> int1_t; typedef nall::int_t< 2> int2_t; typedef nall::int_t< 3> int3_t; typedef nall::int_t< 4> int4_t; typedef nall::int_t< 5> int5_t; typedef nall::int_t< 6> int6_t; typedef nall::int_t< 7> int7_t; //typedef nall::int_t< 8> int8_t; typedef nall::int_t< 9> int9_t; typedef nall::int_t<10> int10_t; typedef nall::int_t<11> int11_t; typedef nall::int_t<12> int12_t; typedef nall::int_t<13> int13_t; typedef nall::int_t<14> int14_t; typedef nall::int_t<15> int15_t; //typedef nall::int_t<16> int16_t; typedef nall::int_t<17> int17_t; typedef nall::int_t<18> int18_t; typedef nall::int_t<19> int19_t; typedef nall::int_t<20> int20_t; typedef nall::int_t<21> int21_t; typedef nall::int_t<22> int22_t; typedef nall::int_t<23> int23_t; typedef nall::int_t<24> int24_t; typedef nall::int_t<25> int25_t; typedef nall::int_t<26> int26_t; typedef nall::int_t<27> int27_t; typedef nall::int_t<28> int28_t; typedef nall::int_t<29> int29_t; typedef nall::int_t<30> int30_t; typedef nall::int_t<31> int31_t; //typedef nall::int_t<32> int32_t; #endif gba/ppu/ppu.hpp000664 001750 001750 00000002362 12651764221 014565 0ustar00sergiosergio000000 000000 struct PPU : Thread, MMIO { uint8 vram[96 * 1024]; uint16 pram[512]; #include "registers.hpp" #include "state.hpp" uint32* output; static void Enter(); void main(); void step(unsigned clocks); void power(); void scanline(); void frame(); uint8 read(uint32 addr); void write(uint32 addr, uint8 byte); uint32 vram_read(uint32 addr, uint32 size); void vram_write(uint32 addr, uint32 size, uint32 word); uint32 pram_read(uint32 addr, uint32 size); void pram_write(uint32 addr, uint32 size, uint32 word); uint32 oam_read(uint32 addr, uint32 size); void oam_write(uint32 addr, uint32 size, uint32 word); void render_backgrounds(); void render_background_linear(Registers::Background&); void render_background_affine(Registers::Background&); void render_background_bitmap(Registers::Background&); void render_objects(); void render_object(Object&); uint8 object_vram_read(unsigned addr) const; void render_mosaic_background(unsigned id); void render_mosaic_object(); void render_forceblank(); void render_screen(); void render_window(unsigned window); unsigned blend(unsigned above, unsigned eva, unsigned below, unsigned evb); void serialize(serializer&); PPU(); ~PPU(); }; extern PPU ppu; sfc/alt/dsp/serialization.cpp000664 001750 001750 00000001302 12651764221 017406 0ustar00sergiosergio000000 000000 #ifdef DSP_CPP static void dsp_state_save(unsigned char **out, void *in, size_t size) { memcpy(*out, in, size); *out += size; } static void dsp_state_load(unsigned char **in, void *out, size_t size) { memcpy(out, *in, size); *in += size; } void DSP::serialize(serializer &s) { Thread::serialize(s); s.array(samplebuffer); unsigned char state[SPC_DSP::state_size]; unsigned char *p = state; memset(&state, 0, SPC_DSP::state_size); if(s.mode() == serializer::Save) { spc_dsp.copy_state(&p, dsp_state_save); s.array(state); } else if(s.mode() == serializer::Load) { s.array(state); spc_dsp.copy_state(&p, dsp_state_load); } else { s.array(state); } } #endif phoenix/reference/widget/radio-label.hpp000664 001750 001750 00000000502 12651764221 021464 0ustar00sergiosergio000000 000000 namespace phoenix { struct pRadioLabel : public pWidget { RadioLabel& radioLabel; void setChecked(); void setGroup(const group& group); void setText(string text); pRadioLabel(RadioLabel& radioLabel) : pWidget(radioLabel), radioLabel(radioLabel) {} void constructor(); void destructor(); }; } sfc/chip/icd2/mmio/000700 001750 001750 00000000000 12656700342 015153 5ustar00sergiosergio000000 000000 sfc/chip/superfx/bus/000700 001750 001750 00000000000 12656700342 015656 5ustar00sergiosergio000000 000000 sfc/cpu/000700 001750 001750 00000000000 12656700342 013235 5ustar00sergiosergio000000 000000 sfc/alt/ppu-performance/mmio/mmio.cpp000664 001750 001750 00000057444 12651764221 020772 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP void PPU::latch_counters() { regs.hcounter = cpu.hdot(); regs.vcounter = cpu.vcounter(); regs.counters_latched = true; } bool PPU::interlace() const { return display.interlace; } bool PPU::overscan() const { return display.overscan; } bool PPU::hires() const { return regs.pseudo_hires || regs.bgmode == 5 || regs.bgmode == 6; } uint16 PPU::get_vram_addr() { uint16 addr = regs.vram_addr; switch(regs.vram_mapping) { case 0: break; case 1: addr = (addr & 0xff00) | ((addr & 0x001f) << 3) | ((addr >> 5) & 7); break; case 2: addr = (addr & 0xfe00) | ((addr & 0x003f) << 3) | ((addr >> 6) & 7); break; case 3: addr = (addr & 0xfc00) | ((addr & 0x007f) << 3) | ((addr >> 7) & 7); break; } return (addr << 1); } uint8 PPU::vram_read(unsigned addr) { if(regs.display_disable) return vram[addr]; if(cpu.vcounter() >= display.height) return vram[addr]; return 0x00; } void PPU::vram_write(unsigned addr, uint8 data) { if(regs.display_disable || cpu.vcounter() >= display.height) { vram[addr] = data; cache.tilevalid[0][addr >> 4] = false; cache.tilevalid[1][addr >> 5] = false; cache.tilevalid[2][addr >> 6] = false; return; } } uint8 PPU::oam_read(unsigned addr) { if(addr & 0x0200) addr &= 0x021f; if(regs.display_disable) return oam[addr]; if(cpu.vcounter() >= display.height) return oam[addr]; return oam[0x0218]; } void PPU::oam_write(unsigned addr, uint8 data) { if(addr & 0x0200) addr &= 0x021f; if(!regs.display_disable && cpu.vcounter() < display.height) addr = 0x0218; oam[addr] = data; sprite.update_list(addr, data); } uint8 PPU::cgram_read(unsigned addr) { return cgram[addr]; } void PPU::cgram_write(unsigned addr, uint8 data) { cgram[addr] = data; } void PPU::mmio_update_video_mode() { switch(regs.bgmode) { case 0: { bg1.regs.mode = Background::Mode::BPP2; bg1.regs.priority0 = 8; bg1.regs.priority1 = 11; bg2.regs.mode = Background::Mode::BPP2; bg2.regs.priority0 = 7; bg2.regs.priority1 = 10; bg3.regs.mode = Background::Mode::BPP2; bg3.regs.priority0 = 2; bg3.regs.priority1 = 5; bg4.regs.mode = Background::Mode::BPP2; bg4.regs.priority0 = 1; bg4.regs.priority1 = 4; sprite.regs.priority0 = 3; sprite.regs.priority1 = 6; sprite.regs.priority2 = 9; sprite.regs.priority3 = 12; } break; case 1: { bg1.regs.mode = Background::Mode::BPP4; bg2.regs.mode = Background::Mode::BPP4; bg3.regs.mode = Background::Mode::BPP2; bg4.regs.mode = Background::Mode::Inactive; if(regs.bg3_priority) { bg1.regs.priority0 = 5; bg1.regs.priority1 = 8; bg2.regs.priority0 = 4; bg2.regs.priority1 = 7; bg3.regs.priority0 = 1; bg3.regs.priority1 = 10; sprite.regs.priority0 = 2; sprite.regs.priority1 = 3; sprite.regs.priority2 = 6; sprite.regs.priority3 = 9; } else { bg1.regs.priority0 = 6; bg1.regs.priority1 = 9; bg2.regs.priority0 = 5; bg2.regs.priority1 = 8; bg3.regs.priority0 = 1; bg3.regs.priority1 = 3; sprite.regs.priority0 = 2; sprite.regs.priority1 = 4; sprite.regs.priority2 = 7; sprite.regs.priority3 = 10; } } break; case 2: { bg1.regs.mode = Background::Mode::BPP4; bg2.regs.mode = Background::Mode::BPP4; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 3; bg1.regs.priority1 = 7; bg2.regs.priority0 = 1; bg2.regs.priority1 = 5; sprite.regs.priority0 = 2; sprite.regs.priority1 = 4; sprite.regs.priority2 = 6; sprite.regs.priority3 = 8; } break; case 3: { bg1.regs.mode = Background::Mode::BPP8; bg2.regs.mode = Background::Mode::BPP4; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 3; bg1.regs.priority1 = 7; bg2.regs.priority0 = 1; bg2.regs.priority1 = 5; sprite.regs.priority0 = 2; sprite.regs.priority1 = 4; sprite.regs.priority2 = 6; sprite.regs.priority3 = 8; } break; case 4: { bg1.regs.mode = Background::Mode::BPP8; bg2.regs.mode = Background::Mode::BPP2; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 3; bg1.regs.priority1 = 7; bg2.regs.priority0 = 1; bg2.regs.priority1 = 5; sprite.regs.priority0 = 2; sprite.regs.priority1 = 4; sprite.regs.priority2 = 6; sprite.regs.priority3 = 8; } break; case 5: { bg1.regs.mode = Background::Mode::BPP4; bg2.regs.mode = Background::Mode::BPP2; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 3; bg1.regs.priority1 = 7; bg2.regs.priority0 = 1; bg2.regs.priority1 = 5; sprite.regs.priority0 = 2; sprite.regs.priority1 = 4; sprite.regs.priority2 = 6; sprite.regs.priority3 = 8; } break; case 6: { bg1.regs.mode = Background::Mode::BPP4; bg2.regs.mode = Background::Mode::Inactive; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 2; bg1.regs.priority1 = 5; sprite.regs.priority0 = 1; sprite.regs.priority1 = 3; sprite.regs.priority2 = 4; sprite.regs.priority3 = 6; } break; case 7: { if(regs.mode7_extbg == false) { bg1.regs.mode = Background::Mode::Mode7; bg2.regs.mode = Background::Mode::Inactive; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 2; bg1.regs.priority1 = 2; sprite.regs.priority0 = 1; sprite.regs.priority1 = 3; sprite.regs.priority2 = 4; sprite.regs.priority3 = 5; } else { bg1.regs.mode = Background::Mode::Mode7; bg2.regs.mode = Background::Mode::Mode7; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 3; bg1.regs.priority1 = 3; bg2.regs.priority0 = 1; bg2.regs.priority1 = 5; sprite.regs.priority0 = 2; sprite.regs.priority1 = 4; sprite.regs.priority2 = 6; sprite.regs.priority3 = 7; } } break; } } uint8 PPU::mmio_read(unsigned addr) { cpu.synchronize_ppu(); switch(addr & 0xffff) { case 0x2104: case 0x2105: case 0x2106: case 0x2108: case 0x2109: case 0x210a: case 0x2114: case 0x2115: case 0x2116: case 0x2118: case 0x2119: case 0x211a: case 0x2124: case 0x2125: case 0x2126: case 0x2128: case 0x2129: case 0x212a: { return regs.ppu1_mdr; } case 0x2134: { //MPYL unsigned result = ((int16)regs.m7a * (int8)(regs.m7b >> 8)); regs.ppu1_mdr = result >> 0; return regs.ppu1_mdr; } case 0x2135: { //MPYM unsigned result = ((int16)regs.m7a * (int8)(regs.m7b >> 8)); regs.ppu1_mdr = result >> 8; return regs.ppu1_mdr; } case 0x2136: { //MPYH unsigned result = ((int16)regs.m7a * (int8)(regs.m7b >> 8)); regs.ppu1_mdr = result >> 16; return regs.ppu1_mdr; } case 0x2137: { //SLHV if(cpu.pio() & 0x80) latch_counters(); return cpu.regs.mdr; } case 0x2138: { //OAMDATAREAD regs.ppu1_mdr = oam_read(regs.oam_addr); regs.oam_addr = (regs.oam_addr + 1) & 0x03ff; sprite.set_first(); return regs.ppu1_mdr; } case 0x2139: { //VMDATALREAD regs.ppu1_mdr = regs.vram_readbuffer >> 0; if(regs.vram_incmode == 0) { uint16 addr = get_vram_addr(); regs.vram_readbuffer = vram_read(addr + 0) << 0; regs.vram_readbuffer |= vram_read(addr + 1) << 8; regs.vram_addr += regs.vram_incsize; } return regs.ppu1_mdr; } case 0x213a: { //VMDATAHREAD regs.ppu1_mdr = regs.vram_readbuffer >> 8; if(regs.vram_incmode == 1) { uint16 addr = get_vram_addr(); regs.vram_readbuffer = vram_read(addr + 0) << 0; regs.vram_readbuffer |= vram_read(addr + 1) << 8; regs.vram_addr += regs.vram_incsize; } return regs.ppu1_mdr; } case 0x213b: { //CGDATAREAD if((regs.cgram_addr & 1) == 0) { regs.ppu2_mdr = cgram_read(regs.cgram_addr); } else { regs.ppu2_mdr = (regs.ppu2_mdr & 0x80) | (cgram_read(regs.cgram_addr) & 0x7f); } regs.cgram_addr = (regs.cgram_addr + 1) & 0x01ff; return regs.ppu2_mdr; } case 0x213c: { //OPHCT if(regs.latch_hcounter == 0) { regs.ppu2_mdr = regs.hcounter & 0xff; } else { regs.ppu2_mdr = (regs.ppu2_mdr & 0xfe) | (regs.hcounter >> 8); } regs.latch_hcounter ^= 1; return regs.ppu2_mdr; } case 0x213d: { //OPVCT if(regs.latch_vcounter == 0) { regs.ppu2_mdr = regs.vcounter & 0xff; } else { regs.ppu2_mdr = (regs.ppu2_mdr & 0xfe) | (regs.vcounter >> 8); } regs.latch_vcounter ^= 1; return regs.ppu2_mdr; } case 0x213e: { //STAT77 regs.ppu1_mdr &= 0x10; regs.ppu1_mdr |= sprite.regs.time_over << 7; regs.ppu1_mdr |= sprite.regs.range_over << 6; regs.ppu1_mdr |= 0x01; //version return regs.ppu1_mdr; } case 0x213f: { //STAT78 regs.latch_hcounter = 0; regs.latch_vcounter = 0; regs.ppu2_mdr &= 0x20; regs.ppu2_mdr |= cpu.field() << 7; if((cpu.pio() & 0x80) == 0) { regs.ppu2_mdr |= 0x40; } else if(regs.counters_latched) { regs.ppu2_mdr |= 0x40; regs.counters_latched = false; } regs.ppu2_mdr |= (system.region() == System::Region::NTSC ? 0 : 1) << 4; regs.ppu2_mdr |= 0x03; //version return regs.ppu2_mdr; } } return cpu.regs.mdr; } void PPU::mmio_write(unsigned addr, uint8 data) { cpu.synchronize_ppu(); switch(addr & 0xffff) { case 0x2100: { //INIDISP if(regs.display_disable && cpu.vcounter() == display.height) sprite.address_reset(); regs.display_disable = data & 0x80; regs.display_brightness = data & 0x0f; return; } case 0x2101: { //OBSEL sprite.regs.base_size = (data >> 5) & 7; sprite.regs.nameselect = (data >> 3) & 3; sprite.regs.tiledata_addr = (data & 3) << 14; sprite.list_valid = false; return; } case 0x2102: { //OAMADDL regs.oam_baseaddr = (regs.oam_baseaddr & 0x0100) | (data << 0); sprite.address_reset(); return; } case 0x2103: { //OAMADDH regs.oam_priority = data & 0x80; regs.oam_baseaddr = ((data & 1) << 8) | (regs.oam_baseaddr & 0x00ff); sprite.address_reset(); return; } case 0x2104: { //OAMDATA if((regs.oam_addr & 1) == 0) regs.oam_latchdata = data; if(regs.oam_addr & 0x0200) { oam_write(regs.oam_addr, data); } else if((regs.oam_addr & 1) == 1) { oam_write((regs.oam_addr & ~1) + 0, regs.oam_latchdata); oam_write((regs.oam_addr & ~1) + 1, data); } regs.oam_addr = (regs.oam_addr + 1) & 0x03ff; sprite.set_first(); return; } case 0x2105: { //BGMODE bg4.regs.tile_size = data & 0x80; bg3.regs.tile_size = data & 0x40; bg2.regs.tile_size = data & 0x20; bg1.regs.tile_size = data & 0x10; regs.bg3_priority = data & 0x08; regs.bgmode = data & 0x07; mmio_update_video_mode(); return; } case 0x2106: { //MOSAIC unsigned mosaic_size = (data >> 4) & 15; bg4.regs.mosaic = (data & 0x08 ? mosaic_size : 0); bg3.regs.mosaic = (data & 0x04 ? mosaic_size : 0); bg2.regs.mosaic = (data & 0x02 ? mosaic_size : 0); bg1.regs.mosaic = (data & 0x01 ? mosaic_size : 0); return; } case 0x2107: { //BG1SC bg1.regs.screen_addr = (data & 0x7c) << 9; bg1.regs.screen_size = data & 3; return; } case 0x2108: { //BG2SC bg2.regs.screen_addr = (data & 0x7c) << 9; bg2.regs.screen_size = data & 3; return; } case 0x2109: { //BG3SC bg3.regs.screen_addr = (data & 0x7c) << 9; bg3.regs.screen_size = data & 3; return; } case 0x210a: { //BG4SC bg4.regs.screen_addr = (data & 0x7c) << 9; bg4.regs.screen_size = data & 3; return; } case 0x210b: { //BG12NBA bg1.regs.tiledata_addr = (data & 0x07) << 13; bg2.regs.tiledata_addr = (data & 0x70) << 9; return; } case 0x210c: { //BG34NBA bg3.regs.tiledata_addr = (data & 0x07) << 13; bg4.regs.tiledata_addr = (data & 0x70) << 9; return; } case 0x210d: { //BG1HOFS regs.mode7_hoffset = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; bg1.regs.hoffset = (data << 8) | (regs.bgofs_latchdata & ~7) | ((bg1.regs.hoffset >> 8) & 7); regs.bgofs_latchdata = data; return; } case 0x210e: { //BG1VOFS regs.mode7_voffset = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; bg1.regs.voffset = (data << 8) | regs.bgofs_latchdata; regs.bgofs_latchdata = data; return; } case 0x210f: { //BG2HOFS bg2.regs.hoffset = (data << 8) | (regs.bgofs_latchdata & ~7) | ((bg2.regs.hoffset >> 8) & 7); regs.bgofs_latchdata = data; return; } case 0x2110: { //BG2VOFS bg2.regs.voffset = (data << 8) | regs.bgofs_latchdata; regs.bgofs_latchdata = data; return; } case 0x2111: { //BG3HOFS bg3.regs.hoffset = (data << 8) | (regs.bgofs_latchdata & ~7) | ((bg3.regs.hoffset >> 8) & 7); regs.bgofs_latchdata = data; return; } case 0x2112: { //BG3VOFS bg3.regs.voffset = (data << 8) | regs.bgofs_latchdata; regs.bgofs_latchdata = data; return; } case 0x2113: { //BG4HOFS bg4.regs.hoffset = (data << 8) | (regs.bgofs_latchdata & ~7) | ((bg4.regs.hoffset >> 8) & 7); regs.bgofs_latchdata = data; return; } case 0x2114: { //BG4VOFS bg4.regs.voffset = (data << 8) | regs.bgofs_latchdata; regs.bgofs_latchdata = data; return; } case 0x2115: { //VMAIN regs.vram_incmode = data & 0x80; regs.vram_mapping = (data >> 2) & 3; switch(data & 3) { case 0: regs.vram_incsize = 1; break; case 1: regs.vram_incsize = 32; break; case 2: regs.vram_incsize = 128; break; case 3: regs.vram_incsize = 128; break; } return; } case 0x2116: { //VMADDL regs.vram_addr = (regs.vram_addr & 0xff00) | (data << 0); uint16 addr = get_vram_addr(); regs.vram_readbuffer = vram_read(addr + 0) << 0; regs.vram_readbuffer |= vram_read(addr + 1) << 8; return; } case 0x2117: { //VMADDH regs.vram_addr = (data << 8) | (regs.vram_addr & 0x00ff); uint16 addr = get_vram_addr(); regs.vram_readbuffer = vram_read(addr + 0) << 0; regs.vram_readbuffer |= vram_read(addr + 1) << 8; return; } case 0x2118: { //VMDATAL vram_write(get_vram_addr() + 0, data); if(regs.vram_incmode == 0) regs.vram_addr += regs.vram_incsize; return; } case 0x2119: { //VMDATAH vram_write(get_vram_addr() + 1, data); if(regs.vram_incmode == 1) regs.vram_addr += regs.vram_incsize; return; } case 0x211a: { //M7SEL regs.mode7_repeat = (data >> 6) & 3; regs.mode7_vflip = data & 0x02; regs.mode7_hflip = data & 0x01; return; } case 0x211b: { //M7A regs.m7a = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; return; } case 0x211c: { //M7B regs.m7b = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; return; } case 0x211d: { //M7C regs.m7c = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; return; } case 0x211e: { //M7D regs.m7d = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; return; } case 0x211f: { //M7X regs.m7x = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; return; } case 0x2120: { //M7Y regs.m7y = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; return; } case 0x2121: { //CGADD regs.cgram_addr = data << 1; return; } case 0x2122: { //CGDATA if((regs.cgram_addr & 1) == 0) { regs.cgram_latchdata = data; } else { cgram_write((regs.cgram_addr & ~1) + 0, regs.cgram_latchdata); cgram_write((regs.cgram_addr & ~1) + 1, data & 0x7f); } regs.cgram_addr = (regs.cgram_addr + 1) & 0x01ff; return; } case 0x2123: { //W12SEL bg2.window.two_enable = data & 0x80; bg2.window.two_invert = data & 0x40; bg2.window.one_enable = data & 0x20; bg2.window.one_invert = data & 0x10; bg1.window.two_enable = data & 0x08; bg1.window.two_invert = data & 0x04; bg1.window.one_enable = data & 0x02; bg1.window.one_invert = data & 0x01; return; } case 0x2124: { //W34SEL bg4.window.two_enable = data & 0x80; bg4.window.two_invert = data & 0x40; bg4.window.one_enable = data & 0x20; bg4.window.one_invert = data & 0x10; bg3.window.two_enable = data & 0x08; bg3.window.two_invert = data & 0x04; bg3.window.one_enable = data & 0x02; bg3.window.one_invert = data & 0x01; return; } case 0x2125: { //WOBJSEL screen.window.two_enable = data & 0x80; screen.window.two_invert = data & 0x40; screen.window.one_enable = data & 0x20; screen.window.one_invert = data & 0x10; sprite.window.two_enable = data & 0x08; sprite.window.two_invert = data & 0x04; sprite.window.one_enable = data & 0x02; sprite.window.one_invert = data & 0x01; return; } case 0x2126: { //WH0 regs.window_one_left = data; return; } case 0x2127: { //WH1 regs.window_one_right = data; return; } case 0x2128: { //WH2 regs.window_two_left = data; return; } case 0x2129: { //WH3 regs.window_two_right = data; return; } case 0x212a: { //WBGLOG bg4.window.mask = (data >> 6) & 3; bg3.window.mask = (data >> 4) & 3; bg2.window.mask = (data >> 2) & 3; bg1.window.mask = (data >> 0) & 3; return; } case 0x212b: { //WOBJLOG screen.window.mask = (data >> 2) & 3; sprite.window.mask = (data >> 0) & 3; return; } case 0x212c: { //TM sprite.regs.main_enable = data & 0x10; bg4.regs.main_enable = data & 0x08; bg3.regs.main_enable = data & 0x04; bg2.regs.main_enable = data & 0x02; bg1.regs.main_enable = data & 0x01; return; } case 0x212d: { //TS sprite.regs.sub_enable = data & 0x10; bg4.regs.sub_enable = data & 0x08; bg3.regs.sub_enable = data & 0x04; bg2.regs.sub_enable = data & 0x02; bg1.regs.sub_enable = data & 0x01; return; } case 0x212e: { //TMW sprite.window.main_enable = data & 0x10; bg4.window.main_enable = data & 0x08; bg3.window.main_enable = data & 0x04; bg2.window.main_enable = data & 0x02; bg1.window.main_enable = data & 0x01; return; } case 0x212f: { //TSW sprite.window.sub_enable = data & 0x10; bg4.window.sub_enable = data & 0x08; bg3.window.sub_enable = data & 0x04; bg2.window.sub_enable = data & 0x02; bg1.window.sub_enable = data & 0x01; return; } case 0x2130: { //CGWSEL screen.window.main_mask = (data >> 6) & 3; screen.window.sub_mask = (data >> 4) & 3; screen.regs.addsub_mode = data & 0x02; screen.regs.direct_color = data & 0x01; return; } case 0x2131: { //CGADDSUB screen.regs.color_mode = data & 0x80; screen.regs.color_halve = data & 0x40; screen.regs.color_enable[6] = data & 0x20; screen.regs.color_enable[5] = data & 0x10; screen.regs.color_enable[4] = data & 0x10; screen.regs.color_enable[3] = data & 0x08; screen.regs.color_enable[2] = data & 0x04; screen.regs.color_enable[1] = data & 0x02; screen.regs.color_enable[0] = data & 0x01; return; } case 0x2132: { //COLDATA if(data & 0x80) screen.regs.color_b = data & 0x1f; if(data & 0x40) screen.regs.color_g = data & 0x1f; if(data & 0x20) screen.regs.color_r = data & 0x1f; screen.regs.color = (screen.regs.color_b << 10) | (screen.regs.color_g << 5) | (screen.regs.color_r << 0); return; } case 0x2133: { //SETINI regs.mode7_extbg = data & 0x40; regs.pseudo_hires = data & 0x08; regs.overscan = data & 0x04; sprite.regs.interlace = data & 0x02; regs.interlace = data & 0x01; mmio_update_video_mode(); sprite.list_valid = false; return; } } } void PPU::mmio_reset() { //internal regs.ppu1_mdr = 0; regs.ppu2_mdr = 0; regs.vram_readbuffer = 0; regs.oam_latchdata = 0; regs.cgram_latchdata = 0; regs.bgofs_latchdata = 0; regs.mode7_latchdata = 0; regs.counters_latched = 0; regs.latch_hcounter = 0; regs.latch_vcounter = 0; sprite.regs.first_sprite = 0; sprite.list_valid = false; //$2100 regs.display_disable = true; regs.display_brightness = 0; //$2101 sprite.regs.base_size = 0; sprite.regs.nameselect = 0; sprite.regs.tiledata_addr = 0; //$2102-$2103 regs.oam_baseaddr = 0; regs.oam_addr = 0; regs.oam_priority = 0; //$2105 bg4.regs.tile_size = 0; bg3.regs.tile_size = 0; bg2.regs.tile_size = 0; bg1.regs.tile_size = 0; regs.bg3_priority = 0; regs.bgmode = 0; //$2106 bg4.regs.mosaic = 0; bg3.regs.mosaic = 0; bg2.regs.mosaic = 0; bg1.regs.mosaic = 0; //$2107-$210a bg1.regs.screen_addr = 0; bg1.regs.screen_size = 0; bg2.regs.screen_addr = 0; bg2.regs.screen_size = 0; bg3.regs.screen_addr = 0; bg3.regs.screen_size = 0; bg4.regs.screen_addr = 0; bg4.regs.screen_size = 0; //$210b-$210c bg1.regs.tiledata_addr = 0; bg2.regs.tiledata_addr = 0; bg3.regs.tiledata_addr = 0; bg4.regs.tiledata_addr = 0; //$210d-$2114 regs.mode7_hoffset = 0; regs.mode7_voffset = 0; bg1.regs.hoffset = 0; bg1.regs.voffset = 0; bg2.regs.hoffset = 0; bg2.regs.voffset = 0; bg3.regs.hoffset = 0; bg3.regs.voffset = 0; bg4.regs.hoffset = 0; bg4.regs.voffset = 0; //$2115 regs.vram_incmode = 0; regs.vram_mapping = 0; regs.vram_incsize = 1; //$2116-$2117 regs.vram_addr = 0; //$211a regs.mode7_repeat = 0; regs.mode7_vflip = 0; regs.mode7_hflip = 0; //$211b-$2120 regs.m7a = 0; regs.m7b = 0; regs.m7c = 0; regs.m7d = 0; regs.m7x = 0; regs.m7y = 0; //$2121 regs.cgram_addr = 0; //$2123-$2125 bg1.window.one_enable = 0; bg1.window.one_invert = 0; bg1.window.two_enable = 0; bg1.window.two_invert = 0; bg2.window.one_enable = 0; bg2.window.one_invert = 0; bg2.window.two_enable = 0; bg2.window.two_invert = 0; bg3.window.one_enable = 0; bg3.window.one_invert = 0; bg3.window.two_enable = 0; bg3.window.two_invert = 0; bg4.window.one_enable = 0; bg4.window.one_invert = 0; bg4.window.two_enable = 0; bg4.window.two_invert = 0; sprite.window.one_enable = 0; sprite.window.one_invert = 0; sprite.window.two_enable = 0; sprite.window.two_invert = 0; screen.window.one_enable = 0; screen.window.one_invert = 0; screen.window.two_enable = 0; screen.window.two_invert = 0; //$2126-$2129 regs.window_one_left = 0; regs.window_one_right = 0; regs.window_two_left = 0; regs.window_two_right = 0; //$212a-$212b bg1.window.mask = 0; bg2.window.mask = 0; bg3.window.mask = 0; bg4.window.mask = 0; sprite.window.mask = 0; screen.window.mask = 0; //$212c bg1.regs.main_enable = 0; bg2.regs.main_enable = 0; bg3.regs.main_enable = 0; bg4.regs.main_enable = 0; sprite.regs.main_enable = 0; //$212d bg1.regs.sub_enable = 0; bg2.regs.sub_enable = 0; bg3.regs.sub_enable = 0; bg4.regs.sub_enable = 0; sprite.regs.sub_enable = 0; //$212e bg1.window.main_enable = 0; bg2.window.main_enable = 0; bg3.window.main_enable = 0; bg4.window.main_enable = 0; sprite.window.main_enable = 0; //$212f bg1.window.sub_enable = 0; bg2.window.sub_enable = 0; bg3.window.sub_enable = 0; bg4.window.sub_enable = 0; sprite.window.sub_enable = 0; //$2130 screen.window.main_mask = 0; screen.window.sub_mask = 0; screen.regs.addsub_mode = 0; screen.regs.direct_color = 0; //$2131 screen.regs.color_mode = 0; screen.regs.color_halve = 0; screen.regs.color_enable[6] = 0; screen.regs.color_enable[5] = 0; screen.regs.color_enable[4] = 0; screen.regs.color_enable[3] = 0; screen.regs.color_enable[2] = 0; screen.regs.color_enable[1] = 0; screen.regs.color_enable[0] = 0; //$2132 screen.regs.color_b = 0; screen.regs.color_g = 0; screen.regs.color_r = 0; screen.regs.color = 0; //$2133 regs.mode7_extbg = 0; regs.pseudo_hires = 0; regs.overscan = 0; sprite.regs.interlace = 0; regs.interlace = 0; //$213e sprite.regs.time_over = 0; sprite.regs.range_over = 0; mmio_update_video_mode(); } #endif phoenix/qt/widget/console.cpp000664 001750 001750 00000001135 12651764221 017437 0ustar00sergiosergio000000 000000 namespace phoenix { void pConsole::print(string text) { } void pConsole::reset() { } void pConsole::constructor() { qtWidget = qtConsole = new QtConsole(*this); pWidget::synchronizeState(); } void pConsole::destructor() { delete qtConsole; qtWidget = qtConsole = nullptr; } void pConsole::orphan() { destructor(); constructor(); } void pConsole::keyPressEvent(QKeyEvent* event) { } void pConsole::QtConsole::keyPressEvent(QKeyEvent* event) { self.keyPressEvent(event); } void pConsole::QtConsole::keyPressEventAcknowledge(QKeyEvent* event) { QTextEdit::keyPressEvent(event); } } sfc/chip/st0010/st0010.hpp000664 001750 001750 00000001666 12651764221 016006 0ustar00sergiosergio000000 000000 class ST0010 : public Memory { public: void init(); void load(); void unload(); void power(); void reset(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); void serialize(serializer&); private: uint8 ram[0x1000]; static const int16 sin_table[256]; static const int16 mode7_scale[176]; static const uint8 arctan[32][32]; //interfaces to sin table int16 sin(int16 theta); int16 cos(int16 theta); //interfaces to ram buffer uint8 readb (uint16 addr); uint16 readw (uint16 addr); uint32 readd (uint16 addr); void writeb(uint16 addr, uint8 data); void writew(uint16 addr, uint16 data); void writed(uint16 addr, uint32 data); //opcodes void op_01(); void op_02(); void op_03(); void op_04(); void op_05(); void op_06(); void op_07(); void op_08(); void op_01(int16 x0, int16 y0, int16 &x1, int16 &y1, int16 &quadrant, int16 &theta); }; extern ST0010 st0010; ananke/database/sufami-turbo.hpp000664 001750 001750 00000011256 12651764221 020044 0ustar00sergiosergio000000 000000 string SufamiTurbo = R"( database revision=2013-01-22 release cartridge linkable rom name=program.rom size=0x80000 ram name=save.ram size=0x800 information title: SDウルトラバトル ウルトラマン伝説 name: SD Ultra Battle - Ultraman Densetsu region: JP revision: 1.0 serial: SFT-0101-JPN sha256: 2bb55214fb668ca603d7b944b14f105dfb10b987a8902d420fe4ae1cb69c1d4a configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x800 linkable release cartridge linkable rom name=program.rom size=0x80000 ram name=save.ram size=0x800 information title: SDウルトラバトル セブン伝説 name: SD Ultra Battle - Seven Densetsu region: JP revision: 1.0 serial: SFT-0102-JPN sha256: 2fec5f2bc7dee010af10569a3d2bc18715a79a126940800c3eade5abbd625e3f configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x800 linkable release cartridge linkable rom name=program.rom size=0x80000 ram name=save.ram size=0x800 information title: ポイポイ忍者ワールド name: Poi Poi Ninja World region: JP revision: 1.0 serial: SFT-0103-JPN sha256: 602b20b788640f5743487108a10f3f77bca5ce2d24208b25b1ca498a96eb0d69 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x800 linkable release cartridge linkable rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 information title: SDガンダムジェネレーション 一年戦争記 name: SD Gundam Generation - Ichinen Sensouki region: JP revision: 1.0 serial: SFT-0104-JPN sha256: 3e82215bed08274874b30d461fc4a965c6bca932229da5d46d56e36f484d65eb configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 linkable release cartridge linkable rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 information title: SDガンダムジェネレーション グリプス戦記 name: SD Gundam Generation - Grips Senki region: JP revision: 1.0 serial: SFT-0105-JPN sha256: 8547a08ed11fe408eac282a90ac46654bd2e5f49bda3aec8e5edf166a0a4b9af configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 linkable release cartridge rom name=program.rom size=0x80000 information title: ゲゲゲの鬼太郎 妖怪ドンジャラ name: Gegege no Kitarou - Youkai Donjara region: JP revision: 1.0 serial: SFT-0106-JPN sha256: d93b3a570e7cf343f680ab0768a50b77e3577f9c555007e2de3decd6bc4765c8 configuration rom name=program.rom size=0x80000 release cartridge linkable rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 information title: SDガンダムジェネレーション アクシズ戦記 name: SD Gundam Generation - Axis Senki region: JP revision: 1.0 serial: SFT-0107-JPN sha256: 2a9d7c9a61318861028a73ca03e32a48cff162d76cba36fbaab8690b212efe9b configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 linkable release cartridge linkable rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 information title: SDガンダムジェネレーション バビロニア建国戦記 name: SD Gundam Generation - Babylonia Kenkoku Senki region: JP revision: 1.0 serial: SFT-0108-JPN sha256: 60ac017c18f534e8cf24ca7f38e22ce92db95ea6c30b2d59d76f13c4f1c8a6e4 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 linkable release cartridge linkable rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 information title: SDガンダムジェネレーション ザンスカール戦記 name: SD Gundam Generation - Zanscar Senki region: JP revision: 1.0 serial: SFT-0110-JPN sha256: 5951a58a91d8e397d0a237ccc2b1248e17c7312cb9cc11cbc350200a97b4e021 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 linkable release cartridge linkable rom name=program.rom size=0x80000 ram name=save.ram size=0x800 information title: SDガンダムジェネレーション コロニー格闘記 name: SD Gundam Generation - Colony Kakutouki region: JP revision: 1.0 serial: SFT-0111-JPN sha256: e639b5d5d722432b6809ccc6801dc584e1a3016379f34b335ed2dfa73b1ebf69 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x800 linkable )"; nall/odbc.hpp000664 001750 001750 00000007402 12651764221 014261 0ustar00sergiosergio000000 000000 #ifndef NALL_ODBC_HPP #define NALL_ODBC_HPP //minimal wrapper for core ODBC v3 API //requires Windows or unixODBC #include #include #include #include #include namespace nall { struct ODBC { inline ODBC(); inline ODBC(const string& database, const string& username, const string& password); inline ~ODBC(); inline bool connected(); inline bool connect(const string& hostname, const string& username, const string& password); inline void disconnect(); template inline bool execute(Args&&... args); inline void release(); inline unsigned rows(); inline lstring read(); private: char* buffer = nullptr; SQLHANDLE sqlEnvironment = nullptr; SQLHANDLE sqlConnection = nullptr; SQLHANDLE sqlStatement = nullptr; }; ODBC::ODBC() { auto result = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &sqlEnvironment); if(result != SQL_SUCCESS && result != SQL_SUCCESS_WITH_INFO) return; SQLSetEnvAttr(sqlEnvironment, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0); buffer = new char[65536](); } ODBC::ODBC(const string& database, const string& username, const string& password) : ODBC() { connect(database, username, password); } ODBC::~ODBC() { if(sqlEnvironment) { disconnect(); SQLFreeHandle(SQL_HANDLE_ENV, sqlEnvironment); sqlEnvironment = nullptr; delete[] buffer; buffer = nullptr; } } bool ODBC::connected() { return sqlConnection; } bool ODBC::connect(const string& hostname, const string& username, const string& password) { if(!sqlEnvironment) return false; disconnect(); auto result = SQLAllocHandle(SQL_HANDLE_DBC, sqlEnvironment, &sqlConnection); if(result != SQL_SUCCESS && result != SQL_SUCCESS_WITH_INFO) return false; SQLSetConnectAttr(sqlConnection, SQL_LOGIN_TIMEOUT, (SQLPOINTER)5, 0); result = SQLConnectA(sqlConnection, (SQLCHAR*)(const char*)hostname, SQL_NTS, (SQLCHAR*)(const char*)username, SQL_NTS, (SQLCHAR*)(const char*)password, SQL_NTS ); if(result != SQL_SUCCESS && result != SQL_SUCCESS_WITH_INFO) { disconnect(); return false; } return true; } void ODBC::disconnect() { if(sqlConnection) { release(); SQLDisconnect(sqlConnection); SQLFreeHandle(SQL_HANDLE_DBC, sqlConnection); sqlConnection = nullptr; } } template bool ODBC::execute(Args&&... args) { string statement({args...}); if(!sqlConnection) return false; release(); auto result = SQLAllocHandle(SQL_HANDLE_STMT, sqlConnection, &sqlStatement); if(result != SQL_SUCCESS && result != SQL_SUCCESS_WITH_INFO) return false; result = SQLExecDirectA(sqlStatement, (SQLCHAR*)(const char*)statement, SQL_NTS); if(result != SQL_SUCCESS && result != SQL_SUCCESS_WITH_INFO) { release(); return false; } return true; } void ODBC::release() { if(sqlStatement) { SQLFreeHandle(SQL_HANDLE_STMT, sqlStatement); sqlStatement = nullptr; } } //valid after update, insert or delete unsigned ODBC::rows() { if(!sqlStatement) return 0; SQLLEN sqlRows = 0; auto result = SQLRowCount(sqlStatement, &sqlRows); if(result != SQL_SUCCESS && result != SQL_SUCCESS_WITH_INFO) return 0; return sqlRows; } //valid after select lstring ODBC::read() { if(!sqlStatement) return {}; auto result = SQLFetch(sqlStatement); if(result != SQL_SUCCESS && result != SQL_SUCCESS_WITH_INFO) return {}; SQLSMALLINT sqlColumns = 0; result = SQLNumResultCols(sqlStatement, &sqlColumns); if(result != SQL_SUCCESS && result != SQL_SUCCESS_WITH_INFO) return {}; lstring data; for(unsigned column = 0; column < sqlColumns; column++) { SQLLEN length = 0; SQLGetData(sqlStatement, 1 + column, SQL_C_CHAR, buffer, 65535, &length); data.append(buffer); } return data; } } #endif phoenix/qt/platform.moc.hpp000664 001750 001750 00000042623 12651764221 017127 0ustar00sergiosergio000000 000000 namespace phoenix { struct pApplication { static XlibDisplay* display; static void run(); static bool pendingEvents(); static void processEvents(); static void quit(); static void initialize(); static void syncX(); }; static QApplication* qtApplication = nullptr; struct Settings : Configuration::Document { bimap keymap; struct Geometry : Configuration::Node { unsigned frameX; unsigned frameY; unsigned frameWidth; unsigned frameHeight; unsigned menuHeight; unsigned statusHeight; } geometry; void load(); void save(); Settings(); }; struct pWindow; struct pMenu; struct pLayout; struct pWidget; struct pFont { static string serif(unsigned size, string style); static string sans(unsigned size, string style); static string monospace(unsigned size, string style); static Size size(string font, string text); static QFont create(string description); static Size size(const QFont& qtFont, string text); }; struct pDesktop { static Size size(); static Geometry workspace(); }; struct pMonitor { static unsigned count(); static Geometry geometry(unsigned monitor); static unsigned primary(); }; struct pKeyboard { static bool pressed(Keyboard::Scancode scancode); static vector state(); static void initialize(); }; struct pMouse { static Position position(); static bool pressed(Mouse::Button button); }; struct pBrowserWindow { static string directory(BrowserWindow::State& state); static string open(BrowserWindow::State& state); static string save(BrowserWindow::State& state); }; struct pMessageWindow { static MessageWindow::Response error(MessageWindow::State& state); static MessageWindow::Response information(MessageWindow::State& state); static MessageWindow::Response question(MessageWindow::State& state); static MessageWindow::Response warning(MessageWindow::State& state); }; struct pObject { Object& object; bool locked; pObject(Object& object) : object(object), locked(false) {} virtual ~pObject() {} void constructor() {} void destructor() {} }; struct pTimer : public QObject, public pObject { Q_OBJECT public: Timer& timer; QTimer* qtTimer; void setEnabled(bool enabled); void setInterval(unsigned interval); pTimer(Timer& timer) : pObject(timer), timer(timer) {} void constructor(); void destructor(); public slots: void onActivate(); }; struct pWindow : public QObject, public pObject { Q_OBJECT public: Window& window; struct QtWindow : public QWidget { pWindow& self; void closeEvent(QCloseEvent*); void dragEnterEvent(QDragEnterEvent*); void dropEvent(QDropEvent*); void keyPressEvent(QKeyEvent*); void keyReleaseEvent(QKeyEvent*); void moveEvent(QMoveEvent*); void resizeEvent(QResizeEvent*); QSize sizeHint() const; QtWindow(pWindow& self) : self(self) {} }; QtWindow* qtWindow; QVBoxLayout* qtLayout; QMenuBar* qtMenu; QStatusBar* qtStatus; QWidget* qtContainer; void append(Layout& layout); void append(Menu& menu); void append(Widget& widget); Geometry frameMargin(); bool focused(); Geometry geometry(); void remove(Layout& layout); void remove(Menu& menu); void remove(Widget& widget); void setBackgroundColor(Color color); void setDroppable(bool droppable); void setFocused(); void setFullScreen(bool fullScreen); void setGeometry(Geometry geometry); void setMenuFont(string font); void setMenuVisible(bool visible); void setModal(bool modal); void setResizable(bool resizable); void setStatusFont(string font); void setStatusText(string text); void setStatusVisible(bool visible); void setTitle(string text); void setVisible(bool visible); void setWidgetFont(string font); pWindow(Window& window) : pObject(window), window(window) {} void constructor(); void destructor(); void updateFrameGeometry(); }; struct pAction : public pObject { Action& action; void setEnabled(bool enabled); void setFont(string font); void setVisible(bool visible); pAction(Action& action) : pObject(action), action(action) {} void constructor(); void destructor(); }; struct pMenu : public pAction { Menu& menu; QMenu* qtMenu; void append(Action& action); void remove(Action& action); void setFont(string font); void setImage(const image& image); void setText(string text); pMenu(Menu& menu) : pAction(menu), menu(menu) {} void constructor(); void destructor(); }; struct pSeparator : public pAction { Separator& separator; QAction* qtAction; pSeparator(Separator& separator) : pAction(separator), separator(separator) {} void constructor(); void destructor(); }; struct pItem : public QObject, public pAction { Q_OBJECT public: Item& item; QAction* qtAction; void setImage(const image& image); void setText(string text); pItem(Item& item) : pAction(item), item(item) {} void constructor(); void destructor(); public slots: void onActivate(); }; struct pCheckItem : public QObject, public pAction { Q_OBJECT public: CheckItem& checkItem; QAction* qtAction; void setChecked(bool checked); void setText(string text); pCheckItem(CheckItem& checkItem) : pAction(checkItem), checkItem(checkItem) {} void constructor(); void destructor(); public slots: void onToggle(); }; struct pRadioItem : public QObject, public pAction { Q_OBJECT public: RadioItem& radioItem; QAction* qtAction; QActionGroup* qtGroup; void setChecked(); void setGroup(const group& group); void setText(string text); pRadioItem(RadioItem& radioItem) : pAction(radioItem), radioItem(radioItem) {} void constructor(); void destructor(); public slots: void onActivate(); }; struct pSizable : public pObject { Sizable& sizable; virtual Position displacement() { return {0, 0}; } pSizable(Sizable& sizable) : pObject(sizable), sizable(sizable) {} void constructor() {} void destructor() {} }; struct pLayout : public pSizable { Layout& layout; pLayout(Layout& layout) : pSizable(layout), layout(layout) {} void constructor() {} void destructor() {} }; struct pWidget : public pSizable { Widget& widget; QWidget* qtWidget; virtual QWidget* container(Widget& widget); bool focused(); virtual Size minimumSize(); virtual void setEnabled(bool enabled); void setFocused(); void setFont(string font); virtual void setGeometry(Geometry geometry); virtual void setVisible(bool visible); pWidget(Widget& widget) : pSizable(widget), widget(widget) {} void constructor(); void synchronizeState(); void destructor(); virtual void orphan(); }; struct pButton : public QObject, public pWidget { Q_OBJECT public: Button& button; QToolButton* qtButton; Size minimumSize(); void setImage(const image& image, Orientation orientation); void setText(string text); pButton(Button& button) : pWidget(button), button(button) {} void constructor(); void destructor(); void orphan(); public slots: void onActivate(); }; struct pCanvas : public QObject, public pWidget { Q_OBJECT public: Canvas& canvas; QImage* surface = nullptr; unsigned surfaceWidth = 0; unsigned surfaceHeight = 0; struct QtCanvas : public QWidget { pCanvas& self; void dragEnterEvent(QDragEnterEvent*); void dropEvent(QDropEvent*); void leaveEvent(QEvent*); void mouseMoveEvent(QMouseEvent*); void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void paintEvent(QPaintEvent*); QtCanvas(pCanvas& self); }; QtCanvas* qtCanvas; void setDroppable(bool droppable); void setGeometry(Geometry geometry); void setMode(Canvas::Mode mode); void setSize(Size size); pCanvas(Canvas& canvas) : pWidget(canvas), canvas(canvas) {} void constructor(); void destructor(); void orphan(); void rasterize(); void release(); public slots: }; struct pCheckButton : public QObject, public pWidget { Q_OBJECT public: CheckButton& checkButton; QToolButton* qtCheckButton; Size minimumSize(); void setChecked(bool checked); void setImage(const image& image, Orientation orientation); void setText(string text); pCheckButton(CheckButton& checkButton) : pWidget(checkButton), checkButton(checkButton) {} void constructor(); void destructor(); void orphan(); public slots: void onToggle(bool checked); }; struct pCheckLabel : public QObject, public pWidget { Q_OBJECT public: CheckLabel& checkLabel; QCheckBox* qtCheckLabel; Size minimumSize(); void setChecked(bool checked); void setText(string text); pCheckLabel(CheckLabel& checkLabel) : pWidget(checkLabel), checkLabel(checkLabel) {} void constructor(); void destructor(); void orphan(); public slots: void onToggle(); }; struct pComboButton : public QObject, public pWidget { Q_OBJECT public: ComboButton& comboButton; QComboBox* qtComboButton; void append(string text); Size minimumSize(); void remove(unsigned selection); void reset(); unsigned selection(); void setSelection(unsigned selection); void setText(unsigned selection, string text); pComboButton(ComboButton& comboButton) : pWidget(comboButton), comboButton(comboButton) {} void constructor(); void destructor(); void orphan(); public slots: void onChange(); }; struct pConsole : public QObject, public pWidget { Q_OBJECT public: Console& console; struct QtConsole : public QTextEdit { pConsole& self; void keyPressEvent(QKeyEvent*); void keyPressEventAcknowledge(QKeyEvent*); QtConsole(pConsole& self) : self(self) {} }; QtConsole* qtConsole; void print(string text); void reset(); pConsole(Console& console) : pWidget(console), console(console) {} void constructor(); void destructor(); void orphan(); void keyPressEvent(QKeyEvent*); }; struct pFrame : public QObject, public pWidget { Q_OBJECT public: Frame& frame; QGroupBox* qtFrame; void setEnabled(bool enabled); void setGeometry(Geometry geometry); void setText(string text); void setVisible(bool visible); pFrame(Frame& frame) : pWidget(frame), frame(frame) {} void constructor(); void destructor(); void orphan(); }; struct pHexEdit : public QObject, public pWidget { Q_OBJECT public: HexEdit& hexEdit; struct QtHexEdit : public QTextEdit { pHexEdit& self; void keyPressEvent(QKeyEvent*); void keyPressEventAcknowledge(QKeyEvent*); void wheelEvent(QWheelEvent*); QtHexEdit(pHexEdit& self) : self(self) {} }; struct QtHexEditScrollBar : public QScrollBar { pHexEdit& self; bool event(QEvent*); QtHexEditScrollBar(pHexEdit& self) : QScrollBar(Qt::Vertical), self(self) {} }; QtHexEdit* qtHexEdit; QHBoxLayout* qtLayout; QtHexEditScrollBar* qtScroll; void setColumns(unsigned columns); void setLength(unsigned length); void setOffset(unsigned offset); void setRows(unsigned rows); void update(); pHexEdit(HexEdit& hexEdit) : pWidget(hexEdit), hexEdit(hexEdit) {} void constructor(); void destructor(); void orphan(); void keyPressEvent(QKeyEvent*); signed rows(); signed rowsScrollable(); void scrollTo(signed position); public slots: void onScroll(); }; struct pHorizontalScroller : public QObject, public pWidget { Q_OBJECT public: HorizontalScroller& horizontalScroller; QScrollBar* qtScroller; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pHorizontalScroller(HorizontalScroller& horizontalScroller) : pWidget(horizontalScroller), horizontalScroller(horizontalScroller) {} void constructor(); void destructor(); void orphan(); public slots: void onChange(); }; struct pHorizontalSlider : public QObject, public pWidget { Q_OBJECT public: HorizontalSlider& horizontalSlider; QSlider* qtSlider; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pHorizontalSlider(HorizontalSlider& horizontalSlider) : pWidget(horizontalSlider), horizontalSlider(horizontalSlider) {} void constructor(); void destructor(); void orphan(); public slots: void onChange(); }; struct pLabel : public pWidget { Label& label; QLabel* qtLabel; Size minimumSize(); void setText(string text); pLabel(Label& label) : pWidget(label), label(label) {} void constructor(); void destructor(); void orphan(); }; struct pLineEdit : public QObject, public pWidget { Q_OBJECT public: LineEdit& lineEdit; QLineEdit* qtLineEdit; Size minimumSize(); void setEditable(bool editable); void setText(string text); string text(); pLineEdit(LineEdit& lineEdit) : pWidget(lineEdit), lineEdit(lineEdit) {} void constructor(); void destructor(); void orphan(); public slots: void onActivate(); void onChange(); }; struct pListView : public QObject, public pWidget { Q_OBJECT public: ListView& listView; QTreeWidget* qtListView; void append(const lstring& text); void autoSizeColumns(); void remove(unsigned selection); void reset(); void setCheckable(bool checkable); void setChecked(unsigned selection, bool checked); void setHeaderText(const lstring& text); void setHeaderVisible(bool visible); void setImage(unsigned selection, unsigned position, const image& image); void setSelected(bool selected); void setSelection(unsigned selection); void setText(unsigned selection, unsigned position, string text); pListView(ListView& listView) : pWidget(listView), listView(listView) {} void constructor(); void destructor(); void orphan(); public slots: void onActivate(); void onChange(QTreeWidgetItem* item); void onToggle(QTreeWidgetItem* item); }; struct pProgressBar : public pWidget { ProgressBar& progressBar; QProgressBar* qtProgressBar; Size minimumSize(); void setPosition(unsigned position); pProgressBar(ProgressBar& progressBar) : pWidget(progressBar), progressBar(progressBar) {} void constructor(); void destructor(); void orphan(); }; struct pRadioLabel : public QObject, public pWidget { Q_OBJECT public: RadioLabel& radioLabel; QRadioButton* qtRadioLabel; bool checked(); Size minimumSize(); void setChecked(); void setGroup(const group& group); void setText(string text); pRadioLabel(RadioLabel& radioLabel) : pWidget(radioLabel), radioLabel(radioLabel) {} pRadioLabel& parent(); void constructor(); void destructor(); void orphan(); public slots: void onActivate(); }; struct pRadioButton : public QObject, public pWidget { Q_OBJECT public: RadioButton& radioButton; QToolButton* qtRadioButton; Size minimumSize(); void setChecked(); void setGroup(const group& group); void setImage(const image& image, Orientation orientation); void setText(string text); pRadioButton(RadioButton& radioButton) : pWidget(radioButton), radioButton(radioButton) {} pRadioButton& parent(); void constructor(); void destructor(); void orphan(); public slots: void onActivate(); }; struct pTabFrame : public QObject, public pWidget { Q_OBJECT public: TabFrame& tabFrame; QTabWidget* qtTabFrame; void append(string text, const image& image); QWidget* container(Widget& widget); Position displacement(); void remove(unsigned selection); void setEnabled(bool enabled); void setGeometry(Geometry geometry); void setImage(unsigned selection, const image& image); void setSelection(unsigned selection); void setText(unsigned selection, string text); void setVisible(bool visible); pTabFrame(TabFrame& tabFrame) : pWidget(tabFrame), tabFrame(tabFrame) {} void constructor(); void destructor(); void orphan(); void synchronizeLayout(); public slots: void onChange(int selection); }; struct pTextEdit : public QObject, public pWidget { Q_OBJECT public: TextEdit& textEdit; QTextEdit* qtTextEdit; void setCursorPosition(unsigned position); void setEditable(bool editable); void setText(string text); void setWordWrap(bool wordWrap); string text(); pTextEdit(TextEdit& textEdit) : pWidget(textEdit), textEdit(textEdit) {} void constructor(); void destructor(); void orphan(); public slots: void onChange(); }; struct pVerticalScroller : public QObject, public pWidget { Q_OBJECT public: VerticalScroller& verticalScroller; QScrollBar* qtScroller; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pVerticalScroller(VerticalScroller& verticalScroller) : pWidget(verticalScroller), verticalScroller(verticalScroller) {} void constructor(); void destructor(); void orphan(); public slots: void onChange(); }; struct pVerticalSlider : public QObject, public pWidget { Q_OBJECT public: VerticalSlider& verticalSlider; QSlider* qtSlider; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pVerticalSlider(VerticalSlider& verticalSlider) : pWidget(verticalSlider), verticalSlider(verticalSlider) {} void constructor(); void destructor(); void orphan(); public slots: void onChange(); }; struct pViewport : public pWidget { Viewport& viewport; struct QtViewport : public QWidget { pViewport& self; void dragEnterEvent(QDragEnterEvent*); void dropEvent(QDropEvent*); void leaveEvent(QEvent*); void mouseMoveEvent(QMouseEvent*); void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); QtViewport(pViewport& self); }; QtViewport* qtViewport; uintptr_t handle(); void setDroppable(bool droppable); pViewport(Viewport& viewport) : pWidget(viewport), viewport(viewport) {} void constructor(); void destructor(); void orphan(); }; } phoenix/reference/application.hpp000664 001750 001750 00000000267 12651764221 020341 0ustar00sergiosergio000000 000000 namespace phoenix { struct pApplication { static void run(); static bool pendingEvents(); static void processEvents(); static void quit(); static void initialize(); }; } phoenix/cocoa/widget/check-button.hpp000664 001750 001750 00000001203 12651764221 021024 0ustar00sergiosergio000000 000000 @interface CocoaCheckButton : NSButton { @public phoenix::CheckButton* checkButton; } -(id) initWith:(phoenix::CheckButton&)checkButton; -(IBAction) activate:(id)sender; @end namespace phoenix { struct pCheckButton : public pWidget { CheckButton& checkButton; CocoaCheckButton* cocoaCheckButton = nullptr; Size minimumSize(); void setChecked(bool checked); void setGeometry(Geometry geometry); void setImage(const image& image, Orientation orientation); void setText(string text); pCheckButton(CheckButton& checkButton) : pWidget(checkButton), checkButton(checkButton) {} void constructor(); void destructor(); }; } sfc/chip/cx4/functions.cpp000664 001750 001750 00000016133 12651764221 016624 0ustar00sergiosergio000000 000000 #ifdef CX4_CPP #include #define Tan(a) (CosTable[a] ? ((((int32)SinTable[a]) << 16) / CosTable[a]) : 0x80000000) #define sar(b, n) ((b) >> (n)) #ifdef PI #undef PI #endif #define PI 3.1415926535897932384626433832795 //Wireframe Helpers void Cx4::C4TransfWireFrame() { double c4x = (double)C4WFXVal; double c4y = (double)C4WFYVal; double c4z = (double)C4WFZVal - 0x95; double tanval, c4x2, c4y2, c4z2; //Rotate X tanval = -(double)C4WFX2Val * PI * 2 / 128; c4y2 = c4y * ::cos(tanval) - c4z * ::sin(tanval); c4z2 = c4y * ::sin(tanval) + c4z * ::cos(tanval); //Rotate Y tanval = -(double)C4WFY2Val * PI * 2 / 128; c4x2 = c4x * ::cos(tanval) + c4z2 * ::sin(tanval); c4z = c4x * -::sin(tanval) + c4z2 * ::cos(tanval); //Rotate Z tanval = -(double)C4WFDist * PI * 2 / 128; c4x = c4x2 * ::cos(tanval) - c4y2 * ::sin(tanval); c4y = c4x2 * ::sin(tanval) + c4y2 * ::cos(tanval); //Scale C4WFXVal = (int16)(c4x * C4WFScale / (0x90 * (c4z + 0x95)) * 0x95); C4WFYVal = (int16)(c4y * C4WFScale / (0x90 * (c4z + 0x95)) * 0x95); } void Cx4::C4CalcWireFrame() { C4WFXVal = C4WFX2Val - C4WFXVal; C4WFYVal = C4WFY2Val - C4WFYVal; if(abs(C4WFXVal) > abs(C4WFYVal)) { C4WFDist = abs(C4WFXVal) + 1; C4WFYVal = (256 * (long)C4WFYVal) / abs(C4WFXVal); C4WFXVal = (C4WFXVal < 0) ? -256 : 256; } else if(C4WFYVal != 0) { C4WFDist = abs(C4WFYVal) + 1; C4WFXVal = (256 * (long)C4WFXVal) / abs(C4WFYVal); C4WFYVal = (C4WFYVal < 0) ? -256 : 256; } else { C4WFDist = 0; } } void Cx4::C4TransfWireFrame2() { double c4x = (double)C4WFXVal; double c4y = (double)C4WFYVal; double c4z = (double)C4WFZVal; double tanval, c4x2, c4y2, c4z2; //Rotate X tanval = -(double)C4WFX2Val * PI * 2 / 128; c4y2 = c4y * ::cos(tanval) - c4z * ::sin(tanval); c4z2 = c4y * ::sin(tanval) + c4z * ::cos(tanval); //Rotate Y tanval = -(double)C4WFY2Val * PI * 2 / 128; c4x2 = c4x * ::cos(tanval) + c4z2 * ::sin(tanval); c4z = c4x * -::sin(tanval) + c4z2 * ::cos(tanval); //Rotate Z tanval = -(double)C4WFDist * PI * 2 / 128; c4x = c4x2 * ::cos(tanval) - c4y2 * ::sin(tanval); c4y = c4x2 * ::sin(tanval) + c4y2 * ::cos(tanval); //Scale C4WFXVal = (int16)(c4x * C4WFScale / 0x100); C4WFYVal = (int16)(c4y * C4WFScale / 0x100); } void Cx4::C4DrawWireFrame() { uint32 line = readl(0x1f80); uint32 point1, point2; int16 X1, Y1, Z1; int16 X2, Y2, Z2; uint8 Color; for(int32 i = ram[0x0295]; i > 0; i--, line += 5) { if(bus.read(line) == 0xff && bus.read(line + 1) == 0xff) { int32 tmp = line - 5; while(bus.read(tmp + 2) == 0xff && bus.read(tmp + 3) == 0xff && (tmp + 2) >= 0) { tmp -= 5; } point1 = (read(0x1f82) << 16) | (bus.read(tmp + 2) << 8) | bus.read(tmp + 3); } else { point1 = (read(0x1f82) << 16) | (bus.read(line) << 8) | bus.read(line + 1); } point2 = (read(0x1f82) << 16) | (bus.read(line + 2) << 8) | bus.read(line + 3); X1=(bus.read(point1 + 0) << 8) | bus.read(point1 + 1); Y1=(bus.read(point1 + 2) << 8) | bus.read(point1 + 3); Z1=(bus.read(point1 + 4) << 8) | bus.read(point1 + 5); X2=(bus.read(point2 + 0) << 8) | bus.read(point2 + 1); Y2=(bus.read(point2 + 2) << 8) | bus.read(point2 + 3); Z2=(bus.read(point2 + 4) << 8) | bus.read(point2 + 5); Color = bus.read(line + 4); C4DrawLine(X1, Y1, Z1, X2, Y2, Z2, Color); } } void Cx4::C4DrawLine(int32 X1, int32 Y1, int16 Z1, int32 X2, int32 Y2, int16 Z2, uint8 Color) { //Transform coordinates C4WFXVal = (int16)X1; C4WFYVal = (int16)Y1; C4WFZVal = Z1; C4WFScale = read(0x1f90); C4WFX2Val = read(0x1f86); C4WFY2Val = read(0x1f87); C4WFDist = read(0x1f88); C4TransfWireFrame2(); X1 = (C4WFXVal + 48) << 8; Y1 = (C4WFYVal + 48) << 8; C4WFXVal = (int16)X2; C4WFYVal = (int16)Y2; C4WFZVal = Z2; C4TransfWireFrame2(); X2 = (C4WFXVal + 48) << 8; Y2 = (C4WFYVal + 48) << 8; //Get line info C4WFXVal = (int16)(X1 >> 8); C4WFYVal = (int16)(Y1 >> 8); C4WFX2Val = (int16)(X2 >> 8); C4WFY2Val = (int16)(Y2 >> 8); C4CalcWireFrame(); X2 = (int16)C4WFXVal; Y2 = (int16)C4WFYVal; //Render line for(int32 i = C4WFDist ? C4WFDist : 1; i > 0; i--) { if(X1 > 0xff && Y1 > 0xff && X1 < 0x6000 && Y1 < 0x6000) { uint16 addr = (((Y1 >> 8) >> 3) << 8) - (((Y1 >> 8) >> 3) << 6) + (((X1 >> 8) >> 3) << 4) + ((Y1 >> 8) & 7) * 2; uint8 bit = 0x80 >> ((X1 >> 8) & 7); ram[addr + 0x300] &= ~bit; ram[addr + 0x301] &= ~bit; if(Color & 1) ram[addr + 0x300] |= bit; if(Color & 2) ram[addr + 0x301] |= bit; } X1 += X2; Y1 += Y2; } } void Cx4::C4DoScaleRotate(int row_padding) { int16 A, B, C, D; //Calculate matrix int32 XScale = readw(0x1f8f); int32 YScale = readw(0x1f92); if(XScale & 0x8000)XScale = 0x7fff; if(YScale & 0x8000)YScale = 0x7fff; if(readw(0x1f80) == 0) { //no rotation A = (int16)XScale; B = 0; C = 0; D = (int16)YScale; } else if(readw(0x1f80) == 128) { //90 degree rotation A = 0; B = (int16)(-YScale); C = (int16)XScale; D = 0; } else if(readw(0x1f80) == 256) { //180 degree rotation A = (int16)(-XScale); B = 0; C = 0; D = (int16)(-YScale); } else if(readw(0x1f80) == 384) { //270 degree rotation A = 0; B = (int16)YScale; C = (int16)(-XScale); D = 0; } else { A = (int16) sar(CosTable[readw(0x1f80) & 0x1ff] * XScale, 15); B = (int16)(-sar(SinTable[readw(0x1f80) & 0x1ff] * YScale, 15)); C = (int16) sar(SinTable[readw(0x1f80) & 0x1ff] * XScale, 15); D = (int16) sar(CosTable[readw(0x1f80) & 0x1ff] * YScale, 15); } //Calculate Pixel Resolution uint8 w = read(0x1f89) & ~7; uint8 h = read(0x1f8c) & ~7; //Clear the output RAM memset(ram, 0, (w + row_padding / 4) * h / 2); int32 Cx = (int16)readw(0x1f83); int32 Cy = (int16)readw(0x1f86); //Calculate start position (i.e. (Ox, Oy) = (0, 0)) //The low 12 bits are fractional, so (Cx<<12) gives us the Cx we want in //the function. We do Cx*A etc normally because the matrix parameters //already have the fractional parts. int32 LineX = (Cx << 12) - Cx * A - Cx * B; int32 LineY = (Cy << 12) - Cy * C - Cy * D; //Start loop uint32 X, Y; uint8 byte; int32 outidx = 0; uint8 bit = 0x80; for(int32 y = 0; y < h; y++) { X = LineX; Y = LineY; for(int32 x = 0; x < w; x++) { if((X >> 12) >= w || (Y >> 12) >= h) { byte = 0; } else { uint32 addr = (Y >> 12) * w + (X >> 12); byte = read(0x600 + (addr >> 1)); if(addr & 1) { byte >>= 4; } } //De-bitplanify if(byte & 1) ram[outidx ] |= bit; if(byte & 2) ram[outidx + 1] |= bit; if(byte & 4) ram[outidx + 16] |= bit; if(byte & 8) ram[outidx + 17] |= bit; bit >>= 1; if(!bit) { bit = 0x80; outidx += 32; } X += A; //Add 1 to output x => add an A and a C Y += C; } outidx += 2 + row_padding; if(outidx & 0x10) { outidx &= ~0x10; } else { outidx -= w * 4 + row_padding; } LineX += B; //Add 1 to output y => add a B and a D LineY += D; } } #endif phoenix/qt/header.hpp000664 001750 001750 00000000756 12651764221 015757 0ustar00sergiosergio000000 000000 #include #include #include #define XK_MISCELLANY #define XK_LATIN1 #include #include #undef XK_MISCELLANY #undef XK_LATIN1 #include //Qt 4.8.0 and earlier improperly define the QLOCATION macro //in C++11, it is detected as a malformed user-defined literal //below is a workaround to fix compilation errors caused by this #undef QLOCATION #define QLOCATION "\0" __FILE__ ":" QTOSTRING(__LINE__) sfc/alt/dsp/blargg_source.h000664 001750 001750 00000005735 12651764221 017032 0ustar00sergiosergio000000 000000 /* Included at the beginning of library source files, after all other #include lines. Sets up helpful macros and services used in my source code. They don't need module an annoying module prefix on their names since they are defined after all other #include lines. */ // snes_spc 0.9.0 #ifndef BLARGG_SOURCE_H #define BLARGG_SOURCE_H // If debugging is enabled, abort program if expr is false. Meant for checking // internal state and consistency. A failed assertion indicates a bug in the module. // void assert( bool expr ); #include // If debugging is enabled and expr is false, abort program. Meant for checking // caller-supplied parameters and operations that are outside the control of the // module. A failed requirement indicates a bug outside the module. // void require( bool expr ); #undef require #define require( expr ) assert( expr ) // Like printf() except output goes to debug log file. Might be defined to do // nothing (not even evaluate its arguments). // void dprintf( const char* format, ... ); static inline void blargg_dprintf_( const char*, ... ) { } #undef dprintf #define dprintf (1) ? (void) 0 : blargg_dprintf_ // If enabled, evaluate expr and if false, make debug log entry with source file // and line. Meant for finding situations that should be examined further, but that // don't indicate a problem. In all cases, execution continues normally. #undef check #define check( expr ) ((void) 0) // If expr yields error string, return it from current function, otherwise continue. #undef RETURN_ERR #define RETURN_ERR( expr ) do { \ blargg_err_t blargg_return_err_ = (expr); \ if ( blargg_return_err_ ) return blargg_return_err_; \ } while ( 0 ) // If ptr is 0, return out of memory error string. #undef CHECK_ALLOC #define CHECK_ALLOC( ptr ) do { if ( (ptr) == 0 ) return "Out of memory"; } while ( 0 ) // Avoid any macros which evaluate their arguments multiple times #undef min #undef max #define DEF_MIN_MAX( type ) \ static inline type min( type x, type y ) { if ( x < y ) return x; return y; }\ static inline type max( type x, type y ) { if ( y < x ) return x; return y; } DEF_MIN_MAX( int ) DEF_MIN_MAX( unsigned ) DEF_MIN_MAX( long ) DEF_MIN_MAX( unsigned long ) DEF_MIN_MAX( float ) DEF_MIN_MAX( double ) #undef DEF_MIN_MAX /* // using const references generates crappy code, and I am currenly only using these // for built-in types, so they take arguments by value // TODO: remove inline int min( int x, int y ) template inline T min( T x, T y ) { if ( x < y ) return x; return y; } template inline T max( T x, T y ) { if ( x < y ) return y; return x; } */ // TODO: good idea? bad idea? #undef byte #define byte byte_ typedef unsigned char byte; // deprecated #define BLARGG_CHECK_ALLOC CHECK_ALLOC #define BLARGG_RETURN_ERR RETURN_ERR // BLARGG_SOURCE_BEGIN: If defined, #included, allowing redefition of dprintf and check #ifdef BLARGG_SOURCE_BEGIN #include BLARGG_SOURCE_BEGIN #endif #endif phoenix/cocoa/keyboard.hpp000664 001750 001750 00000000201 12651764221 016750 0ustar00sergiosergio000000 000000 namespace phoenix { struct pKeyboard { static bool pressed(Keyboard::Scancode scancode); static vector state(); }; } sfc/alt/ppu-balanced/serialization.cpp000664 001750 001750 00000012774 12651764221 021172 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP void PPUcounter::serialize(serializer& s) { s.integer(status.interlace); s.integer(status.field); s.integer(status.vcounter); s.integer(status.hcounter); s.array(history.field); s.array(history.vcounter); s.array(history.hcounter); s.integer(history.index); } void PPU::serialize(serializer& s) { Thread::serialize(s); PPUcounter::serialize(s); s.array(vram); s.array(oam); s.array(cgram); s.integer(ppu1_version); s.integer(ppu2_version); s.integer(region); s.integer(line); s.integer(display.interlace); s.integer(display.overscan); s.integer(cache.oam_basesize); s.integer(cache.oam_nameselect); s.integer(cache.oam_tdaddr); s.integer(regs.ppu1_mdr); s.integer(regs.ppu2_mdr); for(unsigned n = 0; n < 4; n++) s.integer(regs.bg_y[n]); s.integer(regs.ioamaddr); s.integer(regs.icgramaddr); s.integer(regs.display_disabled); s.integer(regs.display_brightness); s.integer(regs.oam_basesize); s.integer(regs.oam_nameselect); s.integer(regs.oam_tdaddr); s.integer(regs.oam_baseaddr); s.integer(regs.oam_addr); s.integer(regs.oam_priority); s.integer(regs.oam_firstsprite); s.integer(regs.oam_latchdata); for(unsigned n = 0; n < 4; n++) s.integer(regs.bg_tilesize[n]); s.integer(regs.bg3_priority); s.integer(regs.bg_mode); s.integer(regs.mosaic_size); for(unsigned n = 0; n < 4; n++) s.integer(regs.mosaic_enabled[n]); s.integer(regs.mosaic_countdown); for(unsigned n = 0; n < 4; n++) s.integer(regs.bg_scaddr[n]); for(unsigned n = 0; n < 4; n++) s.integer(regs.bg_scsize[n]); for(unsigned n = 0; n < 4; n++) s.integer(regs.bg_tdaddr[n]); s.integer(regs.bg_ofslatch); s.integer(regs.m7_hofs); s.integer(regs.m7_vofs); for(unsigned n = 0; n < 4; n++) s.integer(regs.bg_hofs[n]); for(unsigned n = 0; n < 4; n++) s.integer(regs.bg_vofs[n]); s.integer(regs.vram_incmode); s.integer(regs.vram_mapping); s.integer(regs.vram_incsize); s.integer(regs.vram_addr); s.integer(regs.mode7_repeat); s.integer(regs.mode7_vflip); s.integer(regs.mode7_hflip); s.integer(regs.m7_latch); s.integer(regs.m7a); s.integer(regs.m7b); s.integer(regs.m7c); s.integer(regs.m7d); s.integer(regs.m7x); s.integer(regs.m7y); s.integer(regs.cgram_addr); s.integer(regs.cgram_latchdata); for(unsigned n = 0; n < 6; n++) s.integer(regs.window1_enabled[n]); for(unsigned n = 0; n < 6; n++) s.integer(regs.window1_invert [n]); for(unsigned n = 0; n < 6; n++) s.integer(regs.window2_enabled[n]); for(unsigned n = 0; n < 6; n++) s.integer(regs.window2_invert [n]); s.integer(regs.window1_left); s.integer(regs.window1_right); s.integer(regs.window2_left); s.integer(regs.window2_right); for(unsigned n = 0; n < 6; n++) s.integer(regs.window_mask[n]); for(unsigned n = 0; n < 5; n++) s.integer(regs.bg_enabled[n]); for(unsigned n = 0; n < 5; n++) s.integer(regs.bgsub_enabled[n]); for(unsigned n = 0; n < 5; n++) s.integer(regs.window_enabled[n]); for(unsigned n = 0; n < 5; n++) s.integer(regs.sub_window_enabled[n]); s.integer(regs.color_mask); s.integer(regs.colorsub_mask); s.integer(regs.addsub_mode); s.integer(regs.direct_color); s.integer(regs.color_mode); s.integer(regs.color_halve); for(unsigned n = 0; n < 6; n++) s.integer(regs.color_enabled[n]); s.integer(regs.color_r); s.integer(regs.color_g); s.integer(regs.color_b); s.integer(regs.color_rgb); s.integer(regs.mode7_extbg); s.integer(regs.pseudo_hires); s.integer(regs.overscan); s.integer(regs.scanlines); s.integer(regs.oam_interlace); s.integer(regs.interlace); s.integer(regs.hcounter); s.integer(regs.vcounter); s.integer(regs.latch_hcounter); s.integer(regs.latch_vcounter); s.integer(regs.counters_latched); s.integer(regs.vram_readbuffer); s.integer(regs.time_over); s.integer(regs.range_over); s.integer(regs.oam_itemcount); s.integer(regs.oam_tilecount); for(unsigned n = 0; n < 256; n++) { s.integer(pixel_cache[n].src_main); s.integer(pixel_cache[n].src_sub); s.integer(pixel_cache[n].bg_main); s.integer(pixel_cache[n].bg_sub); s.integer(pixel_cache[n].ce_main); s.integer(pixel_cache[n].ce_sub); s.integer(pixel_cache[n].pri_main); s.integer(pixel_cache[n].pri_sub); } //better to just take a small speed hit than store all of bg_tiledata[3][] ... flush_tiledata_cache(); for(unsigned n = 0; n < 6; n++) { s.array(window[n].main, 256); s.array(window[n].sub, 256); } for(unsigned n = 0; n < 4; n++) { s.integer(bg_info[n].tw); s.integer(bg_info[n].th); s.integer(bg_info[n].mx); s.integer(bg_info[n].my); s.integer(bg_info[n].scx); s.integer(bg_info[n].scy); } for(unsigned n = 0; n < 128; n++) { s.integer(sprite_list[n].width); s.integer(sprite_list[n].height); s.integer(sprite_list[n].x); s.integer(sprite_list[n].y); s.integer(sprite_list[n].character); s.integer(sprite_list[n].use_nameselect); s.integer(sprite_list[n].vflip); s.integer(sprite_list[n].hflip); s.integer(sprite_list[n].palette); s.integer(sprite_list[n].priority); s.integer(sprite_list[n].size); } s.integer(sprite_list_valid); s.integer(active_sprite); s.array(oam_itemlist, 32); for(unsigned n = 0; n < 34; n++) { s.integer(oam_tilelist[n].x); s.integer(oam_tilelist[n].y); s.integer(oam_tilelist[n].pri); s.integer(oam_tilelist[n].pal); s.integer(oam_tilelist[n].tile); s.integer(oam_tilelist[n].hflip); } s.array(oam_line_pal, 256); s.array(oam_line_pri, 256); } #endif fc/cartridge/chip/mmc1.cpp000664 001750 001750 00000005130 12651764221 016527 0ustar00sergiosergio000000 000000 struct MMC1 : Chip { enum class Revision : unsigned { MMC1, MMC1A, MMC1B1, MMC1B2, MMC1B3, MMC1C, } revision; unsigned writedelay; unsigned shiftaddr; unsigned shiftdata; bool chr_mode; bool prg_size; //0 = 32K, 1 = 16K bool prg_mode; uint2 mirror; //0 = first, 1 = second, 2 = vertical, 3 = horizontal uint5 chr_bank[2]; bool ram_disable; uint4 prg_bank; void main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(writedelay) writedelay--; tick(); } } unsigned prg_addr(unsigned addr) { bool region = addr & 0x4000; unsigned bank = (prg_bank & ~1) + region; if(prg_size) { bank = (region == 0 ? 0x0 : 0xf); if(region != prg_mode) bank = prg_bank; } return (bank << 14) | (addr & 0x3fff); } unsigned chr_addr(unsigned addr) { bool region = addr & 0x1000; unsigned bank = chr_bank[region]; if(chr_mode == 0) bank = (chr_bank[0] & ~1) | region; return (bank << 12) | (addr & 0x0fff); } unsigned ciram_addr(unsigned addr) { switch(mirror) { case 0: return 0x0000 | (addr & 0x03ff); case 1: return 0x0400 | (addr & 0x03ff); case 2: return ((addr & 0x0400) >> 0) | (addr & 0x03ff); case 3: return ((addr & 0x0800) >> 1) | (addr & 0x03ff); } } void mmio_write(unsigned addr, uint8 data) { if(writedelay) return; writedelay = 2; if(data & 0x80) { shiftaddr = 0; prg_size = 1; prg_mode = 1; } else { shiftdata = ((data & 1) << 4) | (shiftdata >> 1); if(++shiftaddr == 5) { shiftaddr = 0; switch((addr >> 13) & 3) { case 0: chr_mode = (shiftdata & 0x10); prg_size = (shiftdata & 0x08); prg_mode = (shiftdata & 0x04); mirror = (shiftdata & 0x03); break; case 1: chr_bank[0] = (shiftdata & 0x1f); break; case 2: chr_bank[1] = (shiftdata & 0x1f); break; case 3: ram_disable = (shiftdata & 0x10); prg_bank = (shiftdata & 0x0f); break; } } } } void power() { } void reset() { writedelay = 0; shiftaddr = 0; shiftdata = 0; chr_mode = 0; prg_size = 1; prg_mode = 1; mirror = 0; chr_bank[0] = 0; chr_bank[1] = 1; ram_disable = 0; prg_bank = 0; } void serialize(serializer& s) { s.integer(writedelay); s.integer(shiftaddr); s.integer(shiftdata); s.integer(chr_mode); s.integer(prg_size); s.integer(prg_mode); s.integer(mirror); s.array(chr_bank); s.integer(ram_disable); s.integer(prg_bank); } MMC1(Board& board) : Chip(board) { revision = Revision::MMC1B2; } }; sfc/cpu/timing/irq.cpp000664 001750 001750 00000005465 12651764221 016052 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP //called once every four clock cycles; //as NMI steps by scanlines (divisible by 4) and IRQ by PPU 4-cycle dots. // //ppu.(vh)counter(n) returns the value of said counters n-clocks before current time; //it is used to emulate hardware communication delay between opcode and interrupt units. void CPU::poll_interrupts() { //NMI hold if(status.nmi_hold) { status.nmi_hold = false; if(status.nmi_enabled) status.nmi_transition = true; } //NMI test bool nmi_valid = (vcounter(2) >= (!ppu.overscan() ? 225 : 240)); if(!status.nmi_valid && nmi_valid) { //0->1 edge sensitive transition status.nmi_line = true; status.nmi_hold = true; //hold /NMI for four cycles } else if(status.nmi_valid && !nmi_valid) { //1->0 edge sensitive transition status.nmi_line = false; } status.nmi_valid = nmi_valid; //IRQ hold status.irq_hold = false; if(status.irq_line) { if(status.virq_enabled || status.hirq_enabled) status.irq_transition = true; } //IRQ test bool irq_valid = (status.virq_enabled || status.hirq_enabled); if(irq_valid) { if((status.virq_enabled && vcounter(10) != (status.virq_pos)) || (status.hirq_enabled && hcounter(10) != (status.hirq_pos + 1) * 4) || (status.virq_pos && vcounter(6) == 0) //IRQs cannot trigger on last dot of field ) irq_valid = false; } if(!status.irq_valid && irq_valid) { //0->1 edge sensitive transition status.irq_line = true; status.irq_hold = true; //hold /IRQ for four cycles } status.irq_valid = irq_valid; } void CPU::nmitimen_update(uint8 data) { bool nmi_enabled = status.nmi_enabled; bool virq_enabled = status.virq_enabled; bool hirq_enabled = status.hirq_enabled; status.nmi_enabled = data & 0x80; status.virq_enabled = data & 0x20; status.hirq_enabled = data & 0x10; //0->1 edge sensitive transition if(!nmi_enabled && status.nmi_enabled && status.nmi_line) { status.nmi_transition = true; } //?->1 level sensitive transition if(status.virq_enabled && !status.hirq_enabled && status.irq_line) { status.irq_transition = true; } if(!status.virq_enabled && !status.hirq_enabled) { status.irq_line = false; status.irq_transition = false; } status.irq_lock = true; } bool CPU::rdnmi() { bool result = status.nmi_line; if(!status.nmi_hold) { status.nmi_line = false; } return result; } bool CPU::timeup() { bool result = status.irq_line; if(!status.irq_hold) { status.irq_line = false; status.irq_transition = false; } return result; } bool CPU::nmi_test() { if(!status.nmi_transition) return false; status.nmi_transition = false; regs.wai = false; return true; } bool CPU::irq_test() { if(!status.irq_transition && !regs.irq) return false; status.irq_transition = false; regs.wai = false; return !regs.p.i; } #endif phoenix/reference/widget/tab-frame.hpp000664 001750 001750 00000000663 12651764221 021157 0ustar00sergiosergio000000 000000 namespace phoenix { struct pTabFrame : public pWidget { TabFrame& tabFrame; void append(string text, const image& image); void remove(unsigned selection); void setImage(unsigned selection, const image& image); void setSelection(unsigned selection); void setText(unsigned selection, string text); pTabFrame(TabFrame& tabFrame) : pWidget(tabFrame), tabFrame(tabFrame) {} void constructor(); void destructor(); }; } sfc/alt/ppu-performance/window/window.hpp000664 001750 001750 00000001005 12651764221 021671 0ustar00sergiosergio000000 000000 struct LayerWindow { bool one_enable; bool one_invert; bool two_enable; bool two_invert; unsigned mask; bool main_enable; bool sub_enable; uint8 main[256]; uint8 sub[256]; void render(bool screen); void serialize(serializer&); }; struct ColorWindow { bool one_enable; bool one_invert; bool two_enable; bool two_invert; unsigned mask; unsigned main_mask; unsigned sub_mask; uint8 main[256]; uint8 sub[256]; void render(bool screen); void serialize(serializer&); }; phoenix/cocoa/window.cpp000664 001750 001750 00000026631 12651764221 016471 0ustar00sergiosergio000000 000000 @implementation CocoaWindow : NSWindow -(id) initWith:(phoenix::Window&)windowReference { window = &windowReference; NSUInteger style = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask; if(window->state.resizable) style |= NSResizableWindowMask; if(self = [super initWithContentRect:NSMakeRect(0, 0, 640, 480) styleMask:style backing:NSBackingStoreBuffered defer:YES]) { [self setDelegate:self]; [self setReleasedWhenClosed:NO]; [self setAcceptsMouseMovedEvents:YES]; [self setTitle:@""]; NSBundle* bundle = [NSBundle mainBundle]; NSDictionary* dictionary = [bundle infoDictionary]; NSString* applicationName = [dictionary objectForKey:@"CFBundleDisplayName"]; if(applicationName == nil) applicationName = [NSString stringWithUTF8String:phoenix::applicationState.name]; menuBar = [[NSMenu alloc] init]; NSMenuItem* item; string text; rootMenu = [[NSMenu alloc] init]; item = [[[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""] autorelease]; [item setSubmenu:rootMenu]; [menuBar addItem:item]; item = [[[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"About %@ ...", applicationName] action:@selector(menuAbout) keyEquivalent:@""] autorelease]; [item setTarget:self]; [rootMenu addItem:item]; [rootMenu addItem:[NSMenuItem separatorItem]]; item = [[[NSMenuItem alloc] initWithTitle:@"Preferences" action:@selector(menuPreferences) keyEquivalent:@""] autorelease]; [item setTarget:self]; [rootMenu addItem:item]; [rootMenu addItem:[NSMenuItem separatorItem]]; NSMenu* servicesMenu = [[[NSMenu alloc] initWithTitle:@"Services"] autorelease]; item = [[[NSMenuItem alloc] initWithTitle:@"Services" action:nil keyEquivalent:@""] autorelease]; [item setTarget:self]; [item setSubmenu:servicesMenu]; [rootMenu addItem:item]; [rootMenu addItem:[NSMenuItem separatorItem]]; [NSApp setServicesMenu:servicesMenu]; item = [[[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"Hide %@", applicationName] action:@selector(hide:) keyEquivalent:@""] autorelease]; [item setTarget:NSApp]; [rootMenu addItem:item]; item = [[[NSMenuItem alloc] initWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@""] autorelease]; [item setTarget:NSApp]; [rootMenu addItem:item]; item = [[[NSMenuItem alloc] initWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""] autorelease]; [item setTarget:NSApp]; [rootMenu addItem:item]; [rootMenu addItem:[NSMenuItem separatorItem]]; item = [[[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"Quit %@", applicationName] action:@selector(menuQuit) keyEquivalent:@""] autorelease]; [item setTarget:self]; [rootMenu addItem:item]; statusBar = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)]; [statusBar setAlignment:NSLeftTextAlignment]; [statusBar setBordered:YES]; [statusBar setBezeled:YES]; [statusBar setBezelStyle:NSTextFieldSquareBezel]; [statusBar setEditable:NO]; [statusBar setHidden:YES]; [[self contentView] addSubview:statusBar positioned:NSWindowBelow relativeTo:nil]; } return self; } -(BOOL) canBecomeKeyWindow { return YES; } -(BOOL) canBecomeMainWindow { return YES; } -(void) windowDidBecomeMain:(NSNotification*)notification { if(window->state.menu.size() > 0) { [NSApp setMainMenu:menuBar]; } } -(void) windowDidMove:(NSNotification*)notification { window->p.moveEvent(); } -(void) windowDidResize:(NSNotification*)notification { window->p.sizeEvent(); } -(BOOL) windowShouldClose:(id)sender { if(window->onClose) window->onClose(); else window->setVisible(false); if(window->state.modal && !window->visible()) window->setModal(false); return NO; } -(NSDragOperation) draggingEntered:(id)sender { return DropPathsOperation(sender); } -(BOOL) performDragOperation:(id)sender { lstring paths = DropPaths(sender); if(paths.empty()) return NO; if(window->onDrop) window->onDrop(paths); return YES; } -(NSMenu*) menuBar { return menuBar; } -(void) menuAbout { using phoenix::Application; if(Application::Cocoa::onAbout) Application::Cocoa::onAbout(); } -(void) menuPreferences { using phoenix::Application; if(Application::Cocoa::onPreferences) Application::Cocoa::onPreferences(); } -(void) menuQuit { using phoenix::Application; if(Application::Cocoa::onQuit) Application::Cocoa::onQuit(); } -(NSTextField*) statusBar { return statusBar; } @end namespace phoenix { Window& pWindow::none() { static Window* window = nullptr; if(window == nullptr) window = new Window; return *window; } void pWindow::append(Layout& layout) { Geometry geometry = window.state.geometry; geometry.x = geometry.y = 0; layout.setGeometry(geometry); statusBarReposition(); } void pWindow::append(Menu& menu) { @autoreleasepool { [[cocoaWindow menuBar] addItem:menu.p.cocoaAction]; } } void pWindow::append(Widget& widget) { if(widget.font().empty() && !window.state.widgetFont.empty()) { widget.setFont(window.state.widgetFont); } @autoreleasepool { [widget.p.cocoaView removeFromSuperview]; [[cocoaWindow contentView] addSubview:widget.p.cocoaView positioned:NSWindowAbove relativeTo:nil]; widget.p.setGeometry(widget.geometry()); [[cocoaWindow contentView] setNeedsDisplay:YES]; } } bool pWindow::focused() { @autoreleasepool { return [cocoaWindow isMainWindow] == YES; } } Geometry pWindow::frameMargin() { @autoreleasepool { NSRect frame = [cocoaWindow frameRectForContentRect:NSMakeRect(0, 0, 640, 480)]; return {abs(frame.origin.x), frame.size.height - 480, frame.size.width - 640, abs(frame.origin.y)}; } } Geometry pWindow::geometry() { @autoreleasepool { NSRect area = [cocoaWindow contentRectForFrameRect:[cocoaWindow frame]]; area.size.height -= statusBarHeight(); return {area.origin.x, Desktop::size().height - area.origin.y - area.size.height, area.size.width, area.size.height}; } } void pWindow::remove(Layout& layout) { @autoreleasepool { [[cocoaWindow contentView] setNeedsDisplay:YES]; } } void pWindow::remove(Menu& menu) { @autoreleasepool { [[cocoaWindow menuBar] removeItem:menu.p.cocoaAction]; } } void pWindow::remove(Widget& widget) { @autoreleasepool { [widget.p.cocoaView removeFromSuperview]; [[cocoaWindow contentView] setNeedsDisplay:YES]; } } void pWindow::setBackgroundColor(Color color) { @autoreleasepool { [cocoaWindow setBackgroundColor:[NSColor colorWithCalibratedRed:color.red / 255.0 green:color.green / 255.0 blue:color.blue / 255.0 alpha:color.alpha / 255.0 ] ]; } } void pWindow::setDroppable(bool droppable) { @autoreleasepool { if(droppable) { [cocoaWindow registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]]; } else { [cocoaWindow unregisterDraggedTypes]; } } } void pWindow::setFocused() { @autoreleasepool { [cocoaWindow makeKeyAndOrderFront:nil]; } } void pWindow::setFullScreen(bool fullScreen) { @autoreleasepool { if(fullScreen == true) { [NSApp setPresentationOptions:NSApplicationPresentationFullScreen]; [cocoaWindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; [cocoaWindow toggleFullScreen:nil]; } else { [cocoaWindow toggleFullScreen:nil]; [cocoaWindow setCollectionBehavior:NSWindowCollectionBehaviorDefault]; [NSApp setPresentationOptions:NSApplicationPresentationDefault]; } } } void pWindow::setGeometry(Geometry geometry) { locked = true; @autoreleasepool { [cocoaWindow setFrame:[cocoaWindow frameRectForContentRect:NSMakeRect( geometry.x, Desktop::size().height - geometry.y - geometry.height, geometry.width, geometry.height + statusBarHeight() ) ] display:YES ]; for(auto& layout : window.state.layout) { Geometry geometry = this->geometry(); geometry.x = geometry.y = 0; layout.setGeometry(geometry); } statusBarReposition(); } locked = false; } void pWindow::setMenuFont(string font) { } void pWindow::setMenuVisible(bool visible) { } void pWindow::setModal(bool modal) { @autoreleasepool { if(modal == true) { [NSApp runModalForWindow:cocoaWindow]; } else { [NSApp stopModal]; NSEvent* event = [NSEvent otherEventWithType:NSApplicationDefined location:NSMakePoint(0, 0) modifierFlags:0 timestamp:0.0 windowNumber:0 context:nil subtype:0 data1:0 data2:0]; [NSApp postEvent:event atStart:true]; } } } void pWindow::setResizable(bool resizable) { @autoreleasepool { NSUInteger style = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask; if(resizable) style |= NSResizableWindowMask; [cocoaWindow setStyleMask:style]; } } void pWindow::setStatusFont(string font) { @autoreleasepool { [[cocoaWindow statusBar] setFont:pFont::cocoaFont(font)]; } statusBarReposition(); } void pWindow::setStatusText(string text) { @autoreleasepool { [[cocoaWindow statusBar] setStringValue:[NSString stringWithUTF8String:text]]; } } void pWindow::setStatusVisible(bool visible) { @autoreleasepool { [[cocoaWindow statusBar] setHidden:!visible]; setGeometry(geometry()); } } void pWindow::setTitle(string text) { @autoreleasepool { [cocoaWindow setTitle:[NSString stringWithUTF8String:text]]; } } void pWindow::setVisible(bool visible) { @autoreleasepool { if(visible) [cocoaWindow makeKeyAndOrderFront:nil]; else [cocoaWindow orderOut:nil]; } } void pWindow::setWidgetFont(string font) { } void pWindow::constructor() { @autoreleasepool { cocoaWindow = [[CocoaWindow alloc] initWith:window]; NSColor* color = [[cocoaWindow backgroundColor] colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; window.state.backgroundColor = Color( (uint8_t)(255 * [color redComponent]), (uint8_t)(255 * [color greenComponent]), (uint8_t)(255 * [color blueComponent]), (uint8_t)(255 * [color alphaComponent]) ); } } void pWindow::destructor() { @autoreleasepool { [cocoaWindow release]; } } void pWindow::moveEvent() { if(locked == false && window.fullScreen() == false && window.visible() == true) { Geometry geometry = this->geometry(); window.state.geometry.x = geometry.x; window.state.geometry.y = geometry.y; } if(locked == false) { if(window.onMove) window.onMove(); } } void pWindow::sizeEvent() { if(locked == false && window.fullScreen() == false && window.visible() == true) { Geometry geometry = this->geometry(); window.state.geometry.width = geometry.width; window.state.geometry.height = geometry.height; } for(auto& layout : window.state.layout) { Geometry geometry = this->geometry(); geometry.x = geometry.y = 0; layout.setGeometry(geometry); } statusBarReposition(); if(locked == false) { if(window.onSize) window.onSize(); } } unsigned pWindow::statusBarHeight() { if(!window.state.statusVisible) return 0; return Font::size(window.state.statusFont, " ").height + 6; } void pWindow::statusBarReposition() { @autoreleasepool { NSRect area = [cocoaWindow contentRectForFrameRect:[cocoaWindow frame]]; [[cocoaWindow statusBar] setFrame:NSMakeRect(0, 0, area.size.width, statusBarHeight())]; [[cocoaWindow contentView] setNeedsDisplay:YES]; } } } sfc/alt/ppu-balanced/render/oam.cpp000664 001750 001750 00000017552 12651764221 020347 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP void PPU::update_sprite_list(unsigned addr, uint8 data) { if(addr < 0x0200) { unsigned i = addr >> 2; switch(addr & 3) { case 0: sprite_list[i].x = (sprite_list[i].x & 0x0100) | data; break; case 1: sprite_list[i].y = (data + 1) & 0xff; break; case 2: sprite_list[i].character = data; break; case 3: sprite_list[i].vflip = data & 0x80; sprite_list[i].hflip = data & 0x40; sprite_list[i].priority = (data >> 4) & 3; sprite_list[i].palette = (data >> 1) & 7; sprite_list[i].use_nameselect = data & 0x01; } } else { unsigned i = (addr & 0x1f) << 2; sprite_list[i + 0].x = ((data & 0x01) << 8) | (sprite_list[i + 0].x & 0xff); sprite_list[i + 0].size = data & 0x02; sprite_list[i + 1].x = ((data & 0x04) << 6) | (sprite_list[i + 1].x & 0xff); sprite_list[i + 1].size = data & 0x08; sprite_list[i + 2].x = ((data & 0x10) << 4) | (sprite_list[i + 2].x & 0xff); sprite_list[i + 2].size = data & 0x20; sprite_list[i + 3].x = ((data & 0x40) << 2) | (sprite_list[i + 3].x & 0xff); sprite_list[i + 3].size = data & 0x80; } } void PPU::build_sprite_list() { if(sprite_list_valid == true) return; sprite_list_valid = true; for(unsigned i = 0; i < 128; i++) { const bool size = sprite_list[i].size; switch(cache.oam_basesize) { case 0: sprite_list[i].width = (!size) ? 8 : 16; sprite_list[i].height = (!size) ? 8 : 16; break; case 1: sprite_list[i].width = (!size) ? 8 : 32; sprite_list[i].height = (!size) ? 8 : 32; break; case 2: sprite_list[i].width = (!size) ? 8 : 64; sprite_list[i].height = (!size) ? 8 : 64; break; case 3: sprite_list[i].width = (!size) ? 16 : 32; sprite_list[i].height = (!size) ? 16 : 32; break; case 4: sprite_list[i].width = (!size) ? 16 : 64; sprite_list[i].height = (!size) ? 16 : 64; break; case 5: sprite_list[i].width = (!size) ? 32 : 64; sprite_list[i].height = (!size) ? 32 : 64; break; case 6: sprite_list[i].width = (!size) ? 16 : 32; sprite_list[i].height = (!size) ? 32 : 64; if(regs.oam_interlace && !size) sprite_list[i].height = 16; //32x64 height is not affected by oam_interlace setting break; case 7: sprite_list[i].width = (!size) ? 16 : 32; sprite_list[i].height = (!size) ? 32 : 32; if(regs.oam_interlace && !size) sprite_list[i].height = 16; break; } } } bool PPU::is_sprite_on_scanline() { //if sprite is entirely offscreen and doesn't wrap around to the left side of the screen, //then it is not counted. this *should* be 256, and not 255, even though dot 256 is offscreen. sprite_item* spr = &sprite_list[active_sprite]; if(spr->x > 256 && (spr->x + spr->width - 1) < 512) return false; int spr_height = (regs.oam_interlace == false) ? (spr->height) : (spr->height >> 1); if(line >= spr->y && line < (spr->y + spr_height)) return true; if((spr->y + spr_height) >= 256 && line < ((spr->y + spr_height) & 255)) return true; return false; } void PPU::load_oam_tiles() { sprite_item* spr = &sprite_list[active_sprite]; uint16 tile_width = spr->width >> 3; int x = spr->x; int y = (line - spr->y) & 0xff; if(regs.oam_interlace == true) { y <<= 1; } if(spr->vflip == true) { if(spr->width == spr->height) { y = (spr->height - 1) - y; } else { y = (y < spr->width) ? ((spr->width - 1) - y) : (spr->width + ((spr->width - 1) - (y - spr->width))); } } if(regs.oam_interlace == true) { y = (spr->vflip == false) ? (y + field()) : (y - field()); } x &= 511; y &= 255; uint16 tdaddr = cache.oam_tdaddr; uint16 chrx = (spr->character ) & 15; uint16 chry = (spr->character >> 4) & 15; if(spr->use_nameselect == true) { tdaddr += (256 * 32) + (cache.oam_nameselect << 13); } chry += (y >> 3); chry &= 15; chry <<= 4; for(unsigned tx = 0; tx < tile_width; tx++) { unsigned sx = (x + (tx << 3)) & 511; //ignore sprites that are offscreen, x==256 is a special case that loads all tiles in OBJ if(x != 256 && sx >= 256 && (sx + 7) < 512) continue; if(regs.oam_tilecount++ >= 34) break; unsigned n = regs.oam_tilecount - 1; oam_tilelist[n].x = sx; oam_tilelist[n].y = y; oam_tilelist[n].pri = spr->priority; oam_tilelist[n].pal = 128 + (spr->palette << 4); oam_tilelist[n].hflip = spr->hflip; unsigned mx = (spr->hflip == false) ? tx : ((tile_width - 1) - tx); unsigned pos = tdaddr + ((chry + ((chrx + mx) & 15)) << 5); oam_tilelist[n].tile = (pos >> 5) & 0x07ff; } } void PPU::render_oam_tile(int tile_num) { oam_tileitem* t = &oam_tilelist[tile_num]; uint8* oam_td = (uint8*)bg_tiledata[COLORDEPTH_16]; uint8* oam_td_state = (uint8*)bg_tiledata_state[COLORDEPTH_16]; if(oam_td_state[t->tile] == 1) { render_bg_tile(t->tile); } unsigned sx = t->x; uint8* tile_ptr = (uint8*)oam_td + (t->tile << 6) + ((t->y & 7) << 3); for(unsigned x = 0; x < 8; x++) { sx &= 511; if(sx < 256) { unsigned col = *(tile_ptr + ((t->hflip == false) ? x : (7 - x))); if(col) { col += t->pal; oam_line_pal[sx] = col; oam_line_pri[sx] = t->pri; } } sx++; } } void PPU::render_line_oam_rto() { build_sprite_list(); regs.oam_itemcount = 0; regs.oam_tilecount = 0; memset(oam_line_pri, OAM_PRI_NONE, 256); memset(oam_itemlist, 0xff, 32); for(int s = 0; s < 34; s++) oam_tilelist[s].tile = 0xffff; for(int s = 0; s < 128; s++) { active_sprite = (s + regs.oam_firstsprite) & 127; if(is_sprite_on_scanline() == false) continue; if(regs.oam_itemcount++ >= 32) break; oam_itemlist[regs.oam_itemcount - 1] = (s + regs.oam_firstsprite) & 127; } if(regs.oam_itemcount > 0 && oam_itemlist[regs.oam_itemcount - 1] != 0xff) { regs.ioamaddr = 0x0200 + (oam_itemlist[regs.oam_itemcount - 1] >> 2); } for(int s = 31; s >= 0; s--) { if(oam_itemlist[s] == 0xff) continue; active_sprite = oam_itemlist[s]; load_oam_tiles(); } regs.time_over |= (regs.oam_tilecount > 34); regs.range_over |= (regs.oam_itemcount > 32); } #define setpixel_main(x) \ if(pixel_cache[x].pri_main < pri) { \ pixel_cache[x].pri_main = pri; \ pixel_cache[x].bg_main = OAM; \ pixel_cache[x].src_main = get_palette(oam_line_pal[x]); \ pixel_cache[x].ce_main = (oam_line_pal[x] < 192); \ } #define setpixel_sub(x) \ if(pixel_cache[x].pri_sub < pri) { \ pixel_cache[x].pri_sub = pri; \ pixel_cache[x].bg_sub = OAM; \ pixel_cache[x].src_sub = get_palette(oam_line_pal[x]); \ pixel_cache[x].ce_sub = (oam_line_pal[x] < 192); \ } void PPU::render_line_oam(uint8 pri0_pos, uint8 pri1_pos, uint8 pri2_pos, uint8 pri3_pos) { if(layer_enabled[OAM][0] == false) pri0_pos = 0; if(layer_enabled[OAM][1] == false) pri1_pos = 0; if(layer_enabled[OAM][2] == false) pri2_pos = 0; if(layer_enabled[OAM][3] == false) pri3_pos = 0; if(pri0_pos + pri1_pos + pri2_pos + pri3_pos == 0) return; if(regs.bg_enabled[OAM] == false && regs.bgsub_enabled[OAM] == false) return; for(unsigned s = 0; s < 34; s++) { if(oam_tilelist[s].tile == 0xffff) continue; render_oam_tile(s); } bool bg_enabled = regs.bg_enabled[OAM]; bool bgsub_enabled = regs.bgsub_enabled[OAM]; build_window_tables(OAM); uint8* wt_main = window[OAM].main; uint8* wt_sub = window[OAM].sub; unsigned pri_tbl[4] = { pri0_pos, pri1_pos, pri2_pos, pri3_pos }; for(int x = 0; x < 256; x++) { if(oam_line_pri[x] == OAM_PRI_NONE) continue; unsigned pri = pri_tbl[oam_line_pri[x]]; if(bg_enabled == true && !wt_main[x]) { setpixel_main(x); } if(bgsub_enabled == true && !wt_sub[x]) { setpixel_sub(x); } } } #undef setpixel_main #undef setpixel_sub #endif nall/mosaic/parser.hpp000664 001750 001750 00000011336 12651764221 016122 0ustar00sergiosergio000000 000000 #ifdef NALL_MOSAIC_INTERNAL_HPP namespace nall { namespace mosaic { struct parser { image canvas; //export from bitstream to canvas void load(bitstream& stream, uint64_t offset, context& ctx, unsigned width, unsigned height) { canvas.allocate(width, height); canvas.fill(ctx.paddingColor); parse(1, stream, offset, ctx, width, height); } //import from canvas to bitstream bool save(bitstream& stream, uint64_t offset, context& ctx) { if(stream.readonly) return false; parse(0, stream, offset, ctx, canvas.width, canvas.height); return true; } inline parser() : canvas(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0) { } private: uint32_t read(unsigned x, unsigned y) const { unsigned addr = y * canvas.width + x; if(addr >= canvas.width * canvas.height) return 0u; uint32_t *buffer = (uint32_t*)canvas.data; return buffer[addr]; } void write(unsigned x, unsigned y, uint32_t data) { unsigned addr = y * canvas.width + x; if(addr >= canvas.width * canvas.height) return; uint32_t *buffer = (uint32_t*)canvas.data; buffer[addr] = data; } void parse(bool load, bitstream& stream, uint64_t offset, context& ctx, unsigned width, unsigned height) { stream.endian = ctx.endian; unsigned canvasWidth = width / (ctx.mosaicWidth * ctx.tileWidth * ctx.blockWidth + ctx.paddingWidth); unsigned canvasHeight = height / (ctx.mosaicHeight * ctx.tileHeight * ctx.blockHeight + ctx.paddingHeight); unsigned bitsPerBlock = ctx.depth * ctx.blockWidth * ctx.blockHeight; unsigned objectOffset = 0; for(unsigned objectY = 0; objectY < canvasHeight; objectY++) { for(unsigned objectX = 0; objectX < canvasWidth; objectX++) { if(objectOffset >= ctx.count && ctx.count > 0) break; unsigned objectIX = objectX * ctx.objectWidth(); unsigned objectIY = objectY * ctx.objectHeight(); objectOffset++; unsigned mosaicOffset = 0; for(unsigned mosaicY = 0; mosaicY < ctx.mosaicHeight; mosaicY++) { for(unsigned mosaicX = 0; mosaicX < ctx.mosaicWidth; mosaicX++) { unsigned mosaicData = ctx.mosaic(mosaicOffset, mosaicOffset); unsigned mosaicIX = (mosaicData % ctx.mosaicWidth) * (ctx.tileWidth * ctx.blockWidth); unsigned mosaicIY = (mosaicData / ctx.mosaicWidth) * (ctx.tileHeight * ctx.blockHeight); mosaicOffset++; unsigned tileOffset = 0; for(unsigned tileY = 0; tileY < ctx.tileHeight; tileY++) { for(unsigned tileX = 0; tileX < ctx.tileWidth; tileX++) { unsigned tileData = ctx.tile(tileOffset, tileOffset); unsigned tileIX = (tileData % ctx.tileWidth) * ctx.blockWidth; unsigned tileIY = (tileData / ctx.tileWidth) * ctx.blockHeight; tileOffset++; unsigned blockOffset = 0; for(unsigned blockY = 0; blockY < ctx.blockHeight; blockY++) { for(unsigned blockX = 0; blockX < ctx.blockWidth; blockX++) { if(load) { unsigned palette = 0; for(unsigned n = 0; n < ctx.depth; n++) { unsigned index = blockOffset++; if(ctx.order == 1) index = (index % ctx.depth) * ctx.blockWidth * ctx.blockHeight + (index / ctx.depth); palette |= stream.read(offset + ctx.block(index, index)) << n; } write( objectIX + mosaicIX + tileIX + blockX, objectIY + mosaicIY + tileIY + blockY, ctx.palette(palette, palette) ); } else /* save */ { uint32_t palette = read( objectIX + mosaicIX + tileIX + blockX, objectIY + mosaicIY + tileIY + blockY ); for(unsigned n = 0; n < ctx.depth; n++) { unsigned index = blockOffset++; if(ctx.order == 1) index = (index % ctx.depth) * ctx.blockWidth * ctx.blockHeight + (index / ctx.depth); stream.write(offset + ctx.block(index, index), palette & 1); palette >>= 1; } } } //blockX } //blockY offset += ctx.blockStride; } //tileX offset += ctx.blockOffset; } //tileY offset += ctx.tileStride; } //mosaicX offset += ctx.tileOffset; } //mosaicY offset += ctx.mosaicStride; } //objectX offset += ctx.mosaicOffset; } //objectY } }; } } #endif sfc/chip/bsx/serialization.cpp000664 001750 001750 00000000222 12651764221 017557 0ustar00sergiosergio000000 000000 #ifdef BSX_CPP void BSXCartridge::serialize(serializer& s) { s.array(ram.data(), ram.size()); s.array(psram.data(), psram.size()); } #endif README000664 001750 001750 00000003530 12651764221 012571 0ustar00sergiosergio000000 000000 bsnes-mercury ------------- bsnes-mercury is a fork of higan, aiming to restore some useful features that have been removed, as well as improving performance a bit. Maximum accuracy is still uncompromisable; anything that affects accuracy is optional and off by default. Changes to upstream: - The biggest change is getting the interface sane, which is accomplished through libretro. - 'inline' was added all across the PPU subclasses. Framerate went up by 20% from such a trivial change! (Spamming inline elsewhere does little if anything, so it wasn't done.) - A fast path was added to various parts of the CPU bus, improving framerate by about 2.5%. - libco has been changed quite a bit, both for performance, readability, and portability to more platforms. - A seven-line function in sfc/memory/memory-inline.hpp was replaced, which speeds up ROM load by roughly a factor 6 (1.2s -> 0.2s). (This change was developed for upstream, and the author of higan was mostly positive; it is likely to appear in bsnes v095.) - A section in sfc/memory/memory.cpp was specialized for the common, easy, case. This speeds up ROM load time by about a third. - HLE emulation of some special chips is optionally restored (defaults to LLE), to improve performance and reduce reliance on those chip ROMs (they're not really easy to find). Chips for which no HLE emulation was developed (ST-0011 and ST-0018) are still LLE. - SuperFX overclock is now available (off by default, of course); if enabled, it makes Star Fox look quite a lot smoother. Todo list: - Is the compat core's DSP identical to that of the accuracy core, but a bit faster? - Examine if ST-0011 is confused by attempts to HLE it. The name is because metals are shiny, like the accuracy promises of bsnes, and mercury is the fastest metal. And like byuu's constantly changing interfaces, mercury is harmful to your brain :) sfc/chip/armdsp/registers.hpp000664 001750 001750 00000000476 12651764221 017423 0ustar00sergiosergio000000 000000 struct Bridge { struct Buffer { bool ready; uint8 data; }; Buffer cputoarm; Buffer armtocpu; uint32 timer; uint32 timerlatch; bool reset; bool ready; bool signal; uint8 status() const { return (ready << 7) | (cputoarm.ready << 3) | (signal << 2) | (armtocpu.ready << 0); } } bridge; sfc/dsp/dsp.hpp000664 001750 001750 00000010455 12651764221 014555 0ustar00sergiosergio000000 000000 struct DSP : Thread { enum : bool { Threaded = true }; alwaysinline void step(unsigned clocks); alwaysinline void synchronize_smp(); bool mute(); uint8 read(uint8 addr); void write(uint8 addr, uint8 data); void enter(); void power(); void reset(); void serialize(serializer&); DSP(); ~DSP(); privileged: #include "moduloarray.hpp" //global registers enum global_reg_t { r_mvoll = 0x0c, r_mvolr = 0x1c, r_evoll = 0x2c, r_evolr = 0x3c, r_kon = 0x4c, r_koff = 0x5c, r_flg = 0x6c, r_endx = 0x7c, r_efb = 0x0d, r_pmon = 0x2d, r_non = 0x3d, r_eon = 0x4d, r_dir = 0x5d, r_esa = 0x6d, r_edl = 0x7d, r_fir = 0x0f, //8 coefficients at 0x0f, 0x1f, ... 0x7f }; //voice registers enum voice_reg_t { v_voll = 0x00, v_volr = 0x01, v_pitchl = 0x02, v_pitchh = 0x03, v_srcn = 0x04, v_adsr0 = 0x05, v_adsr1 = 0x06, v_gain = 0x07, v_envx = 0x08, v_outx = 0x09, }; //internal envelope modes enum env_mode_t { env_release, env_attack, env_decay, env_sustain }; //internal constants enum { echo_hist_size = 8 }; enum { brr_buf_size = 12 }; enum { brr_block_size = 9 }; //global state struct state_t { uint8 regs[128]; moduloarray echo_hist[2]; //echo history keeps most recent 8 samples int echo_hist_pos; bool every_other_sample; //toggles every sample int kon; //KON value when last checked int noise; int counter; int echo_offset; //offset from ESA in echo buffer int echo_length; //number of bytes that echo_offset will stop at //hidden registers also written to when main register is written to int new_kon; int endx_buf; int envx_buf; int outx_buf; //temporary state between clocks //read once per sample int t_pmon; int t_non; int t_eon; int t_dir; int t_koff; //read a few clocks ahead before used int t_brr_next_addr; int t_adsr0; int t_brr_header; int t_brr_byte; int t_srcn; int t_esa; int t_echo_disabled; //internal state that is recalculated every sample int t_dir_addr; int t_pitch; int t_output; int t_looped; int t_echo_ptr; //left/right sums int t_main_out[2]; int t_echo_out[2]; int t_echo_in [2]; } state; //voice state struct voice_t { moduloarray buffer; //decoded samples int buf_pos; //place in buffer where next samples will be decoded int interp_pos; //relative fractional position in sample (0x1000 = 1.0) int brr_addr; //address of current BRR block int brr_offset; //current decoding offset in BRR block int vbit; //bitmask for voice: 0x01 for voice 0, 0x02 for voice 1, etc int vidx; //voice channel register index: 0x00 for voice 0, 0x10 for voice 1, etc int kon_delay; //KON delay/current setup phase int env_mode; int env; //current envelope level int t_envx_out; int hidden_env; //used by GAIN mode 7, very obscure quirk } voice[8]; //gaussian static const int16 gaussian_table[512]; int gaussian_interpolate(const voice_t& v); //counter enum { counter_range = 2048 * 5 * 3 }; //30720 (0x7800) static const uint16 counter_rate[32]; static const uint16 counter_offset[32]; void counter_tick(); bool counter_poll(unsigned rate); //envelope void envelope_run(voice_t& v); //brr void brr_decode(voice_t& v); //misc void misc_27(); void misc_28(); void misc_29(); void misc_30(); //voice void voice_output(voice_t& v, bool channel); void voice_1 (voice_t &v); void voice_2 (voice_t &v); void voice_3 (voice_t &v); void voice_3a(voice_t &v); void voice_3b(voice_t &v); void voice_3c(voice_t &v); void voice_4 (voice_t &v); void voice_5 (voice_t &v); void voice_6 (voice_t &v); void voice_7 (voice_t &v); void voice_8 (voice_t &v); void voice_9 (voice_t &v); //echo int calc_fir(int i, bool channel); int echo_output(bool channel); void echo_read(bool channel); void echo_write(bool channel); void echo_22(); void echo_23(); void echo_24(); void echo_25(); void echo_26(); void echo_27(); void echo_28(); void echo_29(); void echo_30(); //dsp static void Enter(); void tick(); }; extern DSP dsp; sfc/alt/dsp/dsp.hpp000664 001750 001750 00000000753 12651764221 015335 0ustar00sergiosergio000000 000000 #include "SPC_DSP.h" struct DSP : Thread { enum : bool { Threaded = false }; alwaysinline void step(unsigned clocks); alwaysinline void synchronize_smp(); bool mute(); uint8 read(uint8 addr); void write(uint8 addr, uint8 data); void enter(); void power(); void reset(); void channel_enable(unsigned channel, bool enable); void serialize(serializer&); DSP(); private: SPC_DSP spc_dsp; int16 samplebuffer[8192]; bool channel_enabled[8]; }; extern DSP dsp; ananke/heuristics/000700 001750 001750 00000000000 12656700342 015312 5ustar00sergiosergio000000 000000 sfc/chip/sdd1/serialization.cpp000664 001750 001750 00000000442 12651764221 017622 0ustar00sergiosergio000000 000000 #ifdef SDD1_CPP void SDD1::serialize(serializer& s) { s.array(ram.data(), ram.size()); s.integer(sdd1_enable); s.integer(xfer_enable); s.integer(dma_ready); s.array(mmc); for(unsigned n = 0; n < 8; n++) { s.integer(dma[n].addr); s.integer(dma[n].size); } } #endif ananke/database/super-famicom.hpp000664 001750 001750 00001470570 12651764221 020207 0ustar00sergiosergio000000 000000 string SuperFamicom = R"( database revision=2013-01-22 release cartridge region=NTSC board id:BSC-1A5B9P-01 bsx rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 ram name=download.ram size=0x40000 map id=io address=00-3f,80-bf:5000-5fff map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-5f,c0-ff:0000-ffff map id=rom address=78-7d:0000-ffff map id=ram address=20-3f:6000-7fff mask=0xe000 map id=ram address=70-77:0000-ffff information title: BS-X それは名前を盗まれた待の物語 name: BS-X - Sore wa Namae o Nusumareta Machi no Monogatari region: JP revision: 1.1 board: BSC-1A5B9P-01 serial: SHVC-ZBSJ-JPN sha256: 3ce321496edc5d77038de2034eb3fb354d7724afd0bc7fd0319f3eb5d57b984d configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 ram name=download.ram size=0x40000 release cartridge region=NTSC board type=LDH3C revision=01 spc7110 rom name=program.rom size=0x100000 rom name=data.rom size=0x400000 ram name=save.ram size=0x2000 map id=io address=00-3f,80-bf:4800-483f map id=io address=50,58:0000-ffff map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=c0-ff:0000-ffff map id=ram address=00-3f,80-bf:6000-7fff mask=0xe000 epsonrtc ram name=rtc.ram size=0x10 map id=io address=00-3f,80-bf:4840-4842 information title: Far East of Eden 天外魔境 Zero name: Far East of Eden - Tengai Makyou Zero region: JP revision: 1.0 board: SHVC-LDH3C-01 serial: SHVC-AZRJ-JPN sha256: 8620203da71d32d017bb21f542864c1d90705b87eb67815d06b43f09120318aa configuration rom name=program.rom size=0x100000 rom name=data.rom size=0x400000 ram name=save.ram size=0x2000 ram name=rtc.ram size=0x10 release cartridge region=NTSC board type=LDH3C revision=01 spc7110 rom name=program.rom size=0x100000 rom name=data.rom size=0x400000 ram name=save.ram size=0x2000 map id=io address=00-3f,80-bf:4800-483f map id=io address=50,58:0000-ffff map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=c0-ff:0000-ffff map id=ram address=00-3f,80-bf:6000-7fff mask=0xe000 epsonrtc ram name=rtc.ram size=0x10 map id=io address=00-3f,80-bf:4840-4842 information title: Far East of Eden 天外魔境 Zero 少年ジャンプの章 name: Far East of Eden - Tengai Makyou Zero - Shounen Jump no Shou region: JP revision: 1.0 board: SHVC-LDH3C-01 serial: SHVC-AZQJ-JPN sha256: 69d06a3f3a4f3ba769541fe94e92b42142e423e9f0924eab97865b2d826ec82d configuration rom name=program.rom size=0x100000 rom name=data.rom size=0x400000 ram name=save.ram size=0x2000 ram name=rtc.ram size=0x10 release cartridge region=NTSC board type=1DS0B revision=10,20 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 necdsp model=uPD96050 frequency=11000000 rom name=st011.program.rom size=0xc000 rom name=st011.data.rom size=0x1000 ram name=save.ram size=0x1000 map id=io address=60-67,e0-e7:0000-3fff select=0x0001 map id=ram address=68-6f,e8-ef:0000-7fff information title: 早指し二段森田将棋 name: Hayazashi Nidan Morita Shougi region: JP revision: 1.0 board: SHVC-1DS0B-10 serial: SHVC-2M sha256: 5b1a90c70df7537743900ad159e92ba3f72e4560934a64a46d62faba2ca83a70 configuration rom name=program.rom size=0x80000 rom name=st011.program.rom size=0xc000 rom name=st011.data.rom size=0x1000 ram name=save.ram size=0x1000 release cartridge region=NTSC board type=1DE3B revision=01 rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=rom address=40-5f,c0-df:0000-ffff mask=0x8000 map id=ram address=60-7d,e0-ff:0000-ffff armdsp frequency=21477272 rom name=st018.program.rom size=0x20000 rom name=st018.data.rom size=0x8000 ram size=0x4000 map id=io address=00-3f,80-bf:3800-38ff information title: 早指し二段森田将棋2 name: Hayazashi Nidan Morita Shougi 2 region: JP revision: 1.0 board: SHVC-1DE3B-01 serial: SHVC-A2MJ-JPN sha256: 3dd659d048aba8fc7d07b6ab726c9f711c948141e99e393685ae6cc311a83dc5 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 rom name=st018.program.rom size=0x20000 rom name=st018.data.rom size=0x8000 ram name=st018.program.ram size=0x4000 release cartridge region=NTSC board type=2P3B revision=01 rom name=program.rom size=0x80000 map id=rom address=00-0f,80-8f:8000-ffff map id=rom address=40-4f,c0-cf:0000-ffff information title: くにおくんのドッジボールだよ 全員集合! トーナメント スペシャル name: Kunio-kun no Dodge Ball da yo - Zen'in Shuugou! Tournament Special region: JP revision: 1.0 board: SHVC-2P3B-01 serial: N/A sha256: bcba4ca39f0279f7a52657bccbffa84564eaea455e2565597b93942ec245fdb1 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board id:BSC-1J3M-01 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff map id=rom address=40-5f,c0-df:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 satellaview map id=rom address=20-3f,a0-bf:8000-ffff map id=rom address=60-7d,e0-ff:0000-ffff information title: 鮫亀 name: Same Game region: JP revision: 1.0 board: BSC-1J3M-01 serial: SHVC-ZS5J-JPN sha256: 3a709383208d8258dceb20a5e566903326515ba42931bf97fd389a415a13a72d configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board id:Sufami Turbo rom name=program.rom size=0x40000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 sufamiturbo map id=rom address=20-3f,a0-bf:8000-ffff mask=0x8000 map id=ram address=60-6f,e0-ef:0000-ffff sufamiturbo map id=rom address=40-5f,c0-df:0000-7fff mask=0x8000 map id=rom address=40-5f,c0-df:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: スーファミターボ name: Sufami Turbo region: JP revision: 1.0 board: Sufami Turbo serial: SFT-0100-JPN sha256: edacb453da14f825f05d1134d6035f4bf034e55f7cfb97c70c4ee107eabc7342 configuration rom name=program.rom size=0x40000 release cartridge region=NTSC board type=LJ3M revision=01 rom name=program.rom size=0x600000 ram name=save.ram size=0x2000 map id=rom address=00-3f:8000-ffff base=0x400000 map id=rom address=40-7d:0000-ffff base=0x400000 map id=rom address=80-bf:8000-ffff mask=0xc00000 map id=rom address=c0-ff:0000-ffff mask=0xc00000 map id=ram address=80-bf:6000-7fff mask=0xe000 information title: テイルズ オブ ファンタジア name: Tales of Phantasia region: JP revision: 1.0 board: SHVC-LJ3M-01 serial: SHVC-ATVJ-JPN sha256: 77b2d5450ce3c87185f913c2584673530c13dfbe8cc433b1e9fe5e9a653bf7d5 configuration rom name=program.rom size=0x600000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: ヨッシーのクッキー クルッポンオーブンでクッキー name: Yoshi no Cookie - Kuruppon Oven de Cookie region: JP revision: 1.0 board: SHVC-1A0N-10 serial: SHVC-YO sha256: 2b2fe61ac7a79c3cfaa0bc16f1b1f4da544fcc37cfdf3c18879d31b8b9f87941 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: 3 Ninjas Kick Back name: 3 Ninjas Kick Back region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-A3NE-USA sha256: 2ffe8828480f943056fb1ab5c3c84d48a0bf8cbe3ed7c9960b349b59adb07f3b configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=2J3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=10-1f,30-3f:6000-7fff mask=0xe000 map id=ram address=90-9f,b0-bf:6000-7fff mask=0xe000 information title: The 7th Saga name: 7th Saga, The region: NA revision: 1.0 board: SHVC-2J3M-01 serial: SNS-EL-USA sha256: 4dd631433c867ba920997fd3add2c838b62e70e06e0ef55c53884b8b68b0dd27 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Aaahh!!! Real Monsters name: Aaahh!!! Real Monsters region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-ANNE-USA sha256: ce164872c4f5814bce04cf0565edcdb5b7969ae95a3b5cd515cfb626b5cde7b3 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: ABC Monday Night Football name: ABC Monday Night Football region: NA revision: 1.0 board: SHVC-1A3M-10 serial: SNS-N5-USA sha256: bb83f982961c33b81fefc1f545e18ab572d1c43cf6c241948544f05a1a71f2ba configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A5M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: ACME Animation Factory name: ACME Animation Factory region: NA revision: 1.0 board: SHVC-1A5M-11 serial: SNS-ACME-USA sha256: d07e8802a6d9c777247874e05ec08fce7e0fa1bf122cc1ab9913f7d828e4072b configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: ActRaiser name: ActRaiser region: NA revision: 1.0 board: SHVC-1A3B-11 serial: SNS-AR-USA sha256: b8055844825653210d252d29a2229f9a3e7e512004e83940620173c57d8723f0 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=2J0N revision=01,10,11 rom name=program.rom size=0x180000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: ActRaiser 2 name: ActRaiser 2 region: NA revision: 1.0 board: SHVC-2J0N-01 serial: SNS-A8-USA sha256: 71bdd448a30b88725864e55594ebb67a118b1f197a3f9e5dd39dbf23399efa15 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Addams Family name: Addams Family region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-AF-USA sha256: e645310d2406ace85523ed91070ee7ff6aa245217267dacb158ae9fc75109692 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Addams Family 2: Pugsley's Scavenger Hunt name: Addams Family 2 - Pugsley's Scavenger Hunt region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-AH-USA sha256: b6957bae7fd97ba681afbf8962fe2138e209649fd88ed9add2d5233178680aaa configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Addams Family Values name: Addams Family Values region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-VY-USA sha256: f59a0a8ed11ea2ba6217b1640e74bab8d8d8161a4585f5ae4a02edd7958ad9a3 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Adventures of Batman & Robin name: Adventures of Batman & Robin, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ABTE-USA sha256: 8083307f3f4b7df9e5bf53d5f25877c2e548f0f677540d4ee62d60ccca3098f8 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Adventures of Dr. Franken name: Adventures of Dr. Franken, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-6F-USA sha256: ecd964ae44e61203bc8759cfc6441365bf0c6e7bae6ad2a0fd553d4c7efab71e configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x140000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Adventures of Kid Kleets name: Adventure of Kid Kleets, The region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-YK-USA sha256: 670d898bdcf97d7ca3aab6c2dd1641f1270fcc2a070bbd3028ab413aef2b2ecc configuration rom name=program.rom size=0x140000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Adventures of Mighty Max name: Adventures of Mighty Max, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AMOE-USA sha256: 889beb58d2a48a05a6230cabda14555cb030e2e986c0293bdf396e85af5c6798 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Adventures of Rocky and Bullwinkle and Friends name: Adventures of Rocky and Bullwinkle and Friends, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-RZ-USA sha256: b70099186d3774355ac5db370240e370c73f9ce5341f6c805cf9f771374b43ae configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Adventures of Yogi Bear name: Adventures of Yogi Bear region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-Y8-USA sha256: 8049175767eddbc3e21ca5b94ee23fc225f834ccfab4ded30d2e981b0ef73ab6 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x140000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Aero Fighters name: Aero Fighters region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-AERE-USA sha256: b737de81315eef8ded7cfd5df6b37aba01d9e6e14566486db7ec83eb0c1aa85e configuration rom name=program.rom size=0x140000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Aero the Acro-Bat name: Aero the Acro-Bat region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-XB-USA sha256: 18a553dafd4980cc2869180b05f9fdf6e980bf092cc683e498ec6373c9701c6e configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Aero the Acro-Bat 2 name: Aero the Acro-Bat 2 region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AE2E-USA sha256: fc5df5db0a96d39d3df651f63993adf0f5cb5a6b92a36211f3a05d460d92c72d configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Aerobiz name: Aerobiz region: NA revision: 1.0 board: SHVC-1A3B-13 serial: SNS-AL-USA sha256: d5f0fbeed3774bbccbd769698fc4051487a0a5eb699790a8a094451595600f60 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Aerobiz Supersonic name: Aerobiz Supersonic region: NA revision: 1.0 board: SHVC-1A3M-21 serial: SNS-AG-USA sha256: 6b6921d7aba9ba353e96e39c8d79d24eef1b84eb5c7fa54edaa83d2447dcd954 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Air Cavalry name: Air Cavalry region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-ACCE-USA sha256: 1f5738552c51de25ffe8aa44ff396c1ab238435296f1e8f99f8cf335483c03d5 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Air Strike Patrol name: Air Strike Patrol region: NA revision: 1.0 board: SHVC-1A3M-21 serial: SNS-4A-USA sha256: 69c5805ad0494703e7d636d3d40d615d33e79bebef9d2cdb4a23b73d44c7b6f9 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Al Unser Jr.'s Road to the Top name: Al Unser Jr.'s Road to the Top region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AUJE-USA sha256: 0099bdb56e4190f81440c8c29395ecc15d78eeabfc38a93dca4773817d6f720f configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x140000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Aladdin name: Aladdin region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-RJ-USA sha256: aa768b8b00123717c8d49f2c6731cdbfd80ab6a54128bae7594e93f45e38a19e configuration rom name=program.rom size=0x140000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Alien 3 name: Alien 3 region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-A3-USA sha256: e637b8241d55ee334a3452888df5e30d72c520dbb55c498db1a984438bab3e55 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=YA0N revision=01 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Alien vs. Predator name: Alien vs. Predator region: NA revision: 1.0 board: SHVC-YA0N-01 serial: SNS-AP-USA sha256: 05eb897d7696555790591c431c9d55a43ff9a1c12162443c17c5fcddfa5eb3c5 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: American Gladiators name: American Gladiators region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AA-USA sha256: dc9cefb4dd50dce2e9d626ac71d4a06306516cba4bc784c90e4a30fe4e7ff4ef configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: An American Tail: Fievel Goes West name: American Tail - Fievel Goes West, An region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-9W-USA sha256: 6931a3eacb7ab3c2f2fb57ba7d59c6da56fe6c7d60484cebec9332e6caca3ae9 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Andre Agassi Tennis name: Andre Agassi Tennis region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-7A-USA sha256: 9abb426bac62e03e4437f5a9a8455c3000042f339125cc60ae29382ae89d8493 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Animaniacs name: Animaniacs region: NA revision: 1.0 board: MJSC-1A0N-30-2 serial: SNS-ANCE-USA sha256: 626f1fe52b0df0f8ede23f0062cd842321c8dabf14aefdca12e526876ecf383a configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Arcade's Greatest Hits: The Atari Collection 1 name: Arcade's Greatest Hits - The Atari Collection 1 region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-AW7E-USA sha256: 31569bef662bc438194726967970bf19f504101060763cbd649350362fb6ef2f configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Arcana name: Arcana region: NA revision: 1.0 board: SHVC-1A3B-13 serial: SNS-RF-USA sha256: aac9d6f2b8408e4bbdc83ebbba755428caf8021fefbfac7220fb4c772abd9944 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Ardy Light Foot name: Ardy Light Foot region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-A9-USA sha256: 0f474dafe5a26f3dea491d18073dd490d2f1f91313a7e91086565510d38d9a09 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Arkanoid: Doh It Again! name: Arkanoid - Doh It Again! region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-A6-USA sha256: 14d3ece30898587eda20c661a4a55ec595ba6352ca1f0bfc177542aa0eef0039 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Art of Fighting name: Art of Fighting region: NA revision: 1.0 board: SHVC-1J0N-01 serial: SNS-RW-USA sha256: 55e57c5e012583ff0fafd1aee16b3f8269ee2b34fe10f10b93ba0dde72f2b78d configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Axelay name: Axelay region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-AX-USA sha256: 2431f8dc067ba27c6c3a846929f3deac6a45aa53a9a9ac20ede8ec5ca6854ea2 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1K0N revision=01 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff necdsp model=uPD7725 frequency=8000000 rom name=dsp1b.program.rom size=0x1800 rom name=dsp1b.data.rom size=0x800 ram size=0x200 map id=io address=00-1f,80-9f:6000-7fff select=0x1000 information title: Ballz 3D name: Ballz 3D region: NA revision: 1.0 board: SHVC-1K0N-01 serial: SNS-ABZE-USA sha256: a3213e40d7abbc25a5b909642433103b06d8f90500c930bf64093ade0329da78 configuration rom name=program.rom size=0x100000 rom name=dsp1b.program.rom size=0x1800 rom name=dsp1b.data.rom size=0x800 ram name=dsp1b.data.ram size=0x200 release cartridge region=NTSC board type=YA0N revision=01 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Barbie Super Star name: Barbie Super Star region: NA revision: 1.0 board: SHVC-YA0N-01 serial: SNS-8L-USA sha256: 865919b25a9d241c907bcda18b380e3c704f33f4997ad44559046f0f08c4968b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Barkley Shut Up and Jam! name: Barkley Shut Up and Jam! region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-U5-USA sha256: fe1ad128313b2b9a47f89cf0d95d4c0cc2cb35a817ac5d915ee6c4d98d47d675 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Bass Masters Classic name: Bass Masters Classic region: NA revision: 1.0 board: SHVC-2A0N-20 serial: M/SNS-ABAE-USA sha256: c670e16c076f6d92ba581b78769b604e79ad567c04c647dac557f45a48c3448f configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Bass Masters Classic: Pro Edition name: Bass Masters Classic - Pro Edition region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-A9BE-USA sha256: db1ac03cc8b7daaa812da239029bcf999b30b2afe1c03d51f7ae849a796617ea configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Bassin's Black Bass name: Bassin's Black Bass region: NA revision: 1.0 board: SHVC-1A3M-21 serial: SNS-AB2E-USA sha256: e2be173c77bd1957787be36d13334f655e14d32dad99cacb0fd5e5fc65d96fa1 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Batman Forever name: Batman Forever region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-A3BE-USA sha256: e36aaba64be016cabc33a2dcf88913341e2edacc722e2a1ebe04eccda2a5d6e7 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Batman Returns name: Batman Returns region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-BJ-USA sha256: f8d5c51f74df33edc827fbf8df7aab70160770ab0a896db6e59438ad9208cc6e configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=YA0N revision=01 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Battle Blaze name: Battle Blaze region: NA revision: 1.0 board: SHVC-YA0N-01 serial: SNS-BZ-USA sha256: 983022203546e031773db0d1af7552c489187954882843f13ff123f09064c1d3 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=YA0N revision=01 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Battle Cars name: Battle Cars region: NA revision: 1.0 board: SHVC-YA0N-01 serial: SNS-4B-USA sha256: d19113964c4d268e986018e256e9358cde9a23a05e6053b54c0f2d950dcdf395 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Battle Clash name: Battle Clash region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-BT-USA sha256: 32f42fda0667d9435a2de84c7ce7b067bcbab1164f8f6d837992ad6cfac4f8de configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Battle Grand Prix name: Battle Grand Prix region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-BG-USA sha256: 6e436020d967d35a0f7ce43e38e83a616b70696ae7d35b37cd56601cfb3822ba configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Battletoads & Double Dragon name: Battletoads & Double Dragon region: NA revision: 1.0 board: MAXI-1A0N-30-1 serial: SNS-UL-USA sha256: c7f0269498d190e4fd0f6f880a148fbe3713cd3a632083bac1e5bd18f8172371 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Battletoads in Battlemaniacs name: Battletoads in Battlemaniacs region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-NX-USA sha256: b0dbd4d7e5689c32234e80b0c5362ef67c425ab72d6ddb49d1cb1133ef630ef7 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Bazooka Blitzkrieg name: Bazooka Blitzkrieg region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-BY-USA sha256: 0b0f991da7ce4b3c2974d6adf62191ec554db9793c5def14cdfb62b7ae28cc98 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Beauty and the Beast name: Beauty and the Beast region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-EW-USA sha256: d7271ca08400bbf5ae165b0aaa6e8a8a1b266f72e6e0ae10aae529732a472f7c configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Beavis and Butt-Head name: Beavis and Butt-Head region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-ABUE-USA sha256: 15d4fc90cb202a9391718cd40b9f0384165aef03018ed932540e8f7c18b397dd configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Bebe's Kids name: Bebe's Kids region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-6B-USA sha256: 4958eda26f2419f473449017c64121caee5e49c480ffa205422e7dd45cd23e31 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Beethoven: The Ultimate Canine Caper! name: Beethoven - The Ultimate Canine Caper! region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-2V-USA sha256: 4d22279e534848012e0f1595468687742ae18cabc3fe44eeef938bc3a4dd08bf configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Best of the Best: Championship Karate name: Best of the Best - Championship Karate region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-BE-USA sha256: e4e9beaeeb3e968af772d1c4c9e4c1b4dfdba4e47c0205b458e1ab3a62a96060 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A1M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Big Sky Trooper name: Big Sky Trooper region: NA revision: 1.0 board: SHVC-1A1M-20 serial: M/SNS-AB9E-USA sha256: 4cb601168c91fa0608c16a8cf2f292d991c6a5615d51861dee2f9b91c8d6bb19 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Biker Mice from Mars name: Biker Mice from Mars region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ABME-USA sha256: 91ba5691dea3cdf103177ae5779110fc372fce8229cf91f263073667e7a8b5b7 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Bill Laimbeer's Combat Basketball name: Bill Laimbeer's Combat Basketball region: NA revision: 1.0 board: SHVC-1A3B-12 serial: SNS-C8-USA sha256: 6fa6b8a8804ff6544bdedf94339a86ba64ce0b6dbf059605abb1cd6f102d3483 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Bill Walsh College Football name: Bill Walsh College Football region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-7F-USA sha256: ec2d91e238c26a5ddf7067d104b3b3e2eaee89255377e1eb6c4df8f301300e64 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Bio Metal name: Bio Metal region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-BV-USA sha256: de1de85ad549a6aaf0431cceb47cbd07e1f6e81f9e16fd62575305e2c1f06240 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Blackthorne name: Blackthorne region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-6Z-USA sha256: 328c8f57e2ea371f6fd5b8a9834c56e35eb3bfe710502dd80f370739f9ccb7e1 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: BlaZeon: The Bio-Cyborg Challenge name: BlaZeon - The Bio-Cyborg Challenge region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-BL-USA sha256: 0d4e0d134396bd1c7254cdc1da356eb944ca14910b6690f484a75a9c3a8106e7 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Blues Brothers name: Blues Brothers, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-B6-USA sha256: 99f40f06fa4dbeeea4fe67d2de5b4c1bf301bedac1958ba1c239dcaf39b0a998 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: B.O.B. name: BOB region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-B4-USA sha256: 9e6ebebcf14609c2a38a5f4409d0c8c859949cded70c5b6fd16fd15d9983d9d3 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Bonkers name: Bonkers region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ABNE-USA sha256: 854d2492d1cb059749bb0904ca5f92a5eeec09167abf84f7cca4023b1819e4f0 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Boogerman: A Pick and Flick Adventure name: Boogerman - A Pick and Flick Adventure region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-AB4E-USA sha256: 8f131182b286bd87f12cf4f00453336538ce690d0e1f0972ac0be98df4d48987 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Boxing Legends of the Ring name: Boxing Legends of the Ring region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-LL-USA sha256: e67940a2106c1507f3a8d38790f263bbbf814578ebf3dbc4e3eb6007d310793c configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2J3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=10-1f,30-3f:6000-7fff mask=0xe000 map id=ram address=90-9f,b0-bf:6000-7fff mask=0xe000 information title: Brain Lord name: Brain Lord region: NA revision: 1.0 board: SHVC-2J3M-11 serial: SNS-3B-USA sha256: f4666355e7fea434843dc6d5119673bd6c23e69b884aac0b382ff036997e52b5 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Brainies name: Brainies, The region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-B7-USA sha256: 9885ca148d32c4df6230642bcfa153f7e51b9559415042a831db14d07b3e6c3d configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Bram Stoker's Dracula name: Bram Stoker's Dracula region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-5D-USA sha256: bbde8b46c7262f9d4a5b3926a00850cb00b4f7711f6421f0adf4e2b0c847a5d6 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2J5M revision=01 rom name=program.rom size=0x180000 ram name=save.ram size=0x8000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=10-1f,90-9f:6000-7fff mask=0xe000 map id=ram address=30-3f,b0-bf:6000-7fff mask=0xe000 information title: Brandish name: Brandish region: NA revision: 1.0 board: SHVC-2J5M-01 serial: SNS-QF-USA sha256: 130a74e76369b0ec4d6378a014550921433f1ae1ac1dddffb51f77c9f21a818f configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Brawl Brothers name: Brawl Brothers region: NA revision: 1.0 board: SHVC-2A0N-10 serial: SNS-RE-USA sha256: 044b61613ed66eae08abd5fa5dcd13b24aab11a942e3309cdff624d198c47440 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: BreakThru! name: BreakThru! region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ABXE-USA sha256: aad8c9be1b7a9662256b0c3d76f5b7a273bcd497aa838232d307e9f2e80cf699 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2A3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Breath of Fire name: Breath of Fire region: NA revision: 1.0 board: SHVC-2A3M-11 serial: SNS-BF-USA sha256: cbc496a7879ba78f32c51c3df4ba1a1a42f17d78d48a39ea9c709d1ad18cb8df configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Breath of Fire II name: Breath of Fire II region: NA revision: 1.0 board: SHVC-1J3M-20 serial: M/SNS-AF2E-USA sha256: fede9d4aec8c35ed11e2868c3c517bce53ee3e6af724085c92500e99e43e63de configuration rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Brett Hull Hockey name: Brett Hull Hockey '94 region: NA revision: 1.0 board: SHVC-2A0N-01 serial: SNS-5Y-USA sha256: 99450b45ccc70a1ed387f968c8f863a3c7f6a4b86809e841c25a71e1e904ac61 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Brett Hull Hockey '95 name: Brett Hull Hockey '95 region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ABHE-USA sha256: a427db4860cb5140935f263ba872fe14949c3548db644fed46b2edf3dff3d4a8 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Bronkie the Bronchiasaurus name: Bronkie the Bronchiasaurus region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AB6E-USA sha256: f2bc4cb460dfc5d5288065a2f529190b72e69d4e02634246086244c20f30521c configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Brunswick World Tournament of Champions name: Brunswick World Tournament of Champions region: NA revision: 1.0 board: SHVC-1J0N-20 serial: SNS-AWUE-USA sha256: ee00c57ddfa9b967d1857acb518df039ba73055bdebe78db014de0f5da262fd9 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Brutal: Paws of Fury name: Brutal - Paws of Fury region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ABLE-USA sha256: 9e3ad5e521e759a2e2260ea8072eb3314b6fcf67a3b7247357a5de9bcb24eeaa configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Bubsy in Claws Encounters of the Furred Kind name: Bubsy I - Claws Encounters of the Furred Kind region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-UY-USA sha256: 811cbc3287c0959e8eb242e817684d36de664ebebc5873a1fa9958693857c438 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Bubsy II name: Bubsy II region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-ABBE-USA sha256: 2357d344af77d25dda030520ce203045fd9060f83e3b9609a228dba859d9017b configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Bugs Bunny: Rabbit Rampage name: Bugs Bunny - Rabbit Rampage region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-R7-USA sha256: 49020695a017acc3dfadea97a60e28609e583571f69c5abeb3c6b1c2db8113fa configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Bulls vs. Blazers and the NBA Playoffs name: Bulls vs. Blazers and the NBA Playoffs region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-BU-USA sha256: ba4f31353e0e1233b574391ad97a80901d7de212e2c55d7be2af11a9a57c8225 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Bulls vs. Blazers and the NBA Playoffs name: Bulls vs. Blazers and the NBA Playoffs region: NA revision: 1.1 board: SHVC-1A0N-20 serial: SNS-BU-USA-1 sha256: d8b3d9267470adb8ef2d197ade44476e504c0823f8fe9d2cf2883a03aa75bd49 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Bust-a-Move name: Bust-a-Move region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AYKE-USA sha256: d6f6c30732dae8d00cd83628c3156acbdf26f99df701f779522e21de74dae5fe configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Cacoma Knight in Bizyland name: Cacoma Knight in Bizyland region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-CC-USA sha256: a8294d449bbb8370816efe0374704e8af20dbbde9c19afe969d898528bc293d0 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Cal Ripken Jr. Baseball name: Cal Ripken Jr. Baseball region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-CJ-USA-1 sha256: 75993076c8773e7c7d555ef290be10590def40ca7b83307b8dc86556b04a6565 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: California Games II name: California Games II region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-C2-USA sha256: 19f4a1f08aa55ff3cc8ff7ae60ffe03f0e436e8d8901455f1311f2276497a492 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A1M revision=01 rom name=program.rom size=0x180000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Cannondale Cup name: Cannondale Cup region: NA revision: 1.0 board: SHVC-2A1M-01 serial: SNS-ASCE-USA sha256: 6cdec3cb9c91aa23feb13005f874bda580c2f548302874491a31951031c9dbbd configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Capcom's MVP Football name: Capcom's MVP Football region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-NL-USA sha256: 9590110a990e90f525d5c8d70fc2a3da10879378003173b6761afb8bf042ee0d configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Capcom's Soccer Shootout name: Capcom's Soccer Shootout region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-JL-USA sha256: fd5761f9dd1f2b87ad11df6085046d0dfcdc3a79139263e47b0cff707966ba51 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Captain America and The Avengers name: Captain America and The Avengers region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-6A-USA sha256: 2a117951adcfbc4298763673a834d502c3f7a3964db1e59650f113c07bb831fb configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Captain Commando name: Captain Commando region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-QM-USA sha256: d9b7f9356be0780f0037093a86ef8450f15e569cbd3680073d1cd345dfadb709 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Captain Novolin name: Captain Novolin region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-CP-USA sha256: 8784614896e2b3e8d98c8166613ca5d2329643795a4dc107791c58c6c51e1268 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Carrier Aces name: Carrier Aces region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-ACAE-USA sha256: ee5fc27dd19a2ecb3c3c7c73d558a18ffd5ff365710c18b88150e277f08d587e configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Casper name: Casper region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AXCE-USA sha256: b9b982cd8f91c51089d49b550f11882b1ee785ebddcb7355cfc465916d61a042 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Castlevania: Dracula X name: Castlevania - Dracula X region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-ADZE-USA sha256: 367725a149a471411e4f72ad77603b61fb101c9cab4521be5647e13708cc97ba configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Champions World Class Soccer name: Champions World Class Soccer region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-8W-USA sha256: 32008c429eafe7eb59aff7a89f77e1a267f02f9061ff8830ade7b99081e27f7c configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Championship Pool name: Championship Pool region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-5P-USA sha256: e6c4f468b39f2dea3436b63758db8ac9b29731357b982ec373334a36f202623f configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Championship Soccer '94 name: Championship Soccer '94 region: NA revision: 1.0 board: SHVC-1A3M-20 serial: SNS-67-USA sha256: fdd763dffc6fb38975d4c6d6e3123f9738122781b7d13e1fc7f9820464cbaeb5 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A1M revision=01,11,20 rom name=program.rom size=0x80000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Chavez name: Chavez region: MX revision: 1.0 board: SHVC-1A1M-01 serial: SNS-ZV-USA sha256: aa69d4e19c2eb206fe88eba65994c830256c220e5506f59824aefa0a75dd44d5 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Chavez II name: Chavez II region: MX revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AC2E-USA sha256: 39de64101cf7f25863ce55e03a27d13422ea572ee996746578b5936fea80228b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Chessmaster name: Chessmaster, The region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-CH-USA sha256: ee0e51d922d1cf8abe3dfc6b0d84a988a6635dc96b2a96962007c41aaa542774 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Chester Cheetah: Too Cool to Fool name: Chester Cheetah - Too Cool to Fool region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-CE-USA sha256: c7e7df8932bf0056aa530f3dc3c913c1171a359af4c197094c2b972946dc6051 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x140000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Chester Cheetah: Wild, Wild Quest name: Chester Cheetah - Wild, Wild Quest region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-7C-USA sha256: 21a2aa488cb8140ca318f7d1f513103d14e758181aa336a594097d32ba0a7587 configuration rom name=program.rom size=0x140000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Choplifter III name: Choplifter III region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-3C-USA-1 sha256: 9a064b67f522b75b82d0857519c0e33b4dbbe494c2ef79a44fdc913d605d0b26 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x400000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Chrono Trigger name: Chrono Trigger region: NA revision: 1.0 board: SHVC-1J3M-20 serial: M/SNS-ACTE-USA sha256: 06d1c2b06b716052c5596aaa0c2e5632a027fee1a9a28439e509f813c30829a9 configuration rom name=program.rom size=0x400000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Chuck Rock name: Chuck Rock region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-CK-USA sha256: 63ab79e86ea13e2cf9bb67aec971febb68450db9865b00b5f412610653822393 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Clay Fighter name: Clay Fighter region: NA revision: 1.0 board: SHVC-1J0N-01 serial: SNS-8C-USA sha256: 8b7525b2aa30cbea9e3deee601dd26e0100b8169c1948f19866be15cae0ac00d configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Clay Fighter: Tournament Edition name: Clay Fighter - Tournament Edition region: NA revision: 1.0 board: SHVC-BJ0N-01 serial: SNS-7E-USA sha256: ea52b39a8e1ea15bfad6b92883c9a5fe744cecd7c0e175aa3bd40280cf7a966e configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Clay Fighter 2: Judgment Clay name: Clay Fighter 2 - Judgment Clay region: NA revision: 1.0 board: SHVC-BJ0N-20 serial: SNS-ACZE-USA sha256: 2d40c86bc19d85555bf2672acf515b04dbf56a6a59b29ad503e672310b0fae3b configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Claymates name: Claymates region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-Y5-USA sha256: 6d9cd7f0cda3c0a82ed3f6a92cbbba4fe8365438e0a7867ad1cae2044d1738eb configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Cliffhanger name: Cliffhanger region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-6C-USA sha256: e5980b990605a9c91fa89101c440b2ec9993329296ba09a9538042d724a080fb configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Clue name: Clue region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-CL-USA sha256: 03f6c69aef92d36b5ea25a6023368da0e1da9fa160e8316ebd533d4f358ffacf configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: College Football USA '97: The Road to New Orleans name: College Football USA '97 - The Road to New Orleans region: NA revision: 1.0 board: SHVC-1A3M-30 serial: M/SNS-AC7E-USA sha256: 5536cea2da39f2572abe3b0fcf71f8fcd981376b470b174969772aae4a7a1845 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: College Slam name: College Slam region: NA revision: 1.0 board: SHVC-1A3M-30 serial: M/SNS-ANYE-USA sha256: b0be35a0d5e500f4fffca5f2940e0ec52c81ce99dacd773c3ca9cf92f592d943 configuration rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Combatribes name: Combatribes, The region: NA revision: 1.0 board: SHVC-2A0N-01 serial: SNS-CR-USA sha256: c88a882ad72dfa07a9b1eb8a2183aa10057d60877a02edf90cf2cd8c78abe65e configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Congo's Caper name: Congo's Caper region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-J2-USA sha256: 26e09f5bc2bde28d57aeca0bf5be7f7fb8e3b3887af975bcbf2e6f29b07df56f configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Contra III: The Alien Wars name: Contra III - The Alien Wars region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-CS-USA sha256: a93ea87fc835c530b5135c5294433d15eef6dbf656144b387e89ac19cf864996 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Cool Spot name: Cool Spot region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-C8-USA sha256: c7d622391f7699fb0dc6367e141c894e700cc9bd8abca69f36785e7bc2f42a49 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Cool World name: Cool World region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-CD-USA sha256: 9674cc269d89a52d1719a487b44acf004fb777cbd58d76b19a2cd25749728215 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: CutThroat Island name: CutThroat Island region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AC8E-USA sha256: 7c722f9941957630467c1784d0eb3f92fbfc0a2a1da3c8f5c27f593eca2a5a04 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Cyber Spin name: Cyber Spin region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-CF-USA sha256: c4ae2797fac2586b8640064be6398f2b4f2b3158a07f26c66912b29f7fd197de configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Cybernator name: Cybernator region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-AV-USA sha256: ad31b94ce928ecff605e2b89082154671691509e95d38370ed381437f2c36698 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: D-Force name: D-Force region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-DF-USA sha256: 337e643d3e63915de06429992f306e8d2b73aed6849b795f9c855c2d03c18180 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Daffy Duck: The Marvin Missions name: Daffy Duck - The Marvin Missions region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-YF-USA sha256: 4068add412571bd85adac32dff9835e4a4886077d752adb104fee3908e42b7ef configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Darius Twin name: Darius Twin region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-DT-USA sha256: ceb470157576eac3b8b8c16e8ab6b59672409681ffb4232e4ec39dd0cb37ef91 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: David Crane's Amazing Tennis name: David Crane's Amazing Tennis region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ZT-USA sha256: e6efb6361af04963f22c772f879a466543f56b3b6a084204fef2dcb4659d82d9 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Death and Return of Superman name: Death and Return of Superman, The region: NA revision: 1.1 board: SHVC-1A0N-30 serial: M/SNS-9D-LTN sha256: e678a29a93111cf2016c487ba9977b14de8f719040651a42c74bd74eea2d0d81 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Demolition Man name: Demolition Man region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-AD6E-USA sha256: 752d24fab240f4dd1dfbfea5ec83438998316806ad44488bf8c84430ca5a2cd0 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Demon's Crest name: Demon's Crest region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-3Z-USA sha256: 18d40a807d5f88c5b6a1ad849eec7e0f189225d9a1586037c850f6680b5844de configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=YA0N revision=01 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Dennis the Menace name: Dennis the Menace region: NA revision: 1.0 board: SHVC-YA0N-01 serial: SNS-4D-USA sha256: a362033d0d7e754d79202b255679186ad799b9e784719614b913ec8c9857ae33 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Desert Strike: Return to the Gulf name: Desert Strike - Return to the Gulf region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-RG-USA sha256: 606abf536440173ae36466db360c7db6b474beb7a105c8a62bc74a54cbe1c38b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Dig & Spike Volleyball name: Dig & Spike Volleyball region: NA revision: 1.0 board: SHVC-1A3M-20 serial: SNS-VH-USA sha256: 9c4721339a197185d61e0697ea0149db143a27ddb2f57ebd398f18bcf4d7724b configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: DinoCity name: DinoCity region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-DW-USA sha256: 7dbfc44d28a46e6d399628e43086aa9fd0b2abeda4c108751a5ad91c102c3aaf configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1CA0N6S revision=01 superfx revision=4 rom name=program.rom size=0x80000 ram name=save.ram size=0x10000 map id=io address=00-3f,80-bf:3000-34ff map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000 map id=rom address=40-5f,c0-df:0000-ffff map id=ram address=00-3f,80-bf:6000-7fff size=0x2000 map id=ram address=70-71,f0-f1:0000-ffff information title: Dirt Trax FX name: Dirt Trax FX region: NA revision: 1.0 board: SHVC-1CA0N6S-01 serial: SNS-AF9E-USA sha256: c5474de3592e2a99aac0e5511516658f9f0b50167c754a018409842ec35bcd45 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x10000 superfx revision=4 release cartridge region=NTSC board type=1J1M revision=11,20 rom name=program.rom size=0x400000 ram name=save.ram size=0x800 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Donkey Kong Country name: Donkey Kong Country region: NA revision: 1.1 board: SHVC-1J1M-11 serial: SNS-8X-USA sha256: df2644d435330192a13768cc1f79c5aa3084a64217a5250c6dd4ffdbe2175be4 configuration rom name=program.rom size=0x400000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1J1M revision=11,20 rom name=program.rom size=0x400000 ram name=save.ram size=0x800 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Donkey Kong Country name: Donkey Kong Country region: NA revision: 1.2 board: SHVC-1J1M-20 serial: SNS-8X-USA sha256: 628147468c3539283197f58f03b94df49758a332831857481ea9cc31645f0527 configuration rom name=program.rom size=0x400000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1J1M revision=11,20 rom name=program.rom size=0x400000 ram name=save.ram size=0x800 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Donkey Kong Country 2: Diddy's Kong Quest name: Donkey Kong Country 2 - Diddy's Kong Quest region: NA revision: 1.0 board: SHVC-1J1M-20 serial: SNS-ADNE-USA sha256: 35421a9af9dd011b40b91f792192af9f99c93201d8d394026bdfb42cbf2d8633 configuration rom name=program.rom size=0x400000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1J1M revision=11,20 rom name=program.rom size=0x400000 ram name=save.ram size=0x800 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Donkey Kong Country 3: Dixie Kong's Double Trouble name: Donkey Kong Country 3 - Dixie Kong's Double Trouble region: NA revision: 1.0 board: SHVC-1J1M-20 serial: M/SNS-A3CE-USA sha256: 2277a2d8dddb01fe5cb0ae9a0fa225d42b3a11adccaeafa18e3c339b3794a32b configuration rom name=program.rom size=0x400000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1CB0N7S revision=01 superfx revision=4 rom name=program.rom size=0x200000 ram name=save.ram size=0x10000 map id=io address=00-3f,80-bf:3000-34ff map id=rom address=00-3f:8000-ffff mask=0x8000 map id=rom address=40-5f:0000-ffff map id=ram address=00-3f,80-bf:6000-7fff size=0x2000 map id=ram address=70-71:0000-ffff information title: Doom name: Doom region: NA revision: 1.0 board: SHVC-1CB0N7S-01 serial: SNS-AD8E-USA sha256: d45e26eb10c323ecd480e5f2326b223e29264c3adde67f48f0d2791128e519e8 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x10000 superfx revision=4 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Doomsday Warrior name: Doomsday Warrior region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-DM-USA sha256: bb915b286b33842e39e9022366169233a4041515c7ecc60ac428420b28e48dd5 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Double Dragon V: The Shadow Falls name: Double Dragon V - The Shadow Falls region: NA revision: 1.0 board: SHVC-BJ0N-01 serial: SNS-5E-USA sha256: b32aa9cbf8f6baacc84f6418fa6fbc33b9ce71458fecc91275aafdbf6f743a99 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Dragon: The Bruce Lee Story name: Dragon - The Bruce Lee Story region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-AD5E-USA sha256: d98d7da1e7636e067563e2e480d7dfbc013b7e9bdf1329fd61c5cacac0293e1d configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Dragon View name: Dragon View region: NA revision: 1.0 board: SHVC-1A3M-21 serial: SNS-ADVE-USA sha256: a3b1cae3fe55fe52c035ab122e7f850640b0935524496d45b1915ca3c8a934f4 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Dragon's Lair name: Dragon's Lair region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-DI-USA sha256: 49a1f9f5e6084b3daa1b13ab5a37ebe8bd3cf20e1c7429fbf722298092893e81 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Drakkhen name: Drakkhen region: NA revision: 1.0 board: SHVC-1A3B-11 serial: SNS-DK-USA sha256: 74910ce01d19d25cb97a243a51f21c3d522f02fb116682f60440da3292bb14f7 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Dream T.V. name: Dream TV region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-VE-USA sha256: 1a79d51a2ad7dd4848205a07ff8e5d873b155dc420de5e52158c9bab935e05c3 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1B5B revision=02 rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff necdsp model=uPD7725 frequency=8000000 rom name=dsp2.program.rom size=0x1800 rom name=dsp2.data.rom size=0x800 ram size=0x200 map id=io address=20-3f,a0-bf:8000-ffff select=0x4000 information title: Dungeon Master name: Dungeon Master region: NA revision: 1.0 board: SHVC-1B5B-02 serial: SNS-V2-USA sha256: 03d25227fb88899d0f3234c4a3f76f1dbe8d582cb6429454fd6f1c4cf14d5c6e configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 rom name=dsp2.program.rom size=0x1800 rom name=dsp2.data.rom size=0x800 ram name=dsp2.data.ram size=0x200 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Earth Defense Force name: Earth Defense Force region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-ED-USA sha256: 0408e3d9f2259044344a3bfbd7a7ca3c3427f82108fbecd6e5c4c41e80cd303b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: EarthBound name: EarthBound region: NA revision: 1.0 board: SHVC-1J3M-20 serial: SNS-MB-USA sha256: a8fe2226728002786d68c27ddddf0b90a894db52e4dfe268fdf72a68cae5f02e configuration rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Earthworm Jim name: Earthworm Jim region: NA revision: 1.0 board: SHVC-BJ0N-01 serial: SNS-AEJE-USA sha256: 4579e437279f79eedd6b9cf648a814df2ab2c83d937a1bcec1578d28965fb9a0 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Earthworm Jim 2 name: Earthworm Jim 2 region: NA revision: 1.0 board: MJSC-1J0N-20-2 serial: SNS-A2EE-USA sha256: 10eadaab168707829418702386e1bcedd2619d9bbefc37cf31c4118313bcf6de configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Eek! The Cat name: Eek! The Cat region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-E7-USA sha256: 5d658b63d35e2e0baf48ae3bb04ea5e1553855b34bb39fc2c7ca41fbd3894d52 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Elite Soccer name: Elite Soccer region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-L7-USA sha256: b296054effb1948039635044bc905fdf8ff53e7a73038fd5d8436a913ea5ad8a configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Emmitt Smith Football name: Emmitt Smith Football region: NA revision: 1.0 board: SHVC-1A3M-30 serial: M/SNS-AESE-USA sha256: f14e30ee452ec930a6d08094094b287d0c40c8108f2017c418015242987649b3 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Equinox name: Equinox region: NA revision: 1.0 board: SHVC-1A3M-20 serial: SNS-EX-USA sha256: cfd666f0bbabec59613d9fe189db7d0a060a78047bc084c0c365840769047bf2 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: ESPN Baseball Tonight name: ESPN Baseball Tonight region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-EV-USA sha256: c702c3860e9dffdaa1917d013ecbcefdd2c47f89726992f7f810d879772dcc4d configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: ESPN National Hockey Night name: ESPN National Hockey Night region: NA revision: 1.0 board: SHVC-1A3M-21 serial: SNS-AEHE-USA sha256: 3326061160ad12c7aef5176544ec1c8ef2f534a51960ca882dbc7fcb9b1a7384 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: ESPN Speed World name: ESPN Speed World region: NA revision: 1.0 board: SHVC-1A3M-21 serial: SNS-ASWE-USA sha256: 7b2fdab972e393395f5379d7fb13e40464db152f6acf58b2d2a6a18f81cefecb configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: ESPN Sunday Night NFL name: ESPN Sunday Night NFL region: NA revision: 1.0 board: SHVC-1A3M-21 serial: SNS-ASNE-USA sha256: faf595b4671f005fa9367ba3fcd30dbff371bc7a9ca8bbfbc0ebfcc5826b60f8 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=2A3M revision=01 mapper=MAD-R rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: E.V.O.: Search for Eden name: EVO - Search for Eden region: NA revision: 1.0 board: SHVC-2A3M-01 mapper: MAD-R serial: SNS-46-USA sha256: 8481e47381bd98c27b9782b5727a5d5f0976fbb3aa3df25c2c42aa37e0586815 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A1M revision=01,11,20 rom name=program.rom size=0x200000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Exertainment Mountain Bike Rally name: Exertainment Mountain Bike Rally region: NA revision: 1.0 board: SHVC-1A1M-11 serial: SNS-9X-USA sha256: f2455253db316b6ccd0c5c686d1f1e2d94cd5e37534e70a3a07a409120d58df6 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x400000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Exertainment Mountain Bike Rally + Speed Racer name: Exertainment Mountain Bike Rally + Speed Racer region: NA revision: 1.0 board: SHVC-1A3M-30 serial: SNS-ALFE-USA sha256: a0521f50b0d0bff6666bfb712498476eb8d5974ef38caf157e2f67cbce5475bb configuration rom name=program.rom size=0x400000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Extra Innings name: Extra Innings region: NA revision: 1.0 board: SHVC-1A3B-12 serial: SNS-GL-USA sha256: 1576066e0cb771a91caf79e7d4f6dc00eb0daa47f0786f1604b32537429a7f45 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A5M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Eye of the Beholder name: Eye of the Beholder region: NA revision: 1.0 board: SHVC-1A5M-01 serial: SNS-IB-USA sha256: 0a8cd5101f849ccd4e40d55fdc4edce914b2825b69eb76ec31cf53b59719e79e configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1A1B revision=04,05,06 rom name=program.rom size=0x80000 ram name=save.ram size=0x800 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: F-Zero name: F-Zero region: NA revision: 1.0 board: SHVC-1A1B-04 serial: SNS-FZ-USA sha256: bf16c3c867c58e2ab061c70de9295b6930d63f29f81cc986f5ecae03e0ad18d2 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A1M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: F1 Pole Position name: F1 Pole Position region: NA revision: 1.0 board: SHVC-1A1M-01 serial: SNS-6P-USA sha256: 55c33efb514568c9946c4b866c160ed190fe436faee265ee2fb107f7fe94d524 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: F1 Race of Champions name: F1 Race of Champions region: NA revision: 1.0 board: SHVC-1A3B-13 serial: SNS-EH-USA sha256: 1d38e3af9e3a6409e93f4705b68c42558f558c68f3e83ef2a40e46cf560b26cc configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1DS0B revision=10,20 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 necdsp model=uPD96050 frequency=11000000 rom name=st010.program.rom size=0xc000 rom name=st010.data.rom size=0x1000 ram name=save.ram size=0x1000 map id=io address=60-67,e0-e7:0000-3fff select=0x0001 map id=ram address=68-6f,e8-ef:0000-7fff information title: F1 Race of Champions II name: F1 Race of Champions II region: NA revision: 1.0 board: SHVC-1DS0B-20 serial: SNS-E2-USA sha256: 3ae7bfd38a3dc273f4d387af3b15621beefebf5056731af06e3822f5e57db5c5 configuration rom name=program.rom size=0x100000 rom name=st010.program.rom size=0xc000 rom name=st010.data.rom size=0x1000 ram name=save.ram size=0x1000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Faceball 2000 name: Faceball 2000 region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-2F-USA sha256: d689392884df91c2bb84b1411a96f3919b6c9cc8a583dff901a98f0d86d31c30 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Family Dog name: Family Dog region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-D8-USA sha256: 2891f1eab285133364ecc379a5c9e1d0026d60f425f1a458d149014f386cfa50 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Family Feud name: Family Feud region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-FN-USA sha256: 4f43ce12e1d8cd195468d7048494ad2930721e5bf9e69bfd86eeee707ffc634b configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Family Feud name: Family Feud region: NA revision: 1.1 board: MAXI-1A0N-30 serial: SNS-FN-USA sha256: d5c651d726dd957b80d03ab6fdbed4cdd26a3cccf5ec9d91af67251b3ec26a3c configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Fatal Fury name: Fatal Fury region: NA revision: 1.0 board: SHVC-2A0N-01 serial: SNS-GN-USA sha256: c92f389d25870aada3002775838ec9f69a988120c0238af885fd08d46bd94930 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x280000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Fatal Fury 2 name: Fatal Fury 2 region: NA revision: 1.0 board: SHVC-BJ0N-01 serial: SNS-DJ-USA sha256: a0c554d46034caef231c36dd6849828ca39703678fb7fdd15a11f292b93bcd6b configuration rom name=program.rom size=0x280000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x400000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Fatal Fury Special name: Fatal Fury Special region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-3R-USA sha256: 410e90db3d38507ccc85ad3bca6b27a080123fd5160e82b5de4d914d4b6d6e61 configuration rom name=program.rom size=0x400000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: FIFA International Soccer name: FIFA International Soccer region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-84-USA sha256: 1f454f2ce16fb96ba0b950ceaa098fe6eabed9e4a0e512252debad8fa6bc5ef5 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: FIFA Soccer '96 name: FIFA Soccer '96 region: NA revision: 1.0 board: SHVC-1A3M-30 serial: M/SNS-A6SE-USA sha256: 26ff143c2f1a4a16ca838cc4b5555e39bbe7208515dca8f1c4b1a00dec61cf09 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x1e0000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: FIFA Soccer '97 name: FIFA Soccer '97 region: NA revision: 1.0 board: EA-1A3M-30/P10019 serial: SNS-A7IE-USA sha256: c514f855ad377242582952eee95513a2152ebbf6bb5b06bdf9f031fc5ac748ab configuration rom name=program.rom size=0x1e0000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x280000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Fighter's History name: Fighter's History region: NA revision: 1.1 board: SHVC-BJ0N-01 serial: SNS-YH-USA sha256: b9594d588816ae570ea5fea14577ed47de4db9ac9a40a116c84e0ad7a2ce58f8 configuration rom name=program.rom size=0x280000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Final Fantasy: Mystic Quest name: Final Fantasy - Mystic Quest region: NA revision: 1.0 board: SHVC-1A3B-13 serial: SNS-MQ-USA sha256: 6151389f33ce2e53db3cd99592440c0020f5f4668f581ce3bd615bc92077f255 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Final Fantasy II name: Final Fantasy II region: NA revision: 1.0 board: SHVC-1A3B-12 serial: SNS-F4-USA sha256: 680535dc1c4196c53b40dc9c2c9bc159a77802ab8d4b474bef5dc0281c15ad06 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=BJ3M revision=10 rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Final Fantasy III name: Final Fantasy III region: NA revision: 1.0 board: SHVC-BJ3M-10 serial: SNS-F6-USA sha256: 0f51b4fca41b7fd509e4b8f9d543151f68efa5e97b08493e4b2a0c06f5d8d5e2 configuration rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Final Fight name: Final Fight region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-FT-USA sha256: 60cca2592d0756b8c4c7a0a254fafa5ac47aa752521fd1f77dcbf4b6ee1bee90 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x140000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Final Fight 2 name: Final Fight 2 region: NA revision: 1.0 board: SHVC-2A0N-01 serial: SNS-F2-USA sha256: 744d1a16c3f99970283597ae8f43b7c3621c5f995c4566ef24b8d70b0692007b configuration rom name=program.rom size=0x140000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Final Fight 3 name: Final Fight 3 region: NA revision: 1.0 board: SHVC-1J0N-20 serial: SNS-AFZE-USA sha256: f9dac709b2c2859f828103a0dd980716817e2bde3b9d7e2fdea36e9bb9bed7f2 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Final Fight Guy name: Final Fight Guy region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-FY-USA sha256: 8c47f9dc79748c0ae6c648f8480614d22eaefade065612ad1fe749fc3db4d1bc configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Firepower 2000 name: Firepower 2000 region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-FW-USA sha256: 003dba0193acc5336840307194643ca3b1f848dcfc77580b4e17c605105b27f5 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Firestriker name: Firestriker region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-3S-USA sha256: 6f32355bef68d4ad58822f50074b46bcc9a68357cd2c6a5470c96bf5344f84d8 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: First Samurai name: First Samurai region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-FK-USA sha256: 4c1354337efa788169387458fa6bdbcf4be0c98369920af2bd876ad98d29070f configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Flashback: The Quest for Identity name: Flashback - The Quest for Identity region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-5F-USA sha256: 064a880a8dfcf576f74ae8a17c3ec7b0a27e8cb0300a5e5959452fcc30422f14 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Flintstones: The Movie name: Flintstones - The Movie, The region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-AFNE-USA sha256: ff09d72d6241b331dc429d1cf27c04c26546f23312a22c7a14e6a4bf41ed1069 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Flintstones: The Treasure of Sierra Madrock name: Flintstones - The Treasure of Sierra Madrock, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-9F-USA sha256: 3d5bbc06e7e9797d937c803610c40b262c14c3f0a39e8048dd6b0b052a040fc1 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Football Fury name: Football Fury region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-UF-USA sha256: 40b55ee44bc6f1c83daac3e1806dcf7ecd5b35280cdb6a63c7a5e52fbd2115e6 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x300000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Foreman For Real name: Foreman For Real region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-AFEE-USA sha256: bc6b0344a434644c391ac69a53c7720c51e2d3c5c082b8d78598ae4df100c464 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Frank Thomas' Big Hurt Baseball name: Frank Thomas' Big Hurt Baseball region: NA revision: 1.0 board: SHVC-1A3M-30 serial: SNS-AFKE-USA sha256: ba93721bdb0f19506e722bc580d0b4dad6e8648dddbc52e3ce45dd75ea165f72 configuration rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Frantic Flea name: Frantic Flea region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AF8E-USA sha256: 25b380f529f5a9295df7c0adcc5213d67f131f552d078a3d8f545f988047c90a configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Frogger name: Frogger region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-AF7E-USA sha256: 1ce72767795f41049a1f4d2829e837a8885eb91e1c14faf1ca62d05839ebe3c9 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Full Throttle: All-American Racing name: Full Throttle - All-American Racing region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AFTE-USA sha256: 3db8a496a49d47b1ac2a893feaf682722765b2cde63c22af3aa68212dcfa975f configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: fun 'n games name: Fun & Games region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-7N-USA sha256: dcceb5be536c9b91bf34f65e7fcec4b55a78af0192323cf86f3b9555072037ee configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Gemfire name: Gemfire region: NA revision: 1.0 board: SHVC-1A3B-13 serial: SNS-RL-USA sha256: 78e2b8210d8dd8776ee23153eb3dce2cbf7d8ddc3e8a5d25b580428f59d98bdb configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J3B revision=01 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Genghis Khan II: Clan of the Gray Wolf name: Genghis Khan II - Clan of the Gray Wolf region: NA revision: 1.0 board: SHVC-1J3B-01 serial: SNS-6G-USA sha256: 05e9404bfe0689e484a34991f22712c9da718cf000b0f748378af5758b654a3d configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: George Foreman's KO Boxing name: George Foreman's KO Boxing region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-GK-USA sha256: fc993c122079b94ebc9b9452b46a55d5ddcd3715a4b97af795222b264827e90f configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Ghoul Patrol name: Ghoul Patrol region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AGJE-USA sha256: a4ceb31b82ea532e6eb640fa2eda61625758e72251efa5f0ae9a984f4a98a8a0 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Goal! name: Goal! region: NA revision: 1.0 board: SHVC-1A3B-13 serial: SNS-SU-USA sha256: feff03cfa195512ad87dc876012d70520cf192e2874c518b6dbdf3d876ea60c4 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Gods name: Gods region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-GZ-USA sha256: 8796ca4de3aeffd3a494fe28e7d7e2aeb220ca652b43684f29e2cc94f02c20c4 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Goof Troop name: Goof Troop region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-G6-USA sha256: 2bb368c47189ce813ad716eef16c01cd47685cb98e2c1cb35fa6f0173c97dd7c configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: GP-1 name: GP-1 region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-G7-USA sha256: 342ddf438aec3f0696de8f2cd74bb7f48a956f488f1246eeccaff5ef246ca50b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2J0N revision=01,10,11 rom name=program.rom size=0x180000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: GP-1: Part II name: GP-1 - Part II region: NA revision: 1.0 board: SHVC-2J0N-11 serial: SNS-AGRE-USA sha256: 2e478569949c3935529c956448947ef90bae64abaf3d523bd89e7f4cf5e83702 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Gradius III name: Gradius III region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-G3-USA sha256: 93da752a0c76167d0907efa832367e5d14aab8e835b864f345c386071a9af718 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2J0N revision=01,10,11 rom name=program.rom size=0x180000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: The Great Circus Mystery: Starring Micky & Minnie name: Great Circus Mystery - Starring Micky & Minnie, The region: NA revision: 1.0 board: SHVC-2J0N-11 serial: SNS-4C-USA sha256: b5492aea296ee4bfcd2c677fbec5153fd4c4db758c835b372ef750cf2399649b configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Great Waldo Search name: Great Waldo Search, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-GW-USA sha256: 3ab1ca181000f10cb7c2ae8dc9fafeecd5d77314ee92960e26dff0d6a1fd11ee configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: GunForce name: GunForce region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-GU-USA sha256: f921297c361f16ad3f1257e91829638fc795f9323172015d7237ed648c8f7515 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Hagane name: Hagane region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-AHGE-USA sha256: 5a6deb5617e86a9f4b981031e939510e30c5c8ad047f5f012e40442113fd28c2 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Hal's Hole in One Golf name: Hal's Hole in One Golf region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-JO-USA sha256: de1cf1512e48473b03adb87b7504f394e8b330b346bac24044f833d83609799a configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Hammer Lock Wrestling name: Hammer Lock Wrestling region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-LJ-USA sha256: 21cd6d749674c55342f5f1a895642d4b58b9bd7eb211f5df3a35dc6c2f5d4501 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Hard Ball III name: Hard Ball III region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-3Y-USA sha256: 4fb9b010e4b1dc166ab7995a6f9491114063b68aac344004b1edfc555951d959 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Harley's Humongous Adventure name: Harley's Humongous Adventure region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-HV-USA sha256: 6e2a02a8944c19db3da76d2646f232fbe3ed039bc7d44cc03910814fa77a7acf configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Harvest Moon name: Harvest Moon region: NA revision: 1.0 board: SHVC-1A3M-30 serial: SNS-AYWE-USA sha256: 73a3aa87ddd5ce5df5ba51292316f42b6e128280179b0a1b11b4dcddc17d4163 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Head-On Soccer name: Head-On Soccer region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AVSE-USA sha256: 9ff6bbcce7dc1f3bded96860a86698cab161d13ee167c57b5b114ac646eea0ea configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Hit the Ice name: Hit the Ice region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-HC-USA sha256: fa418618787145291201b3d9247048b2d7dfba37f6556dcb1d40db499124dd60 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Home Alone name: Home Alone region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-HA-USA sha256: 7c34908526db2a634216fab0276c42a8e4e22d59c728cd586200142a12dd2c2c configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Home Alone 2: Lost in New York name: Home Alone 2 - Lost in New York region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-HN-USA sha256: 27eaccb4eea93832639565a664bf3561ed5a11ac025d377a3f33262d851c1b2b configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Home Improvement name: Home Improvement region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-AHIE-USA sha256: 48a3ac52e2c9128abc2dc60e07817a51898e8a93be0d51d6f541a8635263a089 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Hook name: Hook region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-HO-USA sha256: acad4c594f156e0f30dec2532b35fcb3bab800e08263377634e2d96dfd055f3e configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Hunt for Red October name: Hunt for Red October, The region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-RO-USA sha256: a03528344d40bf800cdbde2dd240b30442cec7aea6026fbbe312a7c36bf0f74a configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Hurricanes name: Hurricanes region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AHUE-USA sha256: 41cc900d2461a8dc4706640e493885ddf85db04d8dffceebf7a0ed89cc983d8d configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Hyper V-Ball name: Hyper V-Ball region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-HQ-USA sha256: db57f45e113127b7148c1b0add2da888e16e16b3e46749f95973b3ef497ae90b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Hyper Zone name: Hyper Zone region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-HZ-USA sha256: f57c49cc3e4c5e34929e12658db0de8794265c517e42f3c518bb1466ba46f14a configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: The Ignition Factor name: Ignition Factor, The region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-AIFE-USA sha256: fa143784fd20721d61101920e6aae9b7f5012b8157b1ce0c7ea83ea6c875d84d configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J3B revision=01 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Illusion of Gaia name: Illusion of Gaia region: NA revision: 1.0 board: SHVC-1J3B-01 serial: SNS-JG-USA sha256: 32adc048fd89228a4310c03df243e83de7d436cdb2460b4cc83ade20d359b2bd configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Imperium name: Imperium region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-DN-USA sha256: 4dc2b5de98e9109583d9b61b38d26a8216af4dba246ef71350122213630562d0 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Incantation name: Incantation region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AIYE-USA sha256: c41150c0e84055801377fb7cb273cc51ca442b269ca6287cadf514f553e34750 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Incredible Crash Dummies name: Incredible Crash Dummies, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-C7-USA sha256: 0415adfe80977485f84cdffaaa79f18c91c004c7dba202b4cf9a94eb11adeada configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Incredible Hulk name: Incredible Hulk, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-8U-USA sha256: 8d170628d2d2fdf142bb82ad80e908bba54c45fa33241c779b8eafaf1b21171f configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Indiana Jones' Greatest Adventures name: Indiana Jones' Greatest Adventures region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AIJE-USA sha256: cf611b40f9570e8fcfdc21db623965da62561e8ca82ded59e432ba6fb0bfb562 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Inindo: Way of the Ninja name: Inindo - Way of the Ninja region: NA revision: 1.0 board: SHVC-1A3B-13 serial: SNS-IN-USA sha256: 5e5cac64fdcf09a52a9c0ab1ebc8bd309dcb1256faf1405284443569b5284fe5 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=YJ0N revision=01 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Inspector Gadget name: Inspector Gadget region: NA revision: 1.0 board: SHVC-YJ0N-01 serial: SNS-5G-USA sha256: c7b1706a0ee96f3e0d65cd043c05966bfe3d5c57d08bbd2df3118817424adf82 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: International Superstar Soccer name: International Superstar Soccer region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-3U-USA sha256: 6443fecebcdc2ff7061a40432f3ad1db6dfd354909a5f306972cf6afa122752c configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: International Superstar Soccer Deluxe name: International Superstar Soccer Deluxe region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-AWJE-USA sha256: d2fe66c1ce66c65ce14e478c94be2e616f9e2cad374b5783a6a64d3c1a99cfa9 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: International Tennis Tour name: International Tennis Tour region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-IT-USA sha256: 4e8044b1e7a779685d6751351eef2391272ac8b2bd909edeecfc3d3c5a594bef configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Irem Skins Game name: Irem Skins Game, The region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-MT-USA sha256: 8304d8bc55aa9e64bdd144d384f4b185af2426e7d64888c6c23dd41366a53981 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Itchy & Scratchy Game name: Itchy & Scratchy Game, The region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AISE-USA sha256: 39bfe828571cdb23e7c85c23cf5b175979dcc2042c5841add58f5ae6492168a9 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Izzy's Quest for the Olympic Rings name: Izzy's Quest for the Olympic Rings region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-AIZE-USA sha256: 183af7d642b55d52cd594786ec2f031d033cc6c8c1a2a84a834e4ada04301b26 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Jack Nicklaus Golf name: Jack Nicklaus Golf region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-JN-USA sha256: 3ffbb6e0ccf8e9f5e4c72d9fe526a16371e562b71a91d6430e562bf358a5126b configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: James Bond Jr. name: James Bond Jr. region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-JJ-USA sha256: 9cf82dd9a851cdc38bf2afc286c077ff18a0a5d3bb301eba606cc52db62f8965 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Jammit name: Jammit region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-J6-USA sha256: 8b7b33f3d2edb844f1d43cfdd595b8c2cb6fc005d59acb899a1afda999e47638 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Jeopardy! name: Jeopardy! region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-JY-USA sha256: 85e5f6fedc420925557092d728e1dc6b4e2042368fb78bf93c0df447f8c9c0c0 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Jeopardy! Deluxe Edition name: Jeopardy! Deluxe Edition region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-7J-USA sha256: 76d760da59aa7fc2fd4426c1d1aec57412703ab901b9df60ac2be16ede80b0e7 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Jeopardy! Sports Edition name: Jeopardy! Sports Edition region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-8Y-USA sha256: d7110ddc0b34aa4ecd5e55f7b846657edb982db82cf0ba340fe0464daf0ca9be configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Jetsons: Invasion of the Planet Pirates name: Jetsons - Invasion of the Planet Pirates, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-8J-USA sha256: ee7a29eb9c302ea2bb235ef990fd8344a6beb9817499941c40a8a94ad5f7c964 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Jim Lee's Wild Covert Action Teams name: Jim Lee's Wild Covert Action Teams region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-AWIE-USA sha256: a314583b11d594b8245b5177aa64a4d3b7497d096edabbea7c1842c57aa2ad2b configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Jim Power: The Lost Dimension in 3D name: Jim Power - The Lost Dimension in 3D region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-6J-USA sha256: 6f0bec87ece503b0fbe108cd159ed6f5fa7711b1c4fe31e982af41ad5c638093 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Jimmy Connors' Pro Tennis Tour name: Jimmy Connors' Pro Tennis Tour region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-JC-USA sha256: 205890f94e27e7c1b381124cc35c866351bafa906383e507cd17ccb9d1b68ffd configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Jimmy Houston's Bass Tournament, U.S.A. name: Jimmy Houston's Bass Tournament, USA region: NA revision: 1.0 board: SHVC-1A3M-30 serial: M/SNS-AFUE-USA sha256: 6abe908b4005a68d1f6e9a54339c94a33db41801890d8c058ce974fdab3d0bcd configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Joe & Mac name: Joe & Mac region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-JT-USA sha256: 3b2b8b813b58049a4a86ce1c42d2a651f19fd9bbab2407a494e20cf343d3c1a4 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Joe & Mac 2: Lost in the Tropics name: Joe & Mac 2 - Lost in the Tropics region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-J3-USA sha256: c9889799a9ae8558f26d66ae546db930c99acb78d921b4395afbbc38da6272aa configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Judge Dredd: The Movie name: Judge Dredd - The Movie region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AJDE-USA sha256: 67fa7115eb6bf292c024c3a8b06ce9bd457c4d46de182a06a573afff968cc0f1 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Jungle Book name: Jungle Book, The region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-7K-USA sha256: 771a0322d9f5f8e13a52d01e80257a1f75cc693cf4abf74793520eb5f8b5580e configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Jungle Strike name: Jungle Strike region: NA revision: 1.0 board: MJSC-1A0N-30-2 serial: M/SNS-AJGE-USA sha256: 8d812ea4fa897274116f7f43bc689e110f1cfbd3f7eb3a1737c2a85d36369159 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Jurassic Park name: Jurassic Park region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-J8-USA sha256: fe91d45201753ae9655d5ce38838e352f478b26b2d933c1bcb5bd8330121f9ff configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Jurassic Park name: Jurassic Park region: NA revision: 1.1 board: MAXI-1A0N-30-1 serial: SNS-J8-USA sha256: 0a4e9d6fa2ac16aa51da5538d93280734de480e44c430173ed14826c84553c7d configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Jurassic Park 2: The Chaos Continues name: Jurassic Park 2 - The Chaos Continues region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-A2JE-USA sha256: 5eff7c27f69b3ebc1ec1294ffcd1debf3512bc3e6c1c75fbdc5e778dcaaba1c9 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=BA0N revision=01,10 rom name=program.rom size=0x280000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Justice League Task Force name: Justice League Task Force region: NA revision: 1.0 board: SHVC-BA0N-10 serial: M/SNS-AJLE-USA sha256: 7f05959f423bc656091ea3bddfbc89c877ae243dca346f63233e27973f34e0eb configuration rom name=program.rom size=0x280000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Ka-Blooey name: Ka-Blooey region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-BB-USA sha256: 05152bcf9bf086e7bcdbfa7dd8edfe2085f1339c4d7e193e0071c49a10471ef4 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Kawasaki Caribbean Challenge name: Kawasaki Caribbean Challenge region: NA revision: 1.0 board: SHVC-2A0N-10 serial: SNS-KC-USA sha256: 7cc3693cc5e1e834d57795f04b048fab27864a898a9507e7ca383771e2035414 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Kawasaki Superbike Challenge name: Kawasaki Superbike Challenge region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AKEE-USA sha256: fec6dd097e378e795dd164be658b10b1c60672b2351a7f4a7722d1fe5736410e configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3B revision=20 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Ken Griffey Jr. Presents Major League Baseball name: Ken Griffey Jr. Presents Major League Baseball region: NA revision: 1.0 board: SHVC-1A3B-20 serial: SNS-JR-USA sha256: 3104d6c06c8909c56f6adb2faecf1b4382f2490370798b605631da926c5306d8 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Ken Griffey Jr. Presents Major League Baseball name: Ken Griffey Jr. Presents Major League Baseball region: NA revision: 1.1 board: SHVC-1A3M-21 serial: SNS-JR-USA sha256: f9f7a2de8cbafd6f9042841dfc42529f8245d75f436bed1c23f9ba1663182e61 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x400000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Ken Griffey Jr.'s Winning Run name: Ken Griffey Jr.'s Winning Run region: NA revision: 1.0 board: SHVC-1J3M-20 serial: M/SNS-A9GE-USA sha256: 18b5276be764c06531219c1757d40214aeec06fae68f4ce3ec78b58ee750a43e configuration rom name=program.rom size=0x400000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Kendo Rage name: Kendo Rage region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-M7-USA sha256: b16661d5151d73cea5ac46d7c899531c7b2cdee2558092c23a5460c8092b80b8 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Kid Klown in Crazy Chase name: Kid Klown in Crazy Chase region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ZI-USA sha256: 914652f72d6ceb83b8b43414d6c42581ec12e9b3f45259b8b2768d26b8d4f073 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x400000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Killer Instinct name: Killer Instinct region: NA revision: 1.0 board: SHVC-1J0N-20 serial: SNS-AKLE-USA sha256: 618a23636e07110e094277ec1d1e60c3620a6e9a5f386292808267593fa803ad configuration rom name=program.rom size=0x400000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x280000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: King Arthur & The Knights of Justice name: King Arthur & The Knights of Justice region: NA revision: 1.0 board: SHVC-BJ0N-20 serial: M/SNS-AAKE-USA sha256: 1b58d0aed4510811c73d267244a7e915aa0b334c86e68f3fa5883f5cb534e4d7 configuration rom name=program.rom size=0x280000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: King Arthur's World name: King Arthur's World region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-RC-USA sha256: aca9eb59d6783e2cae3787c69053888fea98f5dfe4c8af8b5a6360e0afb3b5d7 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: King of Dragons name: King of Dragons region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-EI-USA sha256: 6638b5541059814d4c34574e5e277ef613aebf81c91d3def557a7642fb5840e1 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: King of the Monsters name: King of the Monsters region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-KM-USA sha256: 1135858a1ce686a0a163bb0e6f3a4d7cd71c0cd56efbc79677372f2624cf2306 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: King of the Monsters 2 name: King of the Monsters 2 region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-KT-USA sha256: a9729d049ce580839bbfef1836a13dc16f2fc934d203ebf7390e0b1c47ea9a2d configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1L3B revision=02,11 sa1 rom name=program.rom size=0x400000 ram name=save.ram size=0x2000 ram size=0x800 map id=io address=00-3f,80-bf:2200-23ff map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=c0-ff:0000-ffff map id=bwram address=00-3f,80-bf:6000-7fff map id=bwram address=40-4f:0000-ffff map id=iram address=00-3f,80-bf:3000-37ff information title: Kirby Super Star name: Kirby Super Star region: NA revision: 1.0 board: SHVC-1L3B-11 serial: SNS-AKFE-USA sha256: 4e095fbbdec4a16b075d7140385ff68b259870ca9e3357f076dfff7f3d1c4a62 configuration rom name=program.rom size=0x400000 ram name=save.ram size=0x2000 ram size=0x800 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Kirby's Avalanche name: Kirby's Avalanche region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-PQ-USA sha256: 67937dd7a29a93b1aaabb6df89f0748369ff47f3f6c655a402c00d5657973140 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Kirby's Dream Course name: Kirby's Dream Course region: NA revision: 1.0 board: SHVC-1A3M-30 serial: SNS-CG-USA sha256: 0f984dc5fe8293f75e3b8fad98b0cb564706d9b1e3902b56415aa399c2d4df2b configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1L5B revision=11,20 sa1 rom name=program.rom size=0x400000 ram name=save.ram size=0x8000 ram size=0x800 map id=io address=00-3f,80-bf:2200-23ff map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=c0-ff:0000-ffff map id=bwram address=00-3f,80-bf:6000-7fff map id=bwram address=40-4f:0000-ffff map id=iram address=00-3f,80-bf:3000-37ff information title: Kirby's Dream Land 3 name: Kirby's Dream Land 3 region: NA revision: 1.0 board: SHVC-1L5B-20 serial: SNS-AFJE-USA sha256: b50bf9d95485e8aeb7a6730e9f9f9c9c4ec23a85b336a4fb2e3b63034531e36f configuration rom name=program.rom size=0x400000 ram name=save.ram size=0x8000 ram size=0x800 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Knights of the Round name: Knights of the Round region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-LO-USA sha256: fb601ead645edce139b0483d3155b4e3d7ab245bf87a3a66cb88c0a617c0a526 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Krusty's Super Fun House name: Krusty's Super Fun House region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-FH-USA sha256: bed18c968aee0eb0c866c1964c28135364cd6d65fff7bcb5873342c04e63750d configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Krusty's Super Fun House name: Krusty's Super Fun House region: NA revision: 1.1 board: SHVC-1A0N-02 serial: SNS-FH-USA sha256: e36322697c48baae6492db91e6cbf3844a420f6e0cc8a75f3a73556026ddbbb8 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Kyle Petty's No Fear Racing name: Kyle Petty's No Fear Racing region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-AKPE-USA sha256: daf3e45bafbec81ffa5911b94810b2cd267574de717292360f9940f41fb2a6a9 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Lagoon name: Lagoon region: NA revision: 1.0 board: SHVC-1A3B-12 serial: SNS-LA-USA sha256: 46c811f0cacffe8f20e1d63072d25d7c47e9bb3fd5124851fd05aca9884d21fb configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Lamborghini American Challenge name: Lamborghini American Challenge region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-L8-USA sha256: 48cd9476fef1ed685b9c30dd1669b46048f7295cbbb2abcfa5b1a48699346ea3 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Last Action Hero name: Last Action Hero revision: 1.0 board: SHVC-1A0N-10 serial: SNS-L5-USA sha256: 314d53f409b66ba3f4426a6f1bb7c69f6779aeed277ce2e19535f94d7c8ca586 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Lawnmower Man name: Lawnmower Man, The region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-LW-USA sha256: a179a1188220b59787c49a78a0dde79b89380e3a8a8a0ab558f0102c5796f873 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Legend name: Legend region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-6L-USA sha256: c7814cee0fc95d6422cf19a3dc8c9a65b60f6f56da75f09cebea02cc5f99261b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Legend of the Mystical Ninja name: Legend of the Mystical Ninja, The region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-GG-USA sha256: c865fb17e8c59a21d32b9a605319241fa74ec732e3f0ee58f5d7fcbd8ee57c6b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: The Legend of Zelda: A Link to the Past name: Legend of Zelda - A Link to the Past, The region: NA revision: 1.0 board: SHVC-1A3B-12 serial: SNS-ZL-USA sha256: 66871d66be19ad2c34c927d6b14cd8eb6fc3181965b6e517cb361f7316009cfb configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: La Legende de Zelda: La Triforce des Dieux name: Legende de Zelda - La Triforce des Dieux, La region: QC revision: 1.0 board: SHVC-1A3B-13 serial: SNS-ZF-CAN sha256: dd499445275fca6692c0487a8bd70a23f6c8e78e766df0e3c58fbbe53f8adb06 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Lemmings name: Lemmings region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-LE-USA sha256: 4b28d2ddab405976bb56e41a40ec1ea11d7362a8f398d5f8c117d715a15719ca configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Lemmings name: Lemmings region: NA revision: 1.1 board: SHVC-1A0N-10 serial: SNS-LE-USA sha256: cd016c41c7ef9f4f243d57c2b1564b4ceb3b4c38cc165cd02ab6c8e35c93aa2e configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A1M revision=01,11,20 rom name=program.rom size=0x200000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Lemmings 2: The Tribes name: Lemmings 2 - The Tribes region: NA revision: 1.0 board: SHVC-1A1M-11 serial: SNS-L2-USA sha256: 63ecdca7f89b2432ccd57bdb81c0875f6336353f5897f756ef162ab2ec2ee707 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Lester the Unlikely name: Lester the Unlikely region: NA revision: 1.0 board: SHVC-1J0N-01 serial: SNS-LY-USA sha256: a2c1970670e2831e47e24ced01bf4ba5aba05cac3773bf524c62d689c35687e1 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Lethal Enforcers name: Lethal Enforcers region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-LK-USA sha256: 3bc5f296c3dbee012e93a5cf25568f9288ce87b34d74085401a560350eaca03f configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Lethal Weapon name: Lethal Weapon region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-L3-USA sha256: 80c22cc92d51a54de9cd9fd00db5ff58a35fff35e822169c94e445d50834fba3 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2J3M revision=01,11,20 rom name=program.rom size=0x140000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=10-1f,30-3f:6000-7fff mask=0xe000 map id=ram address=90-9f,b0-bf:6000-7fff mask=0xe000 information title: Liberty or Death name: Liberty or Death region: NA revision: 1.0 board: SHVC-2J3M-01 serial: SNS-7L-USA sha256: 8fcb9c34aea863d49ff08a0ace3f83d301b81f01e2ede28bee7e6d778878d0cc configuration rom name=program.rom size=0x140000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: The Lion King name: Lion King, The region: NA revision: 1.0 board: MJSC-1J0N-20-2 serial: SNS-ALKE-USA sha256: 457abe634e0a8be03e29513a3dca8f3e9d0ddc6bf97d8931f2316094260f3712 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1K0N revision=01 rom name=program.rom size=0x80000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff necdsp model=uPD7725 frequency=8000000 rom name=dsp1.program.rom size=0x1800 rom name=dsp1.data.rom size=0x800 ram size=0x200 map id=io address=00-1f,80-9f:6000-7fff select=0x1000 information title: Lock On name: Lock On region: NA revision: 1.0 board: SHVC-1K0N-01 serial: SNS-AZ-USA sha256: 0e2ba574ff73587f211c8f818d444631584832e9240548f003171c11b898ad62 configuration rom name=program.rom size=0x80000 rom name=dsp1.program.rom size=0x1800 rom name=dsp1.data.rom size=0x800 ram name=dsp1.data.ram size=0x200 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Looney Tunes B-Ball name: Looney Tunes B-Ball region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-ALTE-USA sha256: 76ba0fc1f5c1f39354bb3173a600f23915f1191f400f7d525d220b4b3c8d958d configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Lord of the Rings: Volume 1 name: Lord of the Rings - Volume 1, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-64-USA sha256: 62557ee2a3fc3b5a3f59431f966eb61bb380ba983ef6c7742cb55cf075f15f6c configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Lost Vikings name: Lost Vikings region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-LV-USA-1 sha256: 9f7782a92fda789f9d119b1f0a2f7da0f35606357556a48eca9487797ee1a888 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Lost Vikings 2 name: Lost Vikings 2 region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-ALVE-USA sha256: ab3d97c1a3a979e1680a428ec65df54cfb72997bbfe2173292248a4fa8c51ba1 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Lufia & The Fortress of Doom name: Lufia & The Fortress of Doom region: NA revision: 1.0 board: SHVC-1A3M-20 serial: SNS-ES-USA sha256: 73731a5a7932965de02a9e98055dcf88b4d17b8f710a6ecfde3e36a1f248773b configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x280000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Lufia II: Rise of the Sinistrals name: Lufia II - Rise of the Sinistrals region: NA revision: 1.0 board: SHVC-1A3M-30 serial: M/SNS-ANIE-USA sha256: 7c34ecb16c10f551120ed7b86cfbc947042f479b52ee74bb3c40e92fdd192b3a configuration rom name=program.rom size=0x280000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: John Madden Football name: Madden NFL '92 region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-JM-USA sha256: 5a76347672ea7d27bb334b1e30bbc73e06f92373883bed499245377327a8f0cf configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: John Madden Football '93 name: Madden NFL '93 region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-MF-USA-1 sha256: 3e62872bf69ea90dd7093608268f8defa2c6016adb1011745dab3c2af45d69b7 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Madden NFL '94 name: Madden NFL '94 region: NA revision: 1.0 board: SHVC-1J0N-01 serial: SNS-9M-USA sha256: 7e77e196db47e87a5b297e60f0dfa7ce41df8d2d1fdd9152e06628d0b0e586af configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Madden NFL '95 name: Madden NFL '95 region: NA revision: 1.0 board: SHVC-1J3M-11 serial: SNS-ANLE-USA sha256: 0ad77ae7af231313e1369a52d1622b88e3751aa5ec774628df7071f9e4244abc configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Madden NFL '96 name: Madden NFL '96 region: NA revision: 1.0 board: SHVC-1J3M-20 serial: M/SNS-A6FE-USA sha256: 3059d86cdc383985c564a7a891fe18e08f5222ead7ede9fa309159d60cde13a1 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Madden NFL '97 name: Madden NFL '97 region: NA revision: 1.0 board: EA-1J3M-20/P10018 serial: SNS-A7NE-USA sha256: 6874568d985f65dd817d4b03998e71c8cbacc8d8707411fde7bffee350605a88 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Madden NFL '98 name: Madden NFL '98 region: NA revision: 1.0 board: EA-1J3M-20/P10018 serial: SNS-A8NE-USA sha256: e3c62c9fe55d2311aa6a264f41b45d6cbc7b1b069ed3aa82ee57d381c062547d configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Magic Boy name: Magic Boy region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-YG-USA sha256: c01fb8989d391d3e343003934937f02bd8ef9aacdad68c32c3d3f56feb72f5b0 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Magic Sword name: Magic Sword region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-MD-USA sha256: 1d3cceaa05e054b002caeb09fd5fb9e718ec446764f4169d97bc185da76fdf4d configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Magical Quest Starring Mickey Mouse name: Magical Quest Starring Mickey Mouse, The region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-MI-USA sha256: f301bb8ea867e530ecb64e8eff504ed5b9697cf076c70e2036ecf2ffbe6c487a configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mario is Missing! name: Mario is Missing! region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-MU-USA sha256: 8267e2f092c86d5a29c9a826db82c7473638e28e2507cdaf5c86981f07cd0bef configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A5M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Mario Paint name: Mario Paint region: NA revision: 1.0 board: SHVC-1A5M-20 serial: SNS-MP-USA-1 sha256: e842cac1a4301be196f1e137fbd1a16866d5c913f24dbca313f4dd8bd7472f45 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Mario's Early Years: Fun with Letters name: Mario's Early Years - Fun with Letters region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-AMYE-USA sha256: 22b21fb39d40447846f6ff77a07f7b4aba2a7473941ba50c787aae6153b1fb5e configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Mario's Early Years: Fun with Numbers name: Mario's Early Years - Fun with Numbers region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-YR-USA sha256: 57b94f5f576abbe8bd8f5a4eeb6cf927300ec1b5f0596610f3539ba733505c12 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Mario's Early Years: Preschool Fun name: Mario's Early Years - Preschool Fun region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-AMEE-USA sha256: c646b1e60e2cd5a2741915f5d3dfe3c17f45ff7283f8052e840bd4354b0990e1 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mario's Time Machine name: Mario's Time Machine region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-8M-USA sha256: 4b69d4958e099c3b3f6ae45e153ced9b24755d8c161dfee06c9f67886a7c0f09 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Mark Davis' The Fishing Master name: Mark Davis' The Fishing Master region: NA revision: 1.0 board: SHVC-1J3M-20 serial: M/SNS-AOAE-USA sha256: 908440f96fd0df14602fc6d1daee8519fc31f765ad00bf64aaba35c2c6ef0b56 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Marvel Super Heroes in War of the Gems name: Marvel Super Heroes in War of the Gems region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-AHZE-USA sha256: 49dd77b310b476c875633335243553be59ecfb0bffae62e46f2e53ff05c20fcd configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mary Shelley's Frankenstein name: Mary Shelley's Frankenstein region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AFRE-USA sha256: 2731f0bd1c87e75121f41d1ed5cc9fbf177f414b8bf831c76fd9c4b58c86ed08 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Mask name: Mask, The region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AMGE-USA sha256: 44cc113ce1e7616cc737adea9e8f140436c9f1c3fba57e8e9db48025d4ace632 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Math Blaster: Episode One name: Math Blaster - Episode One region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AMME-USA sha256: 22453182d44380f08004a12c6492a0c4b2e1f584e268dcc3296a03ea03ae0909 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x300000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Maui Mallard in Cold Shadow name: Maui Mallard in Cold Shadow region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AZBE-USA sha256: a203a13870eaec92095daef1196a0c9fe8416e600504d55dd0dc724d4f5f5cb0 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Mecarobot Golf name: Mecarobot Golf region: NA revision: 1.0 board: SHVC-1A3B-13 serial: SNS-TS-USA sha256: c3c4afdeb67136619c643bd9a9f3fe90337541a40745503b5d4eb9b9e6e64b67 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A1B revision=04,05,06 rom name=program.rom size=0x100000 ram name=save.ram size=0x800 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: MechWarrior name: MechWarrior region: NA revision: 1.0 board: SHVC-1A1B-06 serial: SNS-WM-USA sha256: 2a08704748f5ef6488348c4099729feca600412d331bda3756e51efd8b94e113 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x180000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: MechWarrior 3050 name: MechWarrior 3050 region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-A35E-USA sha256: 7bffa1dc31604fa3d61e06ce2c59168098cc8dd7e59998e1d5f30c49bdf8d617 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Mega Man 7 name: Mega Man 7 region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-A7RE-USA sha256: a255fec32453739903a1954149f19bc9658f4a415600b44badf1d4e5e13a16f9 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x140000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mega Man Soccer name: Mega Man Soccer region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-RQ-USA sha256: cf4d603dc0a3759da571224c671a9bfd29f9e52ca8dbb61bcc8ac8be5481e9b2 configuration rom name=program.rom size=0x140000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mega Man X name: Mega Man X region: NA revision: 1.0 board: SHVC-2A0N-01 serial: SNS-RX-USA sha256: 3e1209f473bff8cd4bcbf71d071e7f8df17a2d564e9a5c4c427ee8198cebb615 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=2DC0N revision=01 hitachidsp model=HG51B169 frequency=20000000 rom name=program.rom size=0x180000 ram size=0 rom name=cx4.data.rom size=0xc00 ram size=0xc00 map id=io address=00-3f,80-bf:6000-7fff map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000 map id=ram address=70-77:0000-7fff information title: Mega Man X2 name: Mega Man X2 region: NA revision: 1.0 board: SHVC-2DC0N-01 serial: SNS-ARXE-USA sha256: da484f2a636b8d692840f40e5468e992c5f2af26d365c69fbc12ef2923588d23 configuration rom name=program.rom size=0x180000 rom name=cx4.data.rom size=0xc00 ram name=cx4.data.ram size=0xc00 release cartridge region=NTSC board type=1DC0N revision=01 hitachidsp model=HG51B169 frequency=20000000 rom name=program.rom size=0x200000 ram size=0 rom name=cx4.data.rom size=0xc00 ram size=0xc00 map id=io address=00-3f,80-bf:6000-7fff map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000 map id=ram address=70-77:0000-7fff information title: Mega Man X3 name: Mega Man X3 region: NA revision: 1.0 board: SHVC-1DC0N-01 serial: SNS-AR3E-USA sha256: b2aa2c0a621dfbed3b528de93282fc91abb16325d358680d34753d43629263cf configuration rom name=program.rom size=0x200000 rom name=cx4.data.rom size=0xc00 ram name=cx4.data.ram size=0xc00 release cartridge region=NTSC board type=2E3M revision=01 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000 obc1 ram name=save.ram size=0x2000 map id=io address=00-3f,80-bf:6000-7fff map id=io address=70-71,f0-f1:6000-7fff,e000-ffff information title: Metal Combat: Falcon's Revenge name: Metal Combat - Falcon's Revenge region: NA revision: 1.0 board: SHVC-2E3M-01 serial: SNS-KD-USA sha256: d4f2cb6b209db29f7aec62e5a23846681c14665fb007e94d7bcfc7b5611e938b configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Metal Marines name: Metal Marines region: NA revision: 1.0 board: SHVC-2A0N-01 serial: SNS-6M-USA sha256: 0a9609a505dd1555006b16f53d961b3ce50c518aa1597a77dcd46e55ecc716ff configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Metal Morph name: Metal Morph region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-AMHE-USA sha256: 057484558ebd18165f98e556b994080535e31cefdd98b5edb190516f7040fc9d configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Metal Warriors name: Metal Warriors region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AWME-USA sha256: 0d7f875877fe856066cfb39b4ecdbbe7d48393a75770720876c94419f809bb1c configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1K0N revision=01 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff necdsp model=uPD7725 frequency=8000000 rom name=dsp1.program.rom size=0x1800 rom name=dsp1.data.rom size=0x800 ram size=0x200 map id=io address=00-1f,80-9f:6000-7fff select=0x1000 information title: Michael Andretti's Indy Car Challenge name: Michael Andretti's Indy Car Challenge region: NA revision: 1.0 board: SHVC-1K0N-01 serial: SNS-AMAE-USA sha256: 88545d24c60c18c695cc3fce8c4074f46ad1bac905e8a39a61d8a6ae6b608621 configuration rom name=program.rom size=0x100000 rom name=dsp1.program.rom size=0x1800 rom name=dsp1.data.rom size=0x800 ram name=dsp1.data.ram size=0x200 release cartridge region=NTSC board type=2J0N revision=01,10,11 rom name=program.rom size=0x140000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Michael Jordan: Chaos in the Windy City name: Michael Jordan - Chaos in the Windy City region: NA revision: 1.0 board: SHVC-2J0N-11 serial: SNS-AWCE-USA sha256: 1b425ea5a883b7464637b74c2937fde699ffff52b53ad6940a66285e0663194a configuration rom name=program.rom size=0x140000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mickey Mania: The Timeless Adventures of Mickey Mouse name: Mickey Mania - The Timeless Adventures of Mickey Mouse region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AMIE-USA sha256: 0773eb741ce28f963f767fc7dd44678eb3d37ed4dc7fc82bb9cce7d55f1cfc64 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mickey's Ultimate Challenge name: Mickey's Ultimate Challenge region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-6U-USA sha256: add082caffe707df2c0259489c3e272d6557ab07ba3ff856cbc0adba0d7db6a5 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Micro Machines name: Micro Machines region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AH3E-USA sha256: a2adeb4bf0e7cc943611ac726e5578da404373a79e91436c9bbd15480688b15c configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2A3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Might & Magic III: Isles of Terra name: Might & Magic III - Isles of Terra region: NA revision: 1.0 board: SHVC-2A3M-20 serial: SNS-3H-USA sha256: 835ded9479f0e7babae00405d85233d767e82fa247aa1a9cdc14fd1f147b62ef configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mighty Morphin Power Rangers name: Mighty Morphin Power Rangers region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-52-USA sha256: 624a66607caef2ca34920ea15b84b28cdd1916ee089d496cec4f1d43621fdbb3 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mighty Morphin Power Rangers: The Fighting Edition name: Mighty Morphin Power Rangers - The Fighting Edition region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-A3RE-USA sha256: 1b85c0690aa156a255c7f79e133e453345452698fa98abf8df744c262d0cf865 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mighty Morphin Power Rangers: The Movie name: Mighty Morphin Power Rangers - The Movie region: NA revision: 1.0 board: SHVC-2A0N-20 serial: M/SNS-A2RE-USA sha256: c706b70097c679f6f0ced6f77a30620807d0b2555fc3c683c0ec2fc791176039 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Miracle Piano Teaching System name: Miracle Piano Teaching System, The region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-MR-USA sha256: 8546dfc91f6256df8b21083531457e3edf0021da12fce6858e2c59ff239c31da configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: MLBPA Baseball name: MLBPA Baseball region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-XH-USA sha256: d32f194e27d177e64bf3bda046889b8198276fca2e8772e4b02a17152e9273e4 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mohawk & Headphone Jack name: Mohawk & Headphone Jack region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AJYE-USA sha256: 8715a641f2e4dd8b6066be7f2683d9129fff3fcccaf0a09cc8bdd2aa56460764 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Monopoly name: Monopoly region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-ML-USA sha256: 480ae7186fd5b28200cd88e136b9cd3b6600d32508e280a0bc27ea0ed8d3c0bb configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Monopoly name: Monopoly region: NA revision: 1.1 board: MAXI-1A0N-30-2 serial: SNS-ML-USA sha256: 6b0ac4d52d24536cdb7d9d0dc7d19ee30d08ac34363983290c5912ccc850fa0d configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mortal Kombat name: Mortal Kombat region: NA revision: 1.0 board: SHVC-2A0N-10 serial: SNS-KX-USA sha256: 3c6d3e4a9c9af160f1c1cf11ce4ead531d9500c1f58f1cbe682c90a5eaa3efb2 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Mortal Kombat II name: Mortal Kombat 2 region: NA revision: 1.0 board: SHVC-BJ0N-01 serial: SNS-28-USA sha256: 43e36a74fb73a7efc46b380599e269b1fff8f55ecf80f5cf50c34d02ceda041a configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Mortal Kombat II name: Mortal Kombat 2 region: NA revision: 1.1 board: SHVC-BJ0N-01 serial: SNS-28-USA sha256: ca2f86ca77f822fcd8e86f5a287f2a76d0becbb81a7bce73ae22909beb2f834c configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x400000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Mortal Kombat 3 name: Mortal Kombat 3 region: NA revision: 1.0 board: SHVC-1J0N-20 serial: SNS-A3ME-USA sha256: 417874aa57856fe93eefdb24066fa1a9ca3f23c72c09d5247ae2b3ab4b3d09d1 configuration rom name=program.rom size=0x400000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x40000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mr. Do! name: Mr. Do! region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AUNE-USA sha256: 340293c06536d7b6981ad7c681e404f4390ff6c62340f844a4558877c1b82af0 configuration rom name=program.rom size=0x40000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mr. Nutz name: Mr. Nutz region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-N8-USA sha256: 3472dd574b50aed2fa998f464398db4fbb00f5a300a672c3737ee9336a008a16 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x40000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Ms. Pac-Man name: Ms. Pac-Man region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-AN8E-USA sha256: 007735e68a91cab403f1c955d9d562e9311124e660fa5b32e5c5d0a2e052160e configuration rom name=program.rom size=0x40000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Musya: The Classic Japanese Tale of Horror name: Musya - The Classic Japanese Tale of Horror region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-MY-USA sha256: f292598ac462fdfcd32ad9b6b35ac01d4bab020391dff92bfe94780ec604289a configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Mutant Chronicles: Doom Troopers name: Mutant Chronicles - Doom Troopers region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AM9E-USA sha256: 8d4ada4f98464d176ae7f0fb8a20032056680f3241637a0f903f23f31f41ff36 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Natsume Championship Wrestling name: Natsume Championship Wrestling region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-7W-USA sha256: 22d2260de02552b1205aac2ff5a202a4c80532ac28045ef5a058d88279ab758e configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: NBA All-Star Challenge name: NBA All-Star Challenge region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-NB-USA sha256: c70b812a9d2df7f95b279e4050e03a4b8a68588a370816e645f378296b84e5d1 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: NBA Give 'n Go name: NBA Give & Go region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-ANJE-USA sha256: 5874b942f974bb906d8cbc33b601a1faf8f14aee8d0995124c8dc84bb4973808 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: NBA Hang Time name: NBA Hang Time region: NA revision: 1.0 board: SHVC-1J3M-20 serial: SNS-AXGE-USA sha256: af2fe0627de2bb2672f4f65dcbdaaee22b211275f679f123d5fa5d37fd699363 configuration rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: NBA Jam name: NBA Jam region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-8N-USA sha256: 0f18c496426bb97fe5e8b91ad5299f0b1c3898ac17047b745c86b167c212ab7a configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=BA1M revision=01 rom name=program.rom size=0x300000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: NBA Jam: Tournament Edition name: NBA Jam - Tournament Edition region: NA revision: 1.0 board: SHVC-BA1M-01 serial: M/SNS-AJTE-USA sha256: b257cffb3484e6be051a56268cb99ee888bd6d3e9c0e8d6d0779ff66c411f6ba configuration rom name=program.rom size=0x300000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=2A3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: NBA Live '95 name: NBA Live '95 region: NA revision: 1.0 board: SHVC-2A3M-20 serial: SNS-ANBE-USA sha256: 2115c39f0580ce19885b5459ad708eaa80cc80fabfe5a9325ec2280a5bcd7870 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=2A3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: NBA Live '96 name: NBA Live '96 region: NA revision: 1.0 board: SHVC-2A3M-20 serial: M/SNS-A6BE-USA sha256: 2d6fc4214245684a8f8f9bb553de637b7c660919ec775bfe3baaf74060c9157e configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: NBA Live '97 name: NBA Live '97 region: NA revision: 1.0 board: EA-1A3M-30/P10019 serial: SNS-A7LE-USA sha256: 4b945493d28653d5d047a375136ec9792f27e652be4af00e2c03c40369bd6ecf configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: NBA Live '98 name: NBA Live '98 region: NA revision: 1.0 board: EA-1A3M-30/P10019 serial: SNS-A8LE-USA sha256: 1d1b257dcf859cc412d3a9521fc58dc876a5917e6a69cd1d960a8e9840454bb4 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: NBA Showdown name: NBA Showdown region: NA revision: 1.0 board: SHVC-1A3M-10 serial: SNS-6N-USA sha256: 6a7324734004d99206439430243b51a05fa8c25ffa314dafc7f127235d1a730f configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A1B revision=04,05,06 rom name=program.rom size=0x100000 ram name=save.ram size=0x800 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: NCAA Basketball name: NCAA Basketball region: NA revision: 1.0 board: SHVC-1A1B-06 serial: SNS-DU-USA sha256: 351587366eca8aeb38236e4ad6cbd4a1b6e37b8cc592725a79249c3a054fa3a7 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A1B revision=04,05,06 rom name=program.rom size=0x100000 ram name=save.ram size=0x800 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: NCAA Basketball name: NCAA Basketball region: NA revision: 1.1 board: SHVC-1A1B-06 serial: SNS-DU-USA sha256: 8ef5d5c50ffeca1e62e88e4fe2909eaf191e28fbb5a9faf98b7b10bea72c9ed9 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=2A3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: NCAA Final Four Basketball name: NCAA Final Four Basketball region: NA revision: 1.0 board: SHVC-2A3M-20 serial: SNS-AFIE-USA sha256: d297c76efbcd9a528d8ee51025f8774ab2cb6bbc676c24e28592c50f47e71bfc configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A1M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: NCAA Football name: NCAA Football region: NA revision: 1.0 board: SHVC-1A1M-11 serial: SNS-AFBE-USA sha256: 8c43b7c2f2ef1fca9237c64c2f4c9e98d1a48940dae500ce8eac71278d34efb3 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Newman-Haas IndyCar featuring Nigel Mansell name: Newman-Haas IndyCar featuring Nigel Mansell region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ANME-USA sha256: 489d6d704d3d917d9b46ce382230700419983a8d0d61a98fe07e08c935522dde configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: NFL Football name: NFL Football region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-NF-USA sha256: f651a42bb351f7691b880827178c36fcf6c265c7833c6de1d94f7ed69bac0517 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A1M revision=01,11,20 rom name=program.rom size=0x300000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: NFL Quarterback Club name: NFL Quarterback Club '95 region: NA revision: 1.0 board: SHVC-1A1M-11 serial: SNS-Q9-USA sha256: 6a59115a9958d4a9fa167095505a2ddf222ca6291209d07618319e39a2be8b61 configuration rom name=program.rom size=0x300000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A1M revision=01,11,20 rom name=program.rom size=0x300000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: NFL Quarterback Club '96 name: NFL Quarterback Club '96 region: NA revision: 1.0 board: SHVC-1A1M-20 serial: SNS-AQBE-USA sha256: f43f8ec546b8060e9d191fca860c38caf5a43eda86a304f0073647c6fad7b2c9 configuration rom name=program.rom size=0x300000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: NHL '94 name: NHL '94 region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-4H-USA sha256: 5132e1c0d466963e6adc09e8a608ebd90619ab94f7fc908d626bbaf6a99dfa19 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: NHL '95 name: NHL '95 region: NA revision: 1.0 board: SHVC-1J3M-11 serial: SNS-ANHE-USA sha256: 01c0b58d5fd5d5484fea988455a55a71ed9e606538d2b3ce3f216159cc6929b0 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: NHL '96 name: NHL '96 region: NA revision: 1.0 board: SHVC-1J3M-20 serial: M/SNS-A6HE-USA sha256: d24c0175ee4eafed88e277691c5f5dafd4e197723097e2eb68aa6b40f449fff2 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: NHL '97 name: NHL '97 region: NA revision: 1.0 board: SHVC-1J3M-20 serial: M/SNS-AH7E-USA sha256: 2a2dc2ef84efd9a773d1e8231b7e3e57f0de7e4528968670963f2f1f358eef39 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J5M revision=11,20 rom name=program.rom size=0x200000 ram name=save.ram size=0x8000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: NHL '98 name: NHL '98 region: NA revision: 1.0 board: SHVC-1J5M-20 serial: SNS-A8HE-USA sha256: 8113c2cedafc8fd5a56c8638ae340fb275f263ff5c5e18d04dc6c3ebc5cfffee configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1A1M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: NHL Stanley Cup name: NHL Stanley Cup region: NA revision: 1.0 board: SHVC-1A1M-01 serial: SNS-NH-USA sha256: d44f487d84f5bb761955b7b70a5464b2f094e199875f595f312c88e04ac647ff configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: NHLPA Hockey '93 name: NHLPA Hockey '93 region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-HY-USA-1 sha256: 55f3432a130085c112d65aa6443c41eb7a8aeec59aad2c2b4b2ac536b604b449 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Nickelodeon GUTS name: Nickelodeon GUTS region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-ANGE-USA sha256: d7ad6f67860da78fe25d9e79dd13af7ac7efaa0c8e0103898a4849ab4af9e438 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Nigel Mansell's World Championship Racing name: Nigel Mansell's World Championship Racing region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-M8-USA sha256: ce9c819d6496e58901b39d9b04558a89e09ccc3aac33690b8d02bb0406682a57 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Ninja Gaiden Trilogy name: Ninja Gaiden Trilogy region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-ANRE-USA sha256: fccc96af24a2463b1c53253e1c5c8ef63641355fae53c0fb410427f29743262b configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Ninja Warriors name: Ninja Warriors region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-NI-USA sha256: 3c109e50b91ec6df3bb8509778ae544c99433fb40dda9b801178dfe513053618 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: No Escape name: No Escape region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ANOE-USA sha256: f099937ac4c8afb38c517c5d85475224985fb8f345dacb44994a617ea05bf4e5 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Nobunga's Ambition name: Nobunga's Ambition region: NA revision: 1.0 board: SHVC-1J3M-01 serial: SNS-NZ-USA sha256: 437ea48711d54c2275286170a17948cb57ba9d961ba475715c0dba5fbd61a2db configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A5M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Nobunga's Ambition: Lord of Darkness name: Nobunga's Ambition - Lord of Darkness region: NA revision: 1.0 board: SHVC-1A5M-11 serial: SNS-IZ-USA sha256: ae572a51ebe429cfc06a3b75d7db9581f2884f9adc78827dc162b4c4ddc6ce2d configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Nolan Ryan's Baseball name: Nolan Ryan's Baseball region: NA revision: 1.0 board: SHVC-1A3B-12 serial: SNS-NR-USA sha256: 7f3d0ebac6ecfb99cfd1d5b13210e989df9e8b2f2319a63c42faef8ad115a964 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Nosferatu name: Nosferatu region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-NS-USA sha256: 9712829b38f23229d4e3d65da78237659c790235f425c6b12487e4d9e9a37ae9 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Obitus name: Obitus region: NA revision: 1.0 board: SHVC-1A3M-21 serial: SNS-7B-USA sha256: 31bc862ab0a8eabf23b5124e13940cb3501e7ecdd3f15e34142248ceb4aa139a configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=2A3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Ogre Battle: The March of the Black Queen name: Ogre Battle - The March of the Black Queen region: NA revision: 1.0 board: SHVC-2A3M-20 serial: M/SNS-OB-USA sha256: b766c26498d0afd63f44aefdef42642d2483b54f18d2b81a4f1d67a57f641044 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Olympic Summer Games name: Olympic Summer Games region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-AO9E-USA sha256: a137f4fc1c635f706d10e0c7927e71f52da171ce2d27394ce0deb451b5bed8ae configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: On the Ball name: On the Ball region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-CT-USA sha256: e153195de7b59dd5b9854952cccca6bb93164e5fdff8292124bee6bbe5dbf16f configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2J5M revision=01 rom name=program.rom size=0x140000 ram name=save.ram size=0x8000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=10-1f,90-9f:6000-7fff mask=0xe000 map id=ram address=30-3f,b0-bf:6000-7fff mask=0xe000 information title: Operation Europe: Path to Victory 1939-45 name: Operation Europe - Path to Victory 1939-45 region: NA revision: 1.0 board: SHVC-2J5M-01 serial: SNS-YP-USA sha256: 9e1a39aaf3585af0d6a5d79de3c35fcfe030c34bd4b09606a6fb8c7def19340b configuration rom name=program.rom size=0x140000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Operation Logic Bomb name: Operation Logic Bomb region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-IY-USA sha256: 190742792a950a112f893cba0e083eb787cf24293f698967defff929635ba0e7 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2J0N revision=01,10,11 rom name=program.rom size=0x140000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Operation Thunderbolt name: Operation Thunderbolt region: NA revision: 1.0 board: SHVC-2J0N-11 serial: SNS-36-USA sha256: 5cbed0401734142184166917427d24f9e5f107a7adea665e2f4b4101491ad54b configuration rom name=program.rom size=0x140000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Oscar name: Oscar region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AOZE-USA sha256: 0c08e6b817e4d0b333acb910a0bde3d79bd2dc188defc5df9a7c1233fa81c98d configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Out of This World name: Out of This World region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-TW-USA sha256: 582548dc86598a3557e9e3c27285c81964b006a954affe5c73948da5375ea11c configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Out to Lunch name: Out to Lunch region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-P8-USA sha256: 54b2f03393109ac7fd36d8c7752f15a44d9607ab0187a371b853191db3592c01 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Outlander name: Outlander region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-LD-USA sha256: db44f8b58a31b640a47aa4390101c3c6a5f613e4e49c636d44786278033dec19 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Pac-Attack name: Pac-Attack region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-P9-USA sha256: 10c8abce67b49f8afbe880d2f13e0fd6d5efc162df34d5941e4a94851f23b2ff configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Pac-in-Time name: Pac-in-Time region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-APTE-USA sha256: 7fe4cb9c294d66589ff78e225774471ecb7db80df25f2b6199ca25671358072b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Pac-Man 2: The New Adventures name: Pac-Man 2 - The New Adventures region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-25-USA sha256: 4cb52ba751c42d9e12ca429e5d657622a370b608002880a997f64de453f0de20 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=2A5M revision=01 rom name=program.rom size=0x140000 ram name=save.ram size=0x8000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: P.T.O.: Pacific Theater of Operations name: Pacific Theater of Operations region: NA revision: 1.0 board: SHVC-2A5M-01 serial: SNS-TK-USA sha256: 83727f6954bce024edac7f3fd18a6fbf63d05b580f692d96faa37e60893c91cd configuration rom name=program.rom size=0x140000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1J5M revision=11,20 rom name=program.rom size=0x300000 ram name=save.ram size=0x8000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: P.T.O. II: Pacific Theater of Operations name: Pacific Theater of Operations II region: NA revision: 1.0 board: SHVC-1J5M-20 serial: M/SNS-ATEE-USA sha256: 2c6119fbe40d23576adde568d60ffae793bbf6b512f8fea8dcd0b1cd2623ef02 configuration rom name=program.rom size=0x300000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Packy & Marlon name: Packy & Marlon region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-APYE-USA sha256: b1586c8ece4da9697f0602a684d7a9108027247a34652c3771831d31f82ee078 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Pagemaster name: Pagemaster, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-APME-USA sha256: ecaf51852e111512385c5f209d51578e65b45fcaa17b295ca06120c8d1464520 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=2A3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Paladin's Quest name: Paladin's Quest region: NA revision: 1.0 board: SHVC-2A3M-01 serial: SNS-LN-USA sha256: 46286d0839a4397fc4c067b39783f98d2aefeca870a468bae601a1434f1dde90 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Paperboy 2 name: Paperboy 2 region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-P2-USA sha256: 7cec4ffc3eda0441561717cf55927901b5fbbd669c254079f78ca74c67c4a17b configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: The Peace Keepers name: Peace Keepers, The region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-R6-USA sha256: c414a4084b3d03aba19496d2efdd68fcf826194d8f1308f5c98e3a7af2fcc063 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1L3B revision=02,11 sa1 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 ram size=0x800 map id=io address=00-3f,80-bf:2200-23ff map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=c0-ff:0000-ffff map id=bwram address=00-3f,80-bf:6000-7fff map id=bwram address=40-4f:0000-ffff map id=iram address=00-3f,80-bf:3000-37ff information title: PGA European Tour name: PGA European Tour region: NA revision: 1.0 board: SHVC-1L3B-11 serial: SNS-AEPE-USA sha256: 5abfb974ca0e56aabb3f4126817d14a546c57a5a5c6042d31196063d80996698 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 ram size=0x800 release cartridge region=NTSC board type=1L3B revision=02,11 sa1 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 ram size=0x800 map id=io address=00-3f,80-bf:2200-23ff map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=c0-ff:0000-ffff map id=bwram address=00-3f,80-bf:6000-7fff map id=bwram address=40-4f:0000-ffff map id=iram address=00-3f,80-bf:3000-37ff information title: PGA Tour '96 name: PGA Tour '96 region: NA revision: 1.0 board: SHVC-1L3B-02 serial: SNS-A3GE-USA sha256: 571d3129350bfb7cca2285499cf31dda48d1047cf9eaef122c8c33dffa9ad296 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 ram name=internal.ram size=0x800 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: PGA Tour Golf name: PGA Tour Golf region: NA revision: 1.0 board: SHVC-1A3B-12 serial: SNS-PG-USA sha256: 5c0b5266a191852ca593235f07180e673cb79e3f0b0dd31f65808eef83bf6e90 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Phalanx: The Enforce Fighter A-144 name: Phalanx - The Enforce Fighter A-144 region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-PH-USA sha256: 0663330bc061f4b768fa1806610878ef6e6cf546f36041ae087c8e55703693b8 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Phantom 2040 name: Phantom 2040 region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-A24E-USA sha256: b7291088f5c49e1fc55bf932076ec03f7b39f6e409ae06e884b57024c56cdc87 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Pieces name: Pieces region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-Z5-USA sha256: a0b39d7fd7c39c5b0f41f3542fb8d2887530ded1c111b4ffb2a863845e704ecc configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1B0N revision=02,03 rom name=program.rom size=0x80000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 necdsp model=uPD7725 frequency=8000000 rom name=dsp1.program.rom size=0x1800 rom name=dsp1.data.rom size=0x800 ram size=0x200 map id=io address=30-3f,b0-bf:8000-ffff select=0x4000 information title: Pilotwings name: Pilotwings region: NA revision: 1.0 board: SHVC-1B0N-02 serial: SNS-PW-USA sha256: 724144e34990069213591b5df067dd437a613b30f669840e9098db1dce626d2d configuration rom name=program.rom size=0x80000 rom name=dsp1.program.rom size=0x1800 rom name=dsp1.data.rom size=0x800 ram name=dsp1.data.ram size=0x200 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Pinball Dreams name: Pinball Dreams region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-7D-USA sha256: 3a52bf09850aa054dca443f7ea74d43f201dffecc40326924ecba9b0f1450e43 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Pinball Fantasies name: Pinball Fantasies region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-APFE-USA sha256: 0888d20ab2f834c77b0a2dc2162c43890a1640adc78c6b0bb5892ca8d5008ad3 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Pink Goes to Hollywood name: Pink Goes to Hollywood region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-YW-USA sha256: d0f4a5040ecf96dc49aa0084160e291a38f2ee75319750db4d6687ab36828da9 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Pinocchio name: Pinocchio region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-ACGE-USA sha256: 98c51c3bb577600fe79577c323333a791baa30904f37c695890e6e380b75e3c8 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Pirates of Dark Water name: Pirates of Dark Water, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-8P-USA sha256: 447dfa710e69479159e9d407474fbf5f67d3a3330ab0c7627afd123ded3fdb3a configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Pit-Fighter name: Pit-Fighter region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-PF-USA sha256: c2a1a66648a0a0bfe2f201cf4f926d138e410fbf85ecf436ccb9aac70c0df3de configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Pitfall: The Mayan Adventure name: Pitfall - The Mayan Adventure region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-APAE-USA sha256: e03d117d8b3093b0bbad5224638f85378b254b81eb304e506a732b4338802e0f configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Plok name: Plok region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-P4-USA sha256: 0b3b0fd42bbe06a812053df376b183412fc0de335c4b7cb8e45f3fe47b0044e9 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Pocky & Rocky name: Pocky & Rocky region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-KK-USA sha256: 72b2b3bead3fcd27a1610ad5d4d8be3235efeaff96df2e7858911992a5892d21 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Pocky & Rocky 2 name: Pocky & Rocky 2 region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-29-USA sha256: cc33ae02114ea18a86592de327b2b4bcc80728b11a5e4c61666dca71480d4169 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Populous name: Populous region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-PO-USA sha256: 5e580f220ed16281df8ee9a5f450b553f39f8c4078d3f3048d66bda15f98e19f configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Porky Pig's Haunted Holiday name: Porky Pig's Haunted Holiday region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-KX-USA sha256: ee9759fdb590ba908f569c2bb8a63703d282b58b84bd1fe0a472ea47685acdc5 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x280000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Power Instinct name: Power Instinct region: NA revision: 1.0 board: SHVC-BJ0N-20 serial: SNS-AGKE-USA sha256: 06c8fc466805f97c9147711b2d8370d4f4d05d9fa3a916f17aa1682f73c9a63b configuration rom name=program.rom size=0x280000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Power Moves name: Power Moves region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-P3-USA sha256: 42ee7829d3db0213b718168c29674879bb4532573e9fb3450a5b417174a16ed0 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Power Piggs of the Dark Age name: Power Piggs of the Dark Age region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AOTE-USA sha256: 0288ec049723cd0c7f1148cdc1aef0b6922b8a756affe373c99d5690e0dfceaa configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1L3B revision=02,11 sa1 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 ram size=0x800 map id=io address=00-3f,80-bf:2200-23ff map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=c0-ff:0000-ffff map id=bwram address=00-3f,80-bf:6000-7fff map id=bwram address=40-4f:0000-ffff map id=iram address=00-3f,80-bf:3000-37ff information title: Power Rangers Zeo: Battle Racers name: Power Rangers Zero - Battle Racers region: NA revision: 1.0 board: SHVC-1L3B-11 serial: M/SNS-A4RE-USA sha256: 2e2a8c0da7f6def617077a25b222062f6988ef14b36b2edfe10d47c6a942d023 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 ram name=internal.ram size=0x800 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Prehistorik Man name: Prehistorik Man region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-APUE-USA sha256: 8f387d083de1399bb79e5312c31a6f1757f2a536bfa25cecf1aea77bfd77058b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Primal Rage name: Primal Rage region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-AR9E-USA sha256: 55376715f243b1bacd9aeecf1092bbc7837fe512592a2c1703d24b0829fc1934 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Prince of Persia name: Prince of Persia region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-PR-USA sha256: 494190cd6d7fd68882cbe255a6e237d9c4bdaf3988615ede0297a5e285ad5dd9 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Prince of Persia 2: The Shadow and the Flame name: Prince of Persia 2 - The Shadow and the Flame region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AUPE-USA sha256: 04ca1a481093c4a7e12f18b33697d6e05e50e30e0f5b1655aa265abd14719bba configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Pro Quarterback name: Pro Quarterback region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-QB-USA sha256: 85e2e58e1f99fce366c85d49f77446395584ca4959ef772a707fe454ed46c68f configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Pro Sport Hockey name: Pro Sport Hockey region: NA revision: 1.0 board: SHVC-1A3M-20 serial: SNS-UI-USA sha256: 00b5b3d3febd1a6f28ceb49e39cdd9476a944fe62ea3850808cdeafaaaa63040 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Push-Over name: Push-Over region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-PV-USA sha256: 475c9baa1c2b76a6b3119e47d32814dc1c08e84e23250ae015bb0bccea915637 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Q*bert 3 name: Q-bert 3 region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-Q3-USA sha256: 89d57bf308033ef17f770a80080cbeed2d112244635d5b5f860f2016398cd2f6 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Race Drivin' name: Race Drivin' region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-RV-USA sha256: dd0feb78e2d5d81f59241baf3bca5e2edaebbe98f0ac860a4eb6d448718f1ca5 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A1B revision=04,05,06 rom name=program.rom size=0x80000 ram name=save.ram size=0x800 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Radical Psycho Machine Racing name: Radical Psycho Machine Racing region: NA revision: 1.0 board: SHVC-1A1B-05 serial: SNS-RP-USA sha256: edf990e502c646a2fe83fcd1d359ca0ed5003ace06cb4c3de5a51a0c56d6ec54 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Radical Rex name: Radical Rex region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ARRE-USA sha256: 1869c0faf93bf21b7ff965f1925fad4b2924a64b1e48f4837221eebdf741226c configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Raiden Trad name: Raiden Trad region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-RD-USA sha256: 5fd7666e509f9d3cf1fd6b209dc22f2f3848f74eae7b83239d1090e031fc6df2 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Rampart name: Rampart region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-RM-USA sha256: e19f7d8d5c3e4cefeff5889380d8780495e01f0553d13be4182a15a5d4b615bb configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2J0N revision=01,10,11 rom name=program.rom size=0x180000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Ranma 1/2: Hard Battle name: Ranma Half - Hard Battle region: NA revision: 1.0 board: SHVC-2J0N-01 serial: SNS-R2-USA sha256: 32d32ef56af83887cdc2c04b3da4be1cd82a473988deaa2e7dd50d38ef79c3a1 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Rap Jam: Volume One name: Rap Jam - Volume One region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-ARVE-USA sha256: 920bbaaf6a32cab5feabb5bc8b2b427dccd53bfd31d0da8acb7ea4e819139e4f configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Realm name: Realm region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-ARQE-USA sha256: 097cbe9720903bc14599158b80e0cc314ef2fe8a585d6d0a8962eb1626031492 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Red Line: F-1 Racer name: Red Line - F1 Racer region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-6R-USA sha256: 549f2e5b17f685cad25ba71ce7bc6e004e7bfd09e6be12a827af9a9a26556fff configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Relief Pitcher name: Relief Pitcher region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-5R-USA sha256: b2221d0a59a399e437710e1191a37071d0a59c72d8e62427cd499de8d8fd7b61 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Ren & Stimpy Show: Buckeroo$! name: Ren & Stimpy Show - Buckeroo$!, The region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-ARBE-USA sha256: d322ce440076be0e3678277596acee8089098f4397b35ac8b3df88be5ce5e02f configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Ren & Stimpy Show: Fire Dogs name: Ren & Stimpy Show - Fire Dogs, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-6Y-USA sha256: 71e7083cfcf32b738f60f5eeffd4f9d1fd9250afbde0c56e22a4b97abac377a1 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x140000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Ren & Stimpy Show: Time Warp name: Ren & Stimpy Show - Time Warp, The region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-ARTE-USA sha256: ad7dd4efb8836d4009f6c76bd21865d8f5dcf9c3cbd8fa7bb32d686488847120 configuration rom name=program.rom size=0x140000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Ren & Stimpy Show: Veediots! name: Ren & Stimpy Show - Veediots!, The region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-V8-USA sha256: ba54d715abf100b94fee801351986fa818e4309730cefbacf9b4fad36e284c1c configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Revolution X: Music is the Weapon name: Revolution X - Music is the Weapon region: NA revision: 1.0 board: SHVC-2A0N-20 serial: M/SNS-AXRE-USA sha256: 5fb072c3c2e9d8e7f84bea9c4bf2253e6868eb2b1f13e35a7d75fdf05896d873 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Rex Ronan: Experimental Surgeon name: Rex Ronan - Experimental Surgeon region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-XR-USA sha256: f44482e2cccd9fcfd5875d84ff700f6e783f3bd8abd1ac4d939074cd6ad3fe65 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A1M revision=01,11,20 rom name=program.rom size=0x80000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Riddick Bowe Boxing name: Riddick Bowe Boxing region: NA revision: 1.0 board: SHVC-1A1M-01 serial: SNS-XG-USA sha256: e3ea89964ee82d2ae1e5739b8503acf62732aedef28d1b3d5caa9ebae0feec06 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=2J3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=10-1f,30-3f:6000-7fff mask=0xe000 map id=ram address=90-9f,b0-bf:6000-7fff mask=0xe000 information title: Rise of the Phoenix name: Rise of the Phoenix region: NA revision: 1.0 board: SHVC-2J3M-11 serial: SNS-QG-USA sha256: cce455b7074f62ffdb41863ee8c160ea06f7acd028837666329bc1e0c3567ad0 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x400000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Rise of the Robots name: Rise of the Robots region: NA revision: 1.0 board: SHVC-BJ0N-01 serial: SNS-AROE-USA sha256: 38be8013bbe07b2020ba30031fb0a2c77bad8a3eb61fac8217adfe82d6c402af configuration rom name=program.rom size=0x400000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Rival Turf! name: Rival Turf! region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-RB-USA sha256: 3f59cc687d22cd1b23cc33ae6e4518234c9da813c01f79f4c43716e12d32a12d configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Road Riot 4WD name: Road Riot 4WD region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-RR-USA sha256: 864aa9068fb23cd20022a9ac36fb9082299278ea0cb07a20deec2b6a1c6cbc70 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Road Runner's Death Valley Rally name: Road Runner's Death Valley Rally region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-DV-USA sha256: 2e8203e421f97cf165f03a5d4f69dadf0bcca18c42c6a1dfe79c8705c522cc54 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: RoboCop 3 name: RoboCop 3 region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-R3-USA sha256: 055d9c6311a663af7c899a6f76a419c274c57baada3ef64c52fadb1c676b1446 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: RoboCop versus The Terminator name: RoboCop vs. The Terminator region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-VR-USA sha256: a2115e7576dec06e0de613efb89de861815a78ef72e78a3784be09fb7541928f configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2J3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=10-1f,30-3f:6000-7fff mask=0xe000 map id=ram address=90-9f,b0-bf:6000-7fff mask=0xe000 information title: Robotrek name: Robotrek region: NA revision: 1.0 board: SHVC-2J3M-11 serial: SNS-E9-USA sha256: 1e2ded7b1e350449b7a99b7ec414525e4b9b086c416deeee5eb3e48e032c46bd configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Rock n' Roll Racing name: Rock & Roll Racing region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-RN-USA sha256: 9d721753301278325c851f1843d669a697aed757dcf6495a31fc31ddf664b182 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Rocketeer name: Rocketeer, The region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-RK-USA sha256: b072fd9b08042e3262446fdf418a41848251072a32bd7f8335cc03543c4ae6c8 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Rocko's Modern Life: Spunky's Dangerous Day name: Rocko's Modern Life - Spunky's Dangerous Day region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-8D-USA sha256: cde8876b99c337ff932322506ceef05519e5882b853c54bb8c650d9500cd5957 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Rocky Rodent name: Rocky Rodent region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-NP-USA sha256: 7c0f915b581796e5b6dd384ecdc0dad8af4d956492fbcedec628c8845d911d7e configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Roger Clemens' MVP Baseball name: Roger Clemens' MVP Baseball region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-VP-USA sha256: e21300c8c4170e084fd83ce4c842dd73f939fbd10ddfe47c9a49b6e291dcd52d configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Roger Clemens' MVP Baseball name: Roger Clemens' MVP Baseball region: NA revision: 1.1 board: SHVC-1A0N-20 serial: SNS-VP-USA sha256: f7e3c3012af2dbad350646b6ef3470f0b4c42e4a2873109f7aa6c81d7157c887 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A5B revision=02,04 rom name=program.rom size=0x100000 ram name=save.ram size=0x800 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Romance of the Three Kingdoms II name: Romance of the Three Kingdoms II region: NA revision: 1.0 board: SHVC-1A5B-04 serial: SNS-XL-USA sha256: 815bfcf4fd6eb23a20c2e50dde023c210b273ffb6cd86a93909d803c3643ce46 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=2J5M revision=01 rom name=program.rom size=0x180000 ram name=save.ram size=0x8000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=10-1f,90-9f:6000-7fff mask=0xe000 map id=ram address=30-3f,b0-bf:6000-7fff mask=0xe000 information title: Romance of the Three Kingdoms III: Dragon of Destiny name: Romance of the Three Kingdoms III - Dragon of Destiny region: NA revision: 1.0 board: SHVC-2J5M-01 serial: SNS-S3-USA sha256: 88fa0a78ca98c6386e086c7fa9e81a2625bdecc55115dde6c6f4770b0670aa40 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1J5M revision=11,20 rom name=program.rom size=0x300000 ram name=save.ram size=0x8000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Romance of the Three Kingdoms IV: Wall of Fire name: Romance of the Three Kingdoms IV - Wall of Fire region: NA revision: 1.0 board: SHVC-1J5M-20 serial: M/SNS-AS4E-USA sha256: 9670c67eeeb5581fa5345025a2e2ee875179e0da9f5be4bf78641e477d785f17 configuration rom name=program.rom size=0x300000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: R-Type III: The Third Lightning name: R-Type III - The Third Lightning region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ER-USA sha256: 4d6c7d6d2693d8d43bafaff7582f9a94885362dadd9ee4012bbbdce1ba10c30e configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=YA0N revision=01 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Run Saber name: Run Saber region: NA revision: 1.0 board: SHVC-YA0N-01 serial: SNS-RU-USA sha256: 4158e3e8890a52f0b12dc9ad5a29276058a247ff41e9f1d22897ebde1eb11269 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x400000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Samurai Shodown name: Samurai Shodown region: NA revision: 1.0 board: SHVC-BJ0N-01 serial: SNS-A7SE-USA sha256: 5db804171fca42486485ed85e4afe45b29e6d01304bdf75d520bfc42429739e3 configuration rom name=program.rom size=0x400000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x400000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Saturday Night Slam Masters name: Saturday Night Slam Masters region: NA revision: 1.0 board: SHVC-BJ0N-01 serial: SNS-ZW-USA sha256: 34e1af0642c85148c5a3dc3c7ab4bcbda13a9fea190934b5526c555fff035651 configuration rom name=program.rom size=0x400000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Scooby-Doo Mystery name: Scooby-Doo Mystery region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-AXDE-USA sha256: 7fb5236d10852125f0f37c2188b907d636647400a57bccbdb2f63098ffae8b2d configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: SeaQuest DSV name: SeaQuest DSV region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ASQE-USA sha256: a4ab8cfad2f236675b1c0124f8484688e149f38e8628a3b38e9ec14d491ec07e configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Secret of Evermore name: Secret of Evermore region: NA revision: 1.0 board: SHVC-1J3M-20 serial: M/SNS-AEOE-USA sha256: 17c864a76d498feb6479eee8e7d6807b951c66225033228622bb66754baab1db configuration rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Secret of Mana name: Secret of Mana region: NA revision: 1.0 board: SHVC-1J3M-01 serial: SNS-K2-USA sha256: 4c15013131351e694e05f22e38bb1b3e4031dedac77ec75abecebe8520d82d5f configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Shadowrun name: Shadowrun region: NA revision: 1.0 board: SHVC-1A3M-10 serial: SNS-WR-USA sha256: e6bc0a595d5c7c4bc0bbb61ffe35a70288a77eb78544ed74682d489a9e6f07f4 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Shanghai II: Dragon's Eye name: Shanghai II - Dragon's Eye region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-DE-USA sha256: bdbcc53b266159b5a08e307e5b60fdb0cb5a1ba8f8c1c6c7f89d81eaf5133e85 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Shaq-Fu name: Shaq-Fu region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-AQFE-USA sha256: c73757eea258e169e506eaef989227a59918060f94117917f338183db14c50b6 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Shien's Revenge name: Shien's Revenge region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-OO-USA sha256: 454c580498a7d317ed61cb5863b1999eff57ad440ecd30ebb76e193c9c52f3ac configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1J5M revision=11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x8000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Sid Meier's Civilization name: Sid Meier's Civilization region: NA revision: 1.0 board: SHVC-1J5M-20 serial: SNS-EQ-USA sha256: de2d5a952096c5f50368b9270d342aa6e7a39007ffbec27117e182e30ef4cf32 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Side Pocket name: Side Pocket region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-4P-USA sha256: d09ca5adaee65cfd686742482bc55b1a3ce9bc5ebed61f24c5631555151a7fc7 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A5M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: SimAnt: The Electronic Ant Colony name: SimAnt - The Electronic Ant Colony region: NA revision: 1.0 board: SHVC-1A5M-01 serial: SNS-AN-USA sha256: c0bd1b378337c32047a6b7122a3813beb646e496fbdb1fa5c87ab9856271e4c5 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1A5B revision=02,04 rom name=program.rom size=0x80000 ram name=save.ram size=0x8000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: SimCity name: SimCity region: NA revision: 1.0 board: SHVC-1A5B-02 serial: SNS-SC-USA sha256: e9c0bc05511e05a0d7c3e7cc42e761e1e8e532d46f59b9854b6902e1a2e9dd0a configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1J5M revision=11,20 rom name=program.rom size=0x200000 ram name=save.ram size=0x8000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: SimCity 2000 name: SimCity 2000 region: NA revision: 1.0 board: SHVC-1J5M-20 serial: M/SNS-AWWE-USA sha256: bf74c58e4190faca2f3a967dc190fe529d13887d1262b72e057b5353e43cf67f configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1A3B revision=20 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: SimEarth: The Living Planet name: SimEarth - The Living Planet region: NA revision: 1.0 board: SHVC-1A3B-20 serial: SNS-SE-USA sha256: 446a1036d036986fdea7906c83832d3ba79ef63a6ed8c4e88b89ab9cb25daded configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Simpsons: Bart's Nightmare name: Simpsons - Bart's Nightmare, The region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-BN-USA sha256: f0d98e9061d0f6a193bb856de8a592f336dada97c41966e8d03119ba97465413 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Simpsons: Virtual Bart name: Simpsons - Virtual Bart, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AVBE-USA sha256: 29c28188234ddbb0b72fc84253dcd3514e23034779c773db8097b073b73390c8 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: S.O.S.: Sink or Swim name: Sink or Swim region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-9J-USA sha256: 70008efe51185eb0a2f8d8d8ac2bdbb99bd3dfcc169dcc474962f82692998051 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Skuljagger: Revolt of the Westicans name: Skuljagger - Revolt of the Westicans region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-SL-USA sha256: e10070f01845505ae8bfdf7b5b492e7209c2ae876f169fb6ff420dea269f4da3 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Skyblazer name: Skyblazer region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-LZ-USA sha256: a4ba1483db79c3f6278082387bce216d8f3e3b11ca32d49516d27f5ac07135a5 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Smart Ball name: Smart Ball region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-JB-USA sha256: cbca00fa5dfd6c72db2f21d010255657c33f7ac48de2554262035ead11bdf314 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Snow White in Happily Ever After name: Snow White in Happily Ever After region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ASHE-USA sha256: f653b8308b617e1cba1caf004e5a670088b882e320fa6afcc7a29dd3b2dd0ea0 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2J0N revision=01,10,11 rom name=program.rom size=0x180000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Soldiers of Fortune name: Soldiers of Fortune region: NA revision: 1.0 board: SHVC-2J0N-01 serial: SNS-UD-USA sha256: 6fe7c8d39fcfab7f0a18e837a7ee0dd162e0557d6989c6e0d10c81616d3a0b8b configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Sonic Blast Man name: Sonic Blast Man region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-SK-USA sha256: 75a7b5b8ad0329dc828d3201089e125fd55fdfc99d4cec704ffcd7e3036c2410 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2J0N revision=01,10,11 rom name=program.rom size=0x180000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Sonic Blast Man II name: Sonic Blast Man II region: NA revision: 1.0 board: SHVC-2J0N-11 serial: SNS-2C-USA sha256: efe78f6fc68ddd0f6ef0ad9e0223d9417c14fcadece987dc8f50423fd6723b27 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: SOS name: SOS region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-TT-USA sha256: 8f0a7670fe53d30f721784e5fff78349eb157a9f0eb2246206f9d7db478b7c56 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Soul Blazer name: Soul Blazer region: NA revision: 1.0 board: SHVC-1A3B-13 serial: SNS-SO-USA sha256: 8438da09de8ce9aded3bb08644543f7b60fb60cffc68ce2d67d6a0643f2ecfc2 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Space Ace name: Space Ace region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-5A-USA sha256: 85887dfa92374048fb20809c00eabea428992024cf875d287d0431b9767cc7cb configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Space Football: One on One name: Space Football - One on One region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-FL-USA sha256: 24f3f22949f36ebf8ab4beaa8cba22db107efe7a7585f749343f2860bf041fe1 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x40000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Space Invaders name: Space Invaders region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-IC-USA sha256: dc5353ddc350816619230f25f8c51bddabf7438e6dfba21662eb1c4794856735 configuration rom name=program.rom size=0x40000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Space Megaforce name: Space Megaforce region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AT-USA sha256: f5b7418c00ccac44615cfc57c7e17d57533837056886f6d733e6b714c36dec1f configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Spanky's Quest name: Spanky's Quest region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-HJ-USA sha256: 14dc44687c8da35aec63b9edadbaac21bf7293f5171646f614139192e82ab071 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Sparkster name: Sparkster region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ASSE-USA sha256: eaa06470734ea57eff9b888137aa468fcb7bb149a0870a85e68c9db123de4670 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Spawn name: Spawn region: NA revision: 1.0 board: SHVC-1J0N-20 serial: SNS-A9WE-USA sha256: 32d0f1ca5b91fd9b2caf81422fb9e8fb30bc091f0b2a429b9269dd307fcba4fd configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0xe0000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Spectre name: Spectre region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-7Q-USA sha256: 22d0b7687d66436abaf447bb29558e43f562283ec4dbe744df7d79a3e27a2577 configuration rom name=program.rom size=0xe0000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Speed Racer in My Most Dangerous Adventures name: Speed Racer in My Most Dangerous Adventures region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-9S-USA sha256: 54046ec1fc57f6165ad33080502f72809d1b06b438a5a0d0a80ffa2bb3df8b0b configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Speedy Gonzales: Los Gatos Bandidos name: Speedy Gonzales - Los Gatos Bandidos region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-ASSE-USA sha256: df02d0f4f40e2732138309d38e91b48aef482490979007ecb63359a35115dfd4 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Speedy Gonzales: Los Gatos Bandidos name: Speedy Gonzales - Los Gatos Bandidos region: NA revision: 1.1 board: MAXI-1A0N-30-2 serial: SNS-ASEE-USA sha256: 68a51b7a06b6a9e7100a89521e52b5c467c46c828c0f6504bee677beac2aa6fd configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Spider-Man: The Animated Series name: Spider-Man - The Animated Series region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-ADME-USA sha256: f05d777e3de69aab18d336cac0af07f794f8d00090d085f86cebaed3679cabad configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Spider-Man & Venom: Maximum Carnage name: Spider-Man & Venom - Maximum Carnage region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AMCE-USA sha256: 964d21996e385e032b5d18baf716692ba1db780245cd71956c212045c1b8eb9a configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x300000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Spider-Man & Venom: Separation Anxiety name: Spider-Man & Venom - Separation Anxiety region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-A2CE-USA sha256: b72fbbfe737eff49f59dcef9f13b963e50c5bc322d7eb0e7b4c25f3a71aa0815 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Spider-Man & X-Men: Arcade's Revenge name: Spider-Man & X-Men - Arcade's Revenge region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-MN-USA sha256: 63210a91573fa8e19592f2e6c746a400831d804c00453739447d2df32e731df7 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Spindizzy Worlds name: Spindizzy Worlds region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-SX-USA sha256: fe10238ae42ed9eb4d906a81dd50ebe585140982cdfe266308ce1f16e78e6903 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J3M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: The Sporting News Baseball name: Sporting News Baseball, The region: NA revision: 1.0 board: SHVC-1J3M-20 serial: M/SNS-AWBE-USA sha256: 8d3f20af0be588cf2edc39aee0d96d4085512919a05c0e90a7848e414cc20e42 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Sports Illustrated: Championship Football & Baseball name: Sports Illustrated - Championship Football & Baseball region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-LU-USA sha256: 254d17a82a32d8bd231ca3a87d356b65e65cb0229902a69a57c21a4c99bbba1f configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1C0N5S revision=01 superfx revision=1 rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 map id=io address=00-3f,80-bf:3000-34ff map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=60-7d,e0-ff:0000-ffff information title: Star Fox name: Star Fox region: NA revision: 1.0 board: SHVC-1C0N5S-01 serial: SNS-FO-USA sha256: 3857b5294ea8f7468849437bb2d8271564e8a0ff30774622e9c872bcbd53a84d configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 superfx revision=1 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Star Trek: Deep Space Nine - Crossroads of Time name: Star Trek - Deep Space Nine - Crossroads of Time region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-A9DE-USA sha256: 3a16ad45ae3d89b13c9e53e21c2a4c725ff7cec7fbe7896d538d163f92cb4aac configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Star Trek: Starfleet Academy - Starship Bridge Simulator name: Star Trek - Starfleet Academy - Starship Bridge Simulator region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ASTE-USA sha256: b4d0b4a3fd73469f5469dfcc2316e50848ebf0630a225df2969c740759e321f4 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Star Trek: The Next Generation - Future's Past name: Star Trek - The Next Generation - Future's Past region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-XN-USA sha256: 22c907b56ac6f414365801ed375c3fbf75696ce7f34ec89e1724628dc5622957 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Stargate name: Stargate region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AGTE-USA sha256: 9ffd95486904804aca1f7068c99f1c9e91c2c0e5474ec758df1a913393571cc7 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Steel Talons name: Steel Talons region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-5S-USA sha256: 91f938b4989215b1cd39635797f23b59b9d7b6d36e583f9eb69d022abe537bfc configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Sterling Sharpe: End 2 End name: Sterling Sharpe - End 2 End region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AS2E-USA sha256: e3b07a59f969ced91c4579bb459f2c747a6c3f12c45ae4776483ef4830f5f00f configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Stone Protectors name: Stone Protectors region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ASOE-USA sha256: dad9c116283322d5a13fd659874c681582abdff3df182cc4c90511d33fb7110a configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Street Combat name: Street Combat region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-RA-USA sha256: b4626cf0c876a124b50f9421c48a7d762e9ed808ad336c799d543d60b484897c configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1N0N revision=01 sdd1 rom name=program.rom size=0x400000 map id=io address=00-3f,80-bf:4800-4807 map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000 map id=rom address=c0-ff:0000-ffff information title: Street Fighter Alpha 2 name: Street Fighter Alpha 2 region: NA revision: 1.0 board: SHVC-1N0N-01 serial: SNS-AUZE-USA sha256: 910a29f834199c63c22beddc749baba746da9922196a553255deade59f4fc127 configuration rom name=program.rom size=0x400000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Street Fighter II: The World Warrior name: Street Fighter II - The World Warrior region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-S2-USA sha256: 2b34161e96ef3f0f48cecd67e531a9bb94310652d8686f301bac426e4ab97e77 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=3J0N revision=01 rom name=program.rom size=0x280000 map id=rom address=00-2f,80-af:8000-ffff map id=rom address=40-6f,c0-ef:0000-ffff information title: Street Fighter II Turbo: Hyper Fighting name: Street Fighter II Turbo - Hyper Fighting region: NA revision: 1.0 board: SHVC-3J0N-01 serial: SNS-TI-USA sha256: 3e487f8ba48c0b5e31744e3281d6bce375089db6075c8eb3d9a929376b817381 configuration rom name=program.rom size=0x280000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Street Hockey '95 name: Street Hockey '95 region: NA revision: 1.0 board: SHVC-BJ0N-01 serial: SNS-AHYE-USA sha256: 6756f92fe8e066be4b204cfdc94c1615ba6ece7e78fb5d2c77c81a9d298aa744 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Street Racer name: Street Racer region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ASRE-USA sha256: d1f61b6bb4bb6879a4fbd2c82d77390c546ee7f821edddc884fb9cc7463ad79b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Strike Gunner S.T.G. name: Strike Gunner STG region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-SG-USA sha256: 05f14e6ed3394d9273e2397769a8acf1a9db646be6066e82269521e8eec53562 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1CA6B revision=01 superfx revision=4 rom name=program.rom size=0x100000 ram name=save.ram size=0x10000 map id=io address=00-3f,80-bf:3000-34ff map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000 map id=rom address=40-5f,c0-df:0000-ffff map id=ram address=00-3f,80-bf:6000-7fff size=0x2000 map id=ram address=70-71,f0-f1:0000-ffff information title: Stunt Race FX name: Stunt Race FX region: NA revision: 1.1 board: SHVC-1CA6B-01 serial: SNS-CQ-USA sha256: c04d80b84514202ff319384ca20641eb0189e975eed5612915bd9c224b2ab30a configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x10000 superfx revision=4 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Sunset Riders name: Sunset Riders region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-6S-USA sha256: e9c406d4f773697b9b671e7ddf2207c9d0ab242d7f23e502cdd453fbb264d392 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Adventure Island name: Super Adventure Island region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-H2-USA sha256: 190999122aacc2cff20c5677b3f60ed938d8a36b696d16cc1bf416705efe151e configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2J3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=10-1f,30-3f:6000-7fff mask=0xe000 map id=ram address=90-9f,b0-bf:6000-7fff mask=0xe000 information title: Super Adventure Island II name: Super Adventure Island II region: NA revision: 1.0 board: SHVC-2J3M-11 serial: SNS-E4-USA sha256: eaf1b83e95d8a04f9a84d4960cf87cc182fc60ef07be35eb8929c4033d6fef67 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Alfred Chicken name: Super Alfred Chicken region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-8A-USA sha256: 0deb7a91fbe5848f1733ce668daaa49b0dad3d821bacc0791837c1ba15e60d7c configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Super Aquatic Games starring the Aquabats name: Super Aquatic Games starring the Aquabats, The region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-AU-USA sha256: b64f9f95fb244feddb3ff50bf0972af88f5d006e9b09050b930374fef8b37862 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2J0N revision=01,10,11 rom name=program.rom size=0x180000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Super Baseball 2020 name: Super Baseball 2020 region: NA revision: 1.0 board: SHVC-2J0N-01 serial: SNS-SA-USA sha256: 8808783f789ca6413364a7abea240f6f7291b5906026f360ba8cfdd2791fc179 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x80000 ram name=save.ram size=0x200 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Super Baseball Simulator 1.000 name: Super Baseball Simulator 1.000 region: NA revision: 1.0 board: SHVC-1A3B-12 serial: SNS-UB-USA sha256: 1622371a5a4001fff9690323e89b7a8d449cdc3cae6dcd1249f0c7dc8c651d33 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x200 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Bases Loaded name: Super Bases Loaded region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-SP-USA sha256: a8239355631d303ecebfd43fc14e80f148e4ac9937234e29cc87d6f939b033a0 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2B3B revision=01 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff necdsp model=uPD7725 frequency=8000000 rom name=dsp1.program.rom size=0x1800 rom name=dsp1.data.rom size=0x800 ram size=0x200 map id=io address=60-6f,e0-ef:0000-7fff select=0x4000 information title: Super Bases Loaded 2 name: Super Bases Loaded 2 region: NA revision: 1.0 board: SHVC-2B3B-01 serial: SNS-3D-USA sha256: 327745aceb708d82419c3d2cffdffa78f55df0878bb1786e1b7fc294385f20ba configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 rom name=dsp1.program.rom size=0x1800 rom name=dsp1.data.rom size=0x800 ram name=dsp1.data.ram size=0x200 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Super Bases Loaded 3: License to Steal name: Super Bases Loaded 3 - License to Steal region: NA revision: 1.0 board: SHVC-1A3M-30 serial: SNS-AB3E-USA sha256: b21a161fed748920e54cd72c54095416b1d999636e0388d7d147884779c52833 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Batter Up name: Super Batter Up region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-FA-USA sha256: 165938810948f3226f7446978fa36ae8bc781616d95b39cd126d5c8afbf6e2ee configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Battleship name: Super Battleship region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-8B-USA sha256: 1d6573e3db2efab0c98d1940b4171d569348d27a1cc20e80a83094e6c0e66e35 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Battletank: War in the Gulf name: Super Battletank - War in the Gulf region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-SB-USA sha256: 94496e73fc7fdf2f72f16bf2becb0c3935db2ebd97555eac73b63400acbceec6 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Battletank 2 name: Super Battletank 2 region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-2X-USA sha256: b68e865b0b5fe6af421a171e94fb1cb0006ae3e412b6361f6f858c44adaa304b configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Black Bass name: Super Black Bass region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-BQ-USA sha256: f0913358cb0870c3dcc7f0c0d2d69704874c31a113150eda668c95024c0d6fd9 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x80000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Super Bomberman name: Super Bomberman region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-H6-USA sha256: 4efab3f49cbe91ec77b6cba747ddfedfdc0b080c755a8b6ba51234f0676c000f configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Super Bomberman 2 name: Super Bomberman 2 region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-M4-USA sha256: 0a4b4a783a7faf6ada3e1326ecf85de77e8c2a171659b42a78a1fae43f806ca6 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2J0N revision=01,10,11 rom name=program.rom size=0x180000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Super Bonk name: Super Bonk region: NA revision: 1.0 board: SHVC-2J0N-11 serial: SNS-ANKE-USA sha256: 21d4a72461d8680cf75cf3b8eba42e13127815bc17b6249d89a5e39beb3f1406 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Bowling name: Super Bowling region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-BW-USA sha256: 946de556b4f877e54e16b5c828db89c038e50349cfd0ddf8ea96b6541f9d70fa configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Buster Brothers name: Super Buster Brothers region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-SN-USA sha256: 5965bde449ff775c1a0d9fd3cf2fb8c51a86b44ad1942dfb5c14a91f103be030 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Caesers Palace name: Super Caesers Palace region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-C6-USA sha256: d42f8c7969b4c434f9ca04ce0080d897877a5e71c2926d309ef5dae93ba25548 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Castlevania IV name: Super Castlevania IV region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-AD-USA sha256: 0ef6f4cce5a2273fa49fe1ce724e0048a8e39c91da6b00dbb693fe1ba909177d configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Chase H.Q. name: Super Chase HQ region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-QT-USA sha256: b839253b878821ff00847491d11452e933baaf303f49dd39d22e3a524ea1ff81 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A1B revision=04,05,06 rom name=program.rom size=0x100000 ram name=save.ram size=0x800 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Super Conflict name: Super Conflict region: NA revision: 1.0 board: SHVC-1A1B-06 serial: SNS-CN-USA sha256: 6cbc4db85cb8420020f9edbfd290c0f435b313a59577aca65314d31f8b816620 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Copa name: Super Copa region: MX revision: 1.0 board: SHVC-1A0N-20 serial: SNS-75-USA sha256: db7d727de86a1ac886ce3c243bf5941910154eaef3be50209187b9711592830d configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Double Dragon name: Super Double Dragon region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-WD-USA sha256: bcced1be76ef920b562a555696bcb4583d1c8cea4d4b057cab6e0e09be8ef8c4 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board id:Super Game Boy rom name=program.rom size=0x40000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 icd2 revision=1 rom name=sgb.boot.rom size=0x100 map id=io address=00-3f,80-bf:6000-67ff map id=io address=00-3f,80-bf:7000-7fff information title: Super Game Boy name: Super Game Boy region: NA revision: 1.2 board: Super Game Boy serial: N/A sha256: 4d7fc331a811b8dc630b469262fd6f45e289243cef83101f32038158967d1b28 configuration rom name=program.rom size=0x40000 rom name=sgb.boot.rom size=0x100 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Ghouls 'n Ghosts name: Super Ghouls & Ghosts region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-CM-USA sha256: 7468c271d7240cf4e0d08c16e9969a1b1b1caf5adc0e5adc568d93c92651a057 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Goal! 2 name: Super Goal! 2 region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-JV-USA sha256: d4caa6683ee1b6c70c10fd0555ade33dadcc6551d94e791586e64fd683d8f3a8 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Godzilla name: Super Godzilla region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-7G-USA sha256: 33dda5838264c93341ef865512e4b86e16fd4a0387eda04e331517bfaecf1c0b configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super High Impact name: Super High Impact region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-HX-USA sha256: d78ff42efdbb0e180777d17b5f7a96e08530ab77f15a99237f60714f7cfe2b74 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super James Pond name: Super James Pond region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-J5-USA sha256: 3f8efb19eae68f24feb42c018b7dc7a819bfd8d993ab36899681caa7ee94b06e configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2A3B revision=01 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Super Mario All-Stars name: Super Mario All-Stars region: NA revision: 1.0 board: SHVC-2A3B-01 serial: SNS-4M-USA sha256: a9e3e57d591e995e8e0dd228b619b6aed42205eaf55316fa8ff33f236b3a32b3 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=BA3M revision=01 rom name=program.rom size=0x280000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Super Mario All-Stars + Super Mario World name: Super Mario All-Stars + Super Mario World region: NA revision: 1.0 board: SHVC-BA3M-01 serial: SNS-5M-USA sha256: a8806bfe07cd3c9945d9fd3fcea932ae1cd671cab5cae12bb7a2ae726cbf9175 configuration rom name=program.rom size=0x280000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1K1B revision=01 rom name=program.rom size=0x80000 ram name=save.ram size=0x800 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 necdsp model=uPD7725 frequency=8000000 rom name=dsp1.program.rom size=0x1800 rom name=dsp1.data.rom size=0x800 ram size=0x200 map id=io address=00-1f,80-9f:6000-7fff select=0x1000 information title: Super Mario Kart name: Super Mario Kart region: NA revision: 1.0 board: SHVC-1K1B-01 serial: SNS-MK-USA sha256: 89ad4ba02a2518ca792cf96b61b36613f86baac92344c9c10d7fab5433bebc16 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x800 rom name=dsp1.program.rom size=0x1800 rom name=dsp1.data.rom size=0x800 ram name=dsp1.data.ram size=0x200 release cartridge region=NTSC board type=1L5B revision=11,20 sa1 rom name=program.rom size=0x400000 ram name=save.ram size=0x8000 ram size=0x800 map id=io address=00-3f,80-bf:2200-23ff map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=c0-ff:0000-ffff map id=bwram address=00-3f,80-bf:6000-7fff map id=bwram address=40-4f:0000-ffff map id=iram address=00-3f,80-bf:3000-37ff information title: Super Mario RPG: Legend of the Seven Stars name: Super Mario RPG - Legend of the Seven Stars region: NA revision: 1.0 board: SHVC-1L5B-11 serial: SNS-ARWE-USA sha256: 740646f3535bfb365ca44e70d46ab433467b142bd84010393070bd0b141af853 configuration rom name=program.rom size=0x400000 ram name=save.ram size=0x8000 ram name=internal.ram size=0x800 release cartridge region=NTSC board type=1A1B revision=04,05,06 rom name=program.rom size=0x80000 ram name=save.ram size=0x800 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Super Mario World name: Super Mario World region: NA revision: 1.0 board: SHVC-1A1B-06 serial: SNS-MW-USA-1 sha256: 0838e531fe22c077528febe14cb3ff7c492f1f5fa8de354192bdff7137c27f5b configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1CB5B revision=20 superfx revision=4 rom name=program.rom size=0x200000 ram name=save.ram size=0x8000 map id=io address=00-3f,80-bf:3000-34ff map id=rom address=00-3f:8000-ffff mask=0x8000 map id=rom address=40-5f:0000-ffff map id=ram address=00-3f,80-bf:6000-7fff size=0x2000 map id=ram address=70-71:0000-ffff information title: Super Mario World 2: Yoshi's Island name: Super Mario World 2 - Yoshi's Island region: NA revision: 1.1 board: SHVC-1CB5B-20 serial: SNS-YI-USA sha256: bd763c1a56365c244be92e6cffefd318780a2a19eda7d5baf1c6d5bd6c1b3e06 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x8000 superfx revision=4 release cartridge region=NTSC board type=BA3M revision=01 rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Super Metroid name: Super Metroid region: NA revision: 1.0 board: SHVC-BA3M-01 serial: SNS-RI-USA sha256: 12b77c4bc9c1832cee8881244659065ee1d84c70c3d29e6eaf92e6798cc2ca72 configuration rom name=program.rom size=0x300000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Ninja Boy name: Super Ninja Boy region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-CW-USA sha256: 40b46bb29785fb431b325f22377faa8b099be4d77aecc1f03000b8a4cb589b63 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Super Nova name: Super Nova region: NA revision: 1.0 board: SHVC-1J0N-01 serial: SNS-DH-USA sha256: a8acbbd6f8afbf289a6b837da6cd8bd109a00cd38625c956ab8ff739732d9e4f configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Off Road name: Super Off Road region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-OR-USA sha256: 24b687f95bb9737d223738f13c00aeaa7d697fa9e2fd50597b81d0cfa2160daa configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Off Road: The Baja name: Super Off Road - The Baja region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-R8-USA sha256: 16f9c90d75bd23d0620be00ecf818fcb25c5935d4ee26b1fe17b926f8987aa65 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Pinball: Behind the Mask name: Super Pinball - Behind the Mask region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-XP-USA sha256: 6bf0e7a7b95613b9d0e5c8cc98eee5d0ac200e88b5d4444ad5cf93d3e8265118 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Pinball: Behind the Mask name: Super Pinball - Behind the Mask region: NA revision: 1.1 board: SHVC-1A0N-30 serial: M/SNS-XP-USA-1 sha256: 65aff1403838c938d7c6170f3044a2b0317cd2ee13ad79353a4cdd2aa82f4e87 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Super Play Action Football name: Super Play Action Football region: NA revision: 1.0 board: SHVC-1A3B-13 serial: SNS-SF-USA sha256: 5a4b0c89606f71182fa5552ac476cc3bbda5ddc7d44e33f9184114aaea38020d configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Super Punch-Out!! name: Super Punch-Out!! region: NA revision: 1.0 board: SHVC-1A3M-21 serial: SNS-4Q-USA sha256: a3d803b8c6b0b6ac55085671040b840f993543915c7f802e14fb651beabe9b63 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Putty name: Super Putty region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-YU-USA sha256: 3dff3513ae6acb85a02b00b9f5adb4757ab97661993bded4f329127a792cef87 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super R-Type name: Super R-Type region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-SR-USA sha256: 05c7f6461209020785fba33007e1830820aa44ada4b1a6f991d936bf2335b15b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super R.B.I Baseball name: Super RBI Baseball region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-ARLE-USA sha256: 607bfa0f74e57298f59ebe237c2e7b59364024d844534f3befb9ad1301bbedf8 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Scope 6 name: Super Scope 6 region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-LR-USA sha256: 7a8ffaf8bb549b400ec2f0bda9f3c0dbf5852c38618cdb21cd783c368383e2c7 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Slam Dunk name: Super Slam Dunk region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-D9-USA sha256: e987ceb53cc1407b1ba612b13a7b5391db6c41ea14552c165ae62ad42eeaa0ae configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Slap Shot name: Super Slap Shot region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ZX-USA sha256: c39ebf88af138e87ca5d963ed71a8b7defba3e2bc271d72186d00056e8225721 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Smash T.V. name: Super Smash TV region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-TV-USA sha256: 8b75ab4bb1b63c45a56e7a4c5a37c0864f14375ab3131edc33489764426ad888 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Soccer name: Super Soccer region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-FS-USA sha256: 694ad2b34ab808bd8a1aa9dda359594cfd3a5fd9d95d4cf262ccaa0eb57eef67 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Soccer Champ name: Super Soccer Champ region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-HT-USA sha256: 5eb9736d66b3ac730ebbfdd19ef2397282b5f1a62dc0048093e041e23b807741 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Solitaire name: Super Solitaire region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-LT-USA sha256: 5985cdad45958a5b8c5967ad39efe51569f560bf237a4e9864f21111082a8500 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Star Wars: A New Hope name: Super Star Wars - A New Hope region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-V4-USA sha256: c6bd7239cb2074ff1c471d14535bead6290bba2d7c75b4f03209cb114877b4c8 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Star Wars II: The Empire Strikes Back name: Super Star Wars II - The Empire Strikes Back region: NA revision: 1.0 board: SHVC-2A0N-10 serial: SNS-E5-USA sha256: 1dd01da68cb61def641389bf3fa87b7a29113c9c8dd172cf303c0f7e03ba6e47 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Star Wars II: The Empire Strikes Back name: Super Star Wars II - The Empire Strikes Back region: NA revision: 1.1 board: MAXI-1A0N-30-2 serial: SNS-E5-USA sha256: 46370b3bd6ff9ee04c425eef0f482f521f3b61bd4b058f2f4e9d322253d7b5de configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Star Wars III: Return of the Jedi name: Super Star Wars III - Return of the Jedi region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ARJE-USA sha256: c49be867cdd276703a3ae46a6b17673b9e359af4f9af2329c8eb747120245817 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Star Wars III: Return of the Jedi name: Super Star Wars III - Return of the Jedi region: NA revision: 1.1 board: MAXI-1A0N-30-2 serial: SNS-ARJE-USA sha256: f7df5cd16ce6624567d1a24e9b9c0b9050ea9b6a9fe5a7973484589637756596 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x400000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Super Street Fighter II: The New Challengers name: Super Street Fighter II - The New Challengers region: NA revision: 1.0 board: SHVC-BJ0N-01 serial: SNS-XW-USA sha256: d17cb5c73174060fcbd9cba6c705643f19c3b8be24d0f7ee43aee674ff1ea38e configuration rom name=program.rom size=0x400000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Strike Eagle name: Super Strike Eagle region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-EG-USA sha256: 830c900083cccc6ded74c167c4e257db34df4786ecd6e2f053de454db7d31fe5 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Tennis name: Super Tennis region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-ST-USA sha256: 6e45a80ea148654514cb4e8604a0ffcbc726946e70f9e0b9860e36c0f3fa4877 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Troll Islands name: Super Troll Islands region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-5L-USA sha256: 02cb7f1ed21ed6bfb9eaa0e91df2adb063a9bf4cbd6feb6cd024d676829e227e configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Turrican name: Super Turrican region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-TU-USA sha256: 056ac8160363d577e3ffc2f593801b8bb3d024fe4f3a3331b711dc556204949d configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Turrican 2 name: Super Turrican 2 region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-A2TE-USA sha256: 96da3512a1aa05a40f1e5d61c48932b0d55d9f136d6418b848153a9fecab06de configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Valis IV name: Super Valis IV region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-VA-USA sha256: 792e615a34ceae5a1b9a4f54c5a5d9b53e39299332fece83e4bceca2c22efb21 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Super Widget name: Super Widget region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-WI-USA sha256: 62d3d650e956f23f3b221f83c5c5bd204afd0e4f4d9c47a3251962323de96089 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1K0N revision=01 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff necdsp model=uPD7725 frequency=8000000 rom name=dsp1.program.rom size=0x1800 rom name=dsp1.data.rom size=0x800 ram size=0x200 map id=io address=00-1f,80-9f:6000-7fff select=0x1000 information title: Suzuka 8 Hours name: Suzuka 8 Hours region: NA revision: 1.0 board: SHVC-1K0N-01 serial: SNS-8H-USA sha256: dfada65f4497f482d5f81964322d9952f678f50e65418d307d4503f9bf9a32d9 configuration rom name=program.rom size=0x100000 rom name=dsp1.program.rom size=0x1800 rom name=dsp1.data.rom size=0x800 ram name=dsp1.data.ram size=0x200 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: SWAT Kats: The Radical Squadron name: SWAT Kats - The Radical Squadron region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-AK9E-USA sha256: d802715fb4f09d7e499b5b3e577af641598a723dae7cedeaa93943bb53c6edbb configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Syndicate name: Syndicate region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AFYE-USA sha256: c2015d03dd3db08069b2a6ea1ed6b3e1ac1e3a5f804b02295c3cd3717add91ef configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Taz-Mania name: Taz-Mania region: NA revision: 1.1 board: MAXI-1A0N-30-2 serial: SNS-TZ-USA sha256: 1711fe9010232b41ec406900e5b4ef528dd2beaa97b27d94ed7eef57d63904a0 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Tecmo Secret of the Stars name: Tecmo Secret of the Stars region: NA revision: 1.0 board: SHVC-2A3M-20 serial: M/SNS-AQ-USA sha256: 7da4a3cfa5de4bb4722a6e2a42c26aae322b5e668f1645d8c870fb99e6080600 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=2A3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Tecmo Super Baseball name: Tecmo Super Baseball region: NA revision: 1.0 board: SHVC-2A3M-11 serial: SNS-ATBE-USA sha256: c3cb1d2fd9775aa9d15b7eedd45ad82519b73d47ca166737ed398c748717bcc4 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=2A3B revision=01 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Tecmo Super Bowl name: Tecmo Super Bowl region: NA revision: 1.0 board: SHVC-2A3B-01 serial: SNS-7T-USA sha256: 35dd020cf57fc402417ab6e4a6c49866c5a86bba25218c0aaf7ce85cb134bcf8 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A5M revision=01,11,20 rom name=program.rom size=0x200000 ram name=save.ram size=0x8000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Tecmo Super Bowl II: Special Edition name: Tecmo Super Bowl II - Special Edition region: NA revision: 1.0 board: SHVC-1A5M-11 serial: SNS-ASBE-USA sha256: 2972057a0087f8239d2523eaa995405f06e5d5ba3a3203b6b50d401379c8ebde configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1A5M revision=01,11,20 rom name=program.rom size=0x200000 ram name=save.ram size=0x8000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Tecmo Super Bowl III: Final Edition name: Tecmo Super Bowl III - Final Edition region: NA revision: 1.0 board: SHVC-1A5M-20 serial: M/SNS-AW4E-USA sha256: 8cfd4c5525f4bd4bba5af7e2323f1e61f27ce97c6d5617cfa685c9276fbf6407 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Tecmo Super NBA Basketball name: Tecmo Super NBA Basketball region: NA revision: 1.0 board: SHVC-1A3B-13 serial: SNS-XM-USA sha256: 14bce564f976d1431127259edbcb23c52c79361fed9814d307d627c4650e800e configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Teenage Mutant Ninja Turtles IV: Turtles in Time name: Teenage Mutant Ninja Turtles IV - Turtles in Time region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-TM-USA sha256: 5b82cdd6f2da56f43680d6a5021faebe2e06036d30602c1a7917aa414cf8b5f4 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Teenage Mutant Ninja Turtles V: Tournament Fighters name: Teenage Mutant Ninja Turtles V - Tournament Fighters region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-KY-USA sha256: 849141370f164d6db3e5709da670726f958ce13ffef69319564db3fb0b12c69d configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Terminator name: Terminator region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-TN-USA sha256: bd7074ef4a05d790646abe145ffd2587fb48044e4b730286d807abe102841177 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Terminator 2: Judgment Day name: Terminator 2 - Judgment Day region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-TP-USA sha256: 06db3be569a587d79b51bfc684fd2ebdea977863875aedec88218fbb4169c21b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Terminator 2: The Arcade Game name: Terminator 2 - The Arcade Game region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-XV-USA sha256: 365f10f9d9f68cc59e769eeb451c417e1ff7415022a625de9976a3b924c0bd61 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Test Drive II: The Duel name: Test Drive II - The Duel region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-DL-USA sha256: c9563cb57314588aa3db22b76dc8acfba3e73733dd3538edd90af5a15595830e configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Tetris & Dr. Mario name: Tetris & Dr. Mario region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-AFTE-USA-1 sha256: 3cdebbd8adc4bb6773a7995f542fdac49adefca71cba583255a1c1bf37ac3946 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Tetris 2 name: Tetris 2 region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-27-USA sha256: accc836c3adabadc810fbe35702c6a64d50a09f4c672d2734fa58b251d7a20aa configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Tetris 2 name: Tetris 2 region: NA revision: 1.1 board: SHVC-1A0N-30 serial: SNS-27-USA-1 sha256: 70dea29a928c1625def31c862dc74960e39e587e416b45829efc21f13ebd9630 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Tetris Attack name: Tetris Attack region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-AYLE-USA-1 sha256: 579bf1a1988d4af06a69cc1d82a2478ebe51940c5ced7f97e83029a24e6aa778 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Thomas the Tank Engine & Friends name: Thomas the Tank Engine & Friends region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-6T-USA sha256: 1121df3f05dd9dbb749f6b785eb9b3eb69968004f9d6ceffa6f84757af2f3702 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Thunder Spirits name: Thunder Spirits region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-TH-USA sha256: d50aaa41e153ca356eee16a9deccb1a763ee56ebbe6c80cd28c5ad1db66a5316 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Tick name: Tick, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ATHE-USA sha256: eb958801fd1f08771e5a0933f7701d633262efbfe8d47de21dda18e3b77670de configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Time Cop name: Time Cop region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-ATCE-USA sha256: 16fb965130e57f37dda2466f23820f091f8b96758aa7e30ba4fd63cb618e5ddb configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Time Slip name: Time Slip region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-XT-USA sha256: 8e82f98d2e62bc1e5fcf2386c2b5ca54998398220efcedd67858aaaa92289a42 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Time Trax name: Time Trax region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-X8-USA sha256: fa7e2b40093f0cc7233cc77e95bbbea2144c8183dec10446590396fffd7cda37 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x180000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Timon & Pumbaa's Jungle Games name: Timon & Pumbaa's Jungle Games region: NA revision: 1.0 board: SHVC-1J0N-20 serial: SNS-AJ9E-USA sha256: 271a67b32b3bb00ceb0f4e7d81494888d0d821635f0f936d481dfbe671567c08 configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1A1M revision=01,11,20 rom name=program.rom size=0x200000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Tin Star name: Tin Star region: NA revision: 1.0 board: SHVC-1A1M-11 serial: SNS-9N-USA sha256: 0503cd93b4d211a825acd47ff3813668b4ce68890c8be2fbfe5ac2b46882dfcf configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Tiny Toon Adventures: Buster Busts Loose! name: Tiny Toon Adventures - Buster Busts Loose! region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-TA-USA-1 sha256: ba679a11264e9695895a6c17358a41e8459be06166d056811df9c2738fef3d0d configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Tiny Toon Adventures: Wacky Sports Challenge name: Tiny Toon Adventures - Wacky Sports Challenge region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-5Z-USA sha256: f753de4a38bd83f7d937fc7bf5565a3c351a794c113dead8fdee6d86c85633e8 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: TKO Super Championship Boxing name: TKO Super Championship Boxing region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-BX-USA sha256: 08d808e9c5851e4301a38a56b350a20ea9e3adbef51546e87e1785d691d0f2d5 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2J3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=10-1f,30-3f:6000-7fff mask=0xe000 map id=ram address=90-9f,b0-bf:6000-7fff mask=0xe000 information title: TNN Bass Tournament of Champions name: TNN Bass Tournament of Champions region: NA revision: 1.0 board: SHVC-2J3M-20 serial: M/SNS-ATNE-USA sha256: ced8c0bc2791ffe47cb9eec03db67567945af8c58b5330326722f1cfca41bf51 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Tom and Jerry name: Tom and Jerry region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-TJ-USA sha256: 4f500da19dbb1557a7bc0ce14437098c1402478d573fb569303b81c011f86fbf configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Tommy Moe's Winter Extreme: Skiing and Snowboarding name: Tommy Moe's Winter Extreme - Skiing and Snowboarding region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-XS-USA sha256: d99008d2181986dc7f65228696d940b5d31be8471f166d1ab9b1c14f1503bcfb configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Tony Meola's Sidekicks Soccer name: Tony Meola's Sidekicks Soccer region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-6K-USA sha256: e0fbf731550266d79a0b6ca460afd04c8c312f7023b2c9882c4fc3acc3e7932f configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Top Gear name: Top Gear region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-TR-USA sha256: ca9889f17f184b3d99a2eaaa82af73e366f03ed00313fdd369e5e023b208e788 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Top Gear 2 name: Top Gear 2 region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-2P-USA sha256: 76b2702c4be8b668c1017f2817c280283c275eaa41535bf6ffa2b8d2220b68c6 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1B0N revision=02,03 rom name=program.rom size=0x100000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 necdsp model=uPD7725 frequency=8000000 rom name=dsp4.program.rom size=0x1800 rom name=dsp4.data.rom size=0x800 ram size=0x200 map id=io address=30-3f,b0-bf:8000-ffff select=0x4000 information title: Top Gear 3000 name: Top Gear 3000 region: NA revision: 1.0 board: SHVC-1B0N-03 serial: SNS-A3TE-USA sha256: ede60f0d283b6ea3a45308981d99e7c422a0296e5fadde51c6bafd4dcc789ca2 configuration rom name=program.rom size=0x100000 rom name=dsp4.program.rom size=0x1800 rom name=dsp4.data.rom size=0x800 ram name=dsp4.data.ram size=0x200 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Total Carnage name: Total Carnage region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-XC-USA sha256: 9bf884be5627d38f060ad7f3a61ea1fea1474d416e1d037d33014ca9d5205c1d configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x400000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Toy Story name: Toy Story region: NA revision: 1.0 board: SHVC-BJ0N-20 serial: SNS-AQHE-USA sha256: 345e795000e74f51704774edfc8049473461761a65eb47cab710caa29e09897b configuration rom name=program.rom size=0x400000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Toys: Let the Toy Wars Begin! name: Toys - Let the Toy Wars Begin! region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-YT-USA sha256: 7a6e5da46b026900fba4584a32ad40d940b9ecf9fccfb11f96a205a914014784 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Troddlers name: Troddlers region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-TX-USA sha256: 4070a7702dc506a1ceb6f65b5c330b3a162df6f01735c8f206934fd47b810ed4 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2A3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Troy Aikman Football name: Troy Aikman Football region: NA revision: 1.0 board: SHVC-2A3M-11 serial: SNS-YQ-USA sha256: 46fcca4ce29f472afa8519958d256eec347c2dc2da154c95f263a051c5c02dbb configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: True Golf: Wicked 18 name: True Golf - Wicked 18 region: NA revision: 1.0 board: SHVC-1A3M-10 serial: SNS-W8-USA sha256: dd96a8f4f9c8988301ff710a4c70ebe3bf7914901f3547abe1d5f0dd5c0b921b configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: True Golf Classics: Pebble Beach Golf Links name: True Golf Classics - Pebble Beach Golf Links region: NA revision: 1.0 board: SHVC-1A3B-12 serial: SNS-GB-USA sha256: 5c7b28bb24bad697156ad444ff23bd15ad6744dbf9899b3cccf2aa36d559d825 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: True Golf Classics: Waialae Country Club name: True Golf Classics - Waialae Country Club region: NA revision: 1.0 board: SHVC-1A3B-11 serial: SNS-TG-USA sha256: 72088194a65fc057f2910945a33d9f071682a4cecac8996f0bdabcdb5ef39962 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: True Lies name: True Lies region: NA revision: 1.0 board: SHVC-1A0N-30 serial: SNS-ATLE-USA sha256: 47dd8ea2d12a6bb2a9774de1d492259fc4fb9f8ec7976383bbfd922532671f6b configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Tuff E Nuff name: Tuff E Nuff region: NA revision: 1.0 board: SHVC-2A0N-10 serial: SNS-TE-USA sha256: 8f62d014f513a7dcbca5aa76cbe476c3e4526100f34913af831bc05dab029bd1 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Turn and Burn: No-Fly Zone name: Turn and Burn - No-Fly Zone region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-ZN-USA sha256: e4343c0fadc00ffdc3dc31345068d751eea5d639f826731f08cb81673d508c40 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A1M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: The Twisted Tales of Spike McFang name: Twisted Tales of Spike McFang, The region: NA revision: 1.0 board: SHVC-1A1M-11 serial: SNS-83-USA sha256: 259c25d4613f97f5fa7992900fb583625d7fb912c7ae09fa9def2e682834dc9f configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A1M revision=01,11,20 rom name=program.rom size=0x100000 ram name=save.ram size=0x800 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Ultima: Runes of Virtue II name: Ultima - Runes of Virtue II region: NA revision: 1.0 board: SHVC-1A1M-11 serial: SNS-7U-USA sha256: 094555d5720158ee60c9d5ab9a13110192db5ebf0f6cf69abbb59a00bc470345 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Ultima VI: The False Prophet name: Ultima VI - The False Prophet region: NA revision: 1.0 board: SHVC-1A3M-20 serial: SNS-U6-USA sha256: 11659bd8dd620d50400d16042aeb2d0ddb00c7183fc1ecb95b1a34f07db0431b configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Ultima VII: The Black Gate name: Ultima VII - The Black Gate region: NA revision: 1.0 board: SHVC-1A3M-21 serial: SNS-7I-USA sha256: a31af0e39afb55bbc92a5543b504327fbe7e8cd0a5e08626976bed7b65376737 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Ultimate Fighter name: Ultimate Fighter region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-HP-USA sha256: 78bf82963cded9162e25035053c8b1a9f760748ff0beacc230d005204992737d configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x400000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Ultimate Mortal Kombat 3 name: Ultimate Mortal Kombat 3 region: NA revision: 1.0 board: SHVC-1J0N-20 serial: SNS-A3ZE-USA sha256: cb2fdfce61858063bf4c9da4228381c3ec3abe423f4d378cddd174ae4adb261e configuration rom name=program.rom size=0x400000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Ultraman: Towards the Future name: Ultraman - Towards the Future region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-UM-USA sha256: e9fae4c2e171a1fc4f2bd800abd9e42750aaf7a4db9e40c5b9142e15029500bd configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: U.N. Squadron name: UN Squadron region: NA revision: 1.0 board: SHVC-1A0N-01 serial: SNS-E8-USA sha256: 0b155a54b6134601fc0791252a63ca73efd522667c3d6fd7a44f5b3c500039d7 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Uncharted Waters name: Uncharted Waters region: NA revision: 1.0 board: SHVC-1A3B-13 serial: SNS-QK-USA sha256: 794152fc6f55cb15a0b203fa645ac9fa314a293da999d8ec8b3dda080434d175 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1J5M revision=11,20 rom name=program.rom size=0x200000 ram name=save.ram size=0x8000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000 information title: Uncharted Waters: New Horizons name: Uncharted Waters - New Horizons region: NA revision: 1.0 board: SHVC-1J5M-11 serial: SNS-QL-USA sha256: 64bc4707f422661a66618088887e2363a5f896ea683c58984fffd96dd21ab5f0 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x8000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Uniracers name: Uniracers region: NA revision: 1.0 board: SHVC-1A3M-21 serial: SNS-4L-USA sha256: 859ec99fdc25dd9b239d9085bf656e4f49c93a32faa5bb248da83efd68ebd478 configuration rom name=program.rom size=0x200000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Untouchables name: Untouchables, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-UC-USA sha256: ecefb4117a6aae117e033c8cc07f0db2797d6be93dd5cdcefc23692a21fae02e configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Urban Strike name: Urban Strike region: NA revision: 1.0 board: MJSC-1A0N-30-2 serial: M/SNS-AUSE-USA sha256: dcb33a89fcb8d8ca8f3a467034728ad6375273d8eb51a60418ca51ef745e9b38 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Utopia: The Creation of a Nation name: Utopia - The Creation of a Nation region: NA revision: 1.0 board: SHVC-1A3M-10 serial: SNS-UP-USA sha256: 2500d6c846c78bcb729f15535bf2b852a120411891cabaaaa6fc407906d0214e configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A1B revision=04,05,06 rom name=program.rom size=0x100000 ram name=save.ram size=0x800 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Vegas Stakes name: Vegas Stakes region: NA revision: 1.0 board: SHVC-1A1B-06 serial: SNS-VS-USA sha256: 78bf9d79fb2ff3f9d03ecc1176d070e53ddaca2c6b0cda69e74c19a4e50b195b configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1CA0N5S revision=01 superfx revision=4 rom name=program.rom size=0x80000 ram name=save.ram size=0x8000 map id=io address=00-3f,80-bf:3000-34ff map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000 map id=rom address=40-5f,c0-df:0000-ffff map id=ram address=00-3f,80-bf:6000-7fff size=0x2000 map id=ram address=70-71,f0-f1:0000-ffff information title: Vortex name: Vortex region: NA revision: 1.0 board: SHVC-1CA0N5S-01 serial: SNS-4V-USA sha256: 41b5561de9e4984276e52987ea46c5f4fa8526d8141c70c738875a9eb9fe9d70 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x8000 superfx revision=4 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Wanderers from Ys III name: Wanderers from Ys III region: NA revision: 1.0 board: SHVC-1A3B-12 serial: SNS-YS-USA sha256: b0e74f0fe8d1e7fe2fe404341fea7c68e28f3a0ab78552d5092d413f2ecec417 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: War 2410 name: War 2410 region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-A2AE-USA sha256: 82bba8ae2bb4dbc74a18af31aaec19c368576e4369dd70b396caa5e8729540bb configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: War 3010: The Revolution name: War 3010 - The Revolution region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AZNE-USA sha256: 8b12e5e4553fc921c23739d1aec2ed517535ec239daef800f39f602d8473847f configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Wario's Woods name: Wario's Woods region: NA revision: 1.0 board: SHVC-1A3M-21 serial: SNS-65-USA sha256: be420715152394e0e4a25ab10931b67f92f910cfcf7793e31dfee1c6334808e5 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Warlock name: Warlock region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AWKE-USA sha256: 8579dd352d20589072ed5c026bde7adadd6229d18a022e7cb47cf5602b54015e configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Warp Speed name: Warp Speed region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-WP-USA sha256: 36ec2f409f08a08f8327570eadcd8960b6a47bf5797441c2df05fcc50c5b762b configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Wayne Gretzky and the NHLPA All-Stars name: Wayne Gretzky and the NHLPA All-Stars region: NA revision: 1.0 board: SHVC-2A3M-20 serial: M/SNS-AWZE-USA sha256: dd73690dd3165a16580e191c92a497102758f312c759353f685e371755c663a8 configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Wayne's World name: Wayne's World region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-WW-USA sha256: 56ba3d585bf6b701e342d86a0bd164ab0a97dfbd5df46b3a964506842633459c configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=2A0N revision=01,10,11,20 rom name=program.rom size=0x180000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: WCW Super Brawl Wrestling name: WCW Super Brawl Wrestling region: NA revision: 1.0 board: SHVC-2A0N-11 serial: SNS-AWRE-USA sha256: 215ab7e576b31462e3284d035006dc638cae06bbfb1af2c5617403b15ab2b25a configuration rom name=program.rom size=0x180000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: WeaponLord name: WeaponLord region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-AWDE-USA sha256: 0b1ba31ae95b61d7d9a0f5509b5836fff84f60915802e3b3ba1170a5c50a4b71 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: We're Back!: A Dinosaur's Story name: We're Back! - A Dinosaur's Story region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-6D-USA sha256: e931c3c08f20f78e3a43ad92d16eb472be619abaa17c2d8e2b0fcd5d05dbd74d configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Wheel of Fortune name: Wheel of Fortune region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-WL-USA sha256: 12abf1ba063c120c1a98495a1c85e67a0007aff771ef92adcb94b4a0a2fd5adb configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Wheel of Fortune: Deluxe Edition name: Wheel of Fortune - Deluxe Edition region: NA revision: 1.0 board: MAXI-1A0N-30 serial: SNS-XF-USA sha256: c7af9e7f3243ba1b5dd81f32f710e60c2ae1d443ecaf7140bf42d71a1b69d8a2 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Where in the World is Carmen Sandiego? name: Where in the World is Carmen Sandiego region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-WX-USA sha256: 1bd3af0125743bf9bbbac6e7dc215fe32c4ff7043a2ee034d56b627e3f6875f0 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Where in Time is Carmen Sandiego? name: Where in Time is Carmen Sandiego region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-WN-USA sha256: e3177f066bf004fd99aef31f2692ba0b412dd280d613dc3f4cf334d97f4c9af8 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Whizz name: Whizz region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-AZWE-USA sha256: 0a52dc1e7820f5541f53ce0e1e96144fe079af0efe3dae5c2c89d86365feb8b1 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Wild Guns name: Wild Guns region: NA revision: 1.0 board: SHVC-1A0N-30 serial: M/SNS-4W-USA sha256: c8f159e2625ac8078535c06857ea28475706da45df494de8e46f50888272cf71 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Wild Snake name: Wild Snake region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AWSE-USA sha256: 39bb99eddb224de5f0789f807ffef06b9efa2efb7962dced31fb272f986699cd configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Williams Arcade's Greatest Hits name: Williams Arcade's Greatest Hits region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-AW8E-USA sha256: 60d01a3f499463156546ecdee18ee3e946b95302ee0b1569decb97f52372d2eb configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Wing Commander name: Wing Commander region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-WC-USA sha256: 2167fc7c5447b2287668d2f3e4ef1a285361b2292ecc8a4cbd9f966a460ad7a2 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=YA0N revision=01 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Wing Commander: The Secret Missions name: Wing Commander - The Secret Missions region: NA revision: 1.0 board: SHVC-YA0N-01 serial: SNS-2W-USA sha256: 132ca0b6a4888edf7de785d48f4417fac28522646e6c7514f80c5e9ff1438d5f configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Wings 2: Aces High name: Wings 2 - Aces High region: NA revision: 1.0 board: SHVC-1A0N-02 serial: SNS-WG-USA sha256: c3bcd5c716f96e6359ebcfd85c3e9b07b46c5124bf4010d89ceef5b6f2f868f6 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Winter Olympic Games: Lillehammer '94 name: Winter Olympic Games - Lillehammer '94 region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-W4-USA sha256: 0e834647669783c2b79cc1120c057c870c541079a7abd1eee3f787d59dc3c3eb configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: The Wizard of Oz name: Wizard of Oz, The region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-W6-USA sha256: 025dd3047c474d879e69b91a3918add9cdabedf4182e1c1e10e5f0c13a124bf9 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A3M revision=10,20,21,30 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-7fff information title: Wizardry V: Heart of the Maelstrom name: Wizardry V - Heart of the Maelstrom region: NA revision: 1.0 board: SHVC-1A3M-20 serial: SNS-W5-USA sha256: bc68f40075f9983f5027fe264c3037d1a831e8e76a6c9adb60d10226f6ef005b configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Wolf Child name: Wolf Child region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-WH-USA sha256: e0165bafeb8d65be08a5a4079f8651104471f450c60794b761b1255853ca2d98 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x100000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Wolfenstein 3D name: Wolfenstein 3D region: NA revision: 1.0 board: SHVC-1J0N-10 serial: SNS-6W-USA sha256: 9c2b458e8fda5cb437a4c6d28fb430e45c4cfef98420c40546b8e08563a4fc7d configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Wolverine: Adamantium Rage name: Wolverine - Adamantium Rage region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AWXE-USA sha256: 44428a3d1c796fbd41da7620e321c45f11cd80a0e5f4ab8c48177106cb960d77 configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Wordtris name: Wordtris region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-WT-USA sha256: 82e2b636e66c4edbae27a5be91a61194ef2881ec93f40d1de93a6153617b12f2 configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=2J3M revision=01,11,20 rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff map id=ram address=10-1f,30-3f:6000-7fff mask=0xe000 map id=ram address=90-9f,b0-bf:6000-7fff mask=0xe000 information title: World Cup USA '94 name: World Cup USA '94 region: NA revision: 1.0 board: SHVC-2J3M-11 serial: SNS-U4-USA sha256: 86e9d76a8834732e511253d8092727bdbfb409b3d0ff1c06b6b6e481c9a039ef configuration rom name=program.rom size=0x180000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=2J0N revision=01,10,11 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: World Heroes name: World Heroes region: NA revision: 1.0 board: SHVC-2J0N-10 serial: SNS-WZ-USA sha256: ea76cfdbb2a555a7b6eff8b466a879f9a9189639416e8c2fb45bf074e695105f configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=BA0N revision=01,10 rom name=program.rom size=0x300000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: World Heroes 2 name: World Heroes 2 region: NA revision: 1.0 board: SHVC-BA0N-01 serial: SNS-JI-USA sha256: 159d5341d13d6801324e8271f7191c0223617c9d30984676319b2df7937c78c0 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A1B revision=04,05,06 rom name=program.rom size=0x80000 ram name=save.ram size=0x800 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: World League Soccer name: World League Soccer region: NA revision: 1.0 board: SHVC-1A1B-05 serial: SNS-WS-USA sha256: d4d9f1b41dad7e7a126a9adbe8d86c4b339e120c866156796de1cb0c9a214189 configuration rom name=program.rom size=0x80000 ram name=save.ram size=0x800 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: World Soccer '94: Road to Glory name: World Soccer '94 - Road to Glory region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-WO-USA sha256: 2143bbd87ea1c5cfe5eaf46ae39e3ebb11a2e929d05cbb929904037f4d72acfe configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=BJ0N revision=01,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: WWF Raw name: WWF Raw region: NA revision: 1.0 board: SHVC-BJ0N-01 serial: SNS-AWFE-USA sha256: 0af7b0d3022acd24a1fb15865a076519f7f56e7a4b33f12b6d851b3a91e5388c configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: WWF Royal Rumble name: WWF Royal Rumble region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-WU-USA sha256: 51c53e36ed0b959b0695fc6ef036fa7302d1c995eca35c28261d6f3cb77df0ca configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: WWF Super Wrestlemania name: WWF Super Wrestlemania region: NA revision: 1.0 board: MAXI-1A0N-30-2 serial: SNS-WF-USA sha256: 0b9abf2fc25a5f07c71f9d8efbb0d0e616c1494060138fbb63f7398e9c26198e configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: WWF Wrestlemania: The Arcade Game name: WWF Wrestlemania - The Arcade Game region: NA revision: 1.0 board: SHVC-1J0N-20 serial: SNS-AWVE-USA sha256: 67faa6ed3406a5ab0d7224b811c0960bb36560040ee959bb3304c9293ceaa093 configuration rom name=program.rom size=0x300000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: X-Kaliber 2097 name: X-Kaliber 2097 region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-X7-USA sha256: dc3792e9fe7ef7aaea4ac675a48ad06129dd3ebdd4b96a513bc8241549cbd579 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x200000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: X-Men: Mutant Apocalypse name: X-Men - Mutant Apocalypse region: NA revision: 1.0 board: MAXI-1J0N-20-1 serial: SNS-AXME-USA sha256: 65fe17fd6b297f52df6ce9812ecb02c3bb1bfda3ebc05a19c4a8decbf9a446ae configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: X-Zone name: X-Zone region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-XZ-USA sha256: 93272180090e8418582f69b79c5cee6b28638b9a93192cc4bcd96291a4fca02d configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=1A3B revision=11,12,13 rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000 map id=ram address=70-7d,f0-ff:0000-ffff information title: Xardion name: Xardion region: NA revision: 1.0 board: SHVC-1A3B-12 serial: SNS-XA-USA sha256: 71b69490c78d0bbaf47da25217c5dae295190311aa5df75653c3fac0a1b45358 configuration rom name=program.rom size=0x100000 ram name=save.ram size=0x2000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x80000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Yoshi's Cookie name: Yoshi's Cookie region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-YC-USA sha256: 90ad69a489194aca7ef7b7fd1d30e0105da4934a81ac8b0333ea20f9248df92d configuration rom name=program.rom size=0x80000 release cartridge region=NTSC board type=YA0N revision=01 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Yoshi's Safari name: Yoshi's Safari region: NA revision: 1.0 board: SHVC-YA0N-01 serial: SNS-RH-USA sha256: 12fba2aff04c8e39968e828629ebd16caa314bca397a9418d35fdaffe8188e20 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Young Merlin name: Young Merlin region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-Y6-USA sha256: fbe8926fc0149d3e8e2aec20f15640ea6814f4f4b01c3960f3c477f5f17e890f configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x200000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Zero the Kamikaze Squirrel name: Zero the Kamikaze Squirrel region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-AZKE-USA sha256: 7d414b7f5941f1eddc35259a22accbbbd7b47c517dfcf8bad86c4dcfa9e50b1e configuration rom name=program.rom size=0x200000 release cartridge region=NTSC board type=YA0N revision=01 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Zombies Ate My Neighbors name: Zombies Ate My Neighbors region: NA revision: 1.0 board: SHVC-YA0N-01 serial: SNS-ZA-USA sha256: b27e2e957fa760f4f483e2af30e03062034a6c0066984f2e284cc2cb430b2059 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1A0N revision=01,02,10,20,30 rom name=program.rom size=0x100000 map id=rom address=00-7d,80-ff:8000-ffff mask=0x8000 map id=rom address=40-7d,c0-ff:0000-7fff mask=0x8000 information title: Zool: Ninja of the "Nth" Dimension name: Zool - Ninja of the 'Nth' Dimension region: NA revision: 1.0 board: SHVC-1A0N-20 serial: SNS-Z8-USA sha256: 25414de02c6805ca62574cfb39c23bf292b3d8c4ff33eb8f212ccdbcd61c5ae3 configuration rom name=program.rom size=0x100000 release cartridge region=NTSC board type=1J0N revision=01,10,20 rom name=program.rom size=0x80000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information title: Zoop name: Zoop region: NA revision: 1.0 board: SHVC-1J0N-20 serial: M/SNS-AZPE-USA sha256: a3f1abf2740ff64042d82f7a940fb4269ece57d7c6967571549d8b60b20f305a configuration rom name=program.rom size=0x80000 )"; phoenix/cocoa/widget/radio-button.hpp000664 001750 001750 00000001251 12651764221 021050 0ustar00sergiosergio000000 000000 @interface CocoaRadioButton : NSButton { @public phoenix::RadioButton* radioButton; } -(id) initWith:(phoenix::RadioButton&)radioButton; -(IBAction) activate:(id)sender; @end namespace phoenix { struct pRadioButton : public pWidget { RadioButton& radioButton; CocoaRadioButton* cocoaRadioButton = nullptr; Size minimumSize(); void setChecked(); void setGeometry(Geometry geometry); void setGroup(const group& group); void setImage(const image& image, Orientation orientation); void setText(string text); pRadioButton(RadioButton& radioButton) : pWidget(radioButton), radioButton(radioButton) {} void constructor(); void destructor(); }; } phoenix/windows/action/action.cpp000664 001750 001750 00000000430 12651764221 020307 0ustar00sergiosergio000000 000000 namespace phoenix { void pAction::setEnabled(bool enabled) { if(parentWindow) parentWindow->p.updateMenu(); } void pAction::setVisible(bool visible) { if(parentWindow) parentWindow->p.updateMenu(); } void pAction::constructor() { parentMenu = 0; parentWindow = 0; } } target-ethos/input/000700 001750 001750 00000000000 12656700342 015440 5ustar00sergiosergio000000 000000 phoenix/gtk/keyboard.cpp000664 001750 001750 00000013021 12651764221 016450 0ustar00sergiosergio000000 000000 namespace phoenix { void pKeyboard::initialize() { auto append = [](Keyboard::Scancode scancode, unsigned keysym) { settings->keymap.insert(scancode, XKeysymToKeycode(pApplication::display, keysym)); }; append(Keyboard::Scancode::Escape, XK_Escape); append(Keyboard::Scancode::F1, XK_F1); append(Keyboard::Scancode::F2, XK_F2); append(Keyboard::Scancode::F3, XK_F3); append(Keyboard::Scancode::F4, XK_F4); append(Keyboard::Scancode::F5, XK_F5); append(Keyboard::Scancode::F6, XK_F6); append(Keyboard::Scancode::F7, XK_F7); append(Keyboard::Scancode::F8, XK_F8); append(Keyboard::Scancode::F9, XK_F9); append(Keyboard::Scancode::F10, XK_F10); append(Keyboard::Scancode::F11, XK_F11); append(Keyboard::Scancode::F12, XK_F12); append(Keyboard::Scancode::PrintScreen, XK_Print); append(Keyboard::Scancode::ScrollLock, XK_Scroll_Lock); append(Keyboard::Scancode::Pause, XK_Pause); append(Keyboard::Scancode::Insert, XK_Insert); append(Keyboard::Scancode::Delete, XK_Delete); append(Keyboard::Scancode::Home, XK_Home); append(Keyboard::Scancode::End, XK_End); append(Keyboard::Scancode::PageUp, XK_Prior); append(Keyboard::Scancode::PageDown, XK_Next); append(Keyboard::Scancode::Up, XK_Up); append(Keyboard::Scancode::Down, XK_Down); append(Keyboard::Scancode::Left, XK_Left); append(Keyboard::Scancode::Right, XK_Right); append(Keyboard::Scancode::Grave, XK_asciitilde); append(Keyboard::Scancode::Number1, XK_1); append(Keyboard::Scancode::Number2, XK_2); append(Keyboard::Scancode::Number3, XK_3); append(Keyboard::Scancode::Number4, XK_4); append(Keyboard::Scancode::Number5, XK_5); append(Keyboard::Scancode::Number6, XK_6); append(Keyboard::Scancode::Number7, XK_7); append(Keyboard::Scancode::Number8, XK_8); append(Keyboard::Scancode::Number9, XK_9); append(Keyboard::Scancode::Number0, XK_0); append(Keyboard::Scancode::Minus, XK_minus); append(Keyboard::Scancode::Equal, XK_equal); append(Keyboard::Scancode::Backspace, XK_BackSpace); append(Keyboard::Scancode::BracketLeft, XK_bracketleft); append(Keyboard::Scancode::BracketRight, XK_bracketright); append(Keyboard::Scancode::Backslash, XK_backslash); append(Keyboard::Scancode::Semicolon, XK_semicolon); append(Keyboard::Scancode::Apostrophe, XK_apostrophe); append(Keyboard::Scancode::Comma, XK_comma); append(Keyboard::Scancode::Period, XK_period); append(Keyboard::Scancode::Slash, XK_slash); append(Keyboard::Scancode::Tab, XK_Tab); append(Keyboard::Scancode::CapsLock, XK_Caps_Lock); append(Keyboard::Scancode::Return, XK_Return); append(Keyboard::Scancode::ShiftLeft, XK_Shift_L); append(Keyboard::Scancode::ShiftRight, XK_Shift_R); append(Keyboard::Scancode::ControlLeft, XK_Control_L); append(Keyboard::Scancode::ControlRight, XK_Control_R); append(Keyboard::Scancode::SuperLeft, XK_Super_L); append(Keyboard::Scancode::SuperRight, XK_Super_R); append(Keyboard::Scancode::AltLeft, XK_Alt_L); append(Keyboard::Scancode::AltRight, XK_Alt_R); append(Keyboard::Scancode::Space, XK_space); append(Keyboard::Scancode::Menu, XK_Menu); append(Keyboard::Scancode::A, XK_A); append(Keyboard::Scancode::B, XK_B); append(Keyboard::Scancode::C, XK_C); append(Keyboard::Scancode::D, XK_D); append(Keyboard::Scancode::E, XK_E); append(Keyboard::Scancode::F, XK_F); append(Keyboard::Scancode::G, XK_G); append(Keyboard::Scancode::H, XK_H); append(Keyboard::Scancode::I, XK_I); append(Keyboard::Scancode::J, XK_J); append(Keyboard::Scancode::K, XK_K); append(Keyboard::Scancode::L, XK_L); append(Keyboard::Scancode::M, XK_M); append(Keyboard::Scancode::N, XK_N); append(Keyboard::Scancode::O, XK_O); append(Keyboard::Scancode::P, XK_P); append(Keyboard::Scancode::Q, XK_Q); append(Keyboard::Scancode::R, XK_R); append(Keyboard::Scancode::S, XK_S); append(Keyboard::Scancode::T, XK_T); append(Keyboard::Scancode::U, XK_U); append(Keyboard::Scancode::V, XK_V); append(Keyboard::Scancode::W, XK_W); append(Keyboard::Scancode::X, XK_X); append(Keyboard::Scancode::Y, XK_Y); append(Keyboard::Scancode::Z, XK_Z); append(Keyboard::Scancode::NumLock, XK_Num_Lock); append(Keyboard::Scancode::Divide, XK_KP_Divide); append(Keyboard::Scancode::Multiply, XK_KP_Multiply); append(Keyboard::Scancode::Subtract, XK_KP_Subtract); append(Keyboard::Scancode::Add, XK_KP_Add); append(Keyboard::Scancode::Enter, XK_KP_Enter); append(Keyboard::Scancode::Point, XK_KP_Decimal); append(Keyboard::Scancode::Keypad1, XK_KP_1); append(Keyboard::Scancode::Keypad2, XK_KP_2); append(Keyboard::Scancode::Keypad3, XK_KP_3); append(Keyboard::Scancode::Keypad4, XK_KP_4); append(Keyboard::Scancode::Keypad5, XK_KP_5); append(Keyboard::Scancode::Keypad6, XK_KP_6); append(Keyboard::Scancode::Keypad7, XK_KP_7); append(Keyboard::Scancode::Keypad8, XK_KP_8); append(Keyboard::Scancode::Keypad9, XK_KP_9); append(Keyboard::Scancode::Keypad0, XK_KP_0); } bool pKeyboard::pressed(Keyboard::Scancode scancode) { char state[256]; XQueryKeymap(pApplication::display, state); if(auto result = settings->keymap.find(scancode)) { unsigned id = result(); return state[id >> 3] & (1 << (id & 7)); } return false; } vector pKeyboard::state() { vector output; output.resize((unsigned)Keyboard::Scancode::Limit); for(auto& n : output) n = false; char state[256]; XQueryKeymap(pApplication::display, state); for(auto node : settings->keymap) { if(state[node.value >> 3] & (1 << (node.value & 7))) { output[(unsigned)node.key] = true; } } return output; } } shaders/Scanline.shader/scanline.fs000664 001750 001750 00000000573 12651764221 020475 0ustar00sergiosergio000000 000000 #version 150 uniform sampler2D source[]; in Vertex { vec2 texCoord; }; out vec4 fragColor; void main() { vec4 rgba = texture(source[0], texCoord); vec4 intensity; if(fract(gl_FragCoord.y * (0.5 * 4.0 / 3.0)) > 0.5) { intensity = vec4(0); } else { intensity = smoothstep(0.2, 0.8, rgba) + normalize(rgba); } fragColor = intensity * -0.25 + rgba * 1.1; } sfc/chip/spc7110/dcu.cpp000664 001750 001750 00000003000 12651764221 015754 0ustar00sergiosergio000000 000000 #include "decompressor.cpp" void SPC7110::dcu_load_address() { unsigned table = r4801 | r4802 << 8 | r4803 << 16; unsigned index = r4804 << 2; unsigned addr = table + index; dcu_mode = datarom_read(addr + 0); dcu_addr = datarom_read(addr + 1) << 16; dcu_addr |= datarom_read(addr + 2) << 8; dcu_addr |= datarom_read(addr + 3) << 0; } void SPC7110::dcu_begin_transfer() { if(dcu_mode == 3) return; //invalid mode add_clocks(20); decompressor->initialize(dcu_mode, dcu_addr); decompressor->decode(); unsigned seek = r480b & 2 ? r4805 | r4806 << 8 : 0; while(seek--) decompressor->decode(); r480c |= 0x80; dcu_offset = 0; } uint8 SPC7110::dcu_read() { if((r480c & 0x80) == 0) return 0x00; if(dcu_offset == 0) { for(unsigned row = 0; row < 8; row++) { switch(decompressor->bpp) { case 1: dcu_tile[row] = decompressor->result; break; case 2: dcu_tile[row * 2 + 0] = decompressor->result >> 0; dcu_tile[row * 2 + 1] = decompressor->result >> 8; break; case 4: dcu_tile[row * 2 + 0] = decompressor->result >> 0; dcu_tile[row * 2 + 1] = decompressor->result >> 8; dcu_tile[row * 2 + 16] = decompressor->result >> 16; dcu_tile[row * 2 + 17] = decompressor->result >> 24; break; } unsigned seek = r480b & 1 ? r4807 : 1; while(seek--) decompressor->decode(); } } uint8 data = dcu_tile[dcu_offset++]; dcu_offset &= 8 * decompressor->bpp - 1; return data; } nall/endian.hpp000664 001750 001750 00000003245 12651764221 014611 0ustar00sergiosergio000000 000000 #ifndef NALL_ENDIAN_HPP #define NALL_ENDIAN_HPP #include #if defined(ENDIAN_LSB) //little-endian: uint8_t[] { 0x01, 0x02, 0x03, 0x04 } == 0x04030201 #define order_lsb2(a,b) a,b #define order_lsb3(a,b,c) a,b,c #define order_lsb4(a,b,c,d) a,b,c,d #define order_lsb5(a,b,c,d,e) a,b,c,d,e #define order_lsb6(a,b,c,d,e,f) a,b,c,d,e,f #define order_lsb7(a,b,c,d,e,f,g) a,b,c,d,e,f,g #define order_lsb8(a,b,c,d,e,f,g,h) a,b,c,d,e,f,g,h #define order_msb2(a,b) b,a #define order_msb3(a,b,c) c,b,a #define order_msb4(a,b,c,d) d,c,b,a #define order_msb5(a,b,c,d,e) e,d,c,b,a #define order_msb6(a,b,c,d,e,f) f,e,d,c,b,a #define order_msb7(a,b,c,d,e,f,g) g,f,e,d,c,b,a #define order_msb8(a,b,c,d,e,f,g,h) h,g,f,e,d,c,b,a #elif defined(ENDIAN_MSB) //big-endian: uint8_t[] { 0x01, 0x02, 0x03, 0x04 } == 0x01020304 #define order_lsb2(a,b) b,a #define order_lsb3(a,b,c) c,b,a #define order_lsb4(a,b,c,d) d,c,b,a #define order_lsb5(a,b,c,d,e) e,d,c,b,a #define order_lsb6(a,b,c,d,e,f) f,e,d,c,b,a #define order_lsb7(a,b,c,d,e,f,g) g,f,e,d,c,b,a #define order_lsb8(a,b,c,d,e,f,g,h) h,g,f,e,d,c,b,a #define order_msb2(a,b) a,b #define order_msb3(a,b,c) a,b,c #define order_msb4(a,b,c,d) a,b,c,d #define order_msb5(a,b,c,d,e) a,b,c,d,e #define order_msb6(a,b,c,d,e,f) a,b,c,d,e,f #define order_msb7(a,b,c,d,e,f,g) a,b,c,d,e,f,g #define order_msb8(a,b,c,d,e,f,g,h) a,b,c,d,e,f,g,h #else #error "Unknown endian. Please specify in nall/intrinsics.hpp" #endif #endif nall/string/char/trim.hpp000664 001750 001750 00000002644 12651764221 016553 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { //limit defaults to zero, which will underflow on first compare; equivalent to no limit template char* ltrim(char* str, const char* key) { if(!str || !key || !*key) return str; unsigned limit = Limit; while(strbegin(str, key)) { char* dest = str; char* src = str + strlen(key); while(true) { *dest = *src++; if(!*dest) break; dest++; } if(--limit == 0) break; } return str; } template char* rtrim(char* str, const char* key) { if(!str || !key || !*key) return str; unsigned limit = Limit; while(strend(str, key)) { str[strlen(str) - strlen(key)] = 0; if(--limit == 0) break; } return str; } template char* trim(char* str, const char* key) { return ltrim(rtrim(str, key), key); } template char* trim(char* str, const char* lkey, const char* rkey) { return ltrim(rtrim(str, rkey), lkey); } //remove whitespace characters from both left and right sides of string char* strip(char* s) { if(!s) return nullptr; signed n = 0, p = 0; while(s[n]) { if(s[n] != ' ' && s[n] != '\t' && s[n] != '\r' && s[n] != '\n') break; n++; } while(s[n]) s[p++] = s[n++]; s[p--] = 0; while(p >= 0) { if(s[p] != ' ' && s[p] != '\t' && s[p] != '\r' && s[p] != '\n') break; p--; } s[++p] = 0; return s; } } #endif gb/Makefile000664 001750 001750 00000001646 12651764221 013747 0ustar00sergiosergio000000 000000 gb_objects := gb-interface gb-system gb-scheduler gb_objects += gb-memory gb-cartridge gb_objects += gb-cpu gb-ppu gb-apu gb_objects += gb-cheat gb-video objects += $(gb_objects) obj/gb-interface.o: $(gb)/interface/interface.cpp $(call rwildcard,$(gb)/interface/) obj/gb-system.o: $(gb)/system/system.cpp $(call rwildcard,$(gb)/system/) obj/gb-scheduler.o: $(gb)/scheduler/scheduler.cpp $(call rwildcard,$(gb)/scheduler/) obj/gb-cartridge.o: $(gb)/cartridge/cartridge.cpp $(call rwildcard,$(gb)/cartridge/) obj/gb-memory.o: $(gb)/memory/memory.cpp $(call rwildcard,$(gb)/memory/) obj/gb-cpu.o: $(gb)/cpu/cpu.cpp $(call rwildcard,$(gb)/cpu/) obj/gb-ppu.o: $(gb)/ppu/ppu.cpp $(call rwildcard,$(gb)/ppu/) obj/gb-apu.o: $(gb)/apu/apu.cpp $(call rwildcard,$(gb)/apu/) obj/gb-cheat.o: $(gb)/cheat/cheat.cpp $(call rwildcard,$(gb)/cheat/) obj/gb-video.o: $(gb)/video/video.cpp $(call rwildcard,$(gb)/video/) phoenix/reference/widget/check-label.hpp000664 001750 001750 00000000435 12651764221 021450 0ustar00sergiosergio000000 000000 namespace phoenix { struct pCheckLabel : public pWidget { CheckLabel& checkLabel; void setChecked(bool checked); void setText(string text); pCheckLabel(CheckLabel& checkLabel) : pWidget(checkLabel), checkLabel(checkLabel) {} void constructor(); void destructor(); }; } phoenix/cocoa/widget/layout.hpp000664 001750 001750 00000000221 12651764221 017752 0ustar00sergiosergio000000 000000 namespace phoenix { struct pLayout : public pSizable { Layout& layout; pLayout(Layout& layout) : pSizable(layout), layout(layout) {} }; } sfc/chip/epsonrtc/memory.cpp000664 001750 001750 00000010313 12651764221 017255 0ustar00sergiosergio000000 000000 #ifdef EPSONRTC_CPP void EpsonRTC::rtc_reset() { state = State::Mode; offset = 0; resync = 0; pause = 0; test = 0; } uint4 EpsonRTC::rtc_read(uint4 addr) { switch(addr) { default: case 0: return secondlo; case 1: return secondhi | batteryfailure << 3; case 2: return minutelo; case 3: return minutehi | resync << 3; case 4: return hourlo; case 5: return hourhi | meridian << 2 | resync << 3; case 6: return daylo; case 7: return dayhi | dayram << 2 | resync << 3; case 8: return monthlo; case 9: return monthhi | monthram << 1 | resync << 3; case 10: return yearlo; case 11: return yearhi; case 12: return weekday | resync << 3; case 13: { uint1 readflag = irqflag & !irqmask; irqflag = 0; return hold | calendar << 1 | readflag << 2 | roundseconds << 3; } case 14: return irqmask | irqduty << 1 | irqperiod << 2; case 15: return pause | stop << 1 | atime << 2 | test << 3; } } void EpsonRTC::rtc_write(uint4 addr, uint4 data) { switch(addr) { case 0: secondlo = data; break; case 1: secondhi = data; batteryfailure = data >> 3; break; case 2: minutelo = data; break; case 3: minutehi = data; break; case 4: hourlo = data; break; case 5: hourhi = data; meridian = data >> 2; if(atime == 1) meridian = 0; if(atime == 0) hourhi &= 1; break; case 6: daylo = data; break; case 7: dayhi = data; dayram = data >> 2; break; case 8: monthlo = data; break; case 9: monthhi = data; monthram = data >> 1; break; case 10: yearlo = data; break; case 11: yearhi = data; break; case 12: weekday = data; break; case 13: { bool held = hold; hold = data; calendar = data >> 1; roundseconds = data >> 3; if(held == 1 && hold == 0 && holdtick == 1) { //if a second has passed during hold, increment one second upon resuming holdtick = 0; tick_second(); } } break; case 14: irqmask = data; irqduty = data >> 1; irqperiod = data >> 2; break; case 15: pause = data; stop = data >> 1; atime = data >> 2; test = data >> 3; if(atime == 1) meridian = 0; if(atime == 0) hourhi &= 1; if(pause) { secondlo = 0; secondhi = 0; } break; } } void EpsonRTC::load(const uint8* data) { secondlo = data[0] >> 0; secondhi = data[0] >> 4; batteryfailure = data[0] >> 7; minutelo = data[1] >> 0; minutehi = data[1] >> 4; resync = data[1] >> 7; hourlo = data[2] >> 0; hourhi = data[2] >> 4; meridian = data[2] >> 6; daylo = data[3] >> 0; dayhi = data[3] >> 4; dayram = data[3] >> 6; monthlo = data[4] >> 0; monthhi = data[4] >> 4; monthram = data[4] >> 5; yearlo = data[5] >> 0; yearhi = data[5] >> 4; weekday = data[6] >> 0; hold = data[6] >> 4; calendar = data[6] >> 5; irqflag = data[6] >> 6; roundseconds = data[6] >> 7; irqmask = data[7] >> 0; irqduty = data[7] >> 1; irqperiod = data[7] >> 2; pause = data[7] >> 4; stop = data[7] >> 5; atime = data[7] >> 6; test = data[7] >> 7; uint64 timestamp = 0; for(unsigned byte = 0; byte < 8; byte++) { timestamp |= data[8 + byte] << (byte * 8); } uint64 diff = (uint64)time(0) - timestamp; while(diff >= 60 * 60 * 24) { tick_day(); diff -= 60 * 60 * 24; } while(diff >= 60 * 60) { tick_hour(); diff -= 60 * 60; } while(diff >= 60) { tick_minute(); diff -= 60; } while(diff--) tick_second(); } void EpsonRTC::save(uint8* data) { data[0] = secondlo << 0 | secondhi << 4 | batteryfailure << 7; data[1] = minutelo << 0 | minutehi << 4 | resync << 7; data[2] = hourlo << 0 | hourhi << 4 | meridian << 6 | resync << 7; data[3] = daylo << 0 | dayhi << 4 | dayram << 6 | resync << 7; data[4] = monthlo << 0 | monthhi << 4 | monthram << 5 | resync << 7; data[5] = yearlo << 0 | yearhi << 4; data[6] = weekday << 0 | resync << 3 | hold << 4 | calendar << 5 | irqflag << 6 | roundseconds << 7; data[7] = irqmask << 0 | irqduty << 1 | irqperiod << 2 | pause << 4 | stop << 5 | atime << 6 | test << 7; uint64 timestamp = (uint64)time(0); for(unsigned byte = 0; byte < 8; byte++) { data[8 + byte] = timestamp; timestamp >>= 8; } } #endif nall/string/allocator/small-string-optimization.hpp000664 001750 001750 00000004436 12651764221 024004 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP /* small string optimization (SSO) allocator sizeof(string) == 16 (amd64) utilizes a union to store small strings directly into text pointer bypasses the need to allocate heap memory for small strings requires extra computations, which can be slower for large strings pros: * potential for in-place resize * no heap allocation when (capacity < 8) cons: * added overhead to fetch data() * 32-bit platforms limited to (capacity < 4) * pass-by-value requires heap allocation */ namespace nall { char* string::data() { if(_capacity < SSO) return _text; return _data; } const char* string::data() const { if(_capacity < SSO) return _text; return _data; } void string::reserve(unsigned capacity) { if(capacity > _capacity) { if(capacity >= SSO) { capacity = bit::round(capacity + 1) - 1; if(_capacity < SSO) { char temp[SSO]; memcpy(temp, _text, SSO); _data = (char*)malloc(capacity + 1); memcpy(_data, temp, SSO); } else { _data = (char*)realloc(_data, capacity + 1); } } _capacity = capacity; data()[_capacity] = 0; } } void string::resize(unsigned size) { reserve(size); data()[_size = size] = 0; } void string::reset() { if(_capacity >= SSO) free(_data); _data = nullptr; _capacity = SSO - 1; _size = 0; } string& string::operator=(const string& source) { if(&source == this) return *this; reset(); if(source._capacity >= SSO) { _data = (char*)malloc(source._capacity + 1); _capacity = source._capacity; _size = source._size; memcpy(_data, source.data(), source.size() + 1); } else { memcpy(_text, source._text, SSO); _capacity = SSO - 1; _size = strlen(_text); } return *this; } string& string::operator=(string&& source) { if(&source == this) return *this; reset(); memcpy(this, &source, sizeof(string)); source._data = nullptr; source._capacity = SSO - 1; source._size = 0; return *this; } template string::string(T&& source, Args&&... args) { construct(); sprint(*this, std::forward(source), std::forward(args)...); } string::string() { construct(); } string::~string() { reset(); } void string::construct() { _data = nullptr; _capacity = SSO - 1; _size = 0; } } #endif phoenix/cocoa/action/check-item.hpp000664 001750 001750 00000000733 12651764221 020450 0ustar00sergiosergio000000 000000 @interface CocoaCheckItem : NSMenuItem { @public phoenix::CheckItem* checkItem; } -(id) initWith:(phoenix::CheckItem&)checkItem; -(void) activate; @end namespace phoenix { struct pCheckItem : public pAction { CheckItem& checkItem; CocoaCheckItem* cocoaCheckItem = nullptr; void setChecked(bool checked); void setText(string text); pCheckItem(CheckItem& checkItem) : pAction(checkItem), checkItem(checkItem) {} void constructor(); void destructor(); }; } gba/apu/apu.cpp000664 001750 001750 00000005174 12651764221 014526 0ustar00sergiosergio000000 000000 #include namespace GameBoyAdvance { #include "registers.cpp" #include "mmio.cpp" #include "square.cpp" #include "square1.cpp" #include "square2.cpp" #include "wave.cpp" #include "noise.cpp" #include "sequencer.cpp" #include "fifo.cpp" #include "serialization.cpp" APU apu; void APU::Enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } apu.main(); } } void APU::main() { for(unsigned n = 0; n < 64; n++) { runsequencer(); } signed lsample = regs.bias.level - 0x0200; signed rsample = regs.bias.level - 0x0200; //(4-bit x 4 -> 6-bit) + 3-bit volume = 9-bit output if(sequencer.masterenable) { signed lsequence = 0; if(sequencer.lenable[0]) lsequence += square1.output; if(sequencer.lenable[1]) lsequence += square2.output; if(sequencer.lenable[2]) lsequence += wave.output; if(sequencer.lenable[3]) lsequence += noise.output; signed rsequence = 0; if(sequencer.renable[0]) rsequence += square1.output; if(sequencer.renable[1]) rsequence += square2.output; if(sequencer.renable[2]) rsequence += wave.output; if(sequencer.renable[3]) rsequence += noise.output; if(sequencer.volume < 3) { lsample += lsequence * (sequencer.lvolume + 1) >> (2 - sequencer.volume); rsample += rsequence * (sequencer.rvolume + 1) >> (2 - sequencer.volume); } } //(8-bit x 2 -> 7-bit) + 1-bit volume = 10-bit output signed fifo0 = fifo[0].output + (1 << fifo[0].volume); signed fifo1 = fifo[1].output + (1 << fifo[1].volume); if(fifo[0].lenable) lsample += fifo0; if(fifo[1].lenable) lsample += fifo1; if(fifo[0].renable) rsample += fifo0; if(fifo[1].renable) rsample += fifo1; lsample = sclamp<10>(lsample); rsample = sclamp<10>(rsample); if(regs.bias.amplitude == 1) lsample &= ~3, rsample &= ~3; if(regs.bias.amplitude == 2) lsample &= ~7, rsample &= ~7; if(regs.bias.amplitude == 3) lsample &= ~15, rsample &= ~15; if(cpu.regs.mode == CPU::Registers::Mode::Stop) lsample = 0, rsample = 0; interface->audioSample(sclamp<16>(lsample << 6), sclamp<16>(rsample << 6)); //should be <<5, use <<6 for added volume step(512); } void APU::step(unsigned clocks) { clock += clocks; if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cpu.thread); } void APU::power() { create(APU::Enter, 16777216); square1.power(); square2.power(); wave.power(); noise.power(); sequencer.power(); fifo[0].power(); fifo[1].power(); regs.bias = 0x0200; for(unsigned n = 0x060; n <= 0x0a7; n++) bus.mmio[n] = this; } } processor/r6502/r6502.cpp000664 001750 001750 00000024532 12651764221 015775 0ustar00sergiosergio000000 000000 #include #include "r6502.hpp" namespace Processor { #define I #define L last_cycle(); #define call(op) (this->*op)() #include "memory.cpp" #include "instructions.cpp" #include "disassembler.cpp" #include "serialization.cpp" uint8 R6502::mdr() const { return regs.mdr; } void R6502::power() { regs.a = 0x00; regs.x = 0x00; regs.y = 0x00; regs.s = 0x00; regs.p = 0x04; } void R6502::reset() { regs.mdr = 0x00; regs.s -= 3; regs.p.i = 1; } void R6502::interrupt() { op_readpc(); op_readpc(); op_writesp(regs.pc >> 8); op_writesp(regs.pc >> 0); op_writesp(regs.p | 0x20); uint16 vector = 0xfffe; //IRQ nmi(vector); abs.l = op_read(vector++); regs.p.i = 1; regs.p.d = 0; L abs.h = op_read(vector++); regs.pc = abs.w; } void R6502::exec() { uint8 opcode = op_readpci(); switch(opcode) { case 0x00: return op_brk(); case 0x01: return opi_read_indirect_zero_page_x<&R6502::opf_ora>(); I case 0x04: return opill_nop_zero_page(); case 0x05: return opi_read_zero_page<&R6502::opf_ora>(); case 0x06: return opi_rmw_zero_page<&R6502::opf_asl>(); case 0x08: return op_php(); case 0x09: return opi_read_immediate<&R6502::opf_ora>(); case 0x0a: return opi_shift<&R6502::opf_sla>(); I case 0x0c: return opill_nop_absolute(); case 0x0d: return opi_read_absolute<&R6502::opf_ora>(); case 0x0e: return opi_rmw_absolute<&R6502::opf_asl>(); case 0x10: return opi_branch(regs.p.n == 0); case 0x11: return opi_read_indirect_zero_page_y<&R6502::opf_ora>(); I case 0x14: return opill_nop_zero_page_x(); case 0x15: return opi_read_zero_page_x<&R6502::opf_ora>(); case 0x16: return opi_rmw_zero_page_x<&R6502::opf_asl>(); case 0x18: return opi_clear_flag(regs.p.c); case 0x19: return opi_read_absolute_y<&R6502::opf_ora>(); I case 0x1a: return opill_nop_implied(); I case 0x1c: return opill_nop_absolute_x(); case 0x1d: return opi_read_absolute_x<&R6502::opf_ora>(); case 0x1e: return opi_rmw_absolute_x<&R6502::opf_asl>(); case 0x20: return op_jsr_absolute(); case 0x21: return opi_read_indirect_zero_page_x<&R6502::opf_and>(); case 0x24: return opi_read_zero_page<&R6502::opf_bit>(); case 0x25: return opi_read_zero_page<&R6502::opf_and>(); case 0x26: return opi_rmw_zero_page<&R6502::opf_rol>(); case 0x28: return op_plp(); case 0x29: return opi_read_immediate<&R6502::opf_and>(); case 0x2a: return opi_shift<&R6502::opf_rla>(); case 0x2c: return opi_read_absolute<&R6502::opf_bit>(); case 0x2d: return opi_read_absolute<&R6502::opf_and>(); case 0x2e: return opi_rmw_absolute<&R6502::opf_rol>(); case 0x30: return opi_branch(regs.p.n == 1); case 0x31: return opi_read_indirect_zero_page_y<&R6502::opf_and>(); I case 0x34: return opill_nop_zero_page_x(); case 0x35: return opi_read_zero_page_x<&R6502::opf_and>(); case 0x36: return opi_rmw_zero_page_x<&R6502::opf_rol>(); case 0x38: return opi_set_flag(regs.p.c); case 0x39: return opi_read_absolute_y<&R6502::opf_and>(); I case 0x3a: return opill_nop_implied(); I case 0x3c: return opill_nop_absolute_x(); case 0x3d: return opi_read_absolute_x<&R6502::opf_and>(); case 0x3e: return opi_rmw_absolute_x<&R6502::opf_rol>(); case 0x40: return op_rti(); case 0x41: return opi_read_indirect_zero_page_x<&R6502::opf_eor>(); I case 0x44: return opill_nop_zero_page(); case 0x45: return opi_read_zero_page<&R6502::opf_eor>(); case 0x46: return opi_rmw_zero_page<&R6502::opf_lsr>(); case 0x48: return opi_push(regs.a); case 0x49: return opi_read_immediate<&R6502::opf_eor>(); case 0x4a: return opi_shift<&R6502::opf_sra>(); case 0x4c: return op_jmp_absolute(); case 0x4d: return opi_read_absolute<&R6502::opf_eor>(); case 0x4e: return opi_rmw_absolute<&R6502::opf_lsr>(); case 0x50: return opi_branch(regs.p.v == 0); case 0x51: return opi_read_indirect_zero_page_y<&R6502::opf_eor>(); I case 0x54: return opill_nop_zero_page_x(); case 0x55: return opi_read_zero_page_x<&R6502::opf_eor>(); case 0x56: return opi_rmw_zero_page_x<&R6502::opf_lsr>(); case 0x58: return opi_clear_flag(regs.p.i); case 0x59: return opi_read_absolute_y<&R6502::opf_eor>(); I case 0x5a: return opill_nop_implied(); I case 0x5c: return opill_nop_absolute_x(); case 0x5d: return opi_read_absolute_x<&R6502::opf_eor>(); case 0x5e: return opi_rmw_absolute_x<&R6502::opf_lsr>(); case 0x60: return op_rts(); case 0x61: return opi_read_indirect_zero_page_x<&R6502::opf_adc>(); I case 0x64: return opill_nop_zero_page(); case 0x65: return opi_read_zero_page<&R6502::opf_adc>(); case 0x66: return opi_rmw_zero_page<&R6502::opf_ror>(); case 0x68: return opi_pull(regs.a); case 0x69: return opi_read_immediate<&R6502::opf_adc>(); case 0x6a: return opi_shift<&R6502::opf_rra>(); I case 0x6b: return opill_arr_immediate(); case 0x6c: return op_jmp_indirect_absolute(); case 0x6d: return opi_read_absolute<&R6502::opf_adc>(); case 0x6e: return opi_rmw_absolute<&R6502::opf_ror>(); case 0x70: return opi_branch(regs.p.v == 1); I case 0x74: return opill_nop_zero_page_x(); case 0x71: return opi_read_indirect_zero_page_y<&R6502::opf_adc>(); case 0x75: return opi_read_zero_page_x<&R6502::opf_adc>(); case 0x76: return opi_rmw_zero_page_x<&R6502::opf_ror>(); case 0x78: return opi_set_flag(regs.p.i); case 0x79: return opi_read_absolute_y<&R6502::opf_adc>(); I case 0x7a: return opill_nop_implied(); I case 0x7c: return opill_nop_absolute_x(); case 0x7d: return opi_read_absolute_x<&R6502::opf_adc>(); case 0x7e: return opi_rmw_absolute_x<&R6502::opf_ror>(); I case 0x80: return opill_nop_absolute(); case 0x81: return opi_store_indirect_zero_page_x(regs.a); I case 0x82: return opill_nop_immediate(); case 0x84: return opi_store_zero_page(regs.y); case 0x85: return opi_store_zero_page(regs.a); case 0x86: return opi_store_zero_page(regs.x); case 0x88: return opi_decrement(regs.y); I case 0x89: return opill_nop_immediate(); case 0x8a: return opi_transfer(regs.x, regs.a, 1); case 0x8c: return opi_store_absolute(regs.y); case 0x8d: return opi_store_absolute(regs.a); case 0x8e: return opi_store_absolute(regs.x); case 0x90: return opi_branch(regs.p.c == 0); case 0x91: return opi_store_indirect_zero_page_y(regs.a); case 0x94: return opi_store_zero_page_x(regs.y); case 0x95: return opi_store_zero_page_x(regs.a); case 0x96: return opi_store_zero_page_y(regs.x); case 0x98: return opi_transfer(regs.y, regs.a, 1); case 0x99: return opi_store_absolute_y(regs.a); case 0x9a: return opi_transfer(regs.x, regs.s, 0); case 0x9d: return opi_store_absolute_x(regs.a); case 0xa0: return opi_read_immediate<&R6502::opf_ldy>(); case 0xa1: return opi_read_indirect_zero_page_x<&R6502::opf_lda>(); case 0xa2: return opi_read_immediate<&R6502::opf_ldx>(); case 0xa4: return opi_read_zero_page<&R6502::opf_ldy>(); case 0xa5: return opi_read_zero_page<&R6502::opf_lda>(); case 0xa6: return opi_read_zero_page<&R6502::opf_ldx>(); case 0xa8: return opi_transfer(regs.a, regs.y, 1); case 0xa9: return opi_read_immediate<&R6502::opf_lda>(); case 0xaa: return opi_transfer(regs.a, regs.x, 1); case 0xac: return opi_read_absolute<&R6502::opf_ldy>(); case 0xad: return opi_read_absolute<&R6502::opf_lda>(); case 0xae: return opi_read_absolute<&R6502::opf_ldx>(); case 0xb0: return opi_branch(regs.p.c == 1); case 0xb1: return opi_read_indirect_zero_page_y<&R6502::opf_lda>(); case 0xb4: return opi_read_zero_page_x<&R6502::opf_ldy>(); case 0xb5: return opi_read_zero_page_x<&R6502::opf_lda>(); case 0xb6: return opi_read_zero_page_y<&R6502::opf_ldx>(); case 0xb8: return opi_clear_flag(regs.p.v); case 0xb9: return opi_read_absolute_y<&R6502::opf_lda>(); case 0xba: return opi_transfer(regs.s, regs.x, 1); case 0xbc: return opi_read_absolute_x<&R6502::opf_ldy>(); case 0xbd: return opi_read_absolute_x<&R6502::opf_lda>(); case 0xbe: return opi_read_absolute_y<&R6502::opf_ldx>(); case 0xc0: return opi_read_immediate<&R6502::opf_cpy>(); case 0xc1: return opi_read_indirect_zero_page_x<&R6502::opf_cmp>(); I case 0xc2: return opill_nop_immediate(); case 0xc4: return opi_read_zero_page<&R6502::opf_cpy>(); case 0xc5: return opi_read_zero_page<&R6502::opf_cmp>(); case 0xc6: return opi_rmw_zero_page<&R6502::opf_dec>(); case 0xc8: return opi_increment(regs.y); case 0xc9: return opi_read_immediate<&R6502::opf_cmp>(); case 0xca: return opi_decrement(regs.x); case 0xcc: return opi_read_absolute<&R6502::opf_cpy>(); case 0xcd: return opi_read_absolute<&R6502::opf_cmp>(); case 0xce: return opi_rmw_absolute<&R6502::opf_dec>(); case 0xd0: return opi_branch(regs.p.z == 0); case 0xd1: return opi_read_indirect_zero_page_y<&R6502::opf_cmp>(); I case 0xd4: return opill_nop_zero_page_x(); case 0xd5: return opi_read_zero_page_x<&R6502::opf_cmp>(); case 0xd6: return opi_rmw_zero_page_x<&R6502::opf_dec>(); case 0xd8: return opi_clear_flag(regs.p.d); case 0xd9: return opi_read_absolute_y<&R6502::opf_cmp>(); I case 0xda: return opill_nop_implied(); I case 0xdc: return opill_nop_absolute_x(); case 0xdd: return opi_read_absolute_x<&R6502::opf_cmp>(); case 0xde: return opi_rmw_absolute_x<&R6502::opf_dec>(); case 0xe0: return opi_read_immediate<&R6502::opf_cpx>(); case 0xe1: return opi_read_indirect_zero_page_x<&R6502::opf_sbc>(); I case 0xe2: return opill_nop_immediate(); case 0xe4: return opi_read_zero_page<&R6502::opf_cpx>(); case 0xe5: return opi_read_zero_page<&R6502::opf_sbc>(); case 0xe6: return opi_rmw_zero_page<&R6502::opf_inc>(); case 0xe8: return opi_increment(regs.x); case 0xe9: return opi_read_immediate<&R6502::opf_sbc>(); case 0xea: return op_nop(); I case 0xeb: return opi_read_immediate<&R6502::opf_sbc>(); case 0xec: return opi_read_absolute<&R6502::opf_cpx>(); case 0xed: return opi_read_absolute<&R6502::opf_sbc>(); case 0xee: return opi_rmw_absolute<&R6502::opf_inc>(); case 0xf0: return opi_branch(regs.p.z == 1); case 0xf1: return opi_read_indirect_zero_page_y<&R6502::opf_sbc>(); I case 0xf4: return opill_nop_zero_page_x(); case 0xf5: return opi_read_zero_page_x<&R6502::opf_sbc>(); case 0xf6: return opi_rmw_zero_page_x<&R6502::opf_inc>(); case 0xf8: return opi_set_flag(regs.p.d); case 0xf9: return opi_read_absolute_y<&R6502::opf_sbc>(); I case 0xfa: return opill_nop_implied(); I case 0xfc: return opill_nop_absolute_x(); case 0xfd: return opi_read_absolute_x<&R6502::opf_sbc>(); case 0xfe: return opi_rmw_absolute_x<&R6502::opf_inc>(); } //unimplemented opcode return op_nop(); } #undef I #undef L #undef call } fc/cartridge/chip/vrc1.cpp000664 001750 001750 00000003176 12651764221 016555 0ustar00sergiosergio000000 000000 struct VRC1 : Chip { uint4 prg_bank[3]; uint4 chr_banklo[2]; bool chr_bankhi[2]; bool mirror; unsigned prg_addr(unsigned addr) const { unsigned bank = 0x0f; if((addr & 0xe000) == 0x8000) bank = prg_bank[0]; if((addr & 0xe000) == 0xa000) bank = prg_bank[1]; if((addr & 0xe000) == 0xc000) bank = prg_bank[2]; return (bank * 0x2000) + (addr & 0x1fff); } unsigned chr_addr(unsigned addr) const { unsigned bank = chr_banklo[(bool)(addr & 0x1000)]; bank |= chr_bankhi[(bool)(addr & 0x1000)] << 4; return (bank * 0x1000) + (addr & 0x0fff); } unsigned ciram_addr(unsigned addr) const { switch(mirror) { case 0: return ((addr & 0x0400) >> 0) | (addr & 0x03ff); //vertical mirroring case 1: return ((addr & 0x0800) >> 1) | (addr & 0x03ff); //horizontal mirroring } throw; } void reg_write(unsigned addr, uint8 data) { switch(addr & 0xf000) { case 0x8000: prg_bank[0] = data & 0x0f; break; case 0x9000: chr_bankhi[1] = data & 0x04; chr_bankhi[0] = data & 0x02; mirror = data & 0x01; break; case 0xa000: prg_bank[1] = data & 0x0f; break; case 0xc000: prg_bank[2] = data & 0x0f; break; case 0xe000: chr_banklo[0] = data & 0x0f; break; case 0xf000: chr_banklo[1] = data & 0x0f; break; } } void power() { } void reset() { for(auto& n : prg_bank) n = 0; for(auto& n : chr_banklo) n = 0; for(auto& n : chr_bankhi) n = 0; mirror = 0; } void serialize(serializer& s) { for(auto& n : prg_bank) s.integer(n); for(auto& n : chr_banklo) s.integer(n); for(auto& n : chr_bankhi) s.integer(n); s.integer(mirror); } VRC1(Board& board) : Chip(board) { } }; nall/invoke.hpp000664 001750 001750 00000003270 12651764221 014644 0ustar00sergiosergio000000 000000 #ifndef NALL_INVOKE_HPP #define NALL_INVOKE_HPP //void invoke(const string &name, const string& args...); //if a program is specified, it is executed with the arguments provided //if a file is specified, the file is opened using the program associated with said file type //if a folder is specified, the folder is opened using the associated file explorer //if a URL is specified, the default web browser is opened and pointed at the URL requested //path environment variable is always consulted //execution is asynchronous (non-blocking); use system() for synchronous execution #include #include #if defined(PLATFORM_WINDOWS) #include #endif namespace nall { #if defined(PLATFORM_WINDOWS) template inline void invoke(const string& name, Args&&... args) { lstring argl(std::forward(args)...); for(auto& arg : argl) if(arg.find(" ")) arg = {"\"", arg, "\""}; string arguments = argl.merge(" "); ShellExecuteW(NULL, NULL, utf16_t(name), utf16_t(arguments), NULL, SW_SHOWNORMAL); } #elif defined(PLATFORM_X) template inline void invoke(const string& name, Args&&... args) { pid_t pid = fork(); if(pid == 0) { const char* argv[1 + sizeof...(args) + 1]; const char** argp = argv; lstring argl(std::forward(args)...); *argp++ = (const char*)name; for(auto &arg : argl) *argp++ = (const char*)arg; *argp++ = nullptr; if(execvp(name, (char* const*)argv) < 0) { execlp("xdg-open", "xdg-open", (const char*)name, nullptr); } exit(0); } } #else template inline void invoke(const string& name, Args&&... args) { } #endif } #endif nall/crc32.hpp000664 001750 001750 00000007073 12651764221 014272 0ustar00sergiosergio000000 000000 #ifndef NALL_CRC32_HPP #define NALL_CRC32_HPP #include namespace nall { const uint32_t crc32_table[256] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d }; inline uint32_t crc32_adjust(uint32_t crc32, uint8_t input) { return ((crc32 >> 8) & 0x00ffffff) ^ crc32_table[(crc32 ^ input) & 0xff]; } inline uint32_t crc32_calculate(const uint8_t* data, unsigned length) { uint32_t crc32 = ~0; for(unsigned i = 0; i < length; i++) { crc32 = crc32_adjust(crc32, data[i]); } return ~crc32; } } #endif ruby/input/shared/rawinput.cpp000664 001750 001750 00000011022 12651764221 017647 0ustar00sergiosergio000000 000000 #ifndef RUBY_INPUT_SHARED_RAWINPUT #define RUBY_INPUT_SHARED_RAWINPUT namespace ruby { LRESULT CALLBACK RawInputWindowProc(HWND, UINT, WPARAM, LPARAM); struct RawInput { HANDLE mutex; HWND hwnd; bool ready = false; bool initialized = false; function updateKeyboard; function updateMouse; struct Device { HANDLE handle; string path; enum class Type : unsigned { Keyboard, Mouse, Joypad } type; uint16_t vendorID = 0; uint16_t productID = 0; bool isXInputDevice = false; }; vector devices; optional find(uint16_t vendorID, uint16_t productID) { for(auto& device : devices) { if(device.vendorID == vendorID && device.productID == productID) return {true, device}; } return false; } void scanDevices() { devices.reset(); unsigned deviceCount = 0; GetRawInputDeviceList(NULL, &deviceCount, sizeof(RAWINPUTDEVICELIST)); RAWINPUTDEVICELIST* list = new RAWINPUTDEVICELIST[deviceCount]; GetRawInputDeviceList(list, &deviceCount, sizeof(RAWINPUTDEVICELIST)); for(unsigned n = 0; n < deviceCount; n++) { wchar_t path[4096]; unsigned size = sizeof(path) - 1; GetRawInputDeviceInfo(list[n].hDevice, RIDI_DEVICENAME, &path, &size); RID_DEVICE_INFO info; info.cbSize = size = sizeof(RID_DEVICE_INFO); GetRawInputDeviceInfo(list[n].hDevice, RIDI_DEVICEINFO, &info, &size); Device device; device.path = (const char*)utf8_t(path); device.handle = list[n].hDevice; if(info.dwType == RIM_TYPEKEYBOARD) { device.type = Device::Type::Keyboard; device.vendorID = 0; device.productID = 1; } if(info.dwType == RIM_TYPEMOUSE) { device.type = Device::Type::Mouse; device.vendorID = 0; device.productID = 2; } if(info.dwType == RIM_TYPEHID) { //verify that this is a joypad device if(info.hid.usUsagePage != 1 || (info.hid.usUsage != 4 && info.hid.usUsage != 5)) continue; device.type = Device::Type::Joypad; device.vendorID = info.hid.dwVendorId; device.productID = info.hid.dwProductId; if(device.path.find("IG_")) device.isXInputDevice = true; //"IG_" is only found inside XInput device paths } devices.append(device); } delete[] list; } LRESULT windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { if(msg != WM_INPUT) return DefWindowProc(hwnd, msg, wparam, lparam); unsigned size = 0; GetRawInputData((HRAWINPUT)lparam, RID_INPUT, NULL, &size, sizeof(RAWINPUTHEADER)); RAWINPUT* input = new RAWINPUT[size]; GetRawInputData((HRAWINPUT)lparam, RID_INPUT, input, &size, sizeof(RAWINPUTHEADER)); WaitForSingleObject(mutex, INFINITE); if(input->header.dwType == RIM_TYPEKEYBOARD) { if(updateKeyboard) updateKeyboard(input); } if(input->header.dwType == RIM_TYPEMOUSE) { if(updateMouse) updateMouse(input); } ReleaseMutex(mutex); LRESULT result = DefRawInputProc(&input, size, sizeof(RAWINPUTHEADER)); delete[] input; return result; } void main() { WNDCLASS wc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hbrBackground = (HBRUSH)COLOR_WINDOW; wc.hCursor = LoadCursor(0, IDC_ARROW); wc.hIcon = LoadIcon(0, IDI_APPLICATION); wc.hInstance = GetModuleHandle(0); wc.lpfnWndProc = RawInputWindowProc; wc.lpszClassName = L"RawInputClass"; wc.lpszMenuName = 0; wc.style = CS_VREDRAW | CS_HREDRAW; RegisterClass(&wc); hwnd = CreateWindow(L"RawInputClass", L"RawInputClass", WS_POPUP, 0, 0, 64, 64, 0, 0, GetModuleHandle(0), 0); scanDevices(); RAWINPUTDEVICE device[2]; //capture all keyboard input device[0].usUsagePage = 1; device[0].usUsage = 6; device[0].dwFlags = RIDEV_INPUTSINK; device[0].hwndTarget = hwnd; //capture all mouse input device[1].usUsagePage = 1; device[1].usUsage = 2; device[1].dwFlags = RIDEV_INPUTSINK; device[1].hwndTarget = hwnd; RegisterRawInputDevices(device, 2, sizeof(RAWINPUTDEVICE)); WaitForSingleObject(mutex, INFINITE); ready = true; ReleaseMutex(mutex); while(true) { MSG msg; GetMessage(&msg, hwnd, 0, 0); TranslateMessage(&msg); DispatchMessage(&msg); } } }; static RawInput rawinput; DWORD WINAPI RawInputThreadProc(void*) { rawinput.main(); return 0; } LRESULT CALLBACK RawInputWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { return rawinput.windowProc(hwnd, msg, wparam, lparam); } } #endif ruby/input/mouse/000700 001750 001750 00000000000 12656700342 015143 5ustar00sergiosergio000000 000000 gba/system/serialization.cpp000664 001750 001750 00000002416 12651764221 017351 0ustar00sergiosergio000000 000000 serializer System::serialize() { serializer s(serialize_size); unsigned signature = 0x31545342, version = Info::SerializerVersion; char hash[64], description[512]; memcpy(&hash, (const char*)cartridge.sha256(), 64); memset(&description, 0, sizeof description); s.integer(signature); s.integer(version); s.array(hash); s.array(description); serialize_all(s); return s; } bool System::unserialize(serializer& s) { unsigned signature, version; char hash[64], description[512]; s.integer(signature); s.integer(version); s.array(hash); s.array(description); if(signature != 0x31545342) return false; if(version != Info::SerializerVersion) return false; power(); serialize_all(s); return true; } void System::serialize(serializer& s) { s.integer(bios.size); s.integer(bios.mdr); } void System::serialize_all(serializer& s) { cartridge.serialize(s); system.serialize(s); cpu.serialize(s); ppu.serialize(s); apu.serialize(s); bus.serialize(s); player.serialize(s); } void System::serialize_init() { serializer s; unsigned signature = 0, version = 0; char hash[64], description[512]; s.integer(signature); s.integer(version); s.array(hash); s.array(description); serialize_all(s); serialize_size = s.size(); } sfc/chip/superfx/superfx.cpp000664 001750 001750 00000002345 12651764221 017306 0ustar00sergiosergio000000 000000 #include #define SUPERFX_CPP namespace SuperFamicom { #include "serialization.cpp" #include "bus/bus.cpp" #include "core/core.cpp" #include "memory/memory.cpp" #include "mmio/mmio.cpp" #include "timing/timing.cpp" #include "disassembler/disassembler.cpp" SuperFX superfx; void SuperFX::Enter() { superfx.enter(); } void SuperFX::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(regs.sfr.g == 0) { step(6); synchronize_cpu(); continue; } (this->*opcode_table[(regs.sfr & 0x0300) + peekpipe()])(); if(r15_modified == false) regs.r[15]++; if(++instruction_counter >= 128) { instruction_counter = 0; synchronize_cpu(); } } } void SuperFX::init() { initialize_opcode_table(); regs.r[14].modify = {&SuperFX::r14_modify, this}; regs.r[15].modify = {&SuperFX::r15_modify, this}; } void SuperFX::load() { } void SuperFX::unload() { rom.reset(); ram.reset(); } void SuperFX::power() { GSU::power(); } void SuperFX::reset() { GSU::reset(); create(SuperFX::Enter, system.cpu_frequency()); instruction_counter = 0; memory_reset(); timing_reset(); } } target-ethos/settings/advanced.hpp000664 001750 001750 00000001043 12651764221 020432 0ustar00sergiosergio000000 000000 struct AdvancedSettings : SettingsLayout { Label driverTitle; HorizontalLayout driverLayout; Label videoLabel; ComboButton videoDriver; Label audioLabel; ComboButton audioDriver; Label inputLabel; ComboButton inputDriver; Label libraryTitle; HorizontalLayout libraryLayout; Label libraryLabel; LineEdit libraryPath; Button libraryBrowse; CheckLabel libraryShowOnStartup; Label information; Widget spacer; Label infoLabel; AdvancedSettings(); }; extern AdvancedSettings* advancedSettings; fc/video/000700 001750 001750 00000000000 12656700342 013371 5ustar00sergiosergio000000 000000 phoenix/core/layout/000700 001750 001750 00000000000 12656700342 015612 5ustar00sergiosergio000000 000000 sfc/alt/ppu-performance/screen/screen.hpp000664 001750 001750 00000002032 12651764221 021612 0ustar00sergiosergio000000 000000 class Screen { struct Regs { bool addsub_mode; bool direct_color; bool color_mode; bool color_halve; bool color_enable[7]; unsigned color_b; unsigned color_g; unsigned color_r; unsigned color; } regs; struct Output { struct Pixel { unsigned color; unsigned priority; unsigned source; } main[256], sub[256]; alwaysinline void plot_main(unsigned x, unsigned color, unsigned priority, unsigned source); alwaysinline void plot_sub(unsigned x, unsigned color, unsigned priority, unsigned source); } output; ColorWindow window; alwaysinline unsigned get_palette(unsigned color); unsigned get_direct_color(unsigned palette, unsigned tile); alwaysinline uint16 addsub(unsigned x, unsigned y, bool halve); void scanline(); void render_black(); alwaysinline uint16 get_pixel_main(unsigned x); alwaysinline uint16 get_pixel_sub(unsigned x); void render(); void serialize(serializer&); Screen(PPU& self); ~Screen(); PPU& self; friend class PPU; }; phoenix/cocoa/widget/horizontal-slider.hpp000664 001750 001750 00000001241 12651764221 022111 0ustar00sergiosergio000000 000000 @interface CocoaHorizontalSlider : NSSlider { @public phoenix::HorizontalSlider* horizontalSlider; } -(id) initWith:(phoenix::HorizontalSlider&)horizontalSlider; -(IBAction) activate:(id)sender; @end namespace phoenix { struct pHorizontalSlider : public pWidget { HorizontalSlider& horizontalSlider; CocoaHorizontalSlider* cocoaHorizontalSlider = nullptr; Size minimumSize(); void setGeometry(Geometry geometry); void setLength(unsigned length); void setPosition(unsigned position); pHorizontalSlider(HorizontalSlider& horizontalSlider) : pWidget(horizontalSlider), horizontalSlider(horizontalSlider) {} void constructor(); void destructor(); }; } ruby/input/mouse/xlib.cpp000664 001750 001750 00000011312 12651764221 016620 0ustar00sergiosergio000000 000000 #ifndef RUBY_INPUT_MOUSE_XLIB #define RUBY_INPUT_MOUSE_XLIB namespace ruby { struct InputMouseXlib { HID::Mouse hid; uintptr_t handle = 0; Display* display = nullptr; Window rootWindow; Cursor invisibleCursor; unsigned screenWidth = 0; unsigned screenHeight = 0; struct Mouse { bool acquired = false; signed numerator = 0; signed denominator = 0; signed threshold = 0; unsigned relativeX = 0; unsigned relativeY = 0; } ms; bool acquire() { if(acquired()) return true; if(XGrabPointer(display, handle, True, 0, GrabModeAsync, GrabModeAsync, rootWindow, invisibleCursor, CurrentTime) == GrabSuccess) { //backup existing cursor acceleration settings XGetPointerControl(display, &ms.numerator, &ms.denominator, &ms.threshold); //disable cursor acceleration XChangePointerControl(display, True, False, 1, 1, 0); //center cursor (so that first relative poll returns 0, 0 if mouse has not moved) XWarpPointer(display, None, rootWindow, 0, 0, 0, 0, screenWidth / 2, screenHeight / 2); return ms.acquired = true; } else { return ms.acquired = false; } } bool unacquire() { if(acquired()) { //restore cursor acceleration and release cursor XChangePointerControl(display, True, True, ms.numerator, ms.denominator, ms.threshold); XUngrabPointer(display, CurrentTime); ms.acquired = false; } return true; } bool acquired() { return ms.acquired; } void assign(unsigned groupID, unsigned inputID, int16_t value) { auto& group = hid.group[groupID]; if(group.input[inputID].value == value) return; if(input.onChange) input.onChange(hid, groupID, inputID, group.input[inputID].value, value); group.input[inputID].value = value; } void poll(vector& devices) { Window rootReturn; Window childReturn; signed rootXReturn = 0; signed rootYReturn = 0; signed windowXReturn = 0; signed windowYReturn = 0; unsigned maskReturn = 0; XQueryPointer(display, handle, &rootReturn, &childReturn, &rootXReturn, &rootYReturn, &windowXReturn, &windowYReturn, &maskReturn); if(acquired()) { XWindowAttributes attributes; XGetWindowAttributes(display, handle, &attributes); //absolute -> relative conversion assign(HID::Mouse::GroupID::Axis, 0, (int16_t)(rootXReturn - screenWidth / 2)); assign(HID::Mouse::GroupID::Axis, 1, (int16_t)(rootYReturn - screenHeight / 2)); if(hid.axis().input[0].value != 0 || hid.axis().input[1].value != 0) { //if mouse moved, re-center mouse for next poll XWarpPointer(display, None, rootWindow, 0, 0, 0, 0, screenWidth / 2, screenHeight / 2); } } else { assign(HID::Mouse::GroupID::Axis, 0, (int16_t)(rootXReturn - ms.relativeX)); assign(HID::Mouse::GroupID::Axis, 1, (int16_t)(rootYReturn - ms.relativeY)); ms.relativeX = rootXReturn; ms.relativeY = rootYReturn; } assign(HID::Mouse::GroupID::Button, 0, (bool)(maskReturn & Button1Mask)); assign(HID::Mouse::GroupID::Button, 1, (bool)(maskReturn & Button2Mask)); assign(HID::Mouse::GroupID::Button, 2, (bool)(maskReturn & Button3Mask)); assign(HID::Mouse::GroupID::Button, 3, (bool)(maskReturn & Button4Mask)); assign(HID::Mouse::GroupID::Button, 4, (bool)(maskReturn & Button5Mask)); devices.append(&hid); } bool init(uintptr_t handle) { this->handle = handle; display = XOpenDisplay(0); rootWindow = DefaultRootWindow(display); XWindowAttributes attributes; XGetWindowAttributes(display, rootWindow, &attributes); screenWidth = attributes.width; screenHeight = attributes.height; //Xlib: because XShowCursor(display, false) would just be too easy //create invisible cursor for use when mouse is acquired Pixmap pixmap; XColor black, unused; static char invisibleData[8] = {0}; Colormap colormap = DefaultColormap(display, DefaultScreen(display)); XAllocNamedColor(display, colormap, "black", &black, &unused); pixmap = XCreateBitmapFromData(display, handle, invisibleData, 8, 8); invisibleCursor = XCreatePixmapCursor(display, pixmap, pixmap, &black, &black, 0, 0); XFreePixmap(display, pixmap); XFreeColors(display, colormap, &black.pixel, 1, 0); ms.acquired = false; ms.relativeX = 0; ms.relativeY = 0; hid.id = 2; hid.axis().append({"X"}); hid.axis().append({"Y"}); hid.button().append({"Left"}); hid.button().append({"Middle"}); hid.button().append({"Right"}); hid.button().append({"Up"}); hid.button().append({"Down"}); return true; } void term() { unacquire(); XFreeCursor(display, invisibleCursor); XCloseDisplay(display); } }; } #endif phoenix/reference/widget/canvas.hpp000664 001750 001750 00000000436 12651764221 020572 0ustar00sergiosergio000000 000000 namespace phoenix { struct pCanvas : public pWidget { Canvas& canvas; void setDroppable(bool droppable); void setMode(Canvas::Mode mode); void setSize(Size size); pCanvas(Canvas& canvas) : pWidget(canvas), canvas(canvas) {} void constructor(); void destructor(); }; } phoenix/core/layout/vertical-layout.cpp000664 001750 001750 00000007753 12651764221 021473 0ustar00sergiosergio000000 000000 void VerticalLayout::append(Sizable& sizable, Size size, unsigned spacing) { for(auto& child : children) if(child.sizable == &sizable) return; children.append({&sizable, size.width, size.height, spacing}); synchronizeLayout(); if(window()) window()->synchronizeLayout(); } void VerticalLayout::append(Sizable& sizable) { for(auto& child : children) if(child.sizable == &sizable) return; Layout::append(sizable); if(window()) window()->synchronizeLayout(); } Size VerticalLayout::minimumSize() { unsigned width = 0, height = 0; for(auto& child : children) { if(child.width == Size::Minimum || child.width == Size::Maximum) { width = max(width, child.sizable->minimumSize().width); continue; } width = max(width, child.width); } for(auto& child : children) { height += child.spacing; if(child.height == Size::Minimum || child.height == Size::Maximum) { height += child.sizable->minimumSize().height; continue; } height += child.height; } return {state.margin * 2 + width, state.margin * 2 + height}; } void VerticalLayout::remove(Sizable& sizable) { for(unsigned n = 0; n < children.size(); n++) { if(children[n].sizable == &sizable) { if(dynamic_cast(children[n].sizable)) { Layout* layout = (Layout*)children[n].sizable; layout->reset(); } children.remove(n); Layout::remove(sizable); if(window()) window()->synchronizeLayout(); break; } } } void VerticalLayout::reset() { for(auto& child : children) { if(window() && dynamic_cast(child.sizable)) ((Layout*)child.sizable)->reset(); if(window() && dynamic_cast(child.sizable)) window()->remove((Widget&)*child.sizable); } } void VerticalLayout::setAlignment(double alignment) { state.alignment = max(0.0, min(1.0, alignment)); } void VerticalLayout::setEnabled(bool enabled) { Sizable::state.enabled = enabled; for(auto& child : children) { child.sizable->setEnabled(child.sizable->enabled()); } } void VerticalLayout::setGeometry(Geometry containerGeometry) { auto children = this->children; for(auto& child : children) { if(child.width == Size::Minimum) child.width = child.sizable->minimumSize().width; if(child.height == Size::Minimum) child.height = child.sizable->minimumSize().height; } Geometry geometry = containerGeometry; geometry.x += state.margin; geometry.y += state.margin; geometry.width -= state.margin * 2; geometry.height -= state.margin * 2; unsigned minimumHeight = 0, maximumHeightCounter = 0; for(auto& child : children) { if(child.height == Size::Maximum) maximumHeightCounter++; if(child.height != Size::Maximum) minimumHeight += child.height; minimumHeight += child.spacing; } for(auto& child : children) { if(child.width == Size::Maximum) child.width = geometry.width; if(child.height == Size::Maximum) child.height = (geometry.height - minimumHeight) / maximumHeightCounter; } unsigned maximumWidth = 0; for(auto& child : children) maximumWidth = max(maximumWidth, child.width); for(auto& child : children) { unsigned pivot = (maximumWidth - child.width) * state.alignment; Geometry childGeometry = {geometry.x + pivot, geometry.y, child.width, child.height}; if((signed)childGeometry.width < 1) childGeometry.width = 1; if((signed)childGeometry.height < 1) childGeometry.height = 1; child.sizable->setGeometry(childGeometry); geometry.y += child.height + child.spacing; geometry.height -= child.height + child.spacing; } } void VerticalLayout::setMargin(unsigned margin) { state.margin = margin; } void VerticalLayout::setVisible(bool visible) { Sizable::state.visible = visible; for(auto& child : children) { child.sizable->setVisible(child.sizable->visible()); } } void VerticalLayout::synchronizeLayout() { for(auto& child : children) Layout::append(*child.sizable); } VerticalLayout::~VerticalLayout() { while(children.size()) remove(*children[0].sizable); } nall/dsp/resample/lib/000700 001750 001750 00000000000 12656700342 015765 5ustar00sergiosergio000000 000000 nall/dsp/resample/nearest.hpp000664 001750 001750 00000001440 12651764221 017405 0ustar00sergiosergio000000 000000 #ifdef NALL_DSP_INTERNAL_HPP struct ResampleNearest : Resampler { inline void setFrequency(); inline void clear(); inline void sample(); ResampleNearest(DSP& dsp) : Resampler(dsp) {} real fraction; real step; }; void ResampleNearest::setFrequency() { fraction = 0.0; step = dsp.settings.frequency / frequency; } void ResampleNearest::clear() { fraction = 0.0; } void ResampleNearest::sample() { while(fraction <= 1.0) { real channel[dsp.settings.channels]; for(unsigned n = 0; n < dsp.settings.channels; n++) { real a = dsp.buffer.read(n, -1); real b = dsp.buffer.read(n, -0); real mu = fraction; channel[n] = mu < 0.5 ? a : b; } dsp.write(channel); fraction += step; } dsp.buffer.rdoffset++; fraction -= 1.0; } #endif phoenix/cocoa/application.hpp000664 001750 001750 00000000762 12651764221 017467 0ustar00sergiosergio000000 000000 @interface CocoaDelegate : NSObject { } -(NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication*)sender; -(BOOL) applicationShouldHandleReopen:(NSApplication*)application hasVisibleWindows:(BOOL)flag; -(void) run:(NSTimer*)timer; -(void) updateInDock:(NSTimer*)timer; @end namespace phoenix { struct pApplication { static void run(); static bool pendingEvents(); static void processEvents(); static void quit(); static void initialize(); }; } nall/file.hpp000664 001750 001750 00000024075 12651764221 014276 0ustar00sergiosergio000000 000000 #ifndef NALL_FILE_HPP #define NALL_FILE_HPP #include #include #include #include #include #include #include #ifdef __APPLE__ #include "TargetConditionals.h" #endif namespace nall { inline FILE* fopen_utf8(const string& filename, const string& mode) { #if !defined(_WIN32) return fopen(filename, mode); #else return _wfopen(utf16_t(filename), utf16_t(mode)); #endif } struct file : varint { enum class mode : unsigned { read, write, modify, append, readwrite = modify, writeread = append }; enum class index : unsigned { absolute, relative }; enum class time : unsigned { create, modify, access }; static bool copy(const string& sourcename, const string& targetname) { file rd, wr; if(rd.open(sourcename, mode::read) == false) return false; if(wr.open(targetname, mode::write) == false) return false; for(unsigned n = 0; n < rd.size(); n++) wr.write(rd.read()); return true; } static bool move(const string& sourcename, const string& targetname) { auto result = rename(sourcename, targetname); if(result == 0) return true; if(errno == EXDEV) { //cannot move files between file systems; copy file instead of failing if(file::copy(sourcename, targetname)) { file::remove(sourcename); return true; } } return false; } static bool remove(const string& filename) { return unlink(filename) == 0; } static bool truncate(const string& filename, unsigned size) { #if !defined(_WIN32) return truncate(filename, size) == 0; #else bool result = false; FILE* fp = fopen(filename, "rb+"); if(fp) { result = _chsize(fileno(fp), size) == 0; fclose(fp); } return result; #endif } static vector read(const string& filename) { vector memory; file fp; if(fp.open(filename, mode::read)) { memory.resize(fp.size()); fp.read(memory.data(), memory.size()); } return memory; } static bool read(const string& filename, uint8_t* data, unsigned size) { file fp; if(fp.open(filename, mode::read) == false) return false; fp.read(data, size); fp.close(); return true; } static bool write(const string& filename, const string& text) { file fp; if(fp.open(filename, mode::write) == false) return false; fp.print(text); fp.close(); return true; } static bool write(const string& filename, const vector& buffer) { file fp; if(fp.open(filename, mode::write) == false) return false; fp.write(buffer.data(), buffer.size()); fp.close(); return true; } static bool write(const string& filename, const uint8_t* data, unsigned size) { file fp; if(fp.open(filename, mode::write) == false) return false; fp.write(data, size); fp.close(); return true; } static bool create(const string& filename) { //create an empty file (will replace existing files) file fp; if(fp.open(filename, mode::write) == false) return false; fp.close(); return true; } static string sha256(const string& filename) { auto buffer = read(filename); return nall::sha256(buffer.data(), buffer.size()); } uint8_t read() { if(!fp) return 0xff; //file not open if(file_mode == mode::write) return 0xff; //reads not permitted if(file_offset >= file_size) return 0xff; //cannot read past end of file buffer_sync(); return buffer[(file_offset++) & buffer_mask]; } uintmax_t readl(unsigned length = 1) { uintmax_t data = 0; for(int i = 0; i < length; i++) { data |= (uintmax_t)read() << (i << 3); } return data; } uintmax_t readm(unsigned length = 1) { uintmax_t data = 0; while(length--) { data <<= 8; data |= read(); } return data; } void read(uint8_t* buffer, unsigned length) { while(length--) *buffer++ = read(); } void write(uint8_t data) { if(!fp) return; //file not open if(file_mode == mode::read) return; //writes not permitted buffer_sync(); buffer[(file_offset++) & buffer_mask] = data; buffer_dirty = true; if(file_offset > file_size) file_size = file_offset; } void writel(uintmax_t data, unsigned length = 1) { while(length--) { write(data); data >>= 8; } } void writem(uintmax_t data, unsigned length = 1) { for(int i = length - 1; i >= 0; i--) { write(data >> (i << 3)); } } void write(const uint8_t* buffer, unsigned length) { while(length--) write(*buffer++); } template void print(Args... args) { string data(args...); const char* p = data; while(*p) write(*p++); } void flush() { buffer_flush(); fflush(fp); } void seek(int offset, index index_ = index::absolute) { if(!fp) return; //file not open buffer_flush(); uintmax_t req_offset = file_offset; switch(index_) { case index::absolute: req_offset = offset; break; case index::relative: if (offset < 0 && -offset > req_offset) req_offset = 0; //cannot seek before start of file else req_offset += offset; break; } if(req_offset > file_size) { if(file_mode == mode::read) { //cannot seek past end of file req_offset = file_size; } else { //pad file to requested location file_offset = file_size; while(file_size < req_offset) write(0x00); } } file_offset = req_offset; } unsigned offset() const { if(!fp) return 0; //file not open return file_offset; } unsigned size() const { if(!fp) return 0; //file not open return file_size; } bool truncate(unsigned size) { if(!fp) return false; //file not open #if !defined(_WIN32) return ftruncate(fileno(fp), size) == 0; #else return _chsize(fileno(fp), size) == 0; #endif } bool end() { if(!fp) return true; //file not open return file_offset >= file_size; } static bool exists(const string& filename) { #if defined(__APPLE__) && TARGET_OS_IPHONE struct stat data; if(stat(filename, &data) != 0) return false; #elif !defined(_WIN32) struct stat data; if(stat(filename, &data) != 0) return false; #else struct __stat64 data; if(_wstat64(utf16_t(filename), &data) != 0) return false; #endif //return true if this is a file, and false if this is a directory return !(data.st_mode & S_IFDIR); } static uintmax_t size(const string& filename) { #if defined(__APPLE__) && TARGET_OS_IPHONE struct stat data; if(stat(filename, &data) != 0) return false; #elif !defined(_WIN32) struct stat data; stat(filename, &data); #else struct __stat64 data; _wstat64(utf16_t(filename), &data); #endif return S_ISREG(data.st_mode) ? data.st_size : 0u; } static time_t timestamp(const string& filename, file::time mode = file::time::create) { #if defined(__APPLE__) && TARGET_OS_IPHONE struct stat data; if(stat(filename, &data) != 0) return false; #elif !defined(_WIN32) struct stat data; stat(filename, &data); #else struct __stat64 data; _wstat64(utf16_t(filename), &data); #endif switch(mode) { default: case file::time::create: return data.st_ctime; case file::time::modify: return data.st_mtime; case file::time::access: return data.st_atime; } } bool open() const { return fp; } explicit operator bool() const { return open(); } bool open(const string& filename, mode mode_) { if(fp) return false; switch(file_mode = mode_) { #if !defined(_WIN32) case mode::read: fp = fopen(filename, "rb" ); break; case mode::write: fp = fopen(filename, "wb+"); break; //need read permission for buffering case mode::readwrite: fp = fopen(filename, "rb+"); break; case mode::writeread: fp = fopen(filename, "wb+"); break; #else case mode::read: fp = _wfopen(utf16_t(filename), L"rb" ); break; case mode::write: fp = _wfopen(utf16_t(filename), L"wb+"); break; case mode::readwrite: fp = _wfopen(utf16_t(filename), L"rb+"); break; case mode::writeread: fp = _wfopen(utf16_t(filename), L"wb+"); break; #endif } if(!fp) return false; buffer_offset = -1; //invalidate buffer file_offset = 0; fseek(fp, 0, SEEK_END); file_size = ftell(fp); fseek(fp, 0, SEEK_SET); return true; } void close() { if(!fp) return; buffer_flush(); fclose(fp); fp = nullptr; } file() { } file(const string& filename, mode mode_) { open(filename, mode_); } ~file() { close(); } file& operator=(const file&) = delete; file(const file&) = delete; private: enum { buffer_size = 1 << 12, buffer_mask = buffer_size - 1 }; char buffer[buffer_size] = {0}; int buffer_offset = -1; //invalidate buffer bool buffer_dirty = false; FILE *fp = nullptr; unsigned file_offset = 0; unsigned file_size = 0; mode file_mode = mode::read; void buffer_sync() { if(!fp) return; //file not open if(buffer_offset != (file_offset & ~buffer_mask)) { buffer_flush(); buffer_offset = file_offset & ~buffer_mask; fseek(fp, buffer_offset, SEEK_SET); unsigned length = (buffer_offset + buffer_size) <= file_size ? buffer_size : (file_size & buffer_mask); if(length) unsigned unused = fread(buffer, 1, length, fp); } } void buffer_flush() { if(!fp) return; //file not open if(file_mode == mode::read) return; //buffer cannot be written to if(buffer_offset < 0) return; //buffer unused if(buffer_dirty == false) return; //buffer unmodified since read fseek(fp, buffer_offset, SEEK_SET); unsigned length = (buffer_offset + buffer_size) <= file_size ? buffer_size : (file_size & buffer_mask); if(length) unsigned unused = fwrite(buffer, 1, length, fp); buffer_offset = -1; //invalidate buffer buffer_dirty = false; } }; } #endif target-ethos/tools/cheat-editor.hpp000664 001750 001750 00000001347 12651764221 020544 0ustar00sergiosergio000000 000000 struct CheatEditor : ToolsLayout { ListView cheatList; HorizontalLayout codeLayout; Label codeLabel; LineEdit codeEdit; HorizontalLayout descLayout; Label descLabel; LineEdit descEdit; HorizontalLayout controlLayout; Button findButton; Widget spacer; Button resetButton; Button eraseButton; void reset(); void erase(); void updateCode(); void updateDesc(); bool load(string filename); bool save(string filename); bool import(string code, string desc); void update(); void refresh(); void synchronize(); CheatEditor(); private: enum : unsigned { Codes = 128 }; struct Cheat { string code; string desc; }; Cheat cheat[Codes]; }; extern CheatEditor* cheatEditor; sfc/chip/dsp3/dsp3.hpp000664 001750 001750 00000000321 12651764221 015635 0ustar00sergiosergio000000 000000 class DSP3 : public Memory { public: void init(); void load(); void unload(); void power(); void reset(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); }; extern DSP3 dsp3; gb/cartridge/mbc0/mbc0.cpp000664 001750 001750 00000000754 12651764221 016420 0ustar00sergiosergio000000 000000 #ifdef CARTRIDGE_CPP uint8 Cartridge::MBC0::mmio_read(uint16 addr) { if((addr & 0x8000) == 0x0000) { //$0000-7fff return cartridge.rom_read(addr); } if((addr & 0xe000) == 0xa000) { //$a000-bfff return cartridge.ram_read(addr & 0x1fff); } return 0x00; } void Cartridge::MBC0::mmio_write(uint16 addr, uint8 data) { if((addr & 0xe000) == 0xa000) { //$a000-bfff cartridge.ram_write(addr & 0x1fff, data); return; } } void Cartridge::MBC0::power() { } #endif fc/cartridge/board/nes-hkrom.cpp000664 001750 001750 00000001755 12651764221 017752 0ustar00sergiosergio000000 000000 struct NES_HKROM : Board { MMC6 mmc6; void main() { mmc6.main(); } uint8 prg_read(unsigned addr) { if((addr & 0xf000) == 0x7000) return mmc6.ram_read(addr); if(addr & 0x8000) return prgrom.read(mmc6.prg_addr(addr)); return cpu.mdr(); } void prg_write(unsigned addr, uint8 data) { if((addr & 0xf000) == 0x7000) return mmc6.ram_write(addr, data); if(addr & 0x8000) return mmc6.reg_write(addr, data); } uint8 chr_read(unsigned addr) { mmc6.irq_test(addr); if(addr & 0x2000) return ppu.ciram_read(mmc6.ciram_addr(addr)); return Board::chr_read(mmc6.chr_addr(addr)); } void chr_write(unsigned addr, uint8 data) { mmc6.irq_test(addr); if(addr & 0x2000) return ppu.ciram_write(mmc6.ciram_addr(addr), data); return Board::chr_write(mmc6.chr_addr(addr), data); } void power() { mmc6.power(); } void reset() { mmc6.reset(); } void serialize(serializer& s) { Board::serialize(s); mmc6.serialize(s); } NES_HKROM(Markup::Node& document) : Board(document), mmc6(*this) { } }; nall/string/variadic.hpp000664 001750 001750 00000000630 12651764221 016436 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { void sprint(string& output) { } template void sprint(string& output, const T& value, Args&&... args) { output._append(make_string(value)); sprint(output, std::forward(args)...); } template void print(Args&&... args) { printf("%s", (const char*)string(std::forward(args)...)); } } #endif phoenix/cocoa/widget/line-edit.cpp000664 001750 001750 00000002560 12651764221 020312 0ustar00sergiosergio000000 000000 @implementation CocoaLineEdit : NSTextField -(id) initWith:(phoenix::LineEdit&)lineEditReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { lineEdit = &lineEditReference; [self setDelegate:self]; [self setTarget:self]; [self setAction:@selector(activate:)]; //prevent focus changes from generating activate event [[self cell] setSendsActionOnEndEditing:NO]; } return self; } -(void) textDidChange:(NSNotification*)n { if(lineEdit->onChange) lineEdit->onChange(); } -(IBAction) activate:(id)sender { if(lineEdit->onActivate) lineEdit->onActivate(); } @end namespace phoenix { Size pLineEdit::minimumSize() { Size size = Font::size(lineEdit.font(), lineEdit.state.text); return {size.width + 10, size.height + 8}; } void pLineEdit::setEditable(bool editable) { @autoreleasepool { [cocoaView setEditable:editable]; } } void pLineEdit::setText(string text) { @autoreleasepool { [cocoaView setStringValue:[NSString stringWithUTF8String:text]]; } } string pLineEdit::text() { @autoreleasepool { return [[cocoaView stringValue] UTF8String]; } } void pLineEdit::constructor() { @autoreleasepool { cocoaView = cocoaLineEdit = [[CocoaLineEdit alloc] initWith:lineEdit]; setEditable(lineEdit.state.editable); } } void pLineEdit::destructor() { @autoreleasepool { [cocoaView release]; } } } phoenix/windows/widget/frame.cpp000664 001750 001750 00000002510 12651764221 020133 0ustar00sergiosergio000000 000000 namespace phoenix { void pFrame::setEnabled(bool enabled) { if(frame.state.layout) frame.state.layout->setEnabled(frame.state.layout->enabled()); pWidget::setEnabled(enabled); } void pFrame::setGeometry(Geometry geometry) { bool empty = frame.state.text.empty(); Size size = pFont::size(hfont, frame.state.text); pWidget::setGeometry({ geometry.x, geometry.y - (empty ? size.height >> 1 : 0), geometry.width, geometry.height + (empty ? size.height >> 1 : 0) }); if(frame.state.layout == nullptr) return; if(empty) size.height = 1; geometry.x += 1, geometry.width -= 2; geometry.y += size.height, geometry.height -= size.height + 2; frame.state.layout->setGeometry(geometry); } void pFrame::setText(string text) { SetWindowText(hwnd, utf16_t(text)); } void pFrame::setVisible(bool visible) { if(frame.state.layout) frame.state.layout->setVisible(frame.state.layout->visible()); pWidget::setVisible(visible); } void pFrame::constructor() { hwnd = CreateWindow(L"BUTTON", L"", WS_CHILD | BS_GROUPBOX, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&frame); setDefaultFont(); setText(frame.state.text); synchronize(); } void pFrame::destructor() { DestroyWindow(hwnd); } void pFrame::orphan() { destructor(); constructor(); } } fc/cpu/000700 001750 001750 00000000000 12656700342 013052 5ustar00sergiosergio000000 000000 processor/r65816/r65816.cpp000664 001750 001750 00000003423 12651764221 016163 0ustar00sergiosergio000000 000000 #include #include "r65816.hpp" namespace Processor { #include "algorithms.cpp" #include "disassembler.cpp" #include "serialization.cpp" #define L last_cycle(); #define A 0 #define X 1 #define Y 2 #define Z 3 #define S 4 #define D 5 #define call(op) (this->*op)() #include "opcode_read.cpp" #include "opcode_write.cpp" #include "opcode_rmw.cpp" #include "opcode_pc.cpp" #include "opcode_misc.cpp" #include "table.cpp" #undef L #undef A #undef X #undef Y #undef Z #undef S #undef D #undef call //immediate, 2-cycle opcodes with I/O cycle will become bus read //when an IRQ is to be triggered immediately after opcode completion. //this affects the following opcodes: // clc, cld, cli, clv, sec, sed, sei, // tax, tay, txa, txy, tya, tyx, // tcd, tcs, tdc, tsc, tsx, txs, // inc, inx, iny, dec, dex, dey, // asl, lsr, rol, ror, nop, xce. alwaysinline void R65816::op_io_irq() { if(interrupt_pending()) { //modify I/O cycle to bus read cycle, do not increment PC op_read(regs.pc.d); } else { op_io(); } } alwaysinline void R65816::op_io_cond2() { if(regs.d.l != 0x00) { op_io(); } } alwaysinline void R65816::op_io_cond4(uint16 x, uint16 y) { if(!regs.p.x || (x & 0xff00) != (y & 0xff00)) { op_io(); } } alwaysinline void R65816::op_io_cond6(uint16 addr) { if(regs.e && (regs.pc.w & 0xff00) != (addr & 0xff00)) { op_io(); } } void R65816::op_irq() { op_read(regs.pc.d); op_io(); if(!regs.e) op_writestack(regs.pc.b); op_writestack(regs.pc.h); op_writestack(regs.pc.l); op_writestack(regs.e ? (regs.p & ~0x10) : regs.p); rd.l = op_read(regs.vector + 0); regs.pc.b = 0x00; regs.p.i = 1; regs.p.d = 0; rd.h = op_read(regs.vector + 1); regs.pc.w = rd.w; } R65816::R65816() { initialize_opcode_table(); } } sfc/ppu/000700 001750 001750 00000000000 12656700342 013252 5ustar00sergiosergio000000 000000 phoenix/cocoa/widget/radio-label.hpp000664 001750 001750 00000001132 12651764221 020612 0ustar00sergiosergio000000 000000 @interface CocoaRadioLabel : NSButton { @public phoenix::RadioLabel* radioLabel; } -(id) initWith:(phoenix::RadioLabel&)radioLabel; -(IBAction) activate:(id)sender; @end namespace phoenix { struct pRadioLabel : public pWidget { RadioLabel& radioLabel; CocoaRadioLabel* cocoaRadioLabel = nullptr; Size minimumSize(); void setChecked(); void setGeometry(Geometry geometry); void setGroup(const group& group); void setText(string text); pRadioLabel(RadioLabel& radioLabel) : pWidget(radioLabel), radioLabel(radioLabel) {} void constructor(); void destructor(); }; } processor/r65816/opcode_pc.cpp000664 001750 001750 00000006522 12651764221 017246 0ustar00sergiosergio000000 000000 template void R65816::op_branch() { if((bool)(regs.p & bit) != val) { L rd.l = op_readpc(); } else { rd.l = op_readpc(); aa.w = regs.pc.d + (int8)rd.l; op_io_cond6(aa.w); L op_io(); regs.pc.w = aa.w; } } void R65816::op_bra() { rd.l = op_readpc(); aa.w = regs.pc.d + (int8)rd.l; op_io_cond6(aa.w); L op_io(); regs.pc.w = aa.w; } void R65816::op_brl() { rd.l = op_readpc(); rd.h = op_readpc(); L op_io(); regs.pc.w = regs.pc.d + (int16)rd.w; } void R65816::op_jmp_addr() { rd.l = op_readpc(); L rd.h = op_readpc(); regs.pc.w = rd.w; } void R65816::op_jmp_long() { rd.l = op_readpc(); rd.h = op_readpc(); L rd.b = op_readpc(); regs.pc.d = rd.d & 0xffffff; } void R65816::op_jmp_iaddr() { aa.l = op_readpc(); aa.h = op_readpc(); rd.l = op_readaddr(aa.w + 0); L rd.h = op_readaddr(aa.w + 1); regs.pc.w = rd.w; } void R65816::op_jmp_iaddrx() { aa.l = op_readpc(); aa.h = op_readpc(); op_io(); rd.l = op_readpbr(aa.w + regs.x.w + 0); L rd.h = op_readpbr(aa.w + regs.x.w + 1); regs.pc.w = rd.w; } void R65816::op_jmp_iladdr() { aa.l = op_readpc(); aa.h = op_readpc(); rd.l = op_readaddr(aa.w + 0); rd.h = op_readaddr(aa.w + 1); L rd.b = op_readaddr(aa.w + 2); regs.pc.d = rd.d & 0xffffff; } void R65816::op_jsr_addr() { aa.l = op_readpc(); aa.h = op_readpc(); op_io(); regs.pc.w--; op_writestack(regs.pc.h); L op_writestack(regs.pc.l); regs.pc.w = aa.w; } void R65816::op_jsr_long_e() { aa.l = op_readpc(); aa.h = op_readpc(); op_writestackn(regs.pc.b); op_io(); aa.b = op_readpc(); regs.pc.w--; op_writestackn(regs.pc.h); L op_writestackn(regs.pc.l); regs.pc.d = aa.d & 0xffffff; regs.s.h = 0x01; } void R65816::op_jsr_long_n() { aa.l = op_readpc(); aa.h = op_readpc(); op_writestackn(regs.pc.b); op_io(); aa.b = op_readpc(); regs.pc.w--; op_writestackn(regs.pc.h); L op_writestackn(regs.pc.l); regs.pc.d = aa.d & 0xffffff; } void R65816::op_jsr_iaddrx_e() { aa.l = op_readpc(); op_writestackn(regs.pc.h); op_writestackn(regs.pc.l); aa.h = op_readpc(); op_io(); rd.l = op_readpbr(aa.w + regs.x.w + 0); L rd.h = op_readpbr(aa.w + regs.x.w + 1); regs.pc.w = rd.w; regs.s.h = 0x01; } void R65816::op_jsr_iaddrx_n() { aa.l = op_readpc(); op_writestackn(regs.pc.h); op_writestackn(regs.pc.l); aa.h = op_readpc(); op_io(); rd.l = op_readpbr(aa.w + regs.x.w + 0); L rd.h = op_readpbr(aa.w + regs.x.w + 1); regs.pc.w = rd.w; } void R65816::op_rti_e() { op_io(); op_io(); regs.p = op_readstack() | 0x30; rd.l = op_readstack(); L rd.h = op_readstack(); regs.pc.w = rd.w; } void R65816::op_rti_n() { op_io(); op_io(); regs.p = op_readstack(); if(regs.p.x) { regs.x.h = 0x00; regs.y.h = 0x00; } rd.l = op_readstack(); rd.h = op_readstack(); L rd.b = op_readstack(); regs.pc.d = rd.d & 0xffffff; update_table(); } void R65816::op_rts() { op_io(); op_io(); rd.l = op_readstack(); rd.h = op_readstack(); L op_io(); regs.pc.w = ++rd.w; } void R65816::op_rtl_e() { op_io(); op_io(); rd.l = op_readstackn(); rd.h = op_readstackn(); L rd.b = op_readstackn(); regs.pc.b = rd.b; regs.pc.w = ++rd.w; regs.s.h = 0x01; } void R65816::op_rtl_n() { op_io(); op_io(); rd.l = op_readstackn(); rd.h = op_readstackn(); L rd.b = op_readstackn(); regs.pc.b = rd.b; regs.pc.w = ++rd.w; } phoenix/cocoa/widget/combo-button.hpp000664 001750 001750 00000001265 12651764221 021056 0ustar00sergiosergio000000 000000 @interface CocoaComboButton : NSPopUpButton { @public phoenix::ComboButton* comboButton; } -(id) initWith:(phoenix::ComboButton&)comboButton; -(IBAction) activate:(id)sender; @end namespace phoenix { struct pComboButton : public pWidget { ComboButton& comboButton; CocoaComboButton* cocoaComboButton = nullptr; void append(string text); Size minimumSize(); void remove(unsigned selection); void reset(); void setGeometry(Geometry geometry); void setSelection(unsigned selection); void setText(unsigned selection, string text); pComboButton(ComboButton& comboButton) : pWidget(comboButton), comboButton(comboButton) {} void constructor(); void destructor(); }; } phoenix/qt/keyboard.cpp000664 001750 001750 00000013021 12651764221 016307 0ustar00sergiosergio000000 000000 namespace phoenix { void pKeyboard::initialize() { auto append = [](Keyboard::Scancode scancode, unsigned keysym) { settings->keymap.insert(scancode, XKeysymToKeycode(pApplication::display, keysym)); }; append(Keyboard::Scancode::Escape, XK_Escape); append(Keyboard::Scancode::F1, XK_F1); append(Keyboard::Scancode::F2, XK_F2); append(Keyboard::Scancode::F3, XK_F3); append(Keyboard::Scancode::F4, XK_F4); append(Keyboard::Scancode::F5, XK_F5); append(Keyboard::Scancode::F6, XK_F6); append(Keyboard::Scancode::F7, XK_F7); append(Keyboard::Scancode::F8, XK_F8); append(Keyboard::Scancode::F9, XK_F9); append(Keyboard::Scancode::F10, XK_F10); append(Keyboard::Scancode::F11, XK_F11); append(Keyboard::Scancode::F12, XK_F12); append(Keyboard::Scancode::PrintScreen, XK_Print); append(Keyboard::Scancode::ScrollLock, XK_Scroll_Lock); append(Keyboard::Scancode::Pause, XK_Pause); append(Keyboard::Scancode::Insert, XK_Insert); append(Keyboard::Scancode::Delete, XK_Delete); append(Keyboard::Scancode::Home, XK_Home); append(Keyboard::Scancode::End, XK_End); append(Keyboard::Scancode::PageUp, XK_Prior); append(Keyboard::Scancode::PageDown, XK_Next); append(Keyboard::Scancode::Up, XK_Up); append(Keyboard::Scancode::Down, XK_Down); append(Keyboard::Scancode::Left, XK_Left); append(Keyboard::Scancode::Right, XK_Right); append(Keyboard::Scancode::Grave, XK_asciitilde); append(Keyboard::Scancode::Number1, XK_1); append(Keyboard::Scancode::Number2, XK_2); append(Keyboard::Scancode::Number3, XK_3); append(Keyboard::Scancode::Number4, XK_4); append(Keyboard::Scancode::Number5, XK_5); append(Keyboard::Scancode::Number6, XK_6); append(Keyboard::Scancode::Number7, XK_7); append(Keyboard::Scancode::Number8, XK_8); append(Keyboard::Scancode::Number9, XK_9); append(Keyboard::Scancode::Number0, XK_0); append(Keyboard::Scancode::Minus, XK_minus); append(Keyboard::Scancode::Equal, XK_equal); append(Keyboard::Scancode::Backspace, XK_BackSpace); append(Keyboard::Scancode::BracketLeft, XK_bracketleft); append(Keyboard::Scancode::BracketRight, XK_bracketright); append(Keyboard::Scancode::Backslash, XK_backslash); append(Keyboard::Scancode::Semicolon, XK_semicolon); append(Keyboard::Scancode::Apostrophe, XK_apostrophe); append(Keyboard::Scancode::Comma, XK_comma); append(Keyboard::Scancode::Period, XK_period); append(Keyboard::Scancode::Slash, XK_slash); append(Keyboard::Scancode::Tab, XK_Tab); append(Keyboard::Scancode::CapsLock, XK_Caps_Lock); append(Keyboard::Scancode::Return, XK_Return); append(Keyboard::Scancode::ShiftLeft, XK_Shift_L); append(Keyboard::Scancode::ShiftRight, XK_Shift_R); append(Keyboard::Scancode::ControlLeft, XK_Control_L); append(Keyboard::Scancode::ControlRight, XK_Control_R); append(Keyboard::Scancode::SuperLeft, XK_Super_L); append(Keyboard::Scancode::SuperRight, XK_Super_R); append(Keyboard::Scancode::AltLeft, XK_Alt_L); append(Keyboard::Scancode::AltRight, XK_Alt_R); append(Keyboard::Scancode::Space, XK_space); append(Keyboard::Scancode::Menu, XK_Menu); append(Keyboard::Scancode::A, XK_A); append(Keyboard::Scancode::B, XK_B); append(Keyboard::Scancode::C, XK_C); append(Keyboard::Scancode::D, XK_D); append(Keyboard::Scancode::E, XK_E); append(Keyboard::Scancode::F, XK_F); append(Keyboard::Scancode::G, XK_G); append(Keyboard::Scancode::H, XK_H); append(Keyboard::Scancode::I, XK_I); append(Keyboard::Scancode::J, XK_J); append(Keyboard::Scancode::K, XK_K); append(Keyboard::Scancode::L, XK_L); append(Keyboard::Scancode::M, XK_M); append(Keyboard::Scancode::N, XK_N); append(Keyboard::Scancode::O, XK_O); append(Keyboard::Scancode::P, XK_P); append(Keyboard::Scancode::Q, XK_Q); append(Keyboard::Scancode::R, XK_R); append(Keyboard::Scancode::S, XK_S); append(Keyboard::Scancode::T, XK_T); append(Keyboard::Scancode::U, XK_U); append(Keyboard::Scancode::V, XK_V); append(Keyboard::Scancode::W, XK_W); append(Keyboard::Scancode::X, XK_X); append(Keyboard::Scancode::Y, XK_Y); append(Keyboard::Scancode::Z, XK_Z); append(Keyboard::Scancode::NumLock, XK_Num_Lock); append(Keyboard::Scancode::Divide, XK_KP_Divide); append(Keyboard::Scancode::Multiply, XK_KP_Multiply); append(Keyboard::Scancode::Subtract, XK_KP_Subtract); append(Keyboard::Scancode::Add, XK_KP_Add); append(Keyboard::Scancode::Enter, XK_KP_Enter); append(Keyboard::Scancode::Point, XK_KP_Decimal); append(Keyboard::Scancode::Keypad1, XK_KP_1); append(Keyboard::Scancode::Keypad2, XK_KP_2); append(Keyboard::Scancode::Keypad3, XK_KP_3); append(Keyboard::Scancode::Keypad4, XK_KP_4); append(Keyboard::Scancode::Keypad5, XK_KP_5); append(Keyboard::Scancode::Keypad6, XK_KP_6); append(Keyboard::Scancode::Keypad7, XK_KP_7); append(Keyboard::Scancode::Keypad8, XK_KP_8); append(Keyboard::Scancode::Keypad9, XK_KP_9); append(Keyboard::Scancode::Keypad0, XK_KP_0); } bool pKeyboard::pressed(Keyboard::Scancode scancode) { char state[256]; XQueryKeymap(pApplication::display, state); if(auto result = settings->keymap.find(scancode)) { unsigned id = result(); return state[id >> 3] & (1 << (id & 7)); } return false; } vector pKeyboard::state() { vector output; output.resize((unsigned)Keyboard::Scancode::Limit); for(auto& n : output) n = false; char state[256]; XQueryKeymap(pApplication::display, state); for(auto node : settings->keymap) { if(state[node.value >> 3] & (1 << (node.value & 7))) { output[(unsigned)node.key] = true; } } return output; } } nall/string/eval/000700 001750 001750 00000000000 12656700342 015056 5ustar00sergiosergio000000 000000 sfc/system/video.hpp000664 001750 001750 00000000625 12651764221 015631 0ustar00sergiosergio000000 000000 struct Video { uint32_t* palette; void generate_palette(Emulator::Interface::PaletteMode mode); Video(); ~Video(); private: bool hires; unsigned line_width[240]; void update(); void scanline(); void init(); static const uint8_t gamma_ramp[32]; static const uint8_t cursor[15 * 15]; void draw_cursor(uint16_t color, int x, int y); friend class System; }; extern Video video; gb/system/000700 001750 001750 00000000000 12656700342 013607 5ustar00sergiosergio000000 000000 sfc/alt/smp/core/op_mov.b000664 001750 001750 00000010006 12651764221 016431 0ustar00sergiosergio000000 000000 mov_a_x(0x7d, a, x), mov_a_y(0xdd, a, y), mov_x_a(0x5d, x, a), mov_y_a(0xfd, y, a), mov_x_sp(0x9d, x, sp) { 1:op_io(); regs.$1 = regs.$2; regs.p.n = !!(regs.$1 & 0x80); regs.p.z = (regs.$1 == 0); } mov_sp_x(0xbd, sp, x) { 1:op_io(); regs.$1 = regs.$2; } mov_a_const(0xe8, a), mov_x_const(0xcd, x), mov_y_const(0x8d, y) { 1:regs.$1 = op_readpc(); regs.p.n = !!(regs.$1 & 0x80); regs.p.z = (regs.$1 == 0); } mov_a_ix(0xe6) { 1:op_io(); 2:regs.a = op_readdp(regs.x); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); } mov_a_ixinc(0xbf) { 1:op_io(); 2:regs.a = op_readdp(regs.x++); 3:op_io(); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); } mov_a_dp(0xe4, a), mov_x_dp(0xf8, x), mov_y_dp(0xeb, y) { 1:sp = op_readpc(); 2:regs.$1 = op_readdp(sp); regs.p.n = !!(regs.$1 & 0x80); regs.p.z = (regs.$1 == 0); } mov_a_dpx(0xf4, a, x), mov_x_dpy(0xf9, x, y), mov_y_dpx(0xfb, y, x) { 1:sp = op_readpc(); 2:op_io(); 3:regs.$1 = op_readdp(sp + regs.$2); regs.p.n = !!(regs.$1 & 0x80); regs.p.z = (regs.$1 == 0); } mov_a_addr(0xe5, a), mov_x_addr(0xe9, x), mov_y_addr(0xec, y) { 1:sp = op_readpc(); 2:sp |= op_readpc() << 8; 3:regs.$1 = op_readaddr(sp); regs.p.n = !!(regs.$1 & 0x80); regs.p.z = (regs.$1 == 0); } mov_a_addrx(0xf5, x), mov_a_addry(0xf6, y) { 1:sp = op_readpc(); 2:sp |= op_readpc() << 8; 3:op_io(); 4:regs.a = op_readaddr(sp + regs.$1); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); } mov_a_idpx(0xe7) { 1:dp = op_readpc() + regs.x; 2:op_io(); 3:sp = op_readdp(dp); 4:sp |= op_readdp(dp + 1) << 8; 5:regs.a = op_readaddr(sp); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); } mov_a_idpy(0xf7) { 1:dp = op_readpc(); 2:op_io(); 3:sp = op_readdp(dp); 4:sp |= op_readdp(dp + 1) << 8; 5:regs.a = op_readaddr(sp + regs.y); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); } mov_dp_dp(0xfa) { 1:sp = op_readpc(); 2:rd = op_readdp(sp); 3:dp = op_readpc(); 4:op_writedp(dp, rd); } mov_dp_const(0x8f) { 1:rd = op_readpc(); 2:dp = op_readpc(); 3:op_readdp(dp); 4:op_writedp(dp, rd); } mov_ix_a(0xc6) { 1:op_io(); 2:op_readdp(regs.x); 3:op_writedp(regs.x, regs.a); } mov_ixinc_a(0xaf) { 1:op_io(); 2:op_io(); 3:op_writedp(regs.x++, regs.a); } mov_dp_a(0xc4, a), mov_dp_x(0xd8, x), mov_dp_y(0xcb, y) { 1:dp = op_readpc(); 2:op_readdp(dp); 3:op_writedp(dp, regs.$1); } mov_dpx_a(0xd4, x, a), mov_dpy_x(0xd9, y, x), mov_dpx_y(0xdb, x, y) { 1:dp = op_readpc(); 2:op_io(); dp += regs.$1; 3:op_readdp(dp); 4:op_writedp(dp, regs.$2); } mov_addr_a(0xc5, a), mov_addr_x(0xc9, x), mov_addr_y(0xcc, y) { 1:dp = op_readpc(); 2:dp |= op_readpc() << 8; 3:op_readaddr(dp); 4:op_writeaddr(dp, regs.$1); } mov_addrx_a(0xd5, x), mov_addry_a(0xd6, y) { 1:dp = op_readpc(); 2:dp |= op_readpc() << 8; 3:op_io(); dp += regs.$1; 4:op_readaddr(dp); 5:op_writeaddr(dp, regs.a); } mov_idpx_a(0xc7) { 1:sp = op_readpc(); 2:op_io(); sp += regs.x; 3:dp = op_readdp(sp); 4:dp |= op_readdp(sp + 1) << 8; 5:op_readaddr(dp); 6:op_writeaddr(dp, regs.a); } mov_idpy_a(0xd7) { 1:sp = op_readpc(); 2:dp = op_readdp(sp); 3:dp |= op_readdp(sp + 1) << 8; 4:op_io(); dp += regs.y; 5:op_readaddr(dp); 6:op_writeaddr(dp, regs.a); } movw_ya_dp(0xba) { 1:sp = op_readpc(); 2:regs.a = op_readdp(sp); 3:op_io(); 4:regs.y = op_readdp(sp + 1); regs.p.n = !!(regs.ya & 0x8000); regs.p.z = (regs.ya == 0); } movw_dp_ya(0xda) { 1:dp = op_readpc(); 2:op_readdp(dp); 3:op_writedp(dp, regs.a); 4:op_writedp(dp + 1, regs.y); } mov1_c_bit(0xaa) { 1:sp = op_readpc(); 2:sp |= op_readpc() << 8; 3:bit = sp >> 13; sp &= 0x1fff; rd = op_readaddr(sp); regs.p.c = !!(rd & (1 << bit)); } mov1_bit_c(0xca) { 1:dp = op_readpc(); 2:dp |= op_readpc() << 8; 3:bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); if(regs.p.c)rd |= (1 << bit); else rd &= ~(1 << bit); 4:op_io(); 5:op_writeaddr(dp, rd); } out/.gitignore000664 001750 001750 00000000006 12651764221 014503 0ustar00sergiosergio000000 000000 higan processor/spc700/instructions.cpp000664 001750 001750 00000024307 12651764221 020221 0ustar00sergiosergio000000 000000 #define call (this->*op) template void SPC700::op_adjust(uint8& r) { op_io(); r = call(r); } template void SPC700::op_adjust_addr() { dp.l = op_readpc(); dp.h = op_readpc(); rd = op_read(dp); rd = call(rd); op_write(dp, rd); } template void SPC700::op_adjust_dp() { dp = op_readpc(); rd = op_readdp(dp); rd = call(rd); op_writedp(dp, rd); } void SPC700::op_adjust_dpw(signed n) { dp = op_readpc(); rd.w = op_readdp(dp) + n; op_writedp(dp++, rd.l); rd.h += op_readdp(dp); op_writedp(dp++, rd.h); regs.p.n = rd & 0x8000; regs.p.z = rd == 0; } template void SPC700::op_adjust_dpx() { dp = op_readpc(); op_io(); rd = op_readdp(dp + regs.x); rd = call(rd); op_writedp(dp + regs.x, rd); } void SPC700::op_branch(bool condition) { rd = op_readpc(); if(condition == false) return; op_io(); op_io(); regs.pc += (int8)rd; } void SPC700::op_branch_bit() { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((bool)(sp & (1 << (opcode >> 5))) == (bool)(opcode & 0x10)) return; op_io(); op_io(); regs.pc += (int8)rd; } void SPC700::op_pull(uint8& r) { op_io(); op_io(); r = op_readsp(); } void SPC700::op_push(uint8 r) { op_io(); op_io(); op_writesp(r); } template void SPC700::op_read_addr(uint8& r) { dp.l = op_readpc(); dp.h = op_readpc(); rd = op_read(dp); r = call(r, rd); } template void SPC700::op_read_addri(uint8& r) { dp.l = op_readpc(); dp.h = op_readpc(); op_io(); rd = op_read(dp + r); regs.a = call(regs.a, rd); } template void SPC700::op_read_const(uint8& r) { rd = op_readpc(); r = call(r, rd); } template void SPC700::op_read_dp(uint8& r) { dp = op_readpc(); rd = op_readdp(dp); r = call(r, rd); } template void SPC700::op_read_dpi(uint8& r, uint8& i) { dp = op_readpc(); op_io(); rd = op_readdp(dp + i); r = call(r, rd); } template void SPC700::op_read_dpw() { dp = op_readpc(); rd.l = op_readdp(dp++); if(op != &SPC700::op_cpw) op_io(); rd.h = op_readdp(dp++); regs.ya = call(regs.ya, rd); } template void SPC700::op_read_idpx() { dp = op_readpc() + regs.x; op_io(); sp.l = op_readdp(dp++); sp.h = op_readdp(dp++); rd = op_read(sp); regs.a = call(regs.a, rd); } template void SPC700::op_read_idpy() { dp = op_readpc(); op_io(); sp.l = op_readdp(dp++); sp.h = op_readdp(dp++); rd = op_read(sp + regs.y); regs.a = call(regs.a, rd); } template void SPC700::op_read_ix() { op_io(); rd = op_readdp(regs.x); regs.a = call(regs.a, rd); } void SPC700::op_set_addr_bit() { dp.l = op_readpc(); dp.h = op_readpc(); bit = dp >> 13; dp &= 0x1fff; rd = op_read(dp); switch(opcode >> 5) { case 0: //orc addr:bit case 1: //orc !addr:bit op_io(); regs.p.c |= (rd & (1 << bit)) ^ (bool)(opcode & 0x20); break; case 2: //and addr:bit case 3: //and !addr:bit regs.p.c &= (rd & (1 << bit)) ^ (bool)(opcode & 0x20); break; case 4: //eor addr:bit op_io(); regs.p.c ^= (bool)(rd & (1 << bit)); break; case 5: //ldc addr:bit regs.p.c = (rd & (1 << bit)); break; case 6: //stc addr:bit op_io(); rd = (rd & ~(1 << bit)) | (regs.p.c << bit); op_write(dp, rd); break; case 7: //not addr:bit rd ^= 1 << bit; op_write(dp, rd); break; } } void SPC700::op_set_bit() { dp = op_readpc(); rd = op_readdp(dp) & ~(1 << (opcode >> 5)); op_writedp(dp, rd | (!(opcode & 0x10) << (opcode >> 5))); } void SPC700::op_set_flag(bool& flag, bool data) { op_io(); if(&flag == ®s.p.i) op_io(); flag = data; } void SPC700::op_test_addr(bool set) { dp.l = op_readpc(); dp.h = op_readpc(); rd = op_read(dp); regs.p.n = (regs.a - rd) & 0x80; regs.p.z = (regs.a - rd) == 0; op_read(dp); op_write(dp, set ? rd | regs.a : rd & ~regs.a); } void SPC700::op_transfer(uint8& from, uint8& to) { op_io(); to = from; if(&to == ®s.s) return; regs.p.n = (to & 0x80); regs.p.z = (to == 0); } void SPC700::op_write_addr(uint8& r) { dp.l = op_readpc(); dp.h = op_readpc(); op_read(dp); op_write(dp, r); } void SPC700::op_write_addri(uint8& i) { dp.l = op_readpc(); dp.h = op_readpc(); op_io(); dp += i; op_read(dp); op_write(dp, regs.a); } void SPC700::op_write_dp(uint8& r) { dp = op_readpc(); op_readdp(dp); op_writedp(dp, r); } void SPC700::op_write_dpi(uint8& r, uint8& i) { dp = op_readpc() + i; op_io(); op_readdp(dp); op_writedp(dp, r); } template void SPC700::op_write_dp_const() { rd = op_readpc(); dp = op_readpc(); wr = op_readdp(dp); wr = call(wr, rd); op != &SPC700::op_cmp ? op_writedp(dp, wr) : op_io(); } template void SPC700::op_write_dp_dp() { sp = op_readpc(); rd = op_readdp(sp); dp = op_readpc(); if(op != &SPC700::op_st) wr = op_readdp(dp); wr = call(wr, rd); op != &SPC700::op_cmp ? op_writedp(dp, wr) : op_io(); } template void SPC700::op_write_ix_iy() { op_io(); rd = op_readdp(regs.y); wr = op_readdp(regs.x); wr = call(wr, rd); op != &SPC700::op_cmp ? op_writedp(regs.x, wr) : op_io(); } // void SPC700::op_bne_dp() { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if(regs.a == sp) return; op_io(); op_io(); regs.pc += (int8)rd; } void SPC700::op_bne_dpdec() { dp = op_readpc(); wr = op_readdp(dp); op_writedp(dp, --wr); rd = op_readpc(); if(wr == 0) return; op_io(); op_io(); regs.pc += (int8)rd; } void SPC700::op_bne_dpx() { dp = op_readpc(); op_io(); sp = op_readdp(dp + regs.x); rd = op_readpc(); op_io(); if(regs.a == sp) return; op_io(); op_io(); regs.pc += (int8)rd; } void SPC700::op_bne_ydec() { rd = op_readpc(); op_io(); op_io(); if(--regs.y == 0) return; op_io(); op_io(); regs.pc += (int8)rd; } void SPC700::op_brk() { rd.l = op_read(0xffde); rd.h = op_read(0xffdf); op_io(); op_io(); op_writesp(regs.pc.h); op_writesp(regs.pc.l); op_writesp(regs.p); regs.pc = rd; regs.p.b = 1; regs.p.i = 0; } void SPC700::op_clv() { op_io(); regs.p.v = 0; regs.p.h = 0; } void SPC700::op_cmc() { op_io(); op_io(); regs.p.c = !regs.p.c; } void SPC700::op_daa() { op_io(); op_io(); if(regs.p.c || (regs.a) > 0x99) { regs.a += 0x60; regs.p.c = 1; } if(regs.p.h || (regs.a & 15) > 0x09) { regs.a += 0x06; } regs.p.n = (regs.a & 0x80); regs.p.z = (regs.a == 0); } void SPC700::op_das() { op_io(); op_io(); if(!regs.p.c || (regs.a) > 0x99) { regs.a -= 0x60; regs.p.c = 0; } if(!regs.p.h || (regs.a & 15) > 0x09) { regs.a -= 0x06; } regs.p.n = (regs.a & 0x80); regs.p.z = (regs.a == 0); } void SPC700::op_div_ya_x() { op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); ya = regs.ya; //overflow set if quotient >= 256 regs.p.v = (regs.y >= regs.x); regs.p.h = ((regs.y & 15) >= (regs.x & 15)); if(regs.y < (regs.x << 1)) { //if quotient is <= 511 (will fit into 9-bit result) regs.a = ya / regs.x; regs.y = ya % regs.x; } else { //otherwise, the quotient won't fit into regs.p.v + regs.a //this emulates the odd behavior of the S-SMP in this case regs.a = 255 - (ya - (regs.x << 9)) / (256 - regs.x); regs.y = regs.x + (ya - (regs.x << 9)) % (256 - regs.x); } //result is set based on a (quotient) only regs.p.n = (regs.a & 0x80); regs.p.z = (regs.a == 0); } void SPC700::op_jmp_addr() { rd.l = op_readpc(); rd.h = op_readpc(); regs.pc = rd; } void SPC700::op_jmp_iaddrx() { dp.l = op_readpc(); dp.h = op_readpc(); op_io(); dp += regs.x; rd.l = op_read(dp++); rd.h = op_read(dp++); regs.pc = rd; } void SPC700::op_jsp_dp() { rd = op_readpc(); op_io(); op_io(); op_writesp(regs.pc.h); op_writesp(regs.pc.l); regs.pc = 0xff00 | rd; } void SPC700::op_jsr_addr() { rd.l = op_readpc(); rd.h = op_readpc(); op_io(); op_io(); op_io(); op_writesp(regs.pc.h); op_writesp(regs.pc.l); regs.pc = rd; } void SPC700::op_jst() { dp = 0xffde - ((opcode >> 4) << 1); rd.l = op_read(dp++); rd.h = op_read(dp++); op_io(); op_io(); op_io(); op_writesp(regs.pc.h); op_writesp(regs.pc.l); regs.pc = rd; } void SPC700::op_lda_ixinc() { op_io(); regs.a = op_readdp(regs.x++); op_io(); regs.p.n = regs.a & 0x80; regs.p.z = regs.a == 0; } void SPC700::op_mul_ya() { op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); ya = regs.y * regs.a; regs.a = ya; regs.y = ya >> 8; //result is set based on y (high-byte) only regs.p.n = (regs.y & 0x80); regs.p.z = (regs.y == 0); } void SPC700::op_nop() { op_io(); } void SPC700::op_plp() { op_io(); op_io(); regs.p = op_readsp(); } void SPC700::op_rti() { regs.p = op_readsp(); rd.l = op_readsp(); rd.h = op_readsp(); op_io(); op_io(); regs.pc = rd; } void SPC700::op_rts() { rd.l = op_readsp(); rd.h = op_readsp(); op_io(); op_io(); regs.pc = rd; } void SPC700::op_sta_idpx() { sp = op_readpc() + regs.x; op_io(); dp.l = op_readdp(sp++); dp.h = op_readdp(sp++); op_read(dp); op_write(dp, regs.a); } void SPC700::op_sta_idpy() { sp = op_readpc(); dp.l = op_readdp(sp++); dp.h = op_readdp(sp++); op_io(); dp += regs.y; op_read(dp); op_write(dp, regs.a); } void SPC700::op_sta_ix() { op_io(); op_readdp(regs.x); op_writedp(regs.x, regs.a); } void SPC700::op_sta_ixinc() { op_io(); op_io(); op_writedp(regs.x++, regs.a); } void SPC700::op_stw_dp() { dp = op_readpc(); op_readdp(dp); op_writedp(dp++, regs.a); op_writedp(dp++, regs.y); } void SPC700::op_wait() { while(true) { op_io(); op_io(); } } void SPC700::op_xcn() { op_io(); op_io(); op_io(); op_io(); regs.a = (regs.a >> 4) | (regs.a << 4); regs.p.n = regs.a & 0x80; regs.p.z = regs.a == 0; } #undef call processor/processor.hpp000664 001750 001750 00000000126 12651764221 016456 0ustar00sergiosergio000000 000000 #ifndef PROCESSOR_HPP #define PROCESSOR_HPP #include #endif target-ethos/settings/hotkey.cpp000664 001750 001750 00000003446 12651764221 020174 0ustar00sergiosergio000000 000000 HotkeySettings* hotkeySettings = nullptr; HotkeySettings::HotkeySettings() { inputList.setHeaderText({"Name", "Mapping"}); inputList.setHeaderVisible(); eraseButton.setText("Erase"); append(inputList, {~0, ~0}, 5); append(controlLayout, {~0, 0}); controlLayout.append(spacer, {~0, 0}); controlLayout.append(eraseButton, {80, 0}); inputList.onChange = {&HotkeySettings::synchronize, this}; inputList.onActivate = {&HotkeySettings::assignInput, this}; eraseButton.onActivate = {&HotkeySettings::eraseInput, this}; for(auto& hotkey : inputManager->hotkeyMap) inputList.append({"", ""}); refresh(); } void HotkeySettings::synchronize() { eraseButton.setEnabled(inputList.selected()); } void HotkeySettings::refresh() { unsigned index = 0; for(auto& hotkey : inputManager->hotkeyMap) { string mapping = inputManager->sanitize(hotkey->mapping, " and "); inputList.setText(index++, {hotkey->name, mapping}); } synchronize(); } void HotkeySettings::eraseInput() { activeInput = inputManager->hotkeyMap[inputList.selection()]; inputEvent(hidNull, 0, 0, 0, 1); } void HotkeySettings::assignInput() { activeInput = inputManager->hotkeyMap[inputList.selection()]; settings->setStatusText({"Set assignment for [", activeInput->name, "] ..."}); settings->layout.setEnabled(false); setEnabled(false); } void HotkeySettings::inputEvent(HID::Device& device, unsigned group, unsigned input, int16_t oldValue, int16_t newValue) { if(activeInput == nullptr) return; if(device.isMouse()) return; if(device.isJoypad() && group == HID::Joypad::GroupID::Axis) return; if(activeInput->bind(device, group, input, oldValue, newValue) == false) return; activeInput = nullptr; settings->setStatusText(""); settings->layout.setEnabled(true); setEnabled(true); refresh(); } sfc/alt/smp/core/opcycle_rmw.cpp000664 001750 001750 00000017137 12651764221 020032 0ustar00sergiosergio000000 000000 case 0xbc: { switch(opcode_cycle++) { case 1: op_io(); regs.a = op_inc(regs.a); opcode_cycle = 0; break; } break; } case 0x3d: { switch(opcode_cycle++) { case 1: op_io(); regs.x = op_inc(regs.x); opcode_cycle = 0; break; } break; } case 0xfc: { switch(opcode_cycle++) { case 1: op_io(); regs.y = op_inc(regs.y); opcode_cycle = 0; break; } break; } case 0x9c: { switch(opcode_cycle++) { case 1: op_io(); regs.a = op_dec(regs.a); opcode_cycle = 0; break; } break; } case 0x1d: { switch(opcode_cycle++) { case 1: op_io(); regs.x = op_dec(regs.x); opcode_cycle = 0; break; } break; } case 0xdc: { switch(opcode_cycle++) { case 1: op_io(); regs.y = op_dec(regs.y); opcode_cycle = 0; break; } break; } case 0x1c: { switch(opcode_cycle++) { case 1: op_io(); regs.a = op_asl(regs.a); opcode_cycle = 0; break; } break; } case 0x5c: { switch(opcode_cycle++) { case 1: op_io(); regs.a = op_lsr(regs.a); opcode_cycle = 0; break; } break; } case 0x3c: { switch(opcode_cycle++) { case 1: op_io(); regs.a = op_rol(regs.a); opcode_cycle = 0; break; } break; } case 0x7c: { switch(opcode_cycle++) { case 1: op_io(); regs.a = op_ror(regs.a); opcode_cycle = 0; break; } break; } case 0xab: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd = op_inc(rd); op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x8b: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd = op_dec(rd); op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x0b: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd = op_asl(rd); op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x4b: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd = op_lsr(rd); op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x2b: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd = op_rol(rd); op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x6b: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd = op_ror(rd); op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0xbb: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: rd = op_readdp(dp + regs.x); break; case 4: rd = op_inc(rd); op_writedp(dp + regs.x, rd); opcode_cycle = 0; break; } break; } case 0x9b: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: rd = op_readdp(dp + regs.x); break; case 4: rd = op_dec(rd); op_writedp(dp + regs.x, rd); opcode_cycle = 0; break; } break; } case 0x1b: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: rd = op_readdp(dp + regs.x); break; case 4: rd = op_asl(rd); op_writedp(dp + regs.x, rd); opcode_cycle = 0; break; } break; } case 0x5b: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: rd = op_readdp(dp + regs.x); break; case 4: rd = op_lsr(rd); op_writedp(dp + regs.x, rd); opcode_cycle = 0; break; } break; } case 0x3b: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: rd = op_readdp(dp + regs.x); break; case 4: rd = op_rol(rd); op_writedp(dp + regs.x, rd); opcode_cycle = 0; break; } break; } case 0x7b: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: rd = op_readdp(dp + regs.x); break; case 4: rd = op_ror(rd); op_writedp(dp + regs.x, rd); opcode_cycle = 0; break; } break; } case 0xac: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); break; case 4: rd = op_inc(rd); op_writeaddr(dp, rd); opcode_cycle = 0; break; } break; } case 0x8c: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); break; case 4: rd = op_dec(rd); op_writeaddr(dp, rd); opcode_cycle = 0; break; } break; } case 0x0c: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); break; case 4: rd = op_asl(rd); op_writeaddr(dp, rd); opcode_cycle = 0; break; } break; } case 0x4c: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); break; case 4: rd = op_lsr(rd); op_writeaddr(dp, rd); opcode_cycle = 0; break; } break; } case 0x2c: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); break; case 4: rd = op_rol(rd); op_writeaddr(dp, rd); opcode_cycle = 0; break; } break; } case 0x6c: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); break; case 4: rd = op_ror(rd); op_writeaddr(dp, rd); opcode_cycle = 0; break; } break; } case 0x0e: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); regs.p.n = !!((regs.a - rd) & 0x80); regs.p.z = ((regs.a - rd) == 0); break; case 4: op_readaddr(dp); break; case 5: op_writeaddr(dp, rd | regs.a); opcode_cycle = 0; break; } break; } case 0x4e: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); regs.p.n = !!((regs.a - rd) & 0x80); regs.p.z = ((regs.a - rd) == 0); break; case 4: op_readaddr(dp); break; case 5: op_writeaddr(dp, rd &~ regs.a); opcode_cycle = 0; break; } break; } case 0x3a: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); rd++; break; case 3: op_writedp(dp++, rd); break; case 4: rd += op_readdp(dp) << 8; break; case 5: op_writedp(dp, rd >> 8); regs.p.n = !!(rd & 0x8000); regs.p.z = (rd == 0); opcode_cycle = 0; break; } break; } case 0x1a: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); rd--; break; case 3: op_writedp(dp++, rd); break; case 4: rd += op_readdp(dp) << 8; break; case 5: op_writedp(dp, rd >> 8); regs.p.n = !!(rd & 0x8000); regs.p.z = (rd == 0); opcode_cycle = 0; break; } break; } fc/ppu/serialization.cpp000664 001750 001750 00000003314 12651764221 016466 0ustar00sergiosergio000000 000000 void PPU::serialize(serializer& s) { Thread::serialize(s); s.integer(status.mdr); s.integer(status.field); s.integer(status.lx); s.integer(status.ly); s.integer(status.bus_data); s.integer(status.address_latch); s.integer(status.vaddr); s.integer(status.taddr); s.integer(status.xaddr); s.integer(status.nmi_hold); s.integer(status.nmi_flag); s.integer(status.nmi_enable); s.integer(status.master_select); s.integer(status.sprite_size); s.integer(status.bg_addr); s.integer(status.sprite_addr); s.integer(status.vram_increment); s.integer(status.emphasis); s.integer(status.sprite_enable); s.integer(status.bg_enable); s.integer(status.sprite_edge_enable); s.integer(status.bg_edge_enable); s.integer(status.grayscale); s.integer(status.sprite_zero_hit); s.integer(status.sprite_overflow); s.integer(status.oam_addr); s.integer(raster.nametable); s.integer(raster.attribute); s.integer(raster.tiledatalo); s.integer(raster.tiledatahi); s.integer(raster.oam_iterator); s.integer(raster.oam_counter); for(unsigned n = 0; n < 8; n++) { s.integer(raster.oam[n].id); s.integer(raster.oam[n].y); s.integer(raster.oam[n].tile); s.integer(raster.oam[n].attr); s.integer(raster.oam[n].x); s.integer(raster.oam[n].tiledatalo); s.integer(raster.oam[n].tiledatahi); } for(unsigned n = 0; n < 8; n++) { s.integer(raster.soam[n].id); s.integer(raster.soam[n].y); s.integer(raster.soam[n].tile); s.integer(raster.soam[n].attr); s.integer(raster.soam[n].x); s.integer(raster.soam[n].tiledatalo); s.integer(raster.soam[n].tiledatahi); } s.array(buffer); s.array(ciram); s.array(cgram); s.array(oam); } sfc/chip/spc7110/serialization.cpp000664 001750 001750 00000002200 12651764221 020057 0ustar00sergiosergio000000 000000 #ifdef SPC7110_CPP void SPC7110::serialize(serializer& s) { s.array(ram.data(), ram.size()); s.integer(r4801); s.integer(r4802); s.integer(r4803); s.integer(r4804); s.integer(r4805); s.integer(r4806); s.integer(r4807); s.integer(r4809); s.integer(r480a); s.integer(r480b); s.integer(r480c); s.integer(dcu_pending); s.integer(dcu_mode); s.integer(dcu_addr); s.integer(dcu_offset); s.array(dcu_tile); decompressor->serialize(s); s.integer(r4810); s.integer(r4811); s.integer(r4812); s.integer(r4813); s.integer(r4814); s.integer(r4815); s.integer(r4816); s.integer(r4817); s.integer(r4818); s.integer(r481a); s.integer(r4820); s.integer(r4821); s.integer(r4822); s.integer(r4823); s.integer(r4824); s.integer(r4825); s.integer(r4826); s.integer(r4827); s.integer(r4828); s.integer(r4829); s.integer(r482a); s.integer(r482b); s.integer(r482c); s.integer(r482d); s.integer(r482e); s.integer(r482f); s.integer(mul_pending); s.integer(div_pending); s.integer(r4830); s.integer(r4831); s.integer(r4832); s.integer(r4833); s.integer(r4834); } #endif gba/system/bios.cpp000664 001750 001750 00000001147 12651764221 015430 0ustar00sergiosergio000000 000000 uint32 BIOS::read(uint32 addr, uint32 size) { //GBA BIOS is read-protected; only the BIOS itself can read its own memory //when accessed elsewhere; this returns the last value read by the BIOS program if(cpu.r(15) >= 0x02000000) return mdr; if(size == Word) return mdr = read(addr &~ 2, Half) << 0 | read(addr | 2, Half) << 16; if(size == Half) return mdr = read(addr &~ 1, Byte) << 0 | read(addr | 1, Byte) << 8; return mdr = data[addr & 0x3fff]; } void BIOS::write(uint32 addr, uint32 size, uint32 word) { } BIOS::BIOS() { data = new uint8[size = 16384](); } BIOS::~BIOS() { delete[] data; } gb/system/system.hpp000664 001750 001750 00000001664 12651764221 015670 0ustar00sergiosergio000000 000000 class Interface; enum class Input : unsigned { Up, Down, Left, Right, B, A, Select, Start, }; struct System { enum class Revision : unsigned { GameBoy, SuperGameBoy, GameBoyColor, } revision; inline bool dmg() const { return revision == Revision::GameBoy; } inline bool sgb() const { return revision == Revision::SuperGameBoy; } inline bool cgb() const { return revision == Revision::GameBoyColor; } struct BootROM { uint8 dmg[ 256]; uint8 sgb[ 256]; uint8 cgb[2048]; } bootROM; void run(); void runtosave(); void runthreadtosave(); void init(); void load(Revision); void power(); unsigned clocks_executed; //serialization.cpp unsigned serialize_size; serializer serialize(); bool unserialize(serializer&); void serialize(serializer&); void serialize_all(serializer&); void serialize_init(); System(); }; #include extern System system; gb/apu/wave/wave.hpp000664 001750 001750 00000000623 12651764221 015503 0ustar00sergiosergio000000 000000 struct Wave { bool enable; bool dac_enable; unsigned volume_shift; uint11 frequency; bool counter; uint8 pattern[32]; int16 output; uint8 length; unsigned period; uint5 pattern_offset; uint4 pattern_sample; void run(); void clock_length(); void write(unsigned r, uint8 data); void write_pattern(unsigned p, uint8 data); void power(); void serialize(serializer&); }; sfc/chip/armdsp/armdsp.cpp000664 001750 001750 00000004510 12651764221 016666 0ustar00sergiosergio000000 000000 #include #define ARMDSP_CPP namespace SuperFamicom { #include "memory.cpp" #include "serialization.cpp" ArmDSP armdsp; void ArmDSP::Enter() { armdsp.enter(); } void ArmDSP::enter() { //reset hold delay while(bridge.reset) { step(1); continue; } //reset sequence delay if(bridge.ready == false) { step(65536); bridge.ready = true; } while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(crash) { print(disassemble_arm_instruction(pipeline.execute.address), "\n"); print(disassemble_registers(), "\n"); print("Executed: ", instructions, "\n"); while(true) step(frequency); } arm_step(); } } void ArmDSP::step(unsigned clocks) { if(bridge.timer) --bridge.timer; Coprocessor::step(clocks); synchronize_cpu(); } //MMIO: $00-3f|80-bf:3800-38ff //3800-3807 mirrored throughout //a0 ignored uint8 ArmDSP::mmio_read(unsigned addr) { cpu.synchronize_coprocessors(); uint8 data = 0x00; addr &= 0xff06; if(addr == 0x3800) { if(bridge.armtocpu.ready) { bridge.armtocpu.ready = false; data = bridge.armtocpu.data; } } if(addr == 0x3802) { bridge.signal = false; } if(addr == 0x3804) { data = bridge.status(); } return data; } void ArmDSP::mmio_write(unsigned addr, uint8 data) { cpu.synchronize_coprocessors(); addr &= 0xff06; if(addr == 0x3802) { bridge.cputoarm.ready = true; bridge.cputoarm.data = data; } if(addr == 0x3804) { data &= 1; if(!bridge.reset && data) arm_reset(); bridge.reset = data; } } void ArmDSP::init() { } void ArmDSP::load() { } void ArmDSP::unload() { } void ArmDSP::power() { for(unsigned n = 0; n < 16 * 1024; n++) programRAM[n] = random(0x00); } void ArmDSP::reset() { bridge.reset = false; arm_reset(); } void ArmDSP::arm_reset() { create(ArmDSP::Enter, 21477272); ARM::power(); bridge.ready = false; bridge.signal = false; bridge.timer = 0; bridge.timerlatch = 0; bridge.cputoarm.ready = false; bridge.armtocpu.ready = false; } ArmDSP::ArmDSP() { programROM = new uint8[128 * 1024]; dataROM = new uint8[32 * 1024]; programRAM = new uint8[16 * 1024]; } ArmDSP::~ArmDSP() { delete[] programROM; delete[] dataROM; delete[] programRAM; } } processor/spc700/memory.hpp000664 001750 001750 00000000646 12651764221 016772 0ustar00sergiosergio000000 000000 alwaysinline uint8 op_readpc() { return op_read(regs.pc++); } alwaysinline uint8 op_readsp() { return op_read(0x0100 | ++regs.s); } alwaysinline void op_writesp(uint8 data) { return op_write(0x0100 | regs.s--, data); } alwaysinline uint8 op_readdp(uint8 addr) { return op_read((regs.p.p << 8) + addr); } alwaysinline void op_writedp(uint8 addr, uint8 data) { return op_write((regs.p.p << 8) + addr, data); } ruby/input/keyboard/000700 001750 001750 00000000000 12656700342 015613 5ustar00sergiosergio000000 000000 sfc/alt/ppu-balanced/mmio/000700 001750 001750 00000000000 12656700342 016522 5ustar00sergiosergio000000 000000 sfc/slot/sufamiturbo/sufamiturbo.hpp000664 001750 001750 00000000330 12651764221 021051 0ustar00sergiosergio000000 000000 struct SufamiTurboCartridge { MappedRAM rom; MappedRAM ram; void load(); void unload(); void serialize(serializer&); }; extern SufamiTurboCartridge sufamiturboA; extern SufamiTurboCartridge sufamiturboB; sfc/controller/mouse/mouse.cpp000664 001750 001750 00000004136 12651764221 017636 0ustar00sergiosergio000000 000000 #ifdef CONTROLLER_CPP uint2 Mouse::data() { if(latched == 1) { speed = (speed + 1) % 3; return 0; } if(counter >= 32) return 1; switch(counter++) { default: case 0: return 0; case 1: return 0; case 2: return 0; case 3: return 0; case 4: return 0; case 5: return 0; case 6: return 0; case 7: return 0; case 8: return r; case 9: return l; case 10: return (speed >> 1) & 1; case 11: return (speed >> 0) & 1; case 12: return 0; //signature case 13: return 0; // || case 14: return 0; // || case 15: return 1; // || case 16: return dy; case 17: return (y >> 6) & 1; case 18: return (y >> 5) & 1; case 19: return (y >> 4) & 1; case 20: return (y >> 3) & 1; case 21: return (y >> 2) & 1; case 22: return (y >> 1) & 1; case 23: return (y >> 0) & 1; case 24: return dx; case 25: return (x >> 6) & 1; case 26: return (x >> 5) & 1; case 27: return (x >> 4) & 1; case 28: return (x >> 3) & 1; case 29: return (x >> 2) & 1; case 30: return (x >> 1) & 1; case 31: return (x >> 0) & 1; } } void Mouse::latch(bool data) { if(latched == data) return; latched = data; counter = 0; x = interface->inputPoll(port, (unsigned)Input::Device::Mouse, (unsigned)Input::MouseID::X); //-n = left, 0 = center, +n = right y = interface->inputPoll(port, (unsigned)Input::Device::Mouse, (unsigned)Input::MouseID::Y); //-n = up, 0 = center, +n = down l = interface->inputPoll(port, (unsigned)Input::Device::Mouse, (unsigned)Input::MouseID::Left ); r = interface->inputPoll(port, (unsigned)Input::Device::Mouse, (unsigned)Input::MouseID::Right); dx = x < 0; //0 = right, 1 = left dy = y < 0; //0 = down, 1 = up if(x < 0) x = -x; //abs(position_x) if(y < 0) y = -y; //abs(position_y) double multiplier = 1.0; if(speed == 1) multiplier = 1.5; if(speed == 2) multiplier = 2.0; x = (double)x * multiplier; y = (double)y * multiplier; x = min(127, x); y = min(127, y); } Mouse::Mouse(bool port) : Controller(port) { latched = 0; counter = 0; speed = 0; x = 0; y = 0; dx = 0; dy = 0; l = 0; r = 0; } #endif data/higan.desktop000664 001750 001750 00000000201 12651764221 015273 0ustar00sergiosergio000000 000000 [Desktop Entry] Name=higan Comment=SNES emulator Exec=higan Icon=higan Terminal=false Type=Application Categories=Game;Emulator; phoenix/cocoa/header.hpp000664 001750 001750 00000000136 12651764221 016407 0ustar00sergiosergio000000 000000 #define decimal CocoaDecimal #import #import #undef decimal phoenix/core/state.hpp000664 001750 001750 00000007506 12651764221 016153 0ustar00sergiosergio000000 000000 struct Application::State { string name; bool quit = false; } applicationState; struct Timer::State { bool enabled = false; unsigned interval = 0; }; struct BrowserWindow::State { lstring filters; Window* parent = nullptr; string path; string title; }; struct MessageWindow::State { MessageWindow::Buttons buttons = MessageWindow::Buttons::Ok; Window* parent = nullptr; string text; string title; }; struct Window::State { bool backgroundColorOverride = false; Color backgroundColor = {0, 0, 0, 255}; bool droppable = false; bool fullScreen = false; Geometry geometry = {128, 128, 256, 256}; group layout; group menu; string menuFont; bool menuVisible = false; bool modal = false; bool resizable = true; string statusFont; string statusText; bool statusVisible = false; string title; bool visible = false; group widget; string widgetFont; }; struct Action::State { bool enabled = true; Menu* menu = nullptr; bool visible = true; Window* window = nullptr; }; struct Menu::State { group action; nall::image image; string text; }; struct Item::State { nall::image image; string text; }; struct CheckItem::State { bool checked = false; string text; }; struct RadioItem::State { bool checked = true; nall::group group; string text; }; struct Sizable::State { bool enabled = true; Sizable* parent = nullptr; bool visible = true; Window* window = nullptr; }; struct Layout::State { Widget* widget = nullptr; unsigned widgetSelection = 0; }; struct Widget::State { bool abstract = false; string font; Geometry geometry = {0, 0, 0, 0}; }; struct Button::State { nall::image image; Orientation orientation = Orientation::Horizontal; string text; }; struct Canvas::State { Color color; uint32_t* data = nullptr; bool droppable = false; vector gradient = {{}, {}, {}, {}}; nall::image image; Canvas::Mode mode = Canvas::Mode::Color; unsigned width = 0; unsigned height = 0; }; struct CheckButton::State { bool checked = false; nall::image image; Orientation orientation = Orientation::Horizontal; string text; }; struct CheckLabel::State { bool checked = false; string text; }; struct ComboButton::State { unsigned selection = 0; vector text; }; struct Console::State { }; struct Frame::State { Layout* layout = nullptr; string text; }; struct HexEdit::State { unsigned columns = 16; unsigned length = 0; unsigned offset = 0; unsigned rows = 16; }; struct HorizontalScroller::State { unsigned length = 101; unsigned position = 0; }; struct HorizontalSlider::State { unsigned length = 101; unsigned position = 0; }; struct Label::State { string text; }; struct LineEdit::State { bool editable = true; string text; }; struct ListView::State { bool checkable = false; vector checked; lstring headerText; bool headerVisible = false; vector> image; bool selected = false; unsigned selection = 0; vector text; }; struct ProgressBar::State { unsigned position = 0; }; struct RadioButton::State { bool checked = true; nall::group group; nall::image image; Orientation orientation = Orientation::Horizontal; string text; }; struct RadioLabel::State { bool checked = true; nall::group group; string text; }; struct TabFrame::State { vector image; vector layout; unsigned selection = 0; lstring text; }; struct TextEdit::State { unsigned cursorPosition = 0; bool editable = true; string text; bool wordWrap = true; }; struct VerticalScroller::State { unsigned length = 101; unsigned position = 0; }; struct VerticalSlider::State { unsigned length = 101; unsigned position = 0; }; struct Viewport::State { bool droppable = false; }; emulator/000700 001750 001750 00000000000 12656700342 013523 5ustar00sergiosergio000000 000000 processor/arm/registers.cpp000664 001750 001750 00000003534 12651764221 017226 0ustar00sergiosergio000000 000000 #ifdef PROCESSOR_ARM_HPP void ARM::Processor::power() { r0 = r1 = r2 = r3 = r4 = r5 = r6 = r7 = 0; usr.r8 = usr.r9 = usr.r10 = usr.r11 = usr.r12 = usr.sp = usr.lr = 0; fiq.r8 = fiq.r9 = fiq.r10 = fiq.r11 = fiq.r12 = fiq.sp = fiq.lr = 0; irq.sp = irq.lr = 0; svc.sp = svc.lr = 0; abt.sp = abt.lr = 0; und.sp = und.lr = 0; pc = 0; carryout = false; sequential = false; irqline = false; cpsr = 0; spsr = nullptr; fiq.spsr = 0; irq.spsr = 0; svc.spsr = 0; abt.spsr = 0; und.spsr = 0; r[0] = &r0; r[1] = &r1; r[2] = &r2; r[3] = &r3; r[4] = &r4; r[5] = &r5; r[6] = &r6; r[7] = &r7; r[15] = &pc; } void ARM::Processor::setMode(Mode mode) { cpsr.m = 0x10 | (unsigned)mode; if(mode == Mode::FIQ) { r[ 8] = &fiq.r8; r[ 9] = &fiq.r9; r[10] = &fiq.r10; r[11] = &fiq.r11; r[12] = &fiq.r12; } else { r[ 8] = &usr.r8; r[ 9] = &usr.r9; r[10] = &usr.r10; r[11] = &usr.r11; r[12] = &usr.r12; } switch(mode) { case Mode::FIQ: r[13] = &fiq.sp; r[14] = &fiq.lr; spsr = &fiq.spsr; break; case Mode::IRQ: r[13] = &irq.sp; r[14] = &irq.lr; spsr = &irq.spsr; break; case Mode::SVC: r[13] = &svc.sp; r[14] = &svc.lr; spsr = &svc.spsr; break; case Mode::ABT: r[13] = &abt.sp; r[14] = &abt.lr; spsr = &abt.spsr; break; case Mode::UND: r[13] = &und.sp; r[14] = &und.lr; spsr = &und.spsr; break; default: r[13] = &usr.sp; r[14] = &usr.lr; spsr = nullptr; break; } } void ARM::pipeline_step() { pipeline.execute = pipeline.decode; pipeline.decode = pipeline.fetch; if(cpsr().t == 0) { r(15).data += 4; pipeline.fetch.address = r(15) & ~3; pipeline.fetch.instruction = read(pipeline.fetch.address, Word); } else { r(15).data += 2; pipeline.fetch.address = r(15) & ~1; pipeline.fetch.instruction = read(pipeline.fetch.address, Half); } } #endif nall/filemap.hpp000664 001750 001750 00000011514 12651764221 014766 0ustar00sergiosergio000000 000000 #ifndef NALL_FILEMAP_HPP #define NALL_FILEMAP_HPP #include #include #include #include #include #if defined(_WIN32) #include #else #include #include #include #include #include #endif namespace nall { struct filemap { enum class mode : unsigned { read, write, readwrite, writeread }; explicit operator bool() const { return open(); } bool open() const { return p_open(); } bool open(const string& filename, mode mode_) { return p_open(filename, mode_); } void close() { return p_close(); } unsigned size() const { return p_size; } uint8_t* data() { return p_handle; } const uint8_t* data() const { return p_handle; } filemap() { p_ctor(); } filemap(const string& filename, mode mode_) { p_ctor(); p_open(filename, mode_); } ~filemap() { p_dtor(); } private: uint8_t *p_handle = nullptr; unsigned p_size = 0; #if defined(_WIN32) //============= //MapViewOfFile //============= HANDLE p_filehandle, p_maphandle; bool p_open() const { return p_handle; } bool p_open(const string& filename, mode mode_) { if(file::exists(filename) && file::size(filename) == 0) { p_handle = nullptr; p_size = 0; return true; } int desired_access, creation_disposition, flprotect, map_access; switch(mode_) { default: return false; case mode::read: desired_access = GENERIC_READ; creation_disposition = OPEN_EXISTING; flprotect = PAGE_READONLY; map_access = FILE_MAP_READ; break; case mode::write: //write access requires read access desired_access = GENERIC_WRITE; creation_disposition = CREATE_ALWAYS; flprotect = PAGE_READWRITE; map_access = FILE_MAP_ALL_ACCESS; break; case mode::readwrite: desired_access = GENERIC_READ | GENERIC_WRITE; creation_disposition = OPEN_EXISTING; flprotect = PAGE_READWRITE; map_access = FILE_MAP_ALL_ACCESS; break; case mode::writeread: desired_access = GENERIC_READ | GENERIC_WRITE; creation_disposition = CREATE_NEW; flprotect = PAGE_READWRITE; map_access = FILE_MAP_ALL_ACCESS; break; } p_filehandle = CreateFileW(utf16_t(filename), desired_access, FILE_SHARE_READ, nullptr, creation_disposition, FILE_ATTRIBUTE_NORMAL, nullptr); if(p_filehandle == INVALID_HANDLE_VALUE) return false; p_size = GetFileSize(p_filehandle, nullptr); p_maphandle = CreateFileMapping(p_filehandle, nullptr, flprotect, 0, p_size, nullptr); if(p_maphandle == INVALID_HANDLE_VALUE) { CloseHandle(p_filehandle); p_filehandle = INVALID_HANDLE_VALUE; return false; } p_handle = (uint8_t*)MapViewOfFile(p_maphandle, map_access, 0, 0, p_size); return p_handle; } void p_close() { if(p_handle) { UnmapViewOfFile(p_handle); p_handle = nullptr; } if(p_maphandle != INVALID_HANDLE_VALUE) { CloseHandle(p_maphandle); p_maphandle = INVALID_HANDLE_VALUE; } if(p_filehandle != INVALID_HANDLE_VALUE) { CloseHandle(p_filehandle); p_filehandle = INVALID_HANDLE_VALUE; } } void p_ctor() { p_filehandle = INVALID_HANDLE_VALUE; p_maphandle = INVALID_HANDLE_VALUE; } void p_dtor() { close(); } #else //==== //mmap //==== int p_fd; bool p_open() const { return p_handle; } bool p_open(const string& filename, mode mode_) { if(file::exists(filename) && file::size(filename) == 0) { p_handle = nullptr; p_size = 0; return true; } int open_flags, mmap_flags; switch(mode_) { default: return false; case mode::read: open_flags = O_RDONLY; mmap_flags = PROT_READ; break; case mode::write: open_flags = O_RDWR | O_CREAT; //mmap() requires read access mmap_flags = PROT_WRITE; break; case mode::readwrite: open_flags = O_RDWR; mmap_flags = PROT_READ | PROT_WRITE; break; case mode::writeread: open_flags = O_RDWR | O_CREAT; mmap_flags = PROT_READ | PROT_WRITE; break; } p_fd = ::open(filename, open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); if(p_fd < 0) return false; struct stat p_stat; fstat(p_fd, &p_stat); p_size = p_stat.st_size; p_handle = (uint8_t*)mmap(nullptr, p_size, mmap_flags, MAP_SHARED, p_fd, 0); if(p_handle == MAP_FAILED) { p_handle = nullptr; ::close(p_fd); p_fd = -1; return false; } return p_handle; } void p_close() { if(p_handle) { munmap(p_handle, p_size); p_handle = nullptr; } if(p_fd >= 0) { ::close(p_fd); p_fd = -1; } } void p_ctor() { p_fd = -1; } void p_dtor() { p_close(); } #endif }; } #endif phoenix/windows/widget/radio-label.cpp000664 001750 001750 00000002140 12651764221 021213 0ustar00sergiosergio000000 000000 namespace phoenix { Size pRadioLabel::minimumSize() { Size size = pFont::size(hfont, radioLabel.state.text); return {size.width + 20, size.height + 4}; } void pRadioLabel::setChecked() { for(auto& item : radioLabel.state.group) { SendMessage(item.p.hwnd, BM_SETCHECK, (WPARAM)(&item == &radioLabel), 0); } } void pRadioLabel::setGroup(const group& group) { } void pRadioLabel::setText(string text) { SetWindowText(hwnd, utf16_t(text)); } void pRadioLabel::constructor() { hwnd = CreateWindow( L"BUTTON", L"", WS_CHILD | WS_TABSTOP | BS_RADIOBUTTON, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&radioLabel); setDefaultFont(); if(radioLabel.state.checked) setChecked(); setText(radioLabel.state.text); synchronize(); } void pRadioLabel::destructor() { DestroyWindow(hwnd); } void pRadioLabel::orphan() { destructor(); constructor(); } void pRadioLabel::onActivate() { if(radioLabel.state.checked) return; radioLabel.setChecked(); if(radioLabel.onActivate) radioLabel.onActivate(); } } processor/lr35902/lr35902.hpp000664 001750 001750 00000007744 12651764221 016514 0ustar00sergiosergio000000 000000 #ifndef PROCESSOR_LR35902_HPP #define PROCESSOR_LR35902_HPP namespace Processor { //Sharp LR35902 (Game Boy Z80-derivative) struct LR35902 { #include "registers.hpp" virtual void op_io() = 0; virtual uint8 op_read(uint16 addr) = 0; virtual void op_write(uint16 addr, uint8 data) = 0; virtual bool stop() = 0; virtual uint8 debugger_read(uint16 addr) { return 0u; } void power(); void exec(); void exec_cb(); void serialize(serializer&); privileged: void op_xx(); void op_cb(); //8-bit load commands template void op_ld_r_r(); template void op_ld_r_n(); template void op_ld_r_hl(); template void op_ld_hl_r(); void op_ld_hl_n(); template void op_ld_a_rr(); void op_ld_a_nn(); template void op_ld_rr_a(); void op_ld_nn_a(); void op_ld_a_ffn(); void op_ld_ffn_a(); void op_ld_a_ffc(); void op_ld_ffc_a(); void op_ldi_hl_a(); void op_ldi_a_hl(); void op_ldd_hl_a(); void op_ldd_a_hl(); //16-bit load commands template void op_ld_rr_nn(); void op_ld_nn_sp(); void op_ld_sp_hl(); template void op_push_rr(); template void op_pop_rr(); //8-bit arithmetic commands void opi_add_a(uint8 x); template void op_add_a_r(); void op_add_a_n(); void op_add_a_hl(); void opi_adc_a(uint8 x); template void op_adc_a_r(); void op_adc_a_n(); void op_adc_a_hl(); void opi_sub_a(uint8 x); template void op_sub_a_r(); void op_sub_a_n(); void op_sub_a_hl(); void opi_sbc_a(uint8 x); template void op_sbc_a_r(); void op_sbc_a_n(); void op_sbc_a_hl(); void opi_and_a(uint8 x); template void op_and_a_r(); void op_and_a_n(); void op_and_a_hl(); void opi_xor_a(uint8 x); template void op_xor_a_r(); void op_xor_a_n(); void op_xor_a_hl(); void opi_or_a(uint8 x); template void op_or_a_r(); void op_or_a_n(); void op_or_a_hl(); void opi_cp_a(uint8 x); template void op_cp_a_r(); void op_cp_a_n(); void op_cp_a_hl(); template void op_inc_r(); void op_inc_hl(); template void op_dec_r(); void op_dec_hl(); void op_daa(); void op_cpl(); //16-bit arithmetic commands template void op_add_hl_rr(); template void op_inc_rr(); template void op_dec_rr(); void op_add_sp_n(); void op_ld_hl_sp_n(); //rotate/shift commands void op_rlca(); void op_rla(); void op_rrca(); void op_rra(); template void op_rlc_r(); void op_rlc_hl(); template void op_rl_r(); void op_rl_hl(); template void op_rrc_r(); void op_rrc_hl(); template void op_rr_r(); void op_rr_hl(); template void op_sla_r(); void op_sla_hl(); template void op_swap_r(); void op_swap_hl(); template void op_sra_r(); void op_sra_hl(); template void op_srl_r(); void op_srl_hl(); //single-bit commands template void op_bit_n_r(); template void op_bit_n_hl(); template void op_set_n_r(); template void op_set_n_hl(); template void op_res_n_r(); template void op_res_n_hl(); //control commands void op_ccf(); void op_scf(); void op_nop(); void op_halt(); void op_stop(); void op_di(); void op_ei(); //jump commands void op_jp_nn(); void op_jp_hl(); template void op_jp_f_nn(); void op_jr_n(); template void op_jr_f_n(); void op_call_nn(); template void op_call_f_nn(); void op_ret(); template void op_ret_f(); void op_reti(); template void op_rst_n(); //disassembler.cpp string disassemble(uint16 pc); string disassemble_opcode(uint16 pc); string disassemble_opcode_cb(uint16 pc); }; } #endif sfc/alt/ppu-performance/mmio/000700 001750 001750 00000000000 12656700342 017272 5ustar00sergiosergio000000 000000 target-ethos/settings/timing.hpp000664 001750 001750 00000001166 12651764221 020162 0ustar00sergiosergio000000 000000 struct TimingAdjustment : HorizontalLayout { Label name; LineEdit value; Button assign; Widget spacer; Button analyze; Button stop; TimingAdjustment(); }; struct TimingSettings : SettingsLayout { TimingAdjustment videoAdjust; TimingAdjustment audioAdjust; void analyzeVideoFrequency(); void analyzeAudioFrequency(); void analyzeStart(); bool analyzeTick(string type); void analyzeStop(); TimingSettings(); struct Analysis { bool stop; unsigned seconds; unsigned counter; vector sample; time_t systemTime; } analysis; }; extern TimingSettings* timingSettings; sfc/chip/sa1/bus/bus.hpp000664 001750 001750 00000000455 12651764221 016171 0ustar00sergiosergio000000 000000 struct CPUIRAM : Memory { unsigned size() const; alwaysinline uint8 read(unsigned); alwaysinline void write(unsigned, uint8); } cpuiram; struct CPUBWRAM : Memory { unsigned size() const; alwaysinline uint8 read(unsigned); alwaysinline void write(unsigned, uint8); bool dma; } cpubwram; sfc/chip/hitachidsp/serialization.cpp000664 001750 001750 00000001451 12651764221 021110 0ustar00sergiosergio000000 000000 #ifdef HITACHIDSP_CPP vector HitachiDSP::firmware() { vector buffer; if(cartridge.has_hitachidsp() == false) return buffer; buffer.reserve(1024 * 3); for(unsigned n = 0; n < 1024; n++) { buffer.append(dataROM[n] >> 0); buffer.append(dataROM[n] >> 8); buffer.append(dataROM[n] >> 16); } return buffer; } void HitachiDSP::serialize(serializer& s) { HG51B::serialize(s); Thread::serialize(s); s.integer(mmio.dma); s.integer(mmio.dma_source); s.integer(mmio.dma_length); s.integer(mmio.dma_target); s.integer(mmio.r1f48); s.integer(mmio.program_offset); s.integer(mmio.r1f4c); s.integer(mmio.page_number); s.integer(mmio.program_counter); s.integer(mmio.r1f50); s.integer(mmio.r1f51); s.integer(mmio.r1f52); s.array(mmio.vector); } #endif sfc/chip/cx4/000700 001750 001750 00000000000 12656700342 014067 5ustar00sergiosergio000000 000000 processor/spc700/disassembler.cpp000664 001750 001750 00000030321 12651764221 020123 0ustar00sergiosergio000000 000000 string SPC700::disassemble_opcode(uint16 addr) { auto read = [&](uint16 addr) -> uint8 { return disassembler_read(addr); }; auto relative = [&](unsigned length, int8 offset) -> uint16 { uint16 pc = addr + length; return pc + offset; }; auto a = [&] { return hex<4>((read(addr + 1) << 0) + (read(addr + 2) << 8)); }; auto b = [&](unsigned n) { return hex<2>(read(addr + 1 + n)); }; auto r = [&](unsigned r, unsigned n = 0) { return hex<4>(addr + r + (int8)read(addr + 1 + n)); }; auto dp = [&](unsigned n) { return hex<3>((regs.p.p << 8) + read(addr + 1 + n)); }; auto ab = [&] { unsigned n = (read(addr + 1) << 0) + (read(addr + 2) << 8); return string{ hex<4>(n & 0x1fff), ":", hex<1>(n >> 13) }; }; auto mnemonic = [&]() -> string { switch(read(addr)) { case 0x00: return { "nop" }; case 0x01: return { "jst $ffde" }; case 0x02: return { "set $", dp(0), ":0" }; case 0x03: return { "bbs $", dp(0), ":0=$", r(+3, 1) }; case 0x04: return { "ora $", dp(0) }; case 0x05: return { "ora $", a() }; case 0x06: return { "ora (x)" }; case 0x07: return { "ora ($", dp(0), ",x)" }; case 0x08: return { "ora #$", b(0) }; case 0x09: return { "orr $", dp(1), "=$", dp(0) }; case 0x0a: return { "orc $", ab() }; case 0x0b: return { "asl $", dp(0) }; case 0x0c: return { "asl $", a() }; case 0x0d: return { "php" }; case 0x0e: return { "tsb $", a() }; case 0x0f: return { "brk" }; case 0x10: return { "bpl $", r(+2) }; case 0x11: return { "jst $ffdc" }; case 0x12: return { "clr $", dp(0), ":0" }; case 0x13: return { "bbc $", dp(0), ":0=$", r(+3, 1) }; case 0x14: return { "ora $", dp(0), ",x" }; case 0x15: return { "ora $", a(), ",x" }; case 0x16: return { "ora $", a(), ",y" }; case 0x17: return { "ora ($", dp(0), "),y" }; case 0x18: return { "orr $", dp(1), "=#$", b(0) }; case 0x19: return { "orr (x)=(y)" }; case 0x1a: return { "dew $", dp(0) }; case 0x1b: return { "asl $", dp(0), ",x" }; case 0x1c: return { "asl" }; case 0x1d: return { "dex" }; case 0x1e: return { "cpx $", a() }; case 0x1f: return { "jmp ($", a(), ",x)" }; case 0x20: return { "clp" }; case 0x21: return { "jst $ffda" }; case 0x22: return { "set $", dp(0), ":1" }; case 0x23: return { "bbs $", dp(0), ":1=$", r(+3, 1) }; case 0x24: return { "and $", dp(0) }; case 0x25: return { "and $", a() }; case 0x26: return { "and (x)" }; case 0x27: return { "and ($", dp(0), ",x)" }; case 0x29: return { "and $", dp(1), "=$", dp(0) }; case 0x2a: return { "orc !$", ab() }; case 0x2b: return { "rol $", dp(0) }; case 0x2c: return { "rol $", a() }; case 0x2d: return { "pha" }; case 0x2e: return { "bne $", dp(0), "=$", r(+3, 1) }; case 0x28: return { "and #$", b(0) }; case 0x2f: return { "bra $", r(+2) }; case 0x30: return { "bmi $", r(+2) }; case 0x31: return { "jst $ffd8" }; case 0x32: return { "clr $", dp(0), ":1" }; case 0x33: return { "bbc $", dp(0), ":1=$", r(+3, 1) }; case 0x34: return { "and $", dp(0), ",x" }; case 0x35: return { "and $", a(), ",x" }; case 0x36: return { "and $", a(), ",y" }; case 0x37: return { "and ($", dp(0), "),y" }; case 0x38: return { "and $", dp(1), "=#$", b(0) }; case 0x39: return { "and (x)=(y)" }; case 0x3a: return { "inw $", dp(0) }; case 0x3b: return { "rol $", dp(0), ",x" }; case 0x3c: return { "rol" }; case 0x3d: return { "inx" }; case 0x3e: return { "cpx $", dp(0) }; case 0x3f: return { "jsr $", a() }; case 0x40: return { "sep" }; case 0x41: return { "jst $ffd6" }; case 0x42: return { "set $", dp(0), ":2" }; case 0x43: return { "bbs $", dp(0), ":2=$", r(+3, 1) }; case 0x44: return { "eor $", dp(0) }; case 0x45: return { "eor $", a() }; case 0x46: return { "eor (x)" }; case 0x47: return { "eor ($", dp(0), ",x)" }; case 0x48: return { "eor #$", b(0) }; case 0x49: return { "eor $", dp(1), "=$", dp(0) }; case 0x4a: return { "and $", ab() }; case 0x4b: return { "lsr $", dp(0) }; case 0x4c: return { "lsr $", a() }; case 0x4d: return { "phx" }; case 0x4e: return { "trb $", a() }; case 0x4f: return { "jsp $ff", b(0) }; case 0x50: return { "bvc $", r(+2) }; case 0x51: return { "jst $ffd4" }; case 0x52: return { "clr $", dp(0), ":2" }; case 0x53: return { "bbc $", dp(0), ":2=$", r(+3, 1) }; case 0x54: return { "eor $", dp(0), ",x" }; case 0x55: return { "eor $", a(), ",x" }; case 0x56: return { "eor $", a(), ",y" }; case 0x57: return { "eor ($", dp(0), "),y" }; case 0x58: return { "eor $", dp(1), "=#$", b(0) }; case 0x59: return { "eor (x)=(y)" }; case 0x5a: return { "cpw $", a() }; case 0x5b: return { "lsr $", dp(0), ",x" }; case 0x5c: return { "lsr" }; case 0x5d: return { "tax" }; case 0x5e: return { "cpy $", a() }; case 0x5f: return { "jmp $", a() }; case 0x60: return { "clc" }; case 0x61: return { "jst $ffd2" }; case 0x62: return { "set $", dp(0), ":3" }; case 0x63: return { "bbs $", dp(0), ":3=$", r(+3, 1) }; case 0x64: return { "cmp $", dp(0) }; case 0x65: return { "cmp $", a() }; case 0x66: return { "cmp (x)" }; case 0x67: return { "cmp ($", dp(0), ",x)" }; case 0x68: return { "cmp #$", b(0) }; case 0x69: return { "cmp $", dp(1), "=$", dp(0) }; case 0x6a: return { "and !$", ab() }; case 0x6b: return { "ror $", dp(0) }; case 0x6c: return { "ror $", a() }; case 0x6d: return { "phy" }; case 0x6e: return { "bne --$", dp(0), "=$", r(+3, 1) }; case 0x6f: return { "rts" }; case 0x70: return { "bvs $", r(+2) }; case 0x71: return { "jst $ffd0" }; case 0x72: return { "clr $", dp(0), ":3" }; case 0x73: return { "bbc $", dp(0), ":3=$", r(+3, 1) }; case 0x74: return { "cmp $", dp(0), ",x" }; case 0x75: return { "cmp $", a(), ",x" }; case 0x76: return { "cmp $", a(), ",y" }; case 0x77: return { "cmp ($", dp(0), "),y" }; case 0x78: return { "cmp $", dp(1), "=#$", b(0) }; case 0x79: return { "cmp (x)=(y)" }; case 0x7a: return { "adw $", a() }; case 0x7b: return { "ror $", dp(0), ",x" }; case 0x7c: return { "ror" }; case 0x7d: return { "txa" }; case 0x7e: return { "cpy $", dp(0) }; case 0x7f: return { "rti" }; case 0x80: return { "sec" }; case 0x81: return { "jst $ffce" }; case 0x82: return { "set $", dp(0), ":4" }; case 0x83: return { "bbs $", dp(0), ":4=$", r(+3, 1) }; case 0x84: return { "adc $", dp(0) }; case 0x85: return { "adc $", a() }; case 0x86: return { "adc (x)" }; case 0x87: return { "adc ($", dp(0), ",x)" }; case 0x88: return { "adc #$", b(0) }; case 0x89: return { "adc $", dp(1), "=$", dp(0) }; case 0x8a: return { "eor $", ab() }; case 0x8b: return { "dec $", dp(0) }; case 0x8c: return { "dec $", a() }; case 0x8d: return { "ldy #$", b(0) }; case 0x8e: return { "plp" }; case 0x8f: return { "str $", dp(1), "=#$", b(0) }; case 0x90: return { "bcc $", r(+2) }; case 0x91: return { "jst $ffcc" }; case 0x92: return { "clr $", dp(0), ":4" }; case 0x93: return { "bbc $", dp(0), ":4=$", r(+3, 1) }; case 0x94: return { "adc $", dp(0), ",x" }; case 0x95: return { "adc $", a(), ",x" }; case 0x96: return { "adc $", a(), ",y" }; case 0x97: return { "adc ($", dp(0), "),y" }; case 0x98: return { "adc $", dp(1), "=#$", b(0) }; case 0x99: return { "adc (x)=(y)" }; case 0x9a: return { "sbw $", a() }; case 0x9b: return { "dec $", dp(0), ",x" }; case 0x9c: return { "dec" }; case 0x9d: return { "tsx" }; case 0x9e: return { "div" }; case 0x9f: return { "xcn" }; case 0xa0: return { "sei" }; case 0xa1: return { "jst $ffca" }; case 0xa2: return { "set $", dp(0), ":5" }; case 0xa3: return { "bbs $", dp(0), ":5=$", r(+3, 1) }; case 0xa4: return { "sbc $", dp(0) }; case 0xa5: return { "sbc $", a() }; case 0xa6: return { "sbc (x)" }; case 0xa7: return { "sbc ($", dp(0), ",x)" }; case 0xa8: return { "sbc #$", b(0) }; case 0xa9: return { "sbc $", dp(1), "=$", dp(0) }; case 0xaa: return { "ldc $", ab() }; case 0xab: return { "inc $", dp(0) }; case 0xac: return { "inc $", a() }; case 0xad: return { "cpy #$", b(0) }; case 0xae: return { "pla" }; case 0xaf: return { "sta (x++)" }; case 0xb0: return { "bcs $", r(+2) }; case 0xb1: return { "jst $ffc8" }; case 0xb2: return { "clr $", dp(0), ":5" }; case 0xb3: return { "bbc $", dp(0), ":5=$", r(+3, 1) }; case 0xb4: return { "sbc $", dp(0), ",x" }; case 0xb5: return { "sbc $", a(), ",x" }; case 0xb6: return { "sbc $", a(), ",y" }; case 0xb7: return { "sbc ($", dp(0), "),y" }; case 0xb8: return { "sbc $", dp(1), "=#$", b(0) }; case 0xb9: return { "sbc (x)=(y)" }; case 0xba: return { "ldw $", dp(0) }; case 0xbb: return { "inc $", dp(0), ",x" }; case 0xbc: return { "inc" }; case 0xbd: return { "txs" }; case 0xbe: return { "das" }; case 0xbf: return { "lda (x++)" }; case 0xc0: return { "cli" }; case 0xc1: return { "jst $ffc6" }; case 0xc2: return { "set $", dp(0), ":6" }; case 0xc3: return { "bbs $", dp(0), ":6=$", r(+3, 1) }; case 0xc4: return { "sta $", dp(0) }; case 0xc5: return { "sta $", a() }; case 0xc6: return { "sta (x)" }; case 0xc7: return { "sta ($", dp(0), ",x)" }; case 0xc8: return { "cpx #$", b(0) }; case 0xc9: return { "stx $", a() }; case 0xca: return { "stc $", ab() }; case 0xcb: return { "sty $", dp(0) }; case 0xcc: return { "sty $", a() }; case 0xcd: return { "ldx #$", b(0) }; case 0xce: return { "plx" }; case 0xcf: return { "mul" }; case 0xd0: return { "bne $", r(+2) }; case 0xd1: return { "jst $ffc4" }; case 0xd2: return { "clr $", dp(0), ":6" }; case 0xd3: return { "bbc $", dp(0), ":6=$", r(+3, 1) }; case 0xd4: return { "sta $", dp(0), ",x" }; case 0xd5: return { "sta $", a(), ",x" }; case 0xd6: return { "sta $", a(), ",y" }; case 0xd7: return { "sta ($", dp(0), "),y" }; case 0xd8: return { "stx $", dp(0) }; case 0xd9: return { "stx $", dp(0), ",y" }; case 0xda: return { "stw $", dp(0) }; case 0xdb: return { "sty $", dp(0), ",x" }; case 0xdc: return { "dey" }; case 0xdd: return { "tya" }; case 0xde: return { "bne $", dp(0), ",x=$", r(+3, 1) }; case 0xdf: return { "daa" }; case 0xe0: return { "clv" }; case 0xe1: return { "jst $ffc2" }; case 0xe2: return { "set $", dp(0), ":7" }; case 0xe3: return { "bbs $", dp(0), ":7=$", r(+3, 1) }; case 0xe4: return { "lda $", dp(0) }; case 0xe5: return { "lda $", a() }; case 0xe6: return { "lda (x)" }; case 0xe7: return { "lda ($", dp(0), ",x)" }; case 0xe8: return { "lda #$", b(0) }; case 0xe9: return { "ldx $", a() }; case 0xea: return { "not $", ab() }; case 0xeb: return { "ldy $", dp(0) }; case 0xec: return { "ldy $", a() }; case 0xed: return { "cmc" }; case 0xee: return { "ply" }; case 0xef: return { "wai" }; case 0xf0: return { "beq $", r(+2) }; case 0xf1: return { "jst $ffc0" }; case 0xf2: return { "clr $", dp(0), ":7" }; case 0xf3: return { "bbc $", dp(0), ":7=$", r(+3, 1) }; case 0xf4: return { "lda $", dp(0), ",x" }; case 0xf5: return { "lda $", a(), ",x" }; case 0xf6: return { "lda $", a(), ",y" }; case 0xf7: return { "lda ($", dp(0), "),y" }; case 0xf8: return { "ldx $", dp(0) }; case 0xf9: return { "ldx $", dp(0), ",y" }; case 0xfa: return { "str $", dp(1), "=$", dp(0) }; case 0xfb: return { "ldy $", dp(0), ",x" }; case 0xfc: return { "iny" }; case 0xfd: return { "tay" }; case 0xfe: return { "bne --y=$", r(+2) }; case 0xff: return { "stp" }; } throw; }; string output = { "..", hex<4>(addr), " ", mnemonic() }; unsigned length = output.length(); while(length++ < 30) output.append(" "); output.append( "YA:", hex<4>(regs.ya), " A:", hex<2>(regs.a), " X:", hex<2>(regs.x), " Y:", hex<2>(regs.y), " S:", hex<2>(regs.s), " ", regs.p.n ? "N" : "n", regs.p.v ? "V" : "v", regs.p.p ? "P" : "p", regs.p.b ? "B" : "b", regs.p.h ? "H" : "h", regs.p.i ? "I" : "i", regs.p.z ? "Z" : "z", regs.p.c ? "C" : "c" ); return output; } sfc/alt/smp/timing.cpp000664 001750 001750 00000001151 12651764221 016033 0ustar00sergiosergio000000 000000 template void SMP::Timer::tick() { if(++stage1_ticks < cycle_frequency) return; stage1_ticks = 0; if(enable == false) return; if(++stage2_ticks != target) return; stage2_ticks = 0; stage3_ticks = (stage3_ticks + 1) & 15; } template void SMP::Timer::tick(unsigned clocks) { stage1_ticks += clocks; if(stage1_ticks < cycle_frequency) return; stage1_ticks -= cycle_frequency; if(enable == false) return; if(++stage2_ticks != target) return; stage2_ticks = 0; stage3_ticks = (stage3_ticks + 1) & 15; } sfc/ppu/sprite/list.cpp000664 001750 001750 00000003405 12651764221 016256 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP void PPU::Sprite::update(unsigned addr, uint8 data) { if(addr < 0x0200) { unsigned n = addr >> 2; addr &= 3; if(addr == 0) { list[n].x = (list[n].x & 0x100) | data; } else if(addr == 1) { list[n].y = data; } else if(addr == 2) { list[n].character = data; } else { //(addr == 3) list[n].vflip = data & 0x80; list[n].hflip = data & 0x40; list[n].priority = (data >> 4) & 3; list[n].palette = (data >> 1) & 7; list[n].nameselect = data & 1; } } else { unsigned n = (addr & 0x1f) << 2; list[n + 0].x = ((data & 0x01) << 8) | (list[n + 0].x & 0xff); list[n + 0].size = data & 0x02; list[n + 1].x = ((data & 0x04) << 6) | (list[n + 1].x & 0xff); list[n + 1].size = data & 0x08; list[n + 2].x = ((data & 0x10) << 4) | (list[n + 2].x & 0xff); list[n + 2].size = data & 0x20; list[n + 3].x = ((data & 0x40) << 2) | (list[n + 3].x & 0xff); list[n + 3].size = data & 0x80; } } void PPU::Sprite::synchronize() { for(unsigned n = 0; n < 544; n++) update(n, ppu.oam[n]); } unsigned PPU::Sprite::SpriteItem::width() const { if(size == 0) { static unsigned width[] = { 8, 8, 8, 16, 16, 32, 16, 16}; return width[ppu.sprite.regs.base_size]; } else { static unsigned width[] = {16, 32, 64, 32, 64, 64, 32, 32}; return width[ppu.sprite.regs.base_size]; } } unsigned PPU::Sprite::SpriteItem::height() const { if(size == 0) { if(ppu.sprite.regs.interlace && ppu.sprite.regs.base_size >= 6) return 16; static unsigned height[] = { 8, 8, 8, 16, 16, 32, 32, 32}; return height[ppu.sprite.regs.base_size]; } else { static unsigned height[] = {16, 32, 64, 32, 64, 64, 64, 32}; return height[ppu.sprite.regs.base_size]; } } #endif nall/beat/delta.hpp000664 001750 001750 00000013616 12651764221 015362 0ustar00sergiosergio000000 000000 #ifndef NALL_BEAT_DELTA_HPP #define NALL_BEAT_DELTA_HPP #include #include #include #include #include namespace nall { struct bpsdelta { inline void source(const uint8_t* data, unsigned size); inline void target(const uint8_t* data, unsigned size); inline bool source(const string& filename); inline bool target(const string& filename); inline bool create(const string& filename, const string& metadata = ""); protected: enum : unsigned { SourceRead, TargetRead, SourceCopy, TargetCopy }; enum : unsigned { Granularity = 1 }; struct Node { unsigned offset = 0; Node* next = nullptr; Node() = default; ~Node() { if(next) delete next; } }; filemap sourceFile; const uint8_t* sourceData; unsigned sourceSize; filemap targetFile; const uint8_t* targetData; unsigned targetSize; }; void bpsdelta::source(const uint8_t* data, unsigned size) { sourceData = data; sourceSize = size; } void bpsdelta::target(const uint8_t* data, unsigned size) { targetData = data; targetSize = size; } bool bpsdelta::source(const string& filename) { if(sourceFile.open(filename, filemap::mode::read) == false) return false; source(sourceFile.data(), sourceFile.size()); return true; } bool bpsdelta::target(const string& filename) { if(targetFile.open(filename, filemap::mode::read) == false) return false; target(targetFile.data(), targetFile.size()); return true; } bool bpsdelta::create(const string& filename, const string& metadata) { file modifyFile; if(modifyFile.open(filename, file::mode::write) == false) return false; uint32_t sourceChecksum = ~0, modifyChecksum = ~0; unsigned sourceRelativeOffset = 0, targetRelativeOffset = 0, outputOffset = 0; auto write = [&](uint8_t data) { modifyFile.write(data); modifyChecksum = crc32_adjust(modifyChecksum, data); }; auto encode = [&](uint64_t data) { while(true) { uint64_t x = data & 0x7f; data >>= 7; if(data == 0) { write(0x80 | x); break; } write(x); data--; } }; write('B'); write('P'); write('S'); write('1'); encode(sourceSize); encode(targetSize); unsigned markupSize = metadata.length(); encode(markupSize); for(unsigned n = 0; n < markupSize; n++) write(metadata[n]); Node* sourceTree[65536]; Node* targetTree[65536]; for(unsigned n = 0; n < 65536; n++) sourceTree[n] = nullptr, targetTree[n] = nullptr; //source tree creation for(unsigned offset = 0; offset < sourceSize; offset++) { uint16_t symbol = sourceData[offset + 0]; sourceChecksum = crc32_adjust(sourceChecksum, symbol); if(offset < sourceSize - 1) symbol |= sourceData[offset + 1] << 8; Node *node = new Node; node->offset = offset; node->next = sourceTree[symbol]; sourceTree[symbol] = node; } unsigned targetReadLength = 0; auto targetReadFlush = [&]() { if(targetReadLength) { encode(TargetRead | ((targetReadLength - 1) << 2)); unsigned offset = outputOffset - targetReadLength; while(targetReadLength) write(targetData[offset++]), targetReadLength--; } }; while(outputOffset < targetSize) { unsigned maxLength = 0, maxOffset = 0, mode = TargetRead; uint16_t symbol = targetData[outputOffset + 0]; if(outputOffset < targetSize - 1) symbol |= targetData[outputOffset + 1] << 8; { //source read unsigned length = 0, offset = outputOffset; while(offset < sourceSize && offset < targetSize && sourceData[offset] == targetData[offset]) { length++; offset++; } if(length > maxLength) maxLength = length, mode = SourceRead; } { //source copy Node* node = sourceTree[symbol]; while(node) { unsigned length = 0, x = node->offset, y = outputOffset; while(x < sourceSize && y < targetSize && sourceData[x++] == targetData[y++]) length++; if(length > maxLength) maxLength = length, maxOffset = node->offset, mode = SourceCopy; node = node->next; } } { //target copy Node* node = targetTree[symbol]; while(node) { unsigned length = 0, x = node->offset, y = outputOffset; while(y < targetSize && targetData[x++] == targetData[y++]) length++; if(length > maxLength) maxLength = length, maxOffset = node->offset, mode = TargetCopy; node = node->next; } //target tree append node = new Node; node->offset = outputOffset; node->next = targetTree[symbol]; targetTree[symbol] = node; } { //target read if(maxLength < 4) { maxLength = min((unsigned)Granularity, targetSize - outputOffset); mode = TargetRead; } } if(mode != TargetRead) targetReadFlush(); switch(mode) { case SourceRead: encode(SourceRead | ((maxLength - 1) << 2)); break; case TargetRead: //delay write to group sequential TargetRead commands into one targetReadLength += maxLength; break; case SourceCopy: case TargetCopy: encode(mode | ((maxLength - 1) << 2)); signed relativeOffset; if(mode == SourceCopy) { relativeOffset = maxOffset - sourceRelativeOffset; sourceRelativeOffset = maxOffset + maxLength; } else { relativeOffset = maxOffset - targetRelativeOffset; targetRelativeOffset = maxOffset + maxLength; } encode((relativeOffset < 0) | (abs(relativeOffset) << 1)); break; } outputOffset += maxLength; } targetReadFlush(); sourceChecksum = ~sourceChecksum; for(unsigned n = 0; n < 32; n += 8) write(sourceChecksum >> n); uint32_t targetChecksum = crc32_calculate(targetData, targetSize); for(unsigned n = 0; n < 32; n += 8) write(targetChecksum >> n); uint32_t outputChecksum = ~modifyChecksum; for(unsigned n = 0; n < 32; n += 8) write(outputChecksum >> n); modifyFile.close(); return true; } } #endif fc/scheduler/scheduler.hpp000664 001750 001750 00000000741 12651764221 016747 0ustar00sergiosergio000000 000000 struct Scheduler : property { enum class SynchronizeMode : unsigned { None, PPU, All } sync; enum class ExitReason : unsigned { UnknownEvent, FrameEvent, SynchronizeEvent }; readonly exit_reason; cothread_t host_thread; //program thread (used to exit emulation) cothread_t thread; //active emulation thread (used to enter emulation) void enter(); void exit(ExitReason); void power(); void reset(); }; extern Scheduler scheduler; sfc/alt/ppu-balanced/render/render.cpp000664 001750 001750 00000007035 12651764221 021045 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP #include "cache.cpp" #include "windows.cpp" #include "bg.cpp" #include "oam.cpp" #include "mode7.cpp" #include "addsub.cpp" #include "line.cpp" //Mode 0: -> // 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 // BG4B, BG3B, OAM0, BG4A, BG3A, OAM1, BG2B, BG1B, OAM2, BG2A, BG1A, OAM3 void PPU::render_line_mode0() { render_line_bg<0, BG1, COLORDEPTH_4>(8, 11); render_line_bg<0, BG2, COLORDEPTH_4>(7, 10); render_line_bg<0, BG3, COLORDEPTH_4>(2, 5); render_line_bg<0, BG4, COLORDEPTH_4>(1, 4); render_line_oam(3, 6, 9, 12); } //Mode 1 (pri=1): -> // 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 // BG3B, OAM0, OAM1, BG2B, BG1B, OAM2, BG2A, BG1A, OAM3, BG3A // //Mode 1 (pri=0): -> // 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 // BG3B, OAM0, BG3A, OAM1, BG2B, BG1B, OAM2, BG2A, BG1A, OAM3 void PPU::render_line_mode1() { if(regs.bg3_priority) { render_line_bg<1, BG1, COLORDEPTH_16>(5, 8); render_line_bg<1, BG2, COLORDEPTH_16>(4, 7); render_line_bg<1, BG3, COLORDEPTH_4 >(1, 10); render_line_oam(2, 3, 6, 9); } else { render_line_bg<1, BG1, COLORDEPTH_16>(6, 9); render_line_bg<1, BG2, COLORDEPTH_16>(5, 8); render_line_bg<1, BG3, COLORDEPTH_4 >(1, 3); render_line_oam(2, 4, 7, 10); } } //Mode 2: -> // 1, 2, 3, 4, 5, 6, 7, 8 // BG2B, OAM0, BG1B, OAM1, BG2A, OAM2, BG1A, OAM3 void PPU::render_line_mode2() { render_line_bg<2, BG1, COLORDEPTH_16>(3, 7); render_line_bg<2, BG2, COLORDEPTH_16>(1, 5); render_line_oam(2, 4, 6, 8); } //Mode 3: -> // 1, 2, 3, 4, 5, 6, 7, 8 // BG2B, OAM0, BG1B, OAM1, BG2A, OAM2, BG1A, OAM3 void PPU::render_line_mode3() { render_line_bg<3, BG1, COLORDEPTH_256>(3, 7); render_line_bg<3, BG2, COLORDEPTH_16 >(1, 5); render_line_oam(2, 4, 6, 8); } //Mode 4: -> // 1, 2, 3, 4, 5, 6, 7, 8 // BG2B, OAM0, BG1B, OAM1, BG2A, OAM2, BG1A, OAM3 void PPU::render_line_mode4() { render_line_bg<4, BG1, COLORDEPTH_256>(3, 7); render_line_bg<4, BG2, COLORDEPTH_4 >(1, 5); render_line_oam(2, 4, 6, 8); } //Mode 5: -> // 1, 2, 3, 4, 5, 6, 7, 8 // BG2B, OAM0, BG1B, OAM1, BG2A, OAM2, BG1A, OAM3 void PPU::render_line_mode5() { render_line_bg<5, BG1, COLORDEPTH_16>(3, 7); render_line_bg<5, BG2, COLORDEPTH_4 >(1, 5); render_line_oam(2, 4, 6, 8); } //Mode 6: -> // 1, 2, 3, 4, 5, 6 // OAM0, BG1B, OAM1, OAM2, BG1A, OAM3 void PPU::render_line_mode6() { render_line_bg<6, BG1, COLORDEPTH_16>(2, 5); render_line_oam(1, 3, 4, 6); } //Mode7: -> // 1, 2, 3, 4, 5 // OAM0, BG1n, OAM1, OAM2, OAM3 //Mode 7 EXTBG: -> // 1, 2, 3, 4, 5, 6, 7 // BG2B, OAM0, BG1n, OAM1, BG2A, OAM2, OAM3 void PPU::render_line_mode7() { if(regs.mode7_extbg == false) { render_line_mode7(2, 2); render_line_oam(1, 3, 4, 5); } else { render_line_mode7(3, 3); render_line_mode7(1, 5); render_line_oam(2, 4, 6, 7); } } void PPU::render_line() { if(regs.display_disabled == true) { render_line_clear(); return; } flush_pixel_cache(); build_window_tables(COL); update_bg_info(); switch(regs.bg_mode) { case 0: render_line_mode0(); break; case 1: render_line_mode1(); break; case 2: render_line_mode2(); break; case 3: render_line_mode3(); break; case 4: render_line_mode4(); break; case 5: render_line_mode5(); break; case 6: render_line_mode6(); break; case 7: render_line_mode7(); break; } render_line_output(); } #endif sfc/cpu/memory/000700 001750 001750 00000000000 12656700342 014545 5ustar00sergiosergio000000 000000 fc/interface/interface.cpp000664 001750 001750 00000007133 12651764221 016710 0ustar00sergiosergio000000 000000 #include namespace Famicom { Interface* interface = nullptr; string Interface::title() { return cartridge.title(); } double Interface::videoFrequency() { return 21477272.0 / (262.0 * 1364.0 - 4.0); } double Interface::audioFrequency() { return 21477272.0 / 12.0; } bool Interface::loaded() { return cartridge.loaded(); } string Interface::sha256() { return cartridge.sha256(); } unsigned Interface::group(unsigned id) { switch(id) { case ID::Manifest: case ID::ProgramROM: case ID::ProgramRAM: case ID::CharacterROM: case ID::CharacterRAM: return 1; } throw; } void Interface::load(unsigned id) { cartridge.load(); } void Interface::save() { for(auto& memory : cartridge.memory) { saveRequest(memory.id, memory.name); } } void Interface::load(unsigned id, const stream& stream) { if(id == ID::Manifest) cartridge.information.markup = stream.text(); if(id == ID::ProgramROM) { stream.read(cartridge.board->prgrom.data, min(cartridge.board->prgrom.size, stream.size())); } if(id == ID::ProgramRAM) { stream.read(cartridge.board->prgram.data, min(cartridge.board->prgram.size, stream.size())); } if(id == ID::CharacterROM) { stream.read(cartridge.board->chrrom.data, min(cartridge.board->chrrom.size, stream.size())); } if(id == ID::CharacterRAM) { stream.read(cartridge.board->chrram.data, min(cartridge.board->chrram.size, stream.size())); } } void Interface::save(unsigned id, const stream& stream) { if(id == ID::ProgramRAM) { stream.write(cartridge.board->prgram.data, cartridge.board->prgram.size); } if(id == ID::CharacterRAM) { stream.write(cartridge.board->chrram.data, cartridge.board->chrram.size); } } void Interface::unload() { save(); cartridge.unload(); } void Interface::power() { system.power(); } void Interface::reset() { system.reset(); } void Interface::run() { system.run(); } serializer Interface::serialize() { system.runtosave(); return system.serialize(); } bool Interface::unserialize(serializer& s) { return system.unserialize(s); } void Interface::cheatSet(const lstring& list) { cheat.reset(); for(auto& codeset : list) { lstring codes = codeset.split("+"); for(auto& code : codes) { lstring part = code.split("/"); if(part.size() == 2) cheat.append(hex(part[0]), hex(part[1])); if(part.size() == 3) cheat.append(hex(part[0]), hex(part[1]), hex(part[2])); } } } void Interface::paletteUpdate(PaletteMode mode) { video.generate_palette(mode); } Interface::Interface() { interface = this; information.name = "Famicom"; information.width = 256; information.height = 240; information.overscan = true; information.aspectRatio = 8.0 / 7.0; information.resettable = true; information.capability.states = true; information.capability.cheats = true; media.append({ID::Famicom, "Famicom", "fc", true}); { Device device{0, ID::Port1 | ID::Port2, "Controller"}; device.input.append({0, 0, "A" }); device.input.append({1, 0, "B" }); device.input.append({2, 0, "Select"}); device.input.append({3, 0, "Start" }); device.input.append({4, 0, "Up" }); device.input.append({5, 0, "Down" }); device.input.append({6, 0, "Left" }); device.input.append({7, 0, "Right" }); device.order = {4, 5, 6, 7, 1, 0, 2, 3}; this->device.append(device); } port.append({0, "Port 1"}); port.append({1, "Port 2"}); for(auto& device : this->device) { for(auto& port : this->port) { if(device.portmask & (1 << port.id)) { port.device.append(device); } } } } } sfc/chip/epsonrtc/000700 001750 001750 00000000000 12656700342 015226 5ustar00sergiosergio000000 000000 fc/input/serialization.cpp000664 001750 001750 00000000256 12651764221 017023 0ustar00sergiosergio000000 000000 void Input::serialize(serializer& s) { s.integer((unsigned&)port1); s.integer((unsigned&)port2); s.integer(latchdata); s.integer(counter1); s.integer(counter2); } processor/arm/instructions-arm.hpp000664 001750 001750 00000001325 12651764221 020541 0ustar00sergiosergio000000 000000 void arm_step(); void arm_opcode(uint32 rm); void arm_move_to_status(uint32 rm); void arm_op_multiply(); void arm_op_multiply_long(); void arm_op_memory_swap(); void arm_op_move_half_register(); void arm_op_move_half_immediate(); void arm_op_load_register(); void arm_op_load_immediate(); void arm_op_move_to_register_from_status(); void arm_op_move_to_status_from_register(); void arm_op_branch_exchange_register(); void arm_op_move_to_status_from_immediate(); void arm_op_data_immediate_shift(); void arm_op_data_register_shift(); void arm_op_data_immediate(); void arm_op_move_immediate_offset(); void arm_op_move_register_offset(); void arm_op_move_multiple(); void arm_op_branch(); void arm_op_software_interrupt(); phoenix/cocoa/widget/check-label.hpp000664 001750 001750 00000001065 12651764221 020576 0ustar00sergiosergio000000 000000 @interface CocoaCheckLabel : NSButton { @public phoenix::CheckLabel* checkLabel; } -(id) initWith:(phoenix::CheckLabel&)checkLabel; -(IBAction) activate:(id)sender; @end namespace phoenix { struct pCheckLabel : public pWidget { CheckLabel& checkLabel; CocoaCheckLabel* cocoaCheckLabel = nullptr; Size minimumSize(); void setChecked(bool checked); void setGeometry(Geometry geometry); void setText(string text); pCheckLabel(CheckLabel& checkLabel) : pWidget(checkLabel), checkLabel(checkLabel) {} void constructor(); void destructor(); }; } nall/windows/registry.hpp000664 001750 001750 00000010151 12651764221 016707 0ustar00sergiosergio000000 000000 #ifndef NALL_WINDOWS_REGISTRY_HPP #define NALL_WINDOWS_REGISTRY_HPP #include #include #include #undef interface #ifndef KEY_WOW64_64KEY #define KEY_WOW64_64KEY 0x0100 #endif #ifndef KEY_WOW64_32KEY #define KEY_WOW64_32KEY 0x0200 #endif #ifndef NWR_FLAGS #define NWR_FLAGS KEY_WOW64_64KEY #endif #ifndef NWR_SIZE #define NWR_SIZE 4096 #endif namespace nall { struct registry { static bool exists(const string& name) { lstring part = name.split("/"); HKEY handle, rootKey = root(part.take(0)); string node = part.take(); string path = part.merge("\\"); if(RegOpenKeyExW(rootKey, utf16_t(path), 0, NWR_FLAGS | KEY_READ, &handle) == ERROR_SUCCESS) { wchar_t data[NWR_SIZE] = L""; DWORD size = NWR_SIZE * sizeof(wchar_t); LONG result = RegQueryValueExW(handle, utf16_t(node), nullptr, nullptr, (LPBYTE)&data, (LPDWORD)&size); RegCloseKey(handle); if(result == ERROR_SUCCESS) return true; } return false; } static string read(const string& name) { lstring part = name.split("/"); HKEY handle, rootKey = root(part.take(0)); string node = part.take(); string path = part.merge("\\"); if(RegOpenKeyExW(rootKey, utf16_t(path), 0, NWR_FLAGS | KEY_READ, &handle) == ERROR_SUCCESS) { wchar_t data[NWR_SIZE] = L""; DWORD size = NWR_SIZE * sizeof(wchar_t); LONG result = RegQueryValueExW(handle, utf16_t(node), nullptr, nullptr, (LPBYTE)&data, (LPDWORD)&size); RegCloseKey(handle); if(result == ERROR_SUCCESS) return (const char*)utf8_t(data); } return ""; } static void write(const string& name, const string& data = "") { lstring part = name.split("/"); HKEY handle, rootKey = root(part.take(0)); string node = part.take(), path; DWORD disposition; for(unsigned n = 0; n < part.size(); n++) { path.append(part[n]); if(RegCreateKeyExW(rootKey, utf16_t(path), 0, nullptr, 0, NWR_FLAGS | KEY_ALL_ACCESS, nullptr, &handle, &disposition) == ERROR_SUCCESS) { if(n == part.size() - 1) { RegSetValueExW(handle, utf16_t(node), 0, REG_SZ, (BYTE*)(wchar_t*)utf16_t(data), (data.length() + 1) * sizeof(wchar_t)); } RegCloseKey(handle); } path.append("\\"); } } static bool remove(const string& name) { lstring part = name.split("/"); HKEY rootKey = root(part.take(0)); string node = part.take(); string path = part.merge("\\"); if(node.empty()) return SHDeleteKeyW(rootKey, utf16_t(path)) == ERROR_SUCCESS; return SHDeleteValueW(rootKey, utf16_t(path), utf16_t(node)) == ERROR_SUCCESS; } static lstring contents(const string& name) { lstring part = name.split("/"), result; HKEY handle, rootKey = root(part.take(0)); part.remove(); string path = part.merge("\\"); if(RegOpenKeyExW(rootKey, utf16_t(path), 0, NWR_FLAGS | KEY_READ, &handle) == ERROR_SUCCESS) { DWORD folders, nodes; RegQueryInfoKey(handle, nullptr, nullptr, nullptr, &folders, nullptr, nullptr, &nodes, nullptr, nullptr, nullptr, nullptr); for(unsigned n = 0; n < folders; n++) { wchar_t name[NWR_SIZE] = L""; DWORD size = NWR_SIZE * sizeof(wchar_t); RegEnumKeyEx(handle, n, (wchar_t*)&name, &size, nullptr, nullptr, nullptr, nullptr); result.append({(const char*)utf8_t(name), "/"}); } for(unsigned n = 0; n < nodes; n++) { wchar_t name[NWR_SIZE] = L""; DWORD size = NWR_SIZE * sizeof(wchar_t); RegEnumValueW(handle, n, (wchar_t*)&name, &size, nullptr, nullptr, nullptr, nullptr); result.append((const char*)utf8_t(name)); } RegCloseKey(handle); } return result; } private: static HKEY root(const string& name) { if(name == "HKCR") return HKEY_CLASSES_ROOT; if(name == "HKCC") return HKEY_CURRENT_CONFIG; if(name == "HKCU") return HKEY_CURRENT_USER; if(name == "HKLM") return HKEY_LOCAL_MACHINE; if(name == "HKU" ) return HKEY_USERS; return nullptr; } }; } #endif nall/serial.hpp000664 001750 001750 00000005475 12651764221 014641 0ustar00sergiosergio000000 000000 #ifndef NALL_SERIAL_HPP #define NALL_SERIAL_HPP #include #include #include #if !defined(PLATFORM_X) && !defined(PLATFORM_MACOSX) #error "nall/serial: unsupported platform" #endif #include #include #include #include namespace nall { struct serial { bool readable() { if(port_open == false) return false; fd_set fdset; FD_ZERO(&fdset); FD_SET(port, &fdset); timeval timeout; timeout.tv_sec = 0; timeout.tv_usec = 0; int result = select(FD_SETSIZE, &fdset, nullptr, nullptr, &timeout); if(result < 1) return false; return FD_ISSET(port, &fdset); } //-1 on error, otherwise return bytes read int read(uint8_t* data, unsigned length) { if(port_open == false) return -1; return ::read(port, (void*)data, length); } bool writable() { if(port_open == false) return false; fd_set fdset; FD_ZERO(&fdset); FD_SET(port, &fdset); timeval timeout; timeout.tv_sec = 0; timeout.tv_usec = 0; int result = select(FD_SETSIZE, nullptr, &fdset, nullptr, &timeout); if(result < 1) return false; return FD_ISSET(port, &fdset); } //-1 on error, otherwise return bytes written int write(const uint8_t* data, unsigned length) { if(port_open == false) return -1; return ::write(port, (void*)data, length); } bool open(const string& portname, unsigned rate, bool flowcontrol) { close(); port = ::open(portname, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK); if(port == -1) return false; if(ioctl(port, TIOCEXCL) == -1) { close(); return false; } if(fcntl(port, F_SETFL, 0) == -1) { close(); return false; } if(tcgetattr(port, &original_attr) == -1) { close(); return false; } termios attr = original_attr; cfmakeraw(&attr); cfsetspeed(&attr, rate); attr.c_lflag &=~ (ECHO | ECHONL | ISIG | ICANON | IEXTEN); attr.c_iflag &=~ (BRKINT | PARMRK | INPCK | ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXOFF | IXANY); attr.c_iflag |= (IGNBRK | IGNPAR); attr.c_oflag &=~ (OPOST); attr.c_cflag &=~ (CSIZE | CSTOPB | PARENB | CLOCAL); attr.c_cflag |= (CS8 | CREAD); if(flowcontrol == false) { attr.c_cflag &= ~CRTSCTS; } else { attr.c_cflag |= CRTSCTS; } attr.c_cc[VTIME] = attr.c_cc[VMIN] = 0; if(tcsetattr(port, TCSANOW, &attr) == -1) { close(); return false; } return port_open = true; } void close() { if(port != -1) { tcdrain(port); if(port_open == true) { tcsetattr(port, TCSANOW, &original_attr); port_open = false; } ::close(port); port = -1; } } serial() { port = -1; port_open = false; } ~serial() { close(); } private: int port; bool port_open; termios original_attr; }; } #endif phoenix/cocoa/widget/horizontal-scroller.cpp000664 001750 001750 00000003607 12651764221 022457 0ustar00sergiosergio000000 000000 @implementation CocoaHorizontalScroller : NSScroller -(id) initWith:(phoenix::HorizontalScroller&)horizontalScrollerReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 1, 0)]) { horizontalScroller = &horizontalScrollerReference; [self setTarget:self]; [self setAction:@selector(scroll:)]; [self setControlSize:NSRegularControlSize]; [self setScrollerStyle:NSScrollerStyleLegacy]; [self setEnabled:YES]; [self update]; } return self; } -(void) update { double d = 1.0 / horizontalScroller->state.length; double f = d * horizontalScroller->state.position; [self setDoubleValue:f]; [self setKnobProportion:d]; } -(IBAction) scroll:(id)sender { auto& state = horizontalScroller->state; switch([self hitPart]) { case NSScrollerIncrementLine: case NSScrollerIncrementPage: if(state.position < state.length - 1) state.position++; [self update]; break; case NSScrollerDecrementLine: case NSScrollerDecrementPage: if(state.position) state.position--; [self update]; break; case NSScrollerKnob: state.position = [self doubleValue] * state.length; break; } if(horizontalScroller->onChange) horizontalScroller->onChange(); } @end namespace phoenix { Size pHorizontalScroller::minimumSize() { @autoreleasepool { return {32, [NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy]}; } } void pHorizontalScroller::setLength(unsigned length) { @autoreleasepool { [cocoaView update]; } } void pHorizontalScroller::setPosition(unsigned position) { @autoreleasepool { [cocoaView update]; } } void pHorizontalScroller::constructor() { @autoreleasepool { cocoaView = cocoaHorizontalScroller = [[CocoaHorizontalScroller alloc] initWith:horizontalScroller]; } } void pHorizontalScroller::destructor() { @autoreleasepool { [cocoaView release]; } } } phoenix/reference/widget/frame.hpp000664 001750 001750 00000000317 12651764221 020407 0ustar00sergiosergio000000 000000 namespace phoenix { struct pFrame : public pWidget { Frame& frame; void setText(string text); pFrame(Frame& frame) : pWidget(frame), frame(frame) {} void constructor(); void destructor(); }; } phoenix/core/000700 001750 001750 00000000000 12656700342 014275 5ustar00sergiosergio000000 000000 profile/Game Boy.sys/manifest.bml000664 001750 001750 00000000072 12651764221 020051 0ustar00sergiosergio000000 000000 system name:Game Boy cpu rom name=boot.rom size=256 sfc/cartridge/cartridge.hpp000664 001750 001750 00000006515 12651764221 017113 0ustar00sergiosergio000000 000000 struct Cartridge : property { enum class Region : unsigned { NTSC, PAL, }; enum class Slot : unsigned { Base, Bsx, SufamiTurbo, SufamiTurboA, SufamiTurboB, GameBoy, }; MappedRAM rom; MappedRAM ram; readonly loaded; readonly sha256; readonly region; readonly has_gb_slot; readonly has_bs_cart; readonly has_bs_slot; readonly has_st_slots; readonly has_nss_dip; readonly has_event; readonly has_sa1; readonly has_superfx; readonly has_armdsp; readonly has_hitachidsp; readonly has_necdsp; readonly has_epsonrtc; readonly has_sharprtc; readonly has_spc7110; readonly has_sdd1; readonly has_obc1; readonly has_hsu1; readonly has_msu1; readonly has_dsp1; readonly has_dsp2; readonly has_dsp3; readonly has_dsp4; readonly has_cx4; readonly has_st0010; readonly has_sgbexternal; struct Mapping { function reader; function writer; string addr; unsigned size; unsigned base; unsigned mask; enum fastmode_t { fastmode_slow, fastmode_readonly, fastmode_readwrite } fastmode; uint8* fastptr; Mapping(); Mapping(const function&, const function&); Mapping(SuperFamicom::Memory&); }; vector mapping; struct Memory { unsigned id; string name; }; vector memory; struct Information { struct Markup { string cartridge; string gameBoy; string satellaview; string sufamiTurboA; string sufamiTurboB; } markup; struct Title { string cartridge; string gameBoy; string satellaview; string sufamiTurboA; string sufamiTurboB; } title; } information; string title(); void load(); void unload(); void serialize(serializer&); Cartridge(); ~Cartridge(); private: void load_super_game_boy(); void load_satellaview(); void load_sufami_turbo_a(); void load_sufami_turbo_b(); void parse_markup(const char*); void parse_markup_map(Mapping&, Markup::Node); void parse_markup_memory(MappedRAM&, Markup::Node, unsigned id, bool writable); void parse_markup_cartridge(Markup::Node); void parse_markup_icd2(Markup::Node); void parse_markup_bsx(Markup::Node); void parse_markup_satellaview(Markup::Node); void parse_markup_sufamiturbo(Markup::Node, bool slot); void parse_markup_nss(Markup::Node); void parse_markup_event(Markup::Node); void parse_markup_sa1(Markup::Node); void parse_markup_superfx(Markup::Node); void parse_markup_armdsp(Markup::Node); void parse_markup_hitachidsp(Markup::Node, unsigned roms); void parse_markup_necdsp(Markup::Node); void parse_markup_epsonrtc(Markup::Node); void parse_markup_sharprtc(Markup::Node); void parse_markup_spc7110(Markup::Node); void parse_markup_sdd1(Markup::Node); void parse_markup_obc1(Markup::Node); void parse_markup_hsu1(Markup::Node); void parse_markup_msu1(Markup::Node); void parse_markup_hitachidsp_hle(Markup::Node); void parse_markup_necdsp_hle(Markup::Node); bool parse_markup_icd2_external(Markup::Node); friend class Interface; }; extern Cartridge cartridge; gba/system/system.hpp000664 001750 001750 00000001175 12651764221 016026 0ustar00sergiosergio000000 000000 enum class Input : unsigned { A, B, Select, Start, Right, Left, Up, Down, R, L, }; struct BIOS : Memory { uint8* data; unsigned size; uint32 mdr; uint32 read(uint32 addr, uint32 size); void write(uint32 addr, uint32 size, uint32 word); BIOS(); ~BIOS(); }; struct System { void init(); void term(); void load(); void power(); void run(); void runtosave(); void runthreadtosave(); unsigned serialize_size; serializer serialize(); bool unserialize(serializer&); void serialize(serializer&); void serialize_all(serializer&); void serialize_init(); }; extern BIOS bios; extern System system; phoenix/windows/keyboard.cpp000664 001750 001750 00000012621 12651764221 017362 0ustar00sergiosergio000000 000000 namespace phoenix { void pKeyboard::initialize() { auto append = [](Keyboard::Scancode scancode, unsigned keysym) { settings->keymap.insert(scancode, keysym); }; append(Keyboard::Scancode::Escape, VK_ESCAPE); append(Keyboard::Scancode::F1, VK_F1); append(Keyboard::Scancode::F2, VK_F2); append(Keyboard::Scancode::F3, VK_F3); append(Keyboard::Scancode::F4, VK_F4); append(Keyboard::Scancode::F5, VK_F5); append(Keyboard::Scancode::F6, VK_F6); append(Keyboard::Scancode::F7, VK_F7); append(Keyboard::Scancode::F8, VK_F8); append(Keyboard::Scancode::F9, VK_F9); append(Keyboard::Scancode::F10, VK_F10); append(Keyboard::Scancode::F11, VK_F11); append(Keyboard::Scancode::F12, VK_F12); append(Keyboard::Scancode::PrintScreen, VK_SNAPSHOT); append(Keyboard::Scancode::ScrollLock, VK_SCROLL); append(Keyboard::Scancode::Pause, VK_PAUSE); append(Keyboard::Scancode::Insert, VK_INSERT); append(Keyboard::Scancode::Delete, VK_DELETE); append(Keyboard::Scancode::Home, VK_HOME); append(Keyboard::Scancode::End, VK_END); append(Keyboard::Scancode::PageUp, VK_PRIOR); append(Keyboard::Scancode::PageDown, VK_NEXT); append(Keyboard::Scancode::Up, VK_UP); append(Keyboard::Scancode::Down, VK_DOWN); append(Keyboard::Scancode::Left, VK_LEFT); append(Keyboard::Scancode::Right, VK_RIGHT); append(Keyboard::Scancode::Grave, VK_OEM_3); append(Keyboard::Scancode::Number1, '1'); append(Keyboard::Scancode::Number2, '2'); append(Keyboard::Scancode::Number3, '3'); append(Keyboard::Scancode::Number4, '4'); append(Keyboard::Scancode::Number5, '5'); append(Keyboard::Scancode::Number6, '6'); append(Keyboard::Scancode::Number7, '7'); append(Keyboard::Scancode::Number8, '8'); append(Keyboard::Scancode::Number9, '9'); append(Keyboard::Scancode::Number0, '0'); append(Keyboard::Scancode::Minus, VK_OEM_MINUS); append(Keyboard::Scancode::Equal, VK_OEM_PLUS); append(Keyboard::Scancode::Backspace, VK_BACK); append(Keyboard::Scancode::BracketLeft, VK_OEM_4); append(Keyboard::Scancode::BracketRight, VK_OEM_6); append(Keyboard::Scancode::Backslash, VK_OEM_5); append(Keyboard::Scancode::Semicolon, VK_OEM_1); append(Keyboard::Scancode::Apostrophe, VK_OEM_7); append(Keyboard::Scancode::Comma, VK_OEM_COMMA); append(Keyboard::Scancode::Period, VK_OEM_PERIOD); append(Keyboard::Scancode::Slash, VK_OEM_2); append(Keyboard::Scancode::Tab, VK_TAB); append(Keyboard::Scancode::CapsLock, VK_CAPITAL); append(Keyboard::Scancode::Return, VK_RETURN); append(Keyboard::Scancode::ShiftLeft, VK_LSHIFT); append(Keyboard::Scancode::ShiftRight, VK_RSHIFT); append(Keyboard::Scancode::ControlLeft, VK_LCONTROL); append(Keyboard::Scancode::ControlRight, VK_RCONTROL); append(Keyboard::Scancode::SuperLeft, VK_LWIN); append(Keyboard::Scancode::SuperRight, VK_RWIN); append(Keyboard::Scancode::AltLeft, VK_LMENU); append(Keyboard::Scancode::AltRight, VK_RMENU); append(Keyboard::Scancode::Space, VK_SPACE); append(Keyboard::Scancode::Menu, VK_APPS); append(Keyboard::Scancode::A, 'A'); append(Keyboard::Scancode::B, 'B'); append(Keyboard::Scancode::C, 'C'); append(Keyboard::Scancode::D, 'D'); append(Keyboard::Scancode::E, 'E'); append(Keyboard::Scancode::F, 'F'); append(Keyboard::Scancode::G, 'G'); append(Keyboard::Scancode::H, 'H'); append(Keyboard::Scancode::I, 'I'); append(Keyboard::Scancode::J, 'J'); append(Keyboard::Scancode::K, 'K'); append(Keyboard::Scancode::L, 'L'); append(Keyboard::Scancode::M, 'M'); append(Keyboard::Scancode::N, 'N'); append(Keyboard::Scancode::O, 'O'); append(Keyboard::Scancode::P, 'P'); append(Keyboard::Scancode::Q, 'Q'); append(Keyboard::Scancode::R, 'R'); append(Keyboard::Scancode::S, 'S'); append(Keyboard::Scancode::T, 'T'); append(Keyboard::Scancode::U, 'U'); append(Keyboard::Scancode::V, 'V'); append(Keyboard::Scancode::W, 'W'); append(Keyboard::Scancode::X, 'X'); append(Keyboard::Scancode::Y, 'Y'); append(Keyboard::Scancode::Z, 'Z'); append(Keyboard::Scancode::NumLock, VK_NUMLOCK); append(Keyboard::Scancode::Divide, VK_DIVIDE); append(Keyboard::Scancode::Multiply, VK_MULTIPLY); append(Keyboard::Scancode::Subtract, VK_SUBTRACT); append(Keyboard::Scancode::Add, VK_ADD); //append(Keyboard::Scancode::Enter, ...); append(Keyboard::Scancode::Point, VK_DECIMAL); append(Keyboard::Scancode::Keypad1, VK_NUMPAD1); append(Keyboard::Scancode::Keypad2, VK_NUMPAD2); append(Keyboard::Scancode::Keypad3, VK_NUMPAD3); append(Keyboard::Scancode::Keypad4, VK_NUMPAD4); append(Keyboard::Scancode::Keypad5, VK_NUMPAD5); append(Keyboard::Scancode::Keypad6, VK_NUMPAD6); append(Keyboard::Scancode::Keypad7, VK_NUMPAD7); append(Keyboard::Scancode::Keypad8, VK_NUMPAD8); append(Keyboard::Scancode::Keypad9, VK_NUMPAD9); append(Keyboard::Scancode::Keypad0, VK_NUMPAD0); } bool pKeyboard::pressed(Keyboard::Scancode scancode) { if(auto result = settings->keymap.find(scancode)) { return GetAsyncKeyState(result()) & 0x8000; } return false; } vector pKeyboard::state() { vector output; output.resize((unsigned)Keyboard::Scancode::Limit); for(auto& n : output) n = false; for(auto node : settings->keymap) { if(GetAsyncKeyState(node.value) & 0x8000) { output[(unsigned)node.key] = true; } } return output; } } phoenix/Makefile000664 001750 001750 00000001477 12651764221 015033 0ustar00sergiosergio000000 000000 ifeq ($(platform),) phoenixflags = $(cppflags) $(flags) -DPHOENIX_REFERENCE phoenixlink = else ifeq ($(platform),windows) phoenixflags = $(cppflags) $(flags) -DPHOENIX_WINDOWS phoenixlink = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lole32 -lcomctl32 -lcomdlg32 -luxtheme -lmsimg32 -lshlwapi else ifeq ($(platform),macosx) phoenixflags = $(objcppflags) $(flags) -DPHOENIX_COCOA phoenixlink = -framework Cocoa -framework Carbon else ifeq ($(phoenix),) phoenix := gtk endif ifeq ($(phoenix),gtk) phoenixflags = $(cppflags) $(flags) -DPHOENIX_GTK `pkg-config --cflags gtk+-2.0` phoenixlink = `pkg-config --libs gtk+-2.0` endif ifeq ($(phoenix),qt) phoenixflags = $(cppflags) $(flags) -DPHOENIX_QT `pkg-config --cflags QtCore QtGui` phoenixlink = `pkg-config --libs QtCore QtGui` endif endif phoenix/windows/widget/horizontal-scroller.cpp000664 001750 001750 00000002275 12651764221 023065 0ustar00sergiosergio000000 000000 namespace phoenix { Size pHorizontalScroller::minimumSize() { return {0, 18}; } void pHorizontalScroller::setLength(unsigned length) { length += (length == 0); SetScrollRange(hwnd, SB_CTL, 0, length - 1, TRUE); horizontalScroller.setPosition(0); } void pHorizontalScroller::setPosition(unsigned position) { SetScrollPos(hwnd, SB_CTL, position, TRUE); } void pHorizontalScroller::constructor() { hwnd = CreateWindow( L"SCROLLBAR", L"", WS_CHILD | WS_TABSTOP | SBS_HORZ, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&horizontalScroller); unsigned position = horizontalScroller.state.position; setLength(horizontalScroller.state.length); horizontalScroller.setPosition(position); synchronize(); } void pHorizontalScroller::destructor() { DestroyWindow(hwnd); } void pHorizontalScroller::orphan() { destructor(); constructor(); } void pHorizontalScroller::onChange(WPARAM wparam) { unsigned position = ScrollEvent(hwnd, wparam); if(position == horizontalScroller.state.position) return; horizontalScroller.state.position = position; if(horizontalScroller.onChange) horizontalScroller.onChange(); } } fc/cartridge/board/konami-vrc7.cpp000664 001750 001750 00000001656 12651764221 020204 0ustar00sergiosergio000000 000000 struct KonamiVRC7 : Board { VRC7 vrc7; void main() { return vrc7.main(); } uint8 prg_read(unsigned addr) { if(addr < 0x6000) return cpu.mdr(); if(addr < 0x8000) return prgram.read(addr); return prgrom.read(vrc7.prg_addr(addr)); } void prg_write(unsigned addr, uint8 data) { if(addr < 0x6000) return; if(addr < 0x8000) return prgram.write(addr, data); return vrc7.reg_write(addr, data); } uint8 chr_read(unsigned addr) { if(addr & 0x2000) return ppu.ciram_read(vrc7.ciram_addr(addr)); return chrram.read(vrc7.chr_addr(addr)); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) return ppu.ciram_write(vrc7.ciram_addr(addr), data); return chrram.write(vrc7.chr_addr(addr), data); } void power() { vrc7.power(); } void reset() { vrc7.reset(); } void serialize(serializer& s) { Board::serialize(s); vrc7.serialize(s); } KonamiVRC7(Markup::Node& document) : Board(document), vrc7(*this) { } }; sfc/chip/icd2/000700 001750 001750 00000000000 12656700342 014212 5ustar00sergiosergio000000 000000 sfc/controller/controller.cpp000664 001750 001750 00000002301 12651764221 017531 0ustar00sergiosergio000000 000000 #include #define CONTROLLER_CPP namespace SuperFamicom { #include "gamepad/gamepad.cpp" #include "multitap/multitap.cpp" #include "mouse/mouse.cpp" #include "superscope/superscope.cpp" #include "justifier/justifier.cpp" #include "usart/usart.cpp" void Controller::Enter() { if(co_active() == input.port1->thread) input.port1->enter(); if(co_active() == input.port2->thread) input.port2->enter(); } void Controller::enter() { while(true) step(1); } void Controller::step(unsigned clocks) { clock += clocks * (uint64)cpu.frequency; synchronize_cpu(); } void Controller::synchronize_cpu() { if(CPU::Threaded == true) { if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cpu.thread); } else { while(clock >= 0) cpu.enter(); } } bool Controller::iobit() { if (port == Controller::Port1) return cpu.pio() & 0x40; else return cpu.pio() & 0x80; } void Controller::iobit(bool data) { if (port == Controller::Port1) bus.write(0x4201, (cpu.pio() & ~0x40) | (data << 6)); else bus.write(0x4201, (cpu.pio() & ~0x80) | (data << 7)); } Controller::Controller(bool port) : port(port) { if(!thread) create(Controller::Enter, 1); } } sfc/alt/smp/core/op_mov.cpp000664 001750 001750 00000013571 12651764221 017004 0ustar00sergiosergio000000 000000 case 0x7d: { op_io(); regs.a = regs.x; regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0xdd: { op_io(); regs.a = regs.y; regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0x5d: { op_io(); regs.x = regs.a; regs.p.n = !!(regs.x & 0x80); regs.p.z = (regs.x == 0); break; } case 0xfd: { op_io(); regs.y = regs.a; regs.p.n = !!(regs.y & 0x80); regs.p.z = (regs.y == 0); break; } case 0x9d: { op_io(); regs.x = regs.sp; regs.p.n = !!(regs.x & 0x80); regs.p.z = (regs.x == 0); break; } case 0xbd: { op_io(); regs.sp = regs.x; break; } case 0xe8: { regs.a = op_readpc(); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0xcd: { regs.x = op_readpc(); regs.p.n = !!(regs.x & 0x80); regs.p.z = (regs.x == 0); break; } case 0x8d: { regs.y = op_readpc(); regs.p.n = !!(regs.y & 0x80); regs.p.z = (regs.y == 0); break; } case 0xe6: { op_io(); regs.a = op_readdp(regs.x); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0xbf: { op_io(); regs.a = op_readdp(regs.x++); op_io(); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0xe4: { sp = op_readpc(); regs.a = op_readdp(sp); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0xf8: { sp = op_readpc(); regs.x = op_readdp(sp); regs.p.n = !!(regs.x & 0x80); regs.p.z = (regs.x == 0); break; } case 0xeb: { sp = op_readpc(); regs.y = op_readdp(sp); regs.p.n = !!(regs.y & 0x80); regs.p.z = (regs.y == 0); break; } case 0xf4: { sp = op_readpc(); op_io(); regs.a = op_readdp(sp + regs.x); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0xf9: { sp = op_readpc(); op_io(); regs.x = op_readdp(sp + regs.y); regs.p.n = !!(regs.x & 0x80); regs.p.z = (regs.x == 0); break; } case 0xfb: { sp = op_readpc(); op_io(); regs.y = op_readdp(sp + regs.x); regs.p.n = !!(regs.y & 0x80); regs.p.z = (regs.y == 0); break; } case 0xe5: { sp = op_readpc(); sp |= op_readpc() << 8; regs.a = op_readaddr(sp); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0xe9: { sp = op_readpc(); sp |= op_readpc() << 8; regs.x = op_readaddr(sp); regs.p.n = !!(regs.x & 0x80); regs.p.z = (regs.x == 0); break; } case 0xec: { sp = op_readpc(); sp |= op_readpc() << 8; regs.y = op_readaddr(sp); regs.p.n = !!(regs.y & 0x80); regs.p.z = (regs.y == 0); break; } case 0xf5: { sp = op_readpc(); sp |= op_readpc() << 8; op_io(); regs.a = op_readaddr(sp + regs.x); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0xf6: { sp = op_readpc(); sp |= op_readpc() << 8; op_io(); regs.a = op_readaddr(sp + regs.y); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0xe7: { dp = op_readpc() + regs.x; op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; regs.a = op_readaddr(sp); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0xf7: { dp = op_readpc(); op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; regs.a = op_readaddr(sp + regs.y); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0xfa: { sp = op_readpc(); rd = op_readdp(sp); dp = op_readpc(); op_writedp(dp, rd); break; } case 0x8f: { rd = op_readpc(); dp = op_readpc(); op_readdp(dp); op_writedp(dp, rd); break; } case 0xc6: { op_io(); op_readdp(regs.x); op_writedp(regs.x, regs.a); break; } case 0xaf: { op_io(); op_io(); op_writedp(regs.x++, regs.a); break; } case 0xc4: { dp = op_readpc(); op_readdp(dp); op_writedp(dp, regs.a); break; } case 0xd8: { dp = op_readpc(); op_readdp(dp); op_writedp(dp, regs.x); break; } case 0xcb: { dp = op_readpc(); op_readdp(dp); op_writedp(dp, regs.y); break; } case 0xd4: { dp = op_readpc(); op_io(); dp += regs.x; op_readdp(dp); op_writedp(dp, regs.a); break; } case 0xd9: { dp = op_readpc(); op_io(); dp += regs.y; op_readdp(dp); op_writedp(dp, regs.x); break; } case 0xdb: { dp = op_readpc(); op_io(); dp += regs.x; op_readdp(dp); op_writedp(dp, regs.y); break; } case 0xc5: { dp = op_readpc(); dp |= op_readpc() << 8; op_readaddr(dp); op_writeaddr(dp, regs.a); break; } case 0xc9: { dp = op_readpc(); dp |= op_readpc() << 8; op_readaddr(dp); op_writeaddr(dp, regs.x); break; } case 0xcc: { dp = op_readpc(); dp |= op_readpc() << 8; op_readaddr(dp); op_writeaddr(dp, regs.y); break; } case 0xd5: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); dp += regs.x; op_readaddr(dp); op_writeaddr(dp, regs.a); break; } case 0xd6: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); dp += regs.y; op_readaddr(dp); op_writeaddr(dp, regs.a); break; } case 0xc7: { sp = op_readpc(); op_io(); sp += regs.x; dp = op_readdp(sp); dp |= op_readdp(sp + 1) << 8; op_readaddr(dp); op_writeaddr(dp, regs.a); break; } case 0xd7: { sp = op_readpc(); dp = op_readdp(sp); dp |= op_readdp(sp + 1) << 8; op_io(); dp += regs.y; op_readaddr(dp); op_writeaddr(dp, regs.a); break; } case 0xba: { sp = op_readpc(); regs.a = op_readdp(sp); op_io(); regs.y = op_readdp(sp + 1); regs.p.n = !!(regs.ya & 0x8000); regs.p.z = (regs.ya == 0); break; } case 0xda: { dp = op_readpc(); op_readdp(dp); op_writedp(dp, regs.a); op_writedp(dp + 1, regs.y); break; } case 0xaa: { sp = op_readpc(); sp |= op_readpc() << 8; bit = sp >> 13; sp &= 0x1fff; rd = op_readaddr(sp); regs.p.c = !!(rd & (1 << bit)); break; } case 0xca: { dp = op_readpc(); dp |= op_readpc() << 8; bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); if(regs.p.c)rd |= (1 << bit); else rd &= ~(1 << bit); op_io(); op_writeaddr(dp, rd); break; } sfc/chip/bsx/bsx.hpp000664 001750 001750 00000001441 12651764221 015507 0ustar00sergiosergio000000 000000 struct BSXCartridge { MappedRAM rom; MappedRAM ram; MappedRAM psram; void init(); void load(); void unload(); void power(); void reset(); uint8 memory_access(bool write, Memory& memory, unsigned addr, uint8 data); uint8 memory_read(Memory& memory, unsigned addr); void memory_write(Memory& memory, unsigned addr, uint8 data); uint8 mcu_access(bool write, unsigned addr, uint8 data = 0x00); uint8 mcu_read(unsigned addr); void mcu_write(unsigned addr, uint8 data); uint8 mmio_read(unsigned addr); void mmio_write(unsigned addr, uint8 data); void mmio_commit(); void serialize(serializer&); private: uint8 r[16]; bool r00, r01, r02, r03; bool r04, r05, r06, r07; bool r08, r09, r0a, r0b; bool r0c, r0d, r0e, r0f; }; extern BSXCartridge bsxcartridge; sfc/chip/sharprtc/time.cpp000664 001750 001750 00000003407 12651764221 016702 0ustar00sergiosergio000000 000000 const unsigned SharpRTC::daysinmonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; void SharpRTC::tick_second() { if(++second < 60) return; second = 0; tick_minute(); } void SharpRTC::tick_minute() { if(++minute < 60) return; minute = 0; tick_hour(); } void SharpRTC::tick_hour() { if(++hour < 24) return; hour = 0; tick_day(); } void SharpRTC::tick_day() { unsigned days = daysinmonth[month % 12]; //add one day for leap years if(year % 400 == 0) days++; else if(year % 100 == 0); else if(year % 4 == 0) days++; if(day++ < days) return; day = 1; tick_month(); } void SharpRTC::tick_month() { if(month++ < 12) return; month = 1; tick_year(); } void SharpRTC::tick_year() { year++; year = (uint12)year; } //returns day of week for specified date //eg 0 = Sunday, 1 = Monday, ... 6 = Saturday //usage: calculate_weekday(2008, 1, 1) returns weekday of January 1st, 2008 unsigned SharpRTC::calculate_weekday(unsigned year, unsigned month, unsigned day) { unsigned y = 1000, m = 1; //SharpRTC epoch is 1000-01-01 unsigned sum = 0; //number of days passed since epoch year = max(1000, year); month = max(1, min(12, month)); day = max(1, min(31, day)); while(y < year) { bool leapyear = false; if(y % 4 == 0) { leapyear = true; if(y % 100 == 0 && y % 400 != 0) leapyear = false; } sum += 365 + leapyear; y++; } while(m < month) { unsigned days = daysinmonth[m - 1]; bool leapyearmonth = false; if(days == 28) { if(y % 4 == 0) { leapyearmonth = true; if(y % 100 == 0 && y % 400 != 0) leapyearmonth = false; } } sum += days + leapyearmonth; m++; } sum += day - 1; return (sum + 3) % 7; //1000-01-01 was a Wednesday } phoenix/cocoa/action/radio-item.cpp000664 001750 001750 00000002176 12651764221 020467 0ustar00sergiosergio000000 000000 @implementation CocoaRadioItem : NSMenuItem -(id) initWith:(phoenix::RadioItem&)radioItemReference { if(self = [super initWithTitle:@"" action:@selector(activate) keyEquivalent:@""]) { radioItem = &radioItemReference; [self setTarget:self]; [self setOnStateImage:[NSImage imageNamed:@"NSMenuRadio"]]; } return self; } -(void) activate { radioItem->setChecked(); if(radioItem->onActivate) radioItem->onActivate(); } @end namespace phoenix { void pRadioItem::setChecked() { @autoreleasepool { for(auto& item : radioItem.state.group) { auto state = (&item == &radioItem) ? NSOnState : NSOffState; [item.p.cocoaAction setState:state]; } } } void pRadioItem::setGroup(const group& group) { } void pRadioItem::setText(string text) { @autoreleasepool { [cocoaAction setTitle:[NSString stringWithUTF8String:text]]; } } void pRadioItem::constructor() { @autoreleasepool { cocoaAction = cocoaRadioItem = [[CocoaRadioItem alloc] initWith:radioItem]; setText(radioItem.state.text); } } void pRadioItem::destructor() { @autoreleasepool { [cocoaAction release]; } } } phoenix/cocoa/widget/frame.hpp000664 001750 001750 00000000772 12651764221 017542 0ustar00sergiosergio000000 000000 @interface CocoaFrame : NSBox { @public phoenix::Frame* frame; } -(id) initWith:(phoenix::Frame&)frame; @end namespace phoenix { struct pFrame : public pWidget { Frame& frame; CocoaFrame* cocoaFrame = nullptr; void setEnabled(bool enabled); void setFont(string font); void setGeometry(Geometry geometry); void setText(string text); void setVisible(bool visible); pFrame(Frame& frame) : pWidget(frame), frame(frame) {} void constructor(); void destructor(); void orphan(); }; } profile/Super Famicom.sys/ipl.rom000664 001750 001750 00000000100 12651764221 020111 0ustar00sergiosergio000000 000000 x/~ ~]sfc/chip/icd2/mmio/mmio.cpp000664 001750 001750 00000004427 12651764221 016644 0ustar00sergiosergio000000 000000 #ifdef ICD2_CPP //convert linear pixel data to 2bpp planar tiledata void ICD2::render(const uint32* source) { memset(lcd.output, 0x00, 320 * sizeof(uint16)); for(unsigned y = 0; y < 8; y++) { for(unsigned x = 0; x < 160; x++) { unsigned pixel = *source++; unsigned addr = y * 2 + (x / 8 * 16); lcd.output[addr + 0] |= ((pixel & 1) >> 0) << (7 - (x & 7)); lcd.output[addr + 1] |= ((pixel & 2) >> 1) << (7 - (x & 7)); } } } uint8 ICD2::read(unsigned addr) { addr &= 0xffff; //LY counter if(addr == 0x6000) { r6000_ly = GameBoy::ppu.status.ly; r6000_row = lcd.row; return r6000_ly; } //command ready port if(addr == 0x6002) { bool data = packetsize > 0; if(data) { for(unsigned i = 0; i < 16; i++) r7000[i] = packet[0][i]; packetsize--; for(unsigned i = 0; i < packetsize; i++) packet[i] = packet[i + 1]; } return data; } //ICD2 revision if(addr == 0x600f) { return 0x21; } //command port if((addr & 0xfff0) == 0x7000) { return r7000[addr & 15]; } //VRAM port if(addr == 0x7800) { uint8 data = lcd.output[r7800]; r7800 = (r7800 + 1) % 320; return data; } return 0x00; } void ICD2::write(unsigned addr, uint8 data) { addr &= 0xffff; //VRAM port if(addr == 0x6001) { r6001 = data; r7800 = 0; unsigned offset = (r6000_row - (4 - (r6001 - (r6000_ly & 3)))) & 3; render(lcd.buffer + offset * 160 * 8); return; } //control port //d7: 0 = halt, 1 = reset //d5,d4: 0 = 1-player, 1 = 2-player, 2 = 4-player, 3 = ??? //d1,d0: 0 = frequency divider (clock rate adjust) if(addr == 0x6003) { if((r6003 & 0x80) == 0x00 && (data & 0x80) == 0x80) { reset(); } switch(data & 3) { case 0: frequency = cpu.frequency / 4; break; //fast (glitchy, even on real hardware) case 1: frequency = cpu.frequency / 5; break; //normal case 2: frequency = cpu.frequency / 7; break; //slow case 3: frequency = cpu.frequency / 9; break; //very slow } r6003 = data; return; } if(addr == 0x6004) { r6004 = data; return; } //joypad 1 if(addr == 0x6005) { r6005 = data; return; } //joypad 2 if(addr == 0x6006) { r6006 = data; return; } //joypad 3 if(addr == 0x6007) { r6007 = data; return; } //joypad 4 } #endif sfc/alt/ppu-balanced/ppu.cpp000664 001750 001750 00000024335 12651764221 017115 0ustar00sergiosergio000000 000000 #include #define PPU_CPP namespace SuperFamicom { PPU ppu; #include "memory/memory.cpp" #include "mmio/mmio.cpp" #include "render/render.cpp" #include "serialization.cpp" void PPU::step(unsigned clocks) { clock += clocks; } void PPU::synchronize_cpu() { if(CPU::Threaded == true) { if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cpu.thread); } else { while(clock >= 0) cpu.enter(); } } void PPU::Enter() { ppu.enter(); } void PPU::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } //H = 0 (initialize) scanline(); add_clocks(10); //H = 10 (cache mode7 registers + OAM address reset) cache.m7_hofs = regs.m7_hofs; cache.m7_vofs = regs.m7_vofs; cache.m7a = regs.m7a; cache.m7b = regs.m7b; cache.m7c = regs.m7c; cache.m7d = regs.m7d; cache.m7x = regs.m7x; cache.m7y = regs.m7y; if(vcounter() == (!overscan() ? 225 : 240)) { if(regs.display_disabled == false) { regs.oam_addr = regs.oam_baseaddr << 1; regs.oam_firstsprite = (regs.oam_priority == false) ? 0 : (regs.oam_addr >> 2) & 127; } } add_clocks(502); //H = 512 (render) render_scanline(); add_clocks(640); //H = 1152 (cache OBSEL) if(cache.oam_basesize != regs.oam_basesize) { cache.oam_basesize = regs.oam_basesize; sprite_list_valid = false; } cache.oam_nameselect = regs.oam_nameselect; cache.oam_tdaddr = regs.oam_tdaddr; add_clocks(lineclocks() - 1152); //seek to start of next scanline } } void PPU::add_clocks(unsigned clocks) { tick(clocks); step(clocks); synchronize_cpu(); } void PPU::scanline() { line = vcounter(); if(line == 0) { frame(); //RTO flag reset regs.time_over = false; regs.range_over = false; } if(line == 1) { //mosaic reset for(int bg = BG1; bg <= BG4; bg++) regs.bg_y[bg] = 1; regs.mosaic_countdown = regs.mosaic_size + 1; regs.mosaic_countdown--; } else { for(int bg = BG1; bg <= BG4; bg++) { if(!regs.mosaic_enabled[bg] || !regs.mosaic_countdown) regs.bg_y[bg] = line; } if(!regs.mosaic_countdown) regs.mosaic_countdown = regs.mosaic_size + 1; regs.mosaic_countdown--; } } void PPU::render_scanline() { if(line >= 1 && line < (!overscan() ? 225 : 240)) { if(framecounter) return; render_line_oam_rto(); render_line(); } } void PPU::frame() { system.frame(); if(field() == 0) { display.interlace = regs.interlace; regs.scanlines = (regs.overscan == false) ? 224 : 239; } framecounter = (frameskip == 0 ? 0 : (framecounter + 1) % frameskip); } void PPU::enable() { function reader = {&PPU::mmio_read, (PPU*)&ppu}; function writer = {&PPU::mmio_write, (PPU*)&ppu}; bus.map(reader, writer, 0x00, 0x3f, 0x2100, 0x213f); bus.map(reader, writer, 0x80, 0xbf, 0x2100, 0x213f); } void PPU::power() { for(auto& n : vram) n = 0x00; for(auto& n : oam) n = 0x00; for(auto& n : cgram) n = 0x00; flush_tiledata_cache(); region = (system.region() == System::Region::NTSC ? 0 : 1); //0 = NTSC, 1 = PAL regs.ioamaddr = 0x0000; regs.icgramaddr = 0x01ff; //$2100 regs.display_disabled = true; regs.display_brightness = 15; //$2101 regs.oam_basesize = 0; regs.oam_nameselect = 0; regs.oam_tdaddr = 0x0000; cache.oam_basesize = 0; cache.oam_nameselect = 0; cache.oam_tdaddr = 0x0000; //$2102-$2103 regs.oam_baseaddr = 0x0000; regs.oam_addr = 0x0000; regs.oam_priority = false; regs.oam_firstsprite = 0; //$2104 regs.oam_latchdata = 0x00; //$2105 regs.bg_tilesize[BG1] = 0; regs.bg_tilesize[BG2] = 0; regs.bg_tilesize[BG3] = 0; regs.bg_tilesize[BG4] = 0; regs.bg3_priority = 0; regs.bg_mode = 0; //$2106 regs.mosaic_size = 0; regs.mosaic_enabled[BG1] = false; regs.mosaic_enabled[BG2] = false; regs.mosaic_enabled[BG3] = false; regs.mosaic_enabled[BG4] = false; regs.mosaic_countdown = 0; //$2107-$210a regs.bg_scaddr[BG1] = 0x0000; regs.bg_scaddr[BG2] = 0x0000; regs.bg_scaddr[BG3] = 0x0000; regs.bg_scaddr[BG4] = 0x0000; regs.bg_scsize[BG1] = SC_32x32; regs.bg_scsize[BG2] = SC_32x32; regs.bg_scsize[BG3] = SC_32x32; regs.bg_scsize[BG4] = SC_32x32; //$210b-$210c regs.bg_tdaddr[BG1] = 0x0000; regs.bg_tdaddr[BG2] = 0x0000; regs.bg_tdaddr[BG3] = 0x0000; regs.bg_tdaddr[BG4] = 0x0000; //$210d-$2114 regs.bg_ofslatch = 0x00; regs.m7_hofs = regs.m7_vofs = 0x0000; regs.bg_hofs[BG1] = regs.bg_vofs[BG1] = 0x0000; regs.bg_hofs[BG2] = regs.bg_vofs[BG2] = 0x0000; regs.bg_hofs[BG3] = regs.bg_vofs[BG3] = 0x0000; regs.bg_hofs[BG4] = regs.bg_vofs[BG4] = 0x0000; //$2115 regs.vram_incmode = 1; regs.vram_mapping = 0; regs.vram_incsize = 1; //$2116-$2117 regs.vram_addr = 0x0000; //$211a regs.mode7_repeat = 0; regs.mode7_vflip = false; regs.mode7_hflip = false; //$211b-$2120 regs.m7_latch = 0x00; regs.m7a = 0x0000; regs.m7b = 0x0000; regs.m7c = 0x0000; regs.m7d = 0x0000; regs.m7x = 0x0000; regs.m7y = 0x0000; //$2121 regs.cgram_addr = 0x0000; //$2122 regs.cgram_latchdata = 0x00; //$2123-$2125 regs.window1_enabled[BG1] = false; regs.window1_enabled[BG2] = false; regs.window1_enabled[BG3] = false; regs.window1_enabled[BG4] = false; regs.window1_enabled[OAM] = false; regs.window1_enabled[COL] = false; regs.window1_invert [BG1] = false; regs.window1_invert [BG2] = false; regs.window1_invert [BG3] = false; regs.window1_invert [BG4] = false; regs.window1_invert [OAM] = false; regs.window1_invert [COL] = false; regs.window2_enabled[BG1] = false; regs.window2_enabled[BG2] = false; regs.window2_enabled[BG3] = false; regs.window2_enabled[BG4] = false; regs.window2_enabled[OAM] = false; regs.window2_enabled[COL] = false; regs.window2_invert [BG1] = false; regs.window2_invert [BG2] = false; regs.window2_invert [BG3] = false; regs.window2_invert [BG4] = false; regs.window2_invert [OAM] = false; regs.window2_invert [COL] = false; //$2126-$2129 regs.window1_left = 0x00; regs.window1_right = 0x00; regs.window2_left = 0x00; regs.window2_right = 0x00; //$212a-$212b regs.window_mask[BG1] = 0; regs.window_mask[BG2] = 0; regs.window_mask[BG3] = 0; regs.window_mask[BG4] = 0; regs.window_mask[OAM] = 0; regs.window_mask[COL] = 0; //$212c-$212d regs.bg_enabled[BG1] = false; regs.bg_enabled[BG2] = false; regs.bg_enabled[BG3] = false; regs.bg_enabled[BG4] = false; regs.bg_enabled[OAM] = false; regs.bgsub_enabled[BG1] = false; regs.bgsub_enabled[BG2] = false; regs.bgsub_enabled[BG3] = false; regs.bgsub_enabled[BG4] = false; regs.bgsub_enabled[OAM] = false; //$212e-$212f regs.window_enabled[BG1] = false; regs.window_enabled[BG2] = false; regs.window_enabled[BG3] = false; regs.window_enabled[BG4] = false; regs.window_enabled[OAM] = false; regs.sub_window_enabled[BG1] = false; regs.sub_window_enabled[BG2] = false; regs.sub_window_enabled[BG3] = false; regs.sub_window_enabled[BG4] = false; regs.sub_window_enabled[OAM] = false; //$2130 regs.color_mask = 0; regs.colorsub_mask = 0; regs.addsub_mode = false; regs.direct_color = false; //$2131 regs.color_mode = 0; regs.color_halve = false; regs.color_enabled[BACK] = false; regs.color_enabled[OAM] = false; regs.color_enabled[BG4] = false; regs.color_enabled[BG3] = false; regs.color_enabled[BG2] = false; regs.color_enabled[BG1] = false; //$2132 regs.color_r = 0x00; regs.color_g = 0x00; regs.color_b = 0x00; regs.color_rgb = 0x0000; //$2133 regs.mode7_extbg = false; regs.pseudo_hires = false; regs.overscan = false; regs.scanlines = 224; regs.oam_interlace = false; regs.interlace = false; //$2137 regs.hcounter = 0; regs.vcounter = 0; regs.latch_hcounter = 0; regs.latch_vcounter = 0; regs.counters_latched = false; //$2139-$213a regs.vram_readbuffer = 0x0000; //$213e regs.time_over = false; regs.range_over = false; reset(); } void PPU::reset() { create(Enter, system.cpu_frequency()); PPUcounter::reset(); memset(surface, 0, 512 * 512 * sizeof(uint32)); frame(); //$2100 regs.display_disabled = true; display.interlace = false; display.overscan = false; regs.scanlines = 224; memset(sprite_list, 0, sizeof(sprite_list)); sprite_list_valid = false; //open bus support regs.ppu1_mdr = 0xff; regs.ppu2_mdr = 0xff; //bg line counters regs.bg_y[0] = 0; regs.bg_y[1] = 0; regs.bg_y[2] = 0; regs.bg_y[3] = 0; } void PPU::layer_enable(unsigned layer, unsigned priority, bool enable) { switch(layer * 4 + priority) { case 0: layer_enabled[BG1][0] = enable; break; case 1: layer_enabled[BG1][1] = enable; break; case 4: layer_enabled[BG2][0] = enable; break; case 5: layer_enabled[BG2][1] = enable; break; case 8: layer_enabled[BG3][0] = enable; break; case 9: layer_enabled[BG3][1] = enable; break; case 12: layer_enabled[BG4][0] = enable; break; case 13: layer_enabled[BG4][1] = enable; break; case 16: layer_enabled[OAM][0] = enable; break; case 17: layer_enabled[OAM][1] = enable; break; case 18: layer_enabled[OAM][2] = enable; break; case 19: layer_enabled[OAM][3] = enable; break; } } void PPU::set_frameskip(unsigned frameskip_) { frameskip = frameskip_; framecounter = 0; } PPU::PPU() { surface = new uint32[512 * 512]; output = surface + 16 * 512; alloc_tiledata_cache(); for(unsigned l = 0; l < 16; l++) { for(unsigned i = 0; i < 4096; i++) { mosaic_table[l][i] = (i / (l + 1)) * (l + 1); } } layer_enabled[BG1][0] = true; layer_enabled[BG1][1] = true; layer_enabled[BG2][0] = true; layer_enabled[BG2][1] = true; layer_enabled[BG3][0] = true; layer_enabled[BG3][1] = true; layer_enabled[BG4][0] = true; layer_enabled[BG4][1] = true; layer_enabled[OAM][0] = true; layer_enabled[OAM][1] = true; layer_enabled[OAM][2] = true; layer_enabled[OAM][3] = true; frameskip = 0; framecounter = 0; } PPU::~PPU() { delete[] surface; free_tiledata_cache(); } } sfc/system/000700 001750 001750 00000000000 12656700342 013772 5ustar00sergiosergio000000 000000 phoenix/cocoa/mouse.hpp000664 001750 001750 00000000166 12651764221 016312 0ustar00sergiosergio000000 000000 namespace phoenix { struct pMouse { static Position position(); static bool pressed(Mouse::Button button); }; } sfc/chip/necdsp/000700 001750 001750 00000000000 12656700342 014645 5ustar00sergiosergio000000 000000 phoenix/windows/desktop.cpp000664 001750 001750 00000000475 12651764221 017237 0ustar00sergiosergio000000 000000 namespace phoenix { Size pDesktop::size() { return {GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN)}; } Geometry pDesktop::workspace() { RECT rc; SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0); return {rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top}; } } fc/ppu/000700 001750 001750 00000000000 12656700342 013067 5ustar00sergiosergio000000 000000 gba/memory/000700 001750 001750 00000000000 12656700342 013734 5ustar00sergiosergio000000 000000 phoenix/qt/action/action.cpp000664 001750 001750 00000003351 12651764221 017246 0ustar00sergiosergio000000 000000 namespace phoenix { void pAction::setEnabled(bool enabled) { if(dynamic_cast(&action)) { ((Menu&)action).p.qtMenu->setEnabled(enabled); } else if(dynamic_cast(&action)) { ((Separator&)action).p.qtAction->setEnabled(enabled); } else if(dynamic_cast(&action)) { ((Item&)action).p.qtAction->setEnabled(enabled); } else if(dynamic_cast(&action)) { ((CheckItem&)action).p.qtAction->setEnabled(enabled); } else if(dynamic_cast(&action)) { ((RadioItem&)action).p.qtAction->setEnabled(enabled); } } void pAction::setFont(string font) { QFont qtFont = pFont::create(font); if(dynamic_cast(&action)) { ((Menu&)action).p.setFont(font); } else if(dynamic_cast(&action)) { ((Separator&)action).p.qtAction->setFont(qtFont); } else if(dynamic_cast(&action)) { ((Item&)action).p.qtAction->setFont(qtFont); } else if(dynamic_cast(&action)) { ((CheckItem&)action).p.qtAction->setFont(qtFont); } else if(dynamic_cast(&action)) { ((RadioItem&)action).p.qtAction->setFont(qtFont); } } void pAction::setVisible(bool visible) { if(dynamic_cast(&action)) { ((Menu&)action).p.qtMenu->menuAction()->setVisible(visible); } else if(dynamic_cast(&action)) { ((Separator&)action).p.qtAction->setVisible(visible); } else if(dynamic_cast(&action)) { ((Item&)action).p.qtAction->setVisible(visible); } else if(dynamic_cast(&action)) { ((CheckItem&)action).p.qtAction->setVisible(visible); } else if(dynamic_cast(&action)) { ((RadioItem&)action).p.qtAction->setVisible(visible); } } void pAction::constructor() { } void pAction::destructor() { } } sfc/alt/smp/core/op_misc.cpp000664 001750 001750 00000011012 12651764221 017122 0ustar00sergiosergio000000 000000 case 0x00: { op_io(); break; } case 0xef: { op_io(); op_io(); regs.pc--; break; } case 0xff: { op_io(); op_io(); regs.pc--; break; } case 0x9f: { op_io(); op_io(); op_io(); op_io(); regs.a = (regs.a >> 4) | (regs.a << 4); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0xdf: { op_io(); op_io(); if(regs.p.c || (regs.a) > 0x99) { regs.a += 0x60; regs.p.c = 1; } if(regs.p.h || (regs.a & 15) > 0x09) { regs.a += 0x06; } regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0xbe: { op_io(); op_io(); if(!regs.p.c || (regs.a) > 0x99) { regs.a -= 0x60; regs.p.c = 0; } if(!regs.p.h || (regs.a & 15) > 0x09) { regs.a -= 0x06; } regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } case 0x60: { op_io(); regs.p.c = 0; break; } case 0x20: { op_io(); regs.p.p = 0; break; } case 0x80: { op_io(); regs.p.c = 1; break; } case 0x40: { op_io(); regs.p.p = 1; break; } case 0xe0: { op_io(); regs.p.v = 0; regs.p.h = 0; break; } case 0xed: { op_io(); op_io(); regs.p.c = !regs.p.c; break; } case 0xa0: { op_io(); op_io(); regs.p.i = 1; break; } case 0xc0: { op_io(); op_io(); regs.p.i = 0; break; } case 0x02: { dp = op_readpc(); rd = op_readdp(dp); rd |= 0x01; op_writedp(dp, rd); break; } case 0x12: { dp = op_readpc(); rd = op_readdp(dp); rd &= ~0x01; op_writedp(dp, rd); break; } case 0x22: { dp = op_readpc(); rd = op_readdp(dp); rd |= 0x02; op_writedp(dp, rd); break; } case 0x32: { dp = op_readpc(); rd = op_readdp(dp); rd &= ~0x02; op_writedp(dp, rd); break; } case 0x42: { dp = op_readpc(); rd = op_readdp(dp); rd |= 0x04; op_writedp(dp, rd); break; } case 0x52: { dp = op_readpc(); rd = op_readdp(dp); rd &= ~0x04; op_writedp(dp, rd); break; } case 0x62: { dp = op_readpc(); rd = op_readdp(dp); rd |= 0x08; op_writedp(dp, rd); break; } case 0x72: { dp = op_readpc(); rd = op_readdp(dp); rd &= ~0x08; op_writedp(dp, rd); break; } case 0x82: { dp = op_readpc(); rd = op_readdp(dp); rd |= 0x10; op_writedp(dp, rd); break; } case 0x92: { dp = op_readpc(); rd = op_readdp(dp); rd &= ~0x10; op_writedp(dp, rd); break; } case 0xa2: { dp = op_readpc(); rd = op_readdp(dp); rd |= 0x20; op_writedp(dp, rd); break; } case 0xb2: { dp = op_readpc(); rd = op_readdp(dp); rd &= ~0x20; op_writedp(dp, rd); break; } case 0xc2: { dp = op_readpc(); rd = op_readdp(dp); rd |= 0x40; op_writedp(dp, rd); break; } case 0xd2: { dp = op_readpc(); rd = op_readdp(dp); rd &= ~0x40; op_writedp(dp, rd); break; } case 0xe2: { dp = op_readpc(); rd = op_readdp(dp); rd |= 0x80; op_writedp(dp, rd); break; } case 0xf2: { dp = op_readpc(); rd = op_readdp(dp); rd &= ~0x80; op_writedp(dp, rd); break; } case 0x2d: { op_io(); op_io(); op_writestack(regs.a); break; } case 0x4d: { op_io(); op_io(); op_writestack(regs.x); break; } case 0x6d: { op_io(); op_io(); op_writestack(regs.y); break; } case 0x0d: { op_io(); op_io(); op_writestack(regs.p); break; } case 0xae: { op_io(); op_io(); regs.a = op_readstack(); break; } case 0xce: { op_io(); op_io(); regs.x = op_readstack(); break; } case 0xee: { op_io(); op_io(); regs.y = op_readstack(); break; } case 0x8e: { op_io(); op_io(); regs.p = op_readstack(); break; } case 0xcf: { op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); ya = regs.y * regs.a; regs.a = ya; regs.y = ya >> 8; //result is set based on y (high-byte) only regs.p.n = !!(regs.y & 0x80); regs.p.z = (regs.y == 0); break; } case 0x9e: { op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); op_io(); ya = regs.ya; //overflow set if quotient >= 256 regs.p.v = !!(regs.y >= regs.x); regs.p.h = !!((regs.y & 15) >= (regs.x & 15)); if(regs.y < (regs.x << 1)) { //if quotient is <= 511 (will fit into 9-bit result) regs.a = ya / regs.x; regs.y = ya % regs.x; } else { //otherwise, the quotient won't fit into regs.p.v + regs.a //this emulates the odd behavior of the S-SMP in this case regs.a = 255 - (ya - (regs.x << 9)) / (256 - regs.x); regs.y = regs.x + (ya - (regs.x << 9)) % (256 - regs.x); } //result is set based on a (quotient) only regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); break; } processor/hg51b/hg51b.hpp000664 001750 001750 00000001044 12651764221 016253 0ustar00sergiosergio000000 000000 #ifndef PROCESSOR_HG51B_HPP #define PROCESSOR_HG51B_HPP namespace Processor { //Hitachi HG51B169 (HG51BS family/derivative?) struct HG51B { //uint16 programROM[2][256]; uint24 dataROM[1024]; uint8 dataRAM[3072]; #include "registers.hpp" void exec(uint24 addr); virtual uint8 bus_read(uint24 addr) = 0; virtual void bus_write(uint24 addr, uint8 data) = 0; void power(); void serialize(serializer&); protected: void push(); void pull(); unsigned sa(); unsigned ri(); unsigned np(); void instruction(); }; } #endif phoenix/reference/widget/viewport.cpp000664 001750 001750 00000000275 12651764221 021172 0ustar00sergiosergio000000 000000 namespace phoenix { uintptr_t pViewport::handle() { return 0; } void pViewport::setDroppable(bool droppable) { } void pViewport::constructor() { } void pViewport::destructor() { } } sfc/cheat/cheat.cpp000664 001750 001750 00000001251 12651764221 015336 0ustar00sergiosergio000000 000000 #include #define CHEAT_CPP namespace SuperFamicom { Cheat cheat; void Cheat::reset() { codes.reset(); } void Cheat::append(unsigned addr, unsigned data) { codes.append({addr, Unused, data}); } void Cheat::append(unsigned addr, unsigned comp, unsigned data) { codes.append({addr, comp, data}); } optional Cheat::find(unsigned addr, unsigned comp) { //WRAM mirroring: $00-3f,80-bf:0000-1fff -> $7e:0000-1fff if((addr & 0x40e000) == 0x000000) addr = 0x7e0000 | (addr & 0x1fff); for(auto& code : codes) { if(code.addr == addr && (code.comp == Unused || code.comp == comp)) { return {true, code.data}; } } return false; } } sfc/smp/timing.cpp000664 001750 001750 00000003132 12651764221 015254 0ustar00sergiosergio000000 000000 #ifdef SMP_CPP void SMP::add_clocks(unsigned clocks) { step(clocks); synchronize_dsp(); #if defined(DEBUGGER) synchronize_cpu(); #else //forcefully sync S-SMP to S-CPU in case chips are not communicating //sync if S-SMP is more than 24 samples ahead of S-CPU if(clock > +(768 * 24 * (int64)24000000)) synchronize_cpu(); #endif } void SMP::cycle_edge() { timer0.tick(); timer1.tick(); timer2.tick(); //TEST register S-SMP speed control //24 clocks have already been added for this cycle at this point switch(status.clock_speed) { case 0: break; //100% speed case 1: add_clocks(24); break; // 50% speed case 2: while(true) add_clocks(24); // 0% speed -- locks S-SMP case 3: add_clocks(24 * 9); break; // 10% speed } } template void SMP::Timer::tick() { //stage 0 increment stage0_ticks += smp.status.timer_step; if(stage0_ticks < timer_frequency) return; stage0_ticks -= timer_frequency; //stage 1 increment stage1_ticks ^= 1; synchronize_stage1(); } template void SMP::Timer::synchronize_stage1() { bool new_line = stage1_ticks; if(smp.status.timers_enable == false) new_line = false; if(smp.status.timers_disable == true) new_line = false; bool old_line = current_line; current_line = new_line; if(old_line != 1 || new_line != 0) return; //only pulse on 1->0 transition //stage 2 increment if(enable == false) return; if(++stage2_ticks != target) return; //stage 3 increment stage2_ticks = 0; stage3_ticks++; } #endif nall/string/markup/xml.hpp000664 001750 001750 00000013600 12651764221 016754 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP //XML v1.0 subset parser //revision 0.03 namespace nall { namespace XML { struct Node : Markup::Node { protected: inline string escape() const { string result = data; result.replace("&", "&"); result.replace("<", "<"); result.replace(">", ">"); if(attribute == false) return result; result.replace("\'", "'"); result.replace("\"", """); return result; } inline bool isName(char c) const { if(c >= 'A' && c <= 'Z') return true; if(c >= 'a' && c <= 'z') return true; if(c >= '0' && c <= '9') return true; if(c == '.' || c == '_') return true; if(c == '?') return true; return false; } inline bool isWhitespace(char c) const { if(c == ' ' || c == '\t') return true; if(c == '\r' || c == '\n') return true; return false; } //copy part of string from source document into target string; decode markup while copying inline void copy(string& target, const char* source, unsigned length) { target.reserve(length + 1); #if defined(NALL_XML_LITERAL) memcpy(target(), source, length); target[length] = 0; return; #endif char* output = target.data(); while(length) { if(*source == '&') { if(!memcmp(source, "<", 4)) { *output++ = '<'; source += 4; length -= 4; continue; } if(!memcmp(source, ">", 4)) { *output++ = '>'; source += 4; length -= 4; continue; } if(!memcmp(source, "&", 5)) { *output++ = '&'; source += 5; length -= 5; continue; } if(!memcmp(source, "'", 6)) { *output++ = '\''; source += 6; length -= 6; continue; } if(!memcmp(source, """, 6)) { *output++ = '\"'; source += 6; length -= 6; continue; } } if(attribute == false && source[0] == '<' && source[1] == '!') { //comment if(!memcmp(source, "", 3)) source++, length--; source += 3, length -= 3; continue; } //CDATA if(!memcmp(source, "", 3)) *output++ = *source++, length--; source += 3, length -= 3; continue; } } *output++ = *source++, length--; } *output = 0; } inline bool parseExpression(const char*& p) { if(*(p + 1) != '!') return false; //comment if(!memcmp(p, "", 3)) p++; if(!*p) throw "unclosed comment"; p += 3; return true; } //CDATA if(!memcmp(p, "", 3)) p++; if(!*p) throw "unclosed CDATA"; p += 3; return true; } //DOCTYPE if(!memcmp(p, "') counter--; } while(counter); return true; } return false; } //returns true if tag closes itself (); false if not () inline bool parseHead(const char*& p) { //parse name const char* nameStart = ++p; //skip '<' while(isName(*p)) p++; const char* nameEnd = p; copy(name, nameStart, nameEnd - nameStart); if(name.empty()) throw "missing element name"; //parse attributes while(*p) { while(isWhitespace(*p)) p++; if(!*p) throw "unclosed attribute"; if(*p == '?' || *p == '/' || *p == '>') break; //parse attribute name Node attribute; attribute.attribute = true; const char* nameStart = p; while(isName(*p)) p++; const char* nameEnd = p; copy(attribute.name, nameStart, nameEnd - nameStart); if(attribute.name.empty()) throw "missing attribute name"; //parse attribute data if(*p++ != '=') throw "missing attribute value"; char terminal = *p++; if(terminal != '\'' && terminal != '\"') throw "attribute value not quoted"; const char* dataStart = p; while(*p && *p != terminal) p++; if(!*p) throw "missing attribute data terminal"; const char* dataEnd = p++; //skip closing terminal copy(attribute.data, dataStart, dataEnd - dataStart); children.append(attribute); } //parse closure if(*p == '?' && *(p + 1) == '>') { p += 2; return true; } if(*p == '/' && *(p + 1) == '>') { p += 2; return true; } if(*p == '>') { p += 1; return false; } throw "invalid element tag"; } //parse element and all of its child elements inline void parseElement(const char*& p) { Node node; if(node.parseHead(p) == false) node.parse(p); children.append(node); } //return true if matches this node's name inline bool parseClosureElement(const char*& p) { if(p[0] != '<' || p[1] != '/') return false; p += 2; const char* nameStart = p; while(*p && *p != '>') p++; if(*p != '>') throw "unclosed closure element"; const char* nameEnd = p++; if(memcmp(name, nameStart, nameEnd - nameStart)) throw "closure element name mismatch"; return true; } //parse contents of an element inline void parse(const char*& p) { const char* dataStart = p; const char* dataEnd = p; while(*p) { while(*p && *p != '<') p++; if(!*p) break; dataEnd = p; if(parseClosureElement(p) == true) break; if(parseExpression(p) == true) continue; parseElement(p); } copy(data, dataStart, dataEnd - dataStart); } }; struct Document : Node { string error; inline bool load(const char* document) { if(document == nullptr) return false; reset(); try { parse(document); } catch(const char* error) { reset(); this->error = error; return false; } return true; } inline Document() {} inline Document(const char* document) { load(document); } }; } } #endif gb/interface/interface.hpp000664 001750 001750 00000002211 12651764221 016705 0ustar00sergiosergio000000 000000 #ifndef GB_HPP namespace GameBoy { #endif struct ID { enum : unsigned { System, GameBoy, SuperGameBoy, GameBoyColor, }; enum : unsigned { GameBoyBootROM, SuperGameBoyBootROM, GameBoyColorBootROM, Manifest, ROM, RAM, }; enum : unsigned { Device = 1, }; }; struct Interface : Emulator::Interface { //Super Game Boy bindings struct Hook { virtual void lcdScanline() {} virtual void joypWrite(bool p15, bool p14) {} }; Hook* hook = nullptr; void lcdScanline(); void joypWrite(bool p15, bool p14); string title(); double videoFrequency(); double audioFrequency(); bool loaded(); string sha256(); unsigned group(unsigned id); void load(unsigned id); void save(); void load(unsigned id, const stream& stream); void save(unsigned id, const stream& stream); void unload(); void power(); void reset(); void run(); serializer serialize(); bool unserialize(serializer&); void cheatSet(const lstring&); void paletteUpdate(PaletteMode mode); Interface(); private: vector device; }; extern Interface* interface; #ifndef GB_HPP } #endif nall/string/utility.hpp000664 001750 001750 00000005227 12651764221 016366 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { string substr(rstring source, unsigned offset, unsigned length) { string result; if(length == ~0u) length = source.size() - offset; result.resize(length); memcpy(result.data(), source.data() + offset, length); return result; } string sha256(const uint8_t* data, unsigned size) { sha256_ctx sha; uint8_t hash[32]; sha256_init(&sha); sha256_chunk(&sha, data, size); sha256_final(&sha); sha256_hash(&sha, hash); string result; for(auto& byte : hash) result.append(hex<2>(byte)); return result; } bool tokenize(lstring& list, const char* s, const char* p) { while(*s) { if(*p == '*') { const char* b = s; while(*s) { if(tokenize(list, s++, p + 1)) { list.prepend(substr(b, 0, --s - b)); return true; } } list.prepend(b); return !*++p; } if(*s++ != *p++) return false; } while(*p == '*') { list.prepend(s); p++; } return !*p; } char* integer(char* result, intmax_t value) { bool negative = value < 0; if(negative) value = -value; char buffer[64]; unsigned size = 0; do { unsigned n = value % 10; buffer[size++] = '0' + n; value /= 10; } while(value); if(negative) buffer[size++] = '-'; //buffer[size++] = negative ? '-' : '+'; for(signed x = size - 1, y = 0; x >= 0 && y < size; x--, y++) result[x] = buffer[y]; result[size] = 0; return result; } char* decimal(char* result, uintmax_t value) { char buffer[64]; unsigned size = 0; do { unsigned n = value % 10; buffer[size++] = '0' + n; value /= 10; } while(value); for(signed x = size - 1, y = 0; x >= 0 && y < size; x--, y++) result[x] = buffer[y]; result[size] = 0; return result; } //using sprintf is certainly not the most ideal method to convert //a double to a string ... but attempting to parse a double by //hand, digit-by-digit, results in subtle rounding errors. unsigned real(char* str, long double value) { char buffer[256]; #ifdef _WIN32 //Windows C-runtime does not support long double via sprintf() sprintf(buffer, "%f", (double)value); #else sprintf(buffer, "%Lf", value); #endif //remove excess 0's in fraction (2.500000 -> 2.5) for(char* p = buffer; *p; p++) { if(*p == '.') { char* p = buffer + strlen(buffer) - 1; while(*p == '0') { if(*(p - 1) != '.') *p = 0; //... but not for eg 1.0 -> 1. p--; } break; } } unsigned length = strlen(buffer); if(str) strcpy(str, buffer); return length + 1; } string real(long double value) { string temp; temp.resize(real(nullptr, value)); real(temp.data(), value); return temp; } } #endif processor/hg51b/registers.cpp000664 001750 001750 00000004652 12651764221 017357 0ustar00sergiosergio000000 000000 #ifdef PROCESSOR_HG51B_HPP uint24 HG51B::reg_read(uint8 addr) const { switch(addr) { case 0x00: return regs.a; case 0x01: return regs.acch; case 0x02: return regs.accl; case 0x03: return regs.busdata; case 0x08: return regs.romdata; case 0x0c: return regs.ramdata; case 0x13: return regs.busaddr; case 0x1c: return regs.ramaddr; case 0x50: return 0x000000; case 0x51: return 0xffffff; case 0x52: return 0x00ff00; case 0x53: return 0xff0000; case 0x54: return 0x00ffff; case 0x55: return 0xffff00; case 0x56: return 0x800000; case 0x57: return 0x7fffff; case 0x58: return 0x008000; case 0x59: return 0x007fff; case 0x5a: return 0xff7fff; case 0x5b: return 0xffff7f; case 0x5c: return 0x010000; case 0x5d: return 0xfeffff; case 0x5e: return 0x000100; case 0x5f: return 0x00feff; case 0x60: return regs.gpr[ 0]; case 0x61: return regs.gpr[ 1]; case 0x62: return regs.gpr[ 2]; case 0x63: return regs.gpr[ 3]; case 0x64: return regs.gpr[ 4]; case 0x65: return regs.gpr[ 5]; case 0x66: return regs.gpr[ 6]; case 0x67: return regs.gpr[ 7]; case 0x68: return regs.gpr[ 8]; case 0x69: return regs.gpr[ 9]; case 0x6a: return regs.gpr[10]; case 0x6b: return regs.gpr[11]; case 0x6c: return regs.gpr[12]; case 0x6d: return regs.gpr[13]; case 0x6e: return regs.gpr[14]; case 0x6f: return regs.gpr[15]; } return 0x000000; } void HG51B::reg_write(uint8 addr, uint24 data) { switch(addr) { case 0x00: regs.a = data; return; case 0x01: regs.acch = data; return; case 0x02: regs.accl = data; return; case 0x03: regs.busdata = data; return; case 0x08: regs.romdata = data; return; case 0x0c: regs.ramdata = data; return; case 0x13: regs.busaddr = data; return; case 0x1c: regs.ramaddr = data; return; case 0x60: regs.gpr[ 0] = data; return; case 0x61: regs.gpr[ 1] = data; return; case 0x62: regs.gpr[ 2] = data; return; case 0x63: regs.gpr[ 3] = data; return; case 0x64: regs.gpr[ 4] = data; return; case 0x65: regs.gpr[ 5] = data; return; case 0x66: regs.gpr[ 6] = data; return; case 0x67: regs.gpr[ 7] = data; return; case 0x68: regs.gpr[ 8] = data; return; case 0x69: regs.gpr[ 9] = data; return; case 0x6a: regs.gpr[10] = data; return; case 0x6b: regs.gpr[11] = data; return; case 0x6c: regs.gpr[12] = data; return; case 0x6d: regs.gpr[13] = data; return; case 0x6e: regs.gpr[14] = data; return; case 0x6f: regs.gpr[15] = data; return; } } #endif fc/apu/000700 001750 001750 00000000000 12656700342 013050 5ustar00sergiosergio000000 000000 nall/string/eval/parser.hpp000664 001750 001750 00000016277 12651764221 017115 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { namespace Eval { inline bool whitespace(char n) { return n == ' ' || n == '\t' || n == '\r' || n == '\n'; } inline void parse(Node*& node, const char*& s, unsigned depth) { auto unaryPrefix = [&](Node::Type type, unsigned seek, unsigned depth) { auto parent = new Node(type); parse(parent->link(0) = new Node, s += seek, depth); node = parent; }; auto unarySuffix = [&](Node::Type type, unsigned seek, unsigned depth) { auto parent = new Node(type); parent->link(0) = node; parse(parent, s += seek, depth); node = parent; }; auto binary = [&](Node::Type type, unsigned seek, unsigned depth) { auto parent = new Node(type); parent->link(0) = node; parse(parent->link(1) = new Node, s += seek, depth); node = parent; }; auto ternary = [&](Node::Type type, unsigned seek, unsigned depth) { auto parent = new Node(type); parent->link(0) = node; parse(parent->link(1) = new Node, s += seek, depth); if(s[0] != ':') throw "mismatched ternary"; parse(parent->link(2) = new Node, s += seek, depth); node = parent; }; auto separator = [&](Node::Type type, unsigned seek, unsigned depth) { if(node->type != Node::Type::Separator) return binary(type, seek, depth); unsigned n = node->link.size(); parse(node->link(n) = new Node, s += seek, depth); }; while(whitespace(s[0])) s++; if(!s[0]) return; if(s[0] == '(' && node->link.empty()) { parse(node, s += 1, 1); if(*s++ != ')') throw "mismatched group"; } if(isLiteral(s)) { node->type = Node::Type::Literal; node->literal = literal(s); } #define p() (node->literal.empty() && node->link.empty()) while(true) { while(whitespace(s[0])) s++; if(!s[0]) return; if(depth >= 13) break; if(s[0] == '(' && !p()) { binary(Node::Type::Function, 1, 1); if(*s++ != ')') throw "mismatched function"; continue; } if(s[0] == '[') { binary(Node::Type::Subscript, 1, 1); if(*s++ != ']') throw "mismatched subscript"; continue; } if(s[0] == '.') { binary(Node::Type::Member, 1, 13); continue; } if(s[0] == '+' && s[1] == '+' && !p()) { unarySuffix(Node::Type::SuffixIncrement, 2, 13); continue; } if(s[0] == '-' && s[1] == '-' && !p()) { unarySuffix(Node::Type::SuffixDecrement, 2, 13); continue; } if(s[0] == '&' && p()) { unaryPrefix(Node::Type::Reference, 1, 12); continue; } if(s[0] == '*' && p()) { unaryPrefix(Node::Type::Dereference, 1, 12); continue; } if(s[0] == '!' && p()) { unaryPrefix(Node::Type::LogicalNot, 1, 12); continue; } if(s[0] == '~' && p()) { unaryPrefix(Node::Type::BitwiseNot, 1, 12); continue; } if(s[0] == '+' && s[1] != '+' && p()) { unaryPrefix(Node::Type::Positive, 1, 12); continue; } if(s[0] == '-' && s[1] != '-' && p()) { unaryPrefix(Node::Type::Negative, 1, 12); continue; } if(s[0] == '+' && s[1] == '+' && p()) { unaryPrefix(Node::Type::PrefixIncrement, 2, 12); continue; } if(s[0] == '-' && s[1] == '-' && p()) { unaryPrefix(Node::Type::PrefixDecrement, 2, 12); continue; } if(depth >= 12) break; if(depth >= 11) break; if(s[0] == '*' && s[1] != '=') { binary(Node::Type::Multiply, 1, 11); continue; } if(s[0] == '/' && s[1] != '=') { binary(Node::Type::Divide, 1, 11); continue; } if(s[0] == '%' && s[1] != '=') { binary(Node::Type::Modulo, 1, 11); continue; } if(depth >= 10) break; if(s[0] == '+' && s[1] != '=') { binary(Node::Type::Add, 1, 10); continue; } if(s[0] == '-' && s[1] != '=') { binary(Node::Type::Subtract, 1, 10); continue; } if(depth >= 9) break; if(s[0] == '<' && s[1] == '<' && s[2] == '<' && s[3] != '=') { binary(Node::Type::RotateLeft, 3, 9); continue; } if(s[0] == '>' && s[1] == '>' && s[2] == '>' && s[3] != '=') { binary(Node::Type::RotateRight, 3, 9); continue; } if(s[0] == '<' && s[1] == '<' && s[2] != '=') { binary(Node::Type::ShiftLeft, 2, 9); continue; } if(s[0] == '>' && s[1] == '>' && s[2] != '=') { binary(Node::Type::ShiftRight, 2, 9); continue; } if(depth >= 8) break; if(s[0] == '&' && s[1] != '&' && s[1] != '=') { binary(Node::Type::BitwiseAnd, 1, 8); continue; } if(s[0] == '|' && s[1] != '|' && s[1] != '=') { binary(Node::Type::BitwiseOr, 1, 8); continue; } if(s[0] == '^' && s[1] != '^' && s[1] != '=') { binary(Node::Type::BitwiseXor, 1, 8); continue; } if(depth >= 7) break; if(s[0] == '~' && s[1] != '=') { binary(Node::Type::Concatenate, 1, 7); continue; } if(depth >= 6) break; if(s[0] == '=' && s[1] == '=') { binary(Node::Type::Equal, 2, 6); continue; } if(s[0] == '!' && s[1] == '=') { binary(Node::Type::NotEqual, 2, 6); continue; } if(s[0] == '<' && s[1] == '=') { binary(Node::Type::LessThanEqual, 2, 6); continue; } if(s[0] == '>' && s[1] == '=') { binary(Node::Type::GreaterThanEqual, 2, 6); continue; } if(s[0] == '<') { binary(Node::Type::LessThan, 1, 6); continue; } if(s[0] == '>') { binary(Node::Type::GreaterThan, 1, 6); continue; } if(depth >= 5) break; if(s[0] == '&' && s[1] == '&') { binary(Node::Type::LogicalAnd, 2, 5); continue; } if(s[0] == '|' && s[1] == '|') { binary(Node::Type::LogicalOr, 2, 5); continue; } if(s[0] == '?' && s[1] == '?') { binary(Node::Type::Coalesce, 2, 4); continue; } if(s[0] == '?' && s[1] != '?') { ternary(Node::Type::Condition, 1, 4); continue; } if(depth >= 4) break; if(s[0] == '=') { binary(Node::Type::Assign, 1, 3); continue; } if(s[0] == ':' && s[1] == '=') { binary(Node::Type::Create, 2, 3); continue; } if(s[0] == '*' && s[1] == '=') { binary(Node::Type::AssignMultiply, 2, 3); continue; } if(s[0] == '/' && s[1] == '=') { binary(Node::Type::AssignDivide, 2, 3); continue; } if(s[0] == '%' && s[1] == '=') { binary(Node::Type::AssignModulo, 2, 3); continue; } if(s[0] == '+' && s[1] == '=') { binary(Node::Type::AssignAdd, 2, 3); continue; } if(s[0] == '-' && s[1] == '=') { binary(Node::Type::AssignSubtract, 2, 3); continue; } if(s[0] == '<' && s[1] == '<' && s[2] == '<' && s[3] == '=') { binary(Node::Type::AssignRotateLeft, 4, 3); continue; } if(s[0] == '>' && s[1] == '>' && s[2] == '>' && s[3] == '=') { binary(Node::Type::AssignRotateRight, 4, 3); continue; } if(s[0] == '<' && s[1] == '<' && s[2] == '=') { binary(Node::Type::AssignShiftLeft, 3, 3); continue; } if(s[0] == '>' && s[1] == '>' && s[2] == '=') { binary(Node::Type::AssignShiftRight, 3, 3); continue; } if(s[0] == '&' && s[1] == '=') { binary(Node::Type::AssignBitwiseAnd, 2, 3); continue; } if(s[0] == '|' && s[1] == '=') { binary(Node::Type::AssignBitwiseOr, 2, 3); continue; } if(s[0] == '^' && s[1] == '=') { binary(Node::Type::AssignBitwiseXor, 2, 3); continue; } if(s[0] == '~' && s[1] == '=') { binary(Node::Type::AssignConcatenate, 2, 3); continue; } if(depth >= 3) break; if(depth >= 2) break; if(s[0] == ',') { separator(Node::Type::Separator, 1, 2); continue; } if(depth >= 1 && (s[0] == ')' || s[0] == ']')) break; while(whitespace(s[0])) s++; if(!s[0]) break; throw "unrecognized terminal"; } #undef p } inline Node* parse(const string& expression) { auto result = new Node; const char* p = expression; parse(result, p, 0); return result; } } } #endif nall/vector.hpp000664 001750 001750 00000016270 12651764221 014657 0ustar00sergiosergio000000 000000 #ifndef NALL_VECTOR_HPP #define NALL_VECTOR_HPP #include #include #include #include #include #include #include #include namespace nall { template struct vector { struct exception_out_of_bounds{}; protected: T* pool = nullptr; unsigned poolbase = 0; unsigned poolsize = 0; unsigned objectsize = 0; public: explicit operator bool() const { return objectsize; } T* data() { return pool + poolbase; } const T* data() const { return pool + poolbase; } bool empty() const { return objectsize == 0; } unsigned size() const { return objectsize; } unsigned capacity() const { return poolsize; } T* move() { T* result = pool + poolbase; pool = nullptr; poolbase = 0; poolsize = 0; objectsize = 0; return result; } void reset() { if(pool) { for(unsigned n = 0; n < objectsize; n++) pool[poolbase + n].~T(); free(pool); } pool = nullptr; poolbase = 0; poolsize = 0; objectsize = 0; } void reserve(unsigned size) { if(size <= poolsize) return; size = bit::round(size); //amortize growth T* copy = (T*)calloc(size, sizeof(T)); for(unsigned n = 0; n < objectsize; n++) new(copy + n) T(std::move(pool[poolbase + n])); free(pool); pool = copy; poolbase = 0; poolsize = size; } void resize(unsigned size) { T* copy = (T*)calloc(size, sizeof(T)); for(unsigned n = 0; n < size && n < objectsize; n++) new(copy + n) T(std::move(pool[poolbase + n])); reset(); pool = copy; poolbase = 0; poolsize = size; objectsize = size; } template void prepend(const T& data, Args&&... args) { prepend(std::forward(args)...); prepend(data); } T& prepend(const T& data) { reserve(objectsize + 1); if(poolbase == 0) { unsigned available = poolsize - objectsize; poolbase = max(1u, available >> 1); for(signed n = objectsize - 1; n >= 0; n--) { pool[poolbase + n] = std::move(pool[n]); } } new(pool + --poolbase) T(data); objectsize++; return first(); } template void append(const T& data, Args&&... args) { append(data); append(std::forward(args)...); } T& append(const T& data) { reserve(poolbase + objectsize + 1); new(pool + poolbase + objectsize++) T(data); return last(); } bool appendOnce(const T& data) { if(find(data)) return false; return append(data), true; } void insert(unsigned position, const T& data) { if(position == 0) return prepend(data); append(data); if(position == ~0u) return; for(signed n = objectsize - 1; n > position; n--) { pool[poolbase + n] = std::move(pool[poolbase + n - 1]); } pool[poolbase + position] = data; } void remove(unsigned position = ~0u, unsigned length = 1) { if(position == ~0u) position = objectsize - 1; if(position + length > objectsize) throw exception_out_of_bounds{}; if(position == 0) { for(unsigned n = 0; n < length; n++) pool[poolbase + n].~T(); poolbase += length; } else { for(unsigned n = position; n < objectsize; n++) { if(n + length < objectsize) { pool[poolbase + n] = std::move(pool[poolbase + n + length]); } else { pool[poolbase + n].~T(); } } } objectsize -= length; } void removeFirst() { return remove(0); } void removeLast() { return remove(~0u); } T take(unsigned position = ~0u) { if(position == ~0u) position = objectsize - 1; T object = pool[poolbase + position]; remove(position); return object; } T takeFirst() { return take(0); } T takeLast() { return take(~0u); } void reverse() { unsigned pivot = size() / 2; for(unsigned l = 0, r = size() - 1; l < pivot; l++, r--) { std::swap(pool[poolbase + l], pool[poolbase + r]); } } void sort() { nall::sort(pool + poolbase, objectsize); } template void sort(const Comparator &lessthan) { nall::sort(pool + poolbase, objectsize, lessthan); } optional find(const T& data) { for(unsigned n = 0; n < objectsize; n++) if(pool[poolbase + n] == data) return {true, n}; return false; } T& first() { if(objectsize == 0) throw exception_out_of_bounds(); return pool[poolbase]; } const T& first() const { if(objectsize == 0) throw exception_out_of_bounds(); return pool[poolbase]; } T& last() { if(objectsize == 0) throw exception_out_of_bounds(); return pool[poolbase + objectsize - 1]; } const T& last() const { if(objectsize == 0) throw exception_out_of_bounds(); return pool[poolbase + objectsize - 1]; } //access inline T& operator[](unsigned position) { if(position >= objectsize) throw exception_out_of_bounds(); return pool[poolbase + position]; } inline const T& operator[](unsigned position) const { if(position >= objectsize) throw exception_out_of_bounds(); return pool[poolbase + position]; } inline T& operator()(unsigned position) { if(position >= poolsize) reserve(position + 1); while(position >= objectsize) append(T()); return pool[poolbase + position]; } inline const T& operator()(unsigned position, const T& data) const { if(position >= objectsize) return data; return pool[poolbase + position]; } //iteration struct iterator { T& operator*() { return source.operator[](position); } bool operator!=(const iterator& source) const { return position != source.position; } iterator& operator++() { position++; return *this; } iterator(vector& source, unsigned position) : source(source), position(position) {} private: vector& source; unsigned position; }; iterator begin() { return iterator(*this, 0); } iterator end() { return iterator(*this, size()); } struct constIterator { const T& operator*() const { return source.operator[](position); } bool operator!=(const constIterator& source) const { return position != source.position; } constIterator& operator++() { position++; return *this; } constIterator(const vector& source, unsigned position) : source(source), position(position) {} private: const vector& source; unsigned position; }; const constIterator begin() const { return constIterator(*this, 0); } const constIterator end() const { return constIterator(*this, size()); } //copy inline vector& operator=(const vector& source) { reset(); reserve(source.size()); for(auto& data : source) append(data); return *this; } //move inline vector& operator=(vector&& source) { reset(); pool = source.pool; poolbase = source.poolbase; poolsize = source.poolsize; objectsize = source.objectsize; source.pool = nullptr; source.poolbase = 0; source.poolsize = 0; source.objectsize = 0; return *this; } //construction and destruction vector() = default; vector(std::initializer_list list) { for(auto& data : list) append(data); } vector(const vector& source) { operator=(source); } vector(vector&& source) { operator=(std::move(source)); } ~vector() { reset(); } }; } #endif sfc/base/satellaview/satellaview.cpp000664 001750 001750 00000005736 12651764221 020754 0ustar00sergiosergio000000 000000 #include #define SATELLAVIEW_BASE_UNIT_CPP namespace SuperFamicom { SatellaviewBaseUnit satellaviewbaseunit; void SatellaviewBaseUnit::init() { } void SatellaviewBaseUnit::load() { bus.map( {&SatellaviewBaseUnit::read, &satellaviewbaseunit}, {&SatellaviewBaseUnit::write, &satellaviewbaseunit}, 0x00, 0x3f, 0x2188, 0x219f ); bus.map( {&SatellaviewBaseUnit::read, &satellaviewbaseunit}, {&SatellaviewBaseUnit::write, &satellaviewbaseunit}, 0x80, 0xbf, 0x2188, 0x219f ); } void SatellaviewBaseUnit::unload() { } void SatellaviewBaseUnit::power() { } void SatellaviewBaseUnit::reset() { memset(®s, 0x00, sizeof regs); } uint8 SatellaviewBaseUnit::read(unsigned addr) { addr &= 0xffff; switch(addr) { case 0x2188: return regs.r2188; case 0x2189: return regs.r2189; case 0x218a: return regs.r218a; case 0x218c: return regs.r218c; case 0x218e: return regs.r218e; case 0x218f: return regs.r218f; case 0x2190: return regs.r2190; case 0x2192: { unsigned counter = regs.r2192_counter++; if(regs.r2192_counter >= 18) regs.r2192_counter = 0; if(counter == 0) { time_t rawtime; time(&rawtime); tm* t = localtime(&rawtime); regs.r2192_hour = t->tm_hour; regs.r2192_minute = t->tm_min; regs.r2192_second = t->tm_sec; } switch(counter) { case 0: return 0x00; //??? case 1: return 0x00; //??? case 2: return 0x00; //??? case 3: return 0x00; //??? case 4: return 0x00; //??? case 5: return 0x01; case 6: return 0x01; case 7: return 0x00; case 8: return 0x00; case 9: return 0x00; case 10: return regs.r2192_second; case 11: return regs.r2192_minute; case 12: return regs.r2192_hour; case 13: return 0x00; //??? case 14: return 0x00; //??? case 15: return 0x00; //??? case 16: return 0x00; //??? case 17: return 0x00; //??? } } break; case 0x2193: return regs.r2193 & ~0x0c; case 0x2194: return regs.r2194; case 0x2196: return regs.r2196; case 0x2197: return regs.r2197; case 0x2199: return regs.r2199; } return cpu.regs.mdr; } void SatellaviewBaseUnit::write(unsigned addr, uint8 data) { addr &= 0xffff; switch(addr) { case 0x2188: { regs.r2188 = data; } break; case 0x2189: { regs.r2189 = data; } break; case 0x218a: { regs.r218a = data; } break; case 0x218b: { regs.r218b = data; } break; case 0x218c: { regs.r218c = data; } break; case 0x218e: { regs.r218e = data; } break; case 0x218f: { regs.r218e >>= 1; regs.r218e = regs.r218f - regs.r218e; regs.r218f >>= 1; } break; case 0x2191: { regs.r2191 = data; regs.r2192_counter = 0; } break; case 0x2192: { regs.r2190 = 0x80; } break; case 0x2193: { regs.r2193 = data; } break; case 0x2194: { regs.r2194 = data; } break; case 0x2197: { regs.r2197 = data; } break; case 0x2199: { regs.r2199 = data; } break; } } } sfc/dsp/counter.cpp000664 001750 001750 00000002177 12651764221 015443 0ustar00sergiosergio000000 000000 #ifdef DSP_CPP //counter_rate = number of samples per counter event //all rates are evenly divisible by counter_range (0x7800, 30720, or 2048 * 5 * 3) //note that rate[0] is a special case, which never triggers const uint16 DSP::counter_rate[32] = { 0, 2048, 1536, 1280, 1024, 768, 640, 512, 384, 320, 256, 192, 160, 128, 96, 80, 64, 48, 40, 32, 24, 20, 16, 12, 10, 8, 6, 5, 4, 3, 2, 1, }; //counter_offset = counter offset from zero //counters do not appear to be aligned at zero for all rates const uint16 DSP::counter_offset[32] = { 0, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 0, 0, }; inline void DSP::counter_tick() { state.counter--; if(state.counter < 0) state.counter = counter_range - 1; } //return true if counter event should trigger inline bool DSP::counter_poll(unsigned rate) { if(rate == 0) return false; return (((unsigned)state.counter + counter_offset[rate]) % counter_rate[rate]) == 0; } #endif sfc/chip/dsp4/dsp4emu.h000664 001750 001750 00000007162 12651764221 016020 0ustar00sergiosergio000000 000000 //DSP-4 emulator code //Copyright (c) 2004-2006 Dreamer Nom, John Weidman, Kris Bleakley, Nach, z80 gaiden #ifndef DSP4EMU_H #define DSP4EMU_H #undef TRUE #undef FALSE #define TRUE true #define FALSE false struct DSP4_t { bool8 waiting4command; bool8 half_command; uint16 command; uint32 in_count; uint32 in_index; uint32 out_count; uint32 out_index; uint8 parameters[512]; uint8 output[512]; }; extern struct DSP4_t DSP4; struct DSP4_vars_t { // op control int8 DSP4_Logic; // controls op flow // projection format int16 lcv; // loop-control variable int16 distance; // z-position into virtual world int16 raster; // current raster line int16 segments; // number of raster lines drawn // 1.15.16 or 1.15.0 [sign, integer, fraction] int32 world_x; // line of x-projection in world int32 world_y; // line of y-projection in world int32 world_dx; // projection line x-delta int32 world_dy; // projection line y-delta int16 world_ddx; // x-delta increment int16 world_ddy; // y-delta increment int32 world_xenv; // world x-shaping factor int16 world_yofs; // world y-vertical scroll int16 view_x1; // current viewer-x int16 view_y1; // current viewer-y int16 view_x2; // future viewer-x int16 view_y2; // future viewer-y int16 view_dx; // view x-delta factor int16 view_dy; // view y-delta factor int16 view_xofs1; // current viewer x-vertical scroll int16 view_yofs1; // current viewer y-vertical scroll int16 view_xofs2; // future viewer x-vertical scroll int16 view_yofs2; // future viewer y-vertical scroll int16 view_yofsenv; // y-scroll shaping factor int16 view_turnoff_x; // road turnoff data int16 view_turnoff_dx; // road turnoff delta factor // drawing area int16 viewport_cx; // x-center of viewport window int16 viewport_cy; // y-center of render window int16 viewport_left; // x-left of viewport int16 viewport_right; // x-right of viewport int16 viewport_top; // y-top of viewport int16 viewport_bottom; // y-bottom of viewport // sprite structure int16 sprite_x; // projected x-pos of sprite int16 sprite_y; // projected y-pos of sprite int16 sprite_attr; // obj attributes bool8 sprite_size; // sprite size: 8x8 or 16x16 int16 sprite_clipy; // visible line to clip pixels off int16 sprite_count; // generic projection variables designed for // two solid polygons + two polygon sides int16 poly_clipLf[2][2]; // left clip boundary int16 poly_clipRt[2][2]; // right clip boundary int16 poly_ptr[2][2]; // HDMA structure pointers int16 poly_raster[2][2]; // current raster line below horizon int16 poly_top[2][2]; // top clip boundary int16 poly_bottom[2][2]; // bottom clip boundary int16 poly_cx[2][2]; // center for left/right points int16 poly_start[2]; // current projection points int16 poly_plane[2]; // previous z-plane distance // OAM int16 OAM_attr[16]; // OAM (size,MSB) data int16 OAM_index; // index into OAM table int16 OAM_bits; // offset into OAM table int16 OAM_RowMax; // maximum number of tiles per 8 aligned pixels (row) int16 OAM_Row[32]; // current number of tiles per row }; extern struct DSP4_vars_t DSP4_vars; #endif target-ethos/window/000700 001750 001750 00000000000 12656700342 015610 5ustar00sergiosergio000000 000000 sfc/chip/dsp4/dsp4emu.c000664 001750 001750 00000167300 12651764221 016014 0ustar00sergiosergio000000 000000 #ifdef DSP4_CPP //DSP-4 emulator code //Copyright (c) 2004-2006 Dreamer Nom, John Weidman, Kris Bleakley, Nach, z80 gaiden /* Due recognition and credit are given on Overload's DSP website. Thank those contributors for their hard work on this chip. Fixed-point math reminder: [sign, integer, fraction] 1.15.00 * 1.15.00 = 2.30.00 -> 1.30.00 (DSP) -> 1.31.00 (LSB is '0') 1.15.00 * 1.00.15 = 2.15.15 -> 1.15.15 (DSP) -> 1.15.16 (LSB is '0') */ #include "dsp4emu.h" struct DSP4_t DSP4; struct DSP4_vars_t DSP4_vars; ////////////////////////////////////////////////////////////// // input protocol static int16 DSP4_READ_WORD() { int16 out; out = READ_WORD(DSP4.parameters + DSP4.in_index); DSP4.in_index += 2; return out; } static int32 DSP4_READ_DWORD() { int32 out; out = READ_DWORD(DSP4.parameters + DSP4.in_index); DSP4.in_index += 4; return out; } ////////////////////////////////////////////////////////////// // output protocol #define DSP4_CLEAR_OUT() \ { DSP4.out_count = 0; DSP4.out_index = 0; } #define DSP4_WRITE_BYTE( d ) \ { WRITE_WORD( DSP4.output + DSP4.out_count, ( d ) ); DSP4.out_count++; } #define DSP4_WRITE_WORD( d ) \ { WRITE_WORD( DSP4.output + DSP4.out_count, ( d ) ); DSP4.out_count += 2; } #ifndef MSB_FIRST #define DSP4_WRITE_16_WORD( d ) \ { memcpy(DSP4.output + DSP4.out_count, ( d ), 32); DSP4.out_count += 32; } #else #define DSP4_WRITE_16_WORD( d ) \ { int16 *p = ( d ), *end = ( d )+16; \ for (; p != end; p++) \ { \ WRITE_WORD( DSP4.output + DSP4.out_count, *p ); \ } \ DSP4.out_count += 32; \ } #endif #ifdef PRINT_OP #define DSP4_WRITE_DEBUG( x, d ) \ WRITE_WORD( nop + x, d ); #endif #ifdef DEBUG_DSP #define DSP4_WRITE_DEBUG( x, d ) \ WRITE_WORD( nop + x, d ); #endif ////////////////////////////////////////////////////////////// // used to wait for dsp i/o #define DSP4_WAIT( x ) \ DSP4.in_index = 0; DSP4_vars.DSP4_Logic = x; return; ////////////////////////////////////////////////////////////// // 1.7.8 -> 1.15.16 #define SEX78( a ) ( ( (int32) ( (int16) (a) ) ) << 8 ) // 1.15.0 -> 1.15.16 #define SEX16( a ) ( ( (int32) ( (int16) (a) ) ) << 16 ) #ifdef PRINT_OP #define U16( a ) ( (uint16) ( a ) ) #endif #ifdef DEBUG_DSP #define U16( a ) ( (uint16) ( a ) ) #endif ////////////////////////////////////////////////////////////// // Attention: This lookup table is not verified static const uint16 div_lut[64] = { 0x0000, 0x8000, 0x4000, 0x2aaa, 0x2000, 0x1999, 0x1555, 0x1249, 0x1000, 0x0e38, 0x0ccc, 0x0ba2, 0x0aaa, 0x09d8, 0x0924, 0x0888, 0x0800, 0x0787, 0x071c, 0x06bc, 0x0666, 0x0618, 0x05d1, 0x0590, 0x0555, 0x051e, 0x04ec, 0x04bd, 0x0492, 0x0469, 0x0444, 0x0421, 0x0400, 0x03e0, 0x03c3, 0x03a8, 0x038e, 0x0375, 0x035e, 0x0348, 0x0333, 0x031f, 0x030c, 0x02fa, 0x02e8, 0x02d8, 0x02c8, 0x02b9, 0x02aa, 0x029c, 0x028f, 0x0282, 0x0276, 0x026a, 0x025e, 0x0253, 0x0249, 0x023e, 0x0234, 0x022b, 0x0222, 0x0219, 0x0210, 0x0208, }; int16 DSP4_Inverse(int16 value) { // saturate bounds if (value < 0) { value = 0; } if (value > 63) { value = 63; } return div_lut[value]; } ////////////////////////////////////////////////////////////// // Prototype void DSP4_OP0B(bool8 *draw, int16 sp_x, int16 sp_y, int16 sp_attr, bool8 size, bool8 stop); ////////////////////////////////////////////////////////////// // OP00 void DSP4_Multiply(int16 Multiplicand, int16 Multiplier, int32 *Product) { *Product = (Multiplicand * Multiplier << 1) >> 1; } ////////////////////////////////////////////////////////////// void DSP4_OP01() { DSP4.waiting4command = FALSE; // op flow control switch (DSP4_vars.DSP4_Logic) { case 1: goto resume1; break; case 2: goto resume2; break; case 3: goto resume3; break; } //////////////////////////////////////////////////// // process initial inputs // sort inputs DSP4_vars.world_y = DSP4_READ_DWORD(); DSP4_vars.poly_bottom[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_top[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_cx[1][0] = DSP4_READ_WORD(); DSP4_vars.viewport_bottom = DSP4_READ_WORD(); DSP4_vars.world_x = DSP4_READ_DWORD(); DSP4_vars.poly_cx[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_ptr[0][0] = DSP4_READ_WORD(); DSP4_vars.world_yofs = DSP4_READ_WORD(); DSP4_vars.world_dy = DSP4_READ_DWORD(); DSP4_vars.world_dx = DSP4_READ_DWORD(); DSP4_vars.distance = DSP4_READ_WORD(); DSP4_READ_WORD(); // 0x0000 DSP4_vars.world_xenv = DSP4_READ_DWORD(); DSP4_vars.world_ddy = DSP4_READ_WORD(); DSP4_vars.world_ddx = DSP4_READ_WORD(); DSP4_vars.view_yofsenv = DSP4_READ_WORD(); // initial (x,y,offset) at starting DSP4_vars.raster line DSP4_vars.view_x1 = (int16)((DSP4_vars.world_x + DSP4_vars.world_xenv) >> 16); DSP4_vars.view_y1 = (int16)(DSP4_vars.world_y >> 16); DSP4_vars.view_xofs1 = (int16)(DSP4_vars.world_x >> 16); DSP4_vars.view_yofs1 = DSP4_vars.world_yofs; DSP4_vars.view_turnoff_x = 0; DSP4_vars.view_turnoff_dx = 0; // first DSP4_vars.raster line DSP4_vars.poly_raster[0][0] = DSP4_vars.poly_bottom[0][0]; do { //////////////////////////////////////////////////// // process one iteration of projection // perspective projection of world (x,y,scroll) points // based on the current projection lines DSP4_vars.view_x2 = (int16)(( ( ( DSP4_vars.world_x + DSP4_vars.world_xenv ) >> 16 ) * DSP4_vars.distance >> 15 ) + ( DSP4_vars.view_turnoff_x * DSP4_vars.distance >> 15 )); DSP4_vars.view_y2 = (int16)((DSP4_vars.world_y >> 16) * DSP4_vars.distance >> 15); DSP4_vars.view_xofs2 = DSP4_vars.view_x2; DSP4_vars.view_yofs2 = (DSP4_vars.world_yofs * DSP4_vars.distance >> 15) + DSP4_vars.poly_bottom[0][0] - DSP4_vars.view_y2; // 1. World x-location before transformation // 2. Viewer x-position at the next // 3. World y-location before perspective projection // 4. Viewer y-position below the horizon // 5. Number of DSP4_vars.raster lines drawn in this iteration DSP4_CLEAR_OUT(); DSP4_WRITE_WORD((uint16)((DSP4_vars.world_x + DSP4_vars.world_xenv) >> 16)); DSP4_WRITE_WORD(DSP4_vars.view_x2); DSP4_WRITE_WORD((uint16)(DSP4_vars.world_y >> 16)); DSP4_WRITE_WORD(DSP4_vars.view_y2); ////////////////////////////////////////////////////// // SR = 0x00 // determine # of DSP4_vars.raster lines used DSP4_vars.segments = DSP4_vars.poly_raster[0][0] - DSP4_vars.view_y2; // prevent overdraw if (DSP4_vars.view_y2 >= DSP4_vars.poly_raster[0][0]) DSP4_vars.segments = 0; else DSP4_vars.poly_raster[0][0] = DSP4_vars.view_y2; // don't draw outside the window if (DSP4_vars.view_y2 < DSP4_vars.poly_top[0][0]) { DSP4_vars.segments = 0; // flush remaining DSP4_vars.raster lines if (DSP4_vars.view_y1 >= DSP4_vars.poly_top[0][0]) DSP4_vars.segments = DSP4_vars.view_y1 - DSP4_vars.poly_top[0][0]; } // SR = 0x80 DSP4_WRITE_WORD(DSP4_vars.segments); ////////////////////////////////////////////////////// // scan next command if no SR check needed if (DSP4_vars.segments) { int32 px_dx, py_dy; int32 x_scroll, y_scroll; // SR = 0x00 // linear interpolation (lerp) between projected points px_dx = (DSP4_vars.view_xofs2 - DSP4_vars.view_xofs1) * DSP4_Inverse(DSP4_vars.segments) << 1; py_dy = (DSP4_vars.view_yofs2 - DSP4_vars.view_yofs1) * DSP4_Inverse(DSP4_vars.segments) << 1; // starting step values x_scroll = SEX16(DSP4_vars.poly_cx[0][0] + DSP4_vars.view_xofs1); y_scroll = SEX16(-DSP4_vars.viewport_bottom + DSP4_vars.view_yofs1 + DSP4_vars.view_yofsenv + DSP4_vars.poly_cx[1][0] - DSP4_vars.world_yofs); // SR = 0x80 // rasterize line for (DSP4_vars.lcv = 0; DSP4_vars.lcv < DSP4_vars.segments; DSP4_vars.lcv++) { // 1. HDMA memory pointer (bg1) // 2. vertical scroll offset ($210E) // 3. horizontal scroll offset ($210D) DSP4_WRITE_WORD(DSP4_vars.poly_ptr[0][0]); DSP4_WRITE_WORD((uint16)((y_scroll + 0x8000) >> 16)); DSP4_WRITE_WORD((uint16)((x_scroll + 0x8000) >> 16)); // update memory address DSP4_vars.poly_ptr[0][0] -= 4; // update screen values x_scroll += px_dx; y_scroll += py_dy; } } //////////////////////////////////////////////////// // Post-update // update new viewer (x,y,scroll) to last DSP4_vars.raster line drawn DSP4_vars.view_x1 = DSP4_vars.view_x2; DSP4_vars.view_y1 = DSP4_vars.view_y2; DSP4_vars.view_xofs1 = DSP4_vars.view_xofs2; DSP4_vars.view_yofs1 = DSP4_vars.view_yofs2; // add deltas for projection lines DSP4_vars.world_dx += SEX78(DSP4_vars.world_ddx); DSP4_vars.world_dy += SEX78(DSP4_vars.world_ddy); // update projection lines DSP4_vars.world_x += (DSP4_vars.world_dx + DSP4_vars.world_xenv); DSP4_vars.world_y += DSP4_vars.world_dy; // update road turnoff position DSP4_vars.view_turnoff_x += DSP4_vars.view_turnoff_dx; //////////////////////////////////////////////////// // command check // scan next command DSP4.in_count = 2; DSP4_WAIT(1) resume1 : // check for termination DSP4_vars.distance = DSP4_READ_WORD(); if (DSP4_vars.distance == -0x8000) break; // road turnoff if( (uint16) DSP4_vars.distance == 0x8001 ) { DSP4.in_count = 6; DSP4_WAIT(2) resume2: DSP4_vars.distance = DSP4_READ_WORD(); DSP4_vars.view_turnoff_x = DSP4_READ_WORD(); DSP4_vars.view_turnoff_dx = DSP4_READ_WORD(); // factor in new changes DSP4_vars.view_x1 += ( DSP4_vars.view_turnoff_x * DSP4_vars.distance >> 15 ); DSP4_vars.view_xofs1 += ( DSP4_vars.view_turnoff_x * DSP4_vars.distance >> 15 ); // update stepping values DSP4_vars.view_turnoff_x += DSP4_vars.view_turnoff_dx; DSP4.in_count = 2; DSP4_WAIT(1) } // already have 2 bytes read DSP4.in_count = 6; DSP4_WAIT(3) resume3 : // inspect inputs DSP4_vars.world_ddy = DSP4_READ_WORD(); DSP4_vars.world_ddx = DSP4_READ_WORD(); DSP4_vars.view_yofsenv = DSP4_READ_WORD(); // no envelope here DSP4_vars.world_xenv = 0; } while (1); // terminate op DSP4.waiting4command = TRUE; } ////////////////////////////////////////////////////////////// void DSP4_OP03() { DSP4_vars.OAM_RowMax = 33; memset(DSP4_vars.OAM_Row, 0, 64); } ////////////////////////////////////////////////////////////// void DSP4_OP05() { DSP4_vars.OAM_index = 0; DSP4_vars.OAM_bits = 0; memset(DSP4_vars.OAM_attr, 0, 32); DSP4_vars.sprite_count = 0; } ////////////////////////////////////////////////////////////// void DSP4_OP06() { DSP4_CLEAR_OUT(); DSP4_WRITE_16_WORD(DSP4_vars.OAM_attr); } ////////////////////////////////////////////////////////////// void DSP4_OP07() { DSP4.waiting4command = FALSE; // op flow control switch (DSP4_vars.DSP4_Logic) { case 1: goto resume1; break; case 2: goto resume2; break; } //////////////////////////////////////////////////// // sort inputs DSP4_vars.world_y = DSP4_READ_DWORD(); DSP4_vars.poly_bottom[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_top[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_cx[1][0] = DSP4_READ_WORD(); DSP4_vars.viewport_bottom = DSP4_READ_WORD(); DSP4_vars.world_x = DSP4_READ_DWORD(); DSP4_vars.poly_cx[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_ptr[0][0] = DSP4_READ_WORD(); DSP4_vars.world_yofs = DSP4_READ_WORD(); DSP4_vars.distance = DSP4_READ_WORD(); DSP4_vars.view_y2 = DSP4_READ_WORD(); DSP4_vars.view_dy = DSP4_READ_WORD() * DSP4_vars.distance >> 15; DSP4_vars.view_x2 = DSP4_READ_WORD(); DSP4_vars.view_dx = DSP4_READ_WORD() * DSP4_vars.distance >> 15; DSP4_vars.view_yofsenv = DSP4_READ_WORD(); // initial (x,y,offset) at starting DSP4_vars.raster line DSP4_vars.view_x1 = (int16)(DSP4_vars.world_x >> 16); DSP4_vars.view_y1 = (int16)(DSP4_vars.world_y >> 16); DSP4_vars.view_xofs1 = DSP4_vars.view_x1; DSP4_vars.view_yofs1 = DSP4_vars.world_yofs; // first DSP4_vars.raster line DSP4_vars.poly_raster[0][0] = DSP4_vars.poly_bottom[0][0]; do { //////////////////////////////////////////////////// // process one iteration of projection // add shaping DSP4_vars.view_x2 += DSP4_vars.view_dx; DSP4_vars.view_y2 += DSP4_vars.view_dy; // vertical scroll calculation DSP4_vars.view_xofs2 = DSP4_vars.view_x2; DSP4_vars.view_yofs2 = (DSP4_vars.world_yofs * DSP4_vars.distance >> 15) + DSP4_vars.poly_bottom[0][0] - DSP4_vars.view_y2; // 1. Viewer x-position at the next // 2. Viewer y-position below the horizon // 3. Number of DSP4_vars.raster lines drawn in this iteration DSP4_CLEAR_OUT(); DSP4_WRITE_WORD(DSP4_vars.view_x2); DSP4_WRITE_WORD(DSP4_vars.view_y2); ////////////////////////////////////////////////////// // SR = 0x00 // determine # of DSP4_vars.raster lines used DSP4_vars.segments = DSP4_vars.view_y1 - DSP4_vars.view_y2; // prevent overdraw if (DSP4_vars.view_y2 >= DSP4_vars.poly_raster[0][0]) DSP4_vars.segments = 0; else DSP4_vars.poly_raster[0][0] = DSP4_vars.view_y2; // don't draw outside the window if (DSP4_vars.view_y2 < DSP4_vars.poly_top[0][0]) { DSP4_vars.segments = 0; // flush remaining DSP4_vars.raster lines if (DSP4_vars.view_y1 >= DSP4_vars.poly_top[0][0]) DSP4_vars.segments = DSP4_vars.view_y1 - DSP4_vars.poly_top[0][0]; } // SR = 0x80 DSP4_WRITE_WORD(DSP4_vars.segments); ////////////////////////////////////////////////////// // scan next command if no SR check needed if (DSP4_vars.segments) { int32 px_dx, py_dy; int32 x_scroll, y_scroll; // SR = 0x00 // linear interpolation (lerp) between projected points px_dx = (DSP4_vars.view_xofs2 - DSP4_vars.view_xofs1) * DSP4_Inverse(DSP4_vars.segments) << 1; py_dy = (DSP4_vars.view_yofs2 - DSP4_vars.view_yofs1) * DSP4_Inverse(DSP4_vars.segments) << 1; // starting step values x_scroll = SEX16(DSP4_vars.poly_cx[0][0] + DSP4_vars.view_xofs1); y_scroll = SEX16(-DSP4_vars.viewport_bottom + DSP4_vars.view_yofs1 + DSP4_vars.view_yofsenv + DSP4_vars.poly_cx[1][0] - DSP4_vars.world_yofs); // SR = 0x80 // rasterize line for (DSP4_vars.lcv = 0; DSP4_vars.lcv < DSP4_vars.segments; DSP4_vars.lcv++) { // 1. HDMA memory pointer (bg2) // 2. vertical scroll offset ($2110) // 3. horizontal scroll offset ($210F) DSP4_WRITE_WORD(DSP4_vars.poly_ptr[0][0]); DSP4_WRITE_WORD((uint16)((y_scroll + 0x8000) >> 16)); DSP4_WRITE_WORD((uint16)((x_scroll + 0x8000) >> 16)); // update memory address DSP4_vars.poly_ptr[0][0] -= 4; // update screen values x_scroll += px_dx; y_scroll += py_dy; } } ///////////////////////////////////////////////////// // Post-update // update new viewer (x,y,scroll) to last DSP4_vars.raster line drawn DSP4_vars.view_x1 = DSP4_vars.view_x2; DSP4_vars.view_y1 = DSP4_vars.view_y2; DSP4_vars.view_xofs1 = DSP4_vars.view_xofs2; DSP4_vars.view_yofs1 = DSP4_vars.view_yofs2; //////////////////////////////////////////////////// // command check // scan next command DSP4.in_count = 2; DSP4_WAIT(1) resume1 : // check for opcode termination DSP4_vars.distance = DSP4_READ_WORD(); if (DSP4_vars.distance == -0x8000) break; // already have 2 bytes in queue DSP4.in_count = 10; DSP4_WAIT(2) resume2 : // inspect inputs DSP4_vars.view_y2 = DSP4_READ_WORD(); DSP4_vars.view_dy = DSP4_READ_WORD() * DSP4_vars.distance >> 15; DSP4_vars.view_x2 = DSP4_READ_WORD(); DSP4_vars.view_dx = DSP4_READ_WORD() * DSP4_vars.distance >> 15; DSP4_vars.view_yofsenv = DSP4_READ_WORD(); } while (1); DSP4.waiting4command = TRUE; } ////////////////////////////////////////////////////////////// void DSP4_OP08() { int16 win_left, win_right; int16 view_x[2], view_y[2]; int16 envelope[2][2]; DSP4.waiting4command = FALSE; // op flow control switch (DSP4_vars.DSP4_Logic) { case 1: goto resume1; break; case 2: goto resume2; break; } //////////////////////////////////////////////////// // process initial inputs for two polygons // clip values DSP4_vars.poly_clipRt[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_clipRt[0][1] = DSP4_READ_WORD(); DSP4_vars.poly_clipRt[1][0] = DSP4_READ_WORD(); DSP4_vars.poly_clipRt[1][1] = DSP4_READ_WORD(); DSP4_vars.poly_clipLf[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_clipLf[0][1] = DSP4_READ_WORD(); DSP4_vars.poly_clipLf[1][0] = DSP4_READ_WORD(); DSP4_vars.poly_clipLf[1][1] = DSP4_READ_WORD(); // unknown (constant) (ex. 1P/2P = $00A6, $00A6, $00A6, $00A6) DSP4_READ_WORD(); DSP4_READ_WORD(); DSP4_READ_WORD(); DSP4_READ_WORD(); // unknown (constant) (ex. 1P/2P = $00A5, $00A5, $00A7, $00A7) DSP4_READ_WORD(); DSP4_READ_WORD(); DSP4_READ_WORD(); DSP4_READ_WORD(); // polygon centering (left,right) DSP4_vars.poly_cx[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_cx[0][1] = DSP4_READ_WORD(); DSP4_vars.poly_cx[1][0] = DSP4_READ_WORD(); DSP4_vars.poly_cx[1][1] = DSP4_READ_WORD(); // HDMA pointer locations DSP4_vars.poly_ptr[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_ptr[0][1] = DSP4_READ_WORD(); DSP4_vars.poly_ptr[1][0] = DSP4_READ_WORD(); DSP4_vars.poly_ptr[1][1] = DSP4_READ_WORD(); // starting DSP4_vars.raster line below the horizon DSP4_vars.poly_bottom[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_bottom[0][1] = DSP4_READ_WORD(); DSP4_vars.poly_bottom[1][0] = DSP4_READ_WORD(); DSP4_vars.poly_bottom[1][1] = DSP4_READ_WORD(); // top boundary line to clip DSP4_vars.poly_top[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_top[0][1] = DSP4_READ_WORD(); DSP4_vars.poly_top[1][0] = DSP4_READ_WORD(); DSP4_vars.poly_top[1][1] = DSP4_READ_WORD(); // unknown // (ex. 1P = $2FC8, $0034, $FF5C, $0035) // // (ex. 2P = $3178, $0034, $FFCC, $0035) // (ex. 2P = $2FC8, $0034, $FFCC, $0035) DSP4_READ_WORD(); DSP4_READ_WORD(); DSP4_READ_WORD(); DSP4_READ_WORD(); // look at guidelines for both polygon shapes DSP4_vars.distance = DSP4_READ_WORD(); view_x[0] = DSP4_READ_WORD(); view_y[0] = DSP4_READ_WORD(); view_x[1] = DSP4_READ_WORD(); view_y[1] = DSP4_READ_WORD(); // envelope shaping guidelines (one frame only) envelope[0][0] = DSP4_READ_WORD(); envelope[0][1] = DSP4_READ_WORD(); envelope[1][0] = DSP4_READ_WORD(); envelope[1][1] = DSP4_READ_WORD(); // starting base values to project from DSP4_vars.poly_start[0] = view_x[0]; DSP4_vars.poly_start[1] = view_x[1]; // starting DSP4_vars.raster lines to begin drawing DSP4_vars.poly_raster[0][0] = view_y[0]; DSP4_vars.poly_raster[0][1] = view_y[0]; DSP4_vars.poly_raster[1][0] = view_y[1]; DSP4_vars.poly_raster[1][1] = view_y[1]; // starting distances DSP4_vars.poly_plane[0] = DSP4_vars.distance; DSP4_vars.poly_plane[1] = DSP4_vars.distance; // SR = 0x00 // re-center coordinates win_left = DSP4_vars.poly_cx[0][0] - view_x[0] + envelope[0][0]; win_right = DSP4_vars.poly_cx[0][1] - view_x[0] + envelope[0][1]; // saturate offscreen data for polygon #1 if (win_left < DSP4_vars.poly_clipLf[0][0]) { win_left = DSP4_vars.poly_clipLf[0][0]; } if (win_left > DSP4_vars.poly_clipRt[0][0]) { win_left = DSP4_vars.poly_clipRt[0][0]; } if (win_right < DSP4_vars.poly_clipLf[0][1]) { win_right = DSP4_vars.poly_clipLf[0][1]; } if (win_right > DSP4_vars.poly_clipRt[0][1]) { win_right = DSP4_vars.poly_clipRt[0][1]; } // SR = 0x80 // initial output for polygon #1 DSP4_CLEAR_OUT(); DSP4_WRITE_BYTE(win_left & 0xff); DSP4_WRITE_BYTE(win_right & 0xff); do { int16 polygon; //////////////////////////////////////////////////// // command check // scan next command DSP4.in_count = 2; DSP4_WAIT(1) resume1 : // terminate op DSP4_vars.distance = DSP4_READ_WORD(); if (DSP4_vars.distance == -0x8000) break; // already have 2 bytes in queue DSP4.in_count = 16; DSP4_WAIT(2) resume2 : // look at guidelines for both polygon shapes view_x[0] = DSP4_READ_WORD(); view_y[0] = DSP4_READ_WORD(); view_x[1] = DSP4_READ_WORD(); view_y[1] = DSP4_READ_WORD(); // envelope shaping guidelines (one frame only) envelope[0][0] = DSP4_READ_WORD(); envelope[0][1] = DSP4_READ_WORD(); envelope[1][0] = DSP4_READ_WORD(); envelope[1][1] = DSP4_READ_WORD(); //////////////////////////////////////////////////// // projection begins // init DSP4_CLEAR_OUT(); ////////////////////////////////////////////// // solid polygon renderer - 2 shapes for (polygon = 0; polygon < 2; polygon++) { int32 left_inc, right_inc; int16 x1_final, x2_final; int16 env[2][2]; int16 poly; // SR = 0x00 // # DSP4_vars.raster lines to draw DSP4_vars.segments = DSP4_vars.poly_raster[polygon][0] - view_y[polygon]; // prevent overdraw if (DSP4_vars.segments > 0) { // bump drawing cursor DSP4_vars.poly_raster[polygon][0] = view_y[polygon]; DSP4_vars.poly_raster[polygon][1] = view_y[polygon]; } else DSP4_vars.segments = 0; // don't draw outside the window if (view_y[polygon] < DSP4_vars.poly_top[polygon][0]) { DSP4_vars.segments = 0; // flush remaining DSP4_vars.raster lines if (view_y[polygon] >= DSP4_vars.poly_top[polygon][0]) DSP4_vars.segments = view_y[polygon] - DSP4_vars.poly_top[polygon][0]; } // SR = 0x80 // tell user how many DSP4_vars.raster structures to read in DSP4_WRITE_WORD(DSP4_vars.segments); // normal parameters poly = polygon; ///////////////////////////////////////////////////// // scan next command if no SR check needed if (DSP4_vars.segments) { int32 win_left, win_right; // road turnoff selection if( (uint16) envelope[ polygon ][ 0 ] == (uint16) 0xc001 ) poly = 1; else if( envelope[ polygon ][ 1 ] == 0x3fff ) poly = 1; /////////////////////////////////////////////// // left side of polygon // perspective correction on additional shaping parameters env[0][0] = envelope[polygon][0] * DSP4_vars.poly_plane[poly] >> 15; env[0][1] = envelope[polygon][0] * DSP4_vars.distance >> 15; // project new shapes (left side) x1_final = view_x[poly] + env[0][0]; x2_final = DSP4_vars.poly_start[poly] + env[0][1]; // interpolate between projected points with shaping left_inc = (x2_final - x1_final) * DSP4_Inverse(DSP4_vars.segments) << 1; if (DSP4_vars.segments == 1) left_inc = -left_inc; /////////////////////////////////////////////// // right side of polygon // perspective correction on additional shaping parameters env[1][0] = envelope[polygon][1] * DSP4_vars.poly_plane[poly] >> 15;; env[1][1] = envelope[polygon][1] * DSP4_vars.distance >> 15; // project new shapes (right side) x1_final = view_x[poly] + env[1][0]; x2_final = DSP4_vars.poly_start[poly] + env[1][1]; // interpolate between projected points with shaping right_inc = (x2_final - x1_final) * DSP4_Inverse(DSP4_vars.segments) << 1; if (DSP4_vars.segments == 1) right_inc = -right_inc; /////////////////////////////////////////////// // update each point on the line win_left = SEX16(DSP4_vars.poly_cx[polygon][0] - DSP4_vars.poly_start[poly] + env[0][0]); win_right = SEX16(DSP4_vars.poly_cx[polygon][1] - DSP4_vars.poly_start[poly] + env[1][0]); // update DSP4_vars.distance drawn into world DSP4_vars.poly_plane[polygon] = DSP4_vars.distance; // rasterize line for (DSP4_vars.lcv = 0; DSP4_vars.lcv < DSP4_vars.segments; DSP4_vars.lcv++) { int16 x_left, x_right; // project new coordinates win_left += left_inc; win_right += right_inc; // grab integer portion, drop fraction (no rounding) x_left = (int16)(win_left >> 16); x_right = (int16)(win_right >> 16); // saturate offscreen data if (x_left < DSP4_vars.poly_clipLf[polygon][0]) x_left = DSP4_vars.poly_clipLf[polygon][0]; if (x_left > DSP4_vars.poly_clipRt[polygon][0]) x_left = DSP4_vars.poly_clipRt[polygon][0]; if (x_right < DSP4_vars.poly_clipLf[polygon][1]) x_right = DSP4_vars.poly_clipLf[polygon][1]; if (x_right > DSP4_vars.poly_clipRt[polygon][1]) x_right = DSP4_vars.poly_clipRt[polygon][1]; // 1. HDMA memory pointer // 2. Left window position ($2126/$2128) // 3. Right window position ($2127/$2129) DSP4_WRITE_WORD(DSP4_vars.poly_ptr[polygon][0]); DSP4_WRITE_BYTE(x_left & 0xff); DSP4_WRITE_BYTE(x_right & 0xff); // update memory pointers DSP4_vars.poly_ptr[polygon][0] -= 4; DSP4_vars.poly_ptr[polygon][1] -= 4; } // end rasterize line } //////////////////////////////////////////////// // Post-update // new projection spot to continue rasterizing from DSP4_vars.poly_start[polygon] = view_x[poly]; } // end polygon rasterizer } while (1); // unknown output DSP4_CLEAR_OUT(); DSP4_WRITE_WORD(0); DSP4.waiting4command = TRUE; } ////////////////////////////////////////////////////////////// void DSP4_OP09() { DSP4.waiting4command = FALSE; // op flow control switch (DSP4_vars.DSP4_Logic) { case 1: goto resume1; break; case 2: goto resume2; break; case 3: goto resume3; break; case 4: goto resume4; break; case 5: goto resume5; break; case 6: goto resume6; break; } //////////////////////////////////////////////////// // process initial inputs // grab screen information DSP4_vars.viewport_cx = DSP4_READ_WORD(); DSP4_vars.viewport_cy = DSP4_READ_WORD(); DSP4_READ_WORD(); // 0x0000 DSP4_vars.viewport_left = DSP4_READ_WORD(); DSP4_vars.viewport_right = DSP4_READ_WORD(); DSP4_vars.viewport_top = DSP4_READ_WORD(); DSP4_vars.viewport_bottom = DSP4_READ_WORD(); // starting DSP4_vars.raster line below the horizon DSP4_vars.poly_bottom[0][0] = DSP4_vars.viewport_bottom - DSP4_vars.viewport_cy; DSP4_vars.poly_raster[0][0] = 0x100; do { //////////////////////////////////////////////////// // check for new sprites DSP4.in_count = 4; DSP4_WAIT(1) resume1 : //////////////////////////////////////////////// // DSP4_vars.raster overdraw check DSP4_vars.raster = DSP4_READ_WORD(); // continue updating the DSP4_vars.raster line where overdraw begins if (DSP4_vars.raster < DSP4_vars.poly_raster[0][0]) { DSP4_vars.sprite_clipy = DSP4_vars.viewport_bottom - (DSP4_vars.poly_bottom[0][0] - DSP4_vars.raster); DSP4_vars.poly_raster[0][0] = DSP4_vars.raster; } ///////////////////////////////////////////////// // identify sprite // op termination DSP4_vars.distance = DSP4_READ_WORD(); if (DSP4_vars.distance == -0x8000) goto terminate; // no sprite if (DSP4_vars.distance == 0x0000) { continue; } //////////////////////////////////////////////////// // process projection information // vehicle sprite if ((uint16) DSP4_vars.distance == 0x9000) { int16 car_left, car_right, car_back; int16 impact_left, impact_back; int16 world_spx, world_spy; int16 view_spx, view_spy; uint16 energy; // we already have 4 bytes we want DSP4.in_count = 14; DSP4_WAIT(2) resume2 : // filter inputs energy = DSP4_READ_WORD(); impact_back = DSP4_READ_WORD(); car_back = DSP4_READ_WORD(); impact_left = DSP4_READ_WORD(); car_left = DSP4_READ_WORD(); DSP4_vars.distance = DSP4_READ_WORD(); car_right = DSP4_READ_WORD(); // calculate car's world (x,y) values world_spx = car_right - car_left; world_spy = car_back; // add in collision vector [needs bit-twiddling] world_spx -= energy * (impact_left - car_left) >> 16; world_spy -= energy * (car_back - impact_back) >> 16; // perspective correction for world (x,y) view_spx = world_spx * DSP4_vars.distance >> 15; view_spy = world_spy * DSP4_vars.distance >> 15; // convert to screen values DSP4_vars.sprite_x = DSP4_vars.viewport_cx + view_spx; DSP4_vars.sprite_y = DSP4_vars.viewport_bottom - (DSP4_vars.poly_bottom[0][0] - view_spy); // make the car's (x)-coordinate available DSP4_CLEAR_OUT(); DSP4_WRITE_WORD(world_spx); // grab a few remaining vehicle values DSP4.in_count = 4; DSP4_WAIT(3) resume3 : // add vertical lift factor DSP4_vars.sprite_y += DSP4_READ_WORD(); } // terrain sprite else { int16 world_spx, world_spy; int16 view_spx, view_spy; // we already have 4 bytes we want DSP4.in_count = 10; DSP4_WAIT(4) resume4 : // sort loop inputs DSP4_vars.poly_cx[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_raster[0][1] = DSP4_READ_WORD(); world_spx = DSP4_READ_WORD(); world_spy = DSP4_READ_WORD(); // compute base DSP4_vars.raster line from the bottom DSP4_vars.segments = DSP4_vars.poly_bottom[0][0] - DSP4_vars.raster; // perspective correction for world (x,y) view_spx = world_spx * DSP4_vars.distance >> 15; view_spy = world_spy * DSP4_vars.distance >> 15; // convert to screen values DSP4_vars.sprite_x = DSP4_vars.viewport_cx + view_spx - DSP4_vars.poly_cx[0][0]; DSP4_vars.sprite_y = DSP4_vars.viewport_bottom - DSP4_vars.segments + view_spy; } // default sprite size: 16x16 DSP4_vars.sprite_size = 1; DSP4_vars.sprite_attr = DSP4_READ_WORD(); //////////////////////////////////////////////////// // convert tile data to SNES OAM format do { uint16 header; int16 sp_x, sp_y, sp_attr, sp_dattr; int16 sp_dx, sp_dy; int16 pixels; bool8 draw; DSP4.in_count = 2; DSP4_WAIT(5) resume5 : draw = TRUE; // opcode termination DSP4_vars.raster = DSP4_READ_WORD(); if (DSP4_vars.raster == -0x8000) goto terminate; // stop code if (DSP4_vars.raster == 0x0000 && !DSP4_vars.sprite_size) break; // toggle sprite size if (DSP4_vars.raster == 0x0000) { DSP4_vars.sprite_size = !DSP4_vars.sprite_size; continue; } // check for valid sprite header header = DSP4_vars.raster; header >>= 8; if (header != 0x20 && header != 0x2e && //This is for attractor sprite header != 0x40 && header != 0x60 && header != 0xa0 && header != 0xc0 && header != 0xe0) break; // read in rest of sprite data DSP4.in_count = 4; DSP4_WAIT(6) resume6 : draw = TRUE; ///////////////////////////////////// // process tile data // sprite deltas sp_dattr = DSP4_vars.raster; sp_dy = DSP4_READ_WORD(); sp_dx = DSP4_READ_WORD(); // update coordinates to screen space sp_x = DSP4_vars.sprite_x + sp_dx; sp_y = DSP4_vars.sprite_y + sp_dy; // update sprite nametable/attribute information sp_attr = DSP4_vars.sprite_attr + sp_dattr; // allow partially visibile tiles pixels = DSP4_vars.sprite_size ? 15 : 7; DSP4_CLEAR_OUT(); // transparent tile to clip off parts of a sprite (overdraw) if (DSP4_vars.sprite_clipy - pixels <= sp_y && sp_y <= DSP4_vars.sprite_clipy && sp_x >= DSP4_vars.viewport_left - pixels && sp_x <= DSP4_vars.viewport_right && DSP4_vars.sprite_clipy >= DSP4_vars.viewport_top - pixels && DSP4_vars.sprite_clipy <= DSP4_vars.viewport_bottom) { DSP4_OP0B(&draw, sp_x, DSP4_vars.sprite_clipy, 0x00EE, DSP4_vars.sprite_size, 0); } // normal sprite tile if (sp_x >= DSP4_vars.viewport_left - pixels && sp_x <= DSP4_vars.viewport_right && sp_y >= DSP4_vars.viewport_top - pixels && sp_y <= DSP4_vars.viewport_bottom && sp_y <= DSP4_vars.sprite_clipy) { DSP4_OP0B(&draw, sp_x, sp_y, sp_attr, DSP4_vars.sprite_size, 0); } // no following OAM data DSP4_OP0B(&draw, 0, 0x0100, 0, 0, 1); } while (1); } while (1); terminate : DSP4.waiting4command = TRUE; } ////////////////////////////////////////////////////////////// const uint16 OP0A_Values[16] = { 0x0000, 0x0030, 0x0060, 0x0090, 0x00c0, 0x00f0, 0x0120, 0x0150, 0xfe80, 0xfeb0, 0xfee0, 0xff10, 0xff40, 0xff70, 0xffa0, 0xffd0 }; void DSP4_OP0A(int16 n2, int16 *o1, int16 *o2, int16 *o3, int16 *o4) { *o4 = OP0A_Values[(n2 & 0x000f)]; *o3 = OP0A_Values[(n2 & 0x00f0) >> 4]; *o2 = OP0A_Values[(n2 & 0x0f00) >> 8]; *o1 = OP0A_Values[(n2 & 0xf000) >> 12]; } ////////////////////////////////////////////////////////////// void DSP4_OP0B(bool8 *draw, int16 sp_x, int16 sp_y, int16 sp_attr, bool8 size, bool8 stop) { int16 Row1, Row2; // SR = 0x00 // align to nearest 8-pixel row Row1 = (sp_y >> 3) & 0x1f; Row2 = (Row1 + 1) & 0x1f; // check boundaries if (!((sp_y < 0) || ((sp_y & 0x01ff) < 0x00eb))) { *draw = 0; } if (size) { if (DSP4_vars.OAM_Row[Row1] + 1 >= DSP4_vars.OAM_RowMax) *draw = 0; if (DSP4_vars.OAM_Row[Row2] + 1 >= DSP4_vars.OAM_RowMax) *draw = 0; } else { if (DSP4_vars.OAM_Row[Row1] >= DSP4_vars.OAM_RowMax) { *draw = 0; } } // emulator fail-safe (unknown if this really exists) if (DSP4_vars.sprite_count >= 128) { *draw = 0; } // SR = 0x80 if (*draw) { // Row tiles if (size) { DSP4_vars.OAM_Row[Row1] += 2; DSP4_vars.OAM_Row[Row2] += 2; } else { DSP4_vars.OAM_Row[Row1]++; } // yield OAM output DSP4_WRITE_WORD(1); // pack OAM data: x,y,name,attr DSP4_WRITE_BYTE(sp_x & 0xff); DSP4_WRITE_BYTE(sp_y & 0xff); DSP4_WRITE_WORD(sp_attr); DSP4_vars.sprite_count++; // OAM: size,msb data // save post-oam table data for future retrieval DSP4_vars.OAM_attr[DSP4_vars.OAM_index] |= ((sp_x <0 || sp_x> 255) << DSP4_vars.OAM_bits); DSP4_vars.OAM_bits++; DSP4_vars.OAM_attr[DSP4_vars.OAM_index] |= (size << DSP4_vars.OAM_bits); DSP4_vars.OAM_bits++; // move to next byte in buffer if (DSP4_vars.OAM_bits == 16) { DSP4_vars.OAM_bits = 0; DSP4_vars.OAM_index++; } } else if (stop) { // yield no OAM output DSP4_WRITE_WORD(0); } } ////////////////////////////////////////////////////////////// void DSP4_OP0D() { DSP4.waiting4command = FALSE; // op flow control switch (DSP4_vars.DSP4_Logic) { case 1: goto resume1; break; case 2: goto resume2; break; } //////////////////////////////////////////////////// // process initial inputs // sort inputs DSP4_vars.world_y = DSP4_READ_DWORD(); DSP4_vars.poly_bottom[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_top[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_cx[1][0] = DSP4_READ_WORD(); DSP4_vars.viewport_bottom = DSP4_READ_WORD(); DSP4_vars.world_x = DSP4_READ_DWORD(); DSP4_vars.poly_cx[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_ptr[0][0] = DSP4_READ_WORD(); DSP4_vars.world_yofs = DSP4_READ_WORD(); DSP4_vars.world_dy = DSP4_READ_DWORD(); DSP4_vars.world_dx = DSP4_READ_DWORD(); DSP4_vars.distance = DSP4_READ_WORD(); DSP4_READ_WORD(); // 0x0000 DSP4_vars.world_xenv = SEX78(DSP4_READ_WORD()); DSP4_vars.world_ddy = DSP4_READ_WORD(); DSP4_vars.world_ddx = DSP4_READ_WORD(); DSP4_vars.view_yofsenv = DSP4_READ_WORD(); // initial (x,y,offset) at starting DSP4_vars.raster line DSP4_vars.view_x1 = (int16)((DSP4_vars.world_x + DSP4_vars.world_xenv) >> 16); DSP4_vars.view_y1 = (int16)(DSP4_vars.world_y >> 16); DSP4_vars.view_xofs1 = (int16)(DSP4_vars.world_x >> 16); DSP4_vars.view_yofs1 = DSP4_vars.world_yofs; // first DSP4_vars.raster line DSP4_vars.poly_raster[0][0] = DSP4_vars.poly_bottom[0][0]; do { //////////////////////////////////////////////////// // process one iteration of projection // perspective projection of world (x,y,scroll) points // based on the current projection lines DSP4_vars.view_x2 = (int16)(( ( ( DSP4_vars.world_x + DSP4_vars.world_xenv ) >> 16 ) * DSP4_vars.distance >> 15 ) + ( DSP4_vars.view_turnoff_x * DSP4_vars.distance >> 15 )); DSP4_vars.view_y2 = (int16)((DSP4_vars.world_y >> 16) * DSP4_vars.distance >> 15); DSP4_vars.view_xofs2 = DSP4_vars.view_x2; DSP4_vars.view_yofs2 = (DSP4_vars.world_yofs * DSP4_vars.distance >> 15) + DSP4_vars.poly_bottom[0][0] - DSP4_vars.view_y2; // 1. World x-location before transformation // 2. Viewer x-position at the current // 3. World y-location before perspective projection // 4. Viewer y-position below the horizon // 5. Number of DSP4_vars.raster lines drawn in this iteration DSP4_CLEAR_OUT(); DSP4_WRITE_WORD((uint16)((DSP4_vars.world_x + DSP4_vars.world_xenv) >> 16)); DSP4_WRITE_WORD(DSP4_vars.view_x2); DSP4_WRITE_WORD((uint16)(DSP4_vars.world_y >> 16)); DSP4_WRITE_WORD(DSP4_vars.view_y2); ////////////////////////////////////////////////////////// // SR = 0x00 // determine # of DSP4_vars.raster lines used DSP4_vars.segments = DSP4_vars.view_y1 - DSP4_vars.view_y2; // prevent overdraw if (DSP4_vars.view_y2 >= DSP4_vars.poly_raster[0][0]) DSP4_vars.segments = 0; else DSP4_vars.poly_raster[0][0] = DSP4_vars.view_y2; // don't draw outside the window if (DSP4_vars.view_y2 < DSP4_vars.poly_top[0][0]) { DSP4_vars.segments = 0; // flush remaining DSP4_vars.raster lines if (DSP4_vars.view_y1 >= DSP4_vars.poly_top[0][0]) DSP4_vars.segments = DSP4_vars.view_y1 - DSP4_vars.poly_top[0][0]; } // SR = 0x80 DSP4_WRITE_WORD(DSP4_vars.segments); ////////////////////////////////////////////////////////// // scan next command if no SR check needed if (DSP4_vars.segments) { int32 px_dx, py_dy; int32 x_scroll, y_scroll; // SR = 0x00 // linear interpolation (lerp) between projected points px_dx = (DSP4_vars.view_xofs2 - DSP4_vars.view_xofs1) * DSP4_Inverse(DSP4_vars.segments) << 1; py_dy = (DSP4_vars.view_yofs2 - DSP4_vars.view_yofs1) * DSP4_Inverse(DSP4_vars.segments) << 1; // starting step values x_scroll = SEX16(DSP4_vars.poly_cx[0][0] + DSP4_vars.view_xofs1); y_scroll = SEX16(-DSP4_vars.viewport_bottom + DSP4_vars.view_yofs1 + DSP4_vars.view_yofsenv + DSP4_vars.poly_cx[1][0] - DSP4_vars.world_yofs); // SR = 0x80 // rasterize line for (DSP4_vars.lcv = 0; DSP4_vars.lcv < DSP4_vars.segments; DSP4_vars.lcv++) { // 1. HDMA memory pointer (bg1) // 2. vertical scroll offset ($210E) // 3. horizontal scroll offset ($210D) DSP4_WRITE_WORD(DSP4_vars.poly_ptr[0][0]); DSP4_WRITE_WORD((uint16)((y_scroll + 0x8000) >> 16)); DSP4_WRITE_WORD((uint16)((x_scroll + 0x8000) >> 16)); // update memory address DSP4_vars.poly_ptr[0][0] -= 4; // update screen values x_scroll += px_dx; y_scroll += py_dy; } } ///////////////////////////////////////////////////// // Post-update // update new viewer (x,y,scroll) to last DSP4_vars.raster line drawn DSP4_vars.view_x1 = DSP4_vars.view_x2; DSP4_vars.view_y1 = DSP4_vars.view_y2; DSP4_vars.view_xofs1 = DSP4_vars.view_xofs2; DSP4_vars.view_yofs1 = DSP4_vars.view_yofs2; // add deltas for projection lines DSP4_vars.world_dx += SEX78(DSP4_vars.world_ddx); DSP4_vars.world_dy += SEX78(DSP4_vars.world_ddy); // update projection lines DSP4_vars.world_x += (DSP4_vars.world_dx + DSP4_vars.world_xenv); DSP4_vars.world_y += DSP4_vars.world_dy; //////////////////////////////////////////////////// // command check // scan next command DSP4.in_count = 2; DSP4_WAIT(1) resume1 : // inspect input DSP4_vars.distance = DSP4_READ_WORD(); // terminate op if (DSP4_vars.distance == -0x8000) break; // already have 2 bytes in queue DSP4.in_count = 6; DSP4_WAIT(2) resume2: // inspect inputs DSP4_vars.world_ddy = DSP4_READ_WORD(); DSP4_vars.world_ddx = DSP4_READ_WORD(); DSP4_vars.view_yofsenv = DSP4_READ_WORD(); // no envelope here DSP4_vars.world_xenv = 0; } while (1); DSP4.waiting4command = TRUE; } ////////////////////////////////////////////////////////////// void DSP4_OP0E() { DSP4_vars.OAM_RowMax = 16; memset(DSP4_vars.OAM_Row, 0, 64); } ////////////////////////////////////////////////////////////// void DSP4_OP0F() { DSP4.waiting4command = FALSE; // op flow control switch (DSP4_vars.DSP4_Logic) { case 1: goto resume1; break; case 2: goto resume2; break; case 3: goto resume3; break; case 4: goto resume4; break; } //////////////////////////////////////////////////// // process initial inputs // sort inputs DSP4_READ_WORD(); // 0x0000 DSP4_vars.world_y = DSP4_READ_DWORD(); DSP4_vars.poly_bottom[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_top[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_cx[1][0] = DSP4_READ_WORD(); DSP4_vars.viewport_bottom = DSP4_READ_WORD(); DSP4_vars.world_x = DSP4_READ_DWORD(); DSP4_vars.poly_cx[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_ptr[0][0] = DSP4_READ_WORD(); DSP4_vars.world_yofs = DSP4_READ_WORD(); DSP4_vars.world_dy = DSP4_READ_DWORD(); DSP4_vars.world_dx = DSP4_READ_DWORD(); DSP4_vars.distance = DSP4_READ_WORD(); DSP4_READ_WORD(); // 0x0000 DSP4_vars.world_xenv = DSP4_READ_DWORD(); DSP4_vars.world_ddy = DSP4_READ_WORD(); DSP4_vars.world_ddx = DSP4_READ_WORD(); DSP4_vars.view_yofsenv = DSP4_READ_WORD(); // initial (x,y,offset) at starting DSP4_vars.raster line DSP4_vars.view_x1 = (int16)((DSP4_vars.world_x + DSP4_vars.world_xenv) >> 16); DSP4_vars.view_y1 = (int16)(DSP4_vars.world_y >> 16); DSP4_vars.view_xofs1 = (int16)(DSP4_vars.world_x >> 16); DSP4_vars.view_yofs1 = DSP4_vars.world_yofs; DSP4_vars.view_turnoff_x = 0; DSP4_vars.view_turnoff_dx = 0; // first DSP4_vars.raster line DSP4_vars.poly_raster[0][0] = DSP4_vars.poly_bottom[0][0]; do { //////////////////////////////////////////////////// // process one iteration of projection // perspective projection of world (x,y,scroll) points // based on the current projection lines DSP4_vars.view_x2 = (int16)(((DSP4_vars.world_x + DSP4_vars.world_xenv) >> 16) * DSP4_vars.distance >> 15); DSP4_vars.view_y2 = (int16)((DSP4_vars.world_y >> 16) * DSP4_vars.distance >> 15); DSP4_vars.view_xofs2 = DSP4_vars.view_x2; DSP4_vars.view_yofs2 = (DSP4_vars.world_yofs * DSP4_vars.distance >> 15) + DSP4_vars.poly_bottom[0][0] - DSP4_vars.view_y2; // 1. World x-location before transformation // 2. Viewer x-position at the next // 3. World y-location before perspective projection // 4. Viewer y-position below the horizon // 5. Number of DSP4_vars.raster lines drawn in this iteration DSP4_CLEAR_OUT(); DSP4_WRITE_WORD((uint16)((DSP4_vars.world_x + DSP4_vars.world_xenv) >> 16)); DSP4_WRITE_WORD(DSP4_vars.view_x2); DSP4_WRITE_WORD((uint16)(DSP4_vars.world_y >> 16)); DSP4_WRITE_WORD(DSP4_vars.view_y2); ////////////////////////////////////////////////////// // SR = 0x00 // determine # of DSP4_vars.raster lines used DSP4_vars.segments = DSP4_vars.poly_raster[0][0] - DSP4_vars.view_y2; // prevent overdraw if (DSP4_vars.view_y2 >= DSP4_vars.poly_raster[0][0]) DSP4_vars.segments = 0; else DSP4_vars.poly_raster[0][0] = DSP4_vars.view_y2; // don't draw outside the window if (DSP4_vars.view_y2 < DSP4_vars.poly_top[0][0]) { DSP4_vars.segments = 0; // flush remaining DSP4_vars.raster lines if (DSP4_vars.view_y1 >= DSP4_vars.poly_top[0][0]) DSP4_vars.segments = DSP4_vars.view_y1 - DSP4_vars.poly_top[0][0]; } // SR = 0x80 DSP4_WRITE_WORD(DSP4_vars.segments); ////////////////////////////////////////////////////// // scan next command if no SR check needed if (DSP4_vars.segments) { int32 px_dx, py_dy; int32 x_scroll, y_scroll; for (DSP4_vars.lcv = 0; DSP4_vars.lcv < 4; DSP4_vars.lcv++) { // grab inputs DSP4.in_count = 4; DSP4_WAIT(1); resume1 : for (;;) { int16 distance; int16 color, red, green, blue; distance = DSP4_READ_WORD(); color = DSP4_READ_WORD(); // U1+B5+G5+R5 red = color & 0x1f; green = (color >> 5) & 0x1f; blue = (color >> 10) & 0x1f; // dynamic lighting red = (red * distance >> 15) & 0x1f; green = (green * distance >> 15) & 0x1f; blue = (blue * distance >> 15) & 0x1f; color = red | (green << 5) | (blue << 10); DSP4_CLEAR_OUT(); DSP4_WRITE_WORD(color); break; } } ////////////////////////////////////////////////////// // SR = 0x00 // linear interpolation (lerp) between projected points px_dx = (DSP4_vars.view_xofs2 - DSP4_vars.view_xofs1) * DSP4_Inverse(DSP4_vars.segments) << 1; py_dy = (DSP4_vars.view_yofs2 - DSP4_vars.view_yofs1) * DSP4_Inverse(DSP4_vars.segments) << 1; // starting step values x_scroll = SEX16(DSP4_vars.poly_cx[0][0] + DSP4_vars.view_xofs1); y_scroll = SEX16(-DSP4_vars.viewport_bottom + DSP4_vars.view_yofs1 + DSP4_vars.view_yofsenv + DSP4_vars.poly_cx[1][0] - DSP4_vars.world_yofs); // SR = 0x80 // rasterize line for (DSP4_vars.lcv = 0; DSP4_vars.lcv < DSP4_vars.segments; DSP4_vars.lcv++) { // 1. HDMA memory pointer // 2. vertical scroll offset ($210E) // 3. horizontal scroll offset ($210D) DSP4_WRITE_WORD(DSP4_vars.poly_ptr[0][0]); DSP4_WRITE_WORD((uint16)((y_scroll + 0x8000) >> 16)); DSP4_WRITE_WORD((uint16)((x_scroll + 0x8000) >> 16)); // update memory address DSP4_vars.poly_ptr[0][0] -= 4; // update screen values x_scroll += px_dx; y_scroll += py_dy; } } //////////////////////////////////////////////////// // Post-update // update new viewer (x,y,scroll) to last DSP4_vars.raster line drawn DSP4_vars.view_x1 = DSP4_vars.view_x2; DSP4_vars.view_y1 = DSP4_vars.view_y2; DSP4_vars.view_xofs1 = DSP4_vars.view_xofs2; DSP4_vars.view_yofs1 = DSP4_vars.view_yofs2; // add deltas for projection lines DSP4_vars.world_dx += SEX78(DSP4_vars.world_ddx); DSP4_vars.world_dy += SEX78(DSP4_vars.world_ddy); // update projection lines DSP4_vars.world_x += (DSP4_vars.world_dx + DSP4_vars.world_xenv); DSP4_vars.world_y += DSP4_vars.world_dy; // update road turnoff position DSP4_vars.view_turnoff_x += DSP4_vars.view_turnoff_dx; //////////////////////////////////////////////////// // command check // scan next command DSP4.in_count = 2; DSP4_WAIT(2) resume2: // check for termination DSP4_vars.distance = DSP4_READ_WORD(); if (DSP4_vars.distance == -0x8000) break; // road splice if( (uint16) DSP4_vars.distance == 0x8001 ) { DSP4.in_count = 6; DSP4_WAIT(3) resume3: DSP4_vars.distance = DSP4_READ_WORD(); DSP4_vars.view_turnoff_x = DSP4_READ_WORD(); DSP4_vars.view_turnoff_dx = DSP4_READ_WORD(); // factor in new changes DSP4_vars.view_x1 += ( DSP4_vars.view_turnoff_x * DSP4_vars.distance >> 15 ); DSP4_vars.view_xofs1 += ( DSP4_vars.view_turnoff_x * DSP4_vars.distance >> 15 ); // update stepping values DSP4_vars.view_turnoff_x += DSP4_vars.view_turnoff_dx; DSP4.in_count = 2; DSP4_WAIT(2) } // already have 2 bytes in queue DSP4.in_count = 6; DSP4_WAIT(4) resume4 : // inspect inputs DSP4_vars.world_ddy = DSP4_READ_WORD(); DSP4_vars.world_ddx = DSP4_READ_WORD(); DSP4_vars.view_yofsenv = DSP4_READ_WORD(); // no envelope here DSP4_vars.world_xenv = 0; } while (1); // terminate op DSP4.waiting4command = TRUE; } ////////////////////////////////////////////////////////////// void DSP4_OP10() { DSP4.waiting4command = FALSE; // op flow control switch (DSP4_vars.DSP4_Logic) { case 1: goto resume1; break; case 2: goto resume2; break; case 3: goto resume3; break; } //////////////////////////////////////////////////// // sort inputs DSP4_READ_WORD(); // 0x0000 DSP4_vars.world_y = DSP4_READ_DWORD(); DSP4_vars.poly_bottom[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_top[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_cx[1][0] = DSP4_READ_WORD(); DSP4_vars.viewport_bottom = DSP4_READ_WORD(); DSP4_vars.world_x = DSP4_READ_DWORD(); DSP4_vars.poly_cx[0][0] = DSP4_READ_WORD(); DSP4_vars.poly_ptr[0][0] = DSP4_READ_WORD(); DSP4_vars.world_yofs = DSP4_READ_WORD(); DSP4_vars.distance = DSP4_READ_WORD(); DSP4_vars.view_y2 = DSP4_READ_WORD(); DSP4_vars.view_dy = DSP4_READ_WORD() * DSP4_vars.distance >> 15; DSP4_vars.view_x2 = DSP4_READ_WORD(); DSP4_vars.view_dx = DSP4_READ_WORD() * DSP4_vars.distance >> 15; DSP4_vars.view_yofsenv = DSP4_READ_WORD(); // initial (x,y,offset) at starting DSP4_vars.raster line DSP4_vars.view_x1 = (int16)(DSP4_vars.world_x >> 16); DSP4_vars.view_y1 = (int16)(DSP4_vars.world_y >> 16); DSP4_vars.view_xofs1 = DSP4_vars.view_x1; DSP4_vars.view_yofs1 = DSP4_vars.world_yofs; // first DSP4_vars.raster line DSP4_vars.poly_raster[0][0] = DSP4_vars.poly_bottom[0][0]; do { //////////////////////////////////////////////////// // process one iteration of projection // add shaping DSP4_vars.view_x2 += DSP4_vars.view_dx; DSP4_vars.view_y2 += DSP4_vars.view_dy; // vertical scroll calculation DSP4_vars.view_xofs2 = DSP4_vars.view_x2; DSP4_vars.view_yofs2 = (DSP4_vars.world_yofs * DSP4_vars.distance >> 15) + DSP4_vars.poly_bottom[0][0] - DSP4_vars.view_y2; // 1. Viewer x-position at the next // 2. Viewer y-position below the horizon // 3. Number of DSP4_vars.raster lines drawn in this iteration DSP4_CLEAR_OUT(); DSP4_WRITE_WORD(DSP4_vars.view_x2); DSP4_WRITE_WORD(DSP4_vars.view_y2); ////////////////////////////////////////////////////// // SR = 0x00 // determine # of DSP4_vars.raster lines used DSP4_vars.segments = DSP4_vars.view_y1 - DSP4_vars.view_y2; // prevent overdraw if (DSP4_vars.view_y2 >= DSP4_vars.poly_raster[0][0]) DSP4_vars.segments = 0; else DSP4_vars.poly_raster[0][0] = DSP4_vars.view_y2; // don't draw outside the window if (DSP4_vars.view_y2 < DSP4_vars.poly_top[0][0]) { DSP4_vars.segments = 0; // flush remaining DSP4_vars.raster lines if (DSP4_vars.view_y1 >= DSP4_vars.poly_top[0][0]) DSP4_vars.segments = DSP4_vars.view_y1 - DSP4_vars.poly_top[0][0]; } // SR = 0x80 DSP4_WRITE_WORD(DSP4_vars.segments); ////////////////////////////////////////////////////// // scan next command if no SR check needed if (DSP4_vars.segments) { for (DSP4_vars.lcv = 0; DSP4_vars.lcv < 4; DSP4_vars.lcv++) { // grab inputs DSP4.in_count = 4; DSP4_WAIT(1); resume1 : for (;;) { int16 distance; int16 color, red, green, blue; distance = DSP4_READ_WORD(); color = DSP4_READ_WORD(); // U1+B5+G5+R5 red = color & 0x1f; green = (color >> 5) & 0x1f; blue = (color >> 10) & 0x1f; // dynamic lighting red = (red * distance >> 15) & 0x1f; green = (green * distance >> 15) & 0x1f; blue = (blue * distance >> 15) & 0x1f; color = red | (green << 5) | (blue << 10); DSP4_CLEAR_OUT(); DSP4_WRITE_WORD(color); break; } } } ////////////////////////////////////////////////////// // scan next command if no SR check needed if (DSP4_vars.segments) { int32 px_dx, py_dy; int32 x_scroll, y_scroll; // SR = 0x00 // linear interpolation (lerp) between projected points px_dx = (DSP4_vars.view_xofs2 - DSP4_vars.view_xofs1) * DSP4_Inverse(DSP4_vars.segments) << 1; py_dy = (DSP4_vars.view_yofs2 - DSP4_vars.view_yofs1) * DSP4_Inverse(DSP4_vars.segments) << 1; // starting step values x_scroll = SEX16(DSP4_vars.poly_cx[0][0] + DSP4_vars.view_xofs1); y_scroll = SEX16(-DSP4_vars.viewport_bottom + DSP4_vars.view_yofs1 + DSP4_vars.view_yofsenv + DSP4_vars.poly_cx[1][0] - DSP4_vars.world_yofs); // SR = 0x80 // rasterize line for (DSP4_vars.lcv = 0; DSP4_vars.lcv < DSP4_vars.segments; DSP4_vars.lcv++) { // 1. HDMA memory pointer (bg2) // 2. vertical scroll offset ($2110) // 3. horizontal scroll offset ($210F) DSP4_WRITE_WORD(DSP4_vars.poly_ptr[0][0]); DSP4_WRITE_WORD((uint16)((y_scroll + 0x8000) >> 16)); DSP4_WRITE_WORD((uint16)((x_scroll + 0x8000) >> 16)); // update memory address DSP4_vars.poly_ptr[0][0] -= 4; // update screen values x_scroll += px_dx; y_scroll += py_dy; } } ///////////////////////////////////////////////////// // Post-update // update new viewer (x,y,scroll) to last DSP4_vars.raster line drawn DSP4_vars.view_x1 = DSP4_vars.view_x2; DSP4_vars.view_y1 = DSP4_vars.view_y2; DSP4_vars.view_xofs1 = DSP4_vars.view_xofs2; DSP4_vars.view_yofs1 = DSP4_vars.view_yofs2; //////////////////////////////////////////////////// // command check // scan next command DSP4.in_count = 2; DSP4_WAIT(2) resume2 : // check for opcode termination DSP4_vars.distance = DSP4_READ_WORD(); if (DSP4_vars.distance == -0x8000) break; // already have 2 bytes in queue DSP4.in_count = 10; DSP4_WAIT(3) resume3 : // inspect inputs DSP4_vars.view_y2 = DSP4_READ_WORD(); DSP4_vars.view_dy = DSP4_READ_WORD() * DSP4_vars.distance >> 15; DSP4_vars.view_x2 = DSP4_READ_WORD(); DSP4_vars.view_dx = DSP4_READ_WORD() * DSP4_vars.distance >> 15; } while (1); DSP4.waiting4command = TRUE; } ////////////////////////////////////////////////////////////// void DSP4_OP11(int16 A, int16 B, int16 C, int16 D, int16 *M) { // 0x155 = 341 = Horizontal Width of the Screen *M = ((A * 0x0155 >> 2) & 0xf000) | ((B * 0x0155 >> 6) & 0x0f00) | ((C * 0x0155 >> 10) & 0x00f0) | ((D * 0x0155 >> 14) & 0x000f); } ///////////////////////////////////////////////////////////// //Processing Code ///////////////////////////////////////////////////////////// uint8 dsp4_byte; uint16 dsp4_address; void InitDSP4() { memset(&DSP4, 0, sizeof(DSP4)); DSP4.waiting4command = TRUE; } void DSP4SetByte() { // clear pending read if (DSP4.out_index < DSP4.out_count) { DSP4.out_index++; return; } if (DSP4.waiting4command) { if (DSP4.half_command) { DSP4.command |= (dsp4_byte << 8); DSP4.in_index = 0; DSP4.waiting4command = FALSE; DSP4.half_command = FALSE; DSP4.out_count = 0; DSP4.out_index = 0; DSP4_vars.DSP4_Logic = 0; switch (DSP4.command) { case 0x0000: DSP4.in_count = 4; break; case 0x0001: DSP4.in_count = 44; break; case 0x0003: DSP4.in_count = 0; break; case 0x0005: DSP4.in_count = 0; break; case 0x0006: DSP4.in_count = 0; break; case 0x0007: DSP4.in_count = 34; break; case 0x0008: DSP4.in_count = 90; break; case 0x0009: DSP4.in_count = 14; break; case 0x000a: DSP4.in_count = 6; break; case 0x000b: DSP4.in_count = 6; break; case 0x000d: DSP4.in_count = 42; break; case 0x000e: DSP4.in_count = 0; break; case 0x000f: DSP4.in_count = 46; break; case 0x0010: DSP4.in_count = 36; break; case 0x0011: DSP4.in_count = 8; break; default: DSP4.waiting4command = TRUE; break; } } else { DSP4.command = dsp4_byte; DSP4.half_command = TRUE; } } else { DSP4.parameters[DSP4.in_index] = dsp4_byte; DSP4.in_index++; } if (!DSP4.waiting4command && DSP4.in_count == DSP4.in_index) { // Actually execute the command DSP4.waiting4command = TRUE; DSP4.out_index = 0; DSP4.in_index = 0; switch (DSP4.command) { // 16-bit multiplication case 0x0000: { int16 multiplier, multiplicand; int32 product; multiplier = DSP4_READ_WORD(); multiplicand = DSP4_READ_WORD(); DSP4_Multiply(multiplicand, multiplier, &product); DSP4_CLEAR_OUT(); DSP4_WRITE_WORD((uint16)(product)); DSP4_WRITE_WORD((uint16)(product >> 16)); } break; // single-player track projection case 0x0001: DSP4_OP01(); break; // single-player selection case 0x0003: DSP4_OP03(); break; // clear OAM case 0x0005: DSP4_OP05(); break; // transfer OAM case 0x0006: DSP4_OP06(); break; // single-player track turnoff projection case 0x0007: DSP4_OP07(); break; // solid polygon projection case 0x0008: DSP4_OP08(); break; // sprite projection case 0x0009: DSP4_OP09(); break; // unknown case 0x000A: { int16 in1a = DSP4_READ_WORD(); int16 in2a = DSP4_READ_WORD(); int16 in3a = DSP4_READ_WORD(); int16 out1a, out2a, out3a, out4a; DSP4_OP0A(in2a, &out2a, &out1a, &out4a, &out3a); DSP4_CLEAR_OUT(); DSP4_WRITE_WORD(out1a); DSP4_WRITE_WORD(out2a); DSP4_WRITE_WORD(out3a); DSP4_WRITE_WORD(out4a); } break; // set OAM case 0x000B: { int16 sp_x = DSP4_READ_WORD(); int16 sp_y = DSP4_READ_WORD(); int16 sp_attr = DSP4_READ_WORD(); bool8 draw = 1; DSP4_CLEAR_OUT(); DSP4_OP0B(&draw, sp_x, sp_y, sp_attr, 0, 1); } break; // multi-player track projection case 0x000D: DSP4_OP0D(); break; // multi-player selection case 0x000E: DSP4_OP0E(); break; // single-player track projection with lighting case 0x000F: DSP4_OP0F(); break; // single-player track turnoff projection with lighting case 0x0010: DSP4_OP10(); break; // unknown: horizontal mapping command case 0x0011: { int16 a, b, c, d, m; d = DSP4_READ_WORD(); c = DSP4_READ_WORD(); b = DSP4_READ_WORD(); a = DSP4_READ_WORD(); DSP4_OP11(a, b, c, d, &m); DSP4_CLEAR_OUT(); DSP4_WRITE_WORD(m); break; } default: break; } } } void DSP4GetByte() { if (DSP4.out_count) { dsp4_byte = (uint8) DSP4.output[DSP4.out_index&0x1FF]; DSP4.out_index++; if (DSP4.out_count == DSP4.out_index) DSP4.out_count = 0; } else { dsp4_byte = 0xff; } } #endif sfc/chip/hsu1/serialization.cpp000664 001750 001750 00000000573 12651764221 017654 0ustar00sergiosergio000000 000000 #ifdef HSU1_CPP void HSU1::serialize(serializer& s) { s.integer(txbusy); s.integer(rxbusy); s.integer(txlatch); unsigned size; size = txbuffer.size(); s.integer(size); txbuffer.resize(size); s.array(txbuffer.data(), txbuffer.size()); size = rxbuffer.size(); s.integer(size); rxbuffer.resize(size); s.array(rxbuffer.data(), rxbuffer.size()); } #endif target-ethos/input/hotkeys.cpp000664 001750 001750 00000007007 12651764221 017653 0ustar00sergiosergio000000 000000 void InputManager::appendHotkeys() { { auto hotkey = new HotkeyInput; hotkey->name = "Toggle Fullscreen Mode"; hotkey->mapping = "1/Button/F11"; hotkey->press = [] { utility->toggleFullScreen(); }; } { auto hotkey = new HotkeyInput; hotkey->name = "Toggle Mouse Capture"; hotkey->mapping = "1/Button/F12"; hotkey->press = [] { input.acquired() ? input.unacquire() : input.acquire(); }; } { auto hotkey = new HotkeyInput; hotkey->name = "Show Library"; hotkey->mapping = "1/Button/L"; hotkey->press = [] { libraryManager->show(); }; } { auto hotkey = new HotkeyInput; hotkey->name = "Pause Emulation"; hotkey->mapping = "1/Button/P"; hotkey->press = [] { program->pause = !program->pause; }; } { auto hotkey = new HotkeyInput; hotkey->name = "Fast Forward"; hotkey->mapping = "1/Button/Tilde"; hotkey->press = [] { video.set(Video::Synchronize, false); audio.set(Audio::Synchronize, false); }; hotkey->release = [] { video.set(Video::Synchronize, ::config->video.synchronize); audio.set(Audio::Synchronize, ::config->audio.synchronize); }; } { auto hotkey = new HotkeyInput; hotkey->name = "Power Cycle"; hotkey->mapping = "None"; hotkey->press = [] { utility->power(); }; } { auto hotkey = new HotkeyInput; hotkey->name = "Soft Reset"; hotkey->mapping = "None"; hotkey->press = [] { utility->reset(); }; } static unsigned activeSlot = 1; { auto hotkey = new HotkeyInput; hotkey->name = "Save State"; hotkey->mapping = "1/Button/F5"; hotkey->press = [&] { utility->saveState(activeSlot); }; } { auto hotkey = new HotkeyInput; hotkey->name = "Load State"; hotkey->mapping = "1/Button/F7"; hotkey->press = [&] { utility->loadState(activeSlot); }; } { auto hotkey = new HotkeyInput; hotkey->name = "Decrement Slot"; hotkey->mapping = "1/Button/F6"; hotkey->press = [&] { if(--activeSlot == 0) activeSlot = 5; utility->showMessage({"Selected slot ", activeSlot}); }; } { auto hotkey = new HotkeyInput; hotkey->name = "Increment Slot"; hotkey->mapping = "1/Button/F8"; hotkey->press = [&] { if(++activeSlot == 6) activeSlot = 1; utility->showMessage({"Selected slot ", activeSlot}); }; } { auto hotkey = new HotkeyInput; hotkey->name = "Close Emulator"; hotkey->mapping = "None"; hotkey->press = [] { Application::quit(); }; } { auto hotkey = new HotkeyInput; hotkey->name = "Toggle Tracer"; hotkey->mapping = "None"; hotkey->press = [&] { utility->tracerToggle(); }; } { auto hotkey = new HotkeyInput; hotkey->name = "Export Memory"; hotkey->mapping = "None"; hotkey->press = [&] { if(program->active == nullptr) return; system().exportMemory(); utility->showMessage("Memory exported"); }; } Configuration::Node node; for(auto& hotkey : hotkeyMap) { node.append(hotkey->mapping, string{hotkey->name}.replace(" ", "")); } config.append(node, "Hotkey"); } void InputManager::pollHotkeys() { for(auto& hotkey : hotkeyMap) { bool state = hotkey->poll(); if(hotkey->state == 0 && state == 1) if(hotkey->press) hotkey->press(); if(hotkey->state == 1 && state == 0) if(hotkey->release) hotkey->release(); hotkey->state = state; } } nall/string/char/strpos.hpp000664 001750 001750 00000002012 12651764221 017117 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP //usage example: //if(auto position = strpos(str, key)) print(position(), "\n"); //prints position of key within str; but only if it is found namespace nall { template optional ustrpos(const char* str, const char* key) { const char* base = str; while(*str) { if(quoteskip(str)) continue; for(unsigned n = 0;; n++) { if(key[n] == 0) return {true, (unsigned)(str - base)}; if(str[n] == 0) return false; if(!chrequal(str[n], key[n])) break; } str++; } return false; } optional strpos(const char* str, const char* key) { return ustrpos(str, key); } optional istrpos(const char* str, const char* key) { return ustrpos(str, key); } optional qstrpos(const char* str, const char* key) { return ustrpos(str, key); } optional iqstrpos(const char* str, const char* key) { return ustrpos(str, key); } } #endif gba/apu/fifo.cpp000664 001750 001750 00000000623 12651764221 014656 0ustar00sergiosergio000000 000000 void APU::FIFO::read() { if(size == 0) return; size--; output = sample[rdoffset++]; } void APU::FIFO::write(int8 byte) { if(size == 32) return; size++; sample[wroffset++] = byte; } void APU::FIFO::reset() { for(auto& byte : sample) byte = 0; output = 0; rdoffset = 0; wroffset = 0; size = 0; } void APU::FIFO::power() { reset(); lenable = 0; renable = 0; timer = 0; } nall/stream/memory.hpp000664 001750 001750 00000002330 12651764221 016150 0ustar00sergiosergio000000 000000 #ifndef NALL_STREAM_MEMORY_HPP #define NALL_STREAM_MEMORY_HPP #include namespace nall { struct memorystream : stream { using stream::read; using stream::write; bool seekable() const { return true; } bool readable() const { return true; } bool writable() const { return pwritable; } bool randomaccess() const { return true; } uint8_t* data() const { return pdata; } unsigned size() const { return psize; } unsigned offset() const { return poffset; } void seek(unsigned offset) const { poffset = offset; } uint8_t read() const { return pdata[poffset++]; } void write(uint8_t data) const { pdata[poffset++] = data; } uint8_t read(unsigned offset) const { return pdata[offset]; } void write(unsigned offset, uint8_t data) const { pdata[offset] = data; } memorystream() : pdata(nullptr), psize(0), poffset(0), pwritable(true) {} memorystream(uint8_t* data, unsigned size) { pdata = data, psize = size, poffset = 0; pwritable = true; } memorystream(const uint8_t* data, unsigned size) { pdata = (uint8_t*)data, psize = size, poffset = 0; pwritable = false; } protected: mutable uint8_t* pdata; mutable unsigned psize, poffset, pwritable; }; } #endif sfc/alt/smp/core/generate.cpp000664 001750 001750 00000010136 12651764221 017271 0ustar00sergiosergio000000 000000 #include #include #include using namespace nall; static bool cycle_accurate; struct opcode_t { string name; lstring args; unsigned opcode; }; void generate(const char* sourceFilename, const char* targetFilename) { file fp; fp.open(targetFilename, file::mode::write); string filedata; filedata.readfile(sourceFilename); filedata.replace("\r", ""); lstring block; block.split("\n\n", filedata); foreach(data, block) { lstring lines; lines.split("\n", data); linear_vector array; unsigned sourceStart = 0; foreach(line, lines, currentLine) { line.transform("()", "``"); lstring part; part.split("`", line); lstring arguments; arguments.split(", ", part[1]); opcode_t opcode; opcode.name = part[0]; opcode.args = arguments; opcode.opcode = hex(arguments[0]); array.append(opcode); line.rtrim<1>(","); if(line.endswith(" {")) { line.rtrim<1>("{ "); sourceStart = currentLine + 1; break; } } if(cycle_accurate == false) { foreach(opcode, array) { fp.print("case 0x", hex<2>(opcode.opcode), ": {\n"); for(unsigned n = sourceStart; n < lines.size(); n++) { if(lines[n] == "}") break; string output; if(lines[n].beginswith(" ")) { output = lines[n]; } else { lstring part; part.split<1>(":", lines[n]); output = { " ", part[1] }; } output.replace("$1", opcode.args[1]); output.replace("$2", opcode.args[2]); output.replace("$3", opcode.args[3]); output.replace("$4", opcode.args[4]); output.replace("$5", opcode.args[5]); output.replace("$6", opcode.args[6]); output.replace("$7", opcode.args[7]); output.replace("$8", opcode.args[8]); output.replace("end;", "break;"); fp.print(output, "\n"); } fp.print(" break;\n"); fp.print("}\n\n"); } } else { foreach(opcode, array) { fp.print("case 0x", hex<2>(opcode.opcode), ": {\n"); fp.print(" switch(opcode_cycle++) {\n"); for(unsigned n = sourceStart; n < lines.size(); n++) { if(lines[n] == "}") break; bool nextLineEndsCycle = false; if(lines[n + 1] == "}") nextLineEndsCycle = true; if(lines[n + 1].beginswith(" ") == false) nextLineEndsCycle = true; string output; if(lines[n].beginswith(" ")) { output = { " ", lines[n] }; } else { lstring part; part.split<1>(":", lines[n]); fp.print(" case ", (unsigned)decimal(part[0]), ":\n"); output = { " ", part[1] }; } output.replace("$1", opcode.args[1]); output.replace("$2", opcode.args[2]); output.replace("$3", opcode.args[3]); output.replace("$4", opcode.args[4]); output.replace("$5", opcode.args[5]); output.replace("$6", opcode.args[6]); output.replace("$7", opcode.args[7]); output.replace("$8", opcode.args[8]); output.replace("end;", "{ opcode_cycle = 0; break; }"); fp.print(output, "\n"); if(nextLineEndsCycle) { if(lines[n + 1].beginswith("}")) { fp.print(" opcode_cycle = 0;\n"); } fp.print(" break;\n"); } } fp.print(" }\n"); fp.print(" break;\n"); fp.print("}\n\n"); } } } fp.close(); } int main() { cycle_accurate = false; generate("op_misc.b", "op_misc.cpp"); generate("op_mov.b", "op_mov.cpp" ); generate("op_pc.b", "op_pc.cpp" ); generate("op_read.b", "op_read.cpp"); generate("op_rmw.b", "op_rmw.cpp" ); cycle_accurate = true; generate("op_misc.b", "opcycle_misc.cpp"); generate("op_mov.b", "opcycle_mov.cpp" ); generate("op_pc.b", "opcycle_pc.cpp" ); generate("op_read.b", "opcycle_read.cpp"); generate("op_rmw.b", "opcycle_rmw.cpp" ); return 0; } target-ethos/configuration/configuration.cpp000664 001750 001750 00000004556 12651764221 022552 0ustar00sergiosergio000000 000000 #include "../ethos.hpp" ConfigurationSettings* config = nullptr; ConfigurationSettings::ConfigurationSettings() { video.append(video.driver = ruby::video.optimalDriver(), "Driver"); video.append(video.synchronize = false, "Synchronize"); video.append(video.shader = "Blur", "Shader"); video.append(video.scaleMode = 0, "ScaleMode"); video.append(video.aspectCorrection = true, "AspectCorrection"); video.append(video.colorEmulation = true, "ColorEmulation"); video.maskOverscan.assign(video.maskOverscan.enable = false); video.maskOverscan.append(video.maskOverscan.horizontal = 8, "Horizontal"); video.maskOverscan.append(video.maskOverscan.vertical = 8, "Vertical"); video.append(video.maskOverscan, "MaskOverscan"); video.append(video.saturation = 100, "Saturation"); video.append(video.gamma = 100, "Gamma"); video.append(video.luminance = 100, "Luminance"); video.append(video.startFullScreen = false, "StartFullScreen"); append(video, "Video"); audio.append(audio.driver = ruby::audio.optimalDriver(), "Driver"); audio.append(audio.synchronize = true, "Synchronize"); audio.append(audio.frequency = 48000, "Frequency"); audio.append(audio.latency = 60, "Latency"); audio.append(audio.resampler = 2, "Resampler"); audio.append(audio.volume = 100, "Volume"); audio.append(audio.mute = false, "Mute"); append(audio, "Audio"); input.append(input.driver = ruby::input.optimalDriver(), "Driver"); input.focus.append(input.focus.pause = false, "Pause"); input.focus.append(input.focus.allow = false, "AllowInput"); input.append(input.focus, "Focus"); append(input, "Input"); timing.append(timing.video = 60.0, "Video"); timing.append(timing.audio = 48000.0, "Audio"); append(timing, "Timing"); server.append(server.hostname = "", "Hostname"); server.append(server.username = "", "Username"); server.append(server.password = "", "Password"); append(server, "Server"); library.append(library.selection = -1, "Selection"); library.append(library.mediaMode = 0, "MediaMode"); library.append(library.showOnStartup = true, "ShowOnStartup"); append(library, "Library"); load(); } void ConfigurationSettings::load() { Configuration::Document::load(program->path("settings.bml")); save(); //creates file if it does not exist } void ConfigurationSettings::save() { Configuration::Document::save(program->path("settings.bml")); } phoenix/core/core.cpp000664 001750 001750 00000115264 12651764221 015757 0ustar00sergiosergio000000 000000 #if defined(PHOENIX_WINDOWS) #include "../windows/header.hpp" #elif defined(PHOENIX_QT) #include "../qt/header.hpp" #elif defined(PHOENIX_GTK) #include "../gtk/header.hpp" #elif defined(PHOENIX_COCOA) #include "../cocoa/header.hpp" #elif defined(PHOENIX_REFERENCE) #include "../reference/header.hpp" #endif #include "core.hpp" using namespace nall; namespace phoenix { #include "state.hpp" #include "layout/fixed-layout.cpp" #include "layout/horizontal-layout.cpp" #include "layout/vertical-layout.cpp" } #if defined(PHOENIX_WINDOWS) #include "../windows/platform.cpp" #elif defined(PHOENIX_QT) #include "../qt/platform.cpp" #elif defined(PHOENIX_GTK) #include "../gtk/platform.cpp" #elif defined(PHOENIX_COCOA) #include "../cocoa/platform.cpp" #elif defined(PHOENIX_REFERENCE) #include "../reference/platform.cpp" #endif namespace phoenix { //Application //=========== function Application::main; function Application::Windows::onModalBegin; function Application::Windows::onModalEnd; function Application::Cocoa::onAbout; function Application::Cocoa::onActivate; function Application::Cocoa::onPreferences; function Application::Cocoa::onQuit; void Application::run() { return pApplication::run(); } bool Application::pendingEvents() { return pApplication::pendingEvents(); } void Application::processEvents() { return pApplication::processEvents(); } void Application::quit() { applicationState.quit = true; return pApplication::quit(); } void Application::setName(const string& name) { applicationState.name = name; } void Application::initialize() { static bool initialized = false; if(initialized == false) { initialized = true; return pApplication::initialize(); } } //Color //===== uint32_t Color::rgb() const { return (255 << 24) + (red << 16) + (green << 8) + (blue << 0); } uint32_t Color::argb() const { return (alpha << 24) + (red << 16) + (green << 8) + (blue << 0); } //Geometry //======== Position Geometry::position() const { return {x, y}; } Size Geometry::size() const { return {width, height}; } string Geometry::text() const { return {x, ",", y, ",", width, ",", height}; } Geometry::Geometry(const string& text) { lstring part = text.split(","); x = integer(part(0, "256")); y = integer(part(1, "256")); width = decimal(part(2, "256")); height = decimal(part(3, "256")); } //Font //==== string Font::serif(unsigned size, const string& style) { return pFont::serif(size, style); } string Font::sans(unsigned size, const string& style) { return pFont::sans(size, style); } string Font::monospace(unsigned size, const string& style) { return pFont::monospace(size, style); } Size Font::size(const string& font, const string& text) { return pFont::size(font, text); } //Desktop //======= Size Desktop::size() { return pDesktop::size(); } Geometry Desktop::workspace() { return pDesktop::workspace(); } //Monitor //======= unsigned Monitor::count() { return pMonitor::count(); } Geometry Monitor::geometry(unsigned monitor) { return pMonitor::geometry(monitor); } unsigned Monitor::primary() { return pMonitor::primary(); } //Keyboard //======== bool Keyboard::pressed(Keyboard::Scancode scancode) { return pKeyboard::pressed(scancode); } bool Keyboard::released(Keyboard::Scancode scancode) { return !pressed(scancode); } vector Keyboard::state() { return pKeyboard::state(); } //Mouse //===== Position Mouse::position() { return pMouse::position(); } bool Mouse::pressed(Mouse::Button button) { return pMouse::pressed(button); } bool Mouse::released(Mouse::Button button) { return !pressed(button); } //BrowserWindow //============= string BrowserWindow::directory() { return pBrowserWindow::directory(state); } string BrowserWindow::open() { return pBrowserWindow::open(state); } string BrowserWindow::save() { return pBrowserWindow::save(state); } BrowserWindow& BrowserWindow::setFilters(const lstring& filters) { state.filters = filters; return *this; } BrowserWindow& BrowserWindow::setParent(Window& parent) { state.parent = &parent; return *this; } BrowserWindow& BrowserWindow::setPath(const string& path) { state.path = path; return *this; } BrowserWindow& BrowserWindow::setTitle(const string& title) { state.title = title; return *this; } BrowserWindow::BrowserWindow(): state(*new State) { } BrowserWindow::~BrowserWindow() { delete &state; } //MessageWindow //============= MessageWindow::Response MessageWindow::error(MessageWindow::Buttons buttons) { state.buttons = buttons; return pMessageWindow::error(state); } MessageWindow::Response MessageWindow::information(MessageWindow::Buttons buttons) { state.buttons = buttons; return pMessageWindow::information(state); } MessageWindow::Response MessageWindow::question(MessageWindow::Buttons buttons) { state.buttons = buttons; return pMessageWindow::question(state); } MessageWindow& MessageWindow::setParent(Window& parent) { state.parent = &parent; return *this; } MessageWindow& MessageWindow::setText(const string& text) { state.text = text; return *this; } MessageWindow& MessageWindow::setTitle(const string& title) { state.title = title; return *this; } MessageWindow::Response MessageWindow::warning(MessageWindow::Buttons buttons) { state.buttons = buttons; return pMessageWindow::warning(state); } MessageWindow::MessageWindow(const string& text): state(*new State) { state.text = text; } MessageWindow::~MessageWindow() { delete &state; } //Object //====== Object::Object(pObject& p): p(p) { Application::initialize(); p.constructor(); } Object::~Object() { p.destructor(); delete &p; } //Timer //===== bool Timer::enabled() const { return state.enabled; } unsigned Timer::interval() const { return state.interval; } void Timer::setEnabled(bool enabled) { state.enabled = enabled; return p.setEnabled(enabled); } void Timer::setInterval(unsigned interval) { state.interval = interval; return p.setInterval(interval); } Timer::Timer(): state(*new State), base_from_member(*new pTimer(*this)), Object(base_from_member::value), p(base_from_member::value) { p.constructor(); } Timer::~Timer() { p.destructor(); delete &state; } //Window //====== void Window::append(Layout& layout) { if(state.layout.append(layout)) { layout.Sizable::state.parent = nullptr; layout.Sizable::state.window = this; p.append(layout); layout.synchronizeLayout(); } } void Window::append(Menu& menu) { if(state.menu.append(menu)) { menu.Action::state.window = this; p.append(menu); } } void Window::append(Widget& widget) { if(state.widget.append(widget)) { widget.Sizable::state.window = this; p.append(widget); widget.synchronizeLayout(); } } Color Window::backgroundColor() const { return state.backgroundColor; } bool Window::droppable() const { return state.droppable; } Geometry Window::frameGeometry() { Geometry geometry = p.geometry(); Geometry margin = p.frameMargin(); return { geometry.x - margin.x, geometry.y - margin.y, geometry.width + margin.width, geometry.height + margin.height }; } Geometry Window::frameMargin() { return p.frameMargin(); } bool Window::focused() { return p.focused(); } bool Window::fullScreen() const { return state.fullScreen; } Geometry Window::geometry() { return p.geometry(); } string Window::menuFont() const { return state.menuFont; } bool Window::menuVisible() const { return state.menuVisible; } bool Window::modal() const { return state.modal; } void Window::remove(Layout& layout) { if(state.layout.remove(layout)) { p.remove(layout); layout.Sizable::state.window = nullptr; } } void Window::remove(Menu& menu) { if(state.menu.remove(menu)) { p.remove(menu); menu.Action::state.window = nullptr; } } void Window::remove(Widget& widget) { if(state.widget.remove(widget)) { p.remove(widget); widget.Sizable::state.window = nullptr; } } bool Window::resizable() const { return state.resizable; } void Window::setBackgroundColor(Color color) { state.backgroundColorOverride = true; state.backgroundColor = color; return p.setBackgroundColor(color); } void Window::setDroppable(bool droppable) { state.droppable = droppable; return p.setDroppable(droppable); } void Window::setFrameGeometry(Geometry geometry) { Geometry margin = p.frameMargin(); return setGeometry({ geometry.x + margin.x, geometry.y + margin.y, geometry.width - margin.width, geometry.height - margin.height }); } void Window::setFocused() { return p.setFocused(); } void Window::setFullScreen(bool fullScreen) { state.fullScreen = fullScreen; return p.setFullScreen(fullScreen); } void Window::setGeometry(Geometry geometry) { state.geometry = geometry; return p.setGeometry(geometry); } void Window::setMenuFont(const string& font) { state.menuFont = font; return p.setMenuFont(font); } void Window::setMenuVisible(bool visible) { state.menuVisible = visible; return p.setMenuVisible(visible); } void Window::setModal(bool modal) { state.modal = modal; return p.setModal(modal); } void Window::setResizable(bool resizable) { state.resizable = resizable; return p.setResizable(resizable); } void Window::setStatusFont(const string& font) { state.statusFont = font; return p.setStatusFont(font); } void Window::setStatusText(const string& text) { state.statusText = text; return p.setStatusText(text); } void Window::setStatusVisible(bool visible) { state.statusVisible = visible; return p.setStatusVisible(visible); } void Window::setTitle(const string& text) { state.title = text; return p.setTitle(text); } void Window::setVisible(bool visible) { state.visible = visible; synchronizeLayout(); return p.setVisible(visible); } void Window::setWidgetFont(const string& font) { state.widgetFont = font; return p.setWidgetFont(font); } void Window::setWindowGeometry(Geometry geometry) { Geometry margin = p.frameMargin(); return setGeometry({ geometry.x + margin.x, geometry.y + margin.y, geometry.width, geometry.height }); } string Window::statusFont() const { return state.statusFont; } string Window::statusText() const { return state.statusText; } bool Window::statusVisible() const { return state.statusVisible; } void Window::synchronizeLayout() { if(visible() && applicationState.quit == false) setGeometry(geometry()); } string Window::title() const { return state.title; } bool Window::visible() const { return state.visible; } string Window::widgetFont() const { return state.widgetFont; } Window::Window(): state(*new State), base_from_member(*new pWindow(*this)), Object(base_from_member::value), p(base_from_member::value) { p.constructor(); } Window::~Window() { p.destructor(); delete &state; } //Action //====== bool Action::enabled() const { return state.enabled; } void Action::setEnabled(bool enabled) { state.enabled = enabled; return p.setEnabled(enabled); } void Action::setVisible(bool visible) { state.visible = visible; return p.setVisible(visible); } bool Action::visible() const { return state.visible; } Action::Action(pAction& p): state(*new State), Object(p), p(p) { p.constructor(); } Action::~Action() { p.destructor(); delete &state; } //Menu //==== void Menu::append(const group& list) { for(auto& action : list) { if(state.action.append(action)) { action.state.menu = this; p.append(action); } } } image Menu::image() const { return state.image; } void Menu::remove(const group& list) { for(auto& action : list) { if(state.action.remove(action)) { action.state.menu = nullptr; return p.remove(action); } } } void Menu::setImage(const nall::image& image) { state.image = image; return p.setImage(image); } void Menu::setText(const string& text) { state.text = text; return p.setText(text); } string Menu::text() const { return state.text; } Menu::Menu(): state(*new State), base_from_member(*new pMenu(*this)), Action(base_from_member::value), p(base_from_member::value) { p.constructor(); } Menu::~Menu() { p.destructor(); delete &state; } //Separator //========= Separator::Separator(): base_from_member(*new pSeparator(*this)), Action(base_from_member::value), p(base_from_member::value) { p.constructor(); } Separator::~Separator() { p.destructor(); } //Item //==== image Item::image() const { return state.image; } void Item::setImage(const nall::image& image) { state.image = image; return p.setImage(image); } void Item::setText(const string& text) { state.text = text; return p.setText(text); } string Item::text() const { return state.text; } Item::Item(): state(*new State), base_from_member(*new pItem(*this)), Action(base_from_member::value), p(base_from_member::value) { p.constructor(); } Item::~Item() { p.destructor(); delete &state; } //CheckItem //========= bool CheckItem::checked() const { return state.checked; } void CheckItem::setChecked(bool checked) { state.checked = checked; return p.setChecked(checked); } void CheckItem::setText(const string& text) { state.text = text; return p.setText(text); } string CheckItem::text() const { return state.text; } CheckItem::CheckItem(): state(*new State), base_from_member(*new pCheckItem(*this)), Action(base_from_member::value), p(base_from_member::value) { p.constructor(); } CheckItem::~CheckItem() { p.destructor(); delete &state; } //RadioItem //========= void RadioItem::group(const nall::group& list) { for(auto& item : list) item.p.setGroup(item.state.group = list); if(list.size()) list.first().setChecked(); } bool RadioItem::checked() const { return state.checked; } void RadioItem::setChecked() { for(auto& item : state.group) item.state.checked = false; state.checked = true; return p.setChecked(); } void RadioItem::setText(const string& text) { state.text = text; return p.setText(text); } string RadioItem::text() const { return state.text; } RadioItem::RadioItem(): state(*new State), base_from_member(*new pRadioItem(*this)), Action(base_from_member::value), p(base_from_member::value) { p.constructor(); } RadioItem::~RadioItem() { for(auto& item : state.group) { if(&item != this) item.state.group.remove(*this); } p.destructor(); delete &state; } //Sizable //======= bool Sizable::enabled() const { return state.enabled; } bool Sizable::enabledToAll() const { if(state.enabled == false) return false; if(state.parent) return state.parent->enabledToAll(); return true; } Layout* Sizable::layout() const { if(state.parent && dynamic_cast(state.parent)) return (Layout*)state.parent; return nullptr; } Sizable* Sizable::parent() const { return state.parent; } bool Sizable::visible() const { return state.visible; } bool Sizable::visibleToAll() const { if(state.visible == false) return false; if(state.parent) return state.parent->visibleToAll(); return true; } Window* Sizable::window() const { return state.window; } Sizable::Sizable(pSizable& p): state(*new State), Object(p), p(p) { p.constructor(); } Sizable::~Sizable() { if(layout()) layout()->remove(*this); p.destructor(); delete &state; } //Layout //====== void Layout::append(Sizable& sizable) { sizable.state.parent = this; sizable.state.window = Sizable::state.window; if(dynamic_cast(&sizable)) { Layout& layout = (Layout&)sizable; layout.synchronizeLayout(); } if(dynamic_cast(&sizable)) { Widget& widget = (Widget&)sizable; if(sizable.window()) sizable.window()->append(widget); } } void Layout::remove(Sizable& sizable) { if(dynamic_cast(&sizable)) { Widget& widget = (Widget&)sizable; if(sizable.window()) sizable.window()->remove(widget); } sizable.state.parent = nullptr; sizable.state.window = nullptr; } void Layout::reset() { } Layout::Layout(): state(*new State), base_from_member(*new pLayout(*this)), Sizable(base_from_member::value), p(base_from_member::value) { } Layout::Layout(pLayout& p): state(*new State), base_from_member(p), Sizable(p), p(p) { } Layout::~Layout() { if(layout()) layout()->remove(*this); if(window()) window()->remove(*this); p.destructor(); delete &state; } //Widget //====== bool Widget::focused() { return p.focused(); } string Widget::font() const { return state.font; } Geometry Widget::geometry() const { return state.geometry; } Size Widget::minimumSize() { return p.minimumSize(); } void Widget::setEnabled(bool enabled) { Sizable::state.enabled = enabled; return p.setEnabled(enabled); } void Widget::setFocused() { return p.setFocused(); } void Widget::setFont(const string& font) { state.font = font; return p.setFont(font); } void Widget::setGeometry(Geometry geometry) { state.geometry = geometry; return p.setGeometry(geometry); } void Widget::setVisible(bool visible) { Sizable::state.visible = visible; return p.setVisible(visible); } void Widget::synchronizeLayout() { } Widget::Widget(): state(*new State), base_from_member(*new pWidget(*this)), Sizable(base_from_member::value), p(base_from_member::value) { state.abstract = true; p.constructor(); } Widget::Widget(pWidget& p): state(*new State), base_from_member(p), Sizable(base_from_member::value), p(base_from_member::value) { p.constructor(); } Widget::~Widget() { p.destructor(); delete &state; } //Button //====== image Button::image() const { return state.image; } Orientation Button::orientation() const { return state.orientation; } void Button::setImage(const nall::image& image, Orientation orientation) { state.image = image; state.orientation = orientation; return p.setImage(image, orientation); } void Button::setText(const string& text) { state.text = text; return p.setText(text); } nall::string Button::text() const { return state.text; } Button::Button(): state(*new State), base_from_member(*new pButton(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } Button::~Button() { p.destructor(); delete &state; } //Canvas //====== Color Canvas::color() const { return state.color; } uint32_t* Canvas::data() const { return state.data; } bool Canvas::droppable() const { return state.droppable; } vector Canvas::gradient() const { return state.gradient; } image Canvas::image() const { return state.image; } Canvas::Mode Canvas::mode() const { return state.mode; } void Canvas::setColor(Color color) { state.color = color; return setMode(Canvas::Mode::Color); } void Canvas::setData() { if(state.width == 0 || state.height == 0) return; //dynamic sizing not supported in Mode::Data return setMode(Canvas::Mode::Data); } void Canvas::setDroppable(bool droppable) { state.droppable = droppable; return p.setDroppable(droppable); } void Canvas::setGradient(Color topLeft, Color topRight, Color bottomLeft, Color bottomRight) { state.gradient[0] = topLeft; state.gradient[1] = topRight; state.gradient[2] = bottomLeft; state.gradient[3] = bottomRight; return setMode(Canvas::Mode::Gradient); } void Canvas::setHorizontalGradient(Color left, Color right) { state.gradient[0] = state.gradient[2] = left; state.gradient[1] = state.gradient[3] = right; return setMode(Canvas::Mode::Gradient); } void Canvas::setImage(const nall::image& image) { state.image = image; return setMode(Canvas::Mode::Image); } void Canvas::setMode(Mode mode) { state.mode = mode; return p.setMode(mode); } void Canvas::setSize(Size size) { if(size.width == Size::Maximum) size.width = 0; if(size.height == Size::Maximum) size.height = 0; state.width = size.width; state.height = size.height; delete[] state.data; state.data = new uint32_t[state.width * state.height](); return setMode(state.mode); } void Canvas::setVerticalGradient(Color top, Color bottom) { state.gradient[0] = state.gradient[1] = top; state.gradient[2] = state.gradient[3] = bottom; return setMode(Canvas::Mode::Gradient); } Size Canvas::size() const { return {state.width, state.height}; } Canvas::Canvas(): state(*new State), base_from_member(*new pCanvas(*this)), Widget(base_from_member::value), p(base_from_member::value) { state.data = new uint32_t[state.width * state.height](); p.constructor(); } Canvas::~Canvas() { p.destructor(); delete[] state.data; delete &state; } //CheckButton //=========== bool CheckButton::checked() const { return state.checked; } image CheckButton::image() const { return state.image; } void CheckButton::setChecked(bool checked) { state.checked = checked; return p.setChecked(checked); } void CheckButton::setImage(const nall::image& image, Orientation orientation) { state.image = image; state.orientation = orientation; return p.setImage(image, orientation); } void CheckButton::setText(const string& text) { state.text = text; return p.setText(text); } string CheckButton::text() const { return state.text; } CheckButton::CheckButton(): state(*new State), base_from_member(*new pCheckButton(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } CheckButton::~CheckButton() { p.destructor(); delete &state; } //CheckLabel //========== bool CheckLabel::checked() const { return state.checked; } void CheckLabel::setChecked(bool checked) { state.checked = checked; return p.setChecked(checked); } void CheckLabel::setText(const string& text) { state.text = text; return p.setText(text); } string CheckLabel::text() const { return state.text; } CheckLabel::CheckLabel(): state(*new State), base_from_member(*new pCheckLabel(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } CheckLabel::~CheckLabel() { p.destructor(); delete &state; } //ComboButton //=========== void ComboButton::append(const string& text) { state.text.append(text); return p.append(text); } void ComboButton::remove(unsigned selection) { if(selection >= state.text.size()) return; state.text.remove(selection); p.remove(selection); } void ComboButton::reset() { state.selection = 0; state.text.reset(); return p.reset(); } unsigned ComboButton::rows() const { return state.text.size(); } unsigned ComboButton::selection() const { return state.selection; } void ComboButton::setSelection(unsigned selection) { if(selection >= state.text.size()) return; state.selection = selection; return p.setSelection(selection); } void ComboButton::setText(unsigned selection, const string& text) { if(selection >= state.text.size()) return; state.text[selection] = text; p.setText(selection, text); } string ComboButton::text() const { if(state.text.empty()) return ""; return state.text[state.selection]; } string ComboButton::text(unsigned selection) const { if(selection >= state.text.size()) return ""; return state.text[selection]; } ComboButton::ComboButton(): state(*new State), base_from_member(*new pComboButton(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } ComboButton::~ComboButton() { p.destructor(); delete &state; } //Console //======= void Console::print(const string& text) { return p.print(text); } void Console::reset() { return p.reset(); } Console::Console(): state(*new State), base_from_member(*new pConsole(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } Console::~Console() { p.destructor(); delete &state; } //Frame //===== void Frame::setLayout(Layout& layout) { state.layout = &layout; synchronizeLayout(); } void Frame::setText(const string& text) { state.text = text; return p.setText(text); } void Frame::synchronizeLayout() { if(state.layout == nullptr) return; state.layout->Sizable::state.window = Sizable::state.window; state.layout->Sizable::state.parent = this; state.layout->state.widget = this; state.layout->synchronizeLayout(); } string Frame::text() const { return state.text; } Frame::Frame(): state(*new State), base_from_member(*new pFrame(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } Frame::~Frame() { p.destructor(); delete &state; } //HexEdit //======= unsigned HexEdit::columns() const { return state.columns; } unsigned HexEdit::length() const { return state.length; } unsigned HexEdit::offset() const { return state.offset; } unsigned HexEdit::rows() const { return state.rows; } void HexEdit::setColumns(unsigned columns) { state.columns = columns; return p.setColumns(columns); } void HexEdit::setLength(unsigned length) { state.length = length; return p.setLength(length); } void HexEdit::setOffset(unsigned offset) { state.offset = offset; return p.setOffset(offset); } void HexEdit::setRows(unsigned rows) { state.rows = rows; return p.setRows(rows); } void HexEdit::update() { return p.update(); } HexEdit::HexEdit(): state(*new State), base_from_member(*new pHexEdit(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } HexEdit::~HexEdit() { p.destructor(); delete &state; } //HorizontalScroller //================== unsigned HorizontalScroller::length() const { return state.length; } unsigned HorizontalScroller::position() const { return state.position; } void HorizontalScroller::setLength(unsigned length) { state.length = length; return p.setLength(length); } void HorizontalScroller::setPosition(unsigned position) { state.position = position; return p.setPosition(position); } HorizontalScroller::HorizontalScroller(): state(*new State), base_from_member(*new pHorizontalScroller(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } HorizontalScroller::~HorizontalScroller() { p.destructor(); delete &state; } //HorizontalSlider //================ unsigned HorizontalSlider::length() const { return state.length; } unsigned HorizontalSlider::position() const { return state.position; } void HorizontalSlider::setLength(unsigned length) { state.length = length; return p.setLength(length); } void HorizontalSlider::setPosition(unsigned position) { state.position = position; return p.setPosition(position); } HorizontalSlider::HorizontalSlider(): state(*new State), base_from_member(*new pHorizontalSlider(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } HorizontalSlider::~HorizontalSlider() { p.destructor(); delete &state; } //Label //===== void Label::setText(const string& text) { state.text = text; return p.setText(text); } string Label::text() const { return state.text; } Label::Label(): state(*new State), base_from_member(*new pLabel(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } Label::~Label() { p.destructor(); delete &state; } //LineEdit //======== bool LineEdit::editable() const { return state.editable; } void LineEdit::setEditable(bool editable) { state.editable = editable; return p.setEditable(editable); } void LineEdit::setText(const string& text) { state.text = text; return p.setText(text); } string LineEdit::text() { return p.text(); } LineEdit::LineEdit(): state(*new State), base_from_member(*new pLineEdit(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } LineEdit::~LineEdit() { p.destructor(); delete &state; } //ListView //======== void ListView::append(const lstring& text) { state.checked.append(false); state.image.append({}); state.text.append(text); return p.append(text); } void ListView::autoSizeColumns() { return p.autoSizeColumns(); } bool ListView::checkable() const { return state.checkable; } bool ListView::checked(unsigned selection) const { if(selection >= state.text.size()) return false; return state.checked[selection]; } unsigned ListView::columns() const { return max(1u, state.headerText.size()); } bool ListView::headerVisible() const { return state.headerVisible; } image ListView::image(unsigned selection, unsigned position) const { if(selection >= state.text.size()) return {}; return state.image[selection](position); } void ListView::remove(unsigned selection) { if(selection >= state.text.size()) return; state.checked.remove(selection); state.image.remove(selection); state.text.remove(selection); return p.remove(selection); } void ListView::reset() { state.checked.reset(); state.image.reset(); state.selected = false; state.selection = 0; state.text.reset(); return p.reset(); } unsigned ListView::rows() const { return state.text.size(); } bool ListView::selected() const { return state.selected; } unsigned ListView::selection() const { return state.selection; } void ListView::setCheckable(bool checkable) { state.checkable = checkable; return p.setCheckable(checkable); } void ListView::setChecked(unsigned selection, bool checked) { if(selection >= state.text.size()) return; state.checked[selection] = checked; return p.setChecked(selection, checked); } void ListView::setHeaderText(const lstring& text) { state.headerText = text; return p.setHeaderText(text); } void ListView::setHeaderVisible(bool visible) { state.headerVisible = visible; return p.setHeaderVisible(visible); } void ListView::setImage(unsigned selection, unsigned position, const nall::image& image) { if(selection >= state.text.size()) return; state.image[selection](position) = image; return p.setImage(selection, position, image); } void ListView::setSelected(bool selected) { state.selected = selected; return p.setSelected(selected); } void ListView::setSelection(unsigned selection) { if(selection >= state.text.size()) return; state.selected = true; state.selection = selection; return p.setSelection(selection); } void ListView::setText(unsigned selection, const lstring& text) { if(selection >= state.text.size()) return; for(unsigned position = 0; position < text.size(); position++) { setText(selection, position, text[position]); } } void ListView::setText(unsigned selection, unsigned position, const string& text) { if(selection >= state.text.size()) return; state.text[selection](position) = text; return p.setText(selection, position, text); } string ListView::text(unsigned selection, unsigned position) const { if(selection >= state.text.size()) return ""; return state.text[selection](position); } ListView::ListView(): state(*new State), base_from_member(*new pListView(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } ListView::~ListView() { p.destructor(); delete &state; } //ProgressBar //=========== unsigned ProgressBar::position() const { return state.position; } void ProgressBar::setPosition(unsigned position) { state.position = position; return p.setPosition(position); } ProgressBar::ProgressBar(): state(*new State), base_from_member(*new pProgressBar(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } ProgressBar::~ProgressBar() { p.destructor(); delete &state; } //RadioButton //=========== void RadioButton::group(const nall::group& list) { for(auto& item : list) item.p.setGroup(item.state.group = list); if(list.size()) list.first().setChecked(); } bool RadioButton::checked() const { return state.checked; } image RadioButton::image() const { return state.image; } void RadioButton::setChecked() { for(auto& item : state.group) item.state.checked = false; state.checked = true; return p.setChecked(); } void RadioButton::setImage(const nall::image& image, Orientation orientation) { state.image = image; state.orientation = orientation; return p.setImage(image, orientation); } void RadioButton::setText(const string& text) { state.text = text; return p.setText(text); } string RadioButton::text() const { return state.text; } RadioButton::RadioButton(): state(*new State), base_from_member(*new pRadioButton(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } RadioButton::~RadioButton() { for(auto& item : state.group) { if(&item != this) item.state.group.remove(*this); } p.destructor(); delete &state; } //RadioLabel //========== void RadioLabel::group(const nall::group& list) { for(auto& item : list) item.p.setGroup(item.state.group = list); if(list.size()) list.first().setChecked(); } bool RadioLabel::checked() const { return state.checked; } void RadioLabel::setChecked() { for(auto &item : state.group) item.state.checked = false; state.checked = true; return p.setChecked(); } void RadioLabel::setText(const string& text) { state.text = text; return p.setText(text); } string RadioLabel::text() const { return state.text; } RadioLabel::RadioLabel(): state(*new State), base_from_member(*new pRadioLabel(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } RadioLabel::~RadioLabel() { for(auto& item : state.group) { if(&item != this) item.state.group.remove(*this); } p.destructor(); delete &state; } //TabFrame //======== void TabFrame::append(const string& text, const nall::image& image) { state.image.append(image); state.layout.append(nullptr); state.text.append(text); return p.append(text, image); } image TabFrame::image(unsigned selection) const { if(selection >= state.text.size()) return {}; return state.image[selection]; } void TabFrame::remove(unsigned selection) { if(selection >= state.text.size()) return; state.image.remove(selection); state.layout.remove(selection); state.text.remove(selection); return p.remove(selection); } unsigned TabFrame::selection() const { return state.selection; } void TabFrame::setImage(unsigned selection, const nall::image& image) { if(selection >= state.text.size()) return; state.image[selection] = image; return p.setImage(selection, image); } void TabFrame::setLayout(unsigned selection, Layout& layout) { if(selection >= state.text.size()) return; state.layout[selection] = &layout; synchronizeLayout(); } void TabFrame::setSelection(unsigned selection) { state.selection = selection; return p.setSelection(selection); } void TabFrame::setText(unsigned selection, const string& text) { if(selection >= state.text.size()) return; state.text[selection] = text; return p.setText(selection, text); } void TabFrame::synchronizeLayout() { for(unsigned n = 0; n < state.layout.size(); n++) { Layout* layout = state.layout[n]; if(layout == nullptr) continue; layout->Sizable::state.parent = this; layout->Sizable::state.window = Sizable::state.window; layout->state.widget = this; layout->state.widgetSelection = n; layout->synchronizeLayout(); } } unsigned TabFrame::tabs() const { return state.text.size(); } string TabFrame::text(unsigned selection) const { if(selection >= state.text.size()) return ""; return state.text[selection]; } TabFrame::TabFrame(): state(*new State), base_from_member(*new pTabFrame(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } TabFrame::~TabFrame() { p.destructor(); delete &state; } //TextEdit //======== bool TextEdit::editable() const { return state.editable; } void TextEdit::setCursorPosition(unsigned position) { state.cursorPosition = position; return p.setCursorPosition(position); } void TextEdit::setEditable(bool editable) { state.editable = editable; return p.setEditable(editable); } void TextEdit::setText(const string& text) { state.text = text; return p.setText(text); } void TextEdit::setWordWrap(bool wordWrap) { state.wordWrap = wordWrap; return p.setWordWrap(wordWrap); } string TextEdit::text() { return p.text(); } bool TextEdit::wordWrap() const { return state.wordWrap; } TextEdit::TextEdit(): state(*new State), base_from_member(*new pTextEdit(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } TextEdit::~TextEdit() { p.destructor(); delete &state; } //VerticalScroller //================ unsigned VerticalScroller::length() const { return state.length; } unsigned VerticalScroller::position() const { return state.position; } void VerticalScroller::setLength(unsigned length) { state.length = length; return p.setLength(length); } void VerticalScroller::setPosition(unsigned position) { state.position = position; return p.setPosition(position); } VerticalScroller::VerticalScroller(): state(*new State), base_from_member(*new pVerticalScroller(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } VerticalScroller::~VerticalScroller() { p.destructor(); delete &state; } //VerticalSlider //============== unsigned VerticalSlider::length() const { return state.length; } unsigned VerticalSlider::position() const { return state.position; } void VerticalSlider::setLength(unsigned length) { state.length = length; return p.setLength(length); } void VerticalSlider::setPosition(unsigned position) { state.position = position; return p.setPosition(position); } VerticalSlider::VerticalSlider(): state(*new State), base_from_member(*new pVerticalSlider(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } VerticalSlider::~VerticalSlider() { p.destructor(); delete &state; } //Viewport //======== bool Viewport::droppable() const { return state.droppable; } uintptr_t Viewport::handle() { return p.handle(); } void Viewport::setDroppable(bool droppable) { state.droppable = droppable; return p.setDroppable(droppable); } Viewport::Viewport(): state(*new State), base_from_member(*new pViewport(*this)), Widget(base_from_member::value), p(base_from_member::value) { p.constructor(); } Viewport::~Viewport() { p.destructor(); delete &state; } } sfc/alt/000700 001750 001750 00000000000 12656700342 013226 5ustar00sergiosergio000000 000000 sfc/base/satellaview/000700 001750 001750 00000000000 12656700342 015700 5ustar00sergiosergio000000 000000 nall/stream/gzip.hpp000664 001750 001750 00000001146 12651764221 015615 0ustar00sergiosergio000000 000000 #ifndef NALL_STREAM_GZIP_HPP #define NALL_STREAM_GZIP_HPP #include namespace nall { struct gzipstream : memorystream { using stream::read; using stream::write; gzipstream(const stream& stream) { unsigned size = stream.size(); uint8_t *data = new uint8_t[size]; stream.read(data, size); gzip archive; bool result = archive.decompress(data, size); delete[] data; if(result == false) return; psize = archive.size; pdata = new uint8_t[psize]; memcpy(pdata, archive.data, psize); } ~gzipstream() { if(pdata) delete[] pdata; } }; } #endif phoenix/windows/widget/000700 001750 001750 00000000000 12656700342 016322 5ustar00sergiosergio000000 000000 gba/apu/serialization.cpp000664 001750 001750 00000005707 12651764221 016620 0ustar00sergiosergio000000 000000 void APU::serialize(serializer& s) { Thread::serialize(s); s.integer(regs.bias.level); s.integer(regs.bias.amplitude); s.integer(regs.clock); s.integer(square1.sweep.shift); s.integer(square1.sweep.direction); s.integer(square1.sweep.frequency); s.integer(square1.sweep.enable); s.integer(square1.sweep.negate); s.integer(square1.sweep.period); s.integer(square1.envelope.frequency); s.integer(square1.envelope.direction); s.integer(square1.envelope.volume); s.integer(square1.envelope.period); s.integer(square1.enable); s.integer(square1.length); s.integer(square1.duty); s.integer(square1.frequency); s.integer(square1.counter); s.integer(square1.initialize); s.integer(square1.shadowfrequency); s.integer(square1.signal); s.integer(square1.output); s.integer(square1.period); s.integer(square1.phase); s.integer(square1.volume); s.integer(square2.envelope.frequency); s.integer(square2.envelope.direction); s.integer(square2.envelope.volume); s.integer(square2.envelope.period); s.integer(square2.enable); s.integer(square2.length); s.integer(square2.duty); s.integer(square2.frequency); s.integer(square2.counter); s.integer(square2.initialize); s.integer(square2.shadowfrequency); s.integer(square2.signal); s.integer(square2.output); s.integer(square2.period); s.integer(square2.phase); s.integer(square2.volume); s.integer(wave.mode); s.integer(wave.bank); s.integer(wave.dacenable); s.integer(wave.length); s.integer(wave.volume); s.integer(wave.frequency); s.integer(wave.counter); s.integer(wave.initialize); for(auto& value : wave.pattern) s.integer(value); s.integer(wave.enable); s.integer(wave.output); s.integer(wave.patternaddr); s.integer(wave.patternbank); s.integer(wave.patternsample); s.integer(wave.period); s.integer(noise.envelope.frequency); s.integer(noise.envelope.direction); s.integer(noise.envelope.volume); s.integer(noise.envelope.period); s.integer(noise.length); s.integer(noise.divisor); s.integer(noise.narrowlfsr); s.integer(noise.frequency); s.integer(noise.counter); s.integer(noise.initialize); s.integer(noise.enable); s.integer(noise.lfsr); s.integer(noise.output); s.integer(noise.period); s.integer(noise.volume); s.integer(sequencer.volume); s.integer(sequencer.lvolume); s.integer(sequencer.rvolume); for(auto& flag : sequencer.lenable) s.integer(flag); for(auto& flag : sequencer.renable) s.integer(flag); for(auto& flag : sequencer.enable) s.integer(flag); s.integer(sequencer.masterenable); s.integer(sequencer.base); s.integer(sequencer.step); s.integer(sequencer.lsample); s.integer(sequencer.rsample); for(auto& f : fifo) { for(auto& value : f.sample) s.integer(value); s.integer(f.output); s.integer(f.rdoffset); s.integer(f.wroffset); s.integer(f.size); s.integer(f.volume); s.integer(f.lenable); s.integer(f.renable); s.integer(f.timer); } } phoenix/reference/widget/label.cpp000664 001750 001750 00000000175 12651764221 020371 0ustar00sergiosergio000000 000000 namespace phoenix { void pLabel::setText(string text) { } void pLabel::constructor() { } void pLabel::destructor() { } } nall/string/cast.hpp000664 001750 001750 00000011753 12651764221 015616 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { //convert any (supported) type to a const char* without constructing a new nall::string //this is used inside istring(...) to build nall::string values template struct stringify; // base types template<> struct stringify { bool value; operator const char*() const { return value ? "true" : "false"; } stringify(bool value) : value(value) {} }; template<> struct stringify { char data[2]; operator const char*() const { return data; } stringify(char value) { data[0] = value, data[1] = 0; } }; // signed integers template<> struct stringify { char data[256]; operator const char*() const { return data; } stringify(signed char value) { integer(data, value); } }; template<> struct stringify { char data[256]; operator const char*() const { return data; } stringify(signed short value) { integer(data, value); } }; template<> struct stringify { char data[256]; operator const char*() const { return data; } stringify(signed int value) { integer(data, value); } }; template<> struct stringify { char data[256]; operator const char*() const { return data; } stringify(signed long value) { integer(data, value); } }; template<> struct stringify { char data[256]; operator const char*() const { return data; } stringify(signed long long value) { integer(data, value); } }; template struct stringify> { char data[256]; operator const char*() const { return data; } stringify(int_t value) { integer(data, value); } }; // unsigned integers template<> struct stringify { char data[256]; operator const char*() const { return data; } stringify(unsigned char value) { decimal(data, value); } }; template<> struct stringify { char data[256]; operator const char*() const { return data; } stringify(unsigned short value) { decimal(data, value); } }; template<> struct stringify { char data[256]; operator const char*() const { return data; } stringify(unsigned int value) { decimal(data, value); } }; template<> struct stringify { char data[256]; operator const char*() const { return data; } stringify(unsigned long value) { decimal(data, value); } }; template<> struct stringify { char data[256]; operator const char*() const { return data; } stringify(unsigned long long value) { decimal(data, value); } }; template struct stringify> { char data[256]; operator const char*() const { return data; } stringify(uint_t value) { decimal(data, value); } }; // floating-point template<> struct stringify { char data[256]; operator const char*() const { return data; } stringify(float value) { real(data, value); } }; template<> struct stringify { char data[256]; operator const char*() const { return data; } stringify(double value) { real(data, value); } }; template<> struct stringify { char data[256]; operator const char*() const { return data; } stringify(long double value) { real(data, value); } }; // arrays template<> struct stringify> { char* text; operator const char*() const { return text; } stringify(vector value) { text = new char[value.size() + 1](); memcpy(text, value.data(), value.size()); } ~stringify() { delete[] text; } }; template<> struct stringify&> { char* text; operator const char*() const { return text; } stringify(const vector& value) { text = new char[value.size() + 1](); memcpy(text, value.data(), value.size()); } ~stringify() { delete[] text; } }; // strings template<> struct stringify { const char* value; operator const char*() const { return value; } stringify(char* value) : value(value) {} }; template<> struct stringify { const char* value; operator const char*() const { return value; } stringify(const char* value) : value(value) {} }; template<> struct stringify { const string& value; operator const char*() const { return value; } stringify(const string& value) : value(value) {} }; template<> struct stringify { const string& value; operator const char*() const { return value; } stringify(const string& value) : value(value) {} }; #if defined(QSTRING_H) template<> struct stringify { const QString& value; operator const char*() const { return value.toUtf8().constData(); } stringify(const QString& value) : value(value) {} }; template<> struct stringify { const QString& value; operator const char*() const { return value.toUtf8().constData(); } stringify(const QString& value) : value(value) {} }; string::operator QString() const { return QString::fromUtf8(*this); } #endif // template stringify make_string(T value) { return stringify(std::forward(value)); } } #endif phoenix/windows/font.cpp000664 001750 001750 00000003173 12651764221 016532 0ustar00sergiosergio000000 000000 namespace phoenix { string pFont::serif(unsigned size, string style) { if(size == 0) size = 8; if(style == "") style = "Normal"; return {"Georgia, ", size, ", ", style}; } string pFont::sans(unsigned size, string style) { if(size == 0) size = 8; if(style == "") style = "Normal"; return {"Tahoma, ", size, ", ", style}; } string pFont::monospace(unsigned size, string style) { if(size == 0) size = 8; if(style == "") style = "Normal"; return {"Lucida Console, ", size, ", ", style}; } Size pFont::size(string font, string text) { HFONT hfont = pFont::create(font); Size size = pFont::size(hfont, text); pFont::free(hfont); return size; } HFONT pFont::create(string description) { lstring part; part.split(",", description); for(auto& item : part) item.trim(" "); string family = "Sans"; unsigned size = 8u; bool bold = false; bool italic = false; if(part[0] != "") family = part[0]; if(part.size() >= 2) size = decimal(part[1]); if(part.size() >= 3) bold = part[2].find("Bold"); if(part.size() >= 3) italic = part[2].find("Italic"); return CreateFont( -(size * 96.0 / 72.0 + 0.5), 0, 0, 0, bold == false ? FW_NORMAL : FW_BOLD, italic, 0, 0, 0, 0, 0, 0, 0, utf16_t(family) ); } void pFont::free(HFONT hfont) { DeleteObject(hfont); } Size pFont::size(HFONT hfont, string text) { //temporary fix: empty text string returns height of zero; bad for eg Button height if(text.empty()) text = " "; HDC hdc = GetDC(0); SelectObject(hdc, hfont); RECT rc = {0, 0, 0, 0}; DrawText(hdc, utf16_t(text), -1, &rc, DT_CALCRECT); ReleaseDC(0, hdc); return {rc.right, rc.bottom}; } } phoenix/reference/monitor.hpp000664 001750 001750 00000000223 12651764221 017515 0ustar00sergiosergio000000 000000 namespace phoenix { struct pMonitor { static unsigned count(); static Geometry geometry(unsigned monitor); static unsigned primary(); }; } ruby/input/joypad/xinput.cpp000664 001750 001750 00000015363 12651764221 017361 0ustar00sergiosergio000000 000000 #ifndef RUBY_INPUT_JOYPAD_XINPUT #define RUBY_INPUT_JOYPAD_XINPUT //documented functionality #define oXInputGetState "XInputGetState" #define oXInputSetState "XInputSetState" typedef DWORD WINAPI (*pXInputGetState)(DWORD dwUserIndex, XINPUT_STATE* pState); typedef DWORD WINAPI (*pXInputSetState)(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration); //undocumented functionality #define oXInputGetStateEx (LPCSTR)100 #define oXInputWaitForGuideButton (LPCSTR)101 #define oXInputCancelGuideButtonWait (LPCSTR)102 #define oXInputPowerOffController (LPCSTR)103 typedef DWORD WINAPI (*pXInputGetStateEx)(DWORD dwUserIndex, XINPUT_STATE* pState); typedef DWORD WINAPI (*pXInputWaitForGuideButton)(DWORD dwUserIndex, DWORD dwFlag, void* pUnknown); typedef DWORD WINAPI (*pXInputCancelGuideButtonWait)(DWORD dwUserIndex); typedef DWORD WINAPI (*pXInputPowerOffController)(DWORD dwUserIndex); #define XINPUT_GAMEPAD_GUIDE 0x0400 namespace ruby { struct InputJoypadXInput { HMODULE libxinput = nullptr; pXInputGetStateEx XInputGetStateEx = nullptr; pXInputSetState XInputSetState = nullptr; struct Joypad { HID::Joypad hid; unsigned id; }; vector joypads; void assign(HID::Joypad& hid, unsigned groupID, unsigned inputID, int16_t value) { auto& group = hid.group[groupID]; if(group.input[inputID].value == value) return; if(input.onChange) input.onChange(hid, groupID, inputID, group.input[inputID].value, value); group.input[inputID].value = value; } void poll(vector& devices) { for(auto& jp : joypads) { XINPUT_STATE state; if(XInputGetStateEx(jp.id, &state) != ERROR_SUCCESS) continue; //flip vertical axes so that -32768 = up, +32767 = down uint16_t axisLY = 32768 + state.Gamepad.sThumbLY; uint16_t axisRY = 32768 + state.Gamepad.sThumbRY; assign(jp.hid, HID::Joypad::GroupID::Axis, 0, (int16_t)state.Gamepad.sThumbLX); assign(jp.hid, HID::Joypad::GroupID::Axis, 1, (int16_t)(~axisLY - 32768)); assign(jp.hid, HID::Joypad::GroupID::Axis, 2, (int16_t)state.Gamepad.sThumbRX); assign(jp.hid, HID::Joypad::GroupID::Axis, 3, (int16_t)(~axisRY - 32768)); int16_t hatX = 0; int16_t hatY = 0; if(state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP ) hatY = -32768; if(state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN ) hatY = +32767; if(state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT ) hatX = -32768; if(state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT) hatX = +32767; assign(jp.hid, HID::Joypad::GroupID::Hat, 0, hatX); assign(jp.hid, HID::Joypad::GroupID::Hat, 1, hatY); //scale trigger ranges for up to down from (0 to 255) to (-32768 to +32767) uint16_t triggerL = state.Gamepad.bLeftTrigger; uint16_t triggerR = state.Gamepad.bRightTrigger; triggerL = triggerL << 8 | triggerL << 0; triggerR = triggerR << 8 | triggerR << 0; assign(jp.hid, HID::Joypad::GroupID::Trigger, 0, (int16_t)(triggerL - 32768)); assign(jp.hid, HID::Joypad::GroupID::Trigger, 1, (int16_t)(triggerR - 32768)); assign(jp.hid, HID::Joypad::GroupID::Button, 0, (bool)(state.Gamepad.wButtons & XINPUT_GAMEPAD_A)); assign(jp.hid, HID::Joypad::GroupID::Button, 1, (bool)(state.Gamepad.wButtons & XINPUT_GAMEPAD_B)); assign(jp.hid, HID::Joypad::GroupID::Button, 2, (bool)(state.Gamepad.wButtons & XINPUT_GAMEPAD_X)); assign(jp.hid, HID::Joypad::GroupID::Button, 3, (bool)(state.Gamepad.wButtons & XINPUT_GAMEPAD_Y)); assign(jp.hid, HID::Joypad::GroupID::Button, 4, (bool)(state.Gamepad.wButtons & XINPUT_GAMEPAD_BACK)); assign(jp.hid, HID::Joypad::GroupID::Button, 5, (bool)(state.Gamepad.wButtons & XINPUT_GAMEPAD_START)); assign(jp.hid, HID::Joypad::GroupID::Button, 6, (bool)(state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER)); assign(jp.hid, HID::Joypad::GroupID::Button, 7, (bool)(state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER)); assign(jp.hid, HID::Joypad::GroupID::Button, 8, (bool)(state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB)); assign(jp.hid, HID::Joypad::GroupID::Button, 9, (bool)(state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB)); assign(jp.hid, HID::Joypad::GroupID::Button, 10, (bool)(state.Gamepad.wButtons & XINPUT_GAMEPAD_GUIDE)); devices.append(&jp.hid); } } bool rumble(uint64_t id, bool enable) { for(auto& jp : joypads) { if(jp.hid.id != id) continue; XINPUT_VIBRATION vibration; memset(&vibration, 0, sizeof(XINPUT_VIBRATION)); vibration.wLeftMotorSpeed = enable ? 65535 : 0; //low-frequency motor (0 = off, 65535 = max) vibration.wRightMotorSpeed = enable ? 65535 : 0; //high-frequency motor (0 = off, 65535 = max) XInputSetState(jp.id, &vibration); return true; } return false; } bool init() { if(!libxinput) libxinput = LoadLibraryA("xinput1_3.dll"); if(!libxinput) return false; //XInputGetStateEx is an undocumented function; but is required to get the state of the guide button //if for some reason it is not available, fall back on XInputGetState, which takes the same parameters XInputGetStateEx = (pXInputGetStateEx)GetProcAddress(libxinput, oXInputGetStateEx); XInputSetState = (pXInputSetState)GetProcAddress(libxinput, oXInputSetState); if(!XInputGetStateEx) XInputGetStateEx = (pXInputGetStateEx)GetProcAddress(libxinput, oXInputGetState); if(!XInputGetStateEx || !XInputSetState) return term(), false; //XInput supports a maximum of four controllers //add all four to devices list now. If they are not connected, they will not show up in poll() results for(unsigned id = 0; id < 4; id++) { Joypad jp; jp.id = id; jp.hid.id = (uint64_t)(1 + id) << 32 | 0x045e << 16 | 0x028e << 0; //Xbox 360 Player# + VendorID + ProductID jp.hid.axis().append({"LeftThumbX"}); jp.hid.axis().append({"LeftThumbY"}); jp.hid.axis().append({"RightThumbX"}); jp.hid.axis().append({"RightThumbY"}); jp.hid.hat().append({"HatX"}); jp.hid.hat().append({"HatY"}); jp.hid.trigger().append({"LeftTrigger"}); jp.hid.trigger().append({"RightTrigger"}); jp.hid.button().append({"A"}); jp.hid.button().append({"B"}); jp.hid.button().append({"X"}); jp.hid.button().append({"Y"}); jp.hid.button().append({"Back"}); jp.hid.button().append({"Start"}); jp.hid.button().append({"LeftShoulder"}); jp.hid.button().append({"RightShoulder"}); jp.hid.button().append({"LeftThumb"}); jp.hid.button().append({"RightThumb"}); jp.hid.button().append({"Guide"}); joypads.append(jp); } return true; } void term() { if(!libxinput) return; FreeLibrary(libxinput); libxinput = nullptr; } }; } #endif gb/scheduler/scheduler.cpp000664 001750 001750 00000000776 12651764221 016752 0ustar00sergiosergio000000 000000 #include #define SCHEDULER_CPP namespace GameBoy { Scheduler scheduler; void Scheduler::enter() { host_thread = co_active(); co_switch(active_thread); } void Scheduler::exit(ExitReason reason) { exit_reason = reason; active_thread = co_active(); co_switch(host_thread); } void Scheduler::init() { host_thread = co_active(); active_thread = cpu.thread; } Scheduler::Scheduler() { exit_reason = ExitReason::UnknownEvent; host_thread = nullptr; active_thread = nullptr; } } sfc/chip/sa1/mmio/000700 001750 001750 00000000000 12656700342 015016 5ustar00sergiosergio000000 000000 sfc/chip/icd2/interface/interface.hpp000664 001750 001750 00000001220 12651764221 020633 0ustar00sergiosergio000000 000000 void lcdScanline(); void joypWrite(bool p15, bool p14); uint32_t videoColor(unsigned source, uint16_t red, uint16_t green, uint16_t blue); void videoRefresh(const uint32_t* data, unsigned pitch, unsigned width, unsigned height); void audioSample(int16_t lsample, int16_t rsample); int16_t inputPoll(unsigned port, unsigned device, unsigned id); struct Packet { uint8 data[16]; uint8& operator[](unsigned addr) { return data[addr & 15]; } }; Packet packet[64]; unsigned packetsize; unsigned joyp_id; bool joyp15lock; bool joyp14lock; bool pulselock; bool strobelock; bool packetlock; Packet joyp_packet; uint8 packetoffset; uint8 bitdata, bitoffset; sfc/Makefile000664 001750 001750 00000011064 12651764221 014125 0ustar00sergiosergio000000 000000 sfc_objects := sfc-interface sfc-system sfc-controller sfc_objects += sfc-cartridge sfc-cheat sfc_objects += sfc-memory sfc-cpu sfc-smp sfc-dsp sfc-ppu sfc_objects += sfc-satellaviewbase sfc_objects += sfc-icd2 sfc-bsx sfc-nss sfc-event sfc_objects += sfc-sa1 sfc-superfx sfc_objects += sfc-armdsp sfc-hitachidsp sfc-necdsp sfc_objects += sfc-epsonrtc sfc-sharprtc sfc_objects += sfc-spc7110 sfc-sdd1 sfc-obc1 sfc_objects += sfc-hsu1 sfc-msu1 sfc_objects += sfc-satellaviewcart sfc-sufamiturbo sfc_objects += sfc-hledsp1 sfc-hledsp2 sfc-hledsp3 sfc-hledsp4 sfc_objects += sfc-hlecx4 sfc-hlest0010 sfc_objects += sfc-sgbexternal ifeq ($(profile),accuracy) profflags := -DPROFILE_ACCURACY sfccpu := $(sfc)/cpu sfcsmp := $(sfc)/smp sfcdsp := $(sfc)/dsp sfcppu := $(sfc)/ppu else ifeq ($(profile),balanced) profflags := -DPROFILE_BALANCED sfccpu := $(sfc)/cpu sfcsmp := $(sfc)/smp sfcdsp := $(sfc)/alt/dsp sfcppu := $(sfc)/alt/ppu-balanced else ifeq ($(profile),performance) profflags := -DPROFILE_PERFORMANCE sfccpu := $(sfc)/alt/cpu sfcsmp := $(sfc)/alt/smp sfcdsp := $(sfc)/alt/dsp sfcppu := $(sfc)/alt/ppu-performance else $(error unknown profile.) endif obj/sfc-interface-$(profile).o: $(sfc)/interface/interface.cpp $(call rwildcard,$(sfc)/interface) obj/sfc-system-$(profile).o: $(sfc)/system/system.cpp $(call rwildcard,$(sfc)/system/) obj/sfc-controller-$(profile).o: $(sfc)/controller/controller.cpp $(call rwildcard,$(sfc)/controller/) obj/sfc-cartridge-$(profile).o: $(sfc)/cartridge/cartridge.cpp $(sfc)/cartridge/* obj/sfc-cheat-$(profile).o: $(sfc)/cheat/cheat.cpp $(sfc)/cheat/* obj/sfc-memory-$(profile).o: $(sfc)/memory/memory.cpp $(call rwildcard,$(sfc)/memory/) obj/sfc-cpu-$(profile).o: $(sfccpu)/cpu.cpp $(call rwildcard,$(sfccpu)/) obj/sfc-smp-$(profile).o: $(sfcsmp)/smp.cpp $(call rwildcard,$(sfcsmp)/) obj/sfc-dsp-$(profile).o: $(sfcdsp)/dsp.cpp $(call rwildcard,$(sfcdsp)/) obj/sfc-ppu-$(profile).o: $(sfcppu)/ppu.cpp $(call rwildcard,$(sfcppu)/) obj/sfc-satellaviewbase-$(profile).o: $(sfc)/base/satellaview/satellaview.cpp $(call rwildcard,$(sfc)/base/satellaview/) obj/sfc-icd2-$(profile).o: $(sfc)/chip/icd2/icd2.cpp $(call rwildcard,$(sfc)/chip/icd2/) obj/sfc-bsx-$(profile).o: $(sfc)/chip/bsx/bsx.cpp $(call rwildcard,$(sfc)/chip/bsx/) obj/sfc-nss-$(profile).o: $(sfc)/chip/nss/nss.cpp $(call rwildcard,$(sfc)/chip/nss/) obj/sfc-event-$(profile).o: $(sfc)/chip/event/event.cpp $(call rwildcard,$(sfc)/chip/event/) obj/sfc-sa1-$(profile).o: $(sfc)/chip/sa1/sa1.cpp $(call rwildcard,$(sfc)/chip/sa1/) obj/sfc-superfx-$(profile).o: $(sfc)/chip/superfx/superfx.cpp $(call rwildcard,$(sfc)/chip/superfx/) obj/sfc-armdsp-$(profile).o: $(sfc)/chip/armdsp/armdsp.cpp $(call rwildcard,$(sfc)/chip/armdsp/) obj/sfc-hitachidsp-$(profile).o: $(sfc)/chip/hitachidsp/hitachidsp.cpp $(call rwildcard,$(sfc)/chip/hitachidsp/) obj/sfc-necdsp-$(profile).o: $(sfc)/chip/necdsp/necdsp.cpp $(call rwildcard,$(sfc)/chip/necdsp/) obj/sfc-epsonrtc-$(profile).o: $(sfc)/chip/epsonrtc/epsonrtc.cpp $(call rwildcard,$(sfc)/chip/epsonrtc/) obj/sfc-sharprtc-$(profile).o: $(sfc)/chip/sharprtc/sharprtc.cpp $(call rwildcard,$(sfc)/chip/sharprtc/) obj/sfc-spc7110-$(profile).o: $(sfc)/chip/spc7110/spc7110.cpp $(sfc)/chip/spc7110/* obj/sfc-sdd1-$(profile).o: $(sfc)/chip/sdd1/sdd1.cpp $(sfc)/chip/sdd1/* obj/sfc-obc1-$(profile).o: $(sfc)/chip/obc1/obc1.cpp $(sfc)/chip/obc1/* obj/sfc-hsu1-$(profile).o: $(sfc)/chip/hsu1/hsu1.cpp $(sfc)/chip/hsu1/* obj/sfc-msu1-$(profile).o: $(sfc)/chip/msu1/msu1.cpp $(sfc)/chip/msu1/* obj/sfc-satellaviewcart-$(profile).o: $(sfc)/slot/satellaview/satellaview.cpp $(call rwildcard,$(sfc)/slot/satellaview/) obj/sfc-sufamiturbo-$(profile).o: $(sfc)/slot/sufamiturbo/sufamiturbo.cpp $(call rwildcard,$(sfc)/slot/sufamiturbo/) obj/sfc-hledsp1-$(profile).o: $(sfc)/chip/dsp1/dsp1.cpp $(sfc)/chip/dsp1/* obj/sfc-hledsp2-$(profile).o: $(sfc)/chip/dsp2/dsp2.cpp $(sfc)/chip/dsp2/* obj/sfc-hledsp3-$(profile).o: $(sfc)/chip/dsp3/dsp3.cpp $(sfc)/chip/dsp3/* obj/sfc-hledsp4-$(profile).o: $(sfc)/chip/dsp4/dsp4.cpp $(sfc)/chip/dsp4/* obj/sfc-hlecx4-$(profile).o: $(sfc)/chip/cx4/cx4.cpp $(sfc)/chip/cx4/* obj/sfc-hlest0010-$(profile).o: $(sfc)/chip/st0010/st0010.cpp $(sfc)/chip/st0010/* obj/sfc-sgbexternal-$(profile).o: $(sfc)/chip/sgb-external/sgb-external.cpp $(sfc)/chip/sgb-external/* sfc/system/system.hpp000664 001750 001750 00000003311 12651764221 016042 0ustar00sergiosergio000000 000000 struct Interface; struct System : property { enum class Region : unsigned { NTSC = 0, PAL = 1, Autodetect = 2 }; enum class ExpansionPortDevice : unsigned { None = 0, Satellaview = 1 }; void run(); void runtosave(); void init(); void term(); void load(); void unload(); void power(); void reset(); void frame(); void scanline(); //return *active* system information (settings are cached upon power-on) readonly region; readonly expansion; readonly cpu_frequency; readonly apu_frequency; readonly serialize_size; serializer serialize(); bool unserialize(serializer&); System(); private: void runthreadtosave(); void serialize(serializer&); void serialize_all(serializer&); void serialize_init(); friend class Cartridge; friend class Video; friend class Audio; friend class Input; }; extern System system; #include "video.hpp" #include "audio.hpp" #include "input.hpp" #include struct Configuration { Input::Device controller_port1 = Input::Device::Joypad; Input::Device controller_port2 = Input::Device::Joypad; System::ExpansionPortDevice expansion_port = System::ExpansionPortDevice::Satellaview; System::Region region = System::Region::Autodetect; bool random = true; }; extern Configuration configuration; struct Random { void seed(unsigned seed) { iter = seed; } unsigned operator()(unsigned result) { if(configuration.random == false) return result; return iter = (iter >> 1) ^ (((iter & 1) - 1) & 0xedb88320); } void serialize(serializer& s) { s.integer(iter); } private: unsigned iter = 0; }; extern Random random; phoenix/gtk/widget/frame.cpp000664 001750 001750 00000002223 12651764221 017227 0ustar00sergiosergio000000 000000 namespace phoenix { GtkWidget* pFrame::container(Widget& widget) { return gtk_widget_get_parent(gtkWidget); } Position pFrame::containerOffset() { return {0, 0}; } void pFrame::setEnabled(bool enabled) { if(frame.state.layout) frame.state.layout->setEnabled(frame.state.layout->enabled()); pWidget::setEnabled(enabled); } void pFrame::setGeometry(Geometry geometry) { pWidget::setGeometry(geometry); if(frame.state.layout == nullptr) return; Size size = pFont::size(widget.state.font, frame.state.text); if(frame.state.text.empty()) size.height = 8; geometry.x += 2, geometry.width -= 5; geometry.y += size.height - 1, geometry.height -= size.height + 2; frame.state.layout->setGeometry(geometry); } void pFrame::setText(string text) { gtk_frame_set_label(GTK_FRAME(gtkWidget), text); } void pFrame::setVisible(bool visible) { if(frame.state.layout) frame.state.layout->setVisible(frame.state.layout->visible()); pWidget::setVisible(visible); } void pFrame::constructor() { gtkWidget = gtk_frame_new(""); } void pFrame::destructor() { gtk_widget_destroy(gtkWidget); } void pFrame::orphan() { destructor(); constructor(); } } sfc/chip/dsp1/dsp1.hpp000664 001750 001750 00000000444 12651764221 015637 0ustar00sergiosergio000000 000000 #include "dsp1emu.hpp" class DSP1 { public: void init(); void load(); void unload(); void power(); void reset(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); void serialize(serializer&); unsigned Select; private: Dsp1 dsp1; }; extern DSP1 dsp1; gb/apu/master/master.cpp000664 001750 001750 00000005437 12651764221 016370 0ustar00sergiosergio000000 000000 #ifdef APU_CPP void APU::Master::run() { if(enable == false) { center = 0; left = 0; right = 0; center_bias = left_bias = right_bias = 0; return; } signed sample = 0; sample += apu.square1.output; sample += apu.square2.output; sample += apu.wave.output; sample += apu.noise.output; center = (sample * 512) - 16384; sample = 0; if(channel1_left_enable) sample += apu.square1.output; if(channel2_left_enable) sample += apu.square2.output; if(channel3_left_enable) sample += apu.wave.output; if(channel4_left_enable) sample += apu.noise.output; sample = (sample * 512) - 16384; sample = (sample * (left_volume + 1)) / 8; left = sample; sample = 0; if(channel1_right_enable) sample += apu.square1.output; if(channel2_right_enable) sample += apu.square2.output; if(channel3_right_enable) sample += apu.wave.output; if(channel4_right_enable) sample += apu.noise.output; sample = (sample * 512) - 16384; sample = (sample * (right_volume + 1)) / 8; right = sample; //reduce audio volume center >>= 1; left >>= 1; right >>= 1; } void APU::Master::write(unsigned r, uint8 data) { if(r == 0) { //$ff24 NR50 left_in_enable = data & 0x80; left_volume = (data >> 4) & 7; right_in_enable = data & 0x08; right_volume = (data >> 0) & 7; } if(r == 1) { //$ff25 NR51 channel4_left_enable = data & 0x80; channel3_left_enable = data & 0x40; channel2_left_enable = data & 0x20; channel1_left_enable = data & 0x10; channel4_right_enable = data & 0x08; channel3_right_enable = data & 0x04; channel2_right_enable = data & 0x02; channel1_right_enable = data & 0x01; } if(r == 2) { //$ff26 NR52 enable = data & 0x80; } } void APU::Master::power() { left_in_enable = 0; left_volume = 0; right_in_enable = 0; right_volume = 0; channel4_left_enable = 0; channel3_left_enable = 0; channel2_left_enable = 0; channel1_left_enable = 0; channel4_right_enable = 0; channel3_right_enable = 0; channel2_right_enable = 0; channel1_right_enable = 0; enable = 0; center = 0; left = 0; right = 0; center_bias = 0; left_bias = 0; right_bias = 0; } void APU::Master::serialize(serializer& s) { s.integer(left_in_enable); s.integer(left_volume); s.integer(right_in_enable); s.integer(right_volume); s.integer(channel4_left_enable); s.integer(channel3_left_enable); s.integer(channel2_left_enable); s.integer(channel1_left_enable); s.integer(channel4_right_enable); s.integer(channel3_right_enable); s.integer(channel2_right_enable); s.integer(channel1_right_enable); s.integer(enable); s.integer(center); s.integer(left); s.integer(right); s.integer(center_bias); s.integer(left_bias); s.integer(right_bias); } #endif target-ethos/general/library.hpp000664 001750 001750 00000002214 12651764221 020107 0ustar00sergiosergio000000 000000 struct LibraryBrowser : VerticalLayout { ListView folders; HorizontalLayout informationLayout; Label informationType; Label information; ComboButton mediaMode; LibraryBrowser(Emulator::Interface& emulator); void onActivate(); void onChange(); void refresh(); void setMode(); Emulator::Interface& emulator; string pathname; string type; string typeMask; string typeSuffix; }; struct LibraryImport : VerticalLayout { Label information; Button importButton; LibraryImport(); void onImportActivate(); }; struct LibraryManager : Window { VerticalLayout layout; TabFrame libraryFrame; vector browsers; LibraryImport libraryImport; HorizontalLayout informationLayout; Label information; Button skipButton; Button loadButton; LibraryManager(); void bootstrap(); string load(const string& type); void onChange(); void onLoad(); void setInformation(bool load); void show(); void show(const string& type); void synchronize(); lstring loaded; string requestedLoadType; bool slotLoad = false; string loadPathname; }; extern LibraryManager* libraryManager; phoenix/cocoa/platform.cpp000664 001750 001750 00000002312 12651764221 016774 0ustar00sergiosergio000000 000000 #include "platform.hpp" #include "utility.cpp" #include "font.cpp" #include "desktop.cpp" #include "monitor.cpp" #include "keyboard.cpp" #include "mouse.cpp" #include "browser-window.cpp" #include "message-window.cpp" #include "object.cpp" #include "timer.cpp" #include "window.cpp" #include "action/action.cpp" #include "action/menu.cpp" #include "action/separator.cpp" #include "action/item.cpp" #include "action/check-item.cpp" #include "action/radio-item.cpp" #include "widget/widget.cpp" #include "widget/button.cpp" #include "widget/canvas.cpp" #include "widget/check-button.cpp" #include "widget/check-label.cpp" #include "widget/combo-button.cpp" #include "widget/console.cpp" #include "widget/frame.cpp" #include "widget/hex-edit.cpp" #include "widget/horizontal-scroller.cpp" #include "widget/horizontal-slider.cpp" #include "widget/label.cpp" #include "widget/line-edit.cpp" #include "widget/list-view.cpp" #include "widget/progress-bar.cpp" #include "widget/radio-button.cpp" #include "widget/radio-label.cpp" #include "widget/tab-frame.cpp" #include "widget/text-edit.cpp" #include "widget/vertical-scroller.cpp" #include "widget/vertical-slider.cpp" #include "widget/viewport.cpp" #include "application.cpp" phoenix/cocoa/widget/label.cpp000664 001750 001750 00000002664 12651764221 017524 0ustar00sergiosergio000000 000000 @implementation CocoaLabel : NSTextField -(id) initWith:(phoenix::Label&)labelReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { label = &labelReference; [self setAlignment:NSLeftTextAlignment]; [self setBordered:NO]; [self setDrawsBackground:NO]; [self setEditable:NO]; } return self; } @end namespace phoenix { Size pLabel::minimumSize() { Size size = Font::size(label.font(), label.state.text); return {size.width, size.height}; } void pLabel::setGeometry(Geometry geometry) { //NSTextField does not support vertical text centering: //simulate this by adjusting the geometry placement (reduce height, move view down) unsigned height = Font::size(label.font(), " ").height; unsigned widgetHeight = geometry.height + 4; //+4 compensates for margin adjust auto offset = geometry; if(widgetHeight > height) { unsigned diff = widgetHeight - height; offset.y += diff >> 1; offset.height -= diff >> 1; } pWidget::setGeometry({ offset.x - 3, offset.y - 3, offset.width + 6, offset.height + 6 }); } void pLabel::setText(string text) { @autoreleasepool { [cocoaView setStringValue:[NSString stringWithUTF8String:text]]; } } void pLabel::constructor() { @autoreleasepool { cocoaView = cocoaLabel = [[CocoaLabel alloc] initWith:label]; setText(label.state.text); } } void pLabel::destructor() { @autoreleasepool { [cocoaView release]; } } } sfc/slot/satellaview/satellaview.hpp000664 001750 001750 00000000726 12651764221 021022 0ustar00sergiosergio000000 000000 struct SatellaviewCartridge : Memory { MappedRAM memory; bool readonly; void init(); void load(); void unload(); void power(); void reset(); unsigned size() const; uint8 read(unsigned addr); void write(unsigned addr, uint8 data); private: struct { unsigned command; uint8 write_old; uint8 write_new; bool flash_enable; bool read_enable; bool write_enable; } regs; }; extern SatellaviewCartridge satellaviewcartridge; phoenix/gtk/platform.hpp000664 001750 001750 00000036024 12651764221 016511 0ustar00sergiosergio000000 000000 namespace phoenix { struct pApplication { static XlibDisplay* display; static void run(); static bool pendingEvents(); static void processEvents(); static void quit(); static void initialize(); }; struct Settings : Configuration::Document { bimap keymap; struct Geometry : Configuration::Node { unsigned frameX; unsigned frameY; unsigned frameWidth; unsigned frameHeight; unsigned menuHeight; unsigned statusHeight; } geometry; struct Window : Configuration::Node { unsigned backgroundColor; } window; void load(); void save(); Settings(); }; struct pWindow; struct pMenu; struct pLayout; struct pWidget; struct pFont { static string serif(unsigned size, string style); static string sans(unsigned size, string style); static string monospace(unsigned size, string style); static Size size(string font, string text); static PangoFontDescription* create(string description); static void free(PangoFontDescription* font); static Size size(PangoFontDescription* font, string text); static void setFont(GtkWidget* widget, string font); static void setFont(GtkWidget* widget, gpointer font); }; struct pDesktop { static Size size(); static Geometry workspace(); }; struct pMonitor { static unsigned count(); static Geometry geometry(unsigned monitor); static unsigned primary(); }; struct pKeyboard { static bool pressed(Keyboard::Scancode scancode); static vector state(); static void initialize(); }; struct pMouse { static Position position(); static bool pressed(Mouse::Button button); }; struct pBrowserWindow { static string directory(BrowserWindow::State& state); static string open(BrowserWindow::State& state); static string save(BrowserWindow::State& state); }; struct pMessageWindow { static MessageWindow::Response error(MessageWindow::State& state); static MessageWindow::Response information(MessageWindow::State& state); static MessageWindow::Response question(MessageWindow::State& state); static MessageWindow::Response warning(MessageWindow::State& state); }; struct pObject { Object& object; bool locked; pObject(Object& object) : object(object), locked(false) {} virtual ~pObject() {} void constructor() {} void destructor() {} }; struct pTimer : public pObject { Timer& timer; void setEnabled(bool enabled); void setInterval(unsigned interval); pTimer(Timer& timer) : pObject(timer), timer(timer) {} void constructor(); }; struct pWindow : public pObject { Window& window; GtkWidget* widget; GtkWidget* menuContainer; GtkWidget* formContainer; GtkWidget* statusContainer; GtkWidget* menu; GtkWidget* status; GtkAllocation lastAllocation; bool onSizePending; static Window& none(); void append(Layout& layout); void append(Menu& menu); void append(Widget& widget); bool focused(); Geometry frameMargin(); Geometry geometry(); void remove(Layout& layout); void remove(Menu& menu); void remove(Widget& widget); void setBackgroundColor(Color color); void setDroppable(bool droppable); void setFocused(); void setFullScreen(bool fullScreen); void setGeometry(Geometry geometry); void setMenuFont(string font); void setMenuVisible(bool visible); void setModal(bool modal); void setResizable(bool resizable); void setStatusFont(string font); void setStatusText(string text); void setStatusVisible(bool visible); void setTitle(string text); void setVisible(bool visible); void setWidgetFont(string font); pWindow(Window& window) : pObject(window), window(window) {} void constructor(); unsigned menuHeight(); unsigned statusHeight(); }; struct pAction : public pObject { Action& action; GtkWidget* widget; void setEnabled(bool enabled); void setVisible(bool visible); pAction(Action& action) : pObject(action), action(action) {} void constructor(); virtual void orphan(); string mnemonic(string text); virtual void setFont(string font); }; struct pMenu : public pAction { Menu& menu; GtkWidget* gtkMenu; void append(Action& action); void remove(Action& action); void setImage(const image& image); void setText(string text); pMenu(Menu &menu) : pAction(menu), menu(menu) {} void constructor(); void destructor(); void orphan(); void setFont(string font); }; struct pSeparator : public pAction { Separator& separator; pSeparator(Separator& separator) : pAction(separator), separator(separator) {} void constructor(); void destructor(); void orphan(); }; struct pItem : public pAction { Item& item; void setImage(const image& image); void setText(string text); pItem(Item& item) : pAction(item), item(item) {} void constructor(); void destructor(); void orphan(); }; struct pCheckItem : public pAction { CheckItem& checkItem; void setChecked(bool checked); void setText(string text); pCheckItem(CheckItem& checkItem) : pAction(checkItem), checkItem(checkItem) {} void constructor(); void destructor(); void orphan(); }; struct pRadioItem : public pAction { RadioItem& radioItem; void setChecked(); void setGroup(const group& group); void setText(string text); pRadioItem(RadioItem& radioItem) : pAction(radioItem), radioItem(radioItem) {} void constructor(); void destructor(); void orphan(); void onActivate(); pRadioItem& parent(); }; struct pSizable : public pObject { Sizable& sizable; virtual Position displacement() { return {0, 0}; } pSizable(Sizable &sizable) : pObject(sizable), sizable(sizable) {} }; struct pLayout : public pSizable { Layout& layout; pLayout(Layout& layout) : pSizable(layout), layout(layout) {} }; struct pWidget : public pSizable { Widget& widget; GtkWidget* gtkWidget = nullptr; GtkWidget* gtkParent = nullptr; virtual GtkWidget* container(Widget& widget); virtual bool focused(); virtual Size minimumSize(); virtual void setEnabled(bool enabled); virtual void setFocused(); virtual void setFont(string font); virtual void setGeometry(Geometry geometry); virtual void setVisible(bool visible); pWidget(Widget& widget) : pSizable(widget), widget(widget) {} void constructor(); void destructor(); virtual void orphan(); }; struct pButton : public pWidget { Button& button; Size minimumSize(); void setImage(const image& image, Orientation orientation); void setText(string text); pButton(Button& button) : pWidget(button), button(button) {} void constructor(); void destructor(); void orphan(); }; struct pCanvas : public pWidget { Canvas& canvas; GdkPixbuf* surface = nullptr; unsigned surfaceWidth = 0; unsigned surfaceHeight = 0; Size minimumSize(); void setDroppable(bool droppable); void setGeometry(Geometry geometry); void setMode(Canvas::Mode mode); void setSize(Size size); pCanvas(Canvas& canvas) : pWidget(canvas), canvas(canvas) {} void constructor(); void destructor(); void orphan(); void onExpose(GdkEventExpose* event); void rasterize(); void redraw(); void release(); }; struct pCheckButton : public pWidget { CheckButton& checkButton; Size minimumSize(); void setChecked(bool checked); void setImage(const image& image, Orientation orientation); void setText(string text); pCheckButton(CheckButton& checkButton) : pWidget(checkButton), checkButton(checkButton) {} void constructor(); void destructor(); void orphan(); void onToggle(); }; struct pCheckLabel : public pWidget { CheckLabel& checkLabel; Size minimumSize(); void setChecked(bool checked); void setText(string text); pCheckLabel(CheckLabel& checkLabel) : pWidget(checkLabel), checkLabel(checkLabel) {} void constructor(); void destructor(); void orphan(); }; struct pComboButton : public pWidget { ComboButton& comboButton; unsigned itemCounter; void append(string text); Size minimumSize(); void remove(unsigned selection); void reset(); void setSelection(unsigned selection); void setText(unsigned selection, string text); pComboButton(ComboButton& comboButton) : pWidget(comboButton), comboButton(comboButton) {} void constructor(); void destructor(); void orphan(); }; struct pConsole : public pWidget { Console& console; GtkWidget* subWidget; GtkTextBuffer* textBuffer; string command; void print(string text); void reset(); pConsole(Console& console) : pWidget(console), console(console) {} void constructor(); void destructor(); void orphan(); bool keyPress(unsigned scancode, unsigned mask); void seekCursorToEnd(); }; struct pFrame : public pWidget { Frame& frame; GtkWidget* container(Widget& widget); Position containerOffset(); void setEnabled(bool enabled); void setGeometry(Geometry geometry); void setText(string text); void setVisible(bool visible); pFrame(Frame& frame) : pWidget(frame), frame(frame) {} void constructor(); void destructor(); void orphan(); }; struct pHexEdit : public pWidget { HexEdit& hexEdit; GtkWidget* container; GtkWidget* subWidget; GtkWidget* scrollBar; GtkTextBuffer* textBuffer; GtkTextMark* textCursor; bool focused(); void setColumns(unsigned columns); void setLength(unsigned length); void setOffset(unsigned offset); void setRows(unsigned rows); void update(); pHexEdit(HexEdit& hexEdit) : pWidget(hexEdit), hexEdit(hexEdit) {} void constructor(); void destructor(); void orphan(); unsigned cursorPosition(); bool keyPress(unsigned scancode, unsigned mask); signed rows(); signed rowsScrollable(); void scroll(signed position); void setCursorPosition(unsigned position); void setScroll(); void updateScroll(); }; struct pHorizontalScroller : public pWidget { HorizontalScroller& horizontalScroller; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pHorizontalScroller(HorizontalScroller& horizontalScroller) : pWidget(horizontalScroller), horizontalScroller(horizontalScroller) {} void constructor(); void destructor(); void orphan(); }; struct pHorizontalSlider : public pWidget { HorizontalSlider& horizontalSlider; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pHorizontalSlider(HorizontalSlider& horizontalSlider) : pWidget(horizontalSlider), horizontalSlider(horizontalSlider) {} void constructor(); void destructor(); void orphan(); }; struct pLabel : public pWidget { Label& label; Size minimumSize(); void setText(string text); pLabel(Label& label) : pWidget(label), label(label) {} void constructor(); void destructor(); void orphan(); }; struct pLineEdit : public pWidget { LineEdit& lineEdit; Size minimumSize(); void setEditable(bool editable); void setText(string text); string text(); pLineEdit(LineEdit& lineEdit) : pWidget(lineEdit), lineEdit(lineEdit) {} void constructor(); void destructor(); void orphan(); }; struct pListView : public pWidget { ListView& listView; GtkWidget* subWidget; GtkListStore* store; struct GtkColumn { GtkTreeViewColumn* column; GtkCellRenderer* checkbutton; GtkCellRenderer* icon; GtkCellRenderer* text; GtkWidget *label; }; vector column; void append(const lstring& text); void autoSizeColumns(); bool focused(); void remove(unsigned selection); void reset(); void setCheckable(bool checkable); void setChecked(unsigned selection, bool checked); void setHeaderText(const lstring& text); void setHeaderVisible(bool visible); void setImage(unsigned selection, unsigned position, const image& image); void setSelected(bool selected); void setSelection(unsigned row); void setText(unsigned selection, unsigned position, string text); pListView(ListView& listView) : pWidget(listView), listView(listView) {} void constructor(); void destructor(); void orphan(); void setFocused(); void setFont(string font); }; struct pProgressBar : public pWidget { ProgressBar& progressBar; Size minimumSize(); void setPosition(unsigned position); pProgressBar(ProgressBar& progressBar) : pWidget(progressBar), progressBar(progressBar) {} void constructor(); void destructor(); void orphan(); }; struct pRadioButton : public pWidget { RadioButton& radioButton; Size minimumSize(); void setChecked(); void setGroup(const group& group); void setImage(const image& image, Orientation orientation); void setText(string text); pRadioButton(RadioButton& radioButton) : pWidget(radioButton), radioButton(radioButton) {} void constructor(); void destructor(); void orphan(); void onActivate(); pRadioButton& parent(); }; struct pRadioLabel : public pWidget { RadioLabel& radioLabel; Size minimumSize(); void setChecked(); void setGroup(const group& group); void setText(string text); pRadioLabel(RadioLabel& radioLabel) : pWidget(radioLabel), radioLabel(radioLabel) {} void onActivate(); pRadioLabel& parent(); void constructor(); void destructor(); void orphan(); }; struct pTabFrame : public pWidget { TabFrame& tabFrame; struct Tab { GtkWidget* child; GtkWidget* container; GtkWidget* layout; GtkWidget* image; GtkWidget* title; }; vector tabs; void append(string text, const image& image); GtkWidget* container(Widget& widget); Position displacement(); void remove(unsigned selection); void setEnabled(bool enabled); void setGeometry(Geometry geometry); void setImage(unsigned selection, const image& image); void setSelection(unsigned selection); void setText(unsigned selection, string text); void setVisible(bool visible); pTabFrame(TabFrame& tabFrame) : pWidget(tabFrame), tabFrame(tabFrame) {} void constructor(); void destructor(); void orphan(); void setFont(string font); void synchronizeLayout(); }; struct pTextEdit : public pWidget { TextEdit& textEdit; GtkWidget* subWidget; GtkTextBuffer* textBuffer; bool focused(); void setCursorPosition(unsigned position); void setEditable(bool editable); void setText(string text); void setWordWrap(bool wordWrap); string text(); pTextEdit(TextEdit& textEdit) : pWidget(textEdit), textEdit(textEdit) {} void constructor(); void destructor(); void orphan(); }; struct pVerticalScroller : public pWidget { VerticalScroller& verticalScroller; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pVerticalScroller(VerticalScroller& verticalScroller) : pWidget(verticalScroller), verticalScroller(verticalScroller) {} void constructor(); void destructor(); void orphan(); }; struct pVerticalSlider : public pWidget { VerticalSlider& verticalSlider; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pVerticalSlider(VerticalSlider& verticalSlider) : pWidget(verticalSlider), verticalSlider(verticalSlider) {} void constructor(); void destructor(); void orphan(); }; struct pViewport : public pWidget { Viewport& viewport; uintptr_t handle(); void setDroppable(bool droppable); pViewport(Viewport& viewport) : pWidget(viewport), viewport(viewport) {} void constructor(); void destructor(); void orphan(); }; } phoenix/reference/action/item.cpp000664 001750 001750 00000000250 12651764221 020234 0ustar00sergiosergio000000 000000 namespace phoenix { void pItem::setImage(const image& image) { } void pItem::setText(string text) { } void pItem::constructor() { } void pItem::destructor() { } } phoenix/windows/widget/console.cpp000664 001750 001750 00000002065 12651764221 020510 0ustar00sergiosergio000000 000000 namespace phoenix { static LRESULT CALLBACK Console_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { Console& console = *(Console*)GetWindowLongPtr(hwnd, GWLP_USERDATA); if(msg == WM_CHAR) { if(console.p.keyPress(wparam)) return 0; } return console.p.windowProc(hwnd, msg, wparam, lparam); } void pConsole::print(string text) { } void pConsole::reset() { } void pConsole::constructor() { hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, L"EDIT", L"", WS_CHILD | WS_TABSTOP | ES_READONLY | ES_MULTILINE | ES_WANTRETURN, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&console); setDefaultFont(); windowProc = (LRESULT CALLBACK (*)(HWND, UINT, LPARAM, WPARAM))GetWindowLongPtr(hwnd, GWLP_WNDPROC); SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)Console_windowProc); synchronize(); } void pConsole::destructor() { DestroyWindow(hwnd); } void pConsole::orphan() { destructor(); constructor(); } bool pConsole::keyPress(unsigned scancode) { return false; } } target-ethos/general/presentation.hpp000664 001750 001750 00000002655 12651764221 021167 0ustar00sergiosergio000000 000000 struct Presentation : Window { FixedLayout layout; Viewport viewport; struct Emulator { ::Emulator::Interface* interface; Menu menu; Item power; Item reset; Item unload; Separator controllerSeparator; struct Port { Menu menu; nall::group group; vector device; }; vector port; function callback; }; vector emulatorList; Emulator* active = nullptr; Menu loadMenu; vector loadBootableMedia; Menu settingsMenu; Menu videoMenu; RadioItem centerVideo; RadioItem scaleVideo; RadioItem stretchVideo; CheckItem aspectCorrection; CheckItem maskOverscan; Menu shaderMenu; RadioItem shaderNone; RadioItem shaderBlur; RadioItem shaderEmulation; vector shaderList; CheckItem synchronizeVideo; CheckItem synchronizeAudio; CheckItem muteAudio; Item configurationSettings; Menu toolsMenu; Menu saveStateMenu; Item saveStateItem[5]; Menu loadStateMenu; Item loadStateItem[5]; Separator stateMenuSeparator; Item resizeWindow; Item stateManager; Item cheatEditor; Item synchronizeTime; void synchronize(); void setSystemName(string name); void loadShaders(); void bootstrap(); Presentation(); //internal: string systemName; }; extern Presentation* presentation; phoenix/windows/widget/list-view.cpp000664 001750 001750 00000020312 12651764221 020764 0ustar00sergiosergio000000 000000 namespace phoenix { unsigned ListView_GetColumnCount(HWND hwnd) { unsigned count = 0; LVCOLUMN column; column.mask = LVCF_WIDTH; while(ListView_GetColumn(hwnd, count++, &column)); return --count; } void ListView_SetImage(HWND hwnd, HIMAGELIST imageList, unsigned row, unsigned column, unsigned imageID) { //if this is the first image assigned, set image list now //do not set sooner, or image blocks will appear in a list with no images if(ListView_GetImageList(hwnd, LVSIL_SMALL) != imageList) { ListView_SetImageList(hwnd, imageList, LVSIL_SMALL); } LVITEM item; item.mask = LVIF_IMAGE; item.iItem = row; item.iSubItem = column; item.iImage = imageID; ListView_SetItem(hwnd, &item); } void pListView::append(const lstring& list) { wchar_t empty[] = L""; unsigned row = ListView_GetItemCount(hwnd); LVITEM item; item.mask = LVIF_TEXT; item.iItem = row; item.iSubItem = 0; item.pszText = empty; locked = true; ListView_InsertItem(hwnd, &item); locked = false; for(unsigned column = 0; column < list.size(); column++) { utf16_t wtext(list(column, "")); ListView_SetItemText(hwnd, row, column, wtext); } } void pListView::autoSizeColumns() { unsigned columns = ListView_GetColumnCount(hwnd); for(unsigned n = 0; n < columns; n++) { ListView_SetColumnWidth(hwnd, n, LVSCW_AUTOSIZE_USEHEADER); } } void pListView::remove(unsigned selection) { ListView_DeleteItem(hwnd, selection); } void pListView::reset() { ListView_DeleteAllItems(hwnd); buildImageList(); //free previously allocated images } void pListView::setCheckable(bool checkable) { ListView_SetExtendedListViewStyle(hwnd, LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES | (checkable ? LVS_EX_CHECKBOXES : 0)); } void pListView::setChecked(unsigned selection, bool checked) { locked = true; ListView_SetCheckState(hwnd, selection, checked); locked = false; } void pListView::setGeometry(Geometry geometry) { pWidget::setGeometry(geometry); autoSizeColumns(); } void pListView::setHeaderText(const lstring& list) { while(ListView_DeleteColumn(hwnd, 0)); lstring headers = list; if(headers.size() == 0) headers.append(""); //must have at least one column for(unsigned n = 0; n < headers.size(); n++) { LVCOLUMN column; column.mask = LVCF_FMT | LVCF_TEXT | LVCF_SUBITEM; column.fmt = LVCFMT_LEFT; column.iSubItem = n; utf16_t headerText(headers[n]); column.pszText = headerText; ListView_InsertColumn(hwnd, n, &column); } autoSizeColumns(); } void pListView::setHeaderVisible(bool visible) { SetWindowLong( hwnd, GWL_STYLE, (GetWindowLong(hwnd, GWL_STYLE) & ~LVS_NOCOLUMNHEADER) | (visible ? 0 : LVS_NOCOLUMNHEADER) ); } void pListView::setImage(unsigned selection, unsigned position, const image& image) { //assign existing image for(unsigned n = 0; n < images.size(); n++) { if(images[n] == image) { imageMap(selection)(position) = n; return ListView_SetImage(hwnd, imageList, selection, position, n); } } //append and assign new image imageMap(selection)(position) = images.size(); images.append(image); ImageList_Append(imageList, image, 15); ListView_SetImage(hwnd, imageList, selection, position, imageMap(selection)(position)); } void pListView::setSelected(bool selected) { locked = true; lostFocus = false; if(selected == false) { ListView_SetItemState(hwnd, -1, 0, LVIS_FOCUSED | LVIS_SELECTED); } else { setSelection(listView.state.selection); } locked = false; } void pListView::setSelection(unsigned selection) { locked = true; lostFocus = false; ListView_SetItemState(hwnd, selection, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED); locked = false; } void pListView::setText(unsigned selection, unsigned position, string text) { utf16_t wtext(text); ListView_SetItemText(hwnd, selection, position, wtext); } void pListView::constructor() { lostFocus = false; hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, WC_LISTVIEW, L"", WS_CHILD | WS_TABSTOP | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | LVS_NOCOLUMNHEADER, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&listView); setDefaultFont(); setHeaderText(listView.state.headerText); setHeaderVisible(listView.state.headerVisible); setCheckable(listView.state.checkable); for(auto& text : listView.state.text) append(text); for(unsigned n = 0; n < listView.state.checked.size(); n++) setChecked(n, listView.state.checked[n]); buildImageList(); if(listView.state.selected) setSelection(listView.state.selection); autoSizeColumns(); synchronize(); } void pListView::destructor() { DestroyWindow(hwnd); } void pListView::orphan() { destructor(); constructor(); } void pListView::buildImageList() { auto& list = listView.state.image; unsigned columns = listView.state.text.size(); unsigned rows = max(1u, listView.state.headerText.size()); ListView_SetImageList(hwnd, NULL, LVSIL_SMALL); if(imageList) ImageList_Destroy(imageList); imageList = ImageList_Create(15, 15, ILC_COLOR32, 1, 0); imageMap.reset(); images.reset(); images.append(nall::image()); //empty icon for cells without an image assigned (I_IMAGENONE does not work) //create a vector of unique images from all images used (many cells may use the same image) for(unsigned y = 0; y < list.size(); y++) { for(unsigned x = 0; x < list[y].size(); x++) { bool found = false; for(unsigned z = 0; z < images.size(); z++) { if(list[y][x] == images[z]) { found = true; imageMap(y)(x) = z; break; } } if(found == false) { imageMap(y)(x) = images.size(); images.append(list[y][x]); } } } //build image list for(auto& imageItem : images) ImageList_Append(imageList, imageItem, 15); if(images.size() <= 1) return; //set images for all cells for(unsigned y = 0; y < columns; y++) { for(unsigned x = 0; x < rows; x++) { ListView_SetImage(hwnd, imageList, y, x, imageMap(y)(x)); } } } void pListView::onActivate(LPARAM lparam) { LPNMLISTVIEW nmlistview = (LPNMLISTVIEW)lparam; if(listView.state.text.empty() || !listView.state.selected) return; //LVN_ITEMACTIVATE is not re-entrant until DispatchMessage() completes //if(listView.onActivate) listView.onActivate(); PostMessage(parentHwnd, WM_APP + AppMessage::ListView_onActivate, 0, (LPARAM)&listView); } void pListView::onChange(LPARAM lparam) { LPNMLISTVIEW nmlistview = (LPNMLISTVIEW)lparam; if(!(nmlistview->uChanged & LVIF_STATE)) return; unsigned selection = nmlistview->iItem; unsigned imagemask = ((nmlistview->uNewState & LVIS_STATEIMAGEMASK) >> 12) - 1; if(imagemask == 0 || imagemask == 1) { if(!locked) { listView.state.checked[selection] = !listView.state.checked[selection]; if(listView.onToggle) listView.onToggle(selection); } } else if((nmlistview->uOldState & LVIS_FOCUSED) && !(nmlistview->uNewState & LVIS_FOCUSED)) { lostFocus = true; listView.state.selected = false; listView.state.selection = 0; } else if(!(nmlistview->uOldState & LVIS_SELECTED) && (nmlistview->uNewState & LVIS_SELECTED)) { lostFocus = false; listView.state.selected = true; listView.state.selection = selection; if(!locked && listView.onChange) listView.onChange(); } else if(!lostFocus && !listView.state.selected) { lostFocus = false; listView.state.selected = false; listView.state.selection = 0; if(!locked && listView.onChange) listView.onChange(); } else if(listView.selected() && ListView_GetSelectedCount(hwnd) == 0) { listView.state.selected = false; listView.state.selection = 0; if(!locked && listView.onChange) listView.onChange(); } } LRESULT pListView::onCustomDraw(LPARAM lparam) { LPNMLVCUSTOMDRAW lvcd = (LPNMLVCUSTOMDRAW)lparam; switch(lvcd->nmcd.dwDrawStage) { case CDDS_PREPAINT: return CDRF_NOTIFYITEMDRAW; case CDDS_ITEMPREPAINT: if(listView.state.headerText.size() >= 2) { //draw alternating row colors of there are two or more columns if(lvcd->nmcd.dwItemSpec % 2) lvcd->clrTextBk = GetSysColor(COLOR_WINDOW) ^ 0x070707; } return CDRF_DODEFAULT; default: return CDRF_DODEFAULT; } } } nall/string/base.hpp000664 001750 001750 00000016001 12651764221 015565 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { struct string; struct stringref; struct lstring; typedef const stringref& rstring; //#define NALL_STRING_ALLOCATOR_COPY_ON_WRITE #define NALL_STRING_ALLOCATOR_SMALL_STRING_OPTIMIZATION //#define NALL_STRING_ALLOCATOR_VECTOR struct string { protected: #if defined(NALL_STRING_ALLOCATOR_COPY_ON_WRITE) inline void _copy(); std::shared_ptr _data; #endif #if defined(NALL_STRING_ALLOCATOR_SMALL_STRING_OPTIMIZATION) enum : unsigned { SSO = 24 }; union { char* _data; char _text[SSO]; }; #endif #if defined(NALL_STRING_ALLOCATOR_VECTOR) char* _data; #endif unsigned _capacity; unsigned _size; public: //core.hpp inline char* data(); inline const char* data() const; inline unsigned length() const; inline unsigned size() const; inline unsigned capacity() const; inline bool empty() const; inline void reset(); inline void reserve(unsigned); inline void resize(unsigned); inline void clear(char); inline unsigned hash() const; template inline string& assign(Args&&... args); template inline string& append(Args&&... args); //file.hpp inline static string read(const string& filename); //datetime.hpp inline static string date(); inline static string time(); inline static string datetime(); //replace.hpp template inline string& replace(rstring, rstring); template inline string& ireplace(rstring, rstring); template inline string& qreplace(rstring, rstring); template inline string& iqreplace(rstring, rstring); //wrapper.hpp template inline lstring split(rstring) const; template inline lstring isplit(rstring) const; template inline lstring qsplit(rstring) const; template inline lstring iqsplit(rstring) const; inline signed compare(rstring) const; inline signed icompare(rstring) const; inline bool equals(rstring) const; inline bool iequals(rstring) const; inline bool match(rstring) const; inline bool imatch(rstring) const; inline bool beginsWith(rstring) const; inline bool ibeginsWith(rstring) const; inline bool endsWith(rstring) const; inline bool iendsWith(rstring) const; inline string slice(unsigned offset, unsigned length = ~0u) const; inline string& lower(); inline string& upper(); inline string& qlower(); inline string& qupper(); inline string& transform(rstring before, rstring after); inline string& reverse(); template inline string& ltrim() { return ltrim(" "); } template inline string& ltrim(rstring key); template inline string& rtrim() { return rtrim(" "); } template inline string& rtrim(rstring key); template inline string& trim() { return trim(" "); } template inline string& trim(rstring key); template inline string& trim(rstring key, rstring rkey); inline string& strip(); inline optional find(rstring key) const; inline optional ifind(rstring key) const; inline optional qfind(rstring key) const; inline optional iqfind(rstring key) const; //core.hpp inline explicit operator bool() const; inline operator const char*() const; inline char& operator[](signed); inline const char& operator[](signed) const; inline bool operator==(const char*) const; inline bool operator!=(const char*) const; inline bool operator< (const char*) const; inline bool operator<=(const char*) const; inline bool operator> (const char*) const; inline bool operator>=(const char*) const; inline string& operator=(const string&); inline string& operator=(string&&); template inline string(T&& source, Args&&... args); inline string(); inline string(const string&); inline string(string&&); inline ~string(); inline char* begin() { return &data()[0]; } inline char* end() { return &data()[size()]; } inline const char* begin() const { return &data()[0]; } inline const char* end() const { return &data()[size()]; } //protected: struct exception_out_of_bounds{}; template inline string& ureplace(rstring, rstring); inline string& _append(const char*); private: inline void construct(); #if defined(QSTRING_H) public: inline operator QString() const; #endif }; //list.hpp struct lstring : vector { inline optional find(rstring) const; inline string merge(const string&) const; inline lstring& isort(); inline lstring& strip(); inline void append() {} template inline void append(const string&, Args&&...); inline bool operator==(const lstring&) const; inline bool operator!=(const lstring&) const; inline lstring& operator=(const lstring&); inline lstring& operator=(lstring&); inline lstring& operator=(lstring&&); template inline lstring(Args&&... args); inline lstring(const lstring&); inline lstring(lstring&); inline lstring(lstring&&); //split.hpp template inline lstring& split(rstring, rstring); template inline lstring& isplit(rstring, rstring); template inline lstring& qsplit(rstring, rstring); template inline lstring& iqsplit(rstring, rstring); protected: template inline lstring& usplit(rstring, rstring); }; //filename.hpp inline string dir(string name); inline string notdir(string name); inline string parentdir(string name); inline string basename(string name); inline string extension(string name); inline string tempname(); //format.hpp template inline string format(const string& value); template inline string hex(uintmax_t value); template inline string octal(uintmax_t value); template inline string binary(uintmax_t value); //platform.hpp inline string activepath(); inline string realpath(const string& name); inline string userpath(); inline string configpath(); inline string sharedpath(); inline string temppath(); //utility.hpp inline string substr(rstring source, unsigned offset = 0, unsigned length = ~0u); inline string sha256(const uint8_t* data, unsigned size); inline bool tokenize(lstring& list, const char* s, const char* p); inline char* integer(char* result, intmax_t value); inline char* decimal(char* result, uintmax_t value); inline unsigned real(char* str, long double value); inline string real(long double value); //variadic.hpp inline void sprint(string& output); template inline void sprint(string& output, const T& value, Args&&... args); template inline void print(Args&&... args); } #endif nall/image/core.hpp000664 001750 001750 00000007323 12651764221 015366 0ustar00sergiosergio000000 000000 #ifndef NALL_IMAGE_CORE_HPP #define NALL_IMAGE_CORE_HPP namespace nall { bool image::operator==(const image& source) { if(width != source.width) return false; if(height != source.height) return false; if(pitch != source.pitch) return false; if(endian != source.endian) return false; if(stride != source.stride) return false; if(alpha != source.alpha) return false; if(red != source.red) return false; if(green != source.green) return false; if(blue != source.blue) return false; return memcmp(data, source.data, width * height * stride) == 0; } bool image::operator!=(const image& source) { return !operator==(source); } image& image::operator=(const image& source) { free(); width = source.width; height = source.height; pitch = source.pitch; size = source.size; endian = source.endian; stride = source.stride; alpha = source.alpha; red = source.red; green = source.green; blue = source.blue; data = allocate(width, height, stride); memcpy(data, source.data, source.size); return *this; } image& image::operator=(image&& source) { free(); width = source.width; height = source.height; pitch = source.pitch; size = source.size; endian = source.endian; stride = source.stride; alpha = source.alpha; red = source.red; green = source.green; blue = source.blue; data = source.data; source.data = nullptr; return *this; } image::image(const image& source) { operator=(source); } image::image(image&& source) { operator=(std::forward(source)); } image::image(bool endian, unsigned depth, uint64_t alphaMask, uint64_t redMask, uint64_t greenMask, uint64_t blueMask) { this->endian = endian; this->depth = depth; this->stride = (depth / 8) + ((depth & 7) > 0); alpha = {alphaMask, bitDepth(alphaMask), bitShift(alphaMask)}; red = {redMask, bitDepth(redMask), bitShift(redMask )}; green = {greenMask, bitDepth(greenMask), bitShift(greenMask)}; blue = {blueMask, bitDepth(blueMask), bitShift(blueMask )}; } image::image(const string& filename) { load(filename); } image::image(const uint8_t* data, unsigned size) { loadPNG(data, size); } image::image() { } image::~image() { free(); } uint64_t image::read(const uint8_t* data) const { uint64_t result = 0; if(endian == 0) { for(signed n = stride - 1; n >= 0; n--) result = (result << 8) | data[n]; } else { for(signed n = 0; n < stride; n++) result = (result << 8) | data[n]; } return result; } void image::write(uint8_t* data, uint64_t value) const { if(endian == 0) { for(signed n = 0; n < stride; n++) { data[n] = value; value >>= 8; } } else { for(signed n = stride - 1; n >= 0; n--) { data[n] = value; value >>= 8; } } } void image::free() { if(data) delete[] data; data = nullptr; } bool image::empty() const { if(data == nullptr) return true; if(width == 0 || height == 0) return true; return false; } bool image::load(const string& filename) { if(loadBMP(filename) == true) return true; if(loadPNG(filename) == true) return true; return false; } void image::allocate(unsigned width, unsigned height) { if(data != nullptr && this->width == width && this->height == height) return; free(); data = allocate(width, height, stride); pitch = width * stride; size = height * pitch; this->width = width; this->height = height; } uint8_t* image::allocate(unsigned width, unsigned height, unsigned stride) { //allocate 1x1 larger than requested; so that linear interpolation does not require bounds-checking unsigned size = width * height * stride; unsigned padding = width * stride + stride; uint8_t* data = new uint8_t[size + padding]; memset(data + size, 0x00, padding); return data; } } #endif sfc/chip/sa1/serialization.cpp000664 001750 001750 00000004766 12651764221 017470 0ustar00sergiosergio000000 000000 #ifdef SA1_CPP void SA1::serialize(serializer& s) { R65816::serialize(s); Thread::serialize(s); s.array(iram.data(), iram.size()); s.array(bwram.data(), bwram.size()); //sa1.hpp s.integer(status.tick_counter); s.integer(status.interrupt_pending); s.integer(status.scanlines); s.integer(status.vcounter); s.integer(status.hcounter); //bus/bus.hpp s.array(iram.data(), iram.size()); s.integer(cpubwram.dma); //dma/dma.hpp s.integer(dma.line); //mmio/mmio.hpp s.integer(mmio.sa1_irq); s.integer(mmio.sa1_rdyb); s.integer(mmio.sa1_resb); s.integer(mmio.sa1_nmi); s.integer(mmio.smeg); s.integer(mmio.cpu_irqen); s.integer(mmio.chdma_irqen); s.integer(mmio.cpu_irqcl); s.integer(mmio.chdma_irqcl); s.integer(mmio.crv); s.integer(mmio.cnv); s.integer(mmio.civ); s.integer(mmio.cpu_irq); s.integer(mmio.cpu_ivsw); s.integer(mmio.cpu_nvsw); s.integer(mmio.cmeg); s.integer(mmio.sa1_irqen); s.integer(mmio.timer_irqen); s.integer(mmio.dma_irqen); s.integer(mmio.sa1_nmien); s.integer(mmio.sa1_irqcl); s.integer(mmio.timer_irqcl); s.integer(mmio.dma_irqcl); s.integer(mmio.sa1_nmicl); s.integer(mmio.snv); s.integer(mmio.siv); s.integer(mmio.hvselb); s.integer(mmio.ven); s.integer(mmio.hen); s.integer(mmio.hcnt); s.integer(mmio.vcnt); s.integer(mmio.cbmode); s.integer(mmio.cb); s.integer(mmio.dbmode); s.integer(mmio.db); s.integer(mmio.ebmode); s.integer(mmio.eb); s.integer(mmio.fbmode); s.integer(mmio.fb); s.integer(mmio.sbm); s.integer(mmio.sw46); s.integer(mmio.cbm); s.integer(mmio.swen); s.integer(mmio.cwen); s.integer(mmio.bwp); s.integer(mmio.siwp); s.integer(mmio.ciwp); s.integer(mmio.dmaen); s.integer(mmio.dprio); s.integer(mmio.cden); s.integer(mmio.cdsel); s.integer(mmio.dd); s.integer(mmio.sd); s.integer(mmio.chdend); s.integer(mmio.dmasize); s.integer(mmio.dmacb); s.integer(mmio.dsa); s.integer(mmio.dda); s.integer(mmio.dtc); s.integer(mmio.bbf); s.array(mmio.brf); s.integer(mmio.acm); s.integer(mmio.md); s.integer(mmio.ma); s.integer(mmio.mb); s.integer(mmio.hl); s.integer(mmio.vb); s.integer(mmio.va); s.integer(mmio.vbit); s.integer(mmio.cpu_irqfl); s.integer(mmio.chdma_irqfl); s.integer(mmio.sa1_irqfl); s.integer(mmio.timer_irqfl); s.integer(mmio.dma_irqfl); s.integer(mmio.sa1_nmifl); s.integer(mmio.hcr); s.integer(mmio.vcr); s.integer(mmio.mr); s.integer(mmio.overflow); } #endif sfc/alt/ppu-balanced/memory/000700 001750 001750 00000000000 12656700342 017071 5ustar00sergiosergio000000 000000 ruby/audio/pulseaudio.cpp000664 001750 001750 00000011241 12651764221 016647 0ustar00sergiosergio000000 000000 //audio.pulseaudio (2010-01-05) //author: RedDwarf #include namespace ruby { class pAudioPulseAudio { public: struct { pa_mainloop* mainloop; pa_context* context; pa_stream* stream; pa_sample_spec spec; pa_buffer_attr buffer_attr; bool first; } device; struct { uint32_t* data; size_t size; unsigned offset; } buffer; struct { bool synchronize; unsigned frequency; unsigned latency; } settings; bool cap(const string& name) { if(name == Audio::Synchronize) return true; if(name == Audio::Frequency) return true; if(name == Audio::Latency) return true; } any get(const string& name) { if(name == Audio::Synchronize) return settings.synchronize; if(name == Audio::Frequency) return settings.frequency; if(name == Audio::Latency) return settings.latency; } bool set(const string& name, const any& value) { if(name == Audio::Synchronize) { settings.synchronize = any_cast(value); return true; } if(name == Audio::Frequency) { settings.frequency = any_cast(value); if(device.stream) { pa_operation_unref(pa_stream_update_sample_rate(device.stream, settings.frequency, NULL, NULL)); } return true; } if(name == Audio::Latency) { settings.latency = any_cast(value); if(device.stream) { device.buffer_attr.tlength = pa_usec_to_bytes(settings.latency * PA_USEC_PER_MSEC, &device.spec); pa_stream_set_buffer_attr(device.stream, &device.buffer_attr, NULL, NULL); } return true; } } void sample(uint16_t left, uint16_t right) { pa_stream_begin_write(device.stream, (void**)&buffer.data, &buffer.size); buffer.data[buffer.offset++] = left + (right << 16); if((buffer.offset + 1) * pa_frame_size(&device.spec) <= buffer.size) return; while(true) { if(device.first) { device.first = false; pa_mainloop_iterate(device.mainloop, 0, NULL); } else { pa_mainloop_iterate(device.mainloop, 1, NULL); } unsigned length = pa_stream_writable_size(device.stream); if(length >= buffer.offset * pa_frame_size(&device.spec)) break; if(settings.synchronize == false) { buffer.offset = 0; return; } } pa_stream_write(device.stream, (const void*)buffer.data, buffer.offset * pa_frame_size(&device.spec), NULL, 0LL, PA_SEEK_RELATIVE); buffer.data = 0; buffer.offset = 0; } void clear() { } bool init() { device.mainloop = pa_mainloop_new(); device.context = pa_context_new(pa_mainloop_get_api(device.mainloop), "ruby::pulseaudio"); pa_context_connect(device.context, NULL, PA_CONTEXT_NOFLAGS, NULL); pa_context_state_t cstate; do { pa_mainloop_iterate(device.mainloop, 1, NULL); cstate = pa_context_get_state(device.context); if(!PA_CONTEXT_IS_GOOD(cstate)) return false; } while(cstate != PA_CONTEXT_READY); device.spec.format = PA_SAMPLE_S16LE; device.spec.channels = 2; device.spec.rate = settings.frequency; device.stream = pa_stream_new(device.context, "audio", &device.spec, NULL); device.buffer_attr.maxlength = -1; device.buffer_attr.tlength = pa_usec_to_bytes(settings.latency * PA_USEC_PER_MSEC, &device.spec); device.buffer_attr.prebuf = -1; device.buffer_attr.minreq = -1; device.buffer_attr.fragsize = -1; pa_stream_flags_t flags = (pa_stream_flags_t)(PA_STREAM_ADJUST_LATENCY | PA_STREAM_VARIABLE_RATE); pa_stream_connect_playback(device.stream, NULL, &device.buffer_attr, flags, NULL, NULL); pa_stream_state_t sstate; do { pa_mainloop_iterate(device.mainloop, 1, NULL); sstate = pa_stream_get_state(device.stream); if(!PA_STREAM_IS_GOOD(sstate)) return false; } while(sstate != PA_STREAM_READY); buffer.size = 960; buffer.offset = 0; device.first = true; return true; } void term() { if(buffer.data) { pa_stream_cancel_write(device.stream); buffer.data = 0; } if(device.stream) { pa_stream_disconnect(device.stream); pa_stream_unref(device.stream); device.stream = 0; } if(device.context) { pa_context_disconnect(device.context); pa_context_unref(device.context); device.context = 0; } if(device.mainloop) { pa_mainloop_free(device.mainloop); device.mainloop = 0; } } pAudioPulseAudio() { device.mainloop = 0; device.context = 0; device.stream = 0; buffer.data = 0; settings.synchronize = false; settings.frequency = 22050; settings.latency = 60; } ~pAudioPulseAudio() { term(); } }; DeclareAudio(PulseAudio) } target-ethos/tools/cheat-database.hpp000664 001750 001750 00000000624 12651764221 021017 0ustar00sergiosergio000000 000000 struct CheatDatabase : Window { VerticalLayout layout; ListView cheatList; HorizontalLayout controlLayout; Button selectAllButton; Button unselectAllButton; Widget spacer; Button acceptButton; void findCodes(); void addCodes(); CheatDatabase(); private: struct Cheat { string code; string desc; }; vector cheat; }; extern CheatDatabase* cheatDatabase; phoenix/reference/widget/hex-edit.cpp000664 001750 001750 00000000461 12651764221 021017 0ustar00sergiosergio000000 000000 namespace phoenix { void pHexEdit::setColumns(unsigned columns) { } void pHexEdit::setLength(unsigned length) { } void pHexEdit::setOffset(unsigned offset) { } void pHexEdit::setRows(unsigned rows) { } void pHexEdit::update() { } void pHexEdit::constructor() { } void pHexEdit::destructor() { } } phoenix/reference/widget/horizontal-scroller.hpp000664 001750 001750 00000000561 12651764221 023332 0ustar00sergiosergio000000 000000 namespace phoenix { struct pHorizontalScroller : public pWidget { HorizontalScroller& horizontalScroller; void setLength(unsigned length); void setPosition(unsigned position); pHorizontalScroller(HorizontalScroller& horizontalScroller) : pWidget(horizontalScroller), horizontalScroller(horizontalScroller) {} void constructor(); void destructor(); }; } sfc/alt/dsp/blargg_endian.h000664 001750 001750 00000014334 12651764221 016763 0ustar00sergiosergio000000 000000 // CPU Byte Order Utilities // snes_spc 0.9.0 #ifndef BLARGG_ENDIAN #define BLARGG_ENDIAN #include "blargg_common.h" // BLARGG_CPU_CISC: Defined if CPU has very few general-purpose registers (< 16) #if defined (_M_IX86) || defined (_M_IA64) || defined (__i486__) || \ defined (__x86_64__) || defined (__ia64__) || defined (__i386__) #define BLARGG_CPU_X86 1 #define BLARGG_CPU_CISC 1 #endif #if defined (__powerpc__) || defined (__ppc__) || defined (__POWERPC__) || defined (__powerc) #define BLARGG_CPU_POWERPC 1 #define BLARGG_CPU_RISC 1 #endif // BLARGG_BIG_ENDIAN, BLARGG_LITTLE_ENDIAN: Determined automatically, otherwise only // one may be #defined to 1. Only needed if something actually depends on byte order. #if !defined (BLARGG_BIG_ENDIAN) && !defined (BLARGG_LITTLE_ENDIAN) #ifdef __GLIBC__ // GCC handles this for us #include #if __BYTE_ORDER == __LITTLE_ENDIAN #define BLARGG_LITTLE_ENDIAN 1 #elif __BYTE_ORDER == __BIG_ENDIAN #define BLARGG_BIG_ENDIAN 1 #endif #else #if defined (LSB_FIRST) || defined (__LITTLE_ENDIAN__) || BLARGG_CPU_X86 || \ (defined (LITTLE_ENDIAN) && LITTLE_ENDIAN+0 != 1234) #define BLARGG_LITTLE_ENDIAN 1 #endif #if defined (MSB_FIRST) || defined (__BIG_ENDIAN__) || defined (WORDS_BIGENDIAN) || \ defined (__sparc__) || BLARGG_CPU_POWERPC || \ (defined (BIG_ENDIAN) && BIG_ENDIAN+0 != 4321) #define BLARGG_BIG_ENDIAN 1 #elif !defined (__mips__) // No endian specified; assume little-endian, since it's most common #define BLARGG_LITTLE_ENDIAN 1 #endif #endif #endif #if BLARGG_LITTLE_ENDIAN && BLARGG_BIG_ENDIAN #undef BLARGG_LITTLE_ENDIAN #undef BLARGG_BIG_ENDIAN #endif inline void blargg_verify_byte_order() { #ifndef NDEBUG #if BLARGG_BIG_ENDIAN volatile int i = 1; assert( *(volatile char*) &i == 0 ); #elif BLARGG_LITTLE_ENDIAN volatile int i = 1; assert( *(volatile char*) &i != 0 ); #endif #endif } inline unsigned get_le16( void const* p ) { return (unsigned) ((unsigned char const*) p) [1] << 8 | (unsigned) ((unsigned char const*) p) [0]; } inline unsigned get_be16( void const* p ) { return (unsigned) ((unsigned char const*) p) [0] << 8 | (unsigned) ((unsigned char const*) p) [1]; } inline blargg_ulong get_le32( void const* p ) { return (blargg_ulong) ((unsigned char const*) p) [3] << 24 | (blargg_ulong) ((unsigned char const*) p) [2] << 16 | (blargg_ulong) ((unsigned char const*) p) [1] << 8 | (blargg_ulong) ((unsigned char const*) p) [0]; } inline blargg_ulong get_be32( void const* p ) { return (blargg_ulong) ((unsigned char const*) p) [0] << 24 | (blargg_ulong) ((unsigned char const*) p) [1] << 16 | (blargg_ulong) ((unsigned char const*) p) [2] << 8 | (blargg_ulong) ((unsigned char const*) p) [3]; } inline void set_le16( void* p, unsigned n ) { ((unsigned char*) p) [1] = (unsigned char) (n >> 8); ((unsigned char*) p) [0] = (unsigned char) n; } inline void set_be16( void* p, unsigned n ) { ((unsigned char*) p) [0] = (unsigned char) (n >> 8); ((unsigned char*) p) [1] = (unsigned char) n; } inline void set_le32( void* p, blargg_ulong n ) { ((unsigned char*) p) [0] = (unsigned char) n; ((unsigned char*) p) [1] = (unsigned char) (n >> 8); ((unsigned char*) p) [2] = (unsigned char) (n >> 16); ((unsigned char*) p) [3] = (unsigned char) (n >> 24); } inline void set_be32( void* p, blargg_ulong n ) { ((unsigned char*) p) [3] = (unsigned char) n; ((unsigned char*) p) [2] = (unsigned char) (n >> 8); ((unsigned char*) p) [1] = (unsigned char) (n >> 16); ((unsigned char*) p) [0] = (unsigned char) (n >> 24); } #if BLARGG_NONPORTABLE // Optimized implementation if byte order is known #if BLARGG_LITTLE_ENDIAN #define GET_LE16( addr ) (*(BOOST::uint16_t*) (addr)) #define GET_LE32( addr ) (*(BOOST::uint32_t*) (addr)) #define SET_LE16( addr, data ) (void) (*(BOOST::uint16_t*) (addr) = (data)) #define SET_LE32( addr, data ) (void) (*(BOOST::uint32_t*) (addr) = (data)) #elif BLARGG_BIG_ENDIAN #define GET_BE16( addr ) (*(BOOST::uint16_t*) (addr)) #define GET_BE32( addr ) (*(BOOST::uint32_t*) (addr)) #define SET_BE16( addr, data ) (void) (*(BOOST::uint16_t*) (addr) = (data)) #define SET_BE32( addr, data ) (void) (*(BOOST::uint32_t*) (addr) = (data)) #if BLARGG_CPU_POWERPC // PowerPC has special byte-reversed instructions #if defined (__MWERKS__) #define GET_LE16( addr ) (__lhbrx( addr, 0 )) #define GET_LE32( addr ) (__lwbrx( addr, 0 )) #define SET_LE16( addr, in ) (__sthbrx( in, addr, 0 )) #define SET_LE32( addr, in ) (__stwbrx( in, addr, 0 )) #elif defined (__GNUC__) #define GET_LE16( addr ) ({unsigned ppc_lhbrx_; asm( "lhbrx %0,0,%1" : "=r" (ppc_lhbrx_) : "r" (addr), "0" (ppc_lhbrx_) ); ppc_lhbrx_;}) #define GET_LE32( addr ) ({unsigned ppc_lwbrx_; asm( "lwbrx %0,0,%1" : "=r" (ppc_lwbrx_) : "r" (addr), "0" (ppc_lwbrx_) ); ppc_lwbrx_;}) #define SET_LE16( addr, in ) ({asm( "sthbrx %0,0,%1" : : "r" (in), "r" (addr) );}) #define SET_LE32( addr, in ) ({asm( "stwbrx %0,0,%1" : : "r" (in), "r" (addr) );}) #endif #endif #endif #endif #ifndef GET_LE16 #define GET_LE16( addr ) get_le16( addr ) #define SET_LE16( addr, data ) set_le16( addr, data ) #endif #ifndef GET_LE32 #define GET_LE32( addr ) get_le32( addr ) #define SET_LE32( addr, data ) set_le32( addr, data ) #endif #ifndef GET_BE16 #define GET_BE16( addr ) get_be16( addr ) #define SET_BE16( addr, data ) set_be16( addr, data ) #endif #ifndef GET_BE32 #define GET_BE32( addr ) get_be32( addr ) #define SET_BE32( addr, data ) set_be32( addr, data ) #endif // auto-selecting versions inline void set_le( BOOST::uint16_t* p, unsigned n ) { SET_LE16( p, n ); } inline void set_le( BOOST::uint32_t* p, blargg_ulong n ) { SET_LE32( p, n ); } inline void set_be( BOOST::uint16_t* p, unsigned n ) { SET_BE16( p, n ); } inline void set_be( BOOST::uint32_t* p, blargg_ulong n ) { SET_BE32( p, n ); } inline unsigned get_le( BOOST::uint16_t* p ) { return GET_LE16( p ); } inline blargg_ulong get_le( BOOST::uint32_t* p ) { return GET_LE32( p ); } inline unsigned get_be( BOOST::uint16_t* p ) { return GET_BE16( p ); } inline blargg_ulong get_be( BOOST::uint32_t* p ) { return GET_BE32( p ); } #endif sfc/cpu/mmio/mmio.hpp000664 001750 001750 00000003470 12651764221 015671 0ustar00sergiosergio000000 000000 public: uint8 mmio_read(unsigned addr); void mmio_write(unsigned addr, uint8 data); privileged: void mmio_power(); void mmio_reset(); uint8 mmio_r2180(); uint8 mmio_r4016(); uint8 mmio_r4017(); uint8 mmio_r4210(); uint8 mmio_r4211(); uint8 mmio_r4212(); uint8 mmio_r4213(); uint8 mmio_r4214(); uint8 mmio_r4215(); uint8 mmio_r4216(); uint8 mmio_r4217(); uint8 mmio_r4218(); uint8 mmio_r4219(); uint8 mmio_r421a(); uint8 mmio_r421b(); uint8 mmio_r421c(); uint8 mmio_r421d(); uint8 mmio_r421e(); uint8 mmio_r421f(); uint8 mmio_r43x0(uint8 i); uint8 mmio_r43x1(uint8 i); uint8 mmio_r43x2(uint8 i); uint8 mmio_r43x3(uint8 i); uint8 mmio_r43x4(uint8 i); uint8 mmio_r43x5(uint8 i); uint8 mmio_r43x6(uint8 i); uint8 mmio_r43x7(uint8 i); uint8 mmio_r43x8(uint8 i); uint8 mmio_r43x9(uint8 i); uint8 mmio_r43xa(uint8 i); uint8 mmio_r43xb(uint8 i); void mmio_w2180(uint8 data); void mmio_w2181(uint8 data); void mmio_w2182(uint8 data); void mmio_w2183(uint8 data); void mmio_w4016(uint8 data); void mmio_w4200(uint8 data); void mmio_w4201(uint8 data); void mmio_w4202(uint8 data); void mmio_w4203(uint8 data); void mmio_w4204(uint8 data); void mmio_w4205(uint8 data); void mmio_w4206(uint8 data); void mmio_w4207(uint8 data); void mmio_w4208(uint8 data); void mmio_w4209(uint8 data); void mmio_w420a(uint8 data); void mmio_w420b(uint8 data); void mmio_w420c(uint8 data); void mmio_w420d(uint8 data); void mmio_w43x0(uint8 i, uint8 data); void mmio_w43x1(uint8 i, uint8 data); void mmio_w43x2(uint8 i, uint8 data); void mmio_w43x3(uint8 i, uint8 data); void mmio_w43x4(uint8 i, uint8 data); void mmio_w43x5(uint8 i, uint8 data); void mmio_w43x6(uint8 i, uint8 data); void mmio_w43x7(uint8 i, uint8 data); void mmio_w43x8(uint8 i, uint8 data); void mmio_w43x9(uint8 i, uint8 data); void mmio_w43xa(uint8 i, uint8 data); void mmio_w43xb(uint8 i, uint8 data); nall/dsp/resample/sinc.hpp000664 001750 001750 00000002321 12651764221 016677 0ustar00sergiosergio000000 000000 #ifdef NALL_DSP_INTERNAL_HPP #include "lib/sinc.hpp" struct ResampleSinc : Resampler { inline void setFrequency(); inline void clear(); inline void sample(); inline ResampleSinc(DSP& dsp); private: inline void remakeSinc(); SincResample* sinc_resampler[8]; }; void ResampleSinc::setFrequency() { remakeSinc(); } void ResampleSinc::clear() { remakeSinc(); } void ResampleSinc::sample() { for(unsigned c = 0; c < dsp.settings.channels; c++) { sinc_resampler[c]->write(dsp.buffer.read(c)); } if(sinc_resampler[0]->output_avail()) { do { for(unsigned c = 0; c < dsp.settings.channels; c++) { dsp.output.write(c) = sinc_resampler[c]->read(); } dsp.output.wroffset++; } while(sinc_resampler[0]->output_avail()); } dsp.buffer.rdoffset++; } ResampleSinc::ResampleSinc(DSP& dsp) : Resampler(dsp) { for(unsigned n = 0; n < 8; n++) sinc_resampler[n] = nullptr; } void ResampleSinc::remakeSinc() { assert(dsp.settings.channels < 8); for(unsigned c = 0; c < dsp.settings.channels; c++) { if(sinc_resampler[c]) delete sinc_resampler[c]; sinc_resampler[c] = new SincResample(dsp.settings.frequency, frequency, 0.85, SincResample::QUALITY_HIGH); } } #endif sfc/chip/dsp4/dsp4.hpp000664 001750 001750 00000000321 12651764221 015637 0ustar00sergiosergio000000 000000 class DSP4 : public Memory { public: void init(); void load(); void unload(); void power(); void reset(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); }; extern DSP4 dsp4; phoenix/reference/widget/list-view.cpp000664 001750 001750 00000001361 12651764221 021233 0ustar00sergiosergio000000 000000 namespace phoenix { void pListView::append(const lstring& text) { } void pListView::autoSizeColumns() { } void pListView::remove(unsigned selection) { } void pListView::reset() { } void pListView::setCheckable(bool checkable) { } void pListView::setChecked(unsigned selection, bool checked) { } void pListView::setHeaderText(const lstring& text) { } void pListView::setHeaderVisible(bool visible) { } void pListView::setImage(unsigned selection, unsigned position, const image& image) { } void pListView::setSelected(bool selected) { } void pListView::setSelection(unsigned selection) { } void pListView::setText(unsigned selection, unsigned position, string text) { } void pListView::constructor() { } void pListView::destructor() { } } phoenix/windows/000700 001750 001750 00000000000 12656700342 015037 5ustar00sergiosergio000000 000000 gb/cartridge/mbc1/mbc1.cpp000664 001750 001750 00000003056 12651764221 016420 0ustar00sergiosergio000000 000000 #ifdef CARTRIDGE_CPP uint8 Cartridge::MBC1::mmio_read(uint16 addr) { if((addr & 0xc000) == 0x0000) { //$0000-3fff return cartridge.rom_read(addr); } if((addr & 0xc000) == 0x4000) { //$4000-7fff if(mode_select == 0) { return cartridge.rom_read((ram_select << 19) | (rom_select << 14) | (addr & 0x3fff)); } else { return cartridge.rom_read((rom_select << 14) | (addr & 0x3fff)); } } if((addr & 0xe000) == 0xa000) { //$a000-bfff if(ram_enable) { if(mode_select == 0) { return cartridge.ram_read(addr & 0x1fff); } else { return cartridge.ram_read((ram_select << 13) | (addr & 0x1fff)); } } return 0x00; } return 0x00; } void Cartridge::MBC1::mmio_write(uint16 addr, uint8 data) { if((addr & 0xe000) == 0x0000) { //$0000-1fff ram_enable = (data & 0x0f) == 0x0a; return; } if((addr & 0xe000) == 0x2000) { //$2000-3fff rom_select = (data & 0x1f) + ((data & 0x1f) == 0); return; } if((addr & 0xe000) == 0x4000) { //$4000-5fff ram_select = data & 0x03; return; } if((addr & 0xe000) == 0x6000) { //$6000-7fff mode_select = data & 0x01; return; } if((addr & 0xe000) == 0xa000) { //$a000-bfff if(ram_enable) { if(mode_select == 0) { cartridge.ram_write(addr & 0x1fff, data); } else { cartridge.ram_write((ram_select << 13) | (addr & 0x1fff), data); } } return; } } void Cartridge::MBC1::power() { ram_enable = false; rom_select = 0x01; ram_select = 0x00; mode_select = 0; } #endif phoenix/reference/action/action.hpp000664 001750 001750 00000000375 12651764221 020570 0ustar00sergiosergio000000 000000 namespace phoenix { struct pAction : public pObject { Action& action; void setEnabled(bool enabled); void setVisible(bool visible); pAction(Action& action) : pObject(action), action(action) {} void constructor(); void destructor(); }; } nall/dsp/resample/000700 001750 001750 00000000000 12656700342 015217 5ustar00sergiosergio000000 000000 gba/memory/mmio.cpp000664 001750 001750 00000001540 12651764221 015416 0ustar00sergiosergio000000 000000 uint32 MMIO::read(uint32 addr, uint32 size) { uint32 word = 0; switch(size) { case Word: addr &= ~3; word |= read(addr + 0) << 0; word |= read(addr + 1) << 8; word |= read(addr + 2) << 16; word |= read(addr + 3) << 24; break; case Half: addr &= ~1; word |= read(addr + 0) << 0; word |= read(addr + 1) << 8; break; case Byte: word |= read(addr + 0) << 0; break; } return word; } void MMIO::write(uint32 addr, uint32 size, uint32 word) { switch(size) { case Word: addr &= ~3; write(addr + 0, word >> 0); write(addr + 1, word >> 8); write(addr + 2, word >> 16); write(addr + 3, word >> 24); break; case Half: addr &= ~1; write(addr + 0, word >> 0); write(addr + 1, word >> 8); break; case Byte: write(addr + 0, word >> 0); break; } } processor/r65816/000700 001750 001750 00000000000 12656700342 014565 5ustar00sergiosergio000000 000000 nall/string/filename.hpp000664 001750 001750 00000003474 12651764221 016445 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { // "/foo/bar.c" -> "/foo/" // "/foo/" -> "/foo/" // "bar.c" -> "./" string dir(string name) { for(signed i = name.length(); i >= 0; i--) { if(name[i] == '/' || name[i] == '\\') { name.resize(i + 1); break; } if(i == 0) name = "./"; } return name; } // "/foo/bar.c" -> "bar.c" // "/foo/" -> "" // "bar.c" -> "bar.c" string notdir(string name) { for(signed i = name.length(); i >= 0; i--) { if(name[i] == '/' || name[i] == '\\') { return (const char*)name + i + 1; } } return name; } // "/foo/bar/baz" -> "/foo/bar/" // "/foo/bar/" -> "/foo/" // "/foo/bar" -> "/foo/" string parentdir(string name) { unsigned length = name.length(), paths = 0, prev, last; for(unsigned i = 0; i < length; i++) { if(name[i] == '/' || name[i] == '\\') { paths++; prev = last; last = i; } } if(last + 1 == length) last = prev; //if name ends in slash; use previous slash if(paths > 1) name.resize(last + 1); return name; } // "/foo/bar.c" -> "/foo/bar" string basename(string name) { for(signed i = name.length(); i >= 0; i--) { if(name[i] == '/' || name[i] == '\\') break; //file has no extension if(name[i] == '.') { name.resize(i); break; } } return name; } // "/foo/bar.c" -> "c" // "/foo/bar" -> "" string extension(string name) { for(signed i = name.length(); i >= 0; i--) { if(name[i] == '/' || name[i] == '\\') return ""; //file has no extension if(name[i] == '.') { return (const char*)name + i + 1; } } return name; } string tempname() { string path = temppath(); srand(time(nullptr)); while(true) { uint32_t seed = rand(); string filename = {path, ".temporary-", hex<8>(seed)}; if(access(filename, F_OK) != 0) return filename; } } } #endif sfc/ppu/window/000700 001750 001750 00000000000 12656700342 014561 5ustar00sergiosergio000000 000000 fc/cartridge/board/board.hpp000664 001750 001750 00000002045 12651764221 017134 0ustar00sergiosergio000000 000000 struct Board { struct Memory { uint8_t* data; unsigned size; bool writable; inline uint8 read(unsigned addr) const; inline void write(unsigned addr, uint8 data); inline Memory(uint8_t* data, unsigned size) : data(data), size(size) {} inline Memory() : data(nullptr), size(0u), writable(false) {} inline ~Memory() { if(data) delete[] data; } }; static unsigned mirror(unsigned addr, unsigned size); virtual void main(); virtual void tick(); virtual uint8 prg_read(unsigned addr) = 0; virtual void prg_write(unsigned addr, uint8 data) = 0; virtual uint8 chr_read(unsigned addr); virtual void chr_write(unsigned addr, uint8 data); virtual inline void scanline(unsigned y) {} virtual void power(); virtual void reset(); virtual void serialize(serializer&); Board(Markup::Node& document); virtual ~Board(); static Board* load(string manifest); struct Information { string type; bool battery; } information; Memory prgrom; Memory prgram; Memory chrrom; Memory chrram; }; profile/Famicom.sys/000700 001750 001750 00000000000 12656700342 015523 5ustar00sergiosergio000000 000000 target-ethos/general/dip-switches.hpp000664 001750 001750 00000000622 12651764221 021047 0ustar00sergiosergio000000 000000 struct DipSwitch : HorizontalLayout { Label name; ComboButton value; vector values; DipSwitch(); }; struct DipSwitches : Window { enum : unsigned { Slots = 8 }; VerticalLayout layout; DipSwitch dip[Slots]; HorizontalLayout controlLayout; Widget spacer; Button accept; unsigned run(const Markup::Node& node); DipSwitches(); }; extern DipSwitches* dipSwitches; phoenix/reference/widget/vertical-slider.cpp000664 001750 001750 00000000330 12651764221 022374 0ustar00sergiosergio000000 000000 namespace phoenix { void pVerticalSlider::setLength(unsigned length) { } void pVerticalSlider::setPosition(unsigned position) { } void pVerticalSlider::constructor() { } void pVerticalSlider::destructor() { } } shaders/000700 001750 001750 00000000000 12656700342 013324 5ustar00sergiosergio000000 000000 sfc/chip/superfx/core/core.cpp000664 001750 001750 00000006424 12651764221 017474 0ustar00sergiosergio000000 000000 #ifdef SUPERFX_CPP void SuperFX::stop() { cpu.regs.irq = 1; } uint8 SuperFX::color(uint8 source) { if(regs.por.highnibble) return (regs.colr & 0xf0) | (source >> 4); if(regs.por.freezehigh) return (regs.colr & 0xf0) | (source & 0x0f); return source; } void SuperFX::plot(uint8 x, uint8 y) { uint8 color = regs.colr; if(regs.por.dither && regs.scmr.md != 3) { if((x ^ y) & 1) color >>= 4; color &= 0x0f; } if(!regs.por.transparent) { if(regs.scmr.md == 3) { if(regs.por.freezehigh) { if((color & 0x0f) == 0) return; } else { if(color == 0) return; } } else { if((color & 0x0f) == 0) return; } } uint16 offset = (y << 5) + (x >> 3); if(offset != pixelcache[0].offset) { pixelcache_flush(pixelcache[1]); pixelcache[1] = pixelcache[0]; pixelcache[0].bitpend = 0x00; pixelcache[0].offset = offset; } x = (x & 7) ^ 7; pixelcache[0].data[x] = color; pixelcache[0].bitpend |= 1 << x; if(pixelcache[0].bitpend == 0xff) { pixelcache_flush(pixelcache[1]); pixelcache[1] = pixelcache[0]; pixelcache[0].bitpend = 0x00; } } uint8 SuperFX::rpix(uint8 x, uint8 y) { pixelcache_flush(pixelcache[1]); pixelcache_flush(pixelcache[0]); unsigned cn; //character number switch(regs.por.obj ? 3 : regs.scmr.ht) { case 0: cn = ((x & 0xf8) << 1) + ((y & 0xf8) >> 3); break; case 1: cn = ((x & 0xf8) << 1) + ((x & 0xf8) >> 1) + ((y & 0xf8) >> 3); break; case 2: cn = ((x & 0xf8) << 1) + ((x & 0xf8) << 0) + ((y & 0xf8) >> 3); break; case 3: cn = ((y & 0x80) << 2) + ((x & 0x80) << 1) + ((y & 0x78) << 1) + ((x & 0x78) >> 3); break; } unsigned bpp = 2 << (regs.scmr.md - (regs.scmr.md >> 1)); // = [regs.scmr.md]{ 2, 4, 4, 8 }; unsigned addr = 0x700000 + (cn * (bpp << 3)) + (regs.scbr << 10) + ((y & 0x07) * 2); uint8 data = 0x00; x = (x & 7) ^ 7; for(unsigned n = 0; n < bpp; n++) { unsigned byte = ((n >> 1) << 4) + (n & 1); // = [n]{ 0, 1, 16, 17, 32, 33, 48, 49 }; step(memory_access_speed); data |= ((bus_read(addr + byte) >> x) & 1) << n; } return data; } void SuperFX::pixelcache_flush(pixelcache_t& cache) { if(cache.bitpend == 0x00) return; uint8 x = cache.offset << 3; uint8 y = cache.offset >> 5; unsigned cn; //character number switch(regs.por.obj ? 3 : regs.scmr.ht) { case 0: cn = ((x & 0xf8) << 1) + ((y & 0xf8) >> 3); break; case 1: cn = ((x & 0xf8) << 1) + ((x & 0xf8) >> 1) + ((y & 0xf8) >> 3); break; case 2: cn = ((x & 0xf8) << 1) + ((x & 0xf8) << 0) + ((y & 0xf8) >> 3); break; case 3: cn = ((y & 0x80) << 2) + ((x & 0x80) << 1) + ((y & 0x78) << 1) + ((x & 0x78) >> 3); break; } unsigned bpp = 2 << (regs.scmr.md - (regs.scmr.md >> 1)); // = [regs.scmr.md]{ 2, 4, 4, 8 }; unsigned addr = 0x700000 + (cn * (bpp << 3)) + (regs.scbr << 10) + ((y & 0x07) * 2); for(unsigned n = 0; n < bpp; n++) { unsigned byte = ((n >> 1) << 4) + (n & 1); // = [n]{ 0, 1, 16, 17, 32, 33, 48, 49 }; uint8 data = 0x00; for(unsigned x = 0; x < 8; x++) data |= ((cache.data[x] >> n) & 1) << x; if(cache.bitpend != 0xff) { step(memory_access_speed); data &= cache.bitpend; data |= bus_read(addr + byte) & ~cache.bitpend; } step(memory_access_speed); bus_write(addr + byte, data); } cache.bitpend = 0x00; } #endif processor/r6502/registers.hpp000664 001750 001750 00000001047 12651764221 017227 0ustar00sergiosergio000000 000000 struct Flags { bool n, v, d, i, z, c; inline operator unsigned() { return (n << 7) | (v << 6) | (d << 3) | (i << 2) | (z << 1) | (c << 0); } inline Flags& operator=(uint8 data) { n = data & 0x80; v = data & 0x40; d = data & 0x08; i = data & 0x04; z = data & 0x02; c = data & 0x01; return *this; } }; struct Registers { uint8 mdr; uint16 pc; uint8 a, x, y, s; Flags p; } regs; struct Register16 { union { uint16 w; struct { uint8 order_lsb2(l, h); }; }; } abs, iabs; uint8 rd; uint8 zp; uint16 aa; phoenix/reference/message-window.hpp000664 001750 001750 00000000522 12651764221 020761 0ustar00sergiosergio000000 000000 namespace phoenix { struct pMessageWindow { static MessageWindow::Response error(MessageWindow::State& state); static MessageWindow::Response information(MessageWindow::State& state); static MessageWindow::Response question(MessageWindow::State& state); static MessageWindow::Response warning(MessageWindow::State& state); }; } nall/string/char/utility.hpp000664 001750 001750 00000001631 12651764221 017276 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { template bool chrequal(char x, char y) { if(Insensitive) return chrlower(x) == chrlower(y); return x == y; } template bool quoteskip(T*& p) { if(Quoted == false) return false; if(*p != '\"') return false; while(*p == '\"') { char x = *p++; while(*p && *p++ != x); } return true; } template bool quotecopy(char*& t, T*& p) { if(Quoted == false) return false; if(*p != '\"') return false; while(*p == '\"') { char x = *p++; *t++ = x; while(*p && *p != x) *t++ = *p++; *t++ = *p++; } return true; } //strdup() is not a standard function, so recreate it char* strduplicate(const char* s) { if(s == nullptr) return nullptr; unsigned length = strlen(s); char* result = (char*)malloc(length + 1); strcpy(result, s); return result; } } #endif fc/cartridge/chip/chip.hpp000664 001750 001750 00000000125 12651764221 016621 0ustar00sergiosergio000000 000000 struct Board; struct Chip { Board& board; void tick(); Chip(Board& board); }; gba/video/video.hpp000664 001750 001750 00000000310 12651764221 015360 0ustar00sergiosergio000000 000000 struct Video { uint32_t* palette = nullptr; void generate_palette(Emulator::Interface::PaletteMode mode); Video(); ~Video(); private: static const uint8 curve[32]; }; extern Video video; fc/cartridge/chip/vrc4.cpp000664 001750 001750 00000011136 12651764221 016553 0ustar00sergiosergio000000 000000 struct VRC4 : Chip { bool prg_mode; uint5 prg_bank[2]; uint2 mirror; uint8 chr_bank[8]; uint8 irq_latch; bool irq_mode; bool irq_enable; bool irq_acknowledge; uint8 irq_counter; signed irq_scalar; bool irq_line; void main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(irq_enable) { if(irq_mode == 0) { irq_scalar -= 3; if(irq_scalar <= 0) { irq_scalar += 341; if(irq_counter == 0xff) { irq_counter = irq_latch; irq_line = 1; } else { irq_counter++; } } } if(irq_mode == 1) { if(irq_counter == 0xff) { irq_counter = irq_latch; irq_line = 1; } else { irq_counter++; } } } cpu.set_irq_line(irq_line); tick(); } } unsigned prg_addr(unsigned addr) const { unsigned bank = 0, banks = board.prgrom.size / 0x2000; switch(addr & 0xe000) { case 0x8000: bank = prg_mode == 0 ? (unsigned)prg_bank[0] : banks - 2; break; case 0xa000: bank = prg_bank[1]; break; case 0xc000: bank = prg_mode == 0 ? banks - 2 : (unsigned)prg_bank[0]; break; case 0xe000: bank = banks - 1; break; } return (bank * 0x2000) + (addr & 0x1fff); } unsigned chr_addr(unsigned addr) const { unsigned bank = chr_bank[addr / 0x0400]; return (bank * 0x0400) + (addr & 0x03ff); } unsigned ciram_addr(unsigned addr) const { switch(mirror) { case 0: return ((addr & 0x0400) >> 0) | (addr & 0x03ff); //vertical mirroring case 1: return ((addr & 0x0800) >> 1) | (addr & 0x03ff); //horizontal mirroring case 2: return 0x0000 | (addr & 0x03ff); //one-screen mirroring (first) case 3: return 0x0400 | (addr & 0x03ff); //one-screen mirroring (second) } throw; } void reg_write(unsigned addr, uint8 data) { switch(addr) { case 0x8000: case 0x8001: case 0x8002: case 0x8003: prg_bank[0] = data & 0x1f; break; case 0x9000: case 0x9001: mirror = data & 0x03; break; case 0x9002: case 0x9003: prg_mode = data & 0x02; break; case 0xa000: case 0xa001: case 0xa002: case 0xa003: prg_bank[1] = data & 0x1f; break; case 0xb000: chr_bank[0] = (chr_bank[0] & 0xf0) | ((data & 0x0f) << 0); break; case 0xb001: chr_bank[0] = (chr_bank[0] & 0x0f) | ((data & 0x0f) << 4); break; case 0xb002: chr_bank[1] = (chr_bank[1] & 0xf0) | ((data & 0x0f) << 0); break; case 0xb003: chr_bank[1] = (chr_bank[1] & 0x0f) | ((data & 0x0f) << 4); break; case 0xc000: chr_bank[2] = (chr_bank[2] & 0xf0) | ((data & 0x0f) << 0); break; case 0xc001: chr_bank[2] = (chr_bank[2] & 0x0f) | ((data & 0x0f) << 4); break; case 0xc002: chr_bank[3] = (chr_bank[3] & 0xf0) | ((data & 0x0f) << 0); break; case 0xc003: chr_bank[3] = (chr_bank[3] & 0x0f) | ((data & 0x0f) << 4); break; case 0xd000: chr_bank[4] = (chr_bank[4] & 0xf0) | ((data & 0x0f) << 0); break; case 0xd001: chr_bank[4] = (chr_bank[4] & 0x0f) | ((data & 0x0f) << 4); break; case 0xd002: chr_bank[5] = (chr_bank[5] & 0xf0) | ((data & 0x0f) << 0); break; case 0xd003: chr_bank[5] = (chr_bank[5] & 0x0f) | ((data & 0x0f) << 4); break; case 0xe000: chr_bank[6] = (chr_bank[6] & 0xf0) | ((data & 0x0f) << 0); break; case 0xe001: chr_bank[6] = (chr_bank[6] & 0x0f) | ((data & 0x0f) << 4); break; case 0xe002: chr_bank[7] = (chr_bank[7] & 0xf0) | ((data & 0x0f) << 0); break; case 0xe003: chr_bank[7] = (chr_bank[7] & 0x0f) | ((data & 0x0f) << 4); break; case 0xf000: irq_latch = (irq_latch & 0xf0) | ((data & 0x0f) << 0); break; case 0xf001: irq_latch = (irq_latch & 0x0f) | ((data & 0x0f) << 4); break; case 0xf002: irq_mode = data & 0x04; irq_enable = data & 0x02; irq_acknowledge = data & 0x01; if(irq_enable) { irq_counter = irq_latch; irq_scalar = 341; } irq_line = 0; break; case 0xf003: irq_enable = irq_acknowledge; irq_line = 0; break; } } void power() { } void reset() { prg_mode = 0; for(auto& n : prg_bank) n = 0; mirror = 0; for(auto& n : chr_bank) n = 0; irq_latch = 0; irq_mode = 0; irq_enable = 0; irq_acknowledge = 0; irq_counter = 0; irq_scalar = 0; irq_line = 0; } void serialize(serializer& s) { s.integer(prg_mode); for(auto& n : prg_bank) s.integer(n); s.integer(mirror); for(auto& n : chr_bank) s.integer(n); s.integer(irq_latch); s.integer(irq_mode); s.integer(irq_enable); s.integer(irq_acknowledge); s.integer(irq_counter); s.integer(irq_scalar); s.integer(irq_line); } VRC4(Board& board) : Chip(board) { } }; phoenix/gtk/widget/canvas.cpp000664 001750 001750 00000013420 12651764221 017411 0ustar00sergiosergio000000 000000 namespace phoenix { static void Canvas_drop(GtkWidget* widget, GdkDragContext* context, signed x, signed y, GtkSelectionData* data, unsigned type, unsigned timestamp, Canvas* canvas) { if(!canvas->state.droppable) return; lstring paths = DropPaths(data); if(paths.empty()) return; if(canvas->onDrop) canvas->onDrop(paths); } static signed Canvas_expose(GtkWidget* widget, GdkEventExpose* event, Canvas* self) { self->p.onExpose(event); return true; } static signed Canvas_mouseLeave(GtkWidget* widget, GdkEventButton* event, Canvas* self) { if(self->onMouseLeave) self->onMouseLeave(); return true; } static signed Canvas_mouseMove(GtkWidget* widget, GdkEventButton* event, Canvas* self) { if(self->onMouseMove) self->onMouseMove({(signed)event->x, (signed)event->y}); return true; } static signed Canvas_mousePress(GtkWidget* widget, GdkEventButton* event, Canvas* self) { if(self->onMousePress) switch(event->button) { case 1: self->onMousePress(Mouse::Button::Left); break; case 2: self->onMousePress(Mouse::Button::Middle); break; case 3: self->onMousePress(Mouse::Button::Right); break; } return true; } static signed Canvas_mouseRelease(GtkWidget* widget, GdkEventButton* event, Canvas* self) { if(self->onMouseRelease) switch(event->button) { case 1: self->onMouseRelease(Mouse::Button::Left); break; case 2: self->onMouseRelease(Mouse::Button::Middle); break; case 3: self->onMouseRelease(Mouse::Button::Right); break; } return true; } Size pCanvas::minimumSize() { return {canvas.state.width, canvas.state.height}; } void pCanvas::setDroppable(bool droppable) { gtk_drag_dest_set(gtkWidget, GTK_DEST_DEFAULT_ALL, nullptr, 0, GDK_ACTION_COPY); if(droppable) gtk_drag_dest_add_uri_targets(gtkWidget); } void pCanvas::setGeometry(Geometry geometry) { if(canvas.state.width == 0 || canvas.state.height == 0) rasterize(); unsigned width = canvas.state.width; unsigned height = canvas.state.height; if(width == 0) width = widget.state.geometry.width; if(height == 0) height = widget.state.geometry.height; if(width < geometry.width) { geometry.x += (geometry.width - width) / 2; geometry.width = width; } if(height < geometry.height) { geometry.y += (geometry.height - height) / 2; geometry.height = height; } pWidget::setGeometry(geometry); } void pCanvas::setMode(Canvas::Mode mode) { rasterize(), redraw(); } void pCanvas::setSize(Size size) { rasterize(), redraw(); } void pCanvas::constructor() { gtkWidget = gtk_drawing_area_new(); //gtk_widget_set_double_buffered(gtkWidget, false); gtk_widget_add_events(gtkWidget, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_EXPOSURE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK); g_signal_connect(G_OBJECT(gtkWidget), "button-press-event", G_CALLBACK(Canvas_mousePress), (gpointer)&canvas); g_signal_connect(G_OBJECT(gtkWidget), "button-release-event", G_CALLBACK(Canvas_mouseRelease), (gpointer)&canvas); g_signal_connect(G_OBJECT(gtkWidget), "drag-data-received", G_CALLBACK(Canvas_drop), (gpointer)&canvas); g_signal_connect(G_OBJECT(gtkWidget), "expose-event", G_CALLBACK(Canvas_expose), (gpointer)&canvas); g_signal_connect(G_OBJECT(gtkWidget), "leave-notify-event", G_CALLBACK(Canvas_mouseLeave), (gpointer)&canvas); g_signal_connect(G_OBJECT(gtkWidget), "motion-notify-event", G_CALLBACK(Canvas_mouseMove), (gpointer)&canvas); setDroppable(canvas.state.droppable); rasterize(), redraw(); } void pCanvas::destructor() { release(); gtk_widget_destroy(gtkWidget); } void pCanvas::orphan() { destructor(); constructor(); } void pCanvas::onExpose(GdkEventExpose* expose) { if(surface) gdk_draw_pixbuf(gtk_widget_get_window(gtkWidget), nullptr, surface, 0, 0, 0, 0, -1, -1, GDK_RGB_DITHER_NONE, 0, 0); } void pCanvas::rasterize() { unsigned width = canvas.state.width; unsigned height = canvas.state.height; if(width == 0) width = widget.state.geometry.width; if(height == 0) height = widget.state.geometry.height; if(width != surfaceWidth || height != surfaceHeight) release(); surfaceWidth = width; surfaceHeight = height; if(width == 0 || height == 0) return; if(!surface) surface = gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, width, height); uint32_t* buffer = (uint32_t*)gdk_pixbuf_get_pixels(surface); if(canvas.state.mode == Canvas::Mode::Color) { uint32_t color = canvas.state.color.argb(); for(unsigned n = 0; n < width * height; n++) buffer[n] = color; } if(canvas.state.mode == Canvas::Mode::Gradient) { nall::image image; image.allocate(width, height); image.gradient( canvas.state.gradient[0].argb(), canvas.state.gradient[1].argb(), canvas.state.gradient[2].argb(), canvas.state.gradient[3].argb() ); memcpy(buffer, image.data, image.size); } if(canvas.state.mode == Canvas::Mode::Image) { nall::image image = canvas.state.image; image.scale(width, height); image.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0); memcpy(buffer, image.data, image.size); } if(canvas.state.mode == Canvas::Mode::Data) { if(width == canvas.state.width && height == canvas.state.height) { memcpy(buffer, canvas.state.data, width * height * sizeof(uint32_t)); } else { memset(buffer, 0x00, width * height * sizeof(uint32_t)); } } //ARGB -> ABGR conversion for(unsigned n = 0; n < width * height; n++) { uint32_t color = *buffer; color = (color & 0xff00ff00) | ((color & 0xff0000) >> 16) | ((color & 0x0000ff) << 16); *buffer++ = color; } } void pCanvas::redraw() { if(gtk_widget_get_realized(gtkWidget)) { gdk_window_invalidate_rect(gtk_widget_get_window(gtkWidget), nullptr, true); } } void pCanvas::release() { if(surface == nullptr) return; g_object_unref(surface); surface = nullptr; surfaceWidth = 0; surfaceHeight = 0; } } gba/gba.hpp000664 001750 001750 00000002503 12651764221 013703 0ustar00sergiosergio000000 000000 #ifndef GBA_HPP #define GBA_HPP #include #include namespace GameBoyAdvance { namespace Info { static const char Name[] = "bgba"; static const unsigned SerializerVersion = 2; } } /* bgba - Game Boy Advance emulator authors: byuu, Cydrak license: GPLv3 project started: 2012-03-19 */ #include namespace GameBoyAdvance { enum : unsigned { Byte = 8, Half = 16, Word = 32 }; struct Thread { cothread_t thread; unsigned frequency; signed clock; inline void create(void (*entrypoint)(), unsigned frequency) { if(thread) co_delete(thread); thread = co_create(65536 * sizeof(void*), entrypoint); this->frequency = frequency; clock = 0; } inline void serialize(serializer& s) { s.integer(frequency); s.integer(clock); } inline Thread() : thread(nullptr) { } inline ~Thread() { if(thread) co_delete(thread); } }; #include #include #include #include #include #include #include #include #include #include } #endif sfc/chip/armdsp/serialization.cpp000664 001750 001750 00000001372 12651764221 020260 0ustar00sergiosergio000000 000000 #ifdef ARMDSP_CPP nall::vector ArmDSP::firmware() { nall::vector buffer; if(cartridge.has_armdsp() == false) return buffer; buffer.reserve(128 * 1024 + 32 * 1024); for(unsigned n = 0; n < 128 * 1024; n++) buffer.append(programROM[n]); for(unsigned n = 0; n < 32 * 1024; n++) buffer.append(dataROM[n]); return buffer; } void ArmDSP::serialize(serializer& s) { ARM::serialize(s); Thread::serialize(s); s.array(programRAM, 16 * 1024); s.integer(bridge.cputoarm.ready); s.integer(bridge.cputoarm.data); s.integer(bridge.armtocpu.ready); s.integer(bridge.armtocpu.data); s.integer(bridge.timer); s.integer(bridge.timerlatch); s.integer(bridge.reset); s.integer(bridge.ready); s.integer(bridge.signal); } #endif phoenix/reference/widget/horizontal-slider.hpp000664 001750 001750 00000000537 12651764221 022772 0ustar00sergiosergio000000 000000 namespace phoenix { struct pHorizontalSlider : public pWidget { HorizontalSlider& horizontalSlider; void setLength(unsigned length); void setPosition(unsigned position); pHorizontalSlider(HorizontalSlider& horizontalSlider) : pWidget(horizontalSlider), horizontalSlider(horizontalSlider) {} void constructor(); void destructor(); }; } fc/cartridge/chip/000700 001750 001750 00000000000 12656700342 015152 5ustar00sergiosergio000000 000000 sfc/chip/superfx/disassembler/disassembler.cpp000664 001750 001750 00000030356 12651764221 022747 0ustar00sergiosergio000000 000000 #ifdef SUPERFX_CPP //TODO: this belongs in processor/gsu void SuperFX::disassemble_opcode(char* output) { *output = 0; if(!regs.sfr.alt2) { if(!regs.sfr.alt1) { disassemble_alt0(output); } else { disassemble_alt1(output); } } else { if(!regs.sfr.alt1) { disassemble_alt2(output); } else { disassemble_alt3(output); } } unsigned length = strlen(output); while(length++ < 20) strcat(output, " "); } #define case4(id) \ case id+ 0: case id+ 1: case id+ 2: case id+ 3 #define case6(id) \ case id+ 0: case id+ 1: case id+ 2: case id+ 3: case id+ 4: case id+ 5 #define case12(id) \ case id+ 0: case id+ 1: case id+ 2: case id+ 3: case id+ 4: case id+ 5: case id+ 6: case id+ 7: \ case id+ 8: case id+ 9: case id+10: case id+11 #define case15(id) \ case id+ 0: case id+ 1: case id+ 2: case id+ 3: case id+ 4: case id+ 5: case id+ 6: case id+ 7: \ case id+ 8: case id+ 9: case id+10: case id+11: case id+12: case id+13: case id+14 #define case16(id) \ case id+ 0: case id+ 1: case id+ 2: case id+ 3: case id+ 4: case id+ 5: case id+ 6: case id+ 7: \ case id+ 8: case id+ 9: case id+10: case id+11: case id+12: case id+13: case id+14: case id+15 #define op0 regs.pipeline #define op1 bus_read((regs.pbr << 16) + regs.r[15] + 0) #define op2 bus_read((regs.pbr << 16) + regs.r[15] + 1) void SuperFX::disassemble_alt0(char* output) { char t[256] = ""; switch(op0) { case (0x00): sprintf(t, "stop"); break; case (0x01): sprintf(t, "nop"); break; case (0x02): sprintf(t, "cache"); break; case (0x03): sprintf(t, "lsr"); break; case (0x04): sprintf(t, "rol"); break; case (0x05): sprintf(t, "bra %+d", (int8_t)op1); break; case (0x06): sprintf(t, "blt %+d", (int8_t)op1); break; case (0x07): sprintf(t, "bge %+d", (int8_t)op1); break; case (0x08): sprintf(t, "bne %+d", (int8_t)op1); break; case (0x09): sprintf(t, "beq %+d", (int8_t)op1); break; case (0x0a): sprintf(t, "bpl %+d", (int8_t)op1); break; case (0x0b): sprintf(t, "bmi %+d", (int8_t)op1); break; case (0x0c): sprintf(t, "bcc %+d", (int8_t)op1); break; case (0x0d): sprintf(t, "bcs %+d", (int8_t)op1); break; case (0x0e): sprintf(t, "bvc %+d", (int8_t)op1); break; case (0x0f): sprintf(t, "bvs %+d", (int8_t)op1); break; case16(0x10): sprintf(t, "to r%u", op0 & 15); break; case16(0x20): sprintf(t, "with r%u", op0 & 15); break; case12(0x30): sprintf(t, "stw (r%u)", op0 & 15); break; case (0x3c): sprintf(t, "loop"); break; case (0x3d): sprintf(t, "alt1"); break; case (0x3e): sprintf(t, "alt2"); break; case (0x3f): sprintf(t, "alt3"); break; case12(0x40): sprintf(t, "ldw (r%u)", op0 & 15); break; case (0x4c): sprintf(t, "plot"); break; case (0x4d): sprintf(t, "swap"); break; case (0x4e): sprintf(t, "color"); break; case (0x4f): sprintf(t, "not"); break; case16(0x50): sprintf(t, "add r%u", op0 & 15); break; case16(0x60): sprintf(t, "sub r%u", op0 & 15); break; case (0x70): sprintf(t, "merge"); break; case15(0x71): sprintf(t, "and r%u", op0 & 15); break; case16(0x80): sprintf(t, "mult r%u", op0 & 15); break; case (0x90): sprintf(t, "sbk"); break; case4 (0x91): sprintf(t, "link #%u", op0 & 15); break; case (0x95): sprintf(t, "sex"); break; case (0x96): sprintf(t, "asr"); break; case (0x97): sprintf(t, "ror"); break; case6 (0x98): sprintf(t, "jmp r%u", op0 & 15); break; case (0x9e): sprintf(t, "lob"); break; case (0x9f): sprintf(t, "fmult"); break; case16(0xa0): sprintf(t, "ibt r%u,#$%.2x", op0 & 15, op1); break; case16(0xb0): sprintf(t, "from r%u", op0 & 15); break; case (0xc0): sprintf(t, "hib"); break; case15(0xc1): sprintf(t, "or r%u", op0 & 15); break; case15(0xd0): sprintf(t, "inc r%u", op0 & 15); break; case (0xdf): sprintf(t, "getc"); break; case15(0xe0): sprintf(t, "dec r%u", op0 & 15); break; case (0xef): sprintf(t, "getb"); break; case16(0xf0): sprintf(t, "iwt r%u,#$%.2x%.2x", op0 & 15, op2, op1); break; } strcat(output, t); } void SuperFX::disassemble_alt1(char* output) { char t[256] = ""; switch(op0) { case (0x00): sprintf(t, "stop"); break; case (0x01): sprintf(t, "nop"); break; case (0x02): sprintf(t, "cache"); break; case (0x03): sprintf(t, "lsr"); break; case (0x04): sprintf(t, "rol"); break; case (0x05): sprintf(t, "bra %+d", (int8_t)op1); break; case (0x06): sprintf(t, "blt %+d", (int8_t)op1); break; case (0x07): sprintf(t, "bge %+d", (int8_t)op1); break; case (0x08): sprintf(t, "bne %+d", (int8_t)op1); break; case (0x09): sprintf(t, "beq %+d", (int8_t)op1); break; case (0x0a): sprintf(t, "bpl %+d", (int8_t)op1); break; case (0x0b): sprintf(t, "bmi %+d", (int8_t)op1); break; case (0x0c): sprintf(t, "bcc %+d", (int8_t)op1); break; case (0x0d): sprintf(t, "bcs %+d", (int8_t)op1); break; case (0x0e): sprintf(t, "bvc %+d", (int8_t)op1); break; case (0x0f): sprintf(t, "bvs %+d", (int8_t)op1); break; case16(0x10): sprintf(t, "to r%u", op0 & 15); break; case16(0x20): sprintf(t, "with r%u", op0 & 15); break; case12(0x30): sprintf(t, "stb (r%u)", op0 & 15); break; case (0x3c): sprintf(t, "loop"); break; case (0x3d): sprintf(t, "alt1"); break; case (0x3e): sprintf(t, "alt2"); break; case (0x3f): sprintf(t, "alt3"); break; case12(0x40): sprintf(t, "ldb (r%u)", op0 & 15); break; case (0x4c): sprintf(t, "rpix"); break; case (0x4d): sprintf(t, "swap"); break; case (0x4e): sprintf(t, "cmode"); break; case (0x4f): sprintf(t, "not"); break; case16(0x50): sprintf(t, "adc r%u", op0 & 15); break; case16(0x60): sprintf(t, "sbc r%u", op0 & 15); break; case (0x70): sprintf(t, "merge"); break; case15(0x71): sprintf(t, "bic r%u", op0 & 15); break; case16(0x80): sprintf(t, "umult r%u", op0 & 15); break; case (0x90): sprintf(t, "sbk"); break; case4 (0x91): sprintf(t, "link #%u", op0 & 15); break; case (0x95): sprintf(t, "sex"); break; case (0x96): sprintf(t, "div2"); break; case (0x97): sprintf(t, "ror"); break; case6 (0x98): sprintf(t, "ljmp r%u", op0 & 15); break; case (0x9e): sprintf(t, "lob"); break; case (0x9f): sprintf(t, "lmult"); break; case16(0xa0): sprintf(t, "lms r%u,(#$%.4x)", op0 & 15, op1 << 1); break; case16(0xb0): sprintf(t, "from r%u", op0 & 15); break; case (0xc0): sprintf(t, "hib"); break; case15(0xc1): sprintf(t, "xor r%u", op0 & 15); break; case15(0xd0): sprintf(t, "inc r%u", op0 & 15); break; case (0xdf): sprintf(t, "getc"); break; case15(0xe0): sprintf(t, "dec r%u", op0 & 15); break; case (0xef): sprintf(t, "getbh"); break; case16(0xf0): sprintf(t, "lm r%u", op0 & 15); break; } strcat(output, t); } void SuperFX::disassemble_alt2(char* output) { char t[256] = ""; switch(op0) { case (0x00): sprintf(t, "stop"); break; case (0x01): sprintf(t, "nop"); break; case (0x02): sprintf(t, "cache"); break; case (0x03): sprintf(t, "lsr"); break; case (0x04): sprintf(t, "rol"); break; case (0x05): sprintf(t, "bra %+d", (int8_t)op1); break; case (0x06): sprintf(t, "blt %+d", (int8_t)op1); break; case (0x07): sprintf(t, "bge %+d", (int8_t)op1); break; case (0x08): sprintf(t, "bne %+d", (int8_t)op1); break; case (0x09): sprintf(t, "beq %+d", (int8_t)op1); break; case (0x0a): sprintf(t, "bpl %+d", (int8_t)op1); break; case (0x0b): sprintf(t, "bmi %+d", (int8_t)op1); break; case (0x0c): sprintf(t, "bcc %+d", (int8_t)op1); break; case (0x0d): sprintf(t, "bcs %+d", (int8_t)op1); break; case (0x0e): sprintf(t, "bvc %+d", (int8_t)op1); break; case (0x0f): sprintf(t, "bvs %+d", (int8_t)op1); break; case16(0x10): sprintf(t, "to r%u", op0 & 15); break; case16(0x20): sprintf(t, "with r%u", op0 & 15); break; case12(0x30): sprintf(t, "stw (r%u)", op0 & 15); break; case (0x3c): sprintf(t, "loop"); break; case (0x3d): sprintf(t, "alt1"); break; case (0x3e): sprintf(t, "alt2"); break; case (0x3f): sprintf(t, "alt3"); break; case12(0x40): sprintf(t, "ldw (r%u)", op0 & 15); break; case (0x4c): sprintf(t, "plot"); break; case (0x4d): sprintf(t, "swap"); break; case (0x4e): sprintf(t, "color"); break; case (0x4f): sprintf(t, "not"); break; case16(0x50): sprintf(t, "add #%u", op0 & 15); break; case16(0x60): sprintf(t, "sub #%u", op0 & 15); break; case (0x70): sprintf(t, "merge"); break; case15(0x71): sprintf(t, "and #%u", op0 & 15); break; case16(0x80): sprintf(t, "mult #%u", op0 & 15); break; case (0x90): sprintf(t, "sbk"); break; case4 (0x91): sprintf(t, "link #%u", op0 & 15); break; case (0x95): sprintf(t, "sex"); break; case (0x96): sprintf(t, "asr"); break; case (0x97): sprintf(t, "ror"); break; case6 (0x98): sprintf(t, "jmp r%u", op0 & 15); break; case (0x9e): sprintf(t, "lob"); break; case (0x9f): sprintf(t, "fmult"); break; case16(0xa0): sprintf(t, "sms r%u,(#$%.4x)", op0 & 15, op1 << 1); break; case16(0xb0): sprintf(t, "from r%u", op0 & 15); break; case (0xc0): sprintf(t, "hib"); break; case15(0xc1): sprintf(t, "or #%u", op0 & 15); break; case15(0xd0): sprintf(t, "inc r%u", op0 & 15); break; case (0xdf): sprintf(t, "ramb"); break; case15(0xe0): sprintf(t, "dec r%u", op0 & 15); break; case (0xef): sprintf(t, "getbl"); break; case16(0xf0): sprintf(t, "sm r%u", op0 & 15); break; } strcat(output, t); } void SuperFX::disassemble_alt3(char* output) { char t[256] = ""; switch(op0) { case (0x00): sprintf(t, "stop"); break; case (0x01): sprintf(t, "nop"); break; case (0x02): sprintf(t, "cache"); break; case (0x03): sprintf(t, "lsr"); break; case (0x04): sprintf(t, "rol"); break; case (0x05): sprintf(t, "bra %+d", (int8_t)op1); break; case (0x06): sprintf(t, "blt %+d", (int8_t)op1); break; case (0x07): sprintf(t, "bge %+d", (int8_t)op1); break; case (0x08): sprintf(t, "bne %+d", (int8_t)op1); break; case (0x09): sprintf(t, "beq %+d", (int8_t)op1); break; case (0x0a): sprintf(t, "bpl %+d", (int8_t)op1); break; case (0x0b): sprintf(t, "bmi %+d", (int8_t)op1); break; case (0x0c): sprintf(t, "bcc %+d", (int8_t)op1); break; case (0x0d): sprintf(t, "bcs %+d", (int8_t)op1); break; case (0x0e): sprintf(t, "bvc %+d", (int8_t)op1); break; case (0x0f): sprintf(t, "bvs %+d", (int8_t)op1); break; case16(0x10): sprintf(t, "to r%u", op0 & 15); break; case16(0x20): sprintf(t, "with r%u", op0 & 15); break; case12(0x30): sprintf(t, "stb (r%u)", op0 & 15); break; case (0x3c): sprintf(t, "loop"); break; case (0x3d): sprintf(t, "alt1"); break; case (0x3e): sprintf(t, "alt2"); break; case (0x3f): sprintf(t, "alt3"); break; case12(0x40): sprintf(t, "ldb (r%u)", op0 & 15); break; case (0x4c): sprintf(t, "rpix"); break; case (0x4d): sprintf(t, "swap"); break; case (0x4e): sprintf(t, "cmode"); break; case (0x4f): sprintf(t, "not"); break; case16(0x50): sprintf(t, "adc #%u", op0 & 15); break; case16(0x60): sprintf(t, "cmp r%u", op0 & 15); break; case (0x70): sprintf(t, "merge"); break; case15(0x71): sprintf(t, "bic #%u", op0 & 15); break; case16(0x80): sprintf(t, "umult #%u", op0 & 15); break; case (0x90): sprintf(t, "sbk"); break; case4 (0x91): sprintf(t, "link #%u", op0 & 15); break; case (0x95): sprintf(t, "sex"); break; case (0x96): sprintf(t, "div2"); break; case (0x97): sprintf(t, "ror"); break; case6 (0x98): sprintf(t, "ljmp r%u", op0 & 15); break; case (0x9e): sprintf(t, "lob"); break; case (0x9f): sprintf(t, "lmult"); break; case16(0xa0): sprintf(t, "lms r%u", op0 & 15); break; case16(0xb0): sprintf(t, "from r%u", op0 & 15); break; case (0xc0): sprintf(t, "hib"); break; case15(0xc1): sprintf(t, "xor #%u", op0 & 15); break; case15(0xd0): sprintf(t, "inc r%u", op0 & 15); break; case (0xdf): sprintf(t, "romb"); break; case15(0xe0): sprintf(t, "dec r%u", op0 & 15); break; case (0xef): sprintf(t, "getbs"); break; case16(0xf0): sprintf(t, "lm r%u", op0 & 15); break; } strcat(output, t); } #undef case4 #undef case6 #undef case12 #undef case15 #undef case16 #undef op0 #undef op1 #undef op2 #endif gba/000700 001750 001750 00000000000 12656700342 012424 5ustar00sergiosergio000000 000000 nall/dsp/core.hpp000664 001750 001750 00000006761 12651764221 015077 0ustar00sergiosergio000000 000000 #ifdef NALL_DSP_INTERNAL_HPP #include #include #include namespace nall { //precision: can be float, double or long double #define real float struct DSP; struct Resampler { DSP& dsp; real frequency; virtual void setFrequency() = 0; virtual void clear() = 0; virtual void sample() = 0; Resampler(DSP& dsp) : dsp(dsp) {} virtual ~Resampler() {} }; struct DSP { enum class ResampleEngine : unsigned { Nearest, Linear, Cosine, Cubic, Hermite, Average, Sinc, }; inline void setChannels(unsigned channels); inline void setPrecision(unsigned precision); inline void setFrequency(real frequency); //inputFrequency inline void setVolume(real volume); inline void setBalance(real balance); inline void setResampler(ResampleEngine resamplingEngine); inline void setResamplerFrequency(real frequency); //outputFrequency inline void sample(signed channel[]); inline bool pending(); inline void read(signed channel[]); inline void clear(); inline DSP(); inline ~DSP(); protected: friend class ResampleNearest; friend class ResampleLinear; friend class ResampleCosine; friend class ResampleCubic; friend class ResampleAverage; friend class ResampleHermite; friend class ResampleSinc; struct Settings { unsigned channels; unsigned precision; real frequency; real volume; real balance; //internal real intensity; real intensityInverse; } settings; Resampler* resampler = nullptr; inline void write(real channel[]); #include "buffer.hpp" Buffer buffer; Buffer output; inline void adjustVolume(); inline void adjustBalance(); inline signed clamp(const unsigned bits, const signed x); }; #include "resample/nearest.hpp" #include "resample/linear.hpp" #include "resample/cosine.hpp" #include "resample/cubic.hpp" #include "resample/hermite.hpp" #include "resample/average.hpp" #include "resample/sinc.hpp" #include "settings.hpp" void DSP::sample(signed channel[]) { for(unsigned c = 0; c < settings.channels; c++) { buffer.write(c) = (real)channel[c] * settings.intensityInverse; } buffer.wroffset++; resampler->sample(); } bool DSP::pending() { return output.rdoffset != output.wroffset; } void DSP::read(signed channel[]) { adjustVolume(); adjustBalance(); for(unsigned c = 0; c < settings.channels; c++) { channel[c] = clamp(settings.precision, output.read(c) * settings.intensity); } output.rdoffset++; } void DSP::write(real channel[]) { for(unsigned c = 0; c < settings.channels; c++) { output.write(c) = channel[c]; } output.wroffset++; } void DSP::adjustVolume() { for(unsigned c = 0; c < settings.channels; c++) { output.read(c) *= settings.volume; } } void DSP::adjustBalance() { if(settings.channels != 2) return; //TODO: support > 2 channels if(settings.balance < 0.0) output.read(1) *= 1.0 + settings.balance; if(settings.balance > 0.0) output.read(0) *= 1.0 - settings.balance; } signed DSP::clamp(const unsigned bits, const signed x) { const signed b = 1U << (bits - 1); const signed m = (1U << (bits - 1)) - 1; return (x > m) ? m : (x < -b) ? -b : x; } void DSP::clear() { buffer.clear(); output.clear(); resampler->clear(); } DSP::DSP() { setResampler(ResampleEngine::Hermite); setResamplerFrequency(44100.0); setChannels(2); setPrecision(16); setFrequency(44100.0); setVolume(1.0); setBalance(0.0); clear(); } DSP::~DSP() { if(resampler) delete resampler; } #undef real } #endif gb/memory/000700 001750 001750 00000000000 12656700342 013573 5ustar00sergiosergio000000 000000 libco/ppc.c000664 001750 001750 00000027343 12651764221 013737 0ustar00sergiosergio000000 000000 /* libco.ppc (2010-10-17) author: blargg license: public domain */ /* PowerPC 32/64 using embedded or external asm, with optional floating-point and AltiVec save/restore */ #define LIBCO_C #include "libco.h" #include #include #include #define LIBCO_MPROTECT (__unix__ && !LIBCO_PPC_ASM) #if LIBCO_MPROTECT #include #include #endif /* State format (offsets in 32-bit words) +0 Pointer to swap code Rest of function descriptor for entry function +8 PC +10 SP Special regs GPRs FPRs VRs stack */ enum { state_size = 1024 }; enum { above_stack = 2048 }; enum { stack_align = 256 }; static thread_local cothread_t co_active_handle = 0; /**** Determine environment ****/ #define LIBCO_PPC64 (_ARCH_PPC64 || __PPC64__ || __ppc64__ || __powerpc64__) /* Whether function calls are indirect through a descriptor, or are directly to function */ #ifndef LIBCO_PPCDESC #if !_CALL_SYSV && (_CALL_AIX || _CALL_AIXDESC || LIBCO_PPC64) #define LIBCO_PPCDESC 1 #endif #endif #ifdef LIBCO_PPC_ASM #ifdef __cplusplus extern "C" #endif /* Swap code is in ppc.S */ void co_swap_asm( cothread_t, cothread_t ); #define CO_SWAP_ASM( x, y ) co_swap_asm( x, y ) #else /* Swap code is here in array. Please leave dieassembly comments, as they make it easy to see what it does, and reorder instructions if one wants to see whether that improves performance. */ static const uint32_t libco_ppc_code [] = { #if LIBCO_PPC64 0x7d000026, /* mfcr r8 */ 0xf8240028, /* std r1,40(r4) */ 0x7d2802a6, /* mflr r9 */ 0xf9c40048, /* std r14,72(r4) */ 0xf9e40050, /* std r15,80(r4) */ 0xfa040058, /* std r16,88(r4) */ 0xfa240060, /* std r17,96(r4) */ 0xfa440068, /* std r18,104(r4) */ 0xfa640070, /* std r19,112(r4) */ 0xfa840078, /* std r20,120(r4) */ 0xfaa40080, /* std r21,128(r4) */ 0xfac40088, /* std r22,136(r4) */ 0xfae40090, /* std r23,144(r4) */ 0xfb040098, /* std r24,152(r4) */ 0xfb2400a0, /* std r25,160(r4) */ 0xfb4400a8, /* std r26,168(r4) */ 0xfb6400b0, /* std r27,176(r4) */ 0xfb8400b8, /* std r28,184(r4) */ 0xfba400c0, /* std r29,192(r4) */ 0xfbc400c8, /* std r30,200(r4) */ 0xfbe400d0, /* std r31,208(r4) */ 0xf9240020, /* std r9,32(r4) */ 0xe8e30020, /* ld r7,32(r3) */ 0xe8230028, /* ld r1,40(r3) */ 0x48000009, /* bl 1 */ 0x7fe00008, /* trap */ 0x91040030,/*1:stw r8,48(r4) */ 0x80c30030, /* lwz r6,48(r3) */ 0x7ce903a6, /* mtctr r7 */ 0xe9c30048, /* ld r14,72(r3) */ 0xe9e30050, /* ld r15,80(r3) */ 0xea030058, /* ld r16,88(r3) */ 0xea230060, /* ld r17,96(r3) */ 0xea430068, /* ld r18,104(r3) */ 0xea630070, /* ld r19,112(r3) */ 0xea830078, /* ld r20,120(r3) */ 0xeaa30080, /* ld r21,128(r3) */ 0xeac30088, /* ld r22,136(r3) */ 0xeae30090, /* ld r23,144(r3) */ 0xeb030098, /* ld r24,152(r3) */ 0xeb2300a0, /* ld r25,160(r3) */ 0xeb4300a8, /* ld r26,168(r3) */ 0xeb6300b0, /* ld r27,176(r3) */ 0xeb8300b8, /* ld r28,184(r3) */ 0xeba300c0, /* ld r29,192(r3) */ 0xebc300c8, /* ld r30,200(r3) */ 0xebe300d0, /* ld r31,208(r3) */ 0x7ccff120, /* mtcr r6 */ #else 0x7d000026, /* mfcr r8 */ 0x90240028, /* stw r1,40(r4) */ 0x7d2802a6, /* mflr r9 */ 0x91a4003c, /* stw r13,60(r4) */ 0x91c40040, /* stw r14,64(r4) */ 0x91e40044, /* stw r15,68(r4) */ 0x92040048, /* stw r16,72(r4) */ 0x9224004c, /* stw r17,76(r4) */ 0x92440050, /* stw r18,80(r4) */ 0x92640054, /* stw r19,84(r4) */ 0x92840058, /* stw r20,88(r4) */ 0x92a4005c, /* stw r21,92(r4) */ 0x92c40060, /* stw r22,96(r4) */ 0x92e40064, /* stw r23,100(r4) */ 0x93040068, /* stw r24,104(r4) */ 0x9324006c, /* stw r25,108(r4) */ 0x93440070, /* stw r26,112(r4) */ 0x93640074, /* stw r27,116(r4) */ 0x93840078, /* stw r28,120(r4) */ 0x93a4007c, /* stw r29,124(r4) */ 0x93c40080, /* stw r30,128(r4) */ 0x93e40084, /* stw r31,132(r4) */ 0x91240020, /* stw r9,32(r4) */ 0x80e30020, /* lwz r7,32(r3) */ 0x80230028, /* lwz r1,40(r3) */ 0x48000009, /* bl 1 */ 0x7fe00008, /* trap */ 0x91040030,/*1:stw r8,48(r4) */ 0x80c30030, /* lwz r6,48(r3) */ 0x7ce903a6, /* mtctr r7 */ 0x81a3003c, /* lwz r13,60(r3) */ 0x81c30040, /* lwz r14,64(r3) */ 0x81e30044, /* lwz r15,68(r3) */ 0x82030048, /* lwz r16,72(r3) */ 0x8223004c, /* lwz r17,76(r3) */ 0x82430050, /* lwz r18,80(r3) */ 0x82630054, /* lwz r19,84(r3) */ 0x82830058, /* lwz r20,88(r3) */ 0x82a3005c, /* lwz r21,92(r3) */ 0x82c30060, /* lwz r22,96(r3) */ 0x82e30064, /* lwz r23,100(r3) */ 0x83030068, /* lwz r24,104(r3) */ 0x8323006c, /* lwz r25,108(r3) */ 0x83430070, /* lwz r26,112(r3) */ 0x83630074, /* lwz r27,116(r3) */ 0x83830078, /* lwz r28,120(r3) */ 0x83a3007c, /* lwz r29,124(r3) */ 0x83c30080, /* lwz r30,128(r3) */ 0x83e30084, /* lwz r31,132(r3) */ 0x7ccff120, /* mtcr r6 */ #endif #ifndef LIBCO_PPC_NOFP 0xd9c400e0, /* stfd f14,224(r4) */ 0xd9e400e8, /* stfd f15,232(r4) */ 0xda0400f0, /* stfd f16,240(r4) */ 0xda2400f8, /* stfd f17,248(r4) */ 0xda440100, /* stfd f18,256(r4) */ 0xda640108, /* stfd f19,264(r4) */ 0xda840110, /* stfd f20,272(r4) */ 0xdaa40118, /* stfd f21,280(r4) */ 0xdac40120, /* stfd f22,288(r4) */ 0xdae40128, /* stfd f23,296(r4) */ 0xdb040130, /* stfd f24,304(r4) */ 0xdb240138, /* stfd f25,312(r4) */ 0xdb440140, /* stfd f26,320(r4) */ 0xdb640148, /* stfd f27,328(r4) */ 0xdb840150, /* stfd f28,336(r4) */ 0xdba40158, /* stfd f29,344(r4) */ 0xdbc40160, /* stfd f30,352(r4) */ 0xdbe40168, /* stfd f31,360(r4) */ 0xc9c300e0, /* lfd f14,224(r3) */ 0xc9e300e8, /* lfd f15,232(r3) */ 0xca0300f0, /* lfd f16,240(r3) */ 0xca2300f8, /* lfd f17,248(r3) */ 0xca430100, /* lfd f18,256(r3) */ 0xca630108, /* lfd f19,264(r3) */ 0xca830110, /* lfd f20,272(r3) */ 0xcaa30118, /* lfd f21,280(r3) */ 0xcac30120, /* lfd f22,288(r3) */ 0xcae30128, /* lfd f23,296(r3) */ 0xcb030130, /* lfd f24,304(r3) */ 0xcb230138, /* lfd f25,312(r3) */ 0xcb430140, /* lfd f26,320(r3) */ 0xcb630148, /* lfd f27,328(r3) */ 0xcb830150, /* lfd f28,336(r3) */ 0xcba30158, /* lfd f29,344(r3) */ 0xcbc30160, /* lfd f30,352(r3) */ 0xcbe30168, /* lfd f31,360(r3) */ #endif #ifdef __ALTIVEC__ 0x7ca042a6, /* mfvrsave r5 */ 0x39040180, /* addi r8,r4,384 */ 0x39240190, /* addi r9,r4,400 */ 0x70a00fff, /* andi. r0,r5,4095 */ 0x90a40034, /* stw r5,52(r4) */ 0x4182005c, /* beq- 2 */ 0x7e8041ce, /* stvx v20,r0,r8 */ 0x39080020, /* addi r8,r8,32 */ 0x7ea049ce, /* stvx v21,r0,r9 */ 0x39290020, /* addi r9,r9,32 */ 0x7ec041ce, /* stvx v22,r0,r8 */ 0x39080020, /* addi r8,r8,32 */ 0x7ee049ce, /* stvx v23,r0,r9 */ 0x39290020, /* addi r9,r9,32 */ 0x7f0041ce, /* stvx v24,r0,r8 */ 0x39080020, /* addi r8,r8,32 */ 0x7f2049ce, /* stvx v25,r0,r9 */ 0x39290020, /* addi r9,r9,32 */ 0x7f4041ce, /* stvx v26,r0,r8 */ 0x39080020, /* addi r8,r8,32 */ 0x7f6049ce, /* stvx v27,r0,r9 */ 0x39290020, /* addi r9,r9,32 */ 0x7f8041ce, /* stvx v28,r0,r8 */ 0x39080020, /* addi r8,r8,32 */ 0x7fa049ce, /* stvx v29,r0,r9 */ 0x39290020, /* addi r9,r9,32 */ 0x7fc041ce, /* stvx v30,r0,r8 */ 0x7fe049ce, /* stvx v31,r0,r9 */ 0x80a30034,/*2:lwz r5,52(r3) */ 0x39030180, /* addi r8,r3,384 */ 0x39230190, /* addi r9,r3,400 */ 0x70a00fff, /* andi. r0,r5,4095 */ 0x7ca043a6, /* mtvrsave r5 */ 0x4d820420, /* beqctr */ 0x7e8040ce, /* lvx v20,r0,r8 */ 0x39080020, /* addi r8,r8,32 */ 0x7ea048ce, /* lvx v21,r0,r9 */ 0x39290020, /* addi r9,r9,32 */ 0x7ec040ce, /* lvx v22,r0,r8 */ 0x39080020, /* addi r8,r8,32 */ 0x7ee048ce, /* lvx v23,r0,r9 */ 0x39290020, /* addi r9,r9,32 */ 0x7f0040ce, /* lvx v24,r0,r8 */ 0x39080020, /* addi r8,r8,32 */ 0x7f2048ce, /* lvx v25,r0,r9 */ 0x39290020, /* addi r9,r9,32 */ 0x7f4040ce, /* lvx v26,r0,r8 */ 0x39080020, /* addi r8,r8,32 */ 0x7f6048ce, /* lvx v27,r0,r9 */ 0x39290020, /* addi r9,r9,32 */ 0x7f8040ce, /* lvx v28,r0,r8 */ 0x39080020, /* addi r8,r8,32 */ 0x7fa048ce, /* lvx v29,r0,r9 */ 0x39290020, /* addi r9,r9,32 */ 0x7fc040ce, /* lvx v30,r0,r8 */ 0x7fe048ce, /* lvx v31,r0,r9 */ #endif 0x4e800420, /* bctr */ }; #if LIBCO_PPCDESC /* Function call goes through indirect descriptor */ #define CO_SWAP_ASM( x, y ) \ ((void (*)( cothread_t, cothread_t )) (uintptr_t) x)( x, y ) #else /* Function call goes directly to code */ #define CO_SWAP_ASM( x, y ) \ ((void (*)( cothread_t, cothread_t )) (uintptr_t) libco_ppc_code)( x, y ) #endif #endif static uint32_t* co_create_( unsigned size, uintptr_t entry ) { uint32_t* t = (uint32_t*) malloc( size ); (void) entry; #if LIBCO_PPCDESC if ( t ) { /* Copy entry's descriptor */ memcpy( t, (void*) entry, sizeof (void*) * 3 ); /* Set function pointer to swap routine */ #ifdef LIBCO_PPC_ASM *(const void**) t = *(void**) &co_swap_asm; #else *(const void**) t = libco_ppc_code; #endif } #endif return t; } cothread_t co_create( unsigned int size, void (*entry_)( void ) ) { uintptr_t entry = (uintptr_t) entry_; uint32_t* t = NULL; /* Be sure main thread was successfully allocated */ if ( co_active() ) { size += state_size + above_stack + stack_align; t = co_create_( size, entry ); } if ( t ) { uintptr_t sp; int shift; /* Save current registers into new thread, so that any special ones will have proper values when thread is begun */ CO_SWAP_ASM( t, t ); #if LIBCO_PPCDESC /* Get real address */ entry = (uintptr_t) *(void**) entry; #endif /* Put stack near end of block, and align */ sp = (uintptr_t) t + size - above_stack; sp -= sp % stack_align; /* On PPC32, we save and restore GPRs as 32 bits. For PPC64, we save and restore them as 64 bits, regardless of the size the ABI uses. So, we manually write pointers at the proper size. We always save and restore at the same address, and since PPC is big-endian, we must put the low byte first on PPC32. */ /* If uintptr_t is 32 bits, >>32 is undefined behavior, so we do two shifts and don't have to care how many bits uintptr_t is. */ #if LIBCO_PPC64 shift = 16; #else shift = 0; #endif /* Set up so entry will be called on next swap */ t [8] = (uint32_t) (entry >> shift >> shift); t [9] = (uint32_t) entry; t [10] = (uint32_t) (sp >> shift >> shift); t [11] = (uint32_t) sp; } return t; } void co_delete( cothread_t t ) { free(t); } static void co_init_( void ) { #if LIBCO_MPROTECT /* TODO: pre- and post-pad PPC code so that this doesn't make other data executable and writable */ long page_size = sysconf( _SC_PAGESIZE ); if ( page_size > 0 ) { uintptr_t align = page_size; uintptr_t begin = (uintptr_t) libco_ppc_code; uintptr_t end = begin + sizeof libco_ppc_code; /* Align beginning and end */ end += align - 1; end -= end % align; begin -= begin % align; mprotect( (void*) begin, end - begin, PROT_READ | PROT_WRITE | PROT_EXEC ); } #endif co_active_handle = co_create_( state_size, (uintptr_t) &co_switch ); } cothread_t co_active(void) { if (!co_active_handle) co_init_(); return co_active_handle; } void co_switch(cothread_t t) { cothread_t old = co_active_handle; co_active_handle = t; CO_SWAP_ASM( t, old ); } sfc/chip/sharprtc/sharprtc.hpp000664 001750 001750 00000001632 12651764221 017575 0ustar00sergiosergio000000 000000 struct SharpRTC : Coprocessor { static void Enter(); void enter(); void init(); void load(); void unload(); void power(); void reset(); void sync(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); void serialize(serializer&); enum class State : unsigned { Ready, Command, Read, Write } rtc_state; signed rtc_index; unsigned second; unsigned minute; unsigned hour; unsigned day; unsigned month; unsigned year; unsigned weekday; //memory.cpp uint4 rtc_read(uint4 addr); void rtc_write(uint4 addr, uint4 data); void load(const uint8* data); void save(uint8* data); //time.cpp static const unsigned daysinmonth[12]; void tick_second(); void tick_minute(); void tick_hour(); void tick_day(); void tick_month(); void tick_year(); unsigned calculate_weekday(unsigned year, unsigned month, unsigned day); }; extern SharpRTC sharprtc; fc/system/serialization.cpp000664 001750 001750 00000002312 12651764221 017203 0ustar00sergiosergio000000 000000 serializer System::serialize() { serializer s(serialize_size); unsigned signature = 0x31545342, version = Info::SerializerVersion; char hash[64], description[512]; memcpy(&hash, (const char*)cartridge.sha256(), 64); memset(&description, 0, sizeof description); s.integer(signature); s.integer(version); s.array(hash); s.array(description); serialize_all(s); return s; } bool System::unserialize(serializer& s) { unsigned signature, version; char hash[64], description[512]; s.integer(signature); s.integer(version); s.array(hash); s.array(description); if(signature != 0x31545342) return false; if(version != Info::SerializerVersion) return false; power(); serialize_all(s); return true; } void System::serialize(serializer& s) { } void System::serialize_all(serializer& s) { system.serialize(s); input.serialize(s); cartridge.serialize(s); cpu.serialize(s); apu.serialize(s); ppu.serialize(s); } void System::serialize_init() { serializer s; unsigned signature = 0, version = 0; char hash[64], description[512]; s.integer(signature); s.integer(version); s.array(hash); s.array(description); serialize_all(s); serialize_size = s.size(); } fc/cartridge/board/konami-vrc2.cpp000664 001750 001750 00000002452 12651764221 020172 0ustar00sergiosergio000000 000000 struct KonamiVRC2 : Board { struct Settings { struct Pinout { unsigned a0; unsigned a1; } pinout; } settings; VRC2 vrc2; uint8 prg_read(unsigned addr) { if(addr < 0x6000) return cpu.mdr(); if(addr < 0x8000) return vrc2.ram_read(addr); return prgrom.read(vrc2.prg_addr(addr)); } void prg_write(unsigned addr, uint8 data) { if(addr < 0x6000) return; if(addr < 0x8000) return vrc2.ram_write(addr, data); bool a0 = (addr & settings.pinout.a0); bool a1 = (addr & settings.pinout.a1); addr &= 0xfff0; addr |= (a0 << 0) | (a1 << 1); return vrc2.reg_write(addr, data); } uint8 chr_read(unsigned addr) { if(addr & 0x2000) return ppu.ciram_read(vrc2.ciram_addr(addr)); return Board::chr_read(vrc2.chr_addr(addr)); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) return ppu.ciram_write(vrc2.ciram_addr(addr), data); return Board::chr_write(vrc2.chr_addr(addr), data); } void power() { vrc2.power(); } void reset() { vrc2.reset(); } void serialize(serializer& s) { Board::serialize(s); vrc2.serialize(s); } KonamiVRC2(Markup::Node& document) : Board(document), vrc2(*this) { settings.pinout.a0 = 1 << decimal(document["cartridge"]["chip"]["pinout"]["a0"].data); settings.pinout.a1 = 1 << decimal(document["cartridge"]["chip"]["pinout"]["a1"].data); } }; phoenix/phoenix.cpp000664 001750 001750 00000000112 12651764221 015532 0ustar00sergiosergio000000 000000 #ifndef PHOENIX_CPP #define PHOENIX_CPP #include "core/core.cpp" #endif gb/cartridge/huc3/huc3.hpp000664 001750 001750 00000000340 12651764221 016456 0ustar00sergiosergio000000 000000 struct HuC3 : MMIO { bool ram_enable; //$0000-1fff uint8 rom_select; //$2000-3fff uint8 ram_select; //$4000-5fff uint8 mmio_read(uint16 addr); void mmio_write(uint16 addr, uint8 data); void power(); } huc3; fc/cartridge/board/nes-uxrom.cpp000664 001750 001750 00000002242 12651764221 017774 0ustar00sergiosergio000000 000000 //NES-UNROM //NES-UOROM struct NES_UxROM : Board { struct Settings { bool mirror; //0 = horizontal, 1 = vertical } settings; uint4 prg_bank; uint8 prg_read(unsigned addr) { if((addr & 0xc000) == 0x8000) return prgrom.read((prg_bank << 14) | (addr & 0x3fff)); if((addr & 0xc000) == 0xc000) return prgrom.read(( 0x0f << 14) | (addr & 0x3fff)); return cpu.mdr(); } void prg_write(unsigned addr, uint8 data) { if(addr & 0x8000) prg_bank = data & 0x0f; } uint8 chr_read(unsigned addr) { if(addr & 0x2000) { if(settings.mirror == 0) addr = ((addr & 0x0800) >> 1) | (addr & 0x03ff); return ppu.ciram_read(addr); } return Board::chr_read(addr); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) { if(settings.mirror == 0) addr = ((addr & 0x0800) >> 1) | (addr & 0x03ff); return ppu.ciram_write(addr, data); } return Board::chr_write(addr, data); } void power() { } void reset() { prg_bank = 0; } void serialize(serializer& s) { Board::serialize(s); s.integer(prg_bank); } NES_UxROM(Markup::Node& document) : Board(document) { settings.mirror = document["cartridge"]["mirror"]["mode"].data == "vertical" ? 1 : 0; } }; sfc/chip/dsp1/dsp1emu.hpp000664 001750 001750 00000012533 12651764221 016350 0ustar00sergiosergio000000 000000 // DSP-1's emulation code // // Based on research by Overload, The Dumper, Neviksti and Andreas Naive // Date: June 2006 #ifndef __DSP1EMUL_H #define __DSP1EMUL_H #define DSP1_VERSION 0x0102 class Dsp1 { public: // The DSP-1 status register has 16 bits, but only // the upper 8 bits can be accessed from an external device, so all these // positions are referred to the upper byte (bits D8 to D15) enum SrFlags {DRC=0x04, DRS=0x10, RQM=0x80}; // According to Overload's docs, these are the meanings of the flags: // DRC: The Data Register Control (DRC) bit specifies the data transfer length to and from the host CPU. // 0: Data transfer to and from the DSP-1 is 16 bits. // 1: Data transfer to and from the DSP-1 is 8 bits. // DRS: The Data Register Status (DRS) bit indicates the data transfer status in the case of transfering 16-bit data. // 0: Data transfer has terminated. // 1: Data transfer in progress. // RQM: The Request for Master (RQM) indicates that the DSP1 is requesting host CPU for data read/write. // 0: Internal Data Register Transfer. // 1: External Data Register Transfer. Dsp1(); uint8 getSr(); // return the status register's high byte uint8 getDr(); void setDr(uint8 iDr); void reset(); void serialize(serializer&); private: enum FsmMajorState {WAIT_COMMAND, READ_DATA, WRITE_DATA}; enum MaxDataAccesses {MAX_READS=7, MAX_WRITES=1024}; struct Command { void (Dsp1::*callback)(int16 *, int16 *); unsigned int reads; unsigned int writes; }; static const Command mCommandTable[]; static const int16 MaxAZS_Exp[16]; static const int16 SinTable[]; static const int16 MulTable[]; static const uint16 DataRom[]; struct SharedData { // some RAM variables shared between commands int16 MatrixA[3][3]; // attitude matrix A int16 MatrixB[3][3]; int16 MatrixC[3][3]; int16 CentreX, CentreY, CentreZ; // center of projection int16 CentreZ_C, CentreZ_E; int16 VOffset; // vertical offset of the screen with regard to the centre of projection int16 Les, C_Les, E_Les; int16 SinAas, CosAas; int16 SinAzs, CosAzs; int16 SinAZS, CosAZS; int16 SecAZS_C1, SecAZS_E1; int16 SecAZS_C2, SecAZS_E2; int16 Nx, Ny, Nz; // normal vector to the screen (norm 1, points toward the center of projection) int16 Gx, Gy, Gz; // center of the screen (global coordinates) int16 Hx, Hy; // horizontal vector of the screen (Hz=0, norm 1, points toward the right of the screen) int16 Vx, Vy, Vz; // vertical vector of the screen (norm 1, points toward the top of the screen) } shared; uint8 mSr; // status register int mSrLowByteAccess; uint16 mDr; // "internal" representation of the data register unsigned mFsmMajorState; // current major state of the FSM uint8 mCommand; // current command processed by the FSM uint8 mDataCounter; // #uint16 read/writes counter used by the FSM int16 mReadBuffer[MAX_READS]; int16 mWriteBuffer[MAX_WRITES]; bool mFreeze; // need explanation? ;) void fsmStep(bool read, uint8 &data); // FSM logic // commands void memoryTest(int16 *input, int16 *output); void memoryDump(int16 *input, int16 *output); void memorySize(int16 *input, int16 *output); void multiply(int16* input, int16* output); void multiply2(int16* input, int16* output); void inverse(int16 *input, int16 *output); void triangle(int16 *input, int16 *output); void radius(int16 *input, int16 *output); void range(int16 *input, int16 *output); void range2(int16 *input, int16 *output); void distance(int16 *input, int16 *output); void rotate(int16 *input, int16 *output); void polar(int16 *input, int16 *output); void attitudeA(int16 *input, int16 *output); void attitudeB(int16 *input, int16 *output); void attitudeC(int16 *input, int16 *output); void objectiveA(int16 *input, int16 *output); void objectiveB(int16 *input, int16 *output); void objectiveC(int16 *input, int16 *output); void subjectiveA(int16 *input, int16 *output); void subjectiveB(int16 *input, int16 *output); void subjectiveC(int16 *input, int16 *output); void scalarA(int16 *input, int16 *output); void scalarB(int16 *input, int16 *output); void scalarC(int16 *input, int16 *output); void gyrate(int16 *input, int16 *output); void parameter(int16 *input, int16 *output); void raster(int16 *input, int16 *output); void target(int16 *input, int16 *output); void project(int16 *input, int16 *output); // auxiliar functions int16 sin(int16 Angle); int16 cos(int16 Angle); void inverse(int16 Coefficient, int16 Exponent, int16 &iCoefficient, int16 &iExponent); int16 denormalizeAndClip(int16 C, int16 E); void normalize(int16 m, int16 &Coefficient, int16 &Exponent); void normalizeDouble(int32 Product, int16 &Coefficient, int16 &Exponent); int16 shiftR(int16 C, int16 E); }; #endif ananke/heuristics/super-famicom.hpp000664 001750 001750 00000056707 12651764221 020626 0ustar00sergiosergio000000 000000 #ifndef NALL_EMULATION_SUPER_FAMICOM_HPP #define NALL_EMULATION_SUPER_FAMICOM_HPP #include #include namespace nall { struct SuperFamicomCartridge { string markup; inline SuperFamicomCartridge(const uint8_t *data, unsigned size); //private: inline void read_header(const uint8_t *data, unsigned size); inline unsigned find_header(const uint8_t *data, unsigned size); inline unsigned score_header(const uint8_t *data, unsigned size, unsigned addr); enum HeaderField { CartName = 0x00, Mapper = 0x15, RomType = 0x16, RomSize = 0x17, RamSize = 0x18, CartRegion = 0x19, Company = 0x1a, Version = 0x1b, Complement = 0x1c, //inverse checksum Checksum = 0x1e, ResetVector = 0x3c, }; enum Mode { ModeNormal, ModeBsxSlotted, ModeBsx, ModeSufamiTurbo, ModeSuperGameBoy, }; enum Type { TypeNormal, TypeBsxSlotted, TypeBsxBios, TypeBsx, TypeSufamiTurboBios, TypeSufamiTurbo, TypeSuperGameBoy1Bios, TypeSuperGameBoy2Bios, TypeGameBoy, TypeUnknown, }; enum Region { NTSC, PAL, }; enum MemoryMapper { LoROM, HiROM, ExLoROM, ExHiROM, SuperFXROM, SA1ROM, SPC7110ROM, BSCLoROM, BSCHiROM, BSXROM, STROM, }; enum DSP1MemoryMapper { DSP1Unmapped, DSP1LoROM1MB, DSP1LoROM2MB, DSP1HiROM, }; bool loaded; //is a base cartridge inserted? unsigned crc32; //crc32 of all cartridges (base+slot(s)) unsigned rom_size; unsigned ram_size; bool firmware_appended; //true if firmware is appended to end of ROM data Mode mode; Type type; Region region; MemoryMapper mapper; DSP1MemoryMapper dsp1_mapper; bool has_bsx_slot; bool has_superfx; bool has_sa1; bool has_sharprtc; bool has_epsonrtc; bool has_sdd1; bool has_spc7110; bool has_cx4; bool has_dsp1; bool has_dsp2; bool has_dsp3; bool has_dsp4; bool has_obc1; bool has_st010; bool has_st011; bool has_st018; }; SuperFamicomCartridge::SuperFamicomCartridge(const uint8_t *data, unsigned size) { firmware_appended = false; //skip copier header if((size & 0x7fff) == 512) data += 512, size -= 512; markup = ""; if(size < 0x8000) return; read_header(data, size); markup = ""; if(type == TypeGameBoy) return; if(type == TypeBsx) return; if(type == TypeSufamiTurbo) return; const char *range = (rom_size > 0x200000) || (ram_size > 32 * 1024) ? "0000-7fff" : "0000-ffff"; markup.append("cartridge region=", region == NTSC ? "NTSC" : "PAL", "\n"); if(type == TypeSuperGameBoy1Bios || type == TypeSuperGameBoy2Bios) { markup.append( " rom name=program.rom size=0x", hex(rom_size), "\n" " map id=rom address=00-7f,80-ff:8000-ffff mask=0x8000\n" " icd2 revision=1\n" " rom name=sgb.boot.rom size=0x100\n" " map id=io address=00-3f,80-bf:6000-7fff\n" ); if((rom_size & 0x7fff) == 0x100) { firmware_appended = true; rom_size -= 0x100; } } else if(has_cx4) { markup.append( " hitachidsp model=HG51B169 frequency=20000000\n" " rom id=program name=program.rom size=0x", hex(rom_size), "\n" " rom id=data name=cx4.data.rom size=0xc00\n" " ram id=data size=0xc00\n" " map id=io address=00-3f,80-bf:6000-7fff\n" " map id=rom address=00-7f,80-ff:8000-ffff mask=0x8000\n" " map id=ram address=70-77:0000-7fff\n" ); if((rom_size & 0x7fff) == 0xc00) { firmware_appended = true; rom_size -= 0xc00; } } else if(has_spc7110) { markup.append( " spc7110\n" " rom id=program name=program.rom size=0x100000\n" " rom id=data name=data.rom size=0x", hex(rom_size - 0x100000), "\n" " ram name=save.ram size=0x", hex(ram_size), "\n" " map id=io address=00-3f,80-bf:4800-483f\n" " map id=io address=50:0000-ffff\n" " map id=rom address=00-3f,80-bf:8000-ffff\n" " map id=rom address=c0-ff:0000-ffff\n" " map id=ram address=00-3f,80-bf:6000-7fff mask=0xe000\n" ); } else if(has_sdd1) { markup.append( " sdd1\n" " rom name=program.rom size=0x", hex(rom_size), "\n" ); if(ram_size > 0) markup.append( " ram name=save.ram size=0x", hex(ram_size), "\n" ); markup.append( " map id=io address=00-3f,80-bf:4800-4807\n" " map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000\n" " map id=rom address=c0-ff:0000-ffff\n" ); if(ram_size > 0) markup.append( " map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000\n" " map id=ram address=70-7f:0000-7fff\n" ); } else if(mapper == LoROM) { markup.append( " rom name=program.rom size=0x", hex(rom_size), "\n" ); if(ram_size > 0) markup.append( " ram name=save.ram size=0x", hex(ram_size), "\n" ); markup.append( " map id=rom address=00-7f,80-ff:8000-ffff mask=0x8000\n" ); if(ram_size > 0) markup.append( " map id=ram address=70-7f,f0-ff:", range, "\n" ); } else if(mapper == HiROM) { markup.append( " rom name=program.rom size=0x", hex(rom_size), "\n" ); if(ram_size > 0) markup.append( " ram name=save.ram size=0x", hex(ram_size), "\n" ); markup.append( " map id=rom address=00-3f,80-bf:8000-ffff\n" " map id=rom address=40-7f,c0-ff:0000-ffff\n" ); if(ram_size > 0) markup.append( " map id=ram address=10-3f,90-bf:6000-7fff mask=0xe000\n" ); } else if(mapper == ExLoROM) { markup.append( " rom name=program.rom size=0x", hex(rom_size), "\n" ); if(ram_size > 0) markup.append( " ram name=save.ram size=0x", hex(ram_size), "\n" ); markup.append( " map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000\n" " map id=rom address=40-7f:0000-ffff\n" ); if(ram_size > 0) markup.append( " map id=ram address=20-3f,a0-bf:6000-7fff\n" " map id=ram address=70-7f:0000-7fff\n" ); } else if(mapper == ExHiROM) { markup.append( " rom name=program.rom size=0x", hex(rom_size), "\n" ); if(ram_size > 0) markup.append( " ram name=save.ram size=0x", hex(ram_size), "\n" ); markup.append( " map id=rom address=00-3f:8000-ffff base=0x400000\n" " map id=rom address=40-7f:0000-ffff base=0x400000\n" " map id=rom address=80-bf:8000-ffff mask=0xc00000\n" " map id=rom address=c0-ff:0000-ffff mask=0xc00000\n" ); if(ram_size > 0) markup.append( " map id=ram address=20-3f,a0-bf:6000-7fff mask=0xe000\n" " map id=ram address=70-7f:", range, "\n" ); } else if(mapper == SuperFXROM) { markup.append( " superfx revision=3\n" " rom name=program.rom size=0x", hex(rom_size), "\n" ); if(ram_size > 0) markup.append( " ram name=save.ram size=0x", hex(ram_size), "\n" ); markup.append( " map id=io address=00-3f,80-bf:3000-32ff\n" " map id=rom address=00-3f,80-bf:8000-ffff mask=0x8000\n" " map id=rom address=40-5f,c0-df:0000-ffff\n" ); if(ram_size > 0) markup.append( " map id=ram address=00-3f,80-bf:6000-7fff size=0x2000\n" " map id=ram address=70-71,f0-f1:0000-ffff\n" ); } else if(mapper == SA1ROM) { markup.append( " sa1\n" " rom name=program.rom size=0x", hex(rom_size), "\n" ); if(ram_size > 0) markup.append( " ram id=bitmap name=save.ram size=0x", hex(ram_size), "\n" ); markup.append( " ram id=internal size=0x800\n" " map id=io address=00-3f,80-bf:2200-23ff\n" " map id=rom address=00-3f,80-bf:8000-ffff\n" " map id=rom address=c0-ff:0000-ffff\n" ); if(ram_size > 0) markup.append( " map id=bwram address=00-3f,80-bf:6000-7fff\n" " map id=bwram address=40-4f:0000-ffff\n" ); markup.append( " map id=iram address=00-3f,80-bf:3000-37ff\n" ); } else if(mapper == BSCLoROM) { markup.append( " rom name=program.rom size=0x", hex(rom_size), "\n" " ram name=save.ram size=0x", hex(ram_size), "\n" " map id=rom address=00-1f:8000-ffff base=0x000000 mask=0x8000\n" " map id=rom address=20-3f:8000-ffff base=0x100000 mask=0x8000\n" " map id=rom address=80-9f:8000-ffff base=0x200000 mask=0x8000\n" " map id=rom address=a0-bf:8000-ffff base=0x100000 mask=0x8000\n" " map id=ram address=70-7f,f0-ff:0000-7fff\n" " bsxslot\n" " map id=rom address=c0-ef:0000-ffff\n" ); } else if(mapper == BSCHiROM) { markup.append( " rom name=program.rom size=0x", hex(rom_size), "\n" " ram name=save.ram size=0x", hex(ram_size), "\n" " map id=rom address=00-1f,80-9f:8000-ffff\n" " map id=rom address=40-5f,c0-df:0000-ffff\n" " map id=ram address=20-3f,a0-bf:6000-7fff\n" " bsxslot\n" " map id=rom address=20-3f,a0-bf:8000-ffff\n" " map id=rom address=60-7f,e0-ff:0000-ffff\n" ); } else if(mapper == BSXROM) { markup.append( " bsx\n" " rom name=program.rom size=0x", hex(rom_size), "\n" " ram id=save name=save.ram size=0x", hex(ram_size), "\n" " ram id=download name=bsx.ram size=0x40000\n" " map id=io address=00-3f,80-bf:5000-5fff\n" " map id=rom address=00-3f,80-bf:8000-ffff\n" " map id=rom address=40-7f,c0-ff:0000-ffff\n" " map id=ram address=20-3f:6000-7fff\n" ); } else if(mapper == STROM) { markup.append( " rom name=program.rom size=0x", hex(rom_size), "\n" " map id=rom address='00-1f,80-9f:8000-ffff mask=0x8000\n" " sufamiturbo\n" " slot id=A\n" " map id=rom address=20-3f,a0-bf:8000-ffff mask=0x8000\n" " map id=ram address=60-63,e0-e3:8000-ffff\n" " slot id=B\n" " map id=rom address=40-5f,c0-df:8000-ffff mask=0x8000\n" " map id=ram address=70-73,f0-f3:8000-ffff\n" ); } if(has_sharprtc) { markup.append( " sharprtc\n" " ram name=rtc.ram size=0x10\n" " map id=io address=00-3f,80-bf:2800-2801\n" ); } if(has_epsonrtc) { markup.append( " epsonrtc\n" " ram name=rtc.ram size=0x10\n" " map id=io address=00-3f,80-bf:4840-4842\n" ); } if(has_obc1) { markup.append( " obc1\n" " ram name=save.ram size=0x2000\n" " map id=io address=00-3f,80-bf:6000-7fff\n" ); } if(has_dsp1) { markup.append( " necdsp model=uPD7725 frequency=8000000\n" " rom id=program name=dsp1b.program.rom size=0x1800\n" " rom id=data name=dsp1b.data.rom size=0x800\n" " ram id=data size=0x200\n" ); if(dsp1_mapper == DSP1LoROM1MB) markup.append( " map id=io address=20-3f,a0-bf:8000-ffff select=0x4000\n" ); if(dsp1_mapper == DSP1LoROM2MB) markup.append( " map id=io address=60-6f,e0-ef:0000-7fff select=0x4000\n" ); if(dsp1_mapper == DSP1HiROM) markup.append( " map id=io address=00-1f,80-9f:6000-7fff select=0x1000\n" ); if((size & 0x7fff) == 0x2000) { firmware_appended = true; rom_size -= 0x2000; } } if(has_dsp2) { markup.append( " necdsp model=uPD7725 frequency=8000000\n" " rom id=program name=dsp2.program.rom size=0x1800\n" " rom id=data name=dsp2.data.rom size=0x800\n" " ram id=data size=0x200\n" " map id=io address=20-3f,a0-bf:8000-ffff select=0x4000\n" ); if((size & 0x7fff) == 0x2000) { firmware_appended = true; rom_size -= 0x2000; } } if(has_dsp3) { markup.append( " necdsp model=uPD7725 frequency=8000000\n" " rom id=program name=dsp3.program.rom size=0x1800\n" " rom id=data name=dsp3.data.rom size=0x800\n" " ram id=data size=0x200\n" " map id=io address=20-3f,a0-bf:8000-ffff select=0x4000\n" ); if((size & 0x7fff) == 0x2000) { firmware_appended = true; rom_size -= 0x2000; } } if(has_dsp4) { markup.append( " necdsp model=uPD7725 frequency=8000000\n" " rom id=program name=dsp4.program.rom size=0x1800\n" " rom id=data name=dsp4.data.rom size=0x800\n" " ram id=data size=0x200\n" " map id=io address=30-3f,b0-bf:8000-ffff select=0x4000\n" ); if((size & 0x7fff) == 0x2000) { firmware_appended = true; rom_size -= 0x2000; } } if(has_st010) { markup.append( " necdsp model=uPD96050 frequency=11000000\n" " rom id=program name=st010.program.rom size=0xc000\n" " rom id=data name=st010.data.rom size=0x1000\n" " ram id=data name=save.ram size=0x1000\n" " map id=io address=60-67,e0-e7:0000-3fff select=0x0001\n" " map id=ram address=68-6f,e8-ef:0000-7fff\n" ); if((size & 0xffff) == 0xd000) { firmware_appended = true; rom_size -= 0xd000; } } if(has_st011) { markup.append( " necdsp model=uPD96050 frequency=15000000\n" " rom id=program name=st011.program.rom size=0xc000\n" " rom id=data name=st011.data.rom size=0x1000\n" " ram id=data name=save.ram size=0x1000\n" " map id=io address=60-67,e0-e7:0000-3fff select=0x0001\n" " map id=ram address=68-6f,e8-ef:0000-7fff\n" ); if((size & 0xffff) == 0xd000) { firmware_appended = true; rom_size -= 0xd000; } } if(has_st018) { markup.append( " armdsp frequency=21477272\n" " rom id=program name=st018.program.rom size=0x20000\n" " rom id=data name=st018.data.rom size=0x8000\n" " ram name=save.ram size=0x4000\n" " map id=io address=00-3f,80-bf:3800-38ff\n" ); if((size & 0x3ffff) == 0x28000) { firmware_appended = true; rom_size -= 0x28000; } } } void SuperFamicomCartridge::read_header(const uint8_t *data, unsigned size) { type = TypeUnknown; mapper = LoROM; dsp1_mapper = DSP1Unmapped; region = NTSC; rom_size = size; ram_size = 0; has_bsx_slot = false; has_superfx = false; has_sa1 = false; has_sharprtc = false; has_epsonrtc = false; has_sdd1 = false; has_spc7110 = false; has_cx4 = false; has_dsp1 = false; has_dsp2 = false; has_dsp3 = false; has_dsp4 = false; has_obc1 = false; has_st010 = false; has_st011 = false; has_st018 = false; //===================== //detect Game Boy carts //===================== if(size >= 0x0140) { if(data[0x0104] == 0xce && data[0x0105] == 0xed && data[0x0106] == 0x66 && data[0x0107] == 0x66 && data[0x0108] == 0xcc && data[0x0109] == 0x0d && data[0x010a] == 0x00 && data[0x010b] == 0x0b) { type = TypeGameBoy; return; } } if(size < 32768) { type = TypeUnknown; return; } const unsigned index = find_header(data, size); const uint8_t mapperid = data[index + Mapper]; const uint8_t rom_type = data[index + RomType]; const uint8_t rom_size = data[index + RomSize]; const uint8_t company = data[index + Company]; const uint8_t regionid = data[index + CartRegion] & 0x7f; ram_size = 1024 << (data[index + RamSize] & 7); if(ram_size == 1024) ram_size = 0; //no RAM present if(rom_size == 0 && ram_size) ram_size = 0; //fix for Bazooka Blitzkrieg's malformed header (swapped ROM and RAM sizes) //0, 1, 13 = NTSC; 2 - 12 = PAL region = (regionid <= 1 || regionid >= 13) ? NTSC : PAL; //======================= //detect BS-X flash carts //======================= if(data[index + 0x13] == 0x00 || data[index + 0x13] == 0xff) { if(data[index + 0x14] == 0x00) { const uint8_t n15 = data[index + 0x15]; if(n15 == 0x00 || n15 == 0x80 || n15 == 0x84 || n15 == 0x9c || n15 == 0xbc || n15 == 0xfc) { if(data[index + 0x1a] == 0x33 || data[index + 0x1a] == 0xff) { type = TypeBsx; mapper = BSXROM; region = NTSC; //BS-X only released in Japan return; } } } } //========================= //detect Sufami Turbo carts //========================= if(!memcmp(data, "BANDAI SFC-ADX", 14)) { if(!memcmp(data + 16, "SFC-ADX BACKUP", 14)) { type = TypeSufamiTurboBios; } else { type = TypeSufamiTurbo; } mapper = STROM; region = NTSC; //Sufami Turbo only released in Japan return; //RAM size handled outside this routine } //========================== //detect Super Game Boy BIOS //========================== if(!memcmp(data + index, "Super GAMEBOY2", 14)) { type = TypeSuperGameBoy2Bios; return; } if(!memcmp(data + index, "Super GAMEBOY", 13)) { type = TypeSuperGameBoy1Bios; return; } //===================== //detect standard carts //===================== //detect presence of BS-X flash cartridge connector (reads extended header information) if(data[index - 14] == 'Z') { if(data[index - 11] == 'J') { uint8_t n13 = data[index - 13]; if((n13 >= 'A' && n13 <= 'Z') || (n13 >= '0' && n13 <= '9')) { if(company == 0x33 || (data[index - 10] == 0x00 && data[index - 4] == 0x00)) { has_bsx_slot = true; } } } } if(has_bsx_slot) { if(!memcmp(data + index, "Satellaview BS-X ", 21)) { //BS-X base cart type = TypeBsxBios; mapper = BSXROM; region = NTSC; //BS-X only released in Japan return; //RAM size handled internally by load_cart_bsx() -> BSXCart class } else { type = TypeBsxSlotted; mapper = (index == 0x7fc0 ? BSCLoROM : BSCHiROM); region = NTSC; //BS-X slotted cartridges only released in Japan } } else { //standard cart type = TypeNormal; if(index == 0x7fc0 && size >= 0x401000) { mapper = ExLoROM; } else if(index == 0x7fc0 && mapperid == 0x32) { mapper = ExLoROM; } else if(index == 0x7fc0) { mapper = LoROM; } else if(index == 0xffc0) { mapper = HiROM; } else { //index == 0x40ffc0 mapper = ExHiROM; } } if(mapperid == 0x20 && (rom_type == 0x13 || rom_type == 0x14 || rom_type == 0x15 || rom_type == 0x1a)) { has_superfx = true; mapper = SuperFXROM; ram_size = 1024 << (data[index - 3] & 7); if(ram_size == 1024) ram_size = 0; } if(mapperid == 0x23 && (rom_type == 0x32 || rom_type == 0x34 || rom_type == 0x35)) { has_sa1 = true; mapper = SA1ROM; } if(mapperid == 0x35 && rom_type == 0x55) { has_sharprtc = true; } if(mapperid == 0x32 && (rom_type == 0x43 || rom_type == 0x45)) { has_sdd1 = true; } if(mapperid == 0x3a && (rom_type == 0xf5 || rom_type == 0xf9)) { has_spc7110 = true; has_epsonrtc = (rom_type == 0xf9); mapper = SPC7110ROM; } if(mapperid == 0x20 && rom_type == 0xf3) { has_cx4 = true; } if((mapperid == 0x20 || mapperid == 0x21) && rom_type == 0x03) { has_dsp1 = true; } if(mapperid == 0x30 && rom_type == 0x05 && company != 0xb2) { has_dsp1 = true; } if(mapperid == 0x31 && (rom_type == 0x03 || rom_type == 0x05)) { has_dsp1 = true; } if(has_dsp1 == true) { if((mapperid & 0x2f) == 0x20 && size <= 0x100000) { dsp1_mapper = DSP1LoROM1MB; } else if((mapperid & 0x2f) == 0x20) { dsp1_mapper = DSP1LoROM2MB; } else if((mapperid & 0x2f) == 0x21) { dsp1_mapper = DSP1HiROM; } } if(mapperid == 0x20 && rom_type == 0x05) { has_dsp2 = true; } if(mapperid == 0x30 && rom_type == 0x05 && company == 0xb2) { has_dsp3 = true; } if(mapperid == 0x30 && rom_type == 0x03) { has_dsp4 = true; } if(mapperid == 0x30 && rom_type == 0x25) { has_obc1 = true; } if(mapperid == 0x30 && rom_type == 0xf6 && rom_size >= 10) { has_st010 = true; } if(mapperid == 0x30 && rom_type == 0xf6 && rom_size < 10) { has_st011 = true; } if(mapperid == 0x30 && rom_type == 0xf5) { has_st018 = true; } } unsigned SuperFamicomCartridge::find_header(const uint8_t *data, unsigned size) { unsigned score_lo = score_header(data, size, 0x007fc0); unsigned score_hi = score_header(data, size, 0x00ffc0); unsigned score_ex = score_header(data, size, 0x40ffc0); if(score_ex) score_ex += 4; //favor ExHiROM on images > 32mbits if(score_lo >= score_hi && score_lo >= score_ex) { return 0x007fc0; } else if(score_hi >= score_ex) { return 0x00ffc0; } else { return 0x40ffc0; } } unsigned SuperFamicomCartridge::score_header(const uint8_t *data, unsigned size, unsigned addr) { if(size < addr + 64) return 0; //image too small to contain header at this location? int score = 0; uint16_t resetvector = data[addr + ResetVector] | (data[addr + ResetVector + 1] << 8); uint16_t checksum = data[addr + Checksum ] | (data[addr + Checksum + 1] << 8); uint16_t complement = data[addr + Complement ] | (data[addr + Complement + 1] << 8); uint8_t resetop = data[(addr & ~0x7fff) | (resetvector & 0x7fff)]; //first opcode executed upon reset uint8_t mapper = data[addr + Mapper] & ~0x10; //mask off irrelevent FastROM-capable bit //$00:[000-7fff] contains uninitialized RAM and MMIO. //reset vector must point to ROM at $00:[8000-ffff] to be considered valid. if(resetvector < 0x8000) return 0; //some images duplicate the header in multiple locations, and others have completely //invalid header information that cannot be relied upon. //below code will analyze the first opcode executed at the specified reset vector to //determine the probability that this is the correct header. //most likely opcodes if(resetop == 0x78 //sei || resetop == 0x18 //clc (clc; xce) || resetop == 0x38 //sec (sec; xce) || resetop == 0x9c //stz $nnnn (stz $4200) || resetop == 0x4c //jmp $nnnn || resetop == 0x5c //jml $nnnnnn ) score += 8; //plausible opcodes if(resetop == 0xc2 //rep #$nn || resetop == 0xe2 //sep #$nn || resetop == 0xad //lda $nnnn || resetop == 0xae //ldx $nnnn || resetop == 0xac //ldy $nnnn || resetop == 0xaf //lda $nnnnnn || resetop == 0xa9 //lda #$nn || resetop == 0xa2 //ldx #$nn || resetop == 0xa0 //ldy #$nn || resetop == 0x20 //jsr $nnnn || resetop == 0x22 //jsl $nnnnnn ) score += 4; //implausible opcodes if(resetop == 0x40 //rti || resetop == 0x60 //rts || resetop == 0x6b //rtl || resetop == 0xcd //cmp $nnnn || resetop == 0xec //cpx $nnnn || resetop == 0xcc //cpy $nnnn ) score -= 4; //least likely opcodes if(resetop == 0x00 //brk #$nn || resetop == 0x02 //cop #$nn || resetop == 0xdb //stp || resetop == 0x42 //wdm || resetop == 0xff //sbc $nnnnnn,x ) score -= 8; //at times, both the header and reset vector's first opcode will match ... //fallback and rely on info validity in these cases to determine more likely header. //a valid checksum is the biggest indicator of a valid header. if((checksum + complement) == 0xffff && (checksum != 0) && (complement != 0)) score += 4; if(addr == 0x007fc0 && mapper == 0x20) score += 2; //0x20 is usually LoROM if(addr == 0x00ffc0 && mapper == 0x21) score += 2; //0x21 is usually HiROM if(addr == 0x007fc0 && mapper == 0x22) score += 2; //0x22 is usually ExLoROM if(addr == 0x40ffc0 && mapper == 0x25) score += 2; //0x25 is usually ExHiROM if(data[addr + Company] == 0x33) score += 2; //0x33 indicates extended header if(data[addr + RomType] < 0x08) score++; if(data[addr + RomSize] < 0x10) score++; if(data[addr + RamSize] < 0x08) score++; if(data[addr + CartRegion] < 14) score++; if(score < 0) score = 0; return score; } } #endif gba/apu/wave.cpp000664 001750 001750 00000004037 12651764221 014700 0ustar00sergiosergio000000 000000 void APU::Wave::run() { if(period && --period == 0) { period = 1 * (2048 - frequency); patternsample = pattern[patternbank * 16 + patternaddr++]; if(patternaddr == 0) patternbank ^= mode; } output = patternsample; static unsigned multiplier[] = {0, 4, 2, 1, 3, 3, 3, 3}; output = (output * multiplier[volume]) / 4; if(enable == false) output = 0; } void APU::Wave::clocklength() { if(enable && counter) { if(++length == 0) enable = false; } } uint8 APU::Wave::read(unsigned addr) const { switch(addr) { case 0: return (mode << 5) | (bank << 6) | (dacenable << 7); case 1: return (length << 0); case 2: return (volume << 5); case 3: return (frequency >> 0); case 4: return (frequency >> 8) | (counter << 6) | (initialize << 7); } } void APU::Wave::write(unsigned addr, uint8 byte) { switch(addr) { case 0: //NR30 mode = byte >> 5; bank = byte >> 6; dacenable = byte >> 7; if(dacenable == false) enable = false; break; case 1: //NR31 length = byte >> 0; break; case 2: //NR32 volume = byte >> 5; break; case 3: //NR33 frequency = (frequency & 0xff00) | (byte << 0); break; case 4: //NR34 frequency = (frequency & 0x00ff) | (byte << 8); counter = byte >> 6; initialize = byte >> 7; if(initialize) { enable = dacenable; period = 1 * (2048 - frequency); patternaddr = 0; patternbank = mode ? (uint1)0 : bank; } break; } } uint8 APU::Wave::readram(unsigned addr) const { uint8 byte = 0; byte |= pattern[addr * 2 + 0] << 0; byte |= pattern[addr * 2 + 1] << 4; return byte; } void APU::Wave::writeram(unsigned addr, uint8 byte) { pattern[addr * 2 + 0] = byte >> 0; pattern[addr * 2 + 1] = byte >> 4; } void APU::Wave::power() { mode = 0; bank = 0; dacenable = 0; length = 0; volume = 0; frequency = 0; counter = 0; initialize = 0; for(auto& sample : pattern) sample = 0; enable = 0; output = 0; patternaddr = 0; patternbank = 0; patternsample = 0; period = 0; } data/higan.Manifest000664 001750 001750 00000000745 12651764221 015405 0ustar00sergiosergio000000 000000 phoenix/cocoa/monitor.cpp000664 001750 001750 00000000733 12651764221 016644 0ustar00sergiosergio000000 000000 namespace phoenix { unsigned pMonitor::count() { @autoreleasepool { return [[NSScreen screens] count]; } } Geometry pMonitor::geometry(unsigned monitor) { @autoreleasepool { NSRect rectangle = [[[NSScreen screens] objectAtIndex:monitor] frame]; return {rectangle.origin.x, rectangle.origin.y, rectangle.size.width, rectangle.size.height}; } } unsigned pMonitor::primary() { //on OS X, the primary monitor is always the first monitor return 0; } } processor/spc700/registers.hpp000664 001750 001750 00000003063 12651764221 017465 0ustar00sergiosergio000000 000000 struct flag_t { bool n, v, p, b, h, i, z, c; inline operator unsigned() const { return (n << 7) | (v << 6) | (p << 5) | (b << 4) | (h << 3) | (i << 2) | (z << 1) | (c << 0); } inline unsigned operator=(uint8 data) { n = data & 0x80; v = data & 0x40; p = data & 0x20; b = data & 0x10; h = data & 0x08; i = data & 0x04; z = data & 0x02; c = data & 0x01; return data; } inline unsigned operator|=(uint8 data) { return operator=(operator unsigned() | data); } inline unsigned operator^=(uint8 data) { return operator=(operator unsigned() ^ data); } inline unsigned operator&=(uint8 data) { return operator=(operator unsigned() & data); } }; struct word_t { union { uint16 w; struct { uint8 order_lsb2(l, h); }; }; inline operator unsigned() const { return w; } inline unsigned operator=(unsigned data) { return w = data; } inline unsigned operator++() { return ++w; } inline unsigned operator--() { return --w; } inline unsigned operator++(int) { unsigned data = w++; return data; } inline unsigned operator--(int) { unsigned data = w--; return data; } inline unsigned operator+=(unsigned data) { return w += data;; } inline unsigned operator-=(unsigned data) { return w -= data;; } inline unsigned operator|=(unsigned data) { return w |= data; } inline unsigned operator^=(unsigned data) { return w ^= data; } inline unsigned operator&=(unsigned data) { return w &= data; } }; struct regs_t { word_t pc; union { uint16 ya; struct { uint8 order_lsb2(a, y); }; }; uint8 x, s; flag_t p; }; sfc/chip/sdd1/decomp.cpp000664 001750 001750 00000016466 12651764221 016231 0ustar00sergiosergio000000 000000 //S-DD1 decompression algorithm implementation //original code written by Andreas Naive (public domain license) //bsnes port written by byuu //note: decompression module does not need to be serialized with bsnes //this is because decompression only runs during DMA, and bsnes will complete //any pending DMA transfers prior to serialization. //input manager void SDD1::Decomp::IM::init(unsigned offset_) { offset = offset_; bit_count = 4; } uint8 SDD1::Decomp::IM::get_codeword(uint8 code_length) { uint8 codeword; uint8 comp_count; codeword = sdd1.mmc_read(offset) << bit_count; bit_count++; if(codeword & 0x80) { codeword |= sdd1.mmc_read(offset + 1) >> (9 - bit_count); bit_count += code_length; } if(bit_count & 0x08) { offset++; bit_count &= 0x07; } return codeword; } //golomb-code decoder const uint8 SDD1::Decomp::GCD::run_count[] = { 0x00, 0x00, 0x01, 0x00, 0x03, 0x01, 0x02, 0x00, 0x07, 0x03, 0x05, 0x01, 0x06, 0x02, 0x04, 0x00, 0x0f, 0x07, 0x0b, 0x03, 0x0d, 0x05, 0x09, 0x01, 0x0e, 0x06, 0x0a, 0x02, 0x0c, 0x04, 0x08, 0x00, 0x1f, 0x0f, 0x17, 0x07, 0x1b, 0x0b, 0x13, 0x03, 0x1d, 0x0d, 0x15, 0x05, 0x19, 0x09, 0x11, 0x01, 0x1e, 0x0e, 0x16, 0x06, 0x1a, 0x0a, 0x12, 0x02, 0x1c, 0x0c, 0x14, 0x04, 0x18, 0x08, 0x10, 0x00, 0x3f, 0x1f, 0x2f, 0x0f, 0x37, 0x17, 0x27, 0x07, 0x3b, 0x1b, 0x2b, 0x0b, 0x33, 0x13, 0x23, 0x03, 0x3d, 0x1d, 0x2d, 0x0d, 0x35, 0x15, 0x25, 0x05, 0x39, 0x19, 0x29, 0x09, 0x31, 0x11, 0x21, 0x01, 0x3e, 0x1e, 0x2e, 0x0e, 0x36, 0x16, 0x26, 0x06, 0x3a, 0x1a, 0x2a, 0x0a, 0x32, 0x12, 0x22, 0x02, 0x3c, 0x1c, 0x2c, 0x0c, 0x34, 0x14, 0x24, 0x04, 0x38, 0x18, 0x28, 0x08, 0x30, 0x10, 0x20, 0x00, 0x7f, 0x3f, 0x5f, 0x1f, 0x6f, 0x2f, 0x4f, 0x0f, 0x77, 0x37, 0x57, 0x17, 0x67, 0x27, 0x47, 0x07, 0x7b, 0x3b, 0x5b, 0x1b, 0x6b, 0x2b, 0x4b, 0x0b, 0x73, 0x33, 0x53, 0x13, 0x63, 0x23, 0x43, 0x03, 0x7d, 0x3d, 0x5d, 0x1d, 0x6d, 0x2d, 0x4d, 0x0d, 0x75, 0x35, 0x55, 0x15, 0x65, 0x25, 0x45, 0x05, 0x79, 0x39, 0x59, 0x19, 0x69, 0x29, 0x49, 0x09, 0x71, 0x31, 0x51, 0x11, 0x61, 0x21, 0x41, 0x01, 0x7e, 0x3e, 0x5e, 0x1e, 0x6e, 0x2e, 0x4e, 0x0e, 0x76, 0x36, 0x56, 0x16, 0x66, 0x26, 0x46, 0x06, 0x7a, 0x3a, 0x5a, 0x1a, 0x6a, 0x2a, 0x4a, 0x0a, 0x72, 0x32, 0x52, 0x12, 0x62, 0x22, 0x42, 0x02, 0x7c, 0x3c, 0x5c, 0x1c, 0x6c, 0x2c, 0x4c, 0x0c, 0x74, 0x34, 0x54, 0x14, 0x64, 0x24, 0x44, 0x04, 0x78, 0x38, 0x58, 0x18, 0x68, 0x28, 0x48, 0x08, 0x70, 0x30, 0x50, 0x10, 0x60, 0x20, 0x40, 0x00, }; void SDD1::Decomp::GCD::get_run_count(uint8 code_number, uint8& mps_count, bool& lps_index) { uint8 codeword = self.im.get_codeword(code_number); if(codeword & 0x80) { lps_index = 1; mps_count = run_count[codeword >> (code_number ^ 0x07)]; } else { mps_count = 1 << code_number; } } //bits generator void SDD1::Decomp::BG::init() { mps_count = 0; lps_index = 0; } uint8 SDD1::Decomp::BG::get_bit(bool& end_of_run) { if(!(mps_count || lps_index)) self.gcd.get_run_count(code_number, mps_count, lps_index); uint8 bit; if(mps_count) { bit = 0; mps_count--; } else { bit = 1; lps_index = 0; } end_of_run = !(mps_count || lps_index); return bit; } //probability estimation module const SDD1::Decomp::PEM::State SDD1::Decomp::PEM::evolution_table[33] = { {0, 25, 25}, {0, 2, 1}, {0, 3, 1}, {0, 4, 2}, {0, 5, 3}, {1, 6, 4}, {1, 7, 5}, {1, 8, 6}, {1, 9, 7}, {2, 10, 8}, {2, 11, 9}, {2, 12, 10}, {2, 13, 11}, {3, 14, 12}, {3, 15, 13}, {3, 16, 14}, {3, 17, 15}, {4, 18, 16}, {4, 19, 17}, {5, 20, 18}, {5, 21, 19}, {6, 22, 20}, {6, 23, 21}, {7, 24, 22}, {7, 24, 23}, {0, 26, 1}, {1, 27, 2}, {2, 28, 4}, {3, 29, 8}, {4, 30, 12}, {5, 31, 16}, {6, 32, 18}, {7, 24, 22}, }; void SDD1::Decomp::PEM::init() { for(unsigned i = 0; i < 32; i++) { context_info[i].status = 0; context_info[i].mps = 0; } } uint8 SDD1::Decomp::PEM::get_bit(uint8 context) { ContextInfo& info = context_info[context]; uint8 current_status = info.status; uint8 current_mps = info.mps; const State& s = SDD1::Decomp::PEM::evolution_table[current_status]; uint8 bit; bool end_of_run; switch(s.code_number) { case 0: bit = self.bg0.get_bit(end_of_run); break; case 1: bit = self.bg1.get_bit(end_of_run); break; case 2: bit = self.bg2.get_bit(end_of_run); break; case 3: bit = self.bg3.get_bit(end_of_run); break; case 4: bit = self.bg4.get_bit(end_of_run); break; case 5: bit = self.bg5.get_bit(end_of_run); break; case 6: bit = self.bg6.get_bit(end_of_run); break; case 7: bit = self.bg7.get_bit(end_of_run); break; } if(end_of_run) { if(bit) { if(!(current_status & 0xfe)) info.mps ^= 0x01; info.status = s.next_if_lps; } else { info.status = s.next_if_mps; } } return bit ^ current_mps; } //context model void SDD1::Decomp::CM::init(unsigned offset) { bitplanes_info = sdd1.mmc_read(offset) & 0xc0; context_bits_info = sdd1.mmc_read(offset) & 0x30; bit_number = 0; for(unsigned i = 0; i < 8; i++) previous_bitplane_bits[i] = 0; switch(bitplanes_info) { case 0x00: current_bitplane = 1; break; case 0x40: current_bitplane = 7; break; case 0x80: current_bitplane = 3; break; } } uint8 SDD1::Decomp::CM::get_bit() { switch(bitplanes_info) { case 0x00: current_bitplane ^= 0x01; break; case 0x40: current_bitplane ^= 0x01; if(!(bit_number & 0x7f)) current_bitplane = ((current_bitplane + 2) & 0x07); break; case 0x80: current_bitplane ^= 0x01; if(!(bit_number & 0x7f)) current_bitplane ^= 0x02; break; case 0xc0: current_bitplane = bit_number & 0x07; break; } uint16& context_bits = previous_bitplane_bits[current_bitplane]; uint8 current_context = (current_bitplane & 0x01) << 4; switch(context_bits_info) { case 0x00: current_context |= ((context_bits & 0x01c0) >> 5) | (context_bits & 0x0001); break; case 0x10: current_context |= ((context_bits & 0x0180) >> 5) | (context_bits & 0x0001); break; case 0x20: current_context |= ((context_bits & 0x00c0) >> 5) | (context_bits & 0x0001); break; case 0x30: current_context |= ((context_bits & 0x0180) >> 5) | (context_bits & 0x0003); break; } uint8 bit = self.pem.get_bit(current_context); context_bits <<= 1; context_bits |= bit; bit_number++; return bit; } //output logic void SDD1::Decomp::OL::init(unsigned offset) { bitplanes_info = sdd1.mmc_read(offset) & 0xc0; r0 = 0x01; } uint8 SDD1::Decomp::OL::decompress() { switch(bitplanes_info) { case 0x00: case 0x40: case 0x80: if(r0 == 0) { r0 = ~r0; return r2; } for(r0 = 0x80, r1 = 0, r2 = 0; r0; r0 >>= 1) { if(self.cm.get_bit()) r1 |= r0; if(self.cm.get_bit()) r2 |= r0; } return r1; case 0xc0: for(r0 = 0x01, r1 = 0; r0; r0 <<= 1) { if(self.cm.get_bit()) r1 |= r0; } return r1; } // NOT REACHED return 0; } //core void SDD1::Decomp::init(unsigned offset) { im.init(offset); bg0.init(); bg1.init(); bg2.init(); bg3.init(); bg4.init(); bg5.init(); bg6.init(); bg7.init(); pem.init(); cm.init(offset); ol.init(offset); } uint8 SDD1::Decomp::read() { return ol.decompress(); } SDD1::Decomp::Decomp(): im(*this), gcd(*this), bg0(*this, 0), bg1(*this, 1), bg2(*this, 2), bg3(*this, 3), bg4(*this, 4), bg5(*this, 5), bg6(*this, 6), bg7(*this, 7), pem(*this), cm(*this), ol(*this) { } nall/mosaic/context.hpp000664 001750 001750 00000014405 12651764221 016312 0ustar00sergiosergio000000 000000 #ifdef NALL_MOSAIC_INTERNAL_HPP namespace nall { namespace mosaic { struct context { unsigned offset; unsigned width; unsigned height; unsigned count; bool endian; //0 = lsb, 1 = msb bool order; //0 = linear, 1 = planar unsigned depth; //1 - 24bpp unsigned blockWidth; unsigned blockHeight; unsigned blockStride; unsigned blockOffset; vector block; unsigned tileWidth; unsigned tileHeight; unsigned tileStride; unsigned tileOffset; vector tile; unsigned mosaicWidth; unsigned mosaicHeight; unsigned mosaicStride; unsigned mosaicOffset; vector mosaic; unsigned paddingWidth; unsigned paddingHeight; unsigned paddingColor; vector palette; unsigned objectWidth() const { return blockWidth * tileWidth * mosaicWidth + paddingWidth; } unsigned objectHeight() const { return blockHeight * tileHeight * mosaicHeight + paddingHeight; } unsigned objectSize() const { unsigned size = blockStride * tileWidth * tileHeight * mosaicWidth * mosaicHeight + blockOffset * tileHeight * mosaicWidth * mosaicHeight + tileStride * mosaicWidth * mosaicHeight + tileOffset * mosaicHeight; return max(1u, size); } unsigned eval(const string& expression) { if(auto result = Eval::integer(expression)) return result(); return 0u; } void eval(vector& buffer, const string& expression_) { string expression = expression_; bool function = false; for(auto& c : expression) { if(c == '(') function = true; if(c == ')') function = false; if(c == ',' && function == true) c = ';'; } lstring list = expression.split(","); for(auto& item : list) { item.trim(); if(item.match("f(?*) ?*")) { item.ltrim<1>("f("); lstring part = item.split<1>(") "); lstring args = part[0].split<3>(";"); for(auto &item : args) item.trim(); unsigned length = eval(args(0, "0")); unsigned offset = eval(args(1, "0")); unsigned stride = eval(args(2, "0")); if(args.size() < 2) offset = buffer.size(); if(args.size() < 3) stride = 1; for(unsigned n = 0; n < length; n++) { string fn = part[1]; fn.replace("n", string{n}); fn.replace("o", string{offset}); fn.replace("p", string{buffer.size()}); buffer.resize(offset + 1); buffer[offset] = eval(fn); offset += stride; } } else if(item.match("base64*")) { unsigned offset = 0; item.ltrim<1>("base64"); if(item.match("(?*) *")) { item.ltrim<1>("("); lstring part = item.split<1>(") "); offset = eval(part[0]); item = part(1, ""); } item.trim(); for(auto& c : item) { if(c >= 'A' && c <= 'Z') buffer.append(offset + c - 'A' + 0); if(c >= 'a' && c <= 'z') buffer.append(offset + c - 'a' + 26); if(c >= '0' && c <= '9') buffer.append(offset + c - '0' + 52); if(c == '-') buffer.append(offset + 62); if(c == '_') buffer.append(offset + 63); } } else if(item.match("file *")) { item.ltrim<1>("file "); item.trim(); //... } else if(item.empty() == false) { buffer.append(eval(item)); } } } void parse(const string& data) { reset(); lstring lines = data.split("\n"); for(auto& line : lines) { lstring part = line.split<1>(":"); if(part.size() != 2) continue; part[0].trim(); part[1].trim(); if(part[0] == "offset") offset = eval(part[1]); if(part[0] == "width") width = eval(part[1]); if(part[0] == "height") height = eval(part[1]); if(part[0] == "count") count = eval(part[1]); if(part[0] == "endian") endian = eval(part[1]); if(part[0] == "order") order = eval(part[1]); if(part[0] == "depth") depth = eval(part[1]); if(part[0] == "blockWidth") blockWidth = eval(part[1]); if(part[0] == "blockHeight") blockHeight = eval(part[1]); if(part[0] == "blockStride") blockStride = eval(part[1]); if(part[0] == "blockOffset") blockOffset = eval(part[1]); if(part[0] == "block") eval(block, part[1]); if(part[0] == "tileWidth") tileWidth = eval(part[1]); if(part[0] == "tileHeight") tileHeight = eval(part[1]); if(part[0] == "tileStride") tileStride = eval(part[1]); if(part[0] == "tileOffset") tileOffset = eval(part[1]); if(part[0] == "tile") eval(tile, part[1]); if(part[0] == "mosaicWidth") mosaicWidth = eval(part[1]); if(part[0] == "mosaicHeight") mosaicHeight = eval(part[1]); if(part[0] == "mosaicStride") mosaicStride = eval(part[1]); if(part[0] == "mosaicOffset") mosaicOffset = eval(part[1]); if(part[0] == "mosaic") eval(mosaic, part[1]); if(part[0] == "paddingWidth") paddingWidth = eval(part[1]); if(part[0] == "paddingHeight") paddingHeight = eval(part[1]); if(part[0] == "paddingColor") paddingColor = eval(part[1]); if(part[0] == "palette") eval(palette, part[1]); } sanitize(); } bool load(const string& filename) { string filedata = string::read(filename); if(filedata.empty()) return false; parse(filedata); return true; } void sanitize() { if(depth < 1) depth = 1; if(depth > 24) depth = 24; if(blockWidth < 1) blockWidth = 1; if(blockHeight < 1) blockHeight = 1; if(tileWidth < 1) tileWidth = 1; if(tileHeight < 1) tileHeight = 1; if(mosaicWidth < 1) mosaicWidth = 1; if(mosaicHeight < 1) mosaicHeight = 1; //set alpha to full opacity paddingColor |= 255u << 24; for(auto& color : palette) color |= 255u << 24; } void reset() { offset = 0; width = 0; height = 0; count = 0; endian = 1; order = 0; depth = 1; blockWidth = 1; blockHeight = 1; blockStride = 0; blockOffset = 0; block.reset(); tileWidth = 1; tileHeight = 1; tileStride = 0; tileOffset = 0; tile.reset(); mosaicWidth = 1; mosaicHeight = 1; mosaicStride = 0; mosaicOffset = 0; mosaic.reset(); paddingWidth = 0; paddingHeight = 0; paddingColor = 0; palette.reset(); } context() { reset(); } }; } } #endif gba/player/player.hpp000664 001750 001750 00000000570 12651764221 015744 0ustar00sergiosergio000000 000000 struct Player { struct Status { bool enable; bool rumble; bool logoDetected; unsigned logoCounter; unsigned packet; uint32 send; uint32 recv; } status; void power(); void frame(); optional keyinput(); optional read(); void write(uint8 byte, uint2 addr); void serialize(serializer& s); }; extern Player player; fc/apu/noise.hpp000664 001750 001750 00000000401 12651764221 014706 0ustar00sergiosergio000000 000000 struct Noise { unsigned length_counter; Envelope envelope; uint4 period; unsigned period_counter; bool short_mode; uint15 lfsr; void clock_length(); uint8 clock(); void power(); void reset(); void serialize(serializer&); } noise; fc/input/input.cpp000664 001750 001750 00000001576 12651764221 015313 0ustar00sergiosergio000000 000000 #include namespace Famicom { #include "serialization.cpp" Input input; void Input::latch(bool data) { latchdata = data; if(latchdata == 1) { counter1 = 0; counter2 = 0; } } bool Input::data(bool port) { bool result = 0; if(port == 0) { if(port1 == Device::Joypad) { if(counter1 >= 8) return 1; result = interface->inputPoll(0, 0u, counter1); if(latchdata == 0) counter1++; } } if(port == 1) { if(port2 == Device::Joypad) { if(counter2 >= 8) return 1; result = interface->inputPoll(1, 0u, counter2); if(latchdata == 0) counter2++; } } return result; } void Input::connect(bool port, Device device) { if(port == 0) port1 = device, counter1 = 0; if(port == 1) port2 = device, counter2 = 0; } void Input::power() { } void Input::reset() { latchdata = 0; counter1 = 0; counter2 = 0; } } processor/arm/disassembler.hpp000664 001750 001750 00000000200 12651764221 017664 0ustar00sergiosergio000000 000000 string disassemble_arm_instruction(uint32 pc); string disassemble_thumb_instruction(uint32 pc); string disassemble_registers(); gb/cpu/serialization.cpp000664 001750 001750 00000002725 12651764221 016456 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP void CPU::serialize(serializer& s) { LR35902::serialize(s); Thread::serialize(s); s.array(wram); s.array(hram); s.integer(status.clock); s.integer(status.p15); s.integer(status.p14); s.integer(status.joyp); s.integer(status.mlt_req); s.integer(status.serial_data); s.integer(status.serial_bits); s.integer(status.serial_transfer); s.integer(status.serial_clock); s.integer(status.div); s.integer(status.tima); s.integer(status.tma); s.integer(status.timer_enable); s.integer(status.timer_clock); s.integer(status.interrupt_request_joypad); s.integer(status.interrupt_request_serial); s.integer(status.interrupt_request_timer); s.integer(status.interrupt_request_stat); s.integer(status.interrupt_request_vblank); s.integer(status.speed_double); s.integer(status.speed_switch); s.integer(status.dma_source); s.integer(status.dma_target); s.integer(status.dma_mode); s.integer(status.dma_length); s.integer(status.dma_completed); s.integer(status.ff6c); s.integer(status.wram_bank); s.integer(status.ff72); s.integer(status.ff73); s.integer(status.ff74); s.integer(status.ff75); s.integer(status.interrupt_enable_joypad); s.integer(status.interrupt_enable_serial); s.integer(status.interrupt_enable_timer); s.integer(status.interrupt_enable_stat); s.integer(status.interrupt_enable_vblank); s.integer(oamdma.active); s.integer(oamdma.bank); s.integer(oamdma.offset); } #endif nall/image/scale.hpp000664 001750 001750 00000012260 12651764221 015521 0ustar00sergiosergio000000 000000 #ifndef NALL_IMAGE_SCALE_HPP #define NALL_IMAGE_SCALE_HPP namespace nall { void image::scale(unsigned outputWidth, unsigned outputHeight, bool linear) { if(width == outputWidth && height == outputHeight) return; //no scaling necessary if(linear == false) return scaleNearest(outputWidth, outputHeight); if(width == outputWidth ) return scaleLinearHeight(outputHeight); if(height == outputHeight) return scaleLinearWidth(outputWidth); //find fastest scaling method, based on number of interpolation operations required //magnification usually benefits from two-pass linear interpolation //minification usually benefits from one-pass bilinear interpolation unsigned d1wh = ((width * outputWidth ) + (outputWidth * outputHeight)) * 1; unsigned d1hw = ((height * outputHeight) + (outputWidth * outputHeight)) * 1; unsigned d2wh = (outputWidth * outputHeight) * 3; if(d1wh <= d1hw && d1wh <= d2wh) return scaleLinearWidth(outputWidth), scaleLinearHeight(outputHeight); if(d1hw <= d2wh) return scaleLinearHeight(outputHeight), scaleLinearWidth(outputWidth); return scaleLinear(outputWidth, outputHeight); } void image::scaleLinearWidth(unsigned outputWidth) { uint8_t* outputData = allocate(outputWidth, height, stride); unsigned outputPitch = outputWidth * stride; uint64_t xstride = ((uint64_t)(width - 1) << 32) / max(1u, outputWidth - 1); #pragma omp parallel for for(unsigned y = 0; y < height; y++) { uint64_t xfraction = 0; const uint8_t* sp = data + pitch * y; uint8_t* dp = outputData + outputPitch * y; uint64_t a = read(sp); uint64_t b = read(sp + stride); sp += stride; unsigned x = 0; while(true) { while(xfraction < 0x100000000 && x++ < outputWidth) { write(dp, interpolate4i(a, b, xfraction)); dp += stride; xfraction += xstride; } if(x >= outputWidth) break; sp += stride; a = b; b = read(sp); xfraction -= 0x100000000; } } free(); data = outputData; width = outputWidth; pitch = outputPitch; size = height * pitch; } void image::scaleLinearHeight(unsigned outputHeight) { uint8_t* outputData = allocate(width, outputHeight, stride); uint64_t ystride = ((uint64_t)(height - 1) << 32) / max(1u, outputHeight - 1); #pragma omp parallel for for(unsigned x = 0; x < width; x++) { uint64_t yfraction = 0; const uint8_t* sp = data + stride * x; uint8_t* dp = outputData + stride * x; uint64_t a = read(sp); uint64_t b = read(sp + pitch); sp += pitch; unsigned y = 0; while(true) { while(yfraction < 0x100000000 && y++ < outputHeight) { write(dp, interpolate4i(a, b, yfraction)); dp += pitch; yfraction += ystride; } if(y >= outputHeight) break; sp += pitch; a = b; b = read(sp); yfraction -= 0x100000000; } } free(); data = outputData; height = outputHeight; size = height * pitch; } void image::scaleLinear(unsigned outputWidth, unsigned outputHeight) { uint8_t* outputData = allocate(outputWidth, outputHeight, stride); unsigned outputPitch = outputWidth * stride; uint64_t xstride = ((uint64_t)(width - 1) << 32) / max(1u, outputWidth - 1); uint64_t ystride = ((uint64_t)(height - 1) << 32) / max(1u, outputHeight - 1); #pragma omp parallel for for(unsigned y = 0; y < outputHeight; y++) { uint64_t yfraction = ystride * y; uint64_t xfraction = 0; const uint8_t* sp = data + pitch * (yfraction >> 32); uint8_t* dp = outputData + outputPitch * y; uint64_t a = read(sp); uint64_t b = read(sp + stride); uint64_t c = read(sp + pitch); uint64_t d = read(sp + pitch + stride); sp += stride; unsigned x = 0; while(true) { while(xfraction < 0x100000000 && x++ < outputWidth) { write(dp, interpolate4i(a, b, c, d, xfraction, yfraction)); dp += stride; xfraction += xstride; } if(x >= outputWidth) break; sp += stride; a = b; c = d; b = read(sp); d = read(sp + pitch); xfraction -= 0x100000000; } } free(); data = outputData; width = outputWidth; height = outputHeight; pitch = outputPitch; size = height * pitch; } void image::scaleNearest(unsigned outputWidth, unsigned outputHeight) { uint8_t* outputData = allocate(outputWidth, outputHeight, stride); unsigned outputPitch = outputWidth * stride; uint64_t xstride = ((uint64_t)width << 32) / outputWidth; uint64_t ystride = ((uint64_t)height << 32) / outputHeight; #pragma omp parallel for for(unsigned y = 0; y < outputHeight; y++) { uint64_t yfraction = ystride * y; uint64_t xfraction = 0; const uint8_t* sp = data + pitch * (yfraction >> 32); uint8_t* dp = outputData + outputPitch * y; uint64_t a = read(sp); unsigned x = 0; while(true) { while(xfraction < 0x100000000 && x++ < outputWidth) { write(dp, a); dp += stride; xfraction += xstride; } if(x >= outputWidth) break; sp += stride; a = read(sp); xfraction -= 0x100000000; } } free(); data = outputData; width = outputWidth; height = outputHeight; pitch = outputPitch; size = height * pitch; } } #endif processor/r6502/000700 001750 001750 00000000000 12656700342 014470 5ustar00sergiosergio000000 000000 nall/string/split.hpp000664 001750 001750 00000002135 12651764221 016011 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { template lstring& lstring::usplit(rstring key, rstring base) { reset(); if(key.size() == 0) return *this; const char* b = base; const char* p = base; while(*p) { if(Limit) if(size() >= Limit) break; if(quoteskip(p)) continue; for(unsigned n = 0;; n++) { if(key[n] == 0) { append(substr(b, 0, p - b)); p += n; b = p; break; } if(!chrequal(key[n], p[n])) { p++; break; } } } append(b); return *this; } template lstring& lstring::split(rstring key, rstring src) { return usplit(key, src); } template lstring& lstring::isplit(rstring key, rstring src) { return usplit(key, src); } template lstring& lstring::qsplit(rstring key, rstring src) { return usplit(key, src); } template lstring& lstring::iqsplit(rstring key, rstring src) { return usplit(key, src); } }; #endif ruby/ruby.cpp000664 001750 001750 00000023613 12651764221 014363 0ustar00sergiosergio000000 000000 #include #undef mkdir #undef usleep #include namespace ruby { VideoInterface video; AudioInterface audio; InputInterface input; /* VideoInterface */ const char* Video::Handle = "Handle"; const char* Video::Synchronize = "Synchronize"; const char* Video::Depth = "Depth"; const char* Video::Filter = "Filter"; const char* Video::Shader = "Shader"; const unsigned Video::FilterNearest = 0; const unsigned Video::FilterLinear = 1; void VideoInterface::driver(const char* driver) { if(p) term(); if(!driver || !*driver) driver = optimalDriver(); if(0); #ifdef VIDEO_CGL else if(!strcmp(driver, "OpenGL")) p = new VideoCGL(); #endif #ifdef VIDEO_DIRECT3D else if(!strcmp(driver, "Direct3D")) p = new VideoD3D(); #endif #ifdef VIDEO_DIRECTDRAW else if(!strcmp(driver, "DirectDraw")) p = new VideoDD(); #endif #ifdef VIDEO_GDI else if(!strcmp(driver, "GDI")) p = new VideoGDI(); #endif #ifdef VIDEO_GLX else if(!strcmp(driver, "OpenGL")) p = new VideoGLX(); #endif #ifdef VIDEO_QTOPENGL else if(!strcmp(driver, "Qt-OpenGL")) p = new VideoQtOpenGL(); #endif #ifdef VIDEO_QTRASTER else if(!strcmp(driver, "Qt-Raster")) p = new VideoQtRaster(); #endif #ifdef VIDEO_SDL else if(!strcmp(driver, "SDL")) p = new VideoSDL(); #endif #ifdef VIDEO_WGL else if(!strcmp(driver, "OpenGL")) p = new VideoWGL(); #endif #ifdef VIDEO_XSHM else if(!strcmp(driver, "XShm")) p = new VideoXShm(); #endif #ifdef VIDEO_XV else if(!strcmp(driver, "X-Video")) p = new VideoXv(); #endif else p = new Video(); } const char* VideoInterface::optimalDriver() { #if defined(VIDEO_WGL) return "OpenGL"; #elif defined(VIDEO_DIRECT3D) return "Direct3D"; #elif defined(VIDEO_DIRECTDRAW) return "DirectDraw"; #elif defined(VIDEO_GDI) return "GDI"; #elif defined(VIDEO_CGL) return "OpenGL"; #elif defined(VIDEO_GLX) return "OpenGL"; #elif defined(VIDEO_XV) return "X-Video"; #elif defined(VIDEO_XSHM) return "XShm"; #elif defined(VIDEO_SDL) return "SDL"; #else return "None"; #endif } const char* VideoInterface::safestDriver() { #if defined(VIDEO_DIRECT3D) return "Direct3D"; #elif defined(VIDEO_WGL) return "OpenGL"; #elif defined(VIDEO_DIRECTDRAW) return "DirectDraw"; #elif defined(VIDEO_GDI) return "GDI"; #elif defined(VIDEO_CGL) return "OpenGL"; #elif defined(VIDEO_XSHM) return "XShm"; #elif defined(VIDEO_SDL) return "SDL"; #elif defined(VIDEO_XV) return "X-Video"; #elif defined(VIDEO_GLX) return "OpenGL"; #else return "None"; #endif } const char* VideoInterface::availableDrivers() { return //Windows #if defined(VIDEO_WGL) "OpenGL;" #endif #if defined(VIDEO_DIRECT3D) "Direct3D;" #endif #if defined(VIDEO_DIRECTDRAW) "DirectDraw;" #endif #if defined(VIDEO_GDI) "GDI;" #endif //OS X #if defined(VIDEO_CGL) "OpenGL;" #endif //Linux #if defined(VIDEO_GLX) "OpenGL;" #endif #if defined(VIDEO_XV) "X-Video;" #endif #if defined(VIDEO_XSHM) "XShm;" #endif #if defined(VIDEO_SDL) "SDL;" #endif "None"; } bool VideoInterface::init() { if(!p) driver(); return p->init(); } void VideoInterface::term() { if(p) { p->term(); delete p; p = nullptr; } } bool VideoInterface::cap(const string& name) { return p ? p->cap(name) : false; } any VideoInterface::get(const string& name) { return p ? p->get(name) : false; } bool VideoInterface::set(const string& name, const any& value) { return p ? p->set(name, value) : false; } bool VideoInterface::lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) { return p ? p->lock(data, pitch, width, height) : false; } void VideoInterface::unlock() { if(p) p->unlock(); } void VideoInterface::clear() { if(p) p->clear(); } void VideoInterface::refresh() { if(p) p->refresh(); } VideoInterface::VideoInterface() : p(nullptr) {} VideoInterface::~VideoInterface() { term(); } /* AudioInterface */ const char* Audio::Handle = "Handle"; const char* Audio::Synchronize = "Synchronize"; const char* Audio::Frequency = "Frequency"; const char* Audio::Latency = "Latency"; void AudioInterface::driver(const char* driver) { if(p) term(); if(!driver || !*driver) driver = optimalDriver(); if(0); #ifdef AUDIO_ALSA else if(!strcmp(driver, "ALSA")) p = new AudioALSA(); #endif #ifdef AUDIO_AO else if(!strcmp(driver, "libao")) p = new AudioAO(); #endif #ifdef AUDIO_DIRECTSOUND else if(!strcmp(driver, "DirectSound")) p = new AudioDS(); #endif #ifdef AUDIO_OPENAL else if(!strcmp(driver, "OpenAL")) p = new AudioOpenAL(); #endif #ifdef AUDIO_OSS else if(!strcmp(driver, "OSS")) p = new AudioOSS(); #endif #ifdef AUDIO_PULSEAUDIO else if(!strcmp(driver, "PulseAudio")) p = new AudioPulseAudio(); #endif #ifdef AUDIO_PULSEAUDIOSIMPLE else if(!strcmp(driver, "PulseAudioSimple")) p = new AudioPulseAudioSimple(); #endif #ifdef AUDIO_XAUDIO2 else if(!strcmp(driver, "XAudio2")) p = new AudioXAudio2(); #endif else p = new Audio(); } const char* AudioInterface::optimalDriver() { #if defined(AUDIO_XAUDIO2) return "XAudio2"; #elif defined(AUDIO_DIRECTSOUND) return "DirectSound"; #elif defined(AUDIO_ALSA) return "ALSA"; #elif defined(AUDIO_OPENAL) return "OpenAL"; #elif defined(AUDIO_OSS) return "OSS"; #elif defined(AUDIO_PULSEAUDIO) return "PulseAudio"; #elif defined(AUDIO_PULSEAUDIOSIMPLE) return "PulseAudioSimple"; #elif defined(AUDIO_AO) return "libao"; #else return "None"; #endif } const char* AudioInterface::safestDriver() { #if defined(AUDIO_DIRECTSOUND) return "DirectSound"; #elif defined(AUDIO_XAUDIO2) return "XAudio2"; #elif defined(AUDIO_ALSA) return "ALSA"; #elif defined(AUDIO_OPENAL) return "OpenAL"; #elif defined(AUDIO_PULSEAUDIO) return "PulseAudio"; #elif defined(AUDIO_PULSEAUDIOSIMPLE) return "PulseAudioSimple"; #elif defined(AUDIO_AO) return "libao"; #elif defined(AUDIO_OSS) return "OSS"; #else return "None"; #endif } const char* AudioInterface::availableDrivers() { return //Windows #if defined(AUDIO_XAUDIO2) "XAudio2;" #endif #if defined(AUDIO_DIRECTSOUND) "DirectSound;" #endif //Linux #if defined(AUDIO_ALSA) "ALSA;" #endif #if defined(AUDIO_OPENAL) "OpenAL;" #endif #if defined(AUDIO_OSS) "OSS;" #endif #if defined(AUDIO_PULSEAUDIO) "PulseAudio;" #endif #if defined(AUDIO_PULSEAUDIOSIMPLE) "PulseAudioSimple;" #endif #if defined(AUDIO_AO) "libao;" #endif "None"; } bool AudioInterface::init() { if(!p) driver(); return p->init(); } void AudioInterface::term() { if(p) { p->term(); delete p; p = nullptr; } } bool AudioInterface::cap(const string& name) { return p ? p->cap(name) : false; } any AudioInterface::get(const string& name) { return p ? p->get(name) : false; } bool AudioInterface::set(const string& name, const any& value) { return p ? p->set(name, value) : false; } void AudioInterface::sample(uint16_t left, uint16_t right) { if(p) p->sample(left, right); } void AudioInterface::clear() { if(p) p->clear(); } AudioInterface::AudioInterface() : p(nullptr) {} AudioInterface::~AudioInterface() { term(); } /* InputInterface */ const char* Input::Handle = "Handle"; const char* Input::KeyboardSupport = "KeyboardSupport"; const char* Input::MouseSupport = "MouseSupport"; const char* Input::JoypadSupport = "JoypadSupport"; const char* Input::JoypadRumbleSupport = "JoypadRumbleSupport"; void InputInterface::driver(const char* driver) { if(p) term(); if(!driver || !*driver) driver = optimalDriver(); if(0); #ifdef INPUT_WINDOWS else if(!strcmp(driver, "Windows")) p = new InputWindows(); #endif #ifdef INPUT_CARBON else if(!strcmp(driver, "Carbon")) p = new InputCarbon(); #endif #ifdef INPUT_UDEV else if(!strcmp(driver, "udev")) p = new InputUdev(); #endif #ifdef INPUT_SDL else if(!strcmp(driver, "SDL")) p = new InputSDL(); #endif #ifdef INPUT_XLIB else if(!strcmp(driver, "Xlib")) p = new InputXlib(); #endif else p = new Input(); } const char* InputInterface::optimalDriver() { #if defined(INPUT_WINDOWS) return "Windows"; #elif defined(INPUT_CARBON) return "Carbon"; #elif defined(INPUT_UDEV) return "udev"; #elif defined(INPUT_SDL) return "SDL"; #elif defined(INPUT_XLIB) return "Xlib"; #else return "None"; #endif } const char* InputInterface::safestDriver() { #if defined(INPUT_WINDOWS) return "Windows"; #elif defined(INPUT_CARBON) return "Carbon"; #elif defined(INPUT_UDEV) return "udev"; #elif defined(INPUT_SDL) return "SDL"; #elif defined(INPUT_XLIB) return "Xlib"; #else return "none"; #endif } const char* InputInterface::availableDrivers() { return //Windows #if defined(INPUT_WINDOWS) "Windows;" #endif //OS X #if defined(INPUT_CARBON) "Carbon;" #endif //Linux #if defined(INPUT_UDEV) "udev;" #endif #if defined(INPUT_SDL) "SDL;" #endif #if defined(INPUT_XLIB) "Xlib;" #endif "None"; } bool InputInterface::init() { if(!p) driver(); return p->init(); } void InputInterface::term() { if(p) { p->term(); delete p; p = nullptr; } } bool InputInterface::cap(const string& name) { return p ? p->cap(name) : false; } any InputInterface::get(const string& name) { return p ? p->get(name) : false; } bool InputInterface::set(const string& name, const any& value) { return p ? p->set(name, value) : false; } bool InputInterface::acquire() { return p ? p->acquire() : false; } bool InputInterface::unacquire() { return p ? p->unacquire() : false; } bool InputInterface::acquired() { return p ? p->acquired() : false; } vector InputInterface::poll() { return p ? p->poll() : vector(); } bool InputInterface::rumble(uint64_t id, bool enable) { return p ? p->rumble(id, enable) : false; } InputInterface::InputInterface() : p(nullptr) {} InputInterface::~InputInterface() { term(); } }; gb/apu/apu.hpp000664 001750 001750 00000001064 12651764221 014364 0ustar00sergiosergio000000 000000 struct APU : Thread, MMIO { #include "square1/square1.hpp" #include "square2/square2.hpp" #include "wave/wave.hpp" #include "noise/noise.hpp" #include "master/master.hpp" uint8 mmio_data[48]; uint12 sequencer_base; uint3 sequencer_step; Square1 square1; Square2 square2; Wave wave; Noise noise; Master master; static void Main(); void main(); void hipass(int16& sample, int64& bias); void power(); uint8 mmio_read(uint16 addr); void mmio_write(uint16 addr, uint8 data); void serialize(serializer&); }; extern APU apu; gb/cartridge/mmm01/mmm01.cpp000664 001750 001750 00000002666 12651764221 016640 0ustar00sergiosergio000000 000000 #ifdef CARTRIDGE_CPP uint8 Cartridge::MMM01::mmio_read(uint16 addr) { if((addr & 0x8000) == 0x0000) { //$0000-7fff if(rom_mode == 0) return cartridge.rom_read(addr); } if((addr & 0xc000) == 0x0000) { //$0000-3fff return cartridge.rom_read(0x8000 + (rom_base << 14) + (addr & 0x3fff)); } if((addr & 0xc000) == 0x4000) { //$4000-7fff return cartridge.rom_read(0x8000 + (rom_base << 14) + (rom_select << 14) + (addr & 0x3fff)); } if((addr & 0xe000) == 0xa000) { //$a000-bfff if(ram_enable) return cartridge.ram_read((ram_select << 13) + (addr & 0x1fff)); return 0x00; } return 0x00; } void Cartridge::MMM01::mmio_write(uint16 addr, uint8 data) { if((addr & 0xe000) == 0x0000) { //$0000-1fff if(rom_mode == 0) { rom_mode = 1; } else { ram_enable = (data & 0x0f) == 0x0a; } } if((addr & 0xe000) == 0x2000) { //$2000-3fff if(rom_mode == 0) { rom_base = data & 0x3f; } else { rom_select = data; } } if((addr & 0xe000) == 0x4000) { //$4000-5fff if(rom_mode == 1) { ram_select = data; } } if((addr & 0xe000) == 0x6000) { //$6000-7fff //unknown purpose } if((addr & 0xe000) == 0xa000) { //$a000-bfff if(ram_enable) cartridge.ram_write((ram_select << 13) + (addr & 0x1fff), data); } } void Cartridge::MMM01::power() { rom_mode = 0; rom_base = 0; ram_enable = false; rom_select = 0x01; ram_select = 0x00; } #endif fc/apu/envelope.hpp000664 001750 001750 00000000401 12651764221 015406 0ustar00sergiosergio000000 000000 struct Envelope { uint4 speed; bool use_speed_as_volume; bool loop_mode; bool reload_decay; uint8 decay_counter; uint4 decay_volume; unsigned volume() const; void clock(); void power(); void reset(); void serialize(serializer&); }; phoenix/windows/action/check-item.cpp000664 001750 001750 00000001044 12651764221 021045 0ustar00sergiosergio000000 000000 namespace phoenix { void pCheckItem::setChecked(bool checked) { if(parentMenu) CheckMenuItem(parentMenu->p.hmenu, id, checked ? MF_CHECKED : MF_UNCHECKED); } void pCheckItem::setText(string text) { if(parentWindow) parentWindow->p.updateMenu(); } void pCheckItem::constructor() { } void pCheckItem::destructor() { if(parentMenu) parentMenu->remove(checkItem); } void pCheckItem::onToggle() { checkItem.state.checked = !checkItem.state.checked; setChecked(checkItem.state.checked); if(checkItem.onToggle) checkItem.onToggle(); } } sfc/alt/ppu-performance/ppu.hpp000664 001750 001750 00000002507 12651764221 017667 0ustar00sergiosergio000000 000000 struct PPU : Thread, public PPUcounter { uint8 vram[64 * 1024]; uint8 oam[544]; uint8 cgram[512]; enum : bool { Threaded = true }; alwaysinline void step(unsigned clocks); alwaysinline void synchronize_cpu(); void latch_counters(); bool interlace() const; bool overscan() const; bool hires() const; void enter(); void enable(); void power(); void reset(); void scanline(); void frame(); void layer_enable(unsigned layer, unsigned priority, bool enable); void set_frameskip(unsigned frameskip); void serialize(serializer&); PPU(); ~PPU(); private: uint32* surface; uint32* output; #include "mmio/mmio.hpp" #include "window/window.hpp" #include "cache/cache.hpp" #include "background/background.hpp" #include "sprite/sprite.hpp" #include "screen/screen.hpp" Cache cache; Background bg1; Background bg2; Background bg3; Background bg4; Sprite sprite; Screen screen; struct Display { bool interlace; bool overscan; unsigned width; unsigned height; unsigned frameskip; unsigned framecounter; } display; static void Enter(); void add_clocks(unsigned clocks); void render_scanline(); friend class PPU::Cache; friend class PPU::Background; friend class PPU::Sprite; friend class PPU::Screen; friend class Video; }; extern PPU ppu; nall/public-cast.hpp000664 001750 001750 00000001744 12651764221 015563 0ustar00sergiosergio000000 000000 #ifndef NALL_PUBLIC_CAST_HPP #define NALL_PUBLIC_CAST_HPP //this is a proof-of-concept-*only* C++ access-privilege elevation exploit. //this code is 100% legal C++, per C++98 section 14.7.2 paragraph 8: //"access checking rules do not apply to names in explicit instantiations." //usage example: //struct N { typedef void (Class::*)(); }; //template class public_cast; //(class.*public_cast::value); //Class::Reference may be public, protected or private //Class::Reference may be a function, object or variable namespace nall { template struct public_cast; template struct public_cast { static typename T::type value; }; template typename T::type public_cast::value; template struct public_cast { static typename T::type value; }; template typename T::type public_cast::value = public_cast::value = P; } #endif ruby/audio/pulseaudiosimple.cpp000664 001750 001750 00000004725 12651764221 020072 0ustar00sergiosergio000000 000000 //audio.pulseaudiosimple (2010-01-05) //author: byuu #include #include namespace ruby { class pAudioPulseAudioSimple { public: struct { pa_simple* handle; pa_sample_spec spec; } device; struct { uint32_t* data; unsigned offset; } buffer; struct { unsigned frequency; } settings; bool cap(const string& name) { if(name == Audio::Frequency) return true; return false; } any get(const string& name) { if(name == Audio::Frequency) return settings.frequency; return false; } bool set(const string& name, const any& value) { if(name == Audio::Frequency) { settings.frequency = any_cast(value); if(device.handle) init(); return true; } return false; } void sample(uint16_t left, uint16_t right) { if(!device.handle) return; buffer.data[buffer.offset++] = left + (right << 16); if(buffer.offset >= 64) { int error; pa_simple_write(device.handle, (const void*)buffer.data, buffer.offset * sizeof(uint32_t), &error); buffer.offset = 0; } } void clear() { } bool init() { term(); device.spec.format = PA_SAMPLE_S16LE; device.spec.channels = 2; device.spec.rate = settings.frequency; int error = 0; device.handle = pa_simple_new( 0, //default server "ruby::pulseaudiosimple", //application name PA_STREAM_PLAYBACK, //direction 0, //default device "audio", //stream description &device.spec, //sample format 0, //default channel map 0, //default buffering attributes &error //error code ); if(!device.handle) { fprintf(stderr, "ruby::pulseaudiosimple failed to initialize - %s\n", pa_strerror(error)); return false; } buffer.data = new uint32_t[64]; buffer.offset = 0; return true; } void term() { if(device.handle) { int error; pa_simple_flush(device.handle, &error); pa_simple_free(device.handle); device.handle = nullptr; } if(buffer.data) { delete[] buffer.data; buffer.data = nullptr; } } pAudioPulseAudioSimple() { device.handle = nullptr; buffer.data = nullptr; settings.frequency = 22050; } ~pAudioPulseAudioSimple() { term(); } }; DeclareAudio(PulseAudioSimple) }; fc/cartridge/board/bandai-fcg.cpp000664 001750 001750 00000004734 12651764221 020022 0ustar00sergiosergio000000 000000 //BANDAI-FCG struct BandaiFCG : Board { uint8 chr_bank[8]; uint8 prg_bank; uint2 mirror; bool irq_counter_enable; uint16 irq_counter; uint16 irq_latch; void main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(irq_counter_enable) { if(--irq_counter == 0xffff) { cpu.set_irq_line(1); irq_counter_enable = false; } } tick(); } } unsigned ciram_addr(unsigned addr) const { switch(mirror) { case 0: return ((addr & 0x0400) >> 0) | (addr & 0x03ff); case 1: return ((addr & 0x0800) >> 1) | (addr & 0x03ff); case 2: return 0x0000 | (addr & 0x03ff); case 3: return 0x0400 | (addr & 0x03ff); } } uint8 prg_read(unsigned addr) { if(addr & 0x8000) { bool region = addr & 0x4000; unsigned bank = (region == 0 ? prg_bank : 0x0f); return prgrom.read((bank << 14) | (addr & 0x3fff)); } return cpu.mdr(); } void prg_write(unsigned addr, uint8 data) { if(addr >= 0x6000) { switch(addr & 15) { case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: chr_bank[addr & 7] = data; break; case 0x08: prg_bank = data & 0x0f; break; case 0x09: mirror = data & 0x03; break; case 0x0a: cpu.set_irq_line(0); irq_counter_enable = data & 0x01; irq_counter = irq_latch; break; case 0x0b: irq_latch = (irq_latch & 0xff00) | (data << 0); break; case 0x0c: irq_latch = (irq_latch & 0x00ff) | (data << 8); break; case 0x0d: //TODO: serial EEPROM support break; } } } uint8 chr_read(unsigned addr) { if(addr & 0x2000) return ppu.ciram_read(ciram_addr(addr)); addr = (chr_bank[addr >> 10] << 10) | (addr & 0x03ff); return Board::chr_read(addr); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) return ppu.ciram_write(ciram_addr(addr), data); addr = (chr_bank[addr >> 10] << 10) | (addr & 0x03ff); return Board::chr_write(addr, data); } void power() { reset(); } void reset() { for(auto &n : chr_bank) n = 0; prg_bank = 0; mirror = 0; irq_counter_enable = 0; irq_counter = 0; irq_latch = 0; } void serialize(serializer& s) { Board::serialize(s); s.array(chr_bank); s.integer(prg_bank); s.integer(mirror); s.integer(irq_counter_enable); s.integer(irq_counter); s.integer(irq_latch); } BandaiFCG(Markup::Node& document) : Board(document) { } }; phoenix/gtk/action/radio-item.cpp000664 001750 001750 00000003516 12651764221 020167 0ustar00sergiosergio000000 000000 namespace phoenix { static void RadioItem_activate(GtkCheckMenuItem* gtkCheckMenuItem, RadioItem* self) { self->p.onActivate(); } void pRadioItem::setChecked() { parent().locked = true; for(auto& item : radioItem.state.group) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item.p.widget), false); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), true); parent().locked = false; } void pRadioItem::setGroup(const group& group) { parent().locked = true; for(auto& item : group) { if(&item == &group.first()) continue; GSList* currentGroup = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(group.first().p.widget)); if(currentGroup != gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(item.p.widget))) { gtk_radio_menu_item_set_group(GTK_RADIO_MENU_ITEM(item.p.widget), currentGroup); } } parent().locked = false; } void pRadioItem::setText(string text) { gtk_menu_item_set_label(GTK_MENU_ITEM(widget), mnemonic(text)); } void pRadioItem::constructor() { widget = gtk_radio_menu_item_new_with_mnemonic(0, ""); setGroup(radioItem.state.group); setText(radioItem.state.text); for(auto& item : radioItem.state.group) { gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item.p.widget), item.state.checked); } g_signal_connect(G_OBJECT(widget), "toggled", G_CALLBACK(RadioItem_activate), (gpointer)&radioItem); } void pRadioItem::destructor() { gtk_widget_destroy(widget); } void pRadioItem::orphan() { destructor(); constructor(); } void pRadioItem::onActivate() { if(parent().locked) return; bool wasChecked = radioItem.state.checked; radioItem.setChecked(); if(wasChecked) return; if(radioItem.onActivate) radioItem.onActivate(); } pRadioItem& pRadioItem::parent() { if(radioItem.state.group.size()) return radioItem.state.group.first().p; return *this; } } phoenix/qt/action/check-item.cpp000664 001750 001750 00000001152 12651764221 017777 0ustar00sergiosergio000000 000000 namespace phoenix { void pCheckItem::setChecked(bool checked) { qtAction->setChecked(checked); } void pCheckItem::setText(string text) { qtAction->setText(QString::fromUtf8(text)); } void pCheckItem::constructor() { qtAction = new QAction(0); qtAction->setCheckable(true); connect(qtAction, SIGNAL(triggered()), SLOT(onToggle())); } void pCheckItem::destructor() { if(action.state.menu) action.state.menu->remove(checkItem); delete qtAction; qtAction = nullptr; } void pCheckItem::onToggle() { checkItem.state.checked = qtAction->isChecked(); if(checkItem.onToggle) checkItem.onToggle(); } } phoenix/windows/platform.hpp000664 001750 001750 00000035112 12651764221 017413 0ustar00sergiosergio000000 000000 namespace phoenix { struct AppMessage { enum : unsigned { ListView_onActivate = 0, }; }; typedef LRESULT CALLBACK (*WindowProc)(HWND, UINT, WPARAM, LPARAM); struct pApplication { static void run(); static bool pendingEvents(); static void processEvents(); static void quit(); static void initialize(); }; struct Settings { bimap keymap; }; struct pFont; struct pObject; struct pWindow; struct pMenu; struct pLayout; struct pWidget; struct pFont { static string serif(unsigned size, string style); static string sans(unsigned size, string style); static string monospace(unsigned size, string style); static Size size(string font, string text); static HFONT create(string description); static void free(HFONT hfont); static Size size(HFONT hfont, string text); }; struct pDesktop { static Size size(); static Geometry workspace(); }; struct pMonitor { static unsigned count(); static Geometry geometry(unsigned monitor); static unsigned primary(); }; struct pKeyboard { static bool pressed(Keyboard::Scancode scancode); static vector state(); static void initialize(); }; struct pMouse { static Position position(); static bool pressed(Mouse::Button button); }; struct pBrowserWindow { static string directory(BrowserWindow::State& state); static string open(BrowserWindow::State& state); static string save(BrowserWindow::State& state); }; struct pMessageWindow { static MessageWindow::Response error(MessageWindow::State& state); static MessageWindow::Response information(MessageWindow::State& state); static MessageWindow::Response question(MessageWindow::State& state); static MessageWindow::Response warning(MessageWindow::State& state); }; struct pObject { static vector objects; Object& object; uintptr_t id; bool locked; pObject(Object& object); static Object* find(unsigned id); virtual ~pObject() {} void constructor() {} void destructor() {} }; struct pTimer : public pObject { Timer& timer; UINT_PTR htimer; void setEnabled(bool enabled); void setInterval(unsigned interval); pTimer(Timer& timer) : pObject(timer), timer(timer) {} void constructor(); }; struct pWindow : public pObject { static vector modal; static void updateModality(); Window& window; HWND hwnd; HMENU hmenu; HWND hstatus; HFONT hstatusfont; HBRUSH brush; COLORREF brushColor; static Window& none(); void append(Layout& layout); void append(Menu& menu); void append(Widget& widget); bool focused(); Geometry frameMargin(); Geometry geometry(); void remove(Layout& layout); void remove(Menu& menu); void remove(Widget& widget); void setBackgroundColor(Color color); void setDroppable(bool droppable); void setFocused(); void setFullScreen(bool fullScreen); void setGeometry(Geometry geometry); void setMenuFont(string font); void setMenuVisible(bool visible); void setModal(bool modal); void setResizable(bool resizable); void setStatusFont(string font); void setStatusText(string text); void setStatusVisible(bool visible); void setTitle(string text); void setVisible(bool visible); void setWidgetFont(string font); pWindow(Window& window) : pObject(window), window(window) {} void constructor(); void destructor(); void updateMenu(); void onClose(); void onDrop(WPARAM wparam); bool onEraseBackground(); void onModalBegin(); void onModalEnd(); void onMove(); void onSize(); }; struct pAction : public pObject { Action& action; Menu* parentMenu; Window* parentWindow; void setEnabled(bool enabled); void setVisible(bool visible); pAction(Action& action) : pObject(action), action(action) {} void constructor(); }; struct pMenu : public pAction { Menu& menu; HMENU hmenu; HBITMAP hbitmap; void append(Action& action); void remove(Action& action); void setImage(const image& image); void setText(string text); pMenu(Menu& menu) : pAction(menu), menu(menu), hbitmap(0) {} void constructor(); void destructor(); void createBitmap(); void update(Window& parentWindow, Menu* parentMenu = nullptr); }; struct pSeparator : public pAction { Separator& separator; pSeparator(Separator& separator) : pAction(separator), separator(separator) {} void constructor(); void destructor(); }; struct pItem : public pAction { Item& item; HBITMAP hbitmap; void setImage(const image& image); void setText(string text); pItem(Item& item) : pAction(item), item(item), hbitmap(0) {} void constructor(); void destructor(); void createBitmap(); void onActivate(); }; struct pCheckItem : public pAction { CheckItem& checkItem; void setChecked(bool checked); void setText(string text); pCheckItem(CheckItem& checkItem) : pAction(checkItem), checkItem(checkItem) {} void constructor(); void destructor(); void onToggle(); }; struct pRadioItem : public pAction { RadioItem& radioItem; void setChecked(); void setGroup(const group& group); void setText(string text); pRadioItem(RadioItem& radioItem) : pAction(radioItem), radioItem(radioItem) {} void constructor(); void destructor(); void onActivate(); }; struct pSizable : public pObject { Sizable& sizable; pSizable(Sizable& sizable) : pObject(sizable), sizable(sizable) {} }; struct pLayout : public pSizable { Layout& layout; pLayout(Layout& layout) : pSizable(layout), layout(layout) {} }; struct pWidget : public pSizable { Widget& widget; HWND parentHwnd; HWND hwnd; HFONT hfont; bool focused(); virtual Size minimumSize(); virtual void setEnabled(bool enabled); void setFocused(); void setFont(string font); virtual void setGeometry(Geometry geometry); virtual void setVisible(bool visible); pWidget(Widget& widget) : pSizable(widget), widget(widget) { parentHwnd = pWindow::none().p.hwnd; } void constructor(); void destructor(); virtual void orphan(); void setDefaultFont(); void synchronize(); }; struct pButton : public pWidget { Button& button; HBITMAP hbitmap; HIMAGELIST himagelist; Size minimumSize(); void setImage(const image& image, Orientation orientation); void setText(string text); pButton(Button& button) : pWidget(button), button(button), hbitmap(0), himagelist(0) {} void constructor(); void destructor(); void orphan(); void onActivate(); }; struct pCanvas : public pWidget { Canvas& canvas; uint32_t* surface = nullptr; unsigned surfaceWidth = 0; unsigned surfaceHeight = 0; void setDroppable(bool droppable); void setGeometry(Geometry geometry); void setMode(Canvas::Mode mode); void setSize(Size size); pCanvas(Canvas& canvas) : pWidget(canvas), canvas(canvas) {} void constructor(); void destructor(); void orphan(); void paint(); void rasterize(); void redraw(); void release(); }; struct pCheckButton : public pWidget { CheckButton& checkButton; HBITMAP hbitmap; HIMAGELIST himagelist; Size minimumSize(); void setChecked(bool checked); void setImage(const image& image, Orientation orientation); void setText(string text); pCheckButton(CheckButton& checkButton) : pWidget(checkButton), checkButton(checkButton) {} void constructor(); void destructor(); void orphan(); void onToggle(); }; struct pCheckLabel : public pWidget { CheckLabel& checkLabel; Size minimumSize(); void setChecked(bool checked); void setText(string text); pCheckLabel(CheckLabel& checkLabel) : pWidget(checkLabel), checkLabel(checkLabel) {} void constructor(); void destructor(); void orphan(); void onToggle(); }; struct pComboButton : public pWidget { ComboButton& comboButton; void append(string text); void remove(unsigned selection); Size minimumSize(); void reset(); void setGeometry(Geometry geometry); void setSelection(unsigned selection); void setText(unsigned selection, string text); pComboButton(ComboButton& comboButton) : pWidget(comboButton), comboButton(comboButton) {} void constructor(); void destructor(); void orphan(); void onChange(); }; struct pConsole : public pWidget { Console& console; LRESULT CALLBACK (*windowProc)(HWND, UINT, LPARAM, WPARAM); void print(string text); void reset(); pConsole(Console& console) : pWidget(console), console(console) {} void constructor(); void destructor(); void orphan(); bool keyPress(unsigned key); }; struct pFrame : public pWidget { Frame& frame; void setEnabled(bool enabled); void setGeometry(Geometry geometry); void setText(string text); void setVisible(bool visible); pFrame(Frame& frame) : pWidget(frame), frame(frame) {} void constructor(); void destructor(); void orphan(); }; struct pHexEdit : public pWidget { HexEdit& hexEdit; WindowProc windowProc = nullptr; HWND scrollBar = nullptr; void setColumns(unsigned columns); void setLength(unsigned length); void setOffset(unsigned offset); void setRows(unsigned rows); void update(); pHexEdit(HexEdit& hexEdit) : pWidget(hexEdit), hexEdit(hexEdit) {} void constructor(); void destructor(); void orphan(); bool keyPress(unsigned key); signed rows(); signed rowsScrollable(); signed scrollPosition(); void scrollTo(signed position); }; struct pHorizontalScroller : public pWidget { HorizontalScroller& horizontalScroller; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pHorizontalScroller(HorizontalScroller& horizontalScroller) : pWidget(horizontalScroller), horizontalScroller(horizontalScroller) {} void constructor(); void destructor(); void orphan(); void onChange(WPARAM wparam); }; struct pHorizontalSlider : public pWidget { HorizontalSlider& horizontalSlider; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pHorizontalSlider(HorizontalSlider& horizontalSlider) : pWidget(horizontalSlider), horizontalSlider(horizontalSlider) {} void constructor(); void destructor(); void orphan(); void onChange(); }; struct pLabel : public pWidget { Label& label; Size minimumSize(); void setText(string text); pLabel(Label& label) : pWidget(label), label(label) {} void constructor(); void destructor(); void orphan(); }; struct pLineEdit : public pWidget { LineEdit& lineEdit; Size minimumSize(); void setEditable(bool editable); void setText(string text); string text(); pLineEdit(LineEdit& lineEdit) : pWidget(lineEdit), lineEdit(lineEdit) {} void constructor(); void destructor(); void orphan(); void onChange(); }; struct pListView : public pWidget { ListView& listView; HIMAGELIST imageList; vector> imageMap; vector images; bool lostFocus; void append(const lstring& text); void autoSizeColumns(); void remove(unsigned selection); void reset(); void setCheckable(bool checkable); void setChecked(unsigned selection, bool checked); void setGeometry(Geometry geometry); void setHeaderText(const lstring& text); void setHeaderVisible(bool visible); void setImage(unsigned selection, unsigned position, const image& image); void setSelected(bool selected); void setSelection(unsigned selection); void setText(unsigned selection, unsigned position, string text); pListView(ListView& listView) : pWidget(listView), listView(listView), imageList(nullptr) {} void constructor(); void destructor(); void orphan(); void buildImageList(); void onActivate(LPARAM lparam); void onChange(LPARAM lparam); LRESULT onCustomDraw(LPARAM lparam); }; struct pProgressBar : public pWidget { ProgressBar& progressBar; Size minimumSize(); void setPosition(unsigned position); pProgressBar(ProgressBar& progressBar) : pWidget(progressBar), progressBar(progressBar) {} void constructor(); void destructor(); void orphan(); }; struct pRadioButton : public pWidget { RadioButton& radioButton; HBITMAP hbitmap; HIMAGELIST himagelist; Size minimumSize(); void setChecked(); void setGroup(const group& group); void setImage(const image& image, Orientation orientation); void setText(string text); pRadioButton(RadioButton& radioButton) : pWidget(radioButton), radioButton(radioButton) {} void constructor(); void destructor(); void orphan(); void onActivate(); }; struct pRadioLabel : public pWidget { RadioLabel& radioLabel; Size minimumSize(); void setChecked(); void setGroup(const group& group); void setText(string text); pRadioLabel(RadioLabel& radioLabel) : pWidget(radioLabel), radioLabel(radioLabel) {} void constructor(); void destructor(); void orphan(); void onActivate(); }; struct pTabFrame : public pWidget { TabFrame& tabFrame; WindowProc windowProc = nullptr; HIMAGELIST imageList = nullptr; void append(string text, const image& image); void remove(unsigned selection); void setEnabled(bool enabled); void setGeometry(Geometry geometry); void setImage(unsigned selection, const image& image); void setSelection(unsigned selection); void setText(unsigned selection, string text); void setVisible(bool visible); pTabFrame(TabFrame& tabFrame) : pWidget(tabFrame), tabFrame(tabFrame) {} void constructor(); void destructor(); void orphan(); void buildImageList(); void synchronizeLayout(); void onChange(); void onDrawItem(LPARAM lparam); }; struct pTextEdit : public pWidget { TextEdit& textEdit; void setCursorPosition(unsigned position); void setEditable(bool editable); void setText(string text); void setWordWrap(bool wordWrap); string text(); pTextEdit(TextEdit& textEdit) : pWidget(textEdit), textEdit(textEdit) {} void constructor(); void destructor(); void orphan(); void onChange(); }; struct pVerticalScroller : public pWidget { VerticalScroller& verticalScroller; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pVerticalScroller(VerticalScroller& verticalScroller) : pWidget(verticalScroller), verticalScroller(verticalScroller) {} void constructor(); void destructor(); void orphan(); void onChange(WPARAM wparam); }; struct pVerticalSlider : public pWidget { VerticalSlider& verticalSlider; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pVerticalSlider(VerticalSlider& verticalSlider) : pWidget(verticalSlider), verticalSlider(verticalSlider) {} void constructor(); void destructor(); void orphan(); void onChange(); }; struct pViewport : public pWidget { Viewport& viewport; uintptr_t handle(); void setDroppable(bool droppable); pViewport(Viewport& viewport) : pWidget(viewport), viewport(viewport) {} void constructor(); void destructor(); void orphan(); }; } sfc/controller/gamepad/000700 001750 001750 00000000000 12656700342 016227 5ustar00sergiosergio000000 000000 target-ethos/settings/audio.cpp000664 001750 001750 00000005003 12651764221 017761 0ustar00sergiosergio000000 000000 AudioSettings* audioSettings = nullptr; AudioSlider::AudioSlider() { append(name, {75, 0}); append(value, {75, 0}); append(slider, {~0, 0}); } AudioSettings::AudioSettings() { frequencyLabel.setText("Frequency:"); frequency.append("32000hz"); frequency.append("44100hz"); frequency.append("48000hz"); frequency.append("96000hz"); latencyLabel.setText("Latency:"); latency.append("20ms"); latency.append("40ms"); latency.append("60ms"); latency.append("80ms"); latency.append("100ms"); resamplerLabel.setText("Resampler:"); resampler.append("Linear"); resampler.append("Hermite"); resampler.append("Sinc"); volume.name.setText("Volume:"); volume.slider.setLength(201); append(controlLayout, {~0, 0}, 5); controlLayout.append(frequencyLabel, {0, 0}, 5); controlLayout.append(frequency, {~0, 0}, 5); controlLayout.append(latencyLabel, {0, 0}, 5); controlLayout.append(latency, {~0, 0}, 5); controlLayout.append(resamplerLabel, {0, 0}, 5); controlLayout.append(resampler, {~0, 0}); append(volume, {~0, 0}); switch(config->audio.frequency) { default: case 32000: frequency.setSelection(0); break; case 44100: frequency.setSelection(1); break; case 48000: frequency.setSelection(2); break; case 96000: frequency.setSelection(3); break; } switch(config->audio.latency) { default: case 20: latency.setSelection(0); break; case 40: latency.setSelection(1); break; case 60: latency.setSelection(2); break; case 80: latency.setSelection(3); break; case 100: latency.setSelection(4); break; } resampler.setSelection(config->audio.resampler); volume.slider.setPosition(config->audio.volume); frequency.onChange = latency.onChange = resampler.onChange = volume.slider.onChange = {&AudioSettings::synchronize, this}; synchronize(); } void AudioSettings::synchronize() { switch(frequency.selection()) { case 0: config->audio.frequency = 32000; break; case 1: config->audio.frequency = 44100; break; case 2: config->audio.frequency = 48000; break; case 3: config->audio.frequency = 96000; break; } switch(latency.selection()) { case 0: config->audio.latency = 20; break; case 1: config->audio.latency = 40; break; case 2: config->audio.latency = 60; break; case 3: config->audio.latency = 80; break; case 4: config->audio.latency = 100; break; } config->audio.resampler = resampler.selection(); config->audio.volume = volume.slider.position(); volume.value.setText({config->audio.volume, "%"}); utility->synchronizeRuby(); } phoenix/gtk/widget/progress-bar.cpp000664 001750 001750 00000001013 12651764221 020537 0ustar00sergiosergio000000 000000 namespace phoenix { Size pProgressBar::minimumSize() { return {0, 25}; } void pProgressBar::setPosition(unsigned position) { position = position <= 100 ? position : 0; gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(gtkWidget), (double)position / 100.0); } void pProgressBar::constructor() { gtkWidget = gtk_progress_bar_new(); setPosition(progressBar.state.position); } void pProgressBar::destructor() { gtk_widget_destroy(gtkWidget); } void pProgressBar::orphan() { destructor(); constructor(); } } fc/system/system.hpp000664 001750 001750 00000000550 12651764221 015661 0ustar00sergiosergio000000 000000 struct System { void run(); void runtosave(); void runthreadtosave(); void load(); void power(); void reset(); void init(); void term(); serializer serialize(); bool unserialize(serializer&); void serialize(serializer&); void serialize_all(serializer&); void serialize_init(); unsigned serialize_size; }; extern System system; phoenix/reference/widget/progress-bar.hpp000664 001750 001750 00000000417 12651764221 021724 0ustar00sergiosergio000000 000000 namespace phoenix { struct pProgressBar : public pWidget { ProgressBar& progressBar; void setPosition(unsigned position); pProgressBar(ProgressBar& progressBar) : pWidget(progressBar), progressBar(progressBar) {} void constructor(); void destructor(); }; } sfc/ppu/counter/counter.hpp000664 001750 001750 00000002706 12651764221 017143 0ustar00sergiosergio000000 000000 //PPUcounter emulates the H/V latch counters of the S-PPU2. // //real hardware has the S-CPU maintain its own copy of these counters that are //updated based on the state of the S-PPU Vblank and Hblank pins. emulating this //would require full lock-step synchronization for every clock tick. //to bypass this and allow the two to run out-of-order, both the CPU and PPU //classes inherit PPUcounter and keep their own counters. //the timers are kept in sync, as the only differences occur on V=240 and V=261, //based on interlace. thus, we need only synchronize and fetch interlace at any //point before this in the frame, which is handled internally by this class at //V=128. class PPUcounter { public: alwaysinline void tick(); alwaysinline void tick(unsigned clocks); alwaysinline bool field () const; alwaysinline uint16 vcounter() const; alwaysinline uint16 hcounter() const; inline uint16 hdot() const; inline uint16 lineclocks() const; alwaysinline bool field (unsigned offset) const; alwaysinline uint16 vcounter(unsigned offset) const; alwaysinline uint16 hcounter(unsigned offset) const; inline void reset(); function scanline; void serialize(serializer&); private: inline void vcounter_tick(); struct { bool interlace; bool field; uint16 vcounter; uint16 hcounter; } status; struct { bool field[2048]; uint16 vcounter[2048]; uint16 hcounter[2048]; int32 index; } history; }; sfc/cpu/serialization.cpp000664 001750 001750 00000005464 12651764221 016644 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP void CPU::serialize(serializer& s) { R65816::serialize(s); Thread::serialize(s); PPUcounter::serialize(s); s.array(wram); s.integer(cpu_version); s.integer(status.interrupt_pending); s.integer(status.clock_count); s.integer(status.line_clocks); s.integer(status.irq_lock); s.integer(status.dram_refresh_position); s.integer(status.dram_refreshed); s.integer(status.hdma_init_position); s.integer(status.hdma_init_triggered); s.integer(status.hdma_position); s.integer(status.hdma_triggered); s.integer(status.nmi_valid); s.integer(status.nmi_line); s.integer(status.nmi_transition); s.integer(status.nmi_pending); s.integer(status.nmi_hold); s.integer(status.irq_valid); s.integer(status.irq_line); s.integer(status.irq_transition); s.integer(status.irq_pending); s.integer(status.irq_hold); s.integer(status.reset_pending); s.integer(status.dma_active); s.integer(status.dma_counter); s.integer(status.dma_clocks); s.integer(status.dma_pending); s.integer(status.hdma_pending); s.integer(status.hdma_mode); s.integer(status.auto_joypad_active); s.integer(status.auto_joypad_latch); s.integer(status.auto_joypad_counter); s.integer(status.auto_joypad_clock); s.array(status.port); s.integer(status.wram_addr); s.integer(status.joypad_strobe_latch); s.integer(status.joypad1_bits); s.integer(status.joypad2_bits); s.integer(status.nmi_enabled); s.integer(status.hirq_enabled); s.integer(status.virq_enabled); s.integer(status.auto_joypad_poll); s.integer(status.pio); s.integer(status.wrmpya); s.integer(status.wrmpyb); s.integer(status.wrdiva); s.integer(status.wrdivb); s.integer(status.hirq_pos); s.integer(status.virq_pos); s.integer(status.rom_speed); s.integer(status.rddiv); s.integer(status.rdmpy); s.integer(status.joy1); s.integer(status.joy2); s.integer(status.joy3); s.integer(status.joy4); s.integer(alu.mpyctr); s.integer(alu.divctr); s.integer(alu.shift); for(unsigned i = 0; i < 8; i++) { s.integer(channel[i].dma_enabled); s.integer(channel[i].hdma_enabled); s.integer(channel[i].direction); s.integer(channel[i].indirect); s.integer(channel[i].unused); s.integer(channel[i].reverse_transfer); s.integer(channel[i].fixed_transfer); s.integer(channel[i].transfer_mode); s.integer(channel[i].dest_addr); s.integer(channel[i].source_addr); s.integer(channel[i].source_bank); s.integer(channel[i].transfer_size); s.integer(channel[i].indirect_bank); s.integer(channel[i].hdma_addr); s.integer(channel[i].line_counter); s.integer(channel[i].unknown); s.integer(channel[i].hdma_completed); s.integer(channel[i].hdma_do_transfer); } s.integer(pipe.valid); s.integer(pipe.addr); s.integer(pipe.data); } #endif sfc/alt/ppu-performance/cache/cache.hpp000664 001750 001750 00000000453 12651764221 021167 0ustar00sergiosergio000000 000000 struct Cache { uint8* tiledata[3]; uint8* tilevalid[3]; uint8* tile_2bpp(unsigned tile); uint8* tile_4bpp(unsigned tile); uint8* tile_8bpp(unsigned tile); uint8* tile(unsigned bpp, unsigned tile); void serialize(serializer&); Cache(PPU& self); PPU& self; friend class PPU; }; target-ethos/resource/resource.cpp000664 001750 001750 00000120515 12651764221 020504 0ustar00sergiosergio000000 000000 namespace resource { const uint8_t advanced[611] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255, 97,0,0,0,6,98,75,71,68,0,255,0,255,0,255,160,189,167,147,0,0,0,9,112,72,89,115,0,0,11,19,0, 0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,213,9,26,12,19,57,139,99,194,72,0,0,1,240,73, 68,65,84,56,203,165,146,75,104,19,97,20,133,191,153,248,76,138,77,20,10,130,74,176,204,198,133,182,221,69,172,46, 52,20,98,102,235,66,112,33,84,164,168,181,45,18,82,2,21,3,67,66,160,107,65,116,101,64,138,226,194,137,141,208, 98,87,130,210,54,137,73,23,21,130,85,105,211,151,134,32,68,68,58,51,110,102,134,49,29,235,194,179,251,185,231,156, 123,239,185,63,252,39,4,231,35,157,81,162,128,10,200,241,88,34,247,23,77,52,157,81,108,142,216,82,84,251,175,246, 3,168,166,153,171,248,250,181,1,205,108,180,29,233,140,98,52,26,117,35,157,81,12,247,90,195,170,69,1,196,116,70, 137,90,100,171,171,215,219,230,102,28,5,120,240,240,62,241,88,66,6,114,0,34,160,14,222,28,50,158,62,155,48,0, 245,246,173,17,54,215,215,144,58,37,234,245,175,247,90,179,137,221,25,21,44,49,128,96,21,111,12,12,26,154,182,37, 232,186,110,232,186,70,97,126,78,40,188,47,2,200,59,5,43,180,116,176,17,233,187,72,185,82,97,185,246,5,32,25, 143,37,238,254,243,140,78,188,202,191,52,74,149,18,221,39,123,40,150,11,152,19,76,2,186,171,65,48,146,58,12,212, 172,247,149,144,78,215,9,137,163,71,142,209,108,54,121,55,247,22,183,53,60,78,241,248,112,152,190,80,39,29,1,47, 217,153,77,142,183,127,75,46,125,94,58,215,125,170,135,128,63,192,74,109,249,242,133,240,249,249,233,169,215,85,192,0, 16,131,145,84,23,80,123,52,38,51,91,94,100,182,188,72,199,65,31,0,230,222,114,46,255,2,73,146,56,123,186,215, 250,100,118,30,34,80,28,31,14,51,245,166,196,150,166,35,238,243,179,81,111,218,35,154,35,203,217,39,143,57,208,238, 231,76,168,23,96,204,105,0,192,238,93,30,246,248,14,241,243,199,47,178,249,5,128,112,171,73,46,175,82,253,88,253, 35,108,17,96,101,227,59,251,125,1,218,246,122,120,62,243,1,32,252,105,114,116,218,73,52,77,146,107,235,171,11,64, 210,190,66,48,146,186,4,76,56,184,219,196,59,225,55,55,226,213,246,234,188,84,188,0,0,0,0,73,69,78,68,174, 66,96,130, }; const uint8_t audio[592] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255, 97,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100,136,0,0,0,25,116,69,88,116,83,111,102,116,119,97,114, 101,0,119,119,119,46,105,110,107,115,99,97,112,101,46,111,114,103,155,238,60,26,0,0,1,226,73,68,65,84,56,141, 165,147,191,79,83,81,20,199,63,231,246,245,165,68,168,3,193,201,63,64,99,66,4,139,128,113,100,241,71,88,40,88, 162,46,36,242,106,58,233,0,127,132,49,93,173,12,13,137,160,169,105,2,196,133,196,168,131,131,137,16,23,69,172,147, 58,176,184,152,247,76,244,93,222,61,14,198,218,22,140,65,191,227,57,159,156,123,190,223,123,175,168,42,255,35,243,167, 70,126,58,159,11,130,32,253,79,3,10,133,137,193,20,242,56,142,227,212,129,7,20,10,19,131,105,63,243,84,85,179, 173,245,161,224,94,112,122,118,121,172,147,247,46,77,79,134,64,198,243,188,175,168,222,73,251,153,235,51,51,51,217,202, 221,74,210,10,58,167,239,141,104,53,23,60,236,223,168,76,126,105,110,32,72,166,124,187,236,205,207,205,31,86,152,43, 149,74,217,209,145,51,120,158,7,64,110,118,169,56,114,109,233,232,230,194,213,39,10,235,104,124,179,205,130,162,244,245, 29,225,248,177,19,168,170,12,156,60,69,38,211,133,136,0,32,66,111,34,148,1,68,101,69,144,209,61,25,188,217,122, 205,187,198,91,0,26,141,109,182,183,183,176,214,2,144,114,44,2,99,34,136,26,247,10,116,72,4,105,102,0,16,134, 97,115,101,187,107,81,126,191,141,93,163,137,168,164,0,172,209,196,79,164,45,120,3,16,70,33,97,20,162,170,216,216, 98,99,219,4,4,83,64,244,153,42,234,37,169,1,96,83,91,78,48,0,81,20,177,179,179,3,192,135,79,31,137,109, 220,26,191,167,164,111,252,132,245,130,194,139,182,107,84,85,173,215,235,137,136,88,35,102,113,117,117,229,242,248,197,241, 238,95,192,203,133,43,183,0,134,139,247,71,129,60,98,250,59,45,244,168,106,183,115,174,123,121,233,65,209,126,79,206, 173,61,90,139,156,115,109,94,93,226,134,65,139,27,149,233,207,173,117,217,239,51,77,77,77,157,197,184,245,67,93,61, 189,213,106,245,219,30,160,51,196,78,213,106,181,231,56,115,222,247,253,100,191,254,95,55,56,136,126,0,228,148,200,42, 201,231,90,24,0,0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t cheatEditor[937] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255, 97,0,0,0,6,98,75,71,68,0,255,0,255,0,255,160,189,167,147,0,0,0,9,112,72,89,115,0,0,11,19,0, 0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,213,11,28,23,56,34,56,174,182,224,0,0,3,54,73, 68,65,84,56,203,93,147,75,76,92,117,20,198,191,255,99,230,222,121,128,115,65,96,102,128,162,19,4,154,73,83,19, 23,197,87,221,24,74,210,141,169,85,27,31,171,54,193,84,107,213,210,102,72,67,26,98,162,13,148,88,155,52,172,76, 136,143,133,27,92,17,18,187,168,166,52,93,24,181,117,12,29,168,52,242,152,41,101,24,198,14,51,112,231,206,253,255, 143,27,192,73,191,213,57,223,201,247,203,73,78,14,195,182,70,70,47,246,2,248,206,52,205,135,167,62,248,56,142,42, 141,140,94,28,147,82,190,245,201,233,254,186,106,127,122,28,239,241,157,70,8,49,241,225,201,211,150,109,219,139,87,199, 174,12,238,248,151,191,26,205,28,234,233,237,3,112,231,177,240,203,0,190,222,5,40,165,204,123,243,179,252,196,241,190, 30,165,212,126,0,24,190,244,197,43,209,230,104,164,88,218,96,90,235,238,170,112,59,227,98,146,49,225,217,5,112,206, 75,11,11,255,192,52,12,86,46,151,227,87,199,174,12,74,41,175,197,98,49,172,60,88,209,90,235,249,237,176,197,133, 184,222,209,253,105,80,120,106,84,245,6,61,169,84,10,203,233,37,118,226,120,95,167,109,219,239,119,117,117,121,24,56, 230,239,207,3,192,15,211,227,240,112,33,166,90,227,71,155,234,90,14,49,0,216,5,156,235,31,184,197,57,95,156,155, 155,133,105,152,204,10,89,81,210,64,118,109,85,3,152,60,123,38,241,25,23,98,188,190,249,192,254,104,199,155,30,80, 9,68,244,63,0,0,180,214,71,102,238,206,208,234,234,10,92,229,98,99,163,128,100,50,233,0,24,186,249,13,63,239, 15,181,189,22,123,238,148,233,22,39,161,221,13,0,143,1,206,158,73,252,198,57,255,118,118,46,165,67,161,16,50,15, 50,68,68,227,207,215,39,158,242,120,107,207,119,118,15,248,221,210,52,42,91,139,208,202,6,136,192,170,1,19,225,240, 168,75,116,210,205,231,77,184,46,158,14,55,33,77,122,51,120,208,246,190,112,105,64,74,190,134,98,238,6,12,211,132, 55,244,6,110,255,148,80,2,0,38,34,145,193,35,149,202,245,78,203,234,14,9,33,149,114,169,236,58,168,11,212,176, 70,211,240,24,203,38,255,117,120,10,158,198,28,178,91,119,17,106,108,2,247,182,99,245,254,207,196,127,140,70,223,117, 114,185,161,206,112,88,207,44,45,93,43,108,109,58,249,194,6,247,29,214,45,66,50,252,107,151,80,136,153,104,111,168, 71,50,49,135,252,148,68,197,113,160,221,50,8,4,238,58,206,240,190,214,86,74,45,47,95,56,166,84,111,173,233,83, 194,231,83,141,175,243,239,255,206,172,32,24,12,32,254,101,3,242,47,173,185,123,163,17,42,222,240,66,85,42,112,221, 77,128,8,28,229,114,189,227,56,234,152,82,159,79,6,2,151,61,82,154,194,66,193,111,181,31,8,61,187,7,126,146, 184,55,244,23,204,87,183,36,24,49,93,208,112,29,7,170,178,9,128,32,225,245,102,130,126,255,158,219,109,109,101,173, 181,156,89,75,23,155,47,60,225,111,217,123,212,8,156,251,5,201,143,254,64,199,157,48,42,191,215,64,107,130,172,149, 80,218,221,6,0,226,109,203,202,165,215,215,95,92,119,28,153,103,196,194,253,90,60,115,248,29,131,115,15,140,134,39, 97,68,235,144,94,200,34,155,45,224,145,87,33,62,114,16,190,72,12,68,12,143,30,254,73,172,234,65,246,1,184,197, 152,52,133,244,59,0,1,68,219,83,218,61,53,237,212,68,80,202,246,253,7,17,166,115,66,199,238,239,170,0,0,0, 0,73,69,78,68,174,66,96,130, }; const uint8_t folder[1176] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122, 244,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100,136,0,0,0,9,112,72,89,115,0,0,13,215,0,0,13, 215,1,66,40,155,120,0,0,0,25,116,69,88,116,83,111,102,116,119,97,114,101,0,119,119,119,46,105,110,107,115,99, 97,112,101,46,111,114,103,155,238,60,26,0,0,4,21,73,68,65,84,88,133,237,151,61,111,28,69,24,199,127,51,187, 119,123,175,246,57,145,48,9,5,86,148,194,31,0,9,5,33,83,110,149,130,26,137,2,90,58,62,64,36,62,64,74, 132,68,133,104,161,67,72,167,64,23,201,138,2,138,210,69,194,198,196,40,22,198,247,186,119,222,151,153,157,25,138,123, 201,58,119,142,19,114,82,40,248,75,143,118,118,118,247,121,126,243,60,51,179,187,34,12,67,94,167,228,107,141,254,95, 0,240,1,110,220,184,225,43,165,126,54,198,188,119,209,3,66,136,220,90,251,249,195,135,15,191,92,25,64,154,166,91, 149,74,229,157,155,55,111,250,73,146,224,156,3,192,90,11,48,63,159,182,253,59,119,238,220,222,222,222,254,254,209,163, 71,199,43,1,80,74,101,213,106,213,29,29,29,209,233,116,112,206,45,53,0,33,4,155,155,155,249,193,193,193,71,192, 237,149,0,104,173,211,44,203,196,165,75,27,24,99,176,214,158,9,92,204,132,16,130,106,181,90,63,60,60,252,98,123, 123,251,214,172,127,153,156,115,218,90,251,241,222,222,222,143,207,5,0,178,44,203,188,78,167,75,167,211,153,3,204,142, 179,32,197,64,91,91,91,245,70,163,65,179,217,68,8,129,16,2,0,41,229,188,29,69,17,247,238,221,187,5,60,31, 224,242,229,203,105,191,223,247,54,54,90,104,173,23,0,150,149,98,166,56,142,1,230,16,69,139,227,24,99,76,237,188, 224,115,128,221,221,93,117,237,218,53,217,235,245,230,25,0,150,130,204,178,81,212,108,196,197,224,82,202,25,64,229,66, 0,0,99,140,109,54,215,100,154,102,220,63,180,220,221,63,27,228,188,58,63,171,25,204,228,153,22,206,93,185,206,219, 31,232,226,61,158,39,190,93,255,253,155,79,206,0,56,231,116,183,219,245,187,221,46,143,59,13,62,253,240,93,174,191, 181,81,112,54,61,62,47,250,18,200,105,207,60,206,147,206,152,175,190,187,255,254,236,188,152,1,221,104,212,171,90,107, 212,31,146,102,181,204,254,223,99,162,56,159,140,108,233,104,207,35,17,11,77,1,52,42,62,42,211,8,65,103,118,121, 190,21,27,99,116,191,63,160,219,237,18,103,150,122,181,132,53,147,27,228,212,193,179,134,59,207,220,83,179,19,179,214, 145,100,134,52,203,193,137,249,6,86,44,65,86,169,4,180,90,45,50,35,168,5,37,172,83,120,114,53,175,139,113,154, 83,111,250,140,134,57,214,186,39,11,0,121,158,171,40,26,209,239,15,208,230,13,170,129,143,115,14,79,158,155,231,23, 147,131,81,170,209,185,37,240,37,113,170,173,49,249,209,2,128,49,38,43,151,75,84,155,27,172,213,202,56,64,10,177, 188,248,47,40,227,28,163,84,147,91,135,231,9,130,178,199,105,146,41,33,196,201,2,128,181,54,27,141,198,28,15,20, 235,245,75,232,220,190,210,232,51,109,137,51,3,78,224,79,253,148,61,201,232,84,229,130,167,147,176,152,129,212,247,125, 188,32,160,73,153,76,217,11,131,76,230,152,195,186,201,62,97,236,196,84,110,151,173,72,156,131,193,40,181,185,115,139, 0,214,218,100,60,30,211,25,248,84,90,101,162,68,147,233,233,75,8,200,141,69,27,135,206,45,185,153,110,203,47,153, 149,68,25,134,227,196,19,210,91,90,130,84,8,129,12,26,148,74,62,163,68,19,37,154,84,25,148,182,47,29,108,153, 226,44,231,52,209,62,231,148,32,142,227,83,122,81,133,74,13,30,159,196,12,99,189,212,209,191,145,0,134,177,66,25, 83,250,245,234,94,47,124,252,12,128,181,54,6,129,245,107,100,185,37,138,53,74,95,60,15,94,84,82,10,78,134,9, 82,200,56,220,221,157,59,62,51,7,146,36,33,74,12,87,175,4,84,3,143,160,188,186,111,86,41,4,105,170,144,82, 12,139,253,197,18,36,0,154,18,235,85,143,122,105,21,85,127,42,231,28,253,36,65,88,59,88,0,104,183,219,98,103, 103,199,68,177,98,112,234,248,243,100,136,236,190,226,14,184,68,199,199,67,155,36,195,7,187,237,118,45,12,195,120,14, 0,120,81,20,253,244,203,161,248,76,173,227,255,182,255,202,31,187,103,228,192,2,88,157,30,28,63,248,225,235,226,53, 49,251,53,107,183,219,205,96,109,237,205,90,208,218,116,56,41,133,92,201,18,200,141,49,42,75,107,185,16,121,62,58, 233,1,127,133,97,216,91,0,152,66,72,32,96,146,153,124,21,0,83,5,64,10,168,48,12,207,44,45,241,255,207,233, 235,6,248,7,188,50,165,151,203,8,55,43,0,0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t game[1490] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122, 244,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100,136,0,0,5,137,73,68,65,84,88,133,237,150,91,108,20, 231,21,199,127,231,155,155,151,181,124,89,3,181,113,193,183,13,16,81,82,21,225,52,50,1,132,91,53,20,212,132,155, 212,84,149,18,161,40,82,213,151,72,68,81,108,212,74,121,168,122,81,165,190,24,171,125,141,218,226,66,171,66,91,37, 65,145,82,225,2,9,6,148,132,40,73,9,55,219,4,112,146,58,49,23,239,125,102,190,62,204,236,120,236,176,182,1, 169,79,29,233,232,236,203,156,255,239,252,207,249,190,29,248,255,115,31,79,182,135,157,153,94,116,102,47,91,239,181,134, 186,31,113,173,216,159,173,249,10,90,243,215,76,47,91,254,103,0,217,30,118,106,225,143,183,219,215,219,250,225,103,201, 180,173,179,53,28,186,23,136,187,6,8,58,151,253,147,233,13,142,151,106,97,226,76,63,238,194,54,50,237,143,222,19, 132,220,173,56,134,57,144,95,243,3,43,111,8,147,31,253,3,180,7,98,80,189,226,123,152,159,95,102,193,197,227,69, 129,237,201,95,240,234,124,106,206,219,129,108,47,59,48,204,1,111,211,139,150,145,254,22,217,11,175,160,68,163,148,66, 137,38,123,225,21,252,133,105,114,233,245,129,19,123,249,238,124,234,206,203,129,108,47,59,180,48,224,111,124,193,150,150, 46,138,19,23,64,107,4,184,253,225,1,220,155,163,160,65,139,34,153,222,140,57,62,76,213,197,227,69,17,182,37,127, 206,107,179,213,158,211,129,64,92,6,178,15,108,180,189,134,86,74,19,23,17,64,68,16,17,204,68,93,224,130,161,80, 2,185,203,175,227,54,180,145,79,175,179,181,230,240,92,78,204,234,64,36,158,126,212,246,83,203,64,187,56,141,107,65, 160,52,126,142,252,245,147,248,185,207,167,94,208,58,72,8,137,214,110,140,241,17,170,46,189,57,171,19,21,29,200,246, 176,93,139,12,228,210,235,108,63,245,85,242,163,255,68,187,249,168,115,63,51,6,133,137,160,251,40,12,68,41,148,8, 249,43,71,241,26,150,145,111,127,196,22,164,226,78,220,17,32,219,195,118,95,228,79,217,116,151,237,213,53,147,191,50, 136,8,129,128,8,34,10,17,65,41,99,70,168,169,12,20,174,30,195,91,216,66,182,173,211,169,4,241,37,128,178,120, 174,227,17,219,175,91,66,225,234,49,20,160,68,161,172,5,80,158,125,205,82,204,228,226,105,226,18,101,21,65,20,175, 158,192,75,45,37,219,182,214,17,228,208,100,15,155,43,2,100,122,217,22,136,63,108,251,117,77,20,174,190,137,8,72, 185,168,83,27,117,111,47,92,73,242,107,79,97,47,94,61,189,243,16,72,194,113,136,64,113,108,8,175,174,153,108,235, 26,71,41,57,28,135,136,0,244,75,40,224,80,177,190,209,102,201,215,41,140,157,14,108,151,169,249,154,53,205,136,72, 232,66,0,34,165,201,169,217,71,89,97,88,85,88,245,29,40,195,10,156,248,236,29,212,3,143,81,168,89,236,136,76, 45,100,4,32,47,225,227,179,205,158,248,164,40,215,222,193,105,90,19,21,20,81,24,201,69,40,59,137,136,160,115,227, 228,222,221,71,238,221,126,252,204,245,72,220,176,18,209,8,140,154,165,44,88,190,29,179,182,5,49,76,18,45,221,56, 185,12,206,237,255,20,181,158,218,133,105,35,72,254,138,191,9,250,251,137,225,51,69,243,198,117,236,198,111,32,202,68, 148,194,94,180,122,234,4,220,188,140,200,116,203,205,234,38,18,15,61,131,149,90,142,89,221,136,149,90,142,8,36,58, 182,80,219,245,83,18,84,33,39,250,139,190,231,63,81,253,75,142,68,141,223,233,20,100,122,217,134,200,129,98,251,90, 219,79,53,225,223,184,68,98,245,110,148,225,128,8,197,243,127,70,231,198,131,113,68,173,88,56,171,118,163,37,236,73, 107,52,160,18,13,232,145,33,244,241,254,146,246,220,199,227,226,21,1,166,65,164,59,109,107,197,86,84,162,1,9,174, 64,40,78,226,126,252,6,160,49,106,59,240,198,223,195,88,210,133,170,237,8,133,53,104,144,170,122,244,232,16,254,177, 59,139,207,10,80,134,208,168,131,170,251,121,75,45,93,131,206,127,17,118,45,248,55,47,66,225,38,102,227,90,180,214, 81,169,224,183,6,39,20,255,215,190,138,226,115,2,64,120,47,24,230,65,99,211,30,83,39,171,241,174,31,199,168,107, 71,223,56,15,94,1,107,229,15,65,153,83,215,176,214,96,215,161,71,79,226,205,33,62,47,128,50,132,54,140,3,254, 242,78,75,234,27,17,237,66,241,22,214,146,46,164,174,131,80,25,173,65,236,26,252,209,33,188,193,190,146,214,238,19, 115,253,27,206,247,131,196,248,108,15,59,146,85,242,7,86,126,211,182,59,127,140,246,242,168,240,78,40,3,96,85,227, 141,156,194,27,236,43,77,228,220,93,205,191,225,53,192,3,252,138,133,103,17,85,128,13,84,1,206,175,223,98,244,201, 85,92,72,101,174,109,241,201,24,102,115,39,248,110,112,52,145,72,188,52,216,231,190,255,169,251,244,131,253,28,5,204, 80,163,124,220,191,4,82,9,192,2,156,153,241,219,51,92,249,118,27,151,155,115,195,223,145,69,29,134,170,95,134,248, 46,88,73,252,145,33,74,131,125,238,209,97,247,71,221,47,115,44,38,94,6,80,4,142,135,91,90,25,192,8,1,236, 88,68,16,47,159,229,90,103,147,30,110,187,117,170,91,26,90,149,212,183,226,143,156,164,56,216,231,30,254,183,187,103, 215,65,222,10,197,227,162,241,81,107,130,177,204,10,96,134,16,102,8,80,6,114,0,231,192,7,140,173,72,249,87,86, 76,158,218,160,111,127,170,74,111,255,197,251,253,89,247,39,207,252,157,211,49,209,184,160,31,134,23,203,21,1,252,24, 189,17,203,101,48,3,176,14,159,99,172,165,198,191,182,218,26,89,255,187,51,254,207,158,59,194,233,25,66,238,140,40, 197,34,26,193,108,167,160,188,7,118,44,199,195,138,1,150,187,44,11,20,103,68,33,150,167,45,226,124,142,97,121,28, 54,211,71,83,22,143,47,150,23,235,62,14,51,173,235,187,5,184,211,59,113,241,114,141,153,179,158,215,243,95,119,198, 63,107,9,247,71,127,0,0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t home[606] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255, 97,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187,127,0,0,0,9,112,72,89,115,0,0,13,215,0, 0,13,215,1,66,40,155,120,0,0,0,7,116,73,77,69,7,213,10,14,20,37,19,83,42,210,59,0,0,1,235,73, 68,65,84,56,203,149,147,191,107,83,81,20,128,191,123,251,222,75,211,64,242,36,160,85,135,100,81,123,19,104,85,172, 17,92,28,140,66,19,167,135,212,74,39,145,162,163,24,92,58,180,110,193,169,254,24,234,212,37,139,245,199,96,19,240, 15,240,63,16,121,91,92,196,90,219,240,98,81,137,33,121,215,33,246,217,151,80,33,103,186,92,206,247,221,115,14,231, 194,1,225,41,85,172,128,174,128,246,148,122,200,48,177,7,123,74,105,79,169,61,73,113,104,120,177,56,163,203,55,111, 252,87,34,250,225,154,235,110,20,148,98,253,220,89,182,39,78,113,228,240,56,39,188,38,83,107,107,212,92,151,130,82, 215,14,185,110,117,64,176,31,126,83,156,97,247,248,49,148,202,50,22,141,210,106,181,24,219,252,74,182,92,30,144,136, 126,184,122,251,22,157,100,146,116,42,77,42,149,2,64,107,104,183,219,236,214,235,156,44,149,66,18,177,31,126,247,160, 68,199,48,201,229,46,96,219,118,208,154,214,26,0,223,247,249,185,181,69,114,110,46,144,136,10,232,130,82,188,127,84, 198,107,54,57,63,157,35,30,143,35,132,8,9,124,223,15,206,134,16,140,230,243,212,92,23,3,184,3,172,78,157,62, 195,253,210,61,54,170,111,3,240,201,202,51,86,30,63,69,139,17,116,167,133,48,70,209,221,223,44,47,45,209,238,165, 204,202,121,120,190,48,153,33,17,79,0,160,212,4,153,140,34,155,205,244,94,20,146,145,244,149,222,196,83,121,144,22, 90,107,22,38,51,204,195,186,236,239,211,178,44,76,211,196,48,140,224,254,75,227,7,0,31,234,59,116,187,126,144,11, 48,32,144,82,34,165,196,146,159,1,232,96,241,241,83,3,128,111,222,47,58,34,18,90,36,99,96,179,254,14,207,231, 40,0,151,46,78,115,53,26,67,234,113,46,75,147,237,77,66,21,24,253,21,252,155,126,239,165,239,222,14,162,217,56, 112,245,3,65,36,18,193,182,109,18,137,4,2,137,16,16,139,197,112,28,103,0,178,44,43,252,23,174,207,58,175,0, 135,225,98,245,229,139,215,119,255,0,86,248,213,163,133,187,128,26,0,0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t hotkeys[587] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255, 97,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100,136,0,0,0,9,112,72,89,115,0,0,13,215,0,0,13, 215,1,66,40,155,120,0,0,0,25,116,69,88,116,83,111,102,116,119,97,114,101,0,119,119,119,46,105,110,107,115,99, 97,112,101,46,111,114,103,155,238,60,26,0,0,1,200,73,68,65,84,56,141,181,146,177,107,83,81,20,198,127,247,222, 115,95,95,8,73,159,136,180,209,38,177,21,7,165,21,26,16,204,228,34,102,8,8,34,212,168,127,72,193,191,160,131, 45,174,29,178,184,180,116,17,212,12,25,4,23,137,32,168,56,85,227,146,162,85,112,145,212,190,151,52,125,185,14,109, 53,29,164,193,226,7,151,115,46,231,124,223,189,231,240,169,82,169,196,113,160,15,146,122,189,174,142,37,48,191,48,159, 30,134,80,169,84,252,193,187,58,24,161,88,156,157,242,60,223,3,239,187,136,216,100,210,88,99,196,199,152,139,190,245, 175,2,87,28,76,3,30,74,189,72,38,82,229,106,181,26,203,31,45,127,195,57,123,201,250,186,108,69,143,59,103,50, 32,99,86,108,216,239,179,174,148,187,15,242,174,213,106,253,204,159,157,104,110,111,255,40,0,175,127,11,52,26,141,93, 224,205,254,249,219,247,131,252,228,196,50,142,157,173,173,206,251,67,59,56,10,115,119,230,174,163,226,183,202,169,200,104, 175,80,171,213,186,0,114,20,113,239,229,91,151,193,61,82,112,111,101,101,237,249,96,77,45,173,45,37,78,118,131,166, 159,24,57,163,181,70,27,141,86,123,209,104,131,214,10,173,13,206,57,0,246,123,94,61,88,120,88,4,144,157,86,120, 45,83,184,112,106,102,122,6,107,61,68,4,43,22,99,4,173,13,56,71,223,245,137,162,136,48,10,49,90,211,104,188, 156,173,84,110,158,95,93,125,220,20,17,239,118,144,62,225,133,97,135,205,175,159,72,37,211,160,0,20,74,41,218,237, 54,249,92,142,56,142,249,178,249,153,108,54,79,106,52,144,245,15,31,111,0,139,98,180,46,7,65,0,206,145,61,157, 99,183,31,31,154,127,52,157,166,215,235,1,138,169,201,115,116,186,93,50,99,227,102,196,179,119,129,69,137,227,120,227, 233,179,39,90,169,225,157,236,156,3,199,55,24,112,226,191,98,104,31,252,55,129,95,252,113,137,228,164,151,154,151,0, 0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t input[812] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255, 97,0,0,0,6,98,75,71,68,0,172,0,77,0,0,52,214,215,123,0,0,0,9,112,72,89,115,0,0,11,19,0, 0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,213,4,7,15,10,39,178,201,163,153,0,0,0,140,116, 69,88,116,67,111,109,109,101,110,116,0,77,101,110,117,45,115,105,122,101,100,32,105,99,111,110,10,61,61,61,61,61, 61,61,61,61,61,10,10,40,99,41,32,50,48,48,51,32,74,97,107,117,98,32,39,106,105,109,109,97,99,39,32,83, 116,101,105,110,101,114,44,32,10,104,116,116,112,58,47,47,106,105,109,109,97,99,46,109,117,115,105,99,104,97,108,108, 46,99,122,10,10,99,114,101,97,116,101,100,32,119,105,116,104,32,116,104,101,32,71,73,77,80,44,10,104,116,116,112, 58,47,47,119,119,119,46,103,105,109,112,46,111,114,103,103,138,199,71,0,0,2,33,73,68,65,84,56,203,149,146,203, 107,83,65,20,198,127,147,220,228,38,214,210,164,177,54,245,209,135,160,184,73,176,20,255,130,130,123,17,138,136,130,168, 32,88,8,193,133,173,15,180,221,136,46,68,10,10,130,72,22,93,213,186,19,68,208,133,187,34,84,179,19,68,20,42, 21,53,53,183,105,244,230,117,111,230,184,184,105,154,66,178,232,129,3,195,240,205,55,191,249,230,40,58,212,199,179,132, 255,170,221,51,97,41,95,2,124,235,42,178,96,80,191,58,62,95,40,181,234,84,167,195,117,124,223,250,14,237,141,27, 225,16,162,53,142,93,102,237,251,186,181,161,122,6,79,204,231,237,77,173,175,157,129,70,165,99,67,177,184,175,43,140, 235,247,99,21,107,216,174,143,129,35,253,189,192,253,86,173,175,195,11,82,129,93,97,252,166,137,17,12,16,12,26,252, 94,181,136,14,198,137,200,198,153,86,161,145,74,79,206,0,119,90,55,203,86,6,167,84,193,202,217,116,71,187,40,230, 255,225,214,28,220,170,67,69,153,209,84,250,178,52,164,179,42,149,158,148,185,135,143,182,93,255,235,229,61,170,203,115, 88,185,34,249,181,18,162,96,223,240,30,162,177,46,234,135,47,112,240,212,109,108,219,230,198,173,41,12,0,173,53,133, 66,97,11,235,248,57,114,111,30,211,63,212,199,200,104,15,134,25,160,248,243,15,185,85,135,3,231,47,98,89,22,65, 51,184,149,129,104,241,90,188,86,129,16,3,215,151,88,212,167,249,186,244,133,207,239,62,241,170,52,206,254,155,239,81, 129,16,34,2,141,71,120,4,162,209,34,32,226,125,172,0,134,137,27,234,101,228,193,42,43,43,43,228,223,190,134,128, 137,214,26,192,51,105,18,136,96,189,184,198,143,233,97,214,23,167,26,68,26,183,238,182,36,35,72,93,35,186,209,13, 3,163,153,252,242,2,82,43,81,90,94,160,251,228,93,0,142,37,71,121,250,236,73,115,93,23,221,68,111,230,181,25, 98,104,108,130,202,135,231,132,198,38,208,90,163,68,72,36,146,36,18,73,68,20,74,137,135,223,48,216,70,96,154,38, 71,175,100,128,76,219,169,178,109,111,114,203,229,50,0,149,74,101,59,65,54,155,197,117,93,118,82,74,169,45,131,72, 36,210,68,2,168,86,171,0,212,106,181,142,6,142,227,120,70,237,70,121,7,53,251,31,168,192,0,159,97,230,172,204, 0,0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t server[408] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255, 97,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187,127,0,0,0,9,112,72,89,115,0,0,11,18,0, 0,11,18,1,210,221,126,252,0,0,0,7,116,73,77,69,7,214,2,16,22,3,20,11,54,9,17,0,0,1,37,73, 68,65,84,56,203,157,146,61,75,195,80,20,134,159,155,92,242,63,164,46,221,2,226,238,32,226,38,82,255,131,17,10, 34,56,74,196,42,232,228,80,63,210,95,32,4,99,5,255,134,131,110,46,130,56,152,22,170,129,214,170,225,82,18,7, 13,26,242,97,240,29,207,121,207,203,121,206,189,130,2,181,246,182,61,160,65,185,58,178,164,217,88,152,95,164,86,55, 115,155,131,167,7,188,174,107,149,5,80,171,155,44,55,47,48,140,180,77,169,9,87,206,10,0,165,1,66,8,12,67, 98,206,78,3,49,32,0,184,189,190,39,138,190,60,178,140,245,180,189,207,220,20,168,151,30,143,98,134,247,15,197,235, 56,76,121,100,69,86,122,207,111,223,21,29,128,56,142,127,16,170,176,70,163,97,170,254,123,131,74,172,238,225,82,102, 179,204,17,117,93,163,63,24,231,178,58,71,7,121,132,118,42,224,230,174,15,177,200,101,93,91,109,166,38,53,77,227, 196,105,183,100,98,82,106,130,49,28,101,110,144,40,8,130,220,35,203,132,231,242,184,81,248,10,0,238,249,89,97,64, 199,235,186,214,31,127,222,182,183,118,118,139,2,172,141,245,77,194,48,204,157,76,88,129,194,0,124,223,231,191,146,101, 124,85,244,9,241,192,132,130,214,14,135,66,0,0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t stateManager[378] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255, 97,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187,127,0,0,0,9,112,72,89,115,0,0,13,215,0, 0,13,215,1,66,40,155,120,0,0,0,7,116,73,77,69,7,213,6,16,18,41,48,44,67,93,90,0,0,1,7,73, 68,65,84,56,203,189,146,189,74,3,65,28,196,127,251,145,69,177,176,73,44,124,128,128,207,225,19,8,130,136,31,129, 136,104,37,34,104,173,32,10,130,181,165,112,6,242,20,190,78,138,120,8,90,104,178,183,123,107,17,15,205,37,94,238, 82,56,229,252,255,59,179,179,179,226,168,221,4,216,19,130,136,10,8,129,125,224,73,103,135,175,78,46,73,146,1,225, 123,90,4,33,36,215,15,183,81,8,32,142,15,154,225,188,125,138,148,211,151,245,48,198,153,250,4,175,134,49,55,157, 14,58,35,30,163,59,250,214,148,186,254,138,177,180,118,47,70,6,25,217,183,134,237,213,151,82,2,221,94,131,193,231, 59,90,215,144,204,9,169,70,222,114,150,83,183,215,40,20,210,191,115,253,181,156,231,151,148,35,245,14,231,146,31,129, 245,250,219,92,81,52,128,181,31,60,199,203,149,90,216,202,71,168,218,130,79,253,236,71,44,213,6,64,234,221,255,182, 48,33,96,236,43,155,27,135,99,131,212,123,164,82,164,222,231,62,208,56,39,90,59,107,247,139,11,254,76,235,218,84, 7,231,146,194,8,95,134,90,101,183,231,143,210,134,0,0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t timing[897] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255, 97,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187,127,0,0,0,9,112,72,89,115,0,0,13,215,0, 0,13,215,1,66,40,155,120,0,0,0,7,116,73,77,69,7,213,9,15,8,58,5,128,132,46,85,0,0,3,14,73, 68,65,84,56,203,101,146,75,76,92,101,28,197,127,223,119,239,188,152,185,119,96,34,8,210,202,35,88,29,108,48,150, 190,226,162,177,59,220,152,138,193,186,32,26,54,38,68,87,181,53,38,44,77,99,26,31,137,198,68,77,172,53,177,139, 62,240,17,77,76,163,46,176,5,77,85,40,5,58,88,43,218,17,233,76,167,204,12,195,204,189,195,12,119,190,207,141, 109,40,158,228,236,206,57,255,71,142,96,19,142,28,24,25,210,146,23,5,226,97,148,14,8,67,122,90,138,27,85,181, 126,230,157,207,94,127,101,179,94,108,48,246,104,248,116,247,190,71,123,182,247,198,9,71,194,8,1,90,67,113,181,196, 204,84,130,75,151,230,211,131,195,231,142,245,60,146,10,34,117,146,80,242,180,185,193,124,97,112,120,192,46,27,138,85, 159,131,40,190,118,103,138,221,113,140,120,224,65,26,59,83,205,141,205,149,55,61,189,115,213,208,191,172,8,183,93,73, 0,141,62,62,56,60,96,223,88,43,208,254,80,136,104,245,237,187,214,180,235,45,182,110,107,161,119,111,142,104,195,46, 131,192,187,13,200,167,163,192,14,121,228,192,200,208,238,125,59,118,150,180,71,91,87,35,45,91,226,155,207,68,74,137, 16,2,51,16,67,178,68,165,116,2,167,52,19,4,253,131,4,6,182,247,198,89,46,103,105,109,109,166,144,255,135,248, 227,167,72,103,125,119,63,75,8,42,94,31,158,232,39,149,172,114,242,195,7,170,120,242,156,169,209,123,194,145,48,150, 23,66,41,133,207,103,81,118,139,132,234,44,70,94,218,134,223,222,203,115,109,57,108,219,66,200,24,210,127,16,195,187, 201,194,212,199,209,161,23,250,131,18,168,23,2,154,154,26,200,23,242,40,165,168,41,141,227,20,57,250,222,239,68,98, 221,76,76,76,160,148,66,107,133,97,26,152,134,4,165,5,208,101,2,43,90,19,43,187,85,58,58,218,169,84,214,80, 74,81,44,22,233,238,238,230,229,195,175,114,237,218,85,106,181,26,82,74,180,82,104,13,72,52,176,32,5,226,162,83, 114,88,252,59,141,82,10,207,243,240,60,143,67,135,14,147,72,36,200,100,210,88,150,69,173,86,195,178,108,202,110,25, 167,228,128,207,112,63,57,253,150,35,129,179,115,147,243,216,134,133,83,114,241,249,252,140,141,141,49,58,58,74,42,181, 116,39,48,28,142,160,53,44,95,207,50,55,57,79,133,218,12,128,124,227,203,163,39,126,62,63,53,217,24,182,25,255, 254,87,180,214,244,245,61,65,58,157,98,173,82,65,107,77,32,16,192,52,77,242,153,28,238,178,203,197,31,167,171,95, 77,156,121,6,192,0,232,188,183,107,110,97,54,249,236,254,253,143,249,255,252,99,145,92,33,207,253,109,91,8,6,130, 4,131,33,252,190,0,55,255,202,144,191,190,194,201,15,206,234,217,165,217,247,167,230,127,154,3,178,6,192,76,114,58, 239,55,253,87,150,174,102,246,52,53,196,162,109,45,173,120,69,143,74,126,141,114,182,204,173,228,45,46,143,207,242,245, 231,223,174,143,255,118,225,248,249,233,239,190,1,210,64,78,108,232,74,61,208,249,228,174,254,231,239,187,103,235,83,117, 254,186,22,41,164,169,209,202,93,119,139,233,66,58,241,197,248,169,143,128,20,112,5,88,4,180,224,255,136,252,23,118, 155,26,40,3,171,64,22,40,0,234,182,248,95,201,36,100,6,22,194,54,223,0,0,0,0,73,69,78,68,174,66,96, 130, }; const uint8_t unverified[1675] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122, 244,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100,136,0,0,6,66,73,68,65,84,88,133,229,151,217,115,84, 85,30,199,191,231,119,238,146,78,210,183,59,107,147,116,167,151,132,152,72,132,208,128,27,13,9,104,160,28,202,146,161, 3,79,83,214,164,242,52,207,62,251,224,195,252,13,62,88,53,37,102,134,69,12,250,162,165,14,58,162,65,81,17,179, 66,7,59,91,111,233,108,244,96,210,33,73,247,237,123,231,161,23,110,98,2,1,103,158,230,86,253,234,156,170,123,239, 249,124,206,249,253,234,87,117,128,255,247,135,253,158,159,143,118,116,119,106,76,239,37,157,94,253,234,139,191,125,242,36, 107,208,239,129,103,152,126,94,177,213,32,67,218,135,109,199,186,78,60,201,58,252,73,225,26,99,231,188,190,131,242,169, 147,29,88,211,56,159,137,70,207,184,234,247,254,28,154,24,8,254,79,5,142,118,116,119,106,132,243,222,67,62,217,225, 170,195,59,189,223,224,224,179,45,40,85,20,30,143,68,30,91,226,177,4,142,118,116,119,130,211,133,87,94,123,69,42, 171,182,225,131,43,55,161,105,192,157,169,89,28,122,174,5,102,197,194,167,195,225,199,146,216,182,64,91,71,151,159,56, 191,248,122,215,105,241,233,150,167,240,246,197,175,0,157,65,32,2,17,67,48,52,7,223,129,93,48,91,44,60,22,10, 159,113,55,236,187,25,26,239,31,251,175,8,180,117,116,249,193,232,194,159,94,247,75,45,45,77,24,15,207,195,251,180, 19,7,118,185,112,247,94,18,43,171,105,16,99,24,11,207,227,57,111,19,20,139,149,71,67,83,219,146,120,164,64,91, 71,151,159,49,186,112,224,240,33,105,207,158,102,68,226,255,6,24,64,44,187,243,249,68,18,139,75,171,16,56,129,24, 195,100,100,1,251,91,159,202,74,132,31,45,241,80,129,60,124,223,33,159,84,235,172,67,96,124,6,85,21,102,16,17, 194,211,119,241,237,207,227,152,187,187,4,129,19,4,226,16,136,192,115,239,188,187,119,66,177,150,241,72,40,116,198,221, 224,221,82,98,203,62,208,126,172,251,20,35,186,224,245,249,164,29,14,59,62,191,54,130,180,154,1,39,2,103,12,137, 123,247,113,127,37,5,81,224,16,57,135,40,80,97,78,68,184,118,115,12,110,143,27,190,246,118,137,129,125,212,126,188, 251,15,219,22,104,63,214,125,10,76,191,232,61,152,133,255,235,251,81,112,70,133,99,38,202,206,69,158,135,103,71,129, 19,132,220,156,51,194,15,131,147,112,215,123,224,59,210,38,211,22,18,191,73,65,30,190,247,69,159,84,227,112,224,155, 159,126,1,129,65,224,4,119,109,5,170,203,205,32,98,208,52,29,43,43,41,168,25,173,112,244,198,84,8,156,192,25, 97,110,97,17,187,154,60,80,172,86,33,58,21,58,237,118,183,254,52,53,57,48,182,169,192,145,227,93,127,4,195,251, 173,47,100,119,254,93,255,120,1,46,16,161,209,85,13,171,82,12,98,12,101,74,49,26,221,54,164,83,42,150,150,215, 10,223,100,225,188,48,231,68,88,72,36,209,220,232,130,181,204,42,132,67,225,51,70,137,7,41,120,235,45,210,117,246, 81,149,221,37,181,182,54,227,198,208,36,56,123,144,87,145,115,216,42,20,112,198,178,117,64,12,196,24,86,83,234,186, 111,178,115,130,73,22,81,91,109,133,44,8,224,140,16,28,159,197,97,223,126,212,185,93,178,78,236,211,223,158,192,213, 171,122,125,189,119,96,121,121,209,207,4,19,111,110,116,98,62,177,84,200,125,185,165,4,205,245,59,64,68,88,76,174, 224,202,181,0,198,166,230,145,74,169,133,221,154,100,17,12,217,230,100,171,84,240,236,30,55,146,203,107,72,165,51,216, 183,219,133,196,92,28,125,125,215,83,200,104,175,230,79,96,93,10,166,38,6,238,120,26,90,71,102,98,81,191,217,98, 229,77,13,78,220,189,151,4,39,194,174,134,26,84,150,149,130,17,67,40,150,192,226,210,202,131,156,115,66,133,181,4, 109,207,55,98,109,85,133,36,114,212,213,150,67,49,155,80,93,105,198,254,221,78,68,67,97,156,59,255,97,42,147,86, 79,94,253,242,236,103,91,22,225,212,248,192,168,167,161,117,36,30,139,250,45,214,50,190,211,227,192,210,242,26,246,63, 227,130,32,16,136,17,130,147,179,80,85,173,80,108,2,113,232,58,208,224,172,66,173,205,10,103,109,5,44,102,19,136, 8,149,229,165,24,25,30,197,63,206,93,78,111,132,111,42,96,148,152,142,70,252,86,107,57,63,122,112,55,100,89,0, 67,182,251,217,42,21,36,147,107,40,41,150,80,95,87,133,213,149,20,158,105,178,67,49,155,10,29,146,136,80,102,41, 198,224,208,109,244,252,253,114,58,147,86,95,219,8,223,82,96,189,68,180,179,185,201,195,157,142,26,164,83,42,136,8, 178,40,64,18,57,100,81,64,131,179,26,110,71,37,148,210,34,16,35,176,28,220,170,152,48,56,20,64,79,207,229,116, 38,157,222,20,254,80,129,188,132,171,222,59,50,60,28,232,116,56,106,72,42,50,97,240,86,12,153,140,134,88,252,30, 150,146,171,112,218,203,193,11,13,42,11,87,204,121,120,239,67,225,143,20,0,128,208,68,255,168,211,179,119,100,104,232, 182,159,139,197,188,178,170,28,247,151,83,80,211,26,154,118,238,128,82,106,2,203,117,71,34,6,115,105,81,246,216,123, 122,211,170,150,57,249,245,23,239,110,9,223,150,64,78,34,104,119,182,4,98,145,200,201,138,138,42,254,114,219,30,216, 119,88,97,46,41,42,180,102,34,134,210,146,34,12,15,7,240,94,79,111,122,117,109,229,116,223,151,239,253,51,183,132, 254,36,2,4,64,2,80,4,64,14,79,14,133,170,108,158,224,108,60,126,130,139,37,188,169,209,9,77,211,11,69,87, 82,44,99,104,56,128,119,123,46,169,139,191,46,252,249,135,190,75,87,1,8,57,70,190,225,105,219,21,16,1,200,27, 99,58,18,8,91,202,107,39,98,177,217,227,110,151,157,219,107,170,161,105,58,138,77,89,248,217,158,75,234,194,124,244, 47,253,63,126,220,103,128,231,5,8,217,107,128,110,60,145,205,4,120,78,64,50,68,65,98,102,58,24,43,85,42,38, 127,25,139,190,228,114,216,169,206,97,195,224,208,109,156,237,185,164,198,167,39,222,24,233,191,114,61,7,55,66,141,247, 15,29,64,230,81,2,66,78,66,200,9,228,133,100,0,242,220,204,68,188,200,100,14,7,39,166,219,18,137,69,250,248, 211,43,153,104,248,206,155,163,195,95,223,48,64,141,64,45,23,25,195,184,165,128,102,176,231,134,49,47,198,1,136,11, 115,161,184,44,149,196,18,191,174,30,142,132,110,253,53,24,184,126,99,3,72,221,16,105,67,20,82,240,176,171,89,190, 14,36,195,104,12,209,32,152,223,101,30,144,218,16,107,134,113,93,33,110,231,110,152,79,135,132,245,169,201,195,141,133, 149,49,236,222,40,179,110,215,143,43,176,217,63,70,120,126,141,141,185,222,214,243,31,50,77,124,34,176,20,164,223,0, 0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t up[652] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255, 97,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100,136,0,0,0,25,116,69,88,116,83,111,102,116,119,97,114, 101,0,119,119,119,46,105,110,107,115,99,97,112,101,46,111,114,103,155,238,60,26,0,0,2,30,73,68,65,84,56,141, 149,147,79,104,19,65,20,198,191,55,187,51,217,141,133,122,104,76,255,209,130,4,237,193,64,42,168,208,213,138,104,68, 98,69,45,20,114,107,74,201,73,144,98,22,193,171,199,82,145,160,23,15,69,79,30,165,66,241,226,77,42,94,68,80, 208,67,41,180,42,149,148,52,137,166,154,38,217,217,25,15,81,172,33,169,246,29,223,251,230,199,124,223,155,33,173,53, 218,213,201,155,124,30,0,150,102,189,233,118,26,214,110,224,184,60,221,223,21,73,246,117,29,76,58,46,79,239,9,224, 184,60,26,16,251,178,87,206,76,6,199,70,147,193,128,8,102,29,151,71,255,11,224,184,188,3,132,197,137,115,211,214, 150,151,199,150,183,137,248,200,37,11,132,69,199,229,29,255,4,16,225,209,232,112,162,167,55,52,72,159,75,31,240,177, 244,30,157,157,157,20,27,58,209,13,194,195,93,1,142,203,211,253,7,34,137,179,71,199,249,74,254,13,12,198,97,50, 142,87,107,11,136,13,29,23,161,253,61,137,230,60,216,142,195,81,193,237,108,42,225,218,235,229,101,104,242,32,132,137, 58,125,199,54,21,241,46,255,28,23,78,95,13,154,166,248,43,15,182,211,247,212,88,198,82,228,161,34,75,16,1,1, 30,224,40,203,117,8,219,64,65,174,162,168,86,113,254,212,69,139,216,159,60,216,111,223,241,99,227,221,135,250,98,148, 175,172,193,228,6,56,55,80,81,5,84,141,175,16,54,131,176,25,150,191,189,64,184,55,68,71,14,15,135,137,53,242, 160,145,140,153,30,232,142,100,111,76,220,177,5,15,64,65,194,135,135,215,185,5,188,45,60,131,100,21,16,35,36,6, 50,208,90,67,41,160,94,175,225,241,211,249,74,177,180,57,99,18,67,234,83,110,197,158,185,119,185,225,137,163,122,247, 250,19,171,44,115,240,141,109,112,193,192,76,130,193,9,115,15,110,87,101,77,91,191,236,7,137,33,101,46,205,122,78, 211,38,180,214,10,165,250,23,48,131,96,112,6,30,104,64,100,77,91,47,231,60,218,245,29,0,128,210,62,126,212,139, 141,43,251,26,178,174,160,85,235,63,99,182,106,250,74,162,90,219,134,50,53,160,21,124,73,240,189,61,0,164,47,17, 31,188,6,98,0,49,2,17,246,0,32,108,220,186,63,25,110,37,38,194,70,115,239,39,48,247,197,219,182,208,154,34, 0,0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t video[662] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255, 97,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100,136,0,0,0,9,112,72,89,115,0,0,13,215,0,0,13, 215,1,66,40,155,120,0,0,0,25,116,69,88,116,83,111,102,116,119,97,114,101,0,119,119,119,46,105,110,107,115,99, 97,112,101,46,111,114,103,155,238,60,26,0,0,2,19,73,68,65,84,56,141,165,147,203,106,20,65,20,134,191,83,85, 115,109,72,50,32,6,98,18,35,38,11,183,222,54,186,112,99,6,29,240,25,124,4,55,130,184,81,80,4,241,49,124, 131,108,92,8,9,17,34,226,222,96,188,129,38,16,131,97,72,156,233,234,233,158,238,58,46,58,17,19,3,65,60,155, 42,170,234,255,207,119,206,161,164,221,110,243,63,225,58,157,206,29,17,121,168,170,181,127,17,138,136,87,213,187,78,85, 31,183,111,92,143,154,141,38,121,174,199,103,116,130,181,134,110,183,91,95,90,124,245,196,169,106,109,116,116,132,249,155, 207,73,233,3,160,122,132,209,222,81,77,34,94,190,184,205,200,232,40,64,195,237,223,167,161,207,133,171,99,136,200,30, 34,128,148,171,0,90,238,223,44,111,179,250,238,61,83,83,147,37,81,154,166,128,160,226,136,211,80,10,20,68,228,128, 73,54,204,217,238,254,4,28,103,103,103,49,18,74,3,239,61,33,20,24,99,24,228,82,102,43,155,4,148,194,205,31, 59,196,62,5,160,97,90,124,88,91,99,122,122,146,36,73,112,73,146,80,20,1,140,35,201,203,108,138,32,64,156,164, 236,244,18,84,29,149,250,94,181,137,101,122,230,52,21,103,240,222,227,226,56,70,131,98,76,133,65,112,251,0,36,233, 144,108,104,112,181,232,224,248,172,229,243,199,79,204,205,205,210,239,247,75,2,69,17,107,73,131,3,5,69,81,107,169, 216,35,134,97,135,76,156,154,192,24,202,18,188,247,0,24,227,176,213,232,111,197,161,24,154,62,69,81,160,8,113,28, 227,66,40,187,217,106,56,178,205,193,177,6,81,213,33,70,49,34,37,129,115,174,183,254,109,163,245,236,209,249,99,197, 191,41,210,156,245,245,13,128,29,233,116,58,183,106,181,218,3,17,141,64,12,48,83,169,56,87,169,86,197,26,3,64, 17,2,89,150,105,62,204,135,192,87,208,160,202,174,247,201,125,151,231,249,66,158,231,11,0,170,26,181,78,140,189,157, 111,183,207,93,186,120,153,241,147,227,168,42,91,91,223,89,121,189,162,75,203,75,171,73,111,112,37,203,50,191,79,35, 135,191,179,49,102,164,222,172,63,109,70,205,107,214,154,51,128,22,161,248,50,240,131,197,222,110,255,158,136,196,127,190, 255,5,119,143,242,70,185,147,13,30,0,0,0,0,73,69,78,68,174,66,96,130, }; }; processor/gsu/gsu.hpp000664 001750 001750 00000005371 12651764221 016042 0ustar00sergiosergio000000 000000 #ifndef PROCESSOR_GSU_HPP #define PROCESSOR_GSU_HPP namespace Processor { struct GSU { #include "registers.hpp" virtual void step(unsigned clocks) = 0; virtual void stop() = 0; virtual uint8 color(uint8 source) = 0; virtual void plot(uint8 x, uint8 y) = 0; virtual uint8 rpix(uint8 x, uint8 y) = 0; virtual uint8 pipe() = 0; virtual void rombuffer_sync() = 0; virtual uint8 rombuffer_read() = 0; virtual void rambuffer_sync() = 0; virtual uint8 rambuffer_read(uint16 addr) = 0; virtual void rambuffer_write(uint16 addr, uint8 data) = 0; virtual void cache_flush() = 0; void power(); void reset(); void serialize(serializer&); //table.cpp void (GSU::*opcode_table[1024])(); void initialize_opcode_table(); //instructions.cpp template void op_adc_i(); template void op_adc_r(); template void op_add_i(); template void op_add_r(); void op_alt1(); void op_alt2(); void op_alt3(); template void op_and_i(); template void op_and_r(); void op_asr(); void op_bge(); void op_bcc(); void op_bcs(); void op_beq(); template void op_bic_i(); template void op_bic_r(); void op_blt(); void op_bmi(); void op_bne(); void op_bpl(); void op_bra(); void op_bvc(); void op_bvs(); void op_cache(); void op_cmode(); template void op_cmp_r(); void op_color(); template void op_dec_r(); void op_div2(); void op_fmult(); template void op_from_r(); void op_getb(); void op_getbl(); void op_getbh(); void op_getbs(); void op_getc(); void op_hib(); template void op_ibt_r(); template void op_inc_r(); template void op_iwt_r(); template void op_jmp_r(); template void op_ldb_ir(); template void op_ldw_ir(); template void op_link(); template void op_ljmp_r(); template void op_lm_r(); template void op_lms_r(); void op_lmult(); void op_lob(); void op_loop(); void op_lsr(); void op_merge(); template void op_mult_i(); template void op_mult_r(); void op_nop(); void op_not(); template void op_or_i(); template void op_or_r(); void op_plot(); void op_ramb(); void op_rol(); void op_romb(); void op_ror(); void op_rpix(); template void op_sbc_r(); void op_sbk(); void op_sex(); template void op_sm_r(); template void op_sms_r(); template void op_stb_ir(); void op_stop(); template void op_stw_ir(); template void op_sub_i(); template void op_sub_r(); void op_swap(); template void op_to_r(); template void op_umult_i(); template void op_umult_r(); template void op_with_r(); template void op_xor_i(); template void op_xor_r(); }; } #endif phoenix/reference/action/radio-item.hpp000664 001750 001750 00000000470 12651764221 021341 0ustar00sergiosergio000000 000000 namespace phoenix { struct pRadioItem : public pAction { RadioItem& radioItem; void setChecked(); void setGroup(const group& group); void setText(string text); pRadioItem(RadioItem& radioItem) : pAction(radioItem), radioItem(radioItem) {} void constructor(); void destructor(); }; } data/Info.plist000664 001750 001750 00000000553 12651764221 014574 0ustar00sergiosergio000000 000000 CFBundleDisplayName higan CFBundleExecutable higan CFBundleIconFile higan.icns fc/interface/000700 001750 001750 00000000000 12656700342 014223 5ustar00sergiosergio000000 000000 gba/cpu/dma.cpp000664 001750 001750 00000003121 12651764221 014472 0ustar00sergiosergio000000 000000 void CPU::dma_run() { for(unsigned n = 0; n < 4; n++) { auto& dma = regs.dma[n]; if(dma.pending) { dma.pending = false; dma_transfer(dma); if(dma.control.irq) regs.irq.flag.dma[n] = 1; if(dma.control.drq && n == 3) regs.irq.flag.cartridge = 1; } } } void CPU::dma_transfer(Registers::DMA& dma) { unsigned size = dma.control.size ? Word : Half; unsigned seek = dma.control.size ? 4 : 2; sequential() = false; do { step(bus.speed(dma.run.source, size)); uint32 word = bus.read(dma.run.source, size); step(bus.speed(dma.run.target, size)); bus.write(dma.run.target, size, word); sequential() = true; switch(dma.control.sourcemode) { case 0: dma.run.source += seek; break; case 1: dma.run.source -= seek; break; } switch(dma.control.targetmode) { case 0: dma.run.target += seek; break; case 1: dma.run.target -= seek; break; case 3: dma.run.target += seek; break; } } while(--dma.run.length); sequential() = false; if(dma.control.targetmode == 3) dma.run.target = dma.target; if(dma.control.repeat == 1) dma.run.length = dma.length; if(dma.control.repeat == 0) dma.control.enable = false; } void CPU::dma_vblank() { for(auto& dma : regs.dma) { if(dma.control.enable && dma.control.timingmode == 1) dma.pending = true; } } void CPU::dma_hblank() { for(auto& dma : regs.dma) { if(dma.control.enable && dma.control.timingmode == 2) dma.pending = true; } } void CPU::dma_hdma() { auto& dma = regs.dma[3]; if(dma.control.enable && dma.control.timingmode == 3) dma.pending = true; } phoenix/windows/widget/line-edit.cpp000664 001750 001750 00000002313 12651764221 020714 0ustar00sergiosergio000000 000000 namespace phoenix { Size pLineEdit::minimumSize() { Size size = pFont::size(hfont, lineEdit.state.text); return {size.width + 12, size.height + 10}; } void pLineEdit::setEditable(bool editable) { SendMessage(hwnd, EM_SETREADONLY, editable == false, 0); } void pLineEdit::setText(string text) { locked = true; SetWindowText(hwnd, utf16_t(text)); locked = false; } string pLineEdit::text() { unsigned length = GetWindowTextLength(hwnd); wchar_t text[length + 1]; GetWindowText(hwnd, text, length + 1); text[length] = 0; return (const char*)utf8_t(text); } void pLineEdit::constructor() { hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, L"EDIT", L"", WS_CHILD | WS_TABSTOP | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&lineEdit); setDefaultFont(); setEditable(lineEdit.state.editable); setText(lineEdit.state.text); synchronize(); } void pLineEdit::destructor() { lineEdit.state.text = text(); DestroyWindow(hwnd); } void pLineEdit::orphan() { destructor(); constructor(); } void pLineEdit::onChange() { if(locked) return; if(lineEdit.onChange) lineEdit.onChange(); } } phoenix/qt/widget/vertical-scroller.cpp000664 001750 001750 00000002001 12651764221 021422 0ustar00sergiosergio000000 000000 namespace phoenix { Size pVerticalScroller::minimumSize() { return {15, 0}; } void pVerticalScroller::setLength(unsigned length) { length += length == 0; qtScroller->setRange(0, length - 1); qtScroller->setPageStep(length >> 3); } void pVerticalScroller::setPosition(unsigned position) { qtScroller->setValue(position); } void pVerticalScroller::constructor() { qtWidget = qtScroller = new QScrollBar(Qt::Vertical); qtScroller->setRange(0, 100); qtScroller->setPageStep(101 >> 3); connect(qtScroller, SIGNAL(valueChanged(int)), SLOT(onChange())); pWidget::synchronizeState(); setLength(verticalScroller.state.length); setPosition(verticalScroller.state.position); } void pVerticalScroller::destructor() { delete qtScroller; qtWidget = qtScroller = nullptr; } void pVerticalScroller::orphan() { destructor(); constructor(); } void pVerticalScroller::onChange() { verticalScroller.state.position = qtScroller->value(); if(verticalScroller.onChange) verticalScroller.onChange(); } } phoenix/windows/widget/canvas.cpp000664 001750 001750 00000013524 12651764221 020323 0ustar00sergiosergio000000 000000 namespace phoenix { static LRESULT CALLBACK Canvas_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { Object* object = (Object*)GetWindowLongPtr(hwnd, GWLP_USERDATA); if(object == nullptr) return DefWindowProc(hwnd, msg, wparam, lparam); if(!dynamic_cast(object)) return DefWindowProc(hwnd, msg, wparam, lparam); Canvas& canvas = (Canvas&)*object; if(msg == WM_DROPFILES) { lstring paths = DropPaths(wparam); if(paths.empty() == false) { if(canvas.onDrop) canvas.onDrop(paths); } return FALSE; } if(msg == WM_GETDLGCODE) { return DLGC_STATIC | DLGC_WANTCHARS; } if(msg == WM_ERASEBKGND) { //background is erased during WM_PAINT to prevent flickering return TRUE; } if(msg == WM_PAINT) { canvas.p.paint(); return TRUE; } if(msg == WM_MOUSEMOVE) { TRACKMOUSEEVENT tracker = {sizeof(TRACKMOUSEEVENT), TME_LEAVE, hwnd}; TrackMouseEvent(&tracker); if(canvas.onMouseMove) canvas.onMouseMove({(int16_t)LOWORD(lparam), (int16_t)HIWORD(lparam)}); } if(msg == WM_MOUSELEAVE) { if(canvas.onMouseLeave) canvas.onMouseLeave(); } if(msg == WM_LBUTTONDOWN || msg == WM_MBUTTONDOWN || msg == WM_RBUTTONDOWN) { if(canvas.onMousePress) switch(msg) { case WM_LBUTTONDOWN: canvas.onMousePress(Mouse::Button::Left); break; case WM_MBUTTONDOWN: canvas.onMousePress(Mouse::Button::Middle); break; case WM_RBUTTONDOWN: canvas.onMousePress(Mouse::Button::Right); break; } } if(msg == WM_LBUTTONUP || msg == WM_MBUTTONUP || msg == WM_RBUTTONUP) { if(canvas.onMouseRelease) switch(msg) { case WM_LBUTTONUP: canvas.onMouseRelease(Mouse::Button::Left); break; case WM_MBUTTONUP: canvas.onMouseRelease(Mouse::Button::Middle); break; case WM_RBUTTONUP: canvas.onMouseRelease(Mouse::Button::Right); break; } } return DefWindowProc(hwnd, msg, wparam, lparam); } void pCanvas::setDroppable(bool droppable) { DragAcceptFiles(hwnd, droppable); } void pCanvas::setGeometry(Geometry geometry) { if(canvas.state.width == 0 || canvas.state.height == 0) rasterize(); unsigned width = canvas.state.width; unsigned height = canvas.state.height; if(width == 0) width = widget.state.geometry.width; if(height == 0) height = widget.state.geometry.height; if(width < geometry.width) { geometry.x += (geometry.width - width) / 2; geometry.width = width; } if(height < geometry.height) { geometry.y += (geometry.height - height) / 2; geometry.height = height; } pWidget::setGeometry(geometry); } void pCanvas::setMode(Canvas::Mode mode) { rasterize(), redraw(); } void pCanvas::setSize(Size size) { rasterize(), redraw(); } void pCanvas::constructor() { hwnd = CreateWindow(L"phoenix_canvas", L"", WS_CHILD, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&canvas); setDroppable(canvas.state.droppable); rasterize(); synchronize(); } void pCanvas::destructor() { release(); DestroyWindow(hwnd); } void pCanvas::orphan() { destructor(); constructor(); } void pCanvas::paint() { if(surface == nullptr) return; PAINTSTRUCT ps; BeginPaint(hwnd, &ps); uint32_t* data = surface; unsigned width = surfaceWidth; unsigned height = surfaceHeight; HDC hdc = CreateCompatibleDC(ps.hdc); BITMAPINFO bmi; memset(&bmi, 0, sizeof(BITMAPINFO)); bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biBitCount = 32; bmi.bmiHeader.biCompression = BI_RGB; bmi.bmiHeader.biWidth = width; bmi.bmiHeader.biHeight = -height; //GDI stores bitmaps upside now; negative height flips bitmap bmi.bmiHeader.biSizeImage = width * height * sizeof(uint32_t); void* bits = nullptr; HBITMAP bitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &bits, NULL, 0); if(bits) memcpy(bits, data, width * height * sizeof(uint32_t)); SelectObject(hdc, bitmap); BLENDFUNCTION bf; bf.BlendOp = AC_SRC_OVER; bf.BlendFlags = 0; bf.SourceConstantAlpha = 255; bf.AlphaFormat = AC_SRC_ALPHA; RECT rc; GetClientRect(hwnd, &rc); DrawThemeParentBackground(hwnd, ps.hdc, &rc); AlphaBlend(ps.hdc, 0, 0, width, height, hdc, 0, 0, width, height, bf); DeleteObject(bitmap); DeleteDC(hdc); EndPaint(hwnd, &ps); } void pCanvas::rasterize() { unsigned width = canvas.state.width; unsigned height = canvas.state.height; if(width == 0) width = widget.state.geometry.width; if(height == 0) height = widget.state.geometry.height; if(width != surfaceWidth || height != surfaceHeight) release(); if(!surface) surface = new uint32_t[width * height]; if(canvas.state.mode == Canvas::Mode::Color) { nall::image image; image.allocate(width, height); image.fill(canvas.state.color.argb()); memcpy(surface, image.data, image.size); } if(canvas.state.mode == Canvas::Mode::Gradient) { nall::image image; image.allocate(width, height); image.gradient( canvas.state.gradient[0].argb(), canvas.state.gradient[1].argb(), canvas.state.gradient[2].argb(), canvas.state.gradient[3].argb() ); memcpy(surface, image.data, image.size); } if(canvas.state.mode == Canvas::Mode::Image) { nall::image image = canvas.state.image; image.scale(width, height); image.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0); memcpy(surface, image.data, image.size); } if(canvas.state.mode == Canvas::Mode::Data) { if(width == canvas.state.width && height == canvas.state.height) { memcpy(surface, canvas.state.data, width * height * sizeof(uint32_t)); } else { memset(surface, 0x00, width * height * sizeof(uint32_t)); } } surfaceWidth = width; surfaceHeight = height; } void pCanvas::redraw() { InvalidateRect(hwnd, 0, false); } void pCanvas::release() { if(surface) { delete[] surface; surface = nullptr; surfaceWidth = 0; surfaceHeight = 0; } } } gb/cpu/mmio.cpp000664 001750 001750 00000014610 12651764221 014536 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP unsigned CPU::wram_addr(uint16 addr) const { addr &= 0x1fff; if(addr < 0x1000) return addr; auto bank = status.wram_bank + (status.wram_bank == 0); return (bank * 0x1000) + (addr & 0x0fff); } void CPU::mmio_joyp_poll() { unsigned button = 0, dpad = 0; button |= interface->inputPoll(0, 0, (unsigned)Input::Start) << 3; button |= interface->inputPoll(0, 0, (unsigned)Input::Select) << 2; button |= interface->inputPoll(0, 0, (unsigned)Input::B) << 1; button |= interface->inputPoll(0, 0, (unsigned)Input::A) << 0; dpad |= interface->inputPoll(0, 0, (unsigned)Input::Down) << 3; dpad |= interface->inputPoll(0, 0, (unsigned)Input::Up) << 2; dpad |= interface->inputPoll(0, 0, (unsigned)Input::Left) << 1; dpad |= interface->inputPoll(0, 0, (unsigned)Input::Right) << 0; //D-pad pivot makes it impossible to press opposing directions at the same time if(dpad & 4) dpad &= ~8; //disallow up+down if(dpad & 2) dpad &= ~1; //disallow left+right status.joyp = 0x0f; if(status.p15 == 1 && status.p14 == 1) status.joyp -= status.mlt_req; if(status.p15 == 0) status.joyp &= button ^ 0x0f; if(status.p14 == 0) status.joyp &= dpad ^ 0x0f; if(status.joyp != 0x0f) interrupt_raise(Interrupt::Joypad); } uint8 CPU::mmio_read(uint16 addr) { if(addr >= 0xc000 && addr <= 0xfdff) return wram[wram_addr(addr)]; if(addr >= 0xff80 && addr <= 0xfffe) return hram[addr & 0x7f]; if(addr == 0xff00) { //JOYP mmio_joyp_poll(); return (status.p15 << 5) | (status.p14 << 4) | (status.joyp << 0); } if(addr == 0xff01) { //SB return 0xff; } if(addr == 0xff02) { //SC return (status.serial_transfer << 7) | (status.serial_clock << 0); } if(addr == 0xff04) { //DIV return status.div; } if(addr == 0xff05) { //TIMA return status.tima; } if(addr == 0xff06) { //TMA return status.tma; } if(addr == 0xff07) { //TAC return (status.timer_enable << 2) | (status.timer_clock << 0); } if(addr == 0xff0f) { //IF return (status.interrupt_request_joypad << 4) | (status.interrupt_request_serial << 3) | (status.interrupt_request_timer << 2) | (status.interrupt_request_stat << 1) | (status.interrupt_request_vblank << 0); } if(addr == 0xff4d) { //KEY1 return (status.speed_double << 7); } if(addr == 0xff55) { //HDMA5 return (status.dma_completed << 7) | (((status.dma_length / 16) - 1) & 0x7f); } if(addr == 0xff56) { //RP return 0x02; } if(addr == 0xff6c) { //??? return 0xfe | status.ff6c; } if(addr == 0xff70) { //SVBK return status.wram_bank; } if(addr == 0xff72) { //??? return status.ff72; } if(addr == 0xff73) { //??? return status.ff73; } if(addr == 0xff74) { //??? return status.ff74; } if(addr == 0xff75) { //??? return 0x8f | status.ff75; } if(addr == 0xff76) { //??? return 0x00; } if(addr == 0xff77) { //??? return 0x00; } if(addr == 0xffff) { //IE return (status.interrupt_enable_joypad << 4) | (status.interrupt_enable_serial << 3) | (status.interrupt_enable_timer << 2) | (status.interrupt_enable_stat << 1) | (status.interrupt_enable_vblank << 0); } return 0x00; } void CPU::mmio_write(uint16 addr, uint8 data) { if(addr >= 0xc000 && addr <= 0xfdff) { wram[wram_addr(addr)] = data; return; } if(addr >= 0xff80 && addr <= 0xfffe) { hram[addr & 0x7f] = data; return; } if(addr == 0xff00) { //JOYP status.p15 = data & 0x20; status.p14 = data & 0x10; interface->joypWrite(status.p15, status.p14); return; } if(addr == 0xff01) { //SB status.serial_data = data; return; } if(addr == 0xff02) { //SC status.serial_transfer = data & 0x80; status.serial_clock = data & 0x01; if(status.serial_transfer) status.serial_bits = 8; return; } if(addr == 0xff04) { //DIV status.div = 0; return; } if(addr == 0xff05) { //TIMA status.tima = data; return; } if(addr == 0xff06) { //TMA status.tma = data; return; } if(addr == 0xff07) { //TAC status.timer_enable = data & 0x04; status.timer_clock = data & 0x03; return; } if(addr == 0xff0f) { //IF status.interrupt_request_joypad = data & 0x10; status.interrupt_request_serial = data & 0x08; status.interrupt_request_timer = data & 0x04; status.interrupt_request_stat = data & 0x02; status.interrupt_request_vblank = data & 0x01; return; } if(addr == 0xff46) { //DMA oamdma.active = true; oamdma.bank = data; oamdma.offset = 0; return; } if(addr == 0xff4d) { //KEY1 status.speed_switch = data & 0x01; return; } if(addr == 0xff51) { //HDMA1 status.dma_source = (status.dma_source & 0x00ff) | (data << 8); return; } if(addr == 0xff52) { //HDMA2 status.dma_source = (status.dma_source & 0xff00) | (data & 0xf0); return; } if(addr == 0xff53) { //HDMA3 status.dma_target = (status.dma_target & 0x00ff) | (data << 8); return; } if(addr == 0xff54) { //HDMA4 status.dma_target = (status.dma_target & 0xff00) | (data & 0xf0); return; } if(addr == 0xff55) { //HDMA5 status.dma_mode = data & 0x80; status.dma_length = ((data & 0x7f) + 1) * 16; status.dma_completed = !status.dma_mode; if(status.dma_mode == 0) { do { for(unsigned n = 0; n < 16; n++) { dma_write(status.dma_target++, dma_read(status.dma_source++)); } add_clocks(8 << status.speed_double); status.dma_length -= 16; } while(status.dma_length); } return; } if(addr == 0xff56) { //RP return; } if(addr == 0xff6c) { //??? status.ff6c = data & 0x01; return; } if(addr == 0xff72) { //??? status.ff72 = data; return; } if(addr == 0xff73) { //??? status.ff73 = data; return; } if(addr == 0xff74) { //??? status.ff74 = data; return; } if(addr == 0xff75) { //??? status.ff75 = data & 0x70; return; } if(addr == 0xff70) { //SVBK status.wram_bank = data & 0x07; return; } if(addr == 0xffff) { //IE status.interrupt_enable_joypad = data & 0x10; status.interrupt_enable_serial = data & 0x08; status.interrupt_enable_timer = data & 0x04; status.interrupt_enable_stat = data & 0x02; status.interrupt_enable_vblank = data & 0x01; return; } } #endif gba/memory/serialization.cpp000664 001750 001750 00000000076 12651764221 017335 0ustar00sergiosergio000000 000000 void Bus::serialize(serializer& s) { s.integer(idleflag); } processor/gsu/instructions.cpp000664 001750 001750 00000033350 12651764221 020001 0ustar00sergiosergio000000 000000 //$00 stop void GSU::op_stop() { if(regs.cfgr.irq == 0) { regs.sfr.irq = 1; stop(); } regs.sfr.g = 0; regs.pipeline = 0x01; regs.reset(); } //$01 nop void GSU::op_nop() { regs.reset(); } //$02 cache void GSU::op_cache() { if(regs.cbr != (regs.r[15] & 0xfff0)) { regs.cbr = regs.r[15] & 0xfff0; cache_flush(); } regs.reset(); } //$03 lsr void GSU::op_lsr() { regs.sfr.cy = (regs.sr() & 1); regs.dr() = regs.sr() >> 1; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$04 rol void GSU::op_rol() { bool carry = (regs.sr() & 0x8000); regs.dr() = (regs.sr() << 1) | regs.sfr.cy; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.cy = carry; regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$05 bra e void GSU::op_bra() { regs.r[15] += (int8)pipe(); } //$06 blt e void GSU::op_blt() { int e = (int8)pipe(); if((regs.sfr.s ^ regs.sfr.ov) == 0) regs.r[15] += e; } //$07 bge e void GSU::op_bge() { int e = (int8)pipe(); if((regs.sfr.s ^ regs.sfr.ov) == 1) regs.r[15] += e; } //$08 bne e void GSU::op_bne() { int e = (int8)pipe(); if(regs.sfr.z == 0) regs.r[15] += e; } //$09 beq e void GSU::op_beq() { int e = (int8)pipe(); if(regs.sfr.z == 1) regs.r[15] += e; } //$0a bpl e void GSU::op_bpl() { int e = (int8)pipe(); if(regs.sfr.s == 0) regs.r[15] += e; } //$0b bmi e void GSU::op_bmi() { int e = (int8)pipe(); if(regs.sfr.s == 1) regs.r[15] += e; } //$0c bcc e void GSU::op_bcc() { int e = (int8)pipe(); if(regs.sfr.cy == 0) regs.r[15] += e; } //$0d bcs e void GSU::op_bcs() { int e = (int8)pipe(); if(regs.sfr.cy == 1) regs.r[15] += e; } //$0e bvc e void GSU::op_bvc() { int e = (int8)pipe(); if(regs.sfr.ov == 0) regs.r[15] += e; } //$0f bvs e void GSU::op_bvs() { int e = (int8)pipe(); if(regs.sfr.ov == 1) regs.r[15] += e; } //$10-1f(b0): to rN //$10-1f(b1): move rN template void GSU::op_to_r() { if(regs.sfr.b == 0) { regs.dreg = n; } else { regs.r[n] = regs.sr(); regs.reset(); } } //$20-2f: with rN template void GSU::op_with_r() { regs.sreg = n; regs.dreg = n; regs.sfr.b = 1; } //$30-3b(alt0): stw (rN) template void GSU::op_stw_ir() { regs.ramaddr = regs.r[n]; rambuffer_write(regs.ramaddr ^ 0, regs.sr() >> 0); rambuffer_write(regs.ramaddr ^ 1, regs.sr() >> 8); regs.reset(); } //$30-3b(alt1): stb (rN) template void GSU::op_stb_ir() { regs.ramaddr = regs.r[n]; rambuffer_write(regs.ramaddr, regs.sr()); regs.reset(); } //$3c loop void GSU::op_loop() { regs.r[12]--; regs.sfr.s = (regs.r[12] & 0x8000); regs.sfr.z = (regs.r[12] == 0); if(!regs.sfr.z) regs.r[15] = regs.r[13]; regs.reset(); } //$3d alt1 void GSU::op_alt1() { regs.sfr.b = 0; regs.sfr.alt1 = 1; } //$3e alt2 void GSU::op_alt2() { regs.sfr.b = 0; regs.sfr.alt2 = 1; } //$3f alt3 void GSU::op_alt3() { regs.sfr.b = 0; regs.sfr.alt1 = 1; regs.sfr.alt2 = 1; } //$40-4b(alt0): ldw (rN) template void GSU::op_ldw_ir() { regs.ramaddr = regs.r[n]; uint16_t data; data = rambuffer_read(regs.ramaddr ^ 0) << 0; data |= rambuffer_read(regs.ramaddr ^ 1) << 8; regs.dr() = data; regs.reset(); } //$40-4b(alt1): ldb (rN) template void GSU::op_ldb_ir() { regs.ramaddr = regs.r[n]; regs.dr() = rambuffer_read(regs.ramaddr); regs.reset(); } //$4c(alt0): plot void GSU::op_plot() { plot(regs.r[1], regs.r[2]); regs.r[1]++; regs.reset(); } //$4c(alt1): rpix void GSU::op_rpix() { regs.dr() = rpix(regs.r[1], regs.r[2]); regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$4d: swap void GSU::op_swap() { regs.dr() = (regs.sr() >> 8) | (regs.sr() << 8); regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$4e(alt0): color void GSU::op_color() { regs.colr = color(regs.sr()); regs.reset(); } //$4e(alt1): cmode void GSU::op_cmode() { regs.por = regs.sr(); regs.reset(); } //$4f: not void GSU::op_not() { regs.dr() = ~regs.sr(); regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$50-5f(alt0): add rN template void GSU::op_add_r() { int r = regs.sr() + regs.r[n]; regs.sfr.ov = ~(regs.sr() ^ regs.r[n]) & (regs.r[n] ^ r) & 0x8000; regs.sfr.s = (r & 0x8000); regs.sfr.cy = (r >= 0x10000); regs.sfr.z = ((uint16_t)r == 0); regs.dr() = r; regs.reset(); } //$50-5f(alt1): adc rN template void GSU::op_adc_r() { int r = regs.sr() + regs.r[n] + regs.sfr.cy; regs.sfr.ov = ~(regs.sr() ^ regs.r[n]) & (regs.r[n] ^ r) & 0x8000; regs.sfr.s = (r & 0x8000); regs.sfr.cy = (r >= 0x10000); regs.sfr.z = ((uint16_t)r == 0); regs.dr() = r; regs.reset(); } //$50-5f(alt2): add #N template void GSU::op_add_i() { int r = regs.sr() + n; regs.sfr.ov = ~(regs.sr() ^ n) & (n ^ r) & 0x8000; regs.sfr.s = (r & 0x8000); regs.sfr.cy = (r >= 0x10000); regs.sfr.z = ((uint16_t)r == 0); regs.dr() = r; regs.reset(); } //$50-5f(alt3): adc #N template void GSU::op_adc_i() { int r = regs.sr() + n + regs.sfr.cy; regs.sfr.ov = ~(regs.sr() ^ n) & (n ^ r) & 0x8000; regs.sfr.s = (r & 0x8000); regs.sfr.cy = (r >= 0x10000); regs.sfr.z = ((uint16_t)r == 0); regs.dr() = r; regs.reset(); } //$60-6f(alt0): sub rN template void GSU::op_sub_r() { int r = regs.sr() - regs.r[n]; regs.sfr.ov = (regs.sr() ^ regs.r[n]) & (regs.sr() ^ r) & 0x8000; regs.sfr.s = (r & 0x8000); regs.sfr.cy = (r >= 0); regs.sfr.z = ((uint16_t)r == 0); regs.dr() = r; regs.reset(); } //$60-6f(alt1): sbc rN template void GSU::op_sbc_r() { int r = regs.sr() - regs.r[n] - !regs.sfr.cy; regs.sfr.ov = (regs.sr() ^ regs.r[n]) & (regs.sr() ^ r) & 0x8000; regs.sfr.s = (r & 0x8000); regs.sfr.cy = (r >= 0); regs.sfr.z = ((uint16_t)r == 0); regs.dr() = r; regs.reset(); } //$60-6f(alt2): sub #N template void GSU::op_sub_i() { int r = regs.sr() - n; regs.sfr.ov = (regs.sr() ^ n) & (regs.sr() ^ r) & 0x8000; regs.sfr.s = (r & 0x8000); regs.sfr.cy = (r >= 0); regs.sfr.z = ((uint16_t)r == 0); regs.dr() = r; regs.reset(); } //$60-6f(alt3): cmp rN template void GSU::op_cmp_r() { int r = regs.sr() - regs.r[n]; regs.sfr.ov = (regs.sr() ^ regs.r[n]) & (regs.sr() ^ r) & 0x8000; regs.sfr.s = (r & 0x8000); regs.sfr.cy = (r >= 0); regs.sfr.z = ((uint16_t)r == 0); regs.reset(); } //$70: merge void GSU::op_merge() { regs.dr() = (regs.r[7] & 0xff00) | (regs.r[8] >> 8); regs.sfr.ov = (regs.dr() & 0xc0c0); regs.sfr.s = (regs.dr() & 0x8080); regs.sfr.cy = (regs.dr() & 0xe0e0); regs.sfr.z = (regs.dr() & 0xf0f0); regs.reset(); } //$71-7f(alt0): and rN template void GSU::op_and_r() { regs.dr() = regs.sr() & regs.r[n]; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$71-7f(alt1): bic rN template void GSU::op_bic_r() { regs.dr() = regs.sr() & ~regs.r[n]; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$71-7f(alt2): and #N template void GSU::op_and_i() { regs.dr() = regs.sr() & n; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$71-7f(alt3): bic #N template void GSU::op_bic_i() { regs.dr() = regs.sr() & ~n; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$80-8f(alt0): mult rN template void GSU::op_mult_r() { regs.dr() = (int8)regs.sr() * (int8)regs.r[n]; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); if(!regs.cfgr.ms0) step(2); } //$80-8f(alt1): umult rN template void GSU::op_umult_r() { regs.dr() = (uint8)regs.sr() * (uint8)regs.r[n]; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); if(!regs.cfgr.ms0) step(2); } //$80-8f(alt2): mult #N template void GSU::op_mult_i() { regs.dr() = (int8)regs.sr() * (int8)n; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); if(!regs.cfgr.ms0) step(2); } //$80-8f(alt3): umult #N template void GSU::op_umult_i() { regs.dr() = (uint8)regs.sr() * (uint8)n; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); if(!regs.cfgr.ms0) step(2); } //$90: sbk void GSU::op_sbk() { rambuffer_write(regs.ramaddr ^ 0, regs.sr() >> 0); rambuffer_write(regs.ramaddr ^ 1, regs.sr() >> 8); regs.reset(); } //$91-94: link #N template void GSU::op_link() { regs.r[11] = regs.r[15] + n; regs.reset(); } //$95: sex void GSU::op_sex() { regs.dr() = (int8)regs.sr(); regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$96(alt0): asr void GSU::op_asr() { regs.sfr.cy = (regs.sr() & 1); regs.dr() = (int16_t)regs.sr() >> 1; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$96(alt1): div2 void GSU::op_div2() { regs.sfr.cy = (regs.sr() & 1); regs.dr() = ((int16_t)regs.sr() >> 1) + ((regs.sr() + 1) >> 16); regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$97: ror void GSU::op_ror() { bool carry = (regs.sr() & 1); regs.dr() = (regs.sfr.cy << 15) | (regs.sr() >> 1); regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.cy = carry; regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$98-9d(alt0): jmp rN template void GSU::op_jmp_r() { regs.r[15] = regs.r[n]; regs.reset(); } //$98-9d(alt1): ljmp rN template void GSU::op_ljmp_r() { regs.pbr = regs.r[n] & 0x7f; regs.r[15] = regs.sr(); regs.cbr = regs.r[15] & 0xfff0; cache_flush(); regs.reset(); } //$9e: lob void GSU::op_lob() { regs.dr() = regs.sr() & 0xff; regs.sfr.s = (regs.dr() & 0x80); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$9f(alt0): fmult void GSU::op_fmult() { uint32_t result = (int16_t)regs.sr() * (int16_t)regs.r[6]; regs.dr() = result >> 16; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.cy = (result & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); step(4 + (regs.cfgr.ms0 << 2)); } //$9f(alt1): lmult void GSU::op_lmult() { uint32_t result = (int16_t)regs.sr() * (int16_t)regs.r[6]; regs.r[4] = result; regs.dr() = result >> 16; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.cy = (result & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); step(4 + (regs.cfgr.ms0 << 2)); } //$a0-af(alt0): ibt rN,#pp template void GSU::op_ibt_r() { regs.r[n] = (int8)pipe(); regs.reset(); } //$a0-af(alt1): lms rN,(yy) template void GSU::op_lms_r() { regs.ramaddr = pipe() << 1; uint16_t data; data = rambuffer_read(regs.ramaddr ^ 0) << 0; data |= rambuffer_read(regs.ramaddr ^ 1) << 8; regs.r[n] = data; regs.reset(); } //$a0-af(alt2): sms (yy),rN template void GSU::op_sms_r() { regs.ramaddr = pipe() << 1; rambuffer_write(regs.ramaddr ^ 0, regs.r[n] >> 0); rambuffer_write(regs.ramaddr ^ 1, regs.r[n] >> 8); regs.reset(); } //$b0-bf(b0): from rN //$b0-bf(b1): moves rN template void GSU::op_from_r() { if(regs.sfr.b == 0) { regs.sreg = n; } else { regs.dr() = regs.r[n]; regs.sfr.ov = (regs.dr() & 0x80); regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } } //$c0: hib void GSU::op_hib() { regs.dr() = regs.sr() >> 8; regs.sfr.s = (regs.dr() & 0x80); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$c1-cf(alt0): or rN template void GSU::op_or_r() { regs.dr() = regs.sr() | regs.r[n]; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$c1-cf(alt1): xor rN template void GSU::op_xor_r() { regs.dr() = regs.sr() ^ regs.r[n]; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$c1-cf(alt2): or #N template void GSU::op_or_i() { regs.dr() = regs.sr() | n; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$c1-cf(alt3): xor #N template void GSU::op_xor_i() { regs.dr() = regs.sr() ^ n; regs.sfr.s = (regs.dr() & 0x8000); regs.sfr.z = (regs.dr() == 0); regs.reset(); } //$d0-de: inc rN template void GSU::op_inc_r() { regs.r[n]++; regs.sfr.s = (regs.r[n] & 0x8000); regs.sfr.z = (regs.r[n] == 0); regs.reset(); } //$df(alt0): getc void GSU::op_getc() { regs.colr = color(rombuffer_read()); regs.reset(); } //$df(alt2): ramb void GSU::op_ramb() { rambuffer_sync(); regs.rambr = regs.sr(); regs.reset(); } //$df(alt3): romb void GSU::op_romb() { rombuffer_sync(); regs.rombr = regs.sr() & 0x7f; regs.reset(); } //$e0-ee: dec rN template void GSU::op_dec_r() { regs.r[n]--; regs.sfr.s = (regs.r[n] & 0x8000); regs.sfr.z = (regs.r[n] == 0); regs.reset(); } //$ef(alt0): getb void GSU::op_getb() { regs.dr() = rombuffer_read(); regs.reset(); } //$ef(alt1): getbh void GSU::op_getbh() { regs.dr() = (rombuffer_read() << 8) | (regs.sr() & 0x00ff); regs.reset(); } //$ef(alt2): getbl void GSU::op_getbl() { regs.dr() = (regs.sr() & 0xff00) | (rombuffer_read() << 0); regs.reset(); } //$ef(alt3): getbs void GSU::op_getbs() { regs.dr() = (int8)rombuffer_read(); regs.reset(); } //$f0-ff(alt0): iwt rN,#xx template void GSU::op_iwt_r() { uint16_t data; data = pipe() << 0; data |= pipe() << 8; regs.r[n] = data; regs.reset(); } //$f0-ff(alt1): lm rN,(xx) template void GSU::op_lm_r() { regs.ramaddr = pipe() << 0; regs.ramaddr |= pipe() << 8; uint16_t data; data = rambuffer_read(regs.ramaddr ^ 0) << 0; data |= rambuffer_read(regs.ramaddr ^ 1) << 8; regs.r[n] = data; regs.reset(); } //$f0-ff(alt2): sm (xx),rN template void GSU::op_sm_r() { regs.ramaddr = pipe() << 0; regs.ramaddr |= pipe() << 8; rambuffer_write(regs.ramaddr ^ 0, regs.r[n] >> 0); rambuffer_write(regs.ramaddr ^ 1, regs.r[n] >> 8); regs.reset(); } sfc/alt/dsp/blargg_common.h000664 001750 001750 00000012125 12651764221 017011 0ustar00sergiosergio000000 000000 // Sets up common environment for Shay Green's libraries. // To change configuration options, modify blargg_config.h, not this file. // snes_spc 0.9.0 #ifndef BLARGG_COMMON_H #define BLARGG_COMMON_H #include #include #include #include #undef BLARGG_COMMON_H // allow blargg_config.h to #include blargg_common.h #include "blargg_config.h" #ifndef BLARGG_COMMON_H #define BLARGG_COMMON_H // BLARGG_RESTRICT: equivalent to restrict, where supported #if defined (__GNUC__) || _MSC_VER >= 1100 #define BLARGG_RESTRICT __restrict #else #define BLARGG_RESTRICT #endif // STATIC_CAST(T,expr): Used in place of static_cast (expr) #ifndef STATIC_CAST #define STATIC_CAST(T,expr) ((T) (expr)) #endif // blargg_err_t (0 on success, otherwise error string) #ifndef blargg_err_t typedef const char* blargg_err_t; #endif // blargg_vector - very lightweight vector of POD types (no constructor/destructor) template class blargg_vector { T* begin_; size_t size_; public: blargg_vector() : begin_( 0 ), size_( 0 ) { } ~blargg_vector() { free( begin_ ); } size_t size() const { return size_; } T* begin() const { return begin_; } T* end() const { return begin_ + size_; } blargg_err_t resize( size_t n ) { // TODO: blargg_common.cpp to hold this as an outline function, ugh void* p = realloc( begin_, n * sizeof (T) ); if ( p ) begin_ = (T*) p; else if ( n > size_ ) // realloc failure only a problem if expanding return "Out of memory"; size_ = n; return 0; } void clear() { void* p = begin_; begin_ = 0; size_ = 0; free( p ); } T& operator [] ( size_t n ) const { assert( n <= size_ ); // <= to allow past-the-end value return begin_ [n]; } }; #ifndef BLARGG_DISABLE_NOTHROW // throw spec mandatory in ISO C++ if operator new can return NULL #if __cplusplus >= 199711 || defined (__GNUC__) #define BLARGG_THROWS( spec ) throw spec #else #define BLARGG_THROWS( spec ) #endif #define BLARGG_DISABLE_NOTHROW \ void* operator new ( size_t s ) BLARGG_THROWS(()) { return malloc( s ); }\ void operator delete ( void* p ) { free( p ); } #define BLARGG_NEW new #else #include #define BLARGG_NEW new (std::nothrow) #endif // BLARGG_4CHAR('a','b','c','d') = 'abcd' (four character integer constant) #define BLARGG_4CHAR( a, b, c, d ) \ ((a&0xFF)*0x1000000L + (b&0xFF)*0x10000L + (c&0xFF)*0x100L + (d&0xFF)) // BOOST_STATIC_ASSERT( expr ): Generates compile error if expr is 0. #ifndef BOOST_STATIC_ASSERT #ifdef _MSC_VER // MSVC6 (_MSC_VER < 1300) fails for use of __LINE__ when /Zl is specified #define BOOST_STATIC_ASSERT( expr ) \ void blargg_failed_( int (*arg) [2 / (int) !!(expr) - 1] ) #else // Some other compilers fail when declaring same function multiple times in class, // so differentiate them by line #define BOOST_STATIC_ASSERT( expr ) \ void blargg_failed_( int (*arg) [2 / !!(expr) - 1] [__LINE__] ) #endif #endif // BLARGG_COMPILER_HAS_BOOL: If 0, provides bool support for old compiler. If 1, // compiler is assumed to support bool. If undefined, availability is determined. #ifndef BLARGG_COMPILER_HAS_BOOL #if defined (__MWERKS__) #if !__option(bool) #define BLARGG_COMPILER_HAS_BOOL 0 #endif #elif defined (_MSC_VER) #if _MSC_VER < 1100 #define BLARGG_COMPILER_HAS_BOOL 0 #endif #elif defined (__GNUC__) // supports bool #elif __cplusplus < 199711 #define BLARGG_COMPILER_HAS_BOOL 0 #endif #endif #if defined (BLARGG_COMPILER_HAS_BOOL) && !BLARGG_COMPILER_HAS_BOOL // If you get errors here, modify your blargg_config.h file typedef int bool; const bool true = 1; const bool false = 0; #endif // blargg_long/blargg_ulong = at least 32 bits, int if it's big enough #if INT_MAX < 0x7FFFFFFF || LONG_MAX == 0x7FFFFFFF typedef long blargg_long; #else typedef int blargg_long; #endif #if UINT_MAX < 0xFFFFFFFF || ULONG_MAX == 0xFFFFFFFF typedef unsigned long blargg_ulong; #else typedef unsigned blargg_ulong; #endif // BOOST::int8_t etc. // HAVE_STDINT_H: If defined, use for int8_t etc. #if defined (HAVE_STDINT_H) #include #define BOOST // HAVE_INTTYPES_H: If defined, use for int8_t etc. #elif defined (HAVE_INTTYPES_H) #include #define BOOST #else struct BOOST { #if UCHAR_MAX == 0xFF && SCHAR_MAX == 0x7F typedef signed char int8_t; typedef unsigned char uint8_t; #else // No suitable 8-bit type available typedef struct see_blargg_common_h int8_t; typedef struct see_blargg_common_h uint8_t; #endif #if USHRT_MAX == 0xFFFF typedef short int16_t; typedef unsigned short uint16_t; #else // No suitable 16-bit type available typedef struct see_blargg_common_h int16_t; typedef struct see_blargg_common_h uint16_t; #endif #if ULONG_MAX == 0xFFFFFFFF typedef long int32_t; typedef unsigned long uint32_t; #elif UINT_MAX == 0xFFFFFFFF typedef int int32_t; typedef unsigned int uint32_t; #else // No suitable 32-bit type available typedef struct see_blargg_common_h int32_t; typedef struct see_blargg_common_h uint32_t; #endif }; #endif #endif #endif phoenix/qt/utility.cpp000664 001750 001750 00000023027 12651764221 016221 0ustar00sergiosergio000000 000000 namespace phoenix { static QIcon CreateIcon(const nall::image& image, bool scale = false) { nall::image qtBuffer = image; qtBuffer.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0); if(scale) qtBuffer.scale(16, 16, Interpolation::Linear); QImage qtImage(qtBuffer.data, qtBuffer.width, qtBuffer.height, QImage::Format_ARGB32); return QIcon(QPixmap::fromImage(qtImage)); } static lstring DropPaths(QDropEvent* event) { QList urls = event->mimeData()->urls(); if(urls.size() == 0) return {}; lstring paths; for(unsigned n = 0; n < urls.size(); n++) { string path = urls[n].path().toUtf8().constData(); if(path.empty()) continue; if(directory::exists(path) && !path.endsWith("/")) path.append("/"); paths.append(path); } return paths; } static Position GetDisplacement(Sizable* sizable) { Position position; while(sizable->state.parent) { Position displacement = sizable->state.parent->p.displacement(); position.x += displacement.x; position.y += displacement.y; sizable = sizable->state.parent; } return position; } static Layout* GetParentWidgetLayout(Sizable* sizable) { while(sizable) { if(sizable->state.parent && dynamic_cast(sizable->state.parent)) return (Layout*)sizable; sizable = sizable->state.parent; } return nullptr; } static Widget* GetParentWidget(Sizable* sizable) { while(sizable) { if(sizable->state.parent && dynamic_cast(sizable->state.parent)) return (Widget*)sizable->state.parent; sizable = sizable->state.parent; } return nullptr; } static Keyboard::Keycode Keysym(int keysym) { switch(keysym) { case XK_Escape: return Keyboard::Keycode::Escape; case XK_F1: return Keyboard::Keycode::F1; case XK_F2: return Keyboard::Keycode::F2; case XK_F3: return Keyboard::Keycode::F3; case XK_F4: return Keyboard::Keycode::F4; case XK_F5: return Keyboard::Keycode::F5; case XK_F6: return Keyboard::Keycode::F6; case XK_F7: return Keyboard::Keycode::F7; case XK_F8: return Keyboard::Keycode::F8; case XK_F9: return Keyboard::Keycode::F9; case XK_F10: return Keyboard::Keycode::F10; case XK_F11: return Keyboard::Keycode::F11; case XK_F12: return Keyboard::Keycode::F12; case XK_Print: return Keyboard::Keycode::PrintScreen; //Keyboard::Keycode::SysRq case XK_Scroll_Lock: return Keyboard::Keycode::ScrollLock; case XK_Pause: return Keyboard::Keycode::Pause; //Keyboard::Keycode::Break case XK_Insert: return Keyboard::Keycode::Insert; case XK_Delete: return Keyboard::Keycode::Delete; case XK_Home: return Keyboard::Keycode::Home; case XK_End: return Keyboard::Keycode::End; case XK_Prior: return Keyboard::Keycode::PageUp; case XK_Next: return Keyboard::Keycode::PageDown; case XK_Up: return Keyboard::Keycode::Up; case XK_Down: return Keyboard::Keycode::Down; case XK_Left: return Keyboard::Keycode::Left; case XK_Right: return Keyboard::Keycode::Right; case XK_grave: return Keyboard::Keycode::Grave; case XK_1: return Keyboard::Keycode::Number1; case XK_2: return Keyboard::Keycode::Number2; case XK_3: return Keyboard::Keycode::Number3; case XK_4: return Keyboard::Keycode::Number4; case XK_5: return Keyboard::Keycode::Number5; case XK_6: return Keyboard::Keycode::Number6; case XK_7: return Keyboard::Keycode::Number7; case XK_8: return Keyboard::Keycode::Number8; case XK_9: return Keyboard::Keycode::Number9; case XK_0: return Keyboard::Keycode::Number0; case XK_minus: return Keyboard::Keycode::Minus; case XK_equal: return Keyboard::Keycode::Equal; case XK_BackSpace: return Keyboard::Keycode::Backspace; case XK_asciitilde: return Keyboard::Keycode::Tilde; case XK_exclam: return Keyboard::Keycode::Exclamation; case XK_at: return Keyboard::Keycode::At; case XK_numbersign: return Keyboard::Keycode::Pound; case XK_dollar: return Keyboard::Keycode::Dollar; case XK_percent: return Keyboard::Keycode::Percent; case XK_asciicircum: return Keyboard::Keycode::Power; case XK_ampersand: return Keyboard::Keycode::Ampersand; case XK_asterisk: return Keyboard::Keycode::Asterisk; case XK_parenleft: return Keyboard::Keycode::ParenthesisLeft; case XK_parenright: return Keyboard::Keycode::ParenthesisRight; case XK_underscore: return Keyboard::Keycode::Underscore; case XK_plus: return Keyboard::Keycode::Plus; case XK_bracketleft: return Keyboard::Keycode::BracketLeft; case XK_bracketright: return Keyboard::Keycode::BracketRight; case XK_backslash: return Keyboard::Keycode::Backslash; case XK_semicolon: return Keyboard::Keycode::Semicolon; case XK_apostrophe: return Keyboard::Keycode::Apostrophe; case XK_comma: return Keyboard::Keycode::Comma; case XK_period: return Keyboard::Keycode::Period; case XK_slash: return Keyboard::Keycode::Slash; case XK_braceleft: return Keyboard::Keycode::BraceLeft; case XK_braceright: return Keyboard::Keycode::BraceRight; case XK_bar: return Keyboard::Keycode::Pipe; case XK_colon: return Keyboard::Keycode::Colon; case XK_quotedbl: return Keyboard::Keycode::Quote; case XK_less: return Keyboard::Keycode::CaretLeft; case XK_greater: return Keyboard::Keycode::CaretRight; case XK_question: return Keyboard::Keycode::Question; case XK_Tab: return Keyboard::Keycode::Tab; case XK_Caps_Lock: return Keyboard::Keycode::CapsLock; case XK_Return: return Keyboard::Keycode::Return; case XK_Shift_L: return Keyboard::Keycode::ShiftLeft; case XK_Shift_R: return Keyboard::Keycode::ShiftRight; case XK_Control_L: return Keyboard::Keycode::ControlLeft; case XK_Control_R: return Keyboard::Keycode::ControlRight; case XK_Super_L: return Keyboard::Keycode::SuperLeft; case XK_Super_R: return Keyboard::Keycode::SuperRight; case XK_Alt_L: return Keyboard::Keycode::AltLeft; case XK_Alt_R: return Keyboard::Keycode::AltRight; case XK_space: return Keyboard::Keycode::Space; case XK_Menu: return Keyboard::Keycode::Menu; case XK_A: return Keyboard::Keycode::A; case XK_B: return Keyboard::Keycode::B; case XK_C: return Keyboard::Keycode::C; case XK_D: return Keyboard::Keycode::D; case XK_E: return Keyboard::Keycode::E; case XK_F: return Keyboard::Keycode::F; case XK_G: return Keyboard::Keycode::G; case XK_H: return Keyboard::Keycode::H; case XK_I: return Keyboard::Keycode::I; case XK_J: return Keyboard::Keycode::J; case XK_K: return Keyboard::Keycode::K; case XK_L: return Keyboard::Keycode::L; case XK_M: return Keyboard::Keycode::M; case XK_N: return Keyboard::Keycode::N; case XK_O: return Keyboard::Keycode::O; case XK_P: return Keyboard::Keycode::P; case XK_Q: return Keyboard::Keycode::Q; case XK_R: return Keyboard::Keycode::R; case XK_S: return Keyboard::Keycode::S; case XK_T: return Keyboard::Keycode::T; case XK_U: return Keyboard::Keycode::U; case XK_V: return Keyboard::Keycode::V; case XK_W: return Keyboard::Keycode::W; case XK_X: return Keyboard::Keycode::X; case XK_Y: return Keyboard::Keycode::Y; case XK_Z: return Keyboard::Keycode::Z; case XK_a: return Keyboard::Keycode::a; case XK_b: return Keyboard::Keycode::b; case XK_c: return Keyboard::Keycode::c; case XK_d: return Keyboard::Keycode::d; case XK_e: return Keyboard::Keycode::e; case XK_f: return Keyboard::Keycode::f; case XK_g: return Keyboard::Keycode::g; case XK_h: return Keyboard::Keycode::h; case XK_i: return Keyboard::Keycode::i; case XK_j: return Keyboard::Keycode::j; case XK_k: return Keyboard::Keycode::k; case XK_l: return Keyboard::Keycode::l; case XK_m: return Keyboard::Keycode::m; case XK_n: return Keyboard::Keycode::n; case XK_o: return Keyboard::Keycode::o; case XK_p: return Keyboard::Keycode::p; case XK_q: return Keyboard::Keycode::q; case XK_r: return Keyboard::Keycode::r; case XK_s: return Keyboard::Keycode::s; case XK_t: return Keyboard::Keycode::t; case XK_u: return Keyboard::Keycode::u; case XK_v: return Keyboard::Keycode::v; case XK_w: return Keyboard::Keycode::w; case XK_x: return Keyboard::Keycode::x; case XK_y: return Keyboard::Keycode::y; case XK_z: return Keyboard::Keycode::z; case XK_Num_Lock: return Keyboard::Keycode::NumLock; case XK_KP_Divide: return Keyboard::Keycode::Divide; case XK_KP_Multiply: return Keyboard::Keycode::Multiply; case XK_KP_Subtract: return Keyboard::Keycode::Subtract; case XK_KP_Add: return Keyboard::Keycode::Add; case XK_KP_Enter: return Keyboard::Keycode::Enter; case XK_KP_Decimal: return Keyboard::Keycode::Point; case XK_KP_1: return Keyboard::Keycode::Keypad1; case XK_KP_2: return Keyboard::Keycode::Keypad2; case XK_KP_3: return Keyboard::Keycode::Keypad3; case XK_KP_4: return Keyboard::Keycode::Keypad4; case XK_KP_5: return Keyboard::Keycode::Keypad5; case XK_KP_6: return Keyboard::Keycode::Keypad6; case XK_KP_7: return Keyboard::Keycode::Keypad7; case XK_KP_8: return Keyboard::Keycode::Keypad8; case XK_KP_9: return Keyboard::Keycode::Keypad9; case XK_KP_0: return Keyboard::Keycode::Keypad0; case XK_KP_Home: return Keyboard::Keycode::KeypadHome; case XK_KP_End: return Keyboard::Keycode::KeypadEnd; case XK_KP_Page_Up: return Keyboard::Keycode::KeypadPageUp; case XK_KP_Page_Down: return Keyboard::Keycode::KeypadPageDown; case XK_KP_Up: return Keyboard::Keycode::KeypadUp; case XK_KP_Down: return Keyboard::Keycode::KeypadDown; case XK_KP_Left: return Keyboard::Keycode::KeypadLeft; case XK_KP_Right: return Keyboard::Keycode::KeypadRight; case XK_KP_Begin: return Keyboard::Keycode::KeypadCenter; case XK_KP_Insert: return Keyboard::Keycode::KeypadInsert; case XK_KP_Delete: return Keyboard::Keycode::KeypadDelete; } return Keyboard::Keycode::None; } } ruby/video/xshm.cpp000664 001750 001750 00000015141 12651764221 015464 0ustar00sergiosergio000000 000000 #include #include namespace ruby { struct pVideoXShm { struct Device { Display* display = nullptr; int screen; int depth; Visual* visual = nullptr; Window window; XShmSegmentInfo shmInfo; XImage* image = nullptr; uint32_t* buffer = nullptr; unsigned width, height; } device; struct Settings { uintptr_t handle; unsigned depth = 24; uint32_t* buffer = nullptr; unsigned width, height; } settings; struct Color { unsigned depth; unsigned shift; unsigned idepth; unsigned ishift; } red, green, blue; bool cap(const string& name) { if(name == Video::Handle) return true; if(name == Video::Depth) return true; return false; } any get(const string& name) { if(name == Video::Handle) return settings.handle; if(name == Video::Depth) return settings.depth; return false; } bool set(const string& name, const any& value) { if(name == Video::Handle) { settings.handle = any_cast(value); return true; } if(name == Video::Depth) { return setDepth(any_cast(value)); } return false; } bool lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) { if(settings.buffer == nullptr || settings.width != width || settings.height != height) { if(settings.buffer) delete[] settings.buffer; settings.width = width, settings.height = height; settings.buffer = new uint32_t[width * height](); } data = settings.buffer; pitch = settings.width * sizeof(uint32_t); return true; } void unlock() { } void clear() { if(settings.buffer == nullptr) return; memset(settings.buffer, 0, settings.width * settings.height * sizeof(uint32_t)); refresh(); } void refresh() { if(settings.buffer == nullptr) return; size(); float xRatio = (float)settings.width / (float)device.width; float yRatio = (float)settings.height / (float)device.height; float yStep = 0; for(unsigned y = 0; y < device.height; y++) { uint32_t* sp = settings.buffer + (unsigned)yStep * settings.width; uint32_t* dp = device.buffer + y * device.width; yStep += yRatio; float xStep = 0; for(unsigned x = 0; x < device.width; x++) { uint32_t color = sp[(unsigned)xStep]; xStep += xRatio; unsigned r = (color >> red.ishift ) & ((1 << red.idepth ) - 1); unsigned g = (color >> green.ishift) & ((1 << green.idepth) - 1); unsigned b = (color >> blue.ishift ) & ((1 << blue.idepth ) - 1); *dp++ = image::normalize(r, red.idepth, red.depth ) << red.shift | image::normalize(g, green.idepth, green.depth) << green.shift | image::normalize(b, blue.idepth, blue.depth ) << blue.shift; } } GC gc = XCreateGC(device.display, device.window, 0, 0); XShmPutImage( device.display, device.window, gc, device.image, 0, 0, 0, 0, device.width, device.height, False ); XFreeGC(device.display, gc); XFlush(device.display); } bool init() { device.display = XOpenDisplay(0); device.screen = DefaultScreen(device.display); XWindowAttributes getAttributes; XGetWindowAttributes(device.display, (Window)settings.handle, &getAttributes); device.depth = getAttributes.depth; device.visual = getAttributes.visual; unsigned visualID = XVisualIDFromVisual(device.visual); XVisualInfo visualTemplate = {0}; visualTemplate.screen = device.screen; visualTemplate.depth = device.depth; int visualsMatched = 0; XVisualInfo* visualList = XGetVisualInfo(device.display, VisualScreenMask | VisualDepthMask, &visualTemplate, &visualsMatched); for(unsigned n = 0; n < visualsMatched; n++) { auto& v = visualList[n]; if(v.visualid == visualID) { red.depth = bit::count(v.red_mask), red.shift = bit::first(v.red_mask); green.depth = bit::count(v.green_mask), green.shift = bit::first(v.green_mask); blue.depth = bit::count(v.blue_mask), blue.shift = bit::first(v.blue_mask); break; } } XFree(visualList); setDepth(settings.depth); XSetWindowAttributes setAttributes = {0}; setAttributes.border_pixel = 0; device.window = XCreateWindow(device.display, (Window)settings.handle, 0, 0, 256, 256, 0, getAttributes.depth, InputOutput, getAttributes.visual, CWBorderPixel, &setAttributes ); XSetWindowBackground(device.display, device.window, 0); XMapWindow(device.display, device.window); XFlush(device.display); while(XPending(device.display)) { XEvent event; XNextEvent(device.display, &event); } if(size() == false) return false; return true; } void term() { free(); if(device.display) { XCloseDisplay(device.display); device.display = nullptr; } } ~pVideoXShm() { term(); } //internal: bool setDepth(unsigned depth) { if(depth == 24) { settings.depth = 24; red.idepth = 8, red.ishift = 16; green.idepth = 8, green.ishift = 8; blue.idepth = 8, blue.ishift = 0; return true; } if(depth == 30) { settings.depth = 30; red.idepth = 10, red.ishift = 20; green.idepth = 10, green.ishift = 10; blue.idepth = 10, blue.ishift = 0; return true; } return false; } bool size() { XWindowAttributes windowAttributes; XGetWindowAttributes(device.display, settings.handle, &windowAttributes); if(device.buffer && device.width == windowAttributes.width && device.height == windowAttributes.height) return true; device.width = windowAttributes.width, device.height = windowAttributes.height; XResizeWindow(device.display, device.window, device.width, device.height); free(); //create device.shmInfo.shmid = shmget(IPC_PRIVATE, device.width * device.height * sizeof(uint32_t), IPC_CREAT | 0777); if(device.shmInfo.shmid < 0) return false; device.shmInfo.shmaddr = (char*)shmat(device.shmInfo.shmid, 0, 0); device.shmInfo.readOnly = False; XShmAttach(device.display, &device.shmInfo); device.buffer = (uint32_t*)device.shmInfo.shmaddr; device.image = XShmCreateImage(device.display, device.visual, device.depth, ZPixmap, device.shmInfo.shmaddr, &device.shmInfo, device.width, device.height ); return true; } void free() { if(device.buffer == nullptr) return; device.buffer = nullptr; XShmDetach(device.display, &device.shmInfo); XDestroyImage(device.image); shmdt(device.shmInfo.shmaddr); shmctl(device.shmInfo.shmid, IPC_RMID, 0); } }; DeclareVideo(XShm) } fc/apu/sweep.cpp000664 001750 001750 00000001757 12651764221 014726 0ustar00sergiosergio000000 000000 bool APU::Sweep::check_period() { if(pulse_period > 0x7ff) return false; if(decrement == 0) { if((pulse_period + (pulse_period >> shift)) & 0x800) return false; } return true; } void APU::Sweep::clock(unsigned channel) { if(--counter == 0) { counter = period + 1; if(enable && shift && pulse_period > 8) { signed delta = pulse_period >> shift; if(decrement) { pulse_period -= delta; if(channel == 0) pulse_period--; } else if((pulse_period + delta) < 0x800) { pulse_period += delta; } } } if(reload) { reload = false; counter = period + 1; } } void APU::Sweep::power() { shift = 0; decrement = 0; period = 0; counter = 1; enable = 0; reload = 0; pulse_period = 0; } void APU::Sweep::reset() { } void APU::Sweep::serialize(serializer& s) { s.integer(shift); s.integer(decrement); s.integer(period); s.integer(counter); s.integer(enable); s.integer(reload); s.integer(pulse_period); } sfc/chip/armdsp/memory.cpp000664 001750 001750 00000004732 12651764221 016716 0ustar00sergiosergio000000 000000 #ifdef ARMDSP_CPP void ArmDSP::bus_idle(uint32 addr) { step(1); } uint32 ArmDSP::bus_read(uint32 addr, uint32 size) { step(1); static auto memory = [&](const uint8 *memory, uint32 addr, uint32 size) -> uint32 { switch(size) { case Word: memory += addr & ~3; return memory[0] << 0 | memory[1] << 8 | memory[2] << 16 | memory[3] << 24; case Byte: return memory[addr]; } // NOT REACHED return 0; }; switch(addr & 0xe0000000) { case 0x00000000: return memory(programROM, addr & 0x1ffff, size); case 0x20000000: return pipeline.fetch.instruction; case 0x40000000: break; case 0x60000000: return 0x40404001; case 0x80000000: return pipeline.fetch.instruction; case 0xa0000000: return memory(dataROM, addr & 0x7fff, size); case 0xc0000000: return pipeline.fetch.instruction; case 0xe0000000: return memory(programRAM, addr & 0x3fff, size); } addr &= 0xe000003f; if(addr == 0x40000010) { if(bridge.cputoarm.ready) { bridge.cputoarm.ready = false; return bridge.cputoarm.data; } } if(addr == 0x40000020) { return bridge.status(); } return 0u; } void ArmDSP::bus_write(uint32 addr, uint32 size, uint32 word) { step(1); static auto memory = [](uint8 *memory, uint32 addr, uint32 size, uint32 word) { switch(size) { case Word: memory += addr & ~3; *memory++ = word >> 0; *memory++ = word >> 8; *memory++ = word >> 16; *memory++ = word >> 24; break; case Byte: memory += addr; *memory++ = word >> 0; break; } }; switch(addr & 0xe0000000) { case 0x00000000: return; case 0x20000000: return; case 0x40000000: break; case 0x60000000: return; case 0x80000000: return; case 0xa0000000: return; case 0xc0000000: return; case 0xe0000000: return memory(programRAM, addr & 0x3fff, size, word); } addr &= 0xe000003f; word &= 0x000000ff; if(addr == 0x40000000) { bridge.armtocpu.ready = true; bridge.armtocpu.data = word; return; } if(addr == 0x40000010) { bridge.signal = true; return; } if(addr == 0x40000020) { bridge.timerlatch = (bridge.timerlatch & 0xffff00) | (word << 0); return; } if(addr == 0x40000024) { bridge.timerlatch = (bridge.timerlatch & 0xff00ff) | (word << 8); return; } if(addr == 0x40000028) { bridge.timerlatch = (bridge.timerlatch & 0x00ffff) | (word << 16); return; } if(addr == 0x4000002c) { bridge.timer = bridge.timerlatch; return; } } #endif phoenix/reference/widget/line-edit.cpp000664 001750 001750 00000000324 12651764221 021160 0ustar00sergiosergio000000 000000 namespace phoenix { void pLineEdit::setEditable(bool editable) { } void pLineEdit::setText(string text) { } string pLineEdit::text() { } void pLineEdit::constructor() { } void pLineEdit::destructor() { } } ananke/resource/home.png000664 001750 001750 00000001136 12651764221 016433 0ustar00sergiosergio000000 000000 PNG  IHDRabKGDC pHYs B(xtIME %S*;IDAT8˕kSQ{K@$UdQ{hU\BJ'\:n%`?y[\ZbQ!y!ٗP!g\s)Uz0{JiO=Iqhx87oW"nbY'Nq8'&Skk\Rnu@~Sa12jJ\~zdt*M*@kh,B~D0.`vКErn. RTk69?## |Ά\N>=6o3V?Et0F,/-yx0!O"^SyZk&3úӲ,L0K;t~ 0 R"Ē`So/:"Z$c`(.Ns5Cq.KMB~8pA$mpg,+:bwVգIENDB`phoenix/gtk/monitor.cpp000664 001750 001750 00000000707 12651764221 016346 0ustar00sergiosergio000000 000000 namespace phoenix { unsigned pMonitor::count() { return gdk_screen_get_n_monitors(gdk_screen_get_default()); } Geometry pMonitor::geometry(unsigned monitor) { GdkRectangle rectangle = {0}; gdk_screen_get_monitor_geometry(gdk_screen_get_default(), monitor, &rectangle); return {rectangle.x, rectangle.y, rectangle.width, rectangle.height}; } unsigned pMonitor::primary() { return gdk_screen_get_primary_monitor(gdk_screen_get_default()); } } processor/r6502/instructions.cpp000664 001750 001750 00000022351 12651764221 017760 0ustar00sergiosergio000000 000000 //opcode functions //================ void R6502::opf_adc() { signed result = regs.a + rd + regs.p.c; regs.p.v = ~(regs.a ^ rd) & (regs.a ^ result) & 0x80; regs.p.c = (result > 0xff); regs.p.n = (result & 0x80); regs.p.z = ((uint8)result == 0); regs.a = result; } void R6502::opf_and() { regs.a &= rd; regs.p.n = (regs.a & 0x80); regs.p.z = (regs.a == 0); } void R6502::opf_asl() { regs.p.c = rd & 0x80; rd <<= 1; regs.p.n = (rd & 0x80); regs.p.z = (rd == 0); } void R6502::opf_bit() { regs.p.n = (rd & 0x80); regs.p.v = (rd & 0x40); regs.p.z = ((rd & regs.a) == 0); } void R6502::opf_cmp() { signed r = regs.a - rd; regs.p.n = (r & 0x80); regs.p.z = (uint8)(r == 0); regs.p.c = (r >= 0); } void R6502::opf_cpx() { signed r = regs.x - rd; regs.p.n = (r & 0x80); regs.p.z = (uint8)(r == 0); regs.p.c = (r >= 0); } void R6502::opf_cpy() { signed r = regs.y - rd; regs.p.n = (r & 0x80); regs.p.z = (uint8)(r == 0); regs.p.c = (r >= 0); } void R6502::opf_dec() { rd--; regs.p.n = (rd & 0x80); regs.p.z = (rd == 0); } void R6502::opf_eor() { regs.a ^= rd; regs.p.n = (regs.a & 0x80); regs.p.z = (regs.a == 0); } void R6502::opf_inc() { rd++; regs.p.n = (rd & 0x80); regs.p.z = (rd == 0); } void R6502::opf_lda() { regs.a = rd; regs.p.n = (regs.a & 0x80); regs.p.z = (regs.a == 0); } void R6502::opf_ldx() { regs.x = rd; regs.p.n = (regs.x & 0x80); regs.p.z = (regs.x == 0); } void R6502::opf_ldy() { regs.y = rd; regs.p.n = (regs.y & 0x80); regs.p.z = (regs.y == 0); } void R6502::opf_lsr() { regs.p.c = rd & 0x01; rd >>= 1; regs.p.n = (rd & 0x80); regs.p.z = (rd == 0); } void R6502::opf_ora() { regs.a |= rd; regs.p.n = (regs.a & 0x80); regs.p.z = (regs.a == 0); } void R6502::opf_rla() { unsigned carry = (unsigned)regs.p.c; regs.p.c = regs.a & 0x80; regs.a = (regs.a << 1) | carry; regs.p.n = (regs.a & 0x80); regs.p.z = (regs.a == 0); } void R6502::opf_rol() { unsigned carry = (unsigned)regs.p.c; regs.p.c = rd & 0x80; rd = (rd << 1) | carry; regs.p.n = (rd & 0x80); regs.p.z = (rd == 0); } void R6502::opf_ror() { unsigned carry = (unsigned)regs.p.c << 7; regs.p.c = rd & 0x01; rd = carry | (rd >> 1); regs.p.n = (rd & 0x80); regs.p.z = (rd == 0); } void R6502::opf_rra() { unsigned carry = (unsigned)regs.p.c << 7; regs.p.c = regs.a & 0x01; regs.a = carry | (regs.a >> 1); regs.p.n = (regs.a & 0x80); regs.p.z = (regs.a == 0); } void R6502::opf_sbc() { rd ^= 0xff; return opf_adc(); } void R6502::opf_sla() { regs.p.c = regs.a & 0x80; regs.a <<= 1; regs.p.n = (regs.a & 0x80); regs.p.z = (regs.a == 0); } void R6502::opf_sra() { regs.p.c = regs.a & 0x01; regs.a >>= 1; regs.p.n = (regs.a & 0x80); regs.p.z = (regs.a == 0); } //opcode implementations //====================== void R6502::opi_branch(bool condition) { if(condition == false) { L rd = op_readpci(); } else { rd = op_readpci(); aa = regs.pc + (int8)rd; op_page(regs.pc, aa); L op_readpc(); regs.pc = aa; } } void R6502::opi_clear_flag(bool& flag) { L op_readpc(); flag = 0; } void R6502::opi_decrement(uint8& r) { L op_readpc(); r--; regs.p.n = (r & 0x80); regs.p.z = (r == 0); } void R6502::opi_increment(uint8& r) { L op_readpc(); r++; regs.p.n = (r & 0x80); regs.p.z = (r == 0); } void R6502::opi_pull(uint8& r) { op_readpc(); op_readpc(); L r = op_readsp(); regs.p.n = (r & 0x80); regs.p.z = (r == 0); } void R6502::opi_push(uint8& r) { op_readpc(); L op_writesp(r); } template void R6502::opi_read_absolute() { abs.l = op_readpci(); abs.h = op_readpci(); L rd = op_read(abs.w); call(op); } template void R6502::opi_read_absolute_x() { abs.l = op_readpci(); abs.h = op_readpci(); op_page(abs.w, abs.w + regs.x); L rd = op_read(abs.w + regs.x); call(op); } template void R6502::opi_read_absolute_y() { abs.l = op_readpci(); abs.h = op_readpci(); op_page(abs.w, abs.w + regs.y); L rd = op_read(abs.w + regs.y); call(op); } template void R6502::opi_read_immediate() { L rd = op_readpci(); call(op); } template void R6502::opi_read_indirect_zero_page_x() { zp = op_readpci(); op_readzp(zp); abs.l = op_readzp(zp++ + regs.x); abs.h = op_readzp(zp++ + regs.x); L rd = op_read(abs.w); call(op); } template void R6502::opi_read_indirect_zero_page_y() { rd = op_readpci(); abs.l = op_readzp(rd++); abs.h = op_readzp(rd++); op_page(abs.w, abs.w + regs.y); L rd = op_read(abs.w + regs.y); call(op); } template void R6502::opi_read_zero_page() { zp = op_readpci(); L rd = op_readzp(zp); call(op); } template void R6502::opi_read_zero_page_x() { zp = op_readpci(); op_readzp(zp); L rd = op_readzp(zp + regs.x); call(op); } template void R6502::opi_read_zero_page_y() { zp = op_readpci(); op_readzp(zp); L rd = op_readzp(zp + regs.y); call(op); } template void R6502::opi_rmw_absolute() { abs.l = op_readpci(); abs.h = op_readpci(); rd = op_read(abs.w); op_write(abs.w, rd); call(op); L op_write(abs.w, rd); } template void R6502::opi_rmw_absolute_x() { abs.l = op_readpci(); abs.h = op_readpci(); op_page_always(abs.w, abs.w + regs.x); rd = op_read(abs.w + regs.x); op_write(abs.w + regs.x, rd); call(op); L op_write(abs.w + regs.x, rd); } template void R6502::opi_rmw_zero_page() { zp = op_readpci(); rd = op_readzp(zp); op_writezp(zp, rd); call(op); L op_writezp(zp, rd); } template void R6502::opi_rmw_zero_page_x() { zp = op_readpci(); op_readzp(zp); rd = op_readzp(zp + regs.x); op_writezp(zp + regs.x, rd); call(op); L op_writezp(zp + regs.x, rd); } void R6502::opi_set_flag(bool& flag) { L op_readpc(); flag = 1; } template void R6502::opi_shift() { L op_readpc(); call(op); } void R6502::opi_store_absolute(uint8& r) { abs.l = op_readpci(); abs.h = op_readpci(); L op_write(abs.w, r); } void R6502::opi_store_absolute_x(uint8& r) { abs.l = op_readpci(); abs.h = op_readpci(); op_page_always(abs.w, abs.w + regs.x); L op_write(abs.w + regs.x, r); } void R6502::opi_store_absolute_y(uint8& r) { abs.l = op_readpci(); abs.h = op_readpci(); op_page_always(abs.w, abs.w + regs.y); L op_write(abs.w + regs.y, r); } void R6502::opi_store_indirect_zero_page_x(uint8& r) { zp = op_readpci(); op_readzp(zp); abs.l = op_readzp(zp++ + regs.x); abs.h = op_readzp(zp++ + regs.x); L op_write(abs.w, r); } void R6502::opi_store_indirect_zero_page_y(uint8& r) { rd = op_readpci(); abs.l = op_readzp(rd++); abs.h = op_readzp(rd++); op_page_always(abs.w, abs.w + regs.y); L op_write(abs.w + regs.y, r); } void R6502::opi_store_zero_page(uint8& r) { zp = op_readpci(); L op_writezp(zp, r); } void R6502::opi_store_zero_page_x(uint8& r) { zp = op_readpci(); op_readzp(zp); L op_writezp(zp + regs.x, r); } void R6502::opi_store_zero_page_y(uint8& r) { zp = op_readpci(); op_readzp(zp); L op_writezp(zp + regs.y, r); } void R6502::opi_transfer(uint8& s, uint8& d, bool flag) { L op_readpc(); d = s; if(flag == false) return; regs.p.n = (d & 0x80); regs.p.z = (d == 0); } //opcodes //======= void R6502::op_brk() { op_readpci(); op_writesp(regs.pc >> 8); op_writesp(regs.pc >> 0); op_writesp(regs.p | 0x30); abs.l = op_read(0xfffe); regs.p.i = 1; regs.p.d = 0; L abs.h = op_read(0xffff); regs.pc = abs.w; } void R6502::op_jmp_absolute() { abs.l = op_readpci(); L abs.h = op_readpci(); regs.pc = abs.w; } void R6502::op_jmp_indirect_absolute() { abs.l = op_readpci(); abs.h = op_readpci(); iabs.l = op_read(abs.w); abs.l++; L iabs.h = op_read(abs.w); abs.l++; regs.pc = iabs.w; } void R6502::op_jsr_absolute() { abs.l = op_readpci(); abs.h = op_readpci(); op_readpc(); regs.pc--; op_writesp(regs.pc >> 8); L op_writesp(regs.pc >> 0); regs.pc = abs.w; } void R6502::op_nop() { L op_readpc(); } void R6502::op_php() { op_readpc(); L op_writesp(regs.p | 0x30); } void R6502::op_plp() { op_readpc(); op_readpc(); L regs.p = op_readsp(); } void R6502::op_rti() { op_readpc(); op_readpc(); regs.p = op_readsp(); abs.l = op_readsp(); L abs.h = op_readsp(); regs.pc = abs.w; } void R6502::op_rts() { op_readpc(); op_readpc(); abs.l = op_readsp(); abs.h = op_readsp(); L op_readpc(); regs.pc = ++abs.w; } //illegal opcodes //=============== void R6502::opill_arr_immediate() { L rd = op_readpci(); regs.a &= rd; regs.a = (regs.p.c << 7) | (regs.a >> 1); regs.p.n = (regs.a & 0x80); regs.p.z = (regs.a == 0); regs.p.c = (regs.a & 0x40); regs.p.v = regs.p.c ^ ((regs.a >> 5) & 1); } void R6502::opill_nop_absolute() { abs.l = op_readpci(); abs.h = op_readpci(); L op_readpc(); } void R6502::opill_nop_absolute_x() { abs.l = op_readpci(); abs.h = op_readpci(); op_page(abs.w, abs.w + regs.x); L op_readpc(); } void R6502::opill_nop_immediate() { L rd = op_readpc(); } void R6502::opill_nop_implied() { L op_readpc(); } void R6502::opill_nop_zero_page() { zp = op_readpci(); L op_readzp(zp); } void R6502::opill_nop_zero_page_x() { zp = op_readpci(); op_readzp(zp); L op_readzp(zp + regs.x); } gb/cheat/000700 001750 001750 00000000000 12656700342 013347 5ustar00sergiosergio000000 000000 gba/cpu/cpu.hpp000664 001750 001750 00000001727 12651764221 014537 0ustar00sergiosergio000000 000000 struct CPU : Processor::ARM, Thread, MMIO { uint8* iwram; uint8* ewram; #include "registers.hpp" #include "state.hpp" static void Enter(); void main(); void step(unsigned clocks); void sync_step(unsigned clocks); void bus_idle(uint32 addr); uint32 bus_read(uint32 addr, uint32 size); void bus_write(uint32 addr, uint32 size, uint32 word); void keypad_run(); void power(); uint8 read(uint32 addr); void write(uint32 addr, uint8 byte); uint32 iwram_read(uint32 addr, uint32 size); void iwram_write(uint32 addr, uint32 size, uint32 word); uint32 ewram_read(uint32 addr, uint32 size); void ewram_write(uint32 addr, uint32 size, uint32 word); void dma_run(); void dma_transfer(Registers::DMA &dma); void dma_vblank(); void dma_hblank(); void dma_hdma(); void timer_step(unsigned clocks); void timer_increment(unsigned n); void timer_fifo_run(unsigned n); void serialize(serializer&); CPU(); ~CPU(); }; extern CPU cpu; phoenix/cocoa/widget/vertical-slider.hpp000664 001750 001750 00000001201 12651764221 021525 0ustar00sergiosergio000000 000000 @interface CocoaVerticalSlider : NSSlider { @public phoenix::VerticalSlider* verticalSlider; } -(id) initWith:(phoenix::VerticalSlider&)verticalSlider; -(IBAction) activate:(id)sender; @end namespace phoenix { struct pVerticalSlider : public pWidget { VerticalSlider& verticalSlider; CocoaVerticalSlider* cocoaVerticalSlider = nullptr; Size minimumSize(); void setGeometry(Geometry geometry); void setLength(unsigned length); void setPosition(unsigned position); pVerticalSlider(VerticalSlider& verticalSlider) : pWidget(verticalSlider), verticalSlider(verticalSlider) {} void constructor(); void destructor(); }; } target-ethos/bootstrap.cpp000664 001750 001750 00000000711 12651764221 017036 0ustar00sergiosergio000000 000000 #include #include #include #include void Program::bootstrap() { interface = new Interface; emulator.append(new Famicom::Interface); emulator.append(new SuperFamicom::Interface); emulator.append(new GameBoy::Interface); emulator.append(new GameBoyAdvance::Interface); for(auto& system : emulator) system->bind = interface; } nall/http.hpp000664 001750 001750 00000010546 12651764221 014334 0ustar00sergiosergio000000 000000 #ifndef NALL_HTTP_HPP #define NALL_HTTP_HPP #if !defined(_WIN32) #include #include #include #include #else #include #include #include #endif #include #include namespace nall { struct http { string hostname; addrinfo* serverinfo; int serversocket; string header; inline void download(const string& path, uint8_t*& data, unsigned& size) { data = nullptr; size = 0; send({ "GET ", path, " HTTP/1.1\r\n" "Host: ", hostname, "\r\n" "Connection: close\r\n" "\r\n" }); header = downloadHeader(); downloadContent(data, size); } inline bool connect(string host, unsigned port) { hostname = host; addrinfo hints; memset(&hints, 0, sizeof(addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; int status = getaddrinfo(hostname, string(port), &hints, &serverinfo); if(status != 0) return false; serversocket = socket(serverinfo->ai_family, serverinfo->ai_socktype, serverinfo->ai_protocol); if(serversocket == -1) return false; int result = ::connect(serversocket, serverinfo->ai_addr, serverinfo->ai_addrlen); if(result == -1) return false; return true; } inline bool send(const string& data) { return send((const uint8_t*)(const char*)data, data.length()); } inline bool send(const uint8_t* data, unsigned size) { while(size) { int length = ::send(serversocket, (const char*)data, size, 0); if(length == -1) return false; data += length; size -= length; } return true; } inline string downloadHeader() { string output; do { char buffer[2]; int length = recv(serversocket, buffer, 1, 0); if(length <= 0) return output; buffer[1] = 0; output.append(buffer); } while(output.endsWith("\r\n\r\n") == false); return output; } inline string downloadChunkLength() { string output; do { char buffer[2]; int length = recv(serversocket, buffer, 1, 0); if(length <= 0) return output; buffer[1] = 0; output.append(buffer); } while(output.endsWith("\r\n") == false); return output; } inline void downloadContent(uint8_t*& data, unsigned& size) { unsigned capacity = 0; if(header.ifind("\r\nTransfer-Encoding: chunked\r\n")) { while(true) { unsigned length = hex(downloadChunkLength()); if(length == 0) break; capacity += length; data = (uint8_t*)realloc(data, capacity); char buffer[length]; while(length) { int packetlength = recv(serversocket, buffer, length, 0); if(packetlength <= 0) break; memcpy(data + size, buffer, packetlength); size += packetlength; length -= packetlength; } } } else if(auto position = header.ifind("\r\nContent-Length: ")) { unsigned length = decimal((const char*)header + position() + 18); while(length) { char buffer[256]; int packetlength = recv(serversocket, buffer, min(256, length), 0); if(packetlength <= 0) break; capacity += packetlength; data = (uint8_t*)realloc(data, capacity); memcpy(data + size, buffer, packetlength); size += packetlength; length -= packetlength; } } else { while(true) { char buffer[256]; int packetlength = recv(serversocket, buffer, 256, 0); if(packetlength <= 0) break; capacity += packetlength; data = (uint8_t*)realloc(data, capacity); memcpy(data + size, buffer, packetlength); size += packetlength; } } data = (uint8_t*)realloc(data, capacity + 1); data[capacity] = 0; } inline void disconnect() { close(serversocket); freeaddrinfo(serverinfo); serverinfo = nullptr; serversocket = -1; } #ifdef _WIN32 inline int close(int sock) { return closesocket(sock); } inline http() { int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if(sock == INVALID_SOCKET && WSAGetLastError() == WSANOTINITIALISED) { WSADATA wsaData; if(WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) { WSACleanup(); return; } } else { close(sock); } } #endif }; } #endif sfc/controller/gamepad/gamepad.cpp000664 001750 001750 00000003070 12651764221 020346 0ustar00sergiosergio000000 000000 #ifdef CONTROLLER_CPP uint2 Gamepad::data() { if(counter >= 16) return 1; if(latched == 1) return interface->inputPoll(port, (unsigned)Input::Device::Joypad, (unsigned)Input::JoypadID::B); //note: D-pad physically prevents up+down and left+right from being pressed at the same time switch(counter++) { case 0: return b; case 1: return y; case 2: return select; case 3: return start; case 4: return up & !down; case 5: return down & !up; case 6: return left & !right; case 7: return right & !left; case 8: return a; case 9: return x; case 10: return l; case 11: return r; } return 0; //12-15: signature } void Gamepad::latch(bool data) { if(latched == data) return; latched = data; counter = 0; if(latched == 0) { unsigned id = (unsigned)Input::Device::Joypad; b = interface->inputPoll(port, id, 0); y = interface->inputPoll(port, id, 1); select = interface->inputPoll(port, id, 2); start = interface->inputPoll(port, id, 3); up = interface->inputPoll(port, id, 4); down = interface->inputPoll(port, id, 5); left = interface->inputPoll(port, id, 6); right = interface->inputPoll(port, id, 7); a = interface->inputPoll(port, id, 8); x = interface->inputPoll(port, id, 9); l = interface->inputPoll(port, id, 10); r = interface->inputPoll(port, id, 11); } } Gamepad::Gamepad(bool port) : Controller(port) { latched = 0; counter = 0; b = y = select = start = 0; up = down = left = right = 0; a = x = l = r = 0; } #endif gb/apu/square2/square2.cpp000664 001750 001750 00000004503 12651764221 016537 0ustar00sergiosergio000000 000000 #ifdef APU_CPP bool APU::Square2::dac_enable() { return (envelope_volume || envelope_direction); } void APU::Square2::run() { if(period && --period == 0) { period = 2 * (2048 - frequency); phase++; switch(duty) { case 0: duty_output = (phase == 6); break; //______-_ case 1: duty_output = (phase >= 6); break; //______-- case 2: duty_output = (phase >= 4); break; //____---- case 3: duty_output = (phase <= 5); break; //------__ } } uint4 sample = (duty_output ? volume : (uint4)0); if(enable == false) sample = 0; output = sample; } void APU::Square2::clock_length() { if(counter && enable) { if(++length == 0) enable = false; } } void APU::Square2::clock_envelope() { if(enable && envelope_frequency && --envelope_period == 0) { envelope_period = envelope_frequency; if(envelope_direction == 0 && volume > 0) volume--; if(envelope_direction == 1 && volume < 15) volume++; } } void APU::Square2::write(unsigned r, uint8 data) { if(r == 1) { //$ff16 NR21 duty = data >> 6; length = (data & 0x3f); } if(r == 2) { //$ff17 NR22 envelope_volume = data >> 4; envelope_direction = data & 0x08; envelope_frequency = data & 0x07; if(dac_enable() == false) enable = false; } if(r == 3) { //$ff18 NR23 frequency = (frequency & 0x0700) | data; } if(r == 4) { //$ff19 NR24 bool initialize = data & 0x80; counter = data & 0x40; frequency = ((data & 7) << 8) | (frequency & 0x00ff); if(initialize) { enable = dac_enable(); period = 2 * (2048 - frequency); envelope_period = envelope_frequency; volume = envelope_volume; } } } void APU::Square2::power() { enable = 0; duty = 0; length = 0; envelope_volume = 0; envelope_direction = 0; envelope_frequency = 0; frequency = 0; counter = 0; output = 0; duty_output = 0; phase = 0; period = 0; envelope_period = 0; volume = 0; } void APU::Square2::serialize(serializer& s) { s.integer(enable); s.integer(duty); s.integer(length); s.integer(envelope_volume); s.integer(envelope_direction); s.integer(envelope_frequency); s.integer(frequency); s.integer(counter); s.integer(output); s.integer(duty_output); s.integer(phase); s.integer(period); s.integer(envelope_period); s.integer(volume); } #endif nall/windows/launcher.hpp000664 001750 001750 00000006206 12651764221 016646 0ustar00sergiosergio000000 000000 #ifndef NALL_WINDOWS_LAUNCHER_HPP #define NALL_WINDOWS_LAUNCHER_HPP namespace nall { //launch a new process and inject specified DLL into it bool launch(const char* applicationName, const char* libraryName, uint32_t entryPoint) { //if a launcher does not send at least one message, a wait cursor will appear PostThreadMessage(GetCurrentThreadId(), WM_USER, 0, 0); MSG msg; GetMessage(&msg, 0, 0, 0); STARTUPINFOW si; PROCESS_INFORMATION pi; memset(&si, 0, sizeof(STARTUPINFOW)); BOOL result = CreateProcessW( utf16_t(applicationName), GetCommandLineW(), NULL, NULL, TRUE, DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS, //do not break if application creates its own processes NULL, NULL, &si, &pi ); if(result == false) return false; uint8_t entryData[1024], entryHook[1024] = { 0x68, 0x00, 0x00, 0x00, 0x00, //push libraryName 0xb8, 0x00, 0x00, 0x00, 0x00, //mov eax,LoadLibraryW 0xff, 0xd0, //call eax 0xcd, 0x03, //int 3 }; entryHook[1] = (uint8_t)((entryPoint + 14) >> 0); entryHook[2] = (uint8_t)((entryPoint + 14) >> 8); entryHook[3] = (uint8_t)((entryPoint + 14) >> 16); entryHook[4] = (uint8_t)((entryPoint + 14) >> 24); uint32_t pLoadLibraryW = (uint32_t)GetProcAddress(GetModuleHandleW(L"kernel32"), "LoadLibraryW"); entryHook[6] = pLoadLibraryW >> 0; entryHook[7] = pLoadLibraryW >> 8; entryHook[8] = pLoadLibraryW >> 16; entryHook[9] = pLoadLibraryW >> 24; utf16_t buffer = utf16_t(libraryName); memcpy(entryHook + 14, buffer, 2 * wcslen(buffer) + 2); while(true) { DEBUG_EVENT event; WaitForDebugEvent(&event, INFINITE); if(event.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT) break; if(event.dwDebugEventCode == EXCEPTION_DEBUG_EVENT) { if(event.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT) { if(event.u.Exception.ExceptionRecord.ExceptionAddress == (void*)(entryPoint + 14 - 1)) { HANDLE hProcess = OpenProcess(0, FALSE, event.dwProcessId); HANDLE hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, event.dwThreadId); CONTEXT context; context.ContextFlags = CONTEXT_FULL; GetThreadContext(hThread, &context); WriteProcessMemory(pi.hProcess, (void*)entryPoint, (void*)&entryData, sizeof entryData, NULL); context.Eip = entryPoint; SetThreadContext(hThread, &context); CloseHandle(hThread); CloseHandle(hProcess); } ContinueDebugEvent(event.dwProcessId, event.dwThreadId, DBG_CONTINUE); continue; } ContinueDebugEvent(event.dwProcessId, event.dwThreadId, DBG_EXCEPTION_NOT_HANDLED); continue; } if(event.dwDebugEventCode == CREATE_PROCESS_DEBUG_EVENT) { ReadProcessMemory(pi.hProcess, (void*)entryPoint, (void*)&entryData, sizeof entryData, NULL); WriteProcessMemory(pi.hProcess, (void*)entryPoint, (void*)&entryHook, sizeof entryHook, NULL); ContinueDebugEvent(event.dwProcessId, event.dwThreadId, DBG_CONTINUE); continue; } ContinueDebugEvent(event.dwProcessId, event.dwThreadId, DBG_CONTINUE); } return true; } } #endif processor/arm/arm.hpp000664 001750 001750 00000002445 12651764221 016003 0ustar00sergiosergio000000 000000 #ifndef PROCESSOR_ARM_HPP #define PROCESSOR_ARM_HPP namespace Processor { //ARMv3 //ARMv4TDMI struct ARM { enum : unsigned { Byte = 8, Half = 16, Word = 32 }; #include "registers.hpp" #include "instructions-arm.hpp" #include "instructions-thumb.hpp" #include "disassembler.hpp" virtual void step(unsigned clocks) = 0; virtual void bus_idle(uint32 addr) = 0; virtual uint32 bus_read(uint32 addr, uint32 size) = 0; virtual void bus_write(uint32 addr, uint32 size, uint32 word) = 0; void power(); void exec(); void idle(); uint32 read(uint32 addr, uint32 size); uint32 load(uint32 addr, uint32 size); void write(uint32 addr, uint32 size, uint32 word); void store(uint32 addr, uint32 size, uint32 word); void vector(uint32 addr, Processor::Mode mode); bool condition(uint4 condition); uint32 bit(uint32 result); uint32 add(uint32 source, uint32 modify, bool carry); uint32 sub(uint32 source, uint32 modify, bool carry); uint32 mul(uint32 product, uint32 multiplicand, uint32 multiplier); uint32 lsl(uint32 source, uint8 shift); uint32 lsr(uint32 source, uint8 shift); uint32 asr(uint32 source, uint8 shift); uint32 ror(uint32 source, uint8 shift); uint32 rrx(uint32 source); void serialize(serializer&); bool trace; uintmax_t instructions; }; } #endif gb/cartridge/cartridge.cpp000664 001750 001750 00000011710 12651764221 016714 0ustar00sergiosergio000000 000000 #include #define CARTRIDGE_CPP namespace GameBoy { #include "mbc0/mbc0.cpp" #include "mbc1/mbc1.cpp" #include "mbc2/mbc2.cpp" #include "mbc3/mbc3.cpp" #include "mbc5/mbc5.cpp" #include "mmm01/mmm01.cpp" #include "huc1/huc1.cpp" #include "huc3/huc3.cpp" #include "serialization.cpp" Cartridge cartridge; string Cartridge::title() { return information.title; } //intended for use with Super Game Boy for when no Game Boy cartridge is inserted void Cartridge::load_empty(System::Revision revision) { unload(); romsize = 32768; romdata = allocate(romsize, 0xff); ramsize = 0; mapper = &mbc0; sha256 = nall::sha256(romdata, romsize); loaded = true; system.load(revision); } void Cartridge::load(System::Revision revision) { unload(); system.revision = revision; //needed for ID::Manifest to return correct group ID if(revision != System::Revision::SuperGameBoy) { interface->loadRequest(ID::Manifest, "manifest.bml"); } information.mapper = Mapper::Unknown; information.ram = false; information.battery = false; information.rtc = false; information.rumble = false; information.romsize = 0; information.ramsize = 0; auto document = Markup::Document(information.markup); information.title = document["information/title"].text(); auto mapperid = document["cartridge/board/type"].text(); if(mapperid == "none" ) information.mapper = Mapper::MBC0; if(mapperid == "MBC1" ) information.mapper = Mapper::MBC1; if(mapperid == "MBC2" ) information.mapper = Mapper::MBC2; if(mapperid == "MBC3" ) information.mapper = Mapper::MBC3; if(mapperid == "MBC5" ) information.mapper = Mapper::MBC5; if(mapperid == "MMM01") information.mapper = Mapper::MMM01; if(mapperid == "HuC1" ) information.mapper = Mapper::HuC1; if(mapperid == "HuC3" ) information.mapper = Mapper::HuC3; information.rtc = false; information.rumble = false; auto rom = document["cartridge/rom"]; auto ram = document["cartridge/ram"]; romsize = numeral(rom["size"].data); romdata = allocate(romsize, 0xff); ramsize = numeral(ram["size"].data); ramdata = allocate(ramsize, 0xff); //Super Game Boy core loads memory from Super Famicom core if(revision != System::Revision::SuperGameBoy) { if(rom["name"].exists()) interface->loadRequest(ID::ROM, rom["name"].data); if(ram["name"].exists()) interface->loadRequest(ID::RAM, ram["name"].data); if(ram["name"].exists()) memory.append({ID::RAM, ram["name"].data}); } information.romsize = numeral(rom["size"].data); information.ramsize = numeral(ram["size"].data); information.battery = ram["name"].exists(); switch(information.mapper) { default: case Mapper::MBC0: mapper = &mbc0; break; case Mapper::MBC1: mapper = &mbc1; break; case Mapper::MBC2: mapper = &mbc2; break; case Mapper::MBC3: mapper = &mbc3; break; case Mapper::MBC5: mapper = &mbc5; break; case Mapper::MMM01: mapper = &mmm01; break; case Mapper::HuC1: mapper = &huc1; break; case Mapper::HuC3: mapper = &huc3; break; } sha256 = nall::sha256(romdata, romsize); loaded = true; system.load(revision); } void Cartridge::unload() { if(romdata) { delete[] romdata; romdata = nullptr; romsize = 0; } if(ramdata) { delete[] ramdata; ramdata = nullptr; ramsize = 0; } loaded = false; } uint8 Cartridge::rom_read(unsigned addr) { if(addr >= romsize) addr %= romsize; return romdata[addr]; } void Cartridge::rom_write(unsigned addr, uint8 data) { if(addr >= romsize) addr %= romsize; romdata[addr] = data; } uint8 Cartridge::ram_read(unsigned addr) { if(ramsize == 0) return 0x00; if(addr >= ramsize) addr %= ramsize; return ramdata[addr]; } void Cartridge::ram_write(unsigned addr, uint8 data) { if(ramsize == 0) return; if(addr >= ramsize) addr %= ramsize; ramdata[addr] = data; } uint8 Cartridge::mmio_read(uint16 addr) { if(addr == 0xff50) return 0x00; if(bootrom_enable) { const uint8* data = nullptr; switch(system.revision) { default: case System::Revision::GameBoy: data = system.bootROM.dmg; break; case System::Revision::SuperGameBoy: data = system.bootROM.sgb; break; case System::Revision::GameBoyColor: data = system.bootROM.cgb; break; } if(addr >= 0x0000 && addr <= 0x00ff) return data[addr]; if(addr >= 0x0200 && addr <= 0x08ff && system.cgb()) return data[addr - 256]; } return mapper->mmio_read(addr); } void Cartridge::mmio_write(uint16 addr, uint8 data) { if(bootrom_enable && addr == 0xff50) { bootrom_enable = false; return; } mapper->mmio_write(addr, data); } void Cartridge::power() { bootrom_enable = true; mbc0.power(); mbc1.power(); mbc2.power(); mbc3.power(); mbc5.power(); mmm01.power(); huc1.power(); huc3.power(); for(unsigned n = 0x0000; n <= 0x7fff; n++) bus.mmio[n] = this; for(unsigned n = 0xa000; n <= 0xbfff; n++) bus.mmio[n] = this; bus.mmio[0xff50] = this; } Cartridge::Cartridge() { loaded = false; sha256 = ""; } Cartridge::~Cartridge() { unload(); } } gb/cpu/000700 001750 001750 00000000000 12656700342 013052 5ustar00sergiosergio000000 000000 fc/cpu/cpu.hpp000664 001750 001750 00000002064 12651764221 014371 0ustar00sergiosergio000000 000000 struct CPU : Processor::R6502, Thread { uint8 ram[0x0800]; struct Status { bool interrupt_pending; bool nmi_pending; bool nmi_line; bool irq_line; bool irq_apu_line; bool rdy_line; bool rdy_addr_valid; uint16 rdy_addr_value; bool oam_dma_pending; uint8 oam_dma_page; bool controller_latch; unsigned controller_port0; unsigned controller_port1; } status; static void Enter(); void main(); void add_clocks(unsigned clocks); void power(); void reset(); uint8 debugger_read(uint16 addr); uint8 ram_read(uint16 addr); void ram_write(uint16 addr, uint8 data); uint8 read(uint16 addr); void write(uint16 addr, uint8 data); void serialize(serializer&); //timing.cpp uint8 op_read(uint16 addr); void op_write(uint16 addr, uint8 data); void last_cycle(); void nmi(uint16 &vector); void oam_dma(); void set_nmi_line(bool); void set_irq_line(bool); void set_irq_apu_line(bool); void set_rdy_line(bool); void set_rdy_addr(bool valid, uint16 value = 0); }; extern CPU cpu; sfc/chip/sgb-external/serialization.cpp000664 001750 001750 00000000120 12651764221 021353 0ustar00sergiosergio000000 000000 #ifdef SGBEXTERNAL_CPP void SGBExternal::serialize(serializer& s) { } #endif sfc/alt/ppu-balanced/mmio/mmio.hpp000664 001750 001750 00000011513 12651764221 020212 0ustar00sergiosergio000000 000000 struct { //open bus support uint8 ppu1_mdr, ppu2_mdr; //bg line counters uint16 bg_y[4]; //internal state uint16 ioamaddr; uint16 icgramaddr; //$2100 bool display_disabled; uint8 display_brightness; //$2101 uint8 oam_basesize; uint8 oam_nameselect; uint16 oam_tdaddr; //$2102-$2103 uint16 oam_baseaddr; uint16 oam_addr; bool oam_priority; uint8 oam_firstsprite; //$2104 uint8 oam_latchdata; //$2105 bool bg_tilesize[4]; bool bg3_priority; uint8 bg_mode; //$2106 uint8 mosaic_size; bool mosaic_enabled[4]; uint16 mosaic_countdown; //$2107-$210a uint16 bg_scaddr[4]; uint8 bg_scsize[4]; //$210b-$210c uint16 bg_tdaddr[4]; //$210d-$2114 uint8 bg_ofslatch; uint16 m7_hofs, m7_vofs; uint16 bg_hofs[4]; uint16 bg_vofs[4]; //$2115 bool vram_incmode; uint8 vram_mapping; uint8 vram_incsize; //$2116-$2117 uint16 vram_addr; //$211a uint8 mode7_repeat; bool mode7_vflip; bool mode7_hflip; //$211b-$2120 uint8 m7_latch; uint16 m7a, m7b, m7c, m7d, m7x, m7y; //$2121 uint16 cgram_addr; //$2122 uint8 cgram_latchdata; //$2123-$2125 bool window1_enabled[6]; bool window1_invert [6]; bool window2_enabled[6]; bool window2_invert [6]; //$2126-$2129 uint8 window1_left, window1_right; uint8 window2_left, window2_right; //$212a-$212b uint8 window_mask[6]; //$212c-$212d bool bg_enabled[5], bgsub_enabled[5]; //$212e-$212f bool window_enabled[5], sub_window_enabled[5]; //$2130 uint8 color_mask, colorsub_mask; bool addsub_mode; bool direct_color; //$2131 bool color_mode, color_halve; bool color_enabled[6]; //$2132 uint8 color_r, color_g, color_b; uint16 color_rgb; //$2133 //overscan and interlace are checked once per frame to //determine if entire frame should be interlaced/non-interlace //and overscan adjusted. therefore, the variables act sort of //like a buffer, but they do still affect internal rendering bool mode7_extbg; bool pseudo_hires; bool overscan; uint16 scanlines; bool oam_interlace; bool interlace; //$2137 uint16 hcounter, vcounter; bool latch_hcounter, latch_vcounter; bool counters_latched; //$2139-$213a uint16 vram_readbuffer; //$213e bool time_over, range_over; uint16 oam_itemcount, oam_tilecount; } regs; void mmio_w2100(uint8 value); //INIDISP void mmio_w2101(uint8 value); //OBSEL void mmio_w2102(uint8 value); //OAMADDL void mmio_w2103(uint8 value); //OAMADDH void mmio_w2104(uint8 value); //OAMDATA void mmio_w2105(uint8 value); //BGMODE void mmio_w2106(uint8 value); //MOSAIC void mmio_w2107(uint8 value); //BG1SC void mmio_w2108(uint8 value); //BG2SC void mmio_w2109(uint8 value); //BG3SC void mmio_w210a(uint8 value); //BG4SC void mmio_w210b(uint8 value); //BG12NBA void mmio_w210c(uint8 value); //BG34NBA void mmio_w210d(uint8 value); //BG1HOFS void mmio_w210e(uint8 value); //BG1VOFS void mmio_w210f(uint8 value); //BG2HOFS void mmio_w2110(uint8 value); //BG2VOFS void mmio_w2111(uint8 value); //BG3HOFS void mmio_w2112(uint8 value); //BG3VOFS void mmio_w2113(uint8 value); //BG4HOFS void mmio_w2114(uint8 value); //BG4VOFS void mmio_w2115(uint8 value); //VMAIN void mmio_w2116(uint8 value); //VMADDL void mmio_w2117(uint8 value); //VMADDH void mmio_w2118(uint8 value); //VMDATAL void mmio_w2119(uint8 value); //VMDATAH void mmio_w211a(uint8 value); //M7SEL void mmio_w211b(uint8 value); //M7A void mmio_w211c(uint8 value); //M7B void mmio_w211d(uint8 value); //M7C void mmio_w211e(uint8 value); //M7D void mmio_w211f(uint8 value); //M7X void mmio_w2120(uint8 value); //M7Y void mmio_w2121(uint8 value); //CGADD void mmio_w2122(uint8 value); //CGDATA void mmio_w2123(uint8 value); //W12SEL void mmio_w2124(uint8 value); //W34SEL void mmio_w2125(uint8 value); //WOBJSEL void mmio_w2126(uint8 value); //WH0 void mmio_w2127(uint8 value); //WH1 void mmio_w2128(uint8 value); //WH2 void mmio_w2129(uint8 value); //WH3 void mmio_w212a(uint8 value); //WBGLOG void mmio_w212b(uint8 value); //WOBJLOG void mmio_w212c(uint8 value); //TM void mmio_w212d(uint8 value); //TS void mmio_w212e(uint8 value); //TMW void mmio_w212f(uint8 value); //TSW void mmio_w2130(uint8 value); //CGWSEL void mmio_w2131(uint8 value); //CGADDSUB void mmio_w2132(uint8 value); //COLDATA void mmio_w2133(uint8 value); //SETINI uint8 mmio_r2134(); //MPYL uint8 mmio_r2135(); //MPYM uint8 mmio_r2136(); //MPYH uint8 mmio_r2137(); //SLHV uint8 mmio_r2138(); //OAMDATAREAD uint8 mmio_r2139(); //VMDATALREAD uint8 mmio_r213a(); //VMDATAHREAD uint8 mmio_r213b(); //CGDATAREAD uint8 mmio_r213c(); //OPHCT uint8 mmio_r213d(); //OPVCT uint8 mmio_r213e(); //STAT77 uint8 mmio_r213f(); //STAT78 uint8 mmio_read(unsigned addr); void mmio_write(unsigned addr, uint8 data); void latch_counters(); phoenix/cocoa/timer.hpp000664 001750 001750 00000000754 12651764221 016305 0ustar00sergiosergio000000 000000 @interface CocoaTimer : NSObject { @public phoenix::Timer* timer; NSTimer* instance; } -(id) initWith:(phoenix::Timer&)timer; -(NSTimer*) instance; -(void) update; -(void) run:(NSTimer*)instance; @end namespace phoenix { struct pTimer : public pObject { Timer& timer; CocoaTimer* cocoaTimer = nullptr; void setEnabled(bool enabled); void setInterval(unsigned interval); pTimer(Timer& timer) : pObject(timer), timer(timer) {} void constructor(); void destructor(); }; } processor/upd96050/instructions.cpp000664 001750 001750 00000016553 12651764221 020405 0ustar00sergiosergio000000 000000 void uPD96050::exec() { uint24 opcode = programROM[regs.pc++]; switch(opcode >> 22) { case 0: exec_op(opcode); break; case 1: exec_rt(opcode); break; case 2: exec_jp(opcode); break; case 3: exec_ld(opcode); break; } int32 result = (int32)regs.k * regs.l; //sign + 30-bit result regs.m = result >> 15; //store sign + top 15-bits regs.n = result << 1; //store low 15-bits + zero } void uPD96050::exec_op(uint24 opcode) { uint2 pselect = opcode >> 20; //P select uint4 alu = opcode >> 16; //ALU operation mode uint1 asl = opcode >> 15; //accumulator select uint2 dpl = opcode >> 13; //DP low modify uint4 dphm = opcode >> 9; //DP high XOR modify uint1 rpdcr = opcode >> 8; //RP decrement uint4 src = opcode >> 4; //move source uint4 dst = opcode >> 0; //move destination uint16 idb; switch(src) { case 0: idb = regs.trb; break; case 1: idb = regs.a; break; case 2: idb = regs.b; break; case 3: idb = regs.tr; break; case 4: idb = regs.dp; break; case 5: idb = regs.rp; break; case 6: idb = dataROM[regs.rp]; break; case 7: idb = 0x8000 - regs.flaga.s1; break; case 8: idb = regs.dr; regs.sr.rqm = 1; break; case 9: idb = regs.dr; break; case 10: idb = regs.sr; break; case 11: idb = regs.si; break; //MSB case 12: idb = regs.si; break; //LSB case 13: idb = regs.k; break; case 14: idb = regs.l; break; case 15: idb = dataRAM[regs.dp]; break; } if(alu) { uint16 p, q, r; Flag flag; bool c; switch(pselect) { case 0: p = dataRAM[regs.dp]; break; case 1: p = idb; break; case 2: p = regs.m; break; case 3: p = regs.n; break; } switch(asl) { case 0: q = regs.a; flag = regs.flaga; c = regs.flagb.c; break; case 1: q = regs.b; flag = regs.flagb; c = regs.flaga.c; break; } switch(alu) { case 1: r = q | p; break; //OR case 2: r = q & p; break; //AND case 3: r = q ^ p; break; //XOR case 4: r = q - p; break; //SUB case 5: r = q + p; break; //ADD case 6: r = q - p - c; break; //SBB case 7: r = q + p + c; break; //ADC case 8: r = q - 1; p = 1; break; //DEC case 9: r = q + 1; p = 1; break; //INC case 10: r = ~q; break; //CMP case 11: r = (q >> 1) | (q & 0x8000); break; //SHR1 (ASR) case 12: r = (q << 1) | c; break; //SHL1 (ROL) case 13: r = (q << 2) | 3; break; //SHL2 case 14: r = (q << 4) | 15; break; //SHL4 case 15: r = (q << 8) | (q >> 8); break; //XCHG } flag.s0 = (r & 0x8000); flag.z = (r == 0); switch(alu) { case 1: case 2: case 3: case 10: case 13: case 14: case 15: { flag.c = 0; flag.ov0 = 0; flag.ov1 = 0; break; } case 4: case 5: case 6: case 7: case 8: case 9: { if(alu & 1) { //addition flag.ov0 = (q ^ r) & ~(q ^ p) & 0x8000; flag.c = (r < q); } else { //subtraction flag.ov0 = (q ^ r) & (q ^ p) & 0x8000; flag.c = (r > q); } if(flag.ov0) { flag.s1 = flag.ov1 ^ !(r & 0x8000); flag.ov1 = !flag.ov1; } break; } case 11: { flag.c = q & 1; flag.ov0 = 0; flag.ov1 = 0; break; } case 12: { flag.c = q >> 15; flag.ov0 = 0; flag.ov1 = 0; break; } } switch(asl) { case 0: regs.a = r; regs.flaga = flag; break; case 1: regs.b = r; regs.flagb = flag; break; } } exec_ld((idb << 6) + dst); switch(dpl) { case 1: regs.dp = (regs.dp & 0xf0) + ((regs.dp + 1) & 0x0f); break; //DPINC case 2: regs.dp = (regs.dp & 0xf0) + ((regs.dp - 1) & 0x0f); break; //DPDEC case 3: regs.dp = (regs.dp & 0xf0); break; //DPCLR } regs.dp ^= dphm << 4; if(rpdcr) regs.rp--; } void uPD96050::exec_rt(uint24 opcode) { exec_op(opcode); regs.pc = regs.stack[--regs.sp]; } void uPD96050::exec_jp(uint24 opcode) { uint9 brch = opcode >> 13; //branch uint11 na = opcode >> 2; //next address uint2 bank = opcode >> 0; //bank address uint14 jp = (regs.pc & 0x2000) | (bank << 11) | (na << 0); switch(brch) { case 0x000: regs.pc = regs.so; return; //JMPSO case 0x080: if(regs.flaga.c == 0) regs.pc = jp; return; //JNCA case 0x082: if(regs.flaga.c == 1) regs.pc = jp; return; //JCA case 0x084: if(regs.flagb.c == 0) regs.pc = jp; return; //JNCB case 0x086: if(regs.flagb.c == 1) regs.pc = jp; return; //JCB case 0x088: if(regs.flaga.z == 0) regs.pc = jp; return; //JNZA case 0x08a: if(regs.flaga.z == 1) regs.pc = jp; return; //JZA case 0x08c: if(regs.flagb.z == 0) regs.pc = jp; return; //JNZB case 0x08e: if(regs.flagb.z == 1) regs.pc = jp; return; //JZB case 0x090: if(regs.flaga.ov0 == 0) regs.pc = jp; return; //JNOVA0 case 0x092: if(regs.flaga.ov0 == 1) regs.pc = jp; return; //JOVA0 case 0x094: if(regs.flagb.ov0 == 0) regs.pc = jp; return; //JNOVB0 case 0x096: if(regs.flagb.ov0 == 1) regs.pc = jp; return; //JOVB0 case 0x098: if(regs.flaga.ov1 == 0) regs.pc = jp; return; //JNOVA1 case 0x09a: if(regs.flaga.ov1 == 1) regs.pc = jp; return; //JOVA1 case 0x09c: if(regs.flagb.ov1 == 0) regs.pc = jp; return; //JNOVB1 case 0x09e: if(regs.flagb.ov1 == 1) regs.pc = jp; return; //JOVB1 case 0x0a0: if(regs.flaga.s0 == 0) regs.pc = jp; return; //JNSA0 case 0x0a2: if(regs.flaga.s0 == 1) regs.pc = jp; return; //JSA0 case 0x0a4: if(regs.flagb.s0 == 0) regs.pc = jp; return; //JNSB0 case 0x0a6: if(regs.flagb.s0 == 1) regs.pc = jp; return; //JSB0 case 0x0a8: if(regs.flaga.s1 == 0) regs.pc = jp; return; //JNSA1 case 0x0aa: if(regs.flaga.s1 == 1) regs.pc = jp; return; //JSA1 case 0x0ac: if(regs.flagb.s1 == 0) regs.pc = jp; return; //JNSB1 case 0x0ae: if(regs.flagb.s1 == 1) regs.pc = jp; return; //JSB1 case 0x0b0: if((regs.dp & 0x0f) == 0x00) regs.pc = jp; return; //JDPL0 case 0x0b1: if((regs.dp & 0x0f) != 0x00) regs.pc = jp; return; //JDPLN0 case 0x0b2: if((regs.dp & 0x0f) == 0x0f) regs.pc = jp; return; //JDPLF case 0x0b3: if((regs.dp & 0x0f) != 0x0f) regs.pc = jp; return; //JDPLNF case 0x0bc: if(regs.sr.rqm == 0) regs.pc = jp; return; //JNRQM case 0x0be: if(regs.sr.rqm == 1) regs.pc = jp; return; //JRQM case 0x100: regs.pc = jp & ~0x2000; return; //LJMP case 0x101: regs.pc = jp | 0x2000; return; //HJMP case 0x140: regs.stack[regs.sp++] = regs.pc; regs.pc = jp & ~0x2000; return; //LCALL case 0x141: regs.stack[regs.sp++] = regs.pc; regs.pc = jp | 0x2000; return; //HCALL } } void uPD96050::exec_ld(uint24 opcode) { uint16 id = opcode >> 6; //immediate data uint4 dst = opcode >> 0; //destination switch(dst) { case 0: break; case 1: regs.a = id; break; case 2: regs.b = id; break; case 3: regs.tr = id; break; case 4: regs.dp = id; break; case 5: regs.rp = id; break; case 6: regs.dr = id; regs.sr.rqm = 1; break; case 7: regs.sr = (regs.sr & 0x907c) | (id & ~0x907c); break; case 8: regs.so = id; break; //LSB case 9: regs.so = id; break; //MSB case 10: regs.k = id; break; case 11: regs.k = id; regs.l = dataROM[regs.rp]; break; case 12: regs.l = id; regs.k = dataRAM[regs.dp | 0x40]; break; case 13: regs.l = id; break; case 14: regs.trb = id; break; case 15: dataRAM[regs.dp] = id; break; } } phoenix/gtk/widget/check-button.cpp000664 001750 001750 00000004033 12651764221 020524 0ustar00sergiosergio000000 000000 namespace phoenix { static void CheckButton_toggle(GtkToggleButton* toggleButton, CheckButton* self) { self->p.onToggle(); } Size pCheckButton::minimumSize() { Size size = pFont::size(widget.state.font, checkButton.state.text); if(checkButton.state.orientation == Orientation::Horizontal) { size.width += checkButton.state.image.width; size.height = max(checkButton.state.image.height, size.height); } if(checkButton.state.orientation == Orientation::Vertical) { size.width = max(checkButton.state.image.width, size.width); size.height += checkButton.state.image.height; } return {size.width + 24, size.height + 12}; } void pCheckButton::setChecked(bool checked) { locked = true; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtkWidget), checked); locked = false; } void pCheckButton::setImage(const image& image, Orientation orientation) { if(image.empty() == false) { GtkImage* gtkImage = CreateImage(image); gtk_button_set_image(GTK_BUTTON(gtkWidget), (GtkWidget*)gtkImage); } else { gtk_button_set_image(GTK_BUTTON(gtkWidget), nullptr); } switch(orientation) { case Orientation::Horizontal: gtk_button_set_image_position(GTK_BUTTON(gtkWidget), GTK_POS_LEFT); break; case Orientation::Vertical: gtk_button_set_image_position(GTK_BUTTON(gtkWidget), GTK_POS_TOP); break; } } void pCheckButton::setText(string text) { gtk_button_set_label(GTK_BUTTON(gtkWidget), text); setFont(widget.state.font); } void pCheckButton::constructor() { gtkWidget = gtk_toggle_button_new(); g_signal_connect(G_OBJECT(gtkWidget), "toggled", G_CALLBACK(CheckButton_toggle), (gpointer)&checkButton); setChecked(checkButton.state.checked); setText(checkButton.state.text); } void pCheckButton::destructor() { gtk_widget_destroy(gtkWidget); } void pCheckButton::orphan() { destructor(); constructor(); } void pCheckButton::onToggle() { if(locked) return; checkButton.state.checked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gtkWidget)); if(checkButton.onToggle) checkButton.onToggle(); } } nall/stdint.hpp000664 001750 001750 00000002362 12651764221 014657 0ustar00sergiosergio000000 000000 #ifndef NALL_STDINT_HPP #define NALL_STDINT_HPP #if defined(_MSC_VER) typedef signed char int8_t; typedef signed short int16_t; typedef signed int int32_t; typedef signed long long int64_t; typedef int64_t intmax_t; #if defined(_WIN64) typedef int64_t intptr_t; #else typedef int32_t intptr_t; #endif typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; typedef unsigned long long uint64_t; typedef uint64_t uintmax_t; #if defined(_WIN64) typedef uint64_t uintptr_t; #else typedef uint32_t uintptr_t; #endif #else #include #endif namespace nall { static_assert(sizeof(int8_t) == 1, "int8_t is not of the correct size" ); static_assert(sizeof(int16_t) == 2, "int16_t is not of the correct size"); static_assert(sizeof(int32_t) == 4, "int32_t is not of the correct size"); static_assert(sizeof(int64_t) == 8, "int64_t is not of the correct size"); static_assert(sizeof(uint8_t) == 1, "int8_t is not of the correct size" ); static_assert(sizeof(uint16_t) == 2, "int16_t is not of the correct size"); static_assert(sizeof(uint32_t) == 4, "int32_t is not of the correct size"); static_assert(sizeof(uint64_t) == 8, "int64_t is not of the correct size"); } #endif phoenix/reference/widget/check-button.hpp000664 001750 001750 00000000544 12651764221 021705 0ustar00sergiosergio000000 000000 namespace phoenix { struct pCheckButton : public pWidget { CheckButton& checkButton; void setChecked(bool checked); void setImage(const image& image, Orientation orientation); void setText(string text); pCheckButton(CheckButton& checkButton) : pWidget(checkButton), checkButton(checkButton) {} void constructor(); void destructor(); }; } nall/platform.hpp000664 001750 001750 00000005253 12651764221 015200 0ustar00sergiosergio000000 000000 #ifndef NALL_PLATFORM_HPP #define NALL_PLATFORM_HPP namespace Math { static const long double e = 2.71828182845904523536; static const long double Pi = 3.14159265358979323846; } #if defined(_WIN32) //minimum version needed for _wstat64, etc #undef __MSVCRT_VERSION__ #define __MSVCRT_VERSION__ 0x0601 #include #endif //========================= //standard platform headers //========================= #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(_WIN32) #include #include #include #include #undef interface #define dllexport __declspec(dllexport) #else #ifdef __APPLE__ #include #else #include #endif #include #include #define dllexport #endif //========== //Visual C++ //========== #if defined(_MSC_VER) #pragma warning(disable:4996) //disable libc "deprecation" warnings #define va_copy(dest, src) ((dest) = (src)) #endif #if defined(_WIN32) __declspec(dllimport) int _fileno(FILE*); inline int access(const char* path, int amode) { return _waccess(nall::utf16_t(path), amode); } inline int fileno(FILE* stream) { return _fileno(stream); } inline char* getcwd(char* buf, size_t size) { wchar_t wpath[PATH_MAX] = L""; if(!_wgetcwd(wpath, size)) return nullptr; strcpy(buf, nall::utf8_t(wpath)); return buf; } inline int putenv(char* string) { return _wputenv(nall::utf16_t(string)); } inline char* realpath(const char* file_name, char* resolved_name) { wchar_t wfile_name[PATH_MAX] = L""; if(!_wfullpath(wfile_name, nall::utf16_t(file_name), PATH_MAX)) return nullptr; strcpy(resolved_name, nall::utf8_t(wfile_name)); return resolved_name; } inline int rename(const char* oldname, const char* newname) { return _wrename(nall::utf16_t(oldname), nall::utf16_t(newname)); } inline void usleep(unsigned milliseconds) { Sleep(milliseconds / 1000); } #endif //================ //inline expansion //================ #if defined(__clang__) || defined(__GNUC__) #define noinline __attribute__((noinline)) #define alwaysinline inline __attribute__((always_inline)) #elif defined(_MSC_VER) #define noinline __declspec(noinline) #define alwaysinline inline __forceinline #else #define noinline #define alwaysinline inline #endif //=========== //unreachable //=========== #if defined(__clang__) || defined(__GNUC__) #define unreachable __builtin_unreachable() #else #define unreachable throw #endif #endif phoenix/reference/browser-window.cpp000664 001750 001750 00000000375 12651764221 021021 0ustar00sergiosergio000000 000000 namespace phoenix { string pBrowserWindow::directory(BrowserWindow::State& state) { return ""; } string pBrowserWindow::open(BrowserWindow::State& state) { return ""; } string pBrowserWindow::save(BrowserWindow::State& state) { return ""; } } nall/dsp/resample/linear.hpp000664 001750 001750 00000001442 12651764221 017220 0ustar00sergiosergio000000 000000 #ifdef NALL_DSP_INTERNAL_HPP struct ResampleLinear : Resampler { inline void setFrequency(); inline void clear(); inline void sample(); ResampleLinear(DSP& dsp) : Resampler(dsp) {} real fraction; real step; }; void ResampleLinear::setFrequency() { fraction = 0.0; step = dsp.settings.frequency / frequency; } void ResampleLinear::clear() { fraction = 0.0; } void ResampleLinear::sample() { while(fraction <= 1.0) { real channel[dsp.settings.channels]; for(unsigned n = 0; n < dsp.settings.channels; n++) { real a = dsp.buffer.read(n, -1); real b = dsp.buffer.read(n, -0); real mu = fraction; channel[n] = a * (1.0 - mu) + b * mu; } dsp.write(channel); fraction += step; } dsp.buffer.rdoffset++; fraction -= 1.0; } #endif nall/xorg/000700 001750 001750 00000000000 12656700342 013600 5ustar00sergiosergio000000 000000 sfc/chip/nss/000700 001750 001750 00000000000 12656700342 014174 5ustar00sergiosergio000000 000000 target-ethos/resource/000700 001750 001750 00000000000 12656700342 016130 5ustar00sergiosergio000000 000000 processor/r6502/disassembler.cpp000664 001750 001750 00000012705 12651764221 017673 0ustar00sergiosergio000000 000000 string R6502::disassemble() { string output = { hex<4>(regs.pc), " " }; auto abs = [&]() -> string { return { "$", hex<2>(debugger_read(regs.pc + 2)), hex<2>(debugger_read(regs.pc + 1)) }; }; auto abx = [&]() -> string { return { "$", hex<2>(debugger_read(regs.pc + 2)), hex<2>(debugger_read(regs.pc + 1)), ",x" }; }; auto aby = [&]() -> string { return { "$", hex<2>(debugger_read(regs.pc + 2)), hex<2>(debugger_read(regs.pc + 1)), ",y" }; }; auto iab = [&]() -> string { return { "($", hex<2>(debugger_read(regs.pc + 2)), hex<2>(debugger_read(regs.pc + 1)), ")" }; }; auto imm = [&]() -> string { return { "#$", hex<2>(debugger_read(regs.pc + 1)) }; }; auto imp = [&]() -> string { return ""; }; auto izx = [&]() -> string { return { "($", hex<2>(debugger_read(regs.pc + 1)), ",x)" }; }; auto izy = [&]() -> string { return { "($", hex<2>(debugger_read(regs.pc + 1)), "),y" }; }; auto rel = [&]() -> string { return { "$", hex<4>((regs.pc + 2) + (int8)debugger_read(regs.pc + 1)) }; }; auto zpg = [&]() -> string { return { "$", hex<2>(debugger_read(regs.pc + 1)) }; }; auto zpx = [&]() -> string { return { "$", hex<2>(debugger_read(regs.pc + 1)), ",x" }; }; auto zpy = [&]() -> string { return { "$", hex<2>(debugger_read(regs.pc + 1)), ",y" }; }; #define op(byte, prefix, mode) \ case byte: output.append(#prefix, " ", mode()); \ break uint8 opcode = debugger_read(regs.pc); switch(opcode) { op(0x00, brk, imm); op(0x01, ora, izx); op(0x05, ora, zpg); op(0x06, asl, zpg); op(0x08, php, imp); op(0x09, ora, imm); op(0x0a, asl, imp); op(0x0d, ora, abs); op(0x0e, asl, abs); op(0x10, bpl, rel); op(0x11, ora, izy); op(0x15, ora, zpx); op(0x16, asl, zpx); op(0x18, clc, imp); op(0x19, ora, aby); op(0x1d, ora, abx); op(0x1e, asl, abx); op(0x20, jsr, abs); op(0x21, and, izx); op(0x24, bit, zpg); op(0x25, and, zpg); op(0x26, rol, zpg); op(0x28, plp, imp); op(0x29, and, imm); op(0x2a, rol, imp); op(0x2c, bit, abs); op(0x2d, and, abs); op(0x2e, rol, abs); op(0x30, bmi, rel); op(0x31, and, izy); op(0x35, and, zpx); op(0x36, rol, zpx); op(0x38, sec, imp); op(0x39, and, aby); op(0x3d, and, abx); op(0x3e, rol, abx); op(0x40, rti, imp); op(0x41, eor, izx); op(0x45, eor, zpg); op(0x46, lsr, zpg); op(0x48, pha, imp); op(0x49, eor, imm); op(0x4a, lsr, imp); op(0x4c, jmp, abs); op(0x4d, eor, abs); op(0x4e, lsr, abs); op(0x50, bvc, rel); op(0x51, eor, izy); op(0x55, eor, zpx); op(0x56, lsr, zpx); op(0x58, cli, imp); op(0x59, eor, aby); op(0x5a, phy, imp); op(0x5d, eor, abx); op(0x5e, lsr, abx); op(0x60, rts, imp); op(0x61, adc, izx); op(0x65, adc, zpg); op(0x66, ror, zpg); op(0x68, pla, imp); op(0x69, adc, imm); op(0x6a, ror, imp); op(0x6c, jmp, iab); op(0x6d, adc, abs); op(0x6e, ror, abs); op(0x70, bvs, rel); op(0x71, adc, izy); op(0x75, adc, zpx); op(0x76, ror, zpx); op(0x78, sei, imp); op(0x79, adc, aby); op(0x7a, ply, imp); op(0x7d, adc, abx); op(0x7e, ror, abx); op(0x81, sta, izx); op(0x84, sty, zpg); op(0x85, sta, zpg); op(0x86, stx, zpg); op(0x88, dey, imp); op(0x8a, txa, imp); op(0x8c, sty, abs); op(0x8d, sta, abs); op(0x8e, stx, abs); op(0x90, bcc, rel); op(0x91, sta, izy); op(0x94, sty, zpx); op(0x95, sta, zpx); op(0x96, stx, zpy); op(0x98, tya, imp); op(0x99, sta, aby); op(0x9a, txs, imp); op(0x9d, sta, abx); op(0xa0, ldy, imm); op(0xa1, lda, izx); op(0xa2, ldx, imm); op(0xa4, ldy, zpg); op(0xa5, lda, zpg); op(0xa6, ldx, zpg); op(0xa8, tay, imp); op(0xa9, lda, imm); op(0xaa, tax, imp); op(0xac, ldy, abs); op(0xad, lda, abs); op(0xae, ldx, abs); op(0xb0, bcs, rel); op(0xb1, lda, izy); op(0xb4, ldy, zpx); op(0xb5, lda, zpx); op(0xb6, ldx, zpy); op(0xb8, clv, imp); op(0xb9, lda, aby); op(0xba, tsx, imp); op(0xbc, ldy, abx); op(0xbd, lda, abx); op(0xbe, ldx, aby); op(0xc0, cpy, imm); op(0xc1, cmp, izx); op(0xc4, cpy, zpg); op(0xc5, cmp, zpg); op(0xc6, dec, zpg); op(0xc8, iny, imp); op(0xc9, cmp, imm); op(0xca, dex, imp); op(0xcc, cpy, abs); op(0xcd, cmp, abs); op(0xce, dec, abs); op(0xd0, bne, rel); op(0xd1, cmp, izy); op(0xd5, cmp, zpx); op(0xd6, dec, zpx); op(0xd8, cld, imp); op(0xd9, cmp, aby); op(0xda, phx, imp); op(0xdd, cmp, abx); op(0xde, dec, abx); op(0xe0, cpx, imm); op(0xe1, sbc, izx); op(0xe4, cpx, zpg); op(0xe5, sbc, zpg); op(0xe6, inc, zpg); op(0xe8, inx, imp); op(0xe9, sbc, imm); op(0xea, nop, imp); op(0xec, cpx, abs); op(0xed, sbc, abs); op(0xee, inc, abs); op(0xf0, beq, rel); op(0xf1, sbc, izy); op(0xf5, sbc, zpx); op(0xf6, inc, zpx); op(0xf8, sed, imp); op(0xf9, sbc, aby); op(0xfa, plx, imp); op(0xfd, sbc, abx); op(0xfe, inc, abx); default: output.append("$", hex<2>(opcode)); break; } #undef op output.append(" "); output[20] = 0; output.append( "A:", hex<2>(regs.a), " X:", hex<2>(regs.x), " Y:", hex<2>(regs.y), " S:", hex<2>(regs.s), " ", regs.p.n ? "N" : "n", regs.p.v ? "V" : "v", regs.p.d ? "D" : "d", regs.p.i ? "I" : "i", regs.p.z ? "Z" : "z", regs.p.c ? "C" : "c" ); return output; } processor/lr35902/000700 001750 001750 00000000000 12656700342 014732 5ustar00sergiosergio000000 000000 sfc/cpu/cpu.cpp000664 001750 001750 00000010331 12651764221 014543 0ustar00sergiosergio000000 000000 #include #define CPU_CPP namespace SuperFamicom { CPU cpu; #include "serialization.cpp" #include "dma/dma.cpp" #include "memory/memory.cpp" #include "mmio/mmio.cpp" #include "timing/timing.cpp" void CPU::step(unsigned clocks) { smp.clock -= clocks * (uint64)smp.frequency; ppu.clock -= clocks; for(unsigned i = 0; i < coprocessors.size(); i++) { auto& chip = *coprocessors[i]; chip.clock -= clocks * (uint64)chip.frequency; } input.port1->clock -= clocks * (uint64)input.port1->frequency; input.port2->clock -= clocks * (uint64)input.port2->frequency; synchronize_controllers(); } void CPU::synchronize_smp() { if(SMP::Threaded == true) { if(smp.clock < 0) co_switch(smp.thread); } else { while(smp.clock < 0) smp.enter(); } } void CPU::synchronize_ppu() { if(PPU::Threaded == true) { if(ppu.clock < 0) co_switch(ppu.thread); } else { while(ppu.clock < 0) ppu.enter(); } } void CPU::synchronize_coprocessors() { for(unsigned i = 0; i < coprocessors.size(); i++) { auto& chip = *coprocessors[i]; if(chip.clock < 0) co_switch(chip.thread); } } void CPU::synchronize_controllers() { if(input.port1->clock < 0) co_switch(input.port1->thread); if(input.port2->clock < 0) co_switch(input.port2->thread); } void CPU::Enter() { cpu.enter(); } void CPU::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::CPU) { scheduler.sync = Scheduler::SynchronizeMode::All; scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(status.interrupt_pending) { status.interrupt_pending = false; if(status.nmi_pending) { status.nmi_pending = false; regs.vector = (regs.e == false ? 0xffea : 0xfffa); op_irq(); debugger.op_nmi(); } else if(status.irq_pending) { status.irq_pending = false; regs.vector = (regs.e == false ? 0xffee : 0xfffe); op_irq(); debugger.op_irq(); } else if(status.reset_pending) { status.reset_pending = false; add_clocks(186); regs.pc.l = bus.read(0xfffc); regs.pc.h = bus.read(0xfffd); } } op_step(); } } void CPU::op_step() { debugger.op_exec(regs.pc.d); #ifdef DEBUGGER if(interface->tracer.open()) { char text[4096]; disassemble_opcode(text, regs.pc.d); interface->tracer.print(text, "\n"); } #endif (this->*opcode_table[op_readpc()])(); } void CPU::enable() { function reader = {&CPU::mmio_read, (CPU*)&cpu}; function writer = {&CPU::mmio_write, (CPU*)&cpu}; bus.map(reader, writer, 0x00, 0x3f, 0x2140, 0x2183); bus.map(reader, writer, 0x80, 0xbf, 0x2140, 0x2183); bus.map(reader, writer, 0x00, 0x3f, 0x4016, 0x4017); bus.map(reader, writer, 0x80, 0xbf, 0x4016, 0x4017); bus.map(reader, writer, 0x00, 0x3f, 0x4200, 0x421f); bus.map(reader, writer, 0x80, 0xbf, 0x4200, 0x421f); bus.map(reader, writer, 0x00, 0x3f, 0x4300, 0x437f); bus.map(reader, writer, 0x80, 0xbf, 0x4300, 0x437f); reader = [](unsigned addr) { return cpu.wram[addr]; }; writer = [](unsigned addr, uint8 data) { cpu.wram[addr] = data; }; bus.map(reader, writer, 0x00, 0x3f, 0x0000, 0x1fff, 0x002000, 0,0, Cartridge::Mapping::fastmode_readwrite, cpu.wram); bus.map(reader, writer, 0x80, 0xbf, 0x0000, 0x1fff, 0x002000, 0,0, Cartridge::Mapping::fastmode_readwrite, cpu.wram); bus.map(reader, writer, 0x7e, 0x7f, 0x0000, 0xffff, 0x020000, 0,0, Cartridge::Mapping::fastmode_readwrite, cpu.wram); } void CPU::power() { for(auto& byte : wram) byte = random(0x55); regs.a = regs.x = regs.y = 0x0000; regs.s = 0x01ff; mmio_power(); dma_power(); timing_power(); } void CPU::reset() { create(Enter, system.cpu_frequency()); coprocessors.reset(); PPUcounter::reset(); //note: some registers are not fully reset by SNES regs.pc = 0x000000; regs.x.h = 0x00; regs.y.h = 0x00; regs.s.h = 0x01; regs.d = 0x0000; regs.db = 0x00; regs.p = 0x34; regs.e = 1; regs.mdr = 0x00; regs.wai = false; regs.vector = 0xfffc; //reset vector address update_table(); mmio_reset(); dma_reset(); timing_reset(); } CPU::CPU() { PPUcounter::scanline = {&CPU::scanline, this}; } CPU::~CPU() { } } sfc/alt/cpu/cpu.cpp000664 001750 001750 00000010476 12651764221 015335 0ustar00sergiosergio000000 000000 #include #define CPU_CPP namespace SuperFamicom { CPU cpu; #include "serialization.cpp" #include "dma.cpp" #include "memory.cpp" #include "mmio.cpp" #include "timing.cpp" void CPU::step(unsigned clocks) { smp.clock -= clocks * (uint64)smp.frequency; ppu.clock -= clocks; for(unsigned i = 0; i < coprocessors.size(); i++) { auto& chip = *coprocessors[i]; chip.clock -= clocks * (uint64)chip.frequency; } input.port1->clock -= clocks * (uint64)input.port1->frequency; input.port2->clock -= clocks * (uint64)input.port2->frequency; synchronize_controllers(); } void CPU::synchronize_smp() { if(SMP::Threaded == true) { if(smp.clock < 0) co_switch(smp.thread); } else { while(smp.clock < 0) smp.enter(); } } void CPU::synchronize_ppu() { if(PPU::Threaded == true) { if(ppu.clock < 0) co_switch(ppu.thread); } else { while(ppu.clock < 0) ppu.enter(); } } void CPU::synchronize_coprocessors() { for(unsigned i = 0; i < coprocessors.size(); i++) { auto& chip = *coprocessors[i]; if(chip.clock < 0) co_switch(chip.thread); } } void CPU::synchronize_controllers() { if(input.port1->clock < 0) co_switch(input.port1->thread); if(input.port2->clock < 0) co_switch(input.port2->thread); } void CPU::Enter() { cpu.enter(); } void CPU::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::CPU) { scheduler.sync = Scheduler::SynchronizeMode::All; scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(status.nmi_pending) { status.nmi_pending = false; regs.vector = (regs.e == false ? 0xffea : 0xfffa); op_irq(); } if(status.irq_pending) { status.irq_pending = false; regs.vector = (regs.e == false ? 0xffee : 0xfffe); op_irq(); } op_step(); } } alwaysinline void CPU::op_step() { (this->*opcode_table[op_readpc()])(); } void CPU::enable() { function reader = {&CPU::mmio_read, (CPU*)&cpu}; function writer = {&CPU::mmio_write, (CPU*)&cpu}; bus.map(reader, writer, 0x00, 0x3f, 0x2140, 0x2183); bus.map(reader, writer, 0x80, 0xbf, 0x2140, 0x2183); bus.map(reader, writer, 0x00, 0x3f, 0x4016, 0x4017); bus.map(reader, writer, 0x80, 0xbf, 0x4016, 0x4017); bus.map(reader, writer, 0x00, 0x3f, 0x4200, 0x421f); bus.map(reader, writer, 0x80, 0xbf, 0x4200, 0x421f); bus.map(reader, writer, 0x00, 0x3f, 0x4300, 0x437f); bus.map(reader, writer, 0x80, 0xbf, 0x4300, 0x437f); reader = [](unsigned addr) { return cpu.wram[addr]; }; writer = [](unsigned addr, uint8 data) { cpu.wram[addr] = data; }; bus.map(reader, writer, 0x00, 0x3f, 0x0000, 0x1fff, 0x002000, 0,0, Cartridge::Mapping::fastmode_readwrite, cpu.wram); bus.map(reader, writer, 0x80, 0xbf, 0x0000, 0x1fff, 0x002000, 0,0, Cartridge::Mapping::fastmode_readwrite, cpu.wram); bus.map(reader, writer, 0x7e, 0x7f, 0x0000, 0xffff, 0x020000, 0,0, Cartridge::Mapping::fastmode_readwrite, cpu.wram); } void CPU::power() { regs.a = 0x0000; regs.x = 0x0000; regs.y = 0x0000; regs.s = 0x01ff; reset(); } void CPU::reset() { create(Enter, system.cpu_frequency()); coprocessors.reset(); PPUcounter::reset(); regs.pc = 0x000000; regs.x.h = 0x00; regs.y.h = 0x00; regs.s.h = 0x01; regs.d = 0x0000; regs.db = 0x00; regs.p = 0x34; regs.e = 1; regs.mdr = 0x00; regs.wai = false; update_table(); regs.pc.l = bus.read(0xfffc); regs.pc.h = bus.read(0xfffd); regs.pc.b = 0x00; status.nmi_valid = false; status.nmi_line = false; status.nmi_transition = false; status.nmi_pending = false; status.irq_valid = false; status.irq_line = false; status.irq_transition = false; status.irq_pending = false; status.irq_lock = false; status.hdma_pending = false; status.wram_addr = 0x000000; status.joypad_strobe_latch = 0; status.nmi_enabled = false; status.virq_enabled = false; status.hirq_enabled = false; status.auto_joypad_poll_enabled = false; status.pio = 0xff; status.htime = 0x0000; status.vtime = 0x0000; status.rom_speed = 8; status.joy1l = status.joy1h = 0x00; status.joy2l = status.joy2h = 0x00; status.joy3l = status.joy3h = 0x00; status.joy4l = status.joy4h = 0x00; dma_reset(); } CPU::CPU() : queue(512, {&CPU::queue_event, this}) { PPUcounter::scanline = {&CPU::scanline, this}; } CPU::~CPU() { } } nall/map.hpp000664 001750 001750 00000004123 12651764221 014124 0ustar00sergiosergio000000 000000 #ifndef NALL_MAP_HPP #define NALL_MAP_HPP #include namespace nall { template struct map { struct node_t { T key; U value; bool operator< (const node_t& source) const { return key < source.key; } bool operator==(const node_t& source) const { return key == source.key; } node_t() = default; node_t(const T& key) : key(key) {} node_t(const T& key, const U& value) : key(key), value(value) {} }; optional find(const T& key) const { if(auto node = root.find({key})) return {true, node().value}; return false; } void insert(const T& key, const U& value) { root.insert({key, value}); } void remove(const T& key) { root.remove({key}); } unsigned size() const { return root.size(); } void reset() { root.reset(); } typename set::iterator begin() { return root.begin(); } typename set::iterator end() { return root.end(); } const typename set::iterator begin() const { return root.begin(); } const typename set::iterator end() const { return root.end(); } protected: set root; }; template struct bimap { optional find(const T& key) const { return tmap.find(key); } optional find(const U& key) const { return umap.find(key); } void insert(const T& key, const U& value) { tmap.insert(key, value); umap.insert(value, key); } void remove(const T& key) { if(auto p = tmap.find(key)) { umap.remove(p().value); tmap.remove(key); } } void remove(const U& key) { if(auto p = umap.find(key)) { tmap.remove(p().value); umap.remove(key); } } unsigned size() const { return tmap.size(); } void reset() { tmap.reset(); umap.reset(); } typename set::node_t>::iterator begin() { return tmap.begin(); } typename set::node_t>::iterator end() { return tmap.end(); } const typename set::node_t>::iterator begin() const { return tmap.begin(); } const typename set::node_t>::iterator end() const { return tmap.end(); } protected: map tmap; map umap; }; } #endif processor/upd96050/upd96050.hpp000664 001750 001750 00000001343 12651764221 017031 0ustar00sergiosergio000000 000000 #ifndef PROCESSOR_UPD96050_HPP #define PROCESSOR_UPD96050_HPP namespace Processor { //NEC uPD7720 (not supported) //NEC uPD7725 //NEC uPD96050 struct uPD96050 { enum class Revision : unsigned { uPD7725, uPD96050 } revision; uint24 programROM[16384]; uint16 dataROM[2048]; uint16 dataRAM[2048]; #include "registers.hpp" void power(); void exec(); void serialize(serializer&); void exec_op(uint24 opcode); void exec_rt(uint24 opcode); void exec_jp(uint24 opcode); void exec_ld(uint24 opcode); uint8 sr_read(); void sr_write(uint8 data); uint8 dr_read(); void dr_write(uint8 data); uint8 dp_read(uint12 addr); void dp_write(uint12 addr, uint8 data); string disassemble(uint14 ip); }; } #endif sfc/alt/cpu/timing.cpp000664 001750 001750 00000006303 12651764221 016027 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP void CPU::queue_event(unsigned id) { switch(id) { case QueueEvent::DramRefresh: return add_clocks(40); case QueueEvent::HdmaRun: return hdma_run(); } } void CPU::last_cycle() { if(status.irq_lock) { status.irq_lock = false; return; } if(status.nmi_transition) { regs.wai = false; status.nmi_transition = false; status.nmi_pending = true; } if(status.irq_transition || regs.irq) { regs.wai = false; status.irq_transition = false; status.irq_pending = !regs.p.i; } } void CPU::add_clocks(unsigned clocks) { if(status.hirq_enabled) { if(status.virq_enabled) { unsigned cpu_time = vcounter() * 1364 + hcounter(); unsigned irq_time = status.vtime * 1364 + status.htime * 4; unsigned framelines = (system.region() == System::Region::NTSC ? 262 : 312) + field(); if(cpu_time > irq_time) irq_time += framelines * 1364; bool irq_valid = status.irq_valid; status.irq_valid = cpu_time <= irq_time && cpu_time + clocks > irq_time; if(!irq_valid && status.irq_valid) status.irq_line = true; } else { unsigned irq_time = status.htime * 4; if(hcounter() > irq_time) irq_time += 1364; bool irq_valid = status.irq_valid; status.irq_valid = hcounter() <= irq_time && hcounter() + clocks > irq_time; if(!irq_valid && status.irq_valid) status.irq_line = true; } if(status.irq_line) status.irq_transition = true; } else if(status.virq_enabled) { bool irq_valid = status.irq_valid; status.irq_valid = vcounter() == status.vtime; if(!irq_valid && status.irq_valid) status.irq_line = true; if(status.irq_line) status.irq_transition = true; } else { status.irq_valid = false; } tick(clocks); queue.tick(clocks); step(clocks); } void CPU::scanline() { synchronize_smp(); synchronize_ppu(); synchronize_coprocessors(); system.scanline(); if(vcounter() == 0) hdma_init(); queue.enqueue(534, QueueEvent::DramRefresh); if(vcounter() <= (ppu.overscan() == false ? 224 : 239)) { queue.enqueue(1104 + 8, QueueEvent::HdmaRun); } bool nmi_valid = status.nmi_valid; status.nmi_valid = vcounter() >= (ppu.overscan() == false ? 225 : 240); if(!nmi_valid && status.nmi_valid) { status.nmi_line = true; if(status.nmi_enabled) status.nmi_transition = true; } else if(nmi_valid && !status.nmi_valid) { status.nmi_line = false; } if(status.auto_joypad_poll_enabled && vcounter() == (ppu.overscan() == false ? 227 : 242)) { run_auto_joypad_poll(); } } void CPU::run_auto_joypad_poll() { input.port1->latch(1); input.port2->latch(1); input.port1->latch(0); input.port2->latch(0); uint16 joy1 = 0, joy2 = 0, joy3 = 0, joy4 = 0; for(unsigned i = 0; i < 16; i++) { uint8 port0 = input.port1->data(); uint8 port1 = input.port2->data(); joy1 |= (port0 & 1) ? (0x8000 >> i) : 0; joy2 |= (port1 & 1) ? (0x8000 >> i) : 0; joy3 |= (port0 & 2) ? (0x8000 >> i) : 0; joy4 |= (port1 & 2) ? (0x8000 >> i) : 0; } status.joy1l = joy1; status.joy1h = joy1 >> 8; status.joy2l = joy2; status.joy2h = joy2 >> 8; status.joy3l = joy3; status.joy3h = joy3 >> 8; status.joy4l = joy4; status.joy4h = joy4 >> 8; } #endif sfc/controller/multitap/multitap.cpp000664 001750 001750 00000001655 12651764221 021057 0ustar00sergiosergio000000 000000 #ifdef CONTROLLER_CPP uint2 Multitap::data() { if(latched) return 2; //multitap detection unsigned index, port1, port2; if(iobit()) { index = counter1; if(index >= 16) return 3; counter1++; if(index >= 12) return 0; port1 = 0; //controller 1 port2 = 1; //controller 2 } else { index = counter2; if(index >= 16) return 3; counter2++; if(index >= 12) return 0; port1 = 2; //controller 3 port2 = 3; //controller 4 } bool data1 = interface->inputPoll(port, (unsigned)Input::Device::Multitap, port1 * 12 + index); bool data2 = interface->inputPoll(port, (unsigned)Input::Device::Multitap, port2 * 12 + index); return (data2 << 1) | (data1 << 0); } void Multitap::latch(bool data) { if(latched == data) return; latched = data; counter1 = 0; counter2 = 0; } Multitap::Multitap(bool port) : Controller(port) { latched = 0; counter1 = 0; counter2 = 0; } #endif sfc/cpu/dma/dma.cpp000664 001750 001750 00000016631 12651764221 015267 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP void CPU::dma_add_clocks(unsigned clocks) { status.dma_clocks += clocks; add_clocks(clocks); } //============= //memory access //============= bool CPU::dma_transfer_valid(uint8 bbus, uint32 abus) { //transfers from WRAM to WRAM are invalid; chip only has one address bus if(bbus == 0x80 && ((abus & 0xfe0000) == 0x7e0000 || (abus & 0x40e000) == 0x0000)) return false; return true; } bool CPU::dma_addr_valid(uint32 abus) { //A-bus access to B-bus or S-CPU registers are invalid if((abus & 0x40ff00) == 0x2100) return false; //$[00-3f|80-bf]:[2100-21ff] if((abus & 0x40fe00) == 0x4000) return false; //$[00-3f|80-bf]:[4000-41ff] if((abus & 0x40ffe0) == 0x4200) return false; //$[00-3f|80-bf]:[4200-421f] if((abus & 0x40ff80) == 0x4300) return false; //$[00-3f|80-bf]:[4300-437f] return true; } uint8 CPU::dma_read(uint32 abus) { if(dma_addr_valid(abus) == false) return 0x00; return bus.read(abus); } //simulate two-stage pipeline for DMA transfers; example: //cycle 0: read N+0 //cycle 1: write N+0 & read N+1 (parallel; one on A-bus, one on B-bus) //cycle 2: write N+1 & read N+2 (parallel) //cycle 3: write N+2 void CPU::dma_write(bool valid, unsigned addr, uint8 data) { if(pipe.valid) bus.write(pipe.addr, pipe.data); pipe.valid = valid; pipe.addr = addr; pipe.data = data; } void CPU::dma_transfer(bool direction, uint8 bbus, uint32 abus) { if(direction == 0) { dma_add_clocks(4); regs.mdr = dma_read(abus); dma_add_clocks(4); dma_write(dma_transfer_valid(bbus, abus), 0x2100 | bbus, regs.mdr); } else { dma_add_clocks(4); regs.mdr = dma_transfer_valid(bbus, abus) ? bus.read(0x2100 | bbus) : 0x00; dma_add_clocks(4); dma_write(dma_addr_valid(abus), abus, regs.mdr); } } //=================== //address calculation //=================== uint8 CPU::dma_bbus(unsigned i, unsigned index) { switch(channel[i].transfer_mode) { default: case 0: return (channel[i].dest_addr); //0 case 1: return (channel[i].dest_addr + (index & 1)); //0,1 case 2: return (channel[i].dest_addr); //0,0 case 3: return (channel[i].dest_addr + ((index >> 1) & 1)); //0,0,1,1 case 4: return (channel[i].dest_addr + (index & 3)); //0,1,2,3 case 5: return (channel[i].dest_addr + (index & 1)); //0,1,0,1 case 6: return (channel[i].dest_addr); //0,0 [2] case 7: return (channel[i].dest_addr + ((index >> 1) & 1)); //0,0,1,1 [3] } } inline uint32 CPU::dma_addr(unsigned i) { uint32 r = (channel[i].source_bank << 16) | (channel[i].source_addr); if(channel[i].fixed_transfer == false) { if(channel[i].reverse_transfer == false) { channel[i].source_addr++; } else { channel[i].source_addr--; } } return r; } inline uint32 CPU::hdma_addr(unsigned i) { return (channel[i].source_bank << 16) | (channel[i].hdma_addr++); } inline uint32 CPU::hdma_iaddr(unsigned i) { return (channel[i].indirect_bank << 16) | (channel[i].indirect_addr++); } //============== //channel status //============== uint8 CPU::dma_enabled_channels() { uint8 r = 0; for(unsigned i = 0; i < 8; i++) { if(channel[i].dma_enabled) r++; } return r; } inline bool CPU::hdma_active(unsigned i) { return (channel[i].hdma_enabled && !channel[i].hdma_completed); } inline bool CPU::hdma_active_after(unsigned i) { for(unsigned n = i + 1; n < 8; n++) { if(hdma_active(n) == true) return true; } return false; } inline uint8 CPU::hdma_enabled_channels() { uint8 r = 0; for(unsigned i = 0; i < 8; i++) { if(channel[i].hdma_enabled) r++; } return r; } inline uint8 CPU::hdma_active_channels() { uint8 r = 0; for(unsigned i = 0; i < 8; i++) { if(hdma_active(i) == true) r++; } return r; } //============== //core functions //============== void CPU::dma_run() { dma_add_clocks(8); dma_write(false); dma_edge(); for(unsigned i = 0; i < 8; i++) { if(channel[i].dma_enabled == false) continue; unsigned index = 0; do { dma_transfer(channel[i].direction, dma_bbus(i, index++), dma_addr(i)); dma_edge(); } while(channel[i].dma_enabled && --channel[i].transfer_size); dma_add_clocks(8); dma_write(false); dma_edge(); channel[i].dma_enabled = false; } status.irq_lock = true; } void CPU::hdma_update(unsigned i) { dma_add_clocks(4); regs.mdr = dma_read((channel[i].source_bank << 16) | channel[i].hdma_addr); dma_add_clocks(4); dma_write(false); if((channel[i].line_counter & 0x7f) == 0) { channel[i].line_counter = regs.mdr; channel[i].hdma_addr++; channel[i].hdma_completed = (channel[i].line_counter == 0); channel[i].hdma_do_transfer = !channel[i].hdma_completed; if(channel[i].indirect) { dma_add_clocks(4); regs.mdr = dma_read(hdma_addr(i)); channel[i].indirect_addr = regs.mdr << 8; dma_add_clocks(4); dma_write(false); if(!channel[i].hdma_completed || hdma_active_after(i)) { dma_add_clocks(4); regs.mdr = dma_read(hdma_addr(i)); channel[i].indirect_addr >>= 8; channel[i].indirect_addr |= regs.mdr << 8; dma_add_clocks(4); dma_write(false); } } } } void CPU::hdma_run() { dma_add_clocks(8); dma_write(false); for(unsigned i = 0; i < 8; i++) { if(hdma_active(i) == false) continue; channel[i].dma_enabled = false; //HDMA run during DMA will stop DMA mid-transfer if(channel[i].hdma_do_transfer) { static const unsigned transfer_length[8] = { 1, 2, 2, 4, 4, 4, 2, 4 }; unsigned length = transfer_length[channel[i].transfer_mode]; for(unsigned index = 0; index < length; index++) { unsigned addr = channel[i].indirect == false ? hdma_addr(i) : hdma_iaddr(i); dma_transfer(channel[i].direction, dma_bbus(i, index), addr); } } } for(unsigned i = 0; i < 8; i++) { if(hdma_active(i) == false) continue; channel[i].line_counter--; channel[i].hdma_do_transfer = channel[i].line_counter & 0x80; hdma_update(i); } status.irq_lock = true; } void CPU::hdma_init_reset() { for(unsigned i = 0; i < 8; i++) { channel[i].hdma_completed = false; channel[i].hdma_do_transfer = false; } } void CPU::hdma_init() { dma_add_clocks(8); dma_write(false); for(unsigned i = 0; i < 8; i++) { if(!channel[i].hdma_enabled) continue; channel[i].dma_enabled = false; //HDMA init during DMA will stop DMA mid-transfer channel[i].hdma_addr = channel[i].source_addr; channel[i].line_counter = 0; hdma_update(i); } status.irq_lock = true; } //============== //initialization //============== void CPU::dma_power() { for(unsigned i = 0; i < 8; i++) { channel[i].direction = 1; channel[i].indirect = true; channel[i].unused = true; channel[i].reverse_transfer = true; channel[i].fixed_transfer = true; channel[i].transfer_mode = 7; channel[i].dest_addr = 0xff; channel[i].source_addr = 0xffff; channel[i].source_bank = 0xff; channel[i].transfer_size = 0xffff; channel[i].indirect_bank = 0xff; channel[i].hdma_addr = 0xffff; channel[i].line_counter = 0xff; channel[i].unknown = 0xff; } } void CPU::dma_reset() { for(unsigned i = 0; i < 8; i++) { channel[i].dma_enabled = false; channel[i].hdma_enabled = false; channel[i].hdma_completed = false; channel[i].hdma_do_transfer = false; } pipe.valid = false; pipe.addr = 0; pipe.data = 0; } #endif target-ethos/resource/cheat-editor.png000664 001750 001750 00000001651 12651764221 021226 0ustar00sergiosergio000000 000000 PNG  IHDRabKGD pHYs  tIME 8"86IDAT8]KL\uƿcysA`fISWJҍU6TkfHCb X4L\4]u 4)e3pI9INöFF/4͇>8*^RjzF1ӖmۋWǮ p({~+hX`Zp;b1pK 4 V.WǮ J)b1rH D IAŘ4;DS=5DPsBIENDB`ananke/obj/000700 001750 001750 00000000000 12656700342 013702 5ustar00sergiosergio000000 000000 sfc/chip/hitachidsp/hitachidsp.hpp000664 001750 001750 00000001376 12651764221 020366 0ustar00sergiosergio000000 000000 struct HitachiDSP : Processor::HG51B, Coprocessor { unsigned Frequency; unsigned Roms; MappedRAM rom; MappedRAM ram; #include "mmio.hpp" static void Enter(); void enter(); void init(); void load(); void unload(); void power(); void reset(); //HG51B read/write uint8 bus_read(uint24 addr); void bus_write(uint24 addr, uint8 data); //CPU ROM read/write uint8 rom_read(unsigned addr); void rom_write(unsigned addr, uint8 data); //CPU RAM read/write uint8 ram_read(unsigned addr); void ram_write(unsigned addr, uint8 data); //CPU MMIO read/write uint8 dsp_read(unsigned addr); void dsp_write(unsigned addr, uint8 data); vector firmware(); void serialize(serializer&); }; extern HitachiDSP hitachidsp; sfc/chip/st0010/opcodes.cpp000664 001750 001750 00000013125 12651764221 016477 0ustar00sergiosergio000000 000000 #ifdef ST0010_CPP //ST-0010 emulation code - Copyright (C) 2003 The Dumper, Matthew Kendora, Overload, Feather //bsnes port - Copyright (C) 2007 byuu void ST0010::op_01(int16 x0, int16 y0, int16 &x1, int16 &y1, int16 &quadrant, int16 &theta) { if((x0 < 0) && (y0 < 0)) { x1 = -x0; y1 = -y0; quadrant = -0x8000; } else if(x0 < 0) { x1 = y0; y1 = -x0; quadrant = -0x4000; } else if(y0 < 0) { x1 = -y0; y1 = x0; quadrant = 0x4000; } else { x1 = x0; y1 = y0; quadrant = 0x0000; } while((x1 > 0x1f) || (y1 > 0x1f)) { if(x1 > 1) { x1 >>= 1; } if(y1 > 1) { y1 >>= 1; } } if(y1 == 0) { quadrant += 0x4000; } theta = (arctan[y1][x1] << 8) ^ quadrant; } // void ST0010::op_01() { int16 x0 = readw(0x0000); int16 y0 = readw(0x0002); int16 x1, y1, quadrant, theta; op_01(x0, y0, x1, y1, quadrant, theta); writew(0x0000, x1); writew(0x0002, y1); writew(0x0004, quadrant); //writew(0x0006, y0); //Overload's docs note this write occurs, SNES9x disagrees writew(0x0010, theta); } void ST0010::op_02() { int16 positions = readw(0x0024); uint16 *places = (uint16*)(ram + 0x0040); uint16 *drivers = (uint16*)(ram + 0x0080); bool sorted; uint16 temp; if(positions > 1) { do { sorted = true; for(int i = 0; i < positions - 1; i++) { if(places[i] < places[i + 1]) { temp = places[i + 1]; places[i + 1] = places[i]; places[i] = temp; temp = drivers[i + 1]; drivers[i + 1] = drivers[i]; drivers[i] = temp; sorted = false; } } positions--; } while(!sorted); } } void ST0010::op_03() { int16 x0 = readw(0x0000); int16 y0 = readw(0x0002); int16 multiplier = readw(0x0004); int32 x1, y1; x1 = x0 * multiplier << 1; y1 = y0 * multiplier << 1; writed(0x0010, x1); writed(0x0014, y1); } void ST0010::op_04() { int16 x = readw(0x0000); int16 y = readw(0x0002); int16 square; //calculate the vector length of (x,y) square = (int16)sqrt((double)(y * y + x * x)); writew(0x0010, square); } void ST0010::op_05() { int32 dx, dy; int16 a1, b1, c1; uint16 o1; bool wrap = false; //target (x,y) coordinates int16 ypos_max = readw(0x00c0); int16 xpos_max = readw(0x00c2); //current coordinates and direction int32 ypos = readd(0x00c4); int32 xpos = readd(0x00c8); uint16 rot = readw(0x00cc); //physics uint16 speed = readw(0x00d4); uint16 accel = readw(0x00d6); uint16 speed_max = readw(0x00d8); //special condition acknowledgement int16 system = readw(0x00da); int16 flags = readw(0x00dc); //new target coordinates int16 ypos_new = readw(0x00de); int16 xpos_new = readw(0x00e0); //mask upper bit xpos_new &= 0x7fff; //get the current distance dx = xpos_max - (xpos >> 16); dy = ypos_max - (ypos >> 16); //quirk: clear and move in9 writew(0x00d2, 0xffff); writew(0x00da, 0x0000); //grab the target angle op_01(dy, dx, a1, b1, c1, (int16&)o1); //check for wrapping if(abs(o1 - rot) > 0x8000) { o1 += 0x8000; rot += 0x8000; wrap = true; } uint16 old_speed = speed; //special case if(abs(o1 - rot) == 0x8000) { speed = 0x100; } //slow down for sharp curves else if(abs(o1 - rot) >= 0x1000) { uint32 slow = abs(o1 - rot); slow >>= 4; //scaling speed -= slow; } //otherwise accelerate else { speed += accel; if(speed > speed_max) { speed = speed_max; //clip speed } } //prevent negative/positive overflow if(abs(old_speed - speed) > 0x8000) { if(old_speed < speed) { speed = 0; } else speed = 0xff00; } //adjust direction by so many degrees //be careful of negative adjustments if((o1 > rot && (o1 - rot) > 0x80) || (o1 < rot && (rot - o1) >= 0x80)) { if(o1 < rot) { rot -= 0x280; } else if(o1 > rot) { rot += 0x280; } } //turn off wrapping if(wrap) { rot -= 0x8000; } //now check the distances (store for later) dx = (xpos_max << 16) - xpos; dy = (ypos_max << 16) - ypos; dx >>= 16; dy >>= 16; //if we're in so many units of the target, signal it if((system && (dy <= 6 && dy >= -8) && (dx <= 126 && dx >= -128)) || (!system && (dx <= 6 && dx >= -8) && (dy <= 126 && dy >= -128))) { //announce our new destination and flag it xpos_max = xpos_new & 0x7fff; ypos_max = ypos_new; flags |= 0x08; } //update position xpos -= (cos(rot) * 0x400 >> 15) * (speed >> 8) << 1; ypos -= (sin(rot) * 0x400 >> 15) * (speed >> 8) << 1; //quirk: mask upper byte xpos &= 0x1fffffff; ypos &= 0x1fffffff; writew(0x00c0, ypos_max); writew(0x00c2, xpos_max); writed(0x00c4, ypos); writed(0x00c8, xpos); writew(0x00cc, rot); writew(0x00d4, speed); writew(0x00dc, flags); } void ST0010::op_06() { int16 multiplicand = readw(0x0000); int16 multiplier = readw(0x0002); int32 product; product = multiplicand * multiplier << 1; writed(0x0010, product); } void ST0010::op_07() { int16 theta = readw(0x0000); int16 data; for(int i = 0, offset = 0; i < 176; i++) { data = mode7_scale[i] * cos(theta) >> 15; writew(0x00f0 + offset, data); writew(0x0510 + offset, data); data = mode7_scale[i] * sin(theta) >> 15; writew(0x0250 + offset, data); if(data) { data = ~data; } writew(0x03b0 + offset, data); offset += 2; } } void ST0010::op_08() { int16 x0 = readw(0x0000); int16 y0 = readw(0x0002); int16 theta = readw(0x0004); int16 x1, y1; x1 = (y0 * sin(theta) >> 15) + (x0 * cos(theta) >> 15); y1 = (y0 * cos(theta) >> 15) - (x0 * sin(theta) >> 15); writew(0x0010, x1); writew(0x0012, y1); } #endif sfc/dsp/serialization.cpp000664 001750 001750 00000003203 12651764221 016630 0ustar00sergiosergio000000 000000 #ifdef DSP_CPP void DSP::serialize(serializer& s) { Thread::serialize(s); s.array(state.regs, 128); state.echo_hist[0].serialize(s); state.echo_hist[1].serialize(s); s.integer(state.echo_hist_pos); s.integer(state.every_other_sample); s.integer(state.kon); s.integer(state.noise); s.integer(state.counter); s.integer(state.echo_offset); s.integer(state.echo_length); s.integer(state.new_kon); s.integer(state.endx_buf); s.integer(state.envx_buf); s.integer(state.outx_buf); s.integer(state.t_pmon); s.integer(state.t_non); s.integer(state.t_eon); s.integer(state.t_dir); s.integer(state.t_koff); s.integer(state.t_brr_next_addr); s.integer(state.t_adsr0); s.integer(state.t_brr_header); s.integer(state.t_brr_byte); s.integer(state.t_srcn); s.integer(state.t_esa); s.integer(state.t_echo_disabled); s.integer(state.t_dir_addr); s.integer(state.t_pitch); s.integer(state.t_output); s.integer(state.t_looped); s.integer(state.t_echo_ptr); s.integer(state.t_main_out[0]); s.integer(state.t_main_out[1]); s.integer(state.t_echo_out[0]); s.integer(state.t_echo_out[1]); s.integer(state.t_echo_in [0]); s.integer(state.t_echo_in [1]); for(unsigned n = 0; n < 8; n++) { voice[n].buffer.serialize(s); s.integer(voice[n].buf_pos); s.integer(voice[n].interp_pos); s.integer(voice[n].brr_addr); s.integer(voice[n].brr_offset); s.integer(voice[n].vbit); s.integer(voice[n].vidx); s.integer(voice[n].kon_delay); s.integer(voice[n].env_mode); s.integer(voice[n].env); s.integer(voice[n].t_envx_out); s.integer(voice[n].hidden_env); } } #endif nall/string/char.hpp000664 001750 001750 00000000602 12651764221 015570 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP #include #include #include #include #include #include #include #include #include #endif fc/fc.hpp000664 001750 001750 00000002414 12651764221 013402 0ustar00sergiosergio000000 000000 #ifndef FC_HPP #define FC_HPP #include #include namespace Famicom { namespace Info { static const char Name[] = "bnes"; static const unsigned SerializerVersion = 2; } } /* bnes - Famicom emulator authors: byuu, Ryphecha license: GPLv3 project started: 2011-09-05 */ #include namespace Famicom { struct Thread { cothread_t thread; unsigned frequency; int64 clock; inline void create(void (*entrypoint)(), unsigned frequency) { if(thread) co_delete(thread); thread = co_create(65536 * sizeof(void*), entrypoint); this->frequency = frequency; clock = 0; } inline void serialize(serializer& s) { s.integer(frequency); s.integer(clock); } inline Thread() : thread(nullptr) { } inline ~Thread() { if(thread) co_delete(thread); } }; #include #include #include #include #include #include #include #include #include #include #include } #endif nall/serializer.hpp000664 001750 001750 00000010371 12651764221 015522 0ustar00sergiosergio000000 000000 #ifndef NALL_SERIALIZER_HPP #define NALL_SERIALIZER_HPP //serializer: a class designed to save and restore the state of classes. // //benefits: //- data() will be portable in size (it is not necessary to specify type sizes.) //- data() will be portable in endianness (always stored internally as little-endian.) //- one serialize function can both save and restore class states. // //caveats: //- only plain-old-data can be stored. complex classes must provide serialize(serializer&); //- floating-point usage is not portable across different implementations #include #include #include #include namespace nall { struct serializer; template struct has_serialize { template static char test(decltype(std::declval().serialize(std::declval()))*); template static long test(...); static const bool value = sizeof(test(0)) == sizeof(char); }; struct serializer { enum mode_t { Load, Save, Size }; mode_t mode() const { return _mode; } const uint8_t* data() const { return _data; } unsigned size() const { return _size; } unsigned capacity() const { return _capacity; } template serializer& floatingpoint(T& value) { enum { size = sizeof(T) }; //this is rather dangerous, and not cross-platform safe; //but there is no standardized way to export FP-values uint8_t* p = (uint8_t*)&value; if(_mode == Save) { for(unsigned n = 0; n < size; n++) _data[_size++] = p[n]; } else if(_mode == Load) { for(unsigned n = 0; n < size; n++) p[n] = _data[_size++]; } else { _size += size; } return *this; } template serializer& integer(T& value) { enum { size = std::is_same::value ? 1 : sizeof(T) }; if(_mode == Save) { for(unsigned n = 0; n < size; n++) _data[_size++] = (uintmax_t)value >> (n << 3); } else if(_mode == Load) { value = 0; for(unsigned n = 0; n < size; n++) value |= (uintmax_t)_data[_size++] << (n << 3); } else if(_mode == Size) { _size += size; } return *this; } template serializer& array(T (&array)[N]) { for(unsigned n = 0; n < N; n++) operator()(array[n]); return *this; } template serializer& array(T array, unsigned size) { for(unsigned n = 0; n < size; n++) operator()(array[n]); return *this; } template serializer& operator()(T& value, typename std::enable_if::value>::type* = 0) { value.serialize(*this); return *this; } template serializer& operator()(T& value, typename std::enable_if::value>::type* = 0) { return integer(value); } template serializer& operator()(T& value, typename std::enable_if::value>::type* = 0) { return floatingpoint(value); } template serializer& operator()(T& value, typename std::enable_if::value>::type* = 0) { return array(value); } template serializer& operator()(T& value, unsigned size, typename std::enable_if::value>::type* = 0) { return array(value, size); } serializer& operator=(const serializer& s) { if(_data) delete[] _data; _mode = s._mode; _data = new uint8_t[s._capacity]; _size = s._size; _capacity = s._capacity; memcpy(_data, s._data, s._capacity); return *this; } serializer& operator=(serializer&& s) { if(_data) delete[] _data; _mode = s._mode; _data = s._data; _size = s._size; _capacity = s._capacity; s._data = nullptr; return *this; } serializer() = default; serializer(const serializer& s) { operator=(s); } serializer(serializer&& s) { operator=(std::move(s)); } serializer(unsigned capacity) { _mode = Save; _data = new uint8_t[capacity](); _size = 0; _capacity = capacity; } serializer(const uint8_t* data, unsigned capacity) { _mode = Load; _data = new uint8_t[capacity]; _size = 0; _capacity = capacity; memcpy(_data, data, capacity); } ~serializer() { if(_data) delete[] _data; } private: mode_t _mode = Size; uint8_t* _data = nullptr; unsigned _size = 0; unsigned _capacity = 0; }; }; #endif phoenix/qt/widget/tab-frame.cpp000664 001750 001750 00000004624 12651764221 017641 0ustar00sergiosergio000000 000000 namespace phoenix { void pTabFrame::append(string text, const image& image) { unsigned selection = tabFrame.state.text.size() - 1; qtTabFrame->addTab(new QWidget, QString::fromUtf8(text)); if(!image.empty()) setImage(selection, image); } QWidget* pTabFrame::container(Widget& widget) { Layout* widgetLayout = GetParentWidgetLayout(&widget); unsigned selection = 0; for(auto& layout : tabFrame.state.layout) { if(layout == widgetLayout) return qtTabFrame->widget(selection); selection++; } return nullptr; } Position pTabFrame::displacement() { return {5, 33}; } void pTabFrame::remove(unsigned selection) { qtTabFrame->removeTab(selection); } void pTabFrame::setEnabled(bool enabled) { for(auto& layout : tabFrame.state.layout) { if(layout) layout->setEnabled(layout->enabled()); } pWidget::setEnabled(enabled); } void pTabFrame::setGeometry(Geometry geometry) { pWidget::setGeometry(geometry); geometry.x += 0, geometry.width -= 5; geometry.y += 29, geometry.height -= 33; for(auto& layout : tabFrame.state.layout) { if(layout) layout->setGeometry(geometry); } synchronizeLayout(); } void pTabFrame::setImage(unsigned selection, const image& image) { qtTabFrame->setTabIcon(selection, CreateIcon(image)); } void pTabFrame::setSelection(unsigned selection) { locked = true; qtTabFrame->setCurrentIndex(selection); synchronizeLayout(); locked = false; } void pTabFrame::setText(unsigned selection, string text) { qtTabFrame->setTabText(selection, QString::fromUtf8(text)); } void pTabFrame::setVisible(bool visible) { for(auto& layout : tabFrame.state.layout) { if(layout) layout->setVisible(layout->visible()); } pWidget::setVisible(visible); } void pTabFrame::constructor() { qtWidget = qtTabFrame = new QTabWidget; connect(qtTabFrame, SIGNAL(currentChanged(int)), SLOT(onChange(int))); setSelection(tabFrame.state.selection); } void pTabFrame::destructor() { delete qtTabFrame; qtWidget = qtTabFrame = nullptr; } void pTabFrame::orphan() { destructor(); constructor(); } void pTabFrame::synchronizeLayout() { unsigned selection = 0; for(auto& layout : tabFrame.state.layout) { if(layout) layout->setVisible(selection == tabFrame.state.selection); selection++; } } void pTabFrame::onChange(int selection) { tabFrame.state.selection = selection; synchronizeLayout(); if(!locked && tabFrame.onChange) tabFrame.onChange(); } } sfc/ppu/window/window.hpp000664 001750 001750 00000003173 12651764221 016622 0ustar00sergiosergio000000 000000 struct Window { struct { bool bg1_one_enable; bool bg1_one_invert; bool bg1_two_enable; bool bg1_two_invert; bool bg2_one_enable; bool bg2_one_invert; bool bg2_two_enable; bool bg2_two_invert; bool bg3_one_enable; bool bg3_one_invert; bool bg3_two_enable; bool bg3_two_invert; bool bg4_one_enable; bool bg4_one_invert; bool bg4_two_enable; bool bg4_two_invert; bool oam_one_enable; bool oam_one_invert; bool oam_two_enable; bool oam_two_invert; bool col_one_enable; bool col_one_invert; bool col_two_enable; bool col_two_invert; uint8 one_left; uint8 one_right; uint8 two_left; uint8 two_right; uint2 bg1_mask; uint2 bg2_mask; uint2 bg3_mask; uint2 bg4_mask; uint2 oam_mask; uint2 col_mask; bool bg1_main_enable; bool bg1_sub_enable; bool bg2_main_enable; bool bg2_sub_enable; bool bg3_main_enable; bool bg3_sub_enable; bool bg4_main_enable; bool bg4_sub_enable; bool oam_main_enable; bool oam_sub_enable; uint2 col_main_mask; uint2 col_sub_mask; } regs; struct Output { struct Pixel { bool color_enable; } main, sub; } output; struct { unsigned x; bool one; bool two; }; inline void scanline(); inline void run(); inline void reset(); inline void test( bool& main, bool& sub, bool one_enable, bool one_invert, bool two_enable, bool two_invert, uint8 mask, bool main_enable, bool sub_enable ); inline void serialize(serializer&); inline Window(PPU& self); PPU& self; friend class PPU; }; ruby/video/opengl/000700 001750 001750 00000000000 12656700342 015246 5ustar00sergiosergio000000 000000 nall/stream/file.hpp000664 001750 001750 00000002012 12651764221 015554 0ustar00sergiosergio000000 000000 #ifndef NALL_STREAM_FILE_HPP #define NALL_STREAM_FILE_HPP #include namespace nall { struct filestream : stream { using stream::read; using stream::write; bool seekable() const { return true; } bool readable() const { return true; } bool writable() const { return pwritable; } bool randomaccess() const { return false; } unsigned size() const { return pfile.size(); } unsigned offset() const { return pfile.offset(); } void seek(unsigned offset) const { pfile.seek(offset); } uint8_t read() const { return pfile.read(); } void write(uint8_t data) const { pfile.write(data); } filestream(const string& filename) { pfile.open(filename, file::mode::readwrite); pwritable = pfile.open(); if(!pwritable) pfile.open(filename, file::mode::read); } filestream(const string& filename, file::mode mode) { pfile.open(filename, mode); pwritable = mode == file::mode::write || mode == file::mode::readwrite; } private: mutable file pfile; bool pwritable; }; } #endif gba/cartridge/memory.hpp000664 001750 001750 00000001516 12651764221 016431 0ustar00sergiosergio000000 000000 struct Memory { uint8* data; unsigned size; unsigned mask; } rom, ram; struct EEPROM { uint8* data; unsigned size; unsigned mask; unsigned test; unsigned bits; enum class Mode : unsigned { Wait, Command, ReadAddress, ReadValidate, ReadData, WriteAddress, WriteData, WriteValidate } mode; unsigned offset; unsigned address; unsigned addressbits; bool read(unsigned addr); void write(unsigned addr, bool bit); bool read(); void write(bool bit); void power(); void serialize(serializer&); } eeprom; struct FlashROM { uint8* data; unsigned size; uint16 id; bool unlockhi; bool unlocklo; bool idmode; bool erasemode; bool bankselect; bool writeselect; bool bank; uint8 read(uint16 addr); void write(uint16 addr, uint8 byte); void power(); void serialize(serializer&); } flashrom; processor/upd96050/disassembler.cpp000664 001750 001750 00000015100 12651764221 020301 0ustar00sergiosergio000000 000000 #ifdef NECDSP_CPP string NECDSP::disassemble(uint14 ip) { string output = { hex<4>(ip), " " }; uint24 opcode = programROM[ip]; uint2 type = opcode >> 22; if(type == 0 || type == 1) { //OP,RT uint2 pselect = opcode >> 20; uint4 alu = opcode >> 16; uint1 asl = opcode >> 15; uint2 dpl = opcode >> 13; uint4 dphm = opcode >> 9; uint1 rpdcr = opcode >> 8; uint4 src = opcode >> 4; uint4 dst = opcode >> 0; switch(alu) { case 0: output.append("nop "); break; case 1: output.append("or "); break; case 2: output.append("and "); break; case 3: output.append("xor "); break; case 4: output.append("sub "); break; case 5: output.append("add "); break; case 6: output.append("sbb "); break; case 7: output.append("adc "); break; case 8: output.append("dec "); break; case 9: output.append("inc "); break; case 10: output.append("cmp "); break; case 11: output.append("shr1 "); break; case 12: output.append("shl1 "); break; case 13: output.append("shl2 "); break; case 14: output.append("shl4 "); break; case 15: output.append("xchg "); break; } if(alu < 8) { switch(pselect) { case 0: output.append("ram,"); break; case 1: output.append("idb,"); break; case 2: output.append("m," ); break; case 3: output.append("n," ); break; } } switch(asl) { case 0: output.append("a"); break; case 1: output.append("b"); break; } output.append("\n mov "); switch(src) { case 0: output.append("trb," ); break; case 1: output.append("a," ); break; case 2: output.append("b," ); break; case 3: output.append("tr," ); break; case 4: output.append("dp," ); break; case 5: output.append("rp," ); break; case 6: output.append("ro," ); break; case 7: output.append("sgn," ); break; case 8: output.append("dr," ); break; case 9: output.append("drnf,"); break; case 10: output.append("sr," ); break; case 11: output.append("sim," ); break; case 12: output.append("sil," ); break; case 13: output.append("k," ); break; case 14: output.append("l," ); break; case 15: output.append("mem," ); break; } switch(dst) { case 0: output.append("non"); break; case 1: output.append("a" ); break; case 2: output.append("b" ); break; case 3: output.append("tr" ); break; case 4: output.append("dp" ); break; case 5: output.append("rp" ); break; case 6: output.append("dr" ); break; case 7: output.append("sr" ); break; case 8: output.append("sol"); break; case 9: output.append("som"); break; case 10: output.append("k" ); break; case 11: output.append("klr"); break; case 12: output.append("klm"); break; case 13: output.append("l" ); break; case 14: output.append("trb"); break; case 15: output.append("mem"); break; } if(dpl) { switch(dpl) { case 0: output.append("\n dpnop"); break; case 1: output.append("\n dpinc"); break; case 2: output.append("\n dpdec"); break; case 3: output.append("\n dpclr"); break; } } if(dphm) { output.append("\n m", hex<1>(dphm)); } if(rpdcr == 1) { output.append("\n rpdec"); } if(type == 1) { output.append("\n ret"); } } if(type == 2) { //JP uint9 brch = opcode >> 13; uint11 na = opcode >> 2; uint8 bank = opcode >> 0; uint14 jp = (regs.pc & 0x2000) | (bank << 11) | (na << 0); switch(brch) { case 0x000: output.append("jmpso "); jp = 0; break; case 0x080: output.append("jnca "); break; case 0x082: output.append("jca "); break; case 0x084: output.append("jncb "); break; case 0x086: output.append("jcb "); break; case 0x088: output.append("jnza "); break; case 0x08a: output.append("jza "); break; case 0x08c: output.append("jnzb "); break; case 0x08e: output.append("jzb "); break; case 0x090: output.append("jnova0 "); break; case 0x092: output.append("jova0 "); break; case 0x094: output.append("jnovb0 "); break; case 0x096: output.append("jovb0 "); break; case 0x098: output.append("jnova1 "); break; case 0x09a: output.append("jova1 "); break; case 0x09c: output.append("jnovb1 "); break; case 0x09e: output.append("jovb1 "); break; case 0x0a0: output.append("jnsa0 "); break; case 0x0a2: output.append("jsa0 "); break; case 0x0a4: output.append("jnsb0 "); break; case 0x0a6: output.append("jsb0 "); break; case 0x0a8: output.append("jnsa1 "); break; case 0x0aa: output.append("jsa1 "); break; case 0x0ac: output.append("jnsb1 "); break; case 0x0ae: output.append("jsb1 "); break; case 0x0b0: output.append("jdpl0 "); break; case 0x0b1: output.append("jdpln0 "); break; case 0x0b2: output.append("jdplf "); break; case 0x0b3: output.append("jdplnf "); break; case 0x0b4: output.append("jnsiak "); break; case 0x0b6: output.append("jsiak "); break; case 0x0b8: output.append("jnsoak "); break; case 0x0ba: output.append("jsoak "); break; case 0x0bc: output.append("jnrqm "); break; case 0x0be: output.append("jrqm "); break; case 0x100: output.append("ljmp "); jp &= ~0x2000; break; case 0x101: output.append("hjmp "); jp |= 0x2000; break; case 0x140: output.append("lcall "); jp &= ~0x2000; break; case 0x141: output.append("hcall "); jp |= 0x2000; break; default: output.append("?????? "); break; } output.append("$", hex<4>(jp)); } if(type == 3) { //LD output.append("ld "); uint16 id = opcode >> 6; uint4 dst = opcode >> 0; output.append("$", hex<4>(id), ","); switch(dst) { case 0: output.append("non"); break; case 1: output.append("a" ); break; case 2: output.append("b" ); break; case 3: output.append("tr" ); break; case 4: output.append("dp" ); break; case 5: output.append("rp" ); break; case 6: output.append("dr" ); break; case 7: output.append("sr" ); break; case 8: output.append("sol"); break; case 9: output.append("som"); break; case 10: output.append("k" ); break; case 11: output.append("klr"); break; case 12: output.append("klm"); break; case 13: output.append("l" ); break; case 14: output.append("trb"); break; case 15: output.append("mem"); break; } } return output; } #endif gba/ppu/serialization.cpp000664 001750 001750 00000006075 12651764221 016636 0ustar00sergiosergio000000 000000 void PPU::serialize(serializer& s) { Thread::serialize(s); s.array(vram, 96 * 1024); s.array(pram, 512); s.integer(regs.control.bgmode); s.integer(regs.control.cgbmode); s.integer(regs.control.frame); s.integer(regs.control.hblank); s.integer(regs.control.objmapping); s.integer(regs.control.forceblank); for(auto& flag : regs.control.enable) s.integer(flag); for(auto& flag : regs.control.enablewindow) s.integer(flag); s.integer(regs.greenswap); s.integer(regs.status.vblank); s.integer(regs.status.hblank); s.integer(regs.status.vcoincidence); s.integer(regs.status.irqvblank); s.integer(regs.status.irqhblank); s.integer(regs.status.irqvcoincidence); s.integer(regs.status.vcompare); s.integer(regs.vcounter); for(auto& bg : regs.bg) { s.integer(bg.control.priority); s.integer(bg.control.characterbaseblock); s.integer(bg.control.mosaic); s.integer(bg.control.colormode); s.integer(bg.control.screenbaseblock); s.integer(bg.control.affinewrap); s.integer(bg.control.screensize); s.integer(bg.hoffset); s.integer(bg.voffset); s.integer(bg.pa); s.integer(bg.pb); s.integer(bg.pc); s.integer(bg.pd); s.integer(bg.x); s.integer(bg.y); s.integer(bg.lx); s.integer(bg.ly); s.integer(bg.vmosaic); s.integer(bg.hmosaic); s.integer(bg.id); } for(auto& window : regs.window) { s.integer(window.x1); s.integer(window.x2); s.integer(window.y1); s.integer(window.y2); } for(auto& windowflags : regs.windowflags) { for(auto& flag : windowflags.enable) s.integer(flag); } s.integer(regs.mosaic.bghsize); s.integer(regs.mosaic.bgvsize); s.integer(regs.mosaic.objhsize); s.integer(regs.mosaic.objvsize); for(auto& flag : regs.blend.control.above) s.integer(flag); for(auto& flag : regs.blend.control.below) s.integer(flag); s.integer(regs.blend.control.mode); s.integer(regs.blend.eva); s.integer(regs.blend.evb); s.integer(regs.blend.evy); for(unsigned l = 0; l < 6; l++) { for(unsigned p = 0; p < 240; p++) { auto& pixel = layer[l][p]; s.integer(pixel.enable); s.integer(pixel.priority); s.integer(pixel.color); s.integer(pixel.translucent); s.integer(pixel.mosaic); } } for(unsigned w = 0; w < 3; w++) { for(unsigned p = 0; p < 240; p++) { s.integer(windowmask[w][p]); } } for(auto& value : vmosaic) s.integer(value); for(auto& value : hmosaic) s.integer(value); for(auto& obj : object) { s.integer(obj.y); s.integer(obj.affine); s.integer(obj.affinesize); s.integer(obj.mode); s.integer(obj.mosaic); s.integer(obj.colors); s.integer(obj.shape); s.integer(obj.x); s.integer(obj.affineparam); s.integer(obj.hflip); s.integer(obj.vflip); s.integer(obj.size); s.integer(obj.character); s.integer(obj.priority); s.integer(obj.palette); s.integer(obj.width); s.integer(obj.height); } for(auto& par : objectparam) { s.integer(par.pa); s.integer(par.pb); s.integer(par.pc); s.integer(par.pd); } } libco/x86.c000664 001750 001750 00000005547 12651764221 013604 0ustar00sergiosergio000000 000000 /* libco.x86 (2009-10-12) author: byuu license: public domain */ #define LIBCO_C #include "libco.h" #include #include #ifdef __cplusplus extern "C" { #endif #if defined(_MSC_VER) #define fastcall __fastcall #elif defined(__GNUC__) #define fastcall __attribute__((fastcall)) #else #error "libco: please define fastcall macro" #endif static thread_local long co_active_buffer[64]; static thread_local cothread_t co_active_handle = 0; static void (fastcall *co_swap)(cothread_t, cothread_t) = 0; //ABI: fastcall static unsigned char co_swap_function[] = { 0x89, 0x22, /* mov [edx],esp */ 0x8b, 0x21, /* mov esp,[ecx] */ 0x58, /* pop eax */ 0x89, 0x6a, 0x04, /* mov [edx+0x04],ebp */ 0x89, 0x72, 0x08, /* mov [edx+0x08],esi */ 0x89, 0x7a, 0x0c, /* mov [edx+0x0c],edi */ 0x89, 0x5a, 0x10, /* mov [edx+0x10],ebx */ 0x8b, 0x69, 0x04, /* mov ebp,[ecx+0x04] */ 0x8b, 0x71, 0x08, /* mov esi,[ecx+0x08] */ 0x8b, 0x79, 0x0c, /* mov edi,[ecx+0x0c] */ 0x8b, 0x59, 0x10, /* mov ebx,[ecx+0x10] */ 0xff, 0xe0, /* jmp eax */ }; #ifdef _WIN32 #include void co_init(void) { DWORD old_privileges; VirtualProtect(co_swap_function, sizeof co_swap_function, PAGE_EXECUTE_READWRITE, &old_privileges); } #else #include #include void co_init(void) { unsigned long addr = (unsigned long)co_swap_function; unsigned long base = addr - (addr % sysconf(_SC_PAGESIZE)); unsigned long size = (addr - base) + sizeof co_swap_function; mprotect((void*)base, size, PROT_READ | PROT_WRITE | PROT_EXEC); } #endif static void crash(void) { assert(0); /* called only if cothread_t entrypoint returns */ } cothread_t co_active(void) { if(!co_active_handle) co_active_handle = &co_active_buffer; return co_active_handle; } cothread_t co_create(unsigned int size, void (*entrypoint)(void)) { cothread_t handle; if(!co_swap) { co_init(); co_swap = (void (fastcall*)(cothread_t, cothread_t))co_swap_function; } if(!co_active_handle) co_active_handle = &co_active_buffer; size += 256; /* allocate additional space for storage */ size &= ~15; /* align stack to 16-byte boundary */ if((handle = (cothread_t)malloc(size))) { long *p = (long*)((char*)handle + size); /* seek to top of stack */ *--p = (long)crash; /* crash if entrypoint returns */ *--p = (long)entrypoint; /* start of function */ *(long*)handle = (long)p; /* stack pointer */ } return handle; } void co_delete(cothread_t handle) { free(handle); } void co_switch(cothread_t handle) { register cothread_t co_previous_handle = co_active_handle; co_swap(co_active_handle = handle, co_previous_handle); } #ifdef __cplusplus } #endif ruby/input/joypad/000700 001750 001750 00000000000 12656700342 015301 5ustar00sergiosergio000000 000000 gb/cartridge/mbc2/mbc2.cpp000664 001750 001750 00000001720 12651764221 016416 0ustar00sergiosergio000000 000000 #ifdef CARTRIDGE_CPP uint8 Cartridge::MBC2::mmio_read(uint16 addr) { if((addr & 0xc000) == 0x0000) { //$0000-3fff return cartridge.rom_read(addr); } if((addr & 0xc000) == 0x4000) { //$4000-7fff return cartridge.rom_read((rom_select << 14) | (addr & 0x3fff)); } if((addr & 0xee00) == 0xa000) { //$a000-a1ff if(ram_enable) return cartridge.ram_read(addr & 0x1ff); return 0x00; } return 0x00; } void Cartridge::MBC2::mmio_write(uint16 addr, uint8 data) { if((addr & 0xe000) == 0x0000) { //$0000-1fff if(!(addr & 0x0100)) ram_enable = (data & 0x0f) == 0x0a; return; } if((addr & 0xe000) == 0x2000) { //$2000-3fff if( (addr & 0x0100)) rom_select = (data & 0x0f) + ((data & 0x0f) == 0); return; } if((addr & 0xee00) == 0xa000) { //$a000-a1ff if(ram_enable) cartridge.ram_write(addr & 0x1ff, data & 0x0f); return; } } void Cartridge::MBC2::power() { ram_enable = false; rom_select = 0x01; } #endif target-ethos/tools/000700 001750 001750 00000000000 12656700342 015441 5ustar00sergiosergio000000 000000 nall/beat/multi.hpp000664 001750 001750 00000015617 12651764221 015426 0ustar00sergiosergio000000 000000 #ifndef NALL_BEAT_MULTI_HPP #define NALL_BEAT_MULTI_HPP #include #include #include namespace nall { struct bpsmulti { enum : unsigned { CreatePath = 0, CreateFile = 1, ModifyFile = 2, MirrorFile = 3, }; enum : unsigned { OriginSource = 0, OriginTarget = 1, }; bool create(const string& patchName, const string& sourcePath, const string& targetPath, bool delta = false, const string& metadata = "") { if(fp.open()) fp.close(); fp.open(patchName, file::mode::write); checksum = ~0; writeString("BPM1"); //signature writeNumber(metadata.length()); writeString(metadata); lstring sourceList, targetList; ls(sourceList, sourcePath, sourcePath); ls(targetList, targetPath, targetPath); for(auto& targetName : targetList) { if(targetName.endsWith("/")) { targetName.rtrim<1>("/"); writeNumber(CreatePath | ((targetName.length() - 1) << 2)); writeString(targetName); } else if(auto position = sourceList.find(targetName)) { //if sourceName == targetName file sp, dp; sp.open({sourcePath, targetName}, file::mode::read); dp.open({targetPath, targetName}, file::mode::read); bool identical = sp.size() == dp.size(); uint32_t cksum = ~0; for(unsigned n = 0; n < sp.size(); n++) { uint8_t byte = sp.read(); if(identical && byte != dp.read()) identical = false; cksum = crc32_adjust(cksum, byte); } if(identical) { writeNumber(MirrorFile | ((targetName.length() - 1) << 2)); writeString(targetName); writeNumber(OriginSource); writeChecksum(~cksum); } else { writeNumber(ModifyFile | ((targetName.length() - 1) << 2)); writeString(targetName); writeNumber(OriginSource); if(delta == false) { bpslinear patch; patch.source({sourcePath, targetName}); patch.target({targetPath, targetName}); patch.create({temppath(), "temp.bps"}); } else { bpsdelta patch; patch.source({sourcePath, targetName}); patch.target({targetPath, targetName}); patch.create({temppath(), "temp.bps"}); } auto buffer = file::read({temppath(), "temp.bps"}); writeNumber(buffer.size()); for(auto &byte : buffer) write(byte); } } else { writeNumber(CreateFile | ((targetName.length() - 1) << 2)); writeString(targetName); auto buffer = file::read({targetPath, targetName}); writeNumber(buffer.size()); for(auto &byte : buffer) write(byte); writeChecksum(crc32_calculate(buffer.data(), buffer.size())); } } //checksum writeChecksum(~checksum); fp.close(); return true; } bool apply(const string& patchName, const string& sourcePath, const string& targetPath) { directory::remove(targetPath); //start with a clean directory directory::create(targetPath); if(fp.open()) fp.close(); fp.open(patchName, file::mode::read); checksum = ~0; if(readString(4) != "BPM1") return false; auto metadataLength = readNumber(); while(metadataLength--) read(); while(fp.offset() < fp.size() - 4) { auto encoding = readNumber(); unsigned action = encoding & 3; unsigned targetLength = (encoding >> 2) + 1; string targetName = readString(targetLength); if(action == CreatePath) { directory::create({targetPath, targetName, "/"}); } else if(action == CreateFile) { file fp; fp.open({targetPath, targetName}, file::mode::write); auto fileSize = readNumber(); while(fileSize--) fp.write(read()); uint32_t cksum = readChecksum(); } else if(action == ModifyFile) { auto encoding = readNumber(); string originPath = encoding & 1 ? targetPath : sourcePath; string sourceName = (encoding >> 1) == 0 ? targetName : readString(encoding >> 1); auto patchSize = readNumber(); vector buffer; buffer.resize(patchSize); for(unsigned n = 0; n < patchSize; n++) buffer[n] = read(); bpspatch patch; patch.modify(buffer.data(), buffer.size()); patch.source({originPath, sourceName}); patch.target({targetPath, targetName}); if(patch.apply() != bpspatch::result::success) return false; } else if(action == MirrorFile) { auto encoding = readNumber(); string originPath = encoding & 1 ? targetPath : sourcePath; string sourceName = (encoding >> 1) == 0 ? targetName : readString(encoding >> 1); file::copy({originPath, sourceName}, {targetPath, targetName}); uint32_t cksum = readChecksum(); } } uint32_t cksum = ~checksum; if(read() != (uint8_t)(cksum >> 0)) return false; if(read() != (uint8_t)(cksum >> 8)) return false; if(read() != (uint8_t)(cksum >> 16)) return false; if(read() != (uint8_t)(cksum >> 24)) return false; fp.close(); return true; } protected: file fp; uint32_t checksum; //create() functions void ls(lstring& list, const string& path, const string& basepath) { lstring paths = directory::folders(path); for(auto& pathname : paths) { list.append(string{path, pathname}.ltrim<1>(basepath)); ls(list, {path, pathname}, basepath); } lstring files = directory::files(path); for(auto& filename : files) { list.append(string{path, filename}.ltrim<1>(basepath)); } } void write(uint8_t data) { fp.write(data); checksum = crc32_adjust(checksum, data); } void writeNumber(uint64_t data) { while(true) { uint64_t x = data & 0x7f; data >>= 7; if(data == 0) { write(0x80 | x); break; } write(x); data--; } } void writeString(const string& text) { unsigned length = text.length(); for(unsigned n = 0; n < length; n++) write(text[n]); } void writeChecksum(uint32_t cksum) { write(cksum >> 0); write(cksum >> 8); write(cksum >> 16); write(cksum >> 24); } //apply() functions uint8_t read() { uint8_t data = fp.read(); checksum = crc32_adjust(checksum, data); return data; } uint64_t readNumber() { uint64_t data = 0, shift = 1; while(true) { uint8_t x = read(); data += (x & 0x7f) * shift; if(x & 0x80) break; shift <<= 7; data += shift; } return data; } string readString(unsigned length) { string text; text.reserve(length + 1); for(unsigned n = 0; n < length; n++) text[n] = read(); text[length] = 0; return text; } uint32_t readChecksum() { uint32_t checksum = 0; checksum |= read() << 0; checksum |= read() << 8; checksum |= read() << 16; checksum |= read() << 24; return checksum; } }; } #endif sfc/alt/ppu-balanced/000700 001750 001750 00000000000 12656700342 015561 5ustar00sergiosergio000000 000000 sfc/cpu/timing/timing.cpp000664 001750 001750 00000012501 12651764221 016533 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP #include "irq.cpp" #include "joypad.cpp" unsigned CPU::dma_counter() { return (status.dma_counter + hcounter()) & 7; } void CPU::add_clocks(unsigned clocks) { again: status.irq_lock = false; unsigned ticks = clocks >> 1; while(ticks--) { tick(); if(hcounter() & 2) poll_interrupts(); } step(clocks); status.auto_joypad_clock += clocks; if(status.auto_joypad_clock >= 256) { status.auto_joypad_clock -= 256; step_auto_joypad_poll(); } if(status.dram_refreshed == false && hcounter() >= status.dram_refresh_position) { status.dram_refreshed = true; clocks = 40; goto again; } #if defined(DEBUGGER) synchronize_smp(); synchronize_ppu(); synchronize_coprocessors(); #endif } //called by ppu.tick() when Hcounter=0 void CPU::scanline() { status.dma_counter = (status.dma_counter + status.line_clocks) & 7; status.line_clocks = lineclocks(); //forcefully sync S-CPU to other processors, in case chips are not communicating synchronize_smp(); synchronize_ppu(); synchronize_coprocessors(); system.scanline(); if(vcounter() == 0) { //HDMA init triggers once every frame status.hdma_init_position = (cpu_version == 1 ? 12 + 8 - dma_counter() : 12 + dma_counter()); status.hdma_init_triggered = false; status.auto_joypad_counter = 0; } //DRAM refresh occurs once every scanline if(cpu_version == 2) status.dram_refresh_position = 530 + 8 - dma_counter(); status.dram_refreshed = false; //HDMA triggers once every visible scanline if(vcounter() <= (ppu.overscan() == false ? 224 : 239)) { status.hdma_position = 1104; status.hdma_triggered = false; } } void CPU::alu_edge() { if(alu.mpyctr) { alu.mpyctr--; if(status.rddiv & 1) status.rdmpy += alu.shift; status.rddiv >>= 1; alu.shift <<= 1; } if(alu.divctr) { alu.divctr--; status.rddiv <<= 1; alu.shift >>= 1; if(status.rdmpy >= alu.shift) { status.rdmpy -= alu.shift; status.rddiv |= 1; } } } void CPU::dma_edge() { //H/DMA pending && DMA inactive? //.. Run one full CPU cycle //.. HDMA pending && HDMA enabled ? DMA sync + HDMA run //.. DMA pending && DMA enabled ? DMA sync + DMA run //.... HDMA during DMA && HDMA enabled ? DMA sync + HDMA run //.. Run one bus CPU cycle //.. CPU sync if(status.dma_active == true) { if(status.hdma_pending) { status.hdma_pending = false; if(hdma_enabled_channels()) { if(!dma_enabled_channels()) { dma_add_clocks(8 - dma_counter()); } status.hdma_mode == 0 ? hdma_init() : hdma_run(); if(!dma_enabled_channels()) { add_clocks(status.clock_count - (status.dma_clocks % status.clock_count)); status.dma_active = false; } } } if(status.dma_pending) { status.dma_pending = false; if(dma_enabled_channels()) { dma_add_clocks(8 - dma_counter()); dma_run(); add_clocks(status.clock_count - (status.dma_clocks % status.clock_count)); status.dma_active = false; } } } if(status.hdma_init_triggered == false && hcounter() >= status.hdma_init_position) { status.hdma_init_triggered = true; hdma_init_reset(); if(hdma_enabled_channels()) { status.hdma_pending = true; status.hdma_mode = 0; } } if(status.hdma_triggered == false && hcounter() >= status.hdma_position) { status.hdma_triggered = true; if(hdma_active_channels()) { status.hdma_pending = true; status.hdma_mode = 1; } } if(status.dma_active == false) { if(status.dma_pending || status.hdma_pending) { status.dma_clocks = 0; status.dma_active = true; } } } //used to test for NMI/IRQ, which can trigger on the edge of every opcode. //test one cycle early to simulate two-stage pipeline of x816 CPU. // //status.irq_lock is used to simulate hardware delay before interrupts can //trigger during certain events (immediately after DMA, writes to $4200, etc) void CPU::last_cycle() { if(status.irq_lock == false) { status.nmi_pending |= nmi_test(); status.irq_pending |= irq_test(); status.interrupt_pending = (status.nmi_pending || status.irq_pending); } } void CPU::timing_power() { } void CPU::timing_reset() { status.clock_count = 0; status.line_clocks = lineclocks(); status.irq_lock = false; status.dram_refresh_position = (cpu_version == 1 ? 530 : 538); status.dram_refreshed = false; status.hdma_init_position = (cpu_version == 1 ? 12 + 8 - dma_counter() : 12 + dma_counter()); status.hdma_init_triggered = false; status.hdma_position = 1104; status.hdma_triggered = false; status.nmi_valid = false; status.nmi_line = false; status.nmi_transition = false; status.nmi_pending = false; status.nmi_hold = false; status.irq_valid = false; status.irq_line = false; status.irq_transition = false; status.irq_pending = false; status.irq_hold = false; status.reset_pending = true; status.interrupt_pending = true; status.dma_active = false; status.dma_counter = 0; status.dma_clocks = 0; status.dma_pending = false; status.hdma_pending = false; status.hdma_mode = 0; status.auto_joypad_active = false; status.auto_joypad_latch = false; status.auto_joypad_counter = 0; status.auto_joypad_clock = 0; } #endif phoenix/windows/object.cpp000664 001750 001750 00000000520 12651764221 017023 0ustar00sergiosergio000000 000000 namespace phoenix { vector pObject::objects; pObject::pObject(Object& object) : object(object) { static unsigned uniqueId = 100; objects.append(this); id = uniqueId++; locked = false; } Object* pObject::find(unsigned id) { for(auto& item : objects) if(item->id == id) return &item->object; return nullptr; } } phoenix/reference/widget/radio-button.hpp000664 001750 001750 00000000612 12651764221 021722 0ustar00sergiosergio000000 000000 namespace phoenix { struct pRadioButton : public pWidget { RadioButton& radioButton; void setChecked(); void setGroup(const group& group); void setImage(const image& image, Orientation orientation); void setText(string text); pRadioButton(RadioButton& radioButton) : pWidget(radioButton), radioButton(radioButton) {} void constructor(); void destructor(); }; } phoenix/core/layout/horizontal-layout.hpp000664 001750 001750 00000001240 12651764221 022041 0ustar00sergiosergio000000 000000 struct HorizontalLayout : public Layout { void append(Sizable& sizable, Size size, unsigned spacing = 0); void append(Sizable& sizable); Size minimumSize(); void remove(Sizable& sizable); void reset(); void setAlignment(double alignment); void setEnabled(bool enabled = true); void setGeometry(Geometry geometry); void setMargin(unsigned margin); void setVisible(bool visible = true); void synchronizeLayout(); ~HorizontalLayout(); //private: struct State { double alignment = 0.5; unsigned margin = 0; } state; struct Children { Sizable* sizable; unsigned width, height, spacing; }; nall::vector children; }; nall/string/markup/000700 001750 001750 00000000000 12656700342 015426 5ustar00sergiosergio000000 000000 phoenix/cocoa/widget/widget.cpp000664 001750 001750 00000003416 12651764221 017724 0ustar00sergiosergio000000 000000 namespace phoenix { bool pWidget::enabled() { @autoreleasepool { return [cocoaView respondsToSelector:@selector(enabled)] && [cocoaView enabled]; } } bool pWidget::focused() { @autoreleasepool { return cocoaView == [[cocoaView window] firstResponder]; } } Size pWidget::minimumSize() { return {0, 0}; } void pWidget::setEnabled(bool enabled) { if(!widget.parent()) enabled = false; if(widget.state.abstract) enabled = false; if(!widget.enabledToAll()) enabled = false; @autoreleasepool { if([cocoaView respondsToSelector:@selector(setEnabled:)]) { [cocoaView setEnabled:enabled]; } } } void pWidget::setFocused() { @autoreleasepool { [[cocoaView window] makeFirstResponder:cocoaView]; } } void pWidget::setFont(string font) { @autoreleasepool { if([cocoaView respondsToSelector:@selector(setFont:)]) { [cocoaView setFont:pFont::cocoaFont(font)]; } } } void pWidget::setGeometry(Geometry geometry) { @autoreleasepool { CGFloat windowHeight = [[cocoaView superview] frame].size.height; [cocoaView setFrame:NSMakeRect(geometry.x, windowHeight - geometry.y - geometry.height, geometry.width, geometry.height)]; [[cocoaView superview] setNeedsDisplay:YES]; } if(widget.onSize) widget.onSize(); } void pWidget::setVisible(bool visible) { if(!widget.parent()) visible = false; if(widget.state.abstract) visible = false; if(!widget.visibleToAll()) visible = false; @autoreleasepool { [cocoaView setHidden:!visible]; } } void pWidget::constructor() { if(!widget.state.abstract) return; @autoreleasepool { cocoaView = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)]; [cocoaView setHidden:true]; } } void pWidget::destructor() { @autoreleasepool { [cocoaView release]; } } } gba/ppu/memory.cpp000664 001750 001750 00000007465 12651764221 015275 0ustar00sergiosergio000000 000000 uint32 PPU::vram_read(uint32 addr, uint32 size) { addr &= (addr & 0x10000) ? 0x17fff : 0x0ffff; switch(size) { case Word: addr &= ~3; return vram[addr + 0] << 0 | vram[addr + 1] << 8 | vram[addr + 2] << 16 | vram[addr + 3] << 24; case Half: addr &= ~1; return vram[addr + 0] << 0 | vram[addr + 1] << 8; case Byte: return vram[addr]; } } void PPU::vram_write(uint32 addr, uint32 size, uint32 word) { addr &= (addr & 0x10000) ? 0x17fff : 0x0ffff; switch(size) { case Word: addr &= ~3; vram[addr + 0] = word >> 0; vram[addr + 1] = word >> 8; vram[addr + 2] = word >> 16; vram[addr + 3] = word >> 24; break; case Half: addr &= ~1; vram[addr + 0] = word >> 0; vram[addr + 1] = word >> 8; break; case Byte: addr &= ~1; vram[addr + 0] = word; vram[addr + 1] = word; break; } } uint32 PPU::pram_read(uint32 addr, uint32 size) { if(size == Word) return pram_read(addr & ~2, Half) << 0 | pram_read(addr | 2, Half) << 16; if(size == Byte) return pram_read(addr, Half) >> ((addr & 1) * 8); return pram[addr >> 1 & 511]; } void PPU::pram_write(uint32 addr, uint32 size, uint32 word) { if(size == Word) { pram_write(addr & ~2, Half, word >> 0); pram_write(addr | 2, Half, word >> 16); return; } if(size == Byte) { return pram_write(addr, Half, word << 8 | word << 0); } pram[addr >> 1 & 511] = word & 0x7fff; } uint32 PPU::oam_read(uint32 addr, uint32 size) { if(size == Word) return oam_read(addr & ~2, Half) << 0 | oam_read(addr | 2, Half) << 16; if(size == Byte) return oam_read(addr, Half) >> ((addr & 1) * 8); auto& obj = object[addr >> 3 & 127]; auto& par = objectparam[addr >> 5 & 31]; switch(addr & 6) { case 0: return ( (obj.y << 0) | (obj.affine << 8) | (obj.affinesize << 9) | (obj.mode << 10) | (obj.mosaic << 12) | (obj.colors << 13) | (obj.shape << 14) ); case 2: return ( (obj.x << 0) | (obj.affineparam << 9) | (obj.hflip << 12) | (obj.vflip << 13) | (obj.size << 14) ); case 4: return ( (obj.character << 0) | (obj.priority << 10) | (obj.palette << 12) ); case 6: switch(addr >> 3 & 3) { case 0: return par.pa; case 1: return par.pb; case 2: return par.pc; case 3: return par.pd; } } } void PPU::oam_write(uint32 addr, uint32 size, uint32 word) { if(size == Word) { oam_write(addr & ~2, Half, word >> 0); oam_write(addr | 2, Half, word >> 16); return; } if(size == Byte) { return oam_write(addr, Half, word << 8 | word << 0); } auto& obj = object[addr >> 3 & 127]; auto& par = objectparam[addr >> 5 & 31]; switch(addr & 6) { case 0: obj.y = word >> 0; obj.affine = word >> 8; obj.affinesize = word >> 9; obj.mode = word >> 10; obj.mosaic = word >> 12; obj.colors = word >> 13; obj.shape = word >> 14; break; case 2: obj.x = word >> 0; obj.affineparam = word >> 9; obj.hflip = word >> 12; obj.vflip = word >> 13; obj.size = word >> 14; break; case 4: obj.character = word >> 0; obj.priority = word >> 10; obj.palette = word >> 12; break; case 6: switch(addr >> 3 & 3) { case 0: par.pa = word; break; case 1: par.pb = word; break; case 2: par.pc = word; break; case 3: par.pd = word; break; } } static unsigned widths[] = { 8, 16, 32, 64, 16, 32, 32, 64, 8, 8, 16, 32, 8, 8, 8, 8, //invalid modes }; static unsigned heights[] = { 8, 16, 32, 64, 8, 8, 16, 32, 16, 32, 32, 64, 8, 8, 8, 8, //invalid modes }; obj.width = widths [obj.shape * 4 + obj.size]; obj.height = heights[obj.shape * 4 + obj.size]; } target-ethos/settings/input.cpp000664 001750 001750 00000014355 12651764221 020031 0ustar00sergiosergio000000 000000 InputSettings* inputSettings = nullptr; InputSettings::InputSettings() { focusLabel.setText("When Focus is Lost:"); focusPause.setText("Pause Emulation"); focusAllow.setText("Allow Input"); inputList.setHeaderText({"Name", "Mapping"}); inputList.setHeaderVisible(); resetButton.setText("Reset"); eraseButton.setText("Erase"); append(focusLayout, {~0, 0}, 5); focusLayout.append(focusLabel, {0, 0}, 5); focusLayout.append(focusPause, {0, 0}, 5); focusLayout.append(focusAllow, {0, 0}); append(selectionLayout, {~0, 0}, 5); selectionLayout.append(systemList, {~0, 0}, 5); selectionLayout.append(portList, {~0, 0}, 5); selectionLayout.append(deviceList, {~0, 0}); append(inputList, {~0, ~0}, 5); append(controlLayout, {~0, 0}); controlLayout.append(assign[0], {100, 0}, 5); controlLayout.append(assign[1], {100, 0}, 5); controlLayout.append(assign[2], {100, 0}, 5); controlLayout.append(spacer, {~0, 0}); controlLayout.append(resetButton, {80, 0}, 5); controlLayout.append(eraseButton, {80, 0}); for(auto& emulator : program->emulator) { systemList.append(emulator->information.name); } focusPause.setChecked(config->input.focus.pause); focusAllow.setChecked(config->input.focus.allow); focusAllow.setEnabled(!config->input.focus.pause); focusPause.onToggle = [&] { config->input.focus.pause = focusPause.checked(); focusAllow.setEnabled(!focusPause.checked()); }; focusAllow.onToggle = [&] { config->input.focus.allow = focusAllow.checked(); }; systemList.onChange = {&InputSettings::systemChanged, this}; portList.onChange = {&InputSettings::portChanged, this}; deviceList.onChange = {&InputSettings::deviceChanged, this}; inputList.onChange = {&InputSettings::synchronize, this}; inputList.onActivate = {&InputSettings::assignInput, this}; assign[0].onActivate = [&] { assignMouseInput(0); }; assign[1].onActivate = [&] { assignMouseInput(1); }; assign[2].onActivate = [&] { assignMouseInput(2); }; resetButton.onActivate = {&InputSettings::resetInput, this}; eraseButton.onActivate = {&InputSettings::eraseInput, this}; systemChanged(); } void InputSettings::synchronize() { if(inputList.selected() == false) { assign[0].setVisible(false); assign[1].setVisible(false); assign[2].setVisible(false); } else { unsigned number = activeDevice().order[inputList.selection()]; auto& input = activeDevice().input[number]; auto selectedInput = inputManager->inputMap[input.guid]; if(dynamic_cast(selectedInput)) { assign[0].setText("Mouse Left"); assign[1].setText("Mouse Middle"); assign[2].setText("Mouse Right"); assign[0].setVisible(true); assign[1].setVisible(true); assign[2].setVisible(true); } if(dynamic_cast(selectedInput)) { assign[0].setText("Mouse X-axis"); assign[1].setText("Mouse Y-axis"); assign[0].setVisible(true); assign[1].setVisible(true); assign[2].setVisible(false); } } eraseButton.setEnabled(inputList.selected()); } Emulator::Interface& InputSettings::activeSystem() { return *program->emulator[systemList.selection()]; } Emulator::Interface::Port& InputSettings::activePort() { return activeSystem().port[portList.selection()]; } Emulator::Interface::Device& InputSettings::activeDevice() { return activePort().device[deviceList.selection()]; } void InputSettings::systemChanged() { portList.reset(); for(auto& port : activeSystem().port) { portList.append(port.name); } portChanged(); } void InputSettings::portChanged() { deviceList.reset(); for(auto& device : activePort().device) { deviceList.append(device.name); } deviceChanged(); } void InputSettings::deviceChanged() { inputList.reset(); for(unsigned number : activeDevice().order) inputList.append({"", ""}); inputChanged(); synchronize(); } void InputSettings::inputChanged() { unsigned index = 0; for(unsigned number : activeDevice().order) { auto& input = activeDevice().input[number]; auto abstract = inputManager->inputMap(input.guid); string mapping = inputManager->sanitize(abstract->mapping, " or "); inputList.setText(index++, {input.name, mapping}); } } void InputSettings::resetInput() { if(MessageWindow().setParent(*settings).setText("All inputs will be erased. Are you sure you want to do this?") .question() == MessageWindow::Response::No) return; auto& device = activeDevice(); unsigned length = device.input.size(); for(unsigned n = 0; n < length; n++) { activeInput = inputManager->inputMap[device.input[n].guid]; inputEvent(hidNull, 0, 0, 0, 1); } } void InputSettings::eraseInput() { unsigned number = activeDevice().order[inputList.selection()]; auto& input = activeDevice().input[number]; activeInput = inputManager->inputMap[input.guid]; inputEvent(hidNull, 0, 0, 0, 1); } void InputSettings::assignInput() { unsigned number = activeDevice().order[inputList.selection()]; auto& input = activeDevice().input[number]; activeInput = inputManager->inputMap[input.guid]; settings->setStatusText({"Set assignment for [", activeDevice().name, "::", input.name, "] ..."}); settings->layout.setEnabled(false); setEnabled(false); } void InputSettings::assignMouseInput(unsigned n) { unsigned number = activeDevice().order[inputList.selection()]; auto& input = activeDevice().input[number]; activeInput = inputManager->inputMap[input.guid]; if(dynamic_cast(activeInput)) { if(auto hidMouse = inputManager->findMouse()) { return inputEvent(*hidMouse, HID::Mouse::GroupID::Button, n, 0, 1, true); } } if(dynamic_cast(activeInput)) { if(auto hidMouse = inputManager->findMouse()) { return inputEvent(*hidMouse, HID::Mouse::GroupID::Axis, n, 0, +32767, true); } } } void InputSettings::inputEvent(HID::Device& device, unsigned group, unsigned input, int16_t oldValue, int16_t newValue, bool allowMouseInput) { if(activeInput == nullptr) return; if(allowMouseInput == false && device.isMouse()) return; if(activeInput->bind(device, group, input, oldValue, newValue) == false) return; activeInput = nullptr; inputChanged(); settings->setStatusText(""); settings->layout.setEnabled(true); setEnabled(true); synchronize(); } sfc/alt/ppu-balanced/render/cache.cpp000664 001750 001750 00000010402 12651764221 020621 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP #define render_bg_tile_line_2bpp(mask) \ col = !!(d0 & mask) << 0; \ col += !!(d1 & mask) << 1; \ *dest++ = col #define render_bg_tile_line_4bpp(mask) \ col = !!(d0 & mask) << 0; \ col += !!(d1 & mask) << 1; \ col += !!(d2 & mask) << 2; \ col += !!(d3 & mask) << 3; \ *dest++ = col #define render_bg_tile_line_8bpp(mask) \ col = !!(d0 & mask) << 0; \ col += !!(d1 & mask) << 1; \ col += !!(d2 & mask) << 2; \ col += !!(d3 & mask) << 3; \ col += !!(d4 & mask) << 4; \ col += !!(d5 & mask) << 5; \ col += !!(d6 & mask) << 6; \ col += !!(d7 & mask) << 7; \ *dest++ = col template void PPU::render_bg_tile(uint16 tile_num) { uint8 col, d0, d1, d2, d3, d4, d5, d6, d7; if(color_depth == COLORDEPTH_4) { uint8* dest = (uint8*)bg_tiledata[TILE_2BIT] + tile_num * 64; unsigned pos = tile_num * 16; unsigned y = 8; while(y--) { d0 = vram[pos ]; d1 = vram[pos + 1]; render_bg_tile_line_2bpp(0x80); render_bg_tile_line_2bpp(0x40); render_bg_tile_line_2bpp(0x20); render_bg_tile_line_2bpp(0x10); render_bg_tile_line_2bpp(0x08); render_bg_tile_line_2bpp(0x04); render_bg_tile_line_2bpp(0x02); render_bg_tile_line_2bpp(0x01); pos += 2; } bg_tiledata_state[TILE_2BIT][tile_num] = 0; } if(color_depth == COLORDEPTH_16) { uint8* dest = (uint8*)bg_tiledata[TILE_4BIT] + tile_num * 64; unsigned pos = tile_num * 32; unsigned y = 8; while(y--) { d0 = vram[pos ]; d1 = vram[pos + 1]; d2 = vram[pos + 16]; d3 = vram[pos + 17]; render_bg_tile_line_4bpp(0x80); render_bg_tile_line_4bpp(0x40); render_bg_tile_line_4bpp(0x20); render_bg_tile_line_4bpp(0x10); render_bg_tile_line_4bpp(0x08); render_bg_tile_line_4bpp(0x04); render_bg_tile_line_4bpp(0x02); render_bg_tile_line_4bpp(0x01); pos += 2; } bg_tiledata_state[TILE_4BIT][tile_num] = 0; } if(color_depth == COLORDEPTH_256) { uint8* dest = (uint8*)bg_tiledata[TILE_8BIT] + tile_num * 64; unsigned pos = tile_num * 64; unsigned y = 8; while(y--) { d0 = vram[pos ]; d1 = vram[pos + 1]; d2 = vram[pos + 16]; d3 = vram[pos + 17]; d4 = vram[pos + 32]; d5 = vram[pos + 33]; d6 = vram[pos + 48]; d7 = vram[pos + 49]; render_bg_tile_line_8bpp(0x80); render_bg_tile_line_8bpp(0x40); render_bg_tile_line_8bpp(0x20); render_bg_tile_line_8bpp(0x10); render_bg_tile_line_8bpp(0x08); render_bg_tile_line_8bpp(0x04); render_bg_tile_line_8bpp(0x02); render_bg_tile_line_8bpp(0x01); pos += 2; } bg_tiledata_state[TILE_8BIT][tile_num] = 0; } } #undef render_bg_tile_line_2bpp #undef render_bg_tile_line_4bpp #undef render_bg_tile_line_8bpp void PPU::flush_pixel_cache() { uint16 main = get_palette(0); uint16 sub = (regs.pseudo_hires || regs.bg_mode == 5 || regs.bg_mode == 6) ? main : regs.color_rgb; unsigned i = 255; do { pixel_cache[i].src_main = main; pixel_cache[i].src_sub = sub; pixel_cache[i].bg_main = BACK; pixel_cache[i].bg_sub = BACK; pixel_cache[i].ce_main = false; pixel_cache[i].ce_sub = false; pixel_cache[i].pri_main = 0; pixel_cache[i].pri_sub = 0; } while(i--); } void PPU::alloc_tiledata_cache() { bg_tiledata[TILE_2BIT] = new uint8_t[262144](); bg_tiledata[TILE_4BIT] = new uint8_t[131072](); bg_tiledata[TILE_8BIT] = new uint8_t[ 65536](); bg_tiledata_state[TILE_2BIT] = new uint8_t[ 4096](); bg_tiledata_state[TILE_4BIT] = new uint8_t[ 2048](); bg_tiledata_state[TILE_8BIT] = new uint8_t[ 1024](); } //marks all tiledata cache entries as dirty void PPU::flush_tiledata_cache() { for(unsigned i = 0; i < 4096; i++) bg_tiledata_state[TILE_2BIT][i] = 1; for(unsigned i = 0; i < 2048; i++) bg_tiledata_state[TILE_4BIT][i] = 1; for(unsigned i = 0; i < 1024; i++) bg_tiledata_state[TILE_8BIT][i] = 1; } void PPU::free_tiledata_cache() { delete[] bg_tiledata[TILE_2BIT]; delete[] bg_tiledata[TILE_4BIT]; delete[] bg_tiledata[TILE_8BIT]; delete[] bg_tiledata_state[TILE_2BIT]; delete[] bg_tiledata_state[TILE_4BIT]; delete[] bg_tiledata_state[TILE_8BIT]; } #endif ananke/resource/folder.png000664 001750 001750 00000002230 12651764221 016752 0ustar00sergiosergio000000 000000 PNG  IHDR szzsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<IDATX=oE3w{90 V !SnZ:>@$>@JDhCH@ɊE(wޗ{:wrR(Kvvvy~<3" C^k_nܸ+~6ƼwBZÇ\@[J坛7oIZ 0?;wѣG+PJejtp-5!Gh,ĥKc֞ \̄jZ?<aTnH(sd<TZeDKȍE-n/D[ZT J>D%T/l,4> SzQJ  cѿBS^/| 6kd%5J_<^TR N R8ݝ;>3$!J WToV)iR $UziU*$AX;XhbggDbpdDC$v- xxQˡLgX?515k`mZt8)\ȍ1*Kky>:a[BH `|S@ 0 ,-27+IENDB`phoenix/cocoa/action/separator.cpp000664 001750 001750 00000000363 12651764221 020431 0ustar00sergiosergio000000 000000 namespace phoenix { void pSeparator::constructor() { @autoreleasepool { cocoaAction = cocoaSeparator = [[NSMenuItem separatorItem] retain]; } } void pSeparator::destructor() { @autoreleasepool { [cocoaAction release]; } } } nall/smtp.hpp000664 001750 001750 00000020704 12651764221 014335 0ustar00sergiosergio000000 000000 #ifndef NALL_SMTP_HPP #define NALL_SMTP_HPP #include #include #include #if !defined(_WIN32) #include #include #include #include #else #include #include #include #endif namespace nall { struct SMTP { enum class Format : unsigned { Plain, HTML }; inline void server(string server, uint16_t port = 25); inline void from(string mail, string name = ""); inline void to(string mail, string name = ""); inline void cc(string mail, string name = ""); inline void bcc(string mail, string name = ""); inline void attachment(const uint8_t* data, unsigned size, string name); inline bool attachment(string filename, string name = ""); inline void subject(string subject); inline void body(string body, Format format = Format::Plain); inline bool send(); inline string message(); inline string response(); #ifdef _WIN32 inline int close(int); inline SMTP(); #endif private: struct Information { string server; uint16_t port; struct Contact { string mail; string name; }; Contact from; vector to; vector cc; vector bcc; struct Attachment { vector buffer; string name; }; string subject; string body; Format format = Format::Plain; vector attachments; string message; string response; } info; inline bool send(int sock, const string& text); inline string recv(int sock); inline string boundary(); inline string filename(const string& filename); inline string contact(const Information::Contact& contact); inline string contacts(const vector& contacts); inline string split(const string& text); }; void SMTP::server(string server, uint16_t port) { info.server = server; info.port = port; } void SMTP::from(string mail, string name) { info.from = {mail, name}; } void SMTP::to(string mail, string name) { info.to.append({mail, name}); } void SMTP::cc(string mail, string name) { info.cc.append({mail, name}); } void SMTP::bcc(string mail, string name) { info.bcc.append({mail, name}); } void SMTP::attachment(const uint8_t* data, unsigned size, string name) { vector buffer; buffer.resize(size); memcpy(buffer.data(), data, size); info.attachments.append({std::move(buffer), name}); } bool SMTP::attachment(string filename, string name) { if(!file::exists(filename)) return false; if(name == "") name = notdir(filename); auto buffer = file::read(filename); info.attachments.append({std::move(buffer), name}); return true; } void SMTP::subject(string subject) { info.subject = subject; } void SMTP::body(string body, Format format) { info.body = body; info.format = format; } bool SMTP::send() { info.message.append("From: =?UTF-8?B?", Base64::encode(contact(info.from)), "?=\r\n"); info.message.append("To: =?UTF-8?B?", Base64::encode(contacts(info.to)), "?=\r\n"); info.message.append("Cc: =?UTF-8?B?", Base64::encode(contacts(info.cc)), "?=\r\n"); info.message.append("Subject: =?UTF-8?B?", Base64::encode(info.subject), "?=\r\n"); string uniqueID = boundary(); info.message.append("MIME-Version: 1.0\r\n"); info.message.append("Content-Type: multipart/mixed; boundary=", uniqueID, "\r\n"); info.message.append("\r\n"); string format = (info.format == Format::Plain ? "text/plain" : "text/html"); info.message.append("--", uniqueID, "\r\n"); info.message.append("Content-Type: ", format, "; charset=UTF-8\r\n"); info.message.append("Content-Transfer-Encoding: base64\r\n"); info.message.append("\r\n"); info.message.append(split(Base64::encode(info.body)), "\r\n"); info.message.append("\r\n"); for(auto& attachment : info.attachments) { info.message.append("--", uniqueID, "\r\n"); info.message.append("Content-Type: application/octet-stream\r\n"); info.message.append("Content-Transfer-Encoding: base64\r\n"); info.message.append("Content-Disposition: attachment; size=", attachment.buffer.size(), "; filename*=UTF-8''", filename(attachment.name), "\r\n"); info.message.append("\r\n"); info.message.append(split(Base64::encode(attachment.buffer)), "\r\n"); info.message.append("\r\n"); } info.message.append("--", uniqueID, "--\r\n"); addrinfo hints; memset(&hints, 0, sizeof(addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; addrinfo* serverinfo; int status = getaddrinfo(info.server, string(info.port), &hints, &serverinfo); if(status != 0) return false; int sock = socket(serverinfo->ai_family, serverinfo->ai_socktype, serverinfo->ai_protocol); if(sock == -1) return false; int result = connect(sock, serverinfo->ai_addr, serverinfo->ai_addrlen); if(result == -1) return false; string response; info.response.append(response = recv(sock)); if(!response.beginswith("220 ")) { close(sock); return false; } send(sock, {"HELO ", info.server, "\r\n"}); info.response.append(response = recv(sock)); if(!response.beginswith("250 ")) { close(sock); return false; } send(sock, {"MAIL FROM: <", info.from.mail, ">\r\n"}); info.response.append(response = recv(sock)); if(!response.beginswith("250 ")) { close(sock); return false; } for(auto& contact : info.to) { send(sock, {"RCPT TO: <", contact.mail, ">\r\n"}); info.response.append(response = recv(sock)); if(!response.beginswith("250 ")) { close(sock); return false; } } for(auto& contact : info.cc) { send(sock, {"RCPT TO: <", contact.mail, ">\r\n"}); info.response.append(response = recv(sock)); if(!response.beginswith("250 ")) { close(sock); return false; } } for(auto& contact : info.bcc) { send(sock, {"RCPT TO: <", contact.mail, ">\r\n"}); info.response.append(response = recv(sock)); if(!response.beginswith("250 ")) { close(sock); return false; } } send(sock, {"DATA\r\n"}); info.response.append(response = recv(sock)); if(!response.beginswith("354 ")) { close(sock); return false; } send(sock, {info.message, "\r\n", ".\r\n"}); info.response.append(response = recv(sock)); if(!response.beginswith("250 ")) { close(sock); return false; } send(sock, {"QUIT\r\n"}); info.response.append(response = recv(sock)); //if(!response.beginswith("221 ")) { close(sock); return false; } close(sock); return true; } string SMTP::message() { return info.message; } string SMTP::response() { return info.response; } bool SMTP::send(int sock, const string& text) { const char* data = text.data(); unsigned size = text.size(); while(size) { int length = ::send(sock, (const char*)data, size, 0); if(length == -1) return false; data += length; size -= length; } return true; } string SMTP::recv(int sock) { vector buffer; while(true) { char c; if(::recv(sock, &c, sizeof(char), 0) < 1) break; buffer.append(c); if(c == '\n') break; } buffer.append(0); return buffer; } string SMTP::boundary() { random_lfsr random; random.seed(time(0)); string boundary; for(unsigned n = 0; n < 16; n++) boundary.append(hex<2>(random())); return boundary; } string SMTP::filename(const string& filename) { string result; for(auto& n : filename) { if(n <= 32 || n >= 127) result.append("%", hex<2>(n)); else result.append(n); } return result; } string SMTP::contact(const Information::Contact& contact) { if(!contact.name) return contact.mail; return {"\"", contact.name, "\" <", contact.mail, ">"}; } string SMTP::contacts(const vector& contacts) { string result; for(auto& contact : contacts) { result.append(this->contact(contact), "; "); } result.rtrim<1>("; "); return result; } string SMTP::split(const string& text) { string result; unsigned offset = 0; while(offset < text.size()) { unsigned length = min(76, text.size() - offset); if(length < 76) { result.append(text.slice(offset)); } else { result.append(text.slice(offset, 76), "\r\n"); } offset += length; } return result; } #ifdef _WIN32 int SMTP::close(int sock) { return closesocket(sock); } SMTP::SMTP() { int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if(sock == INVALID_SOCKET && WSAGetLastError() == WSANOTINITIALISED) { WSADATA wsaData; if(WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) { WSACleanup(); return; } } else { close(sock); } } #endif } #endif gba/interface/interface.hpp000664 001750 001750 00000001503 12651764221 017051 0ustar00sergiosergio000000 000000 #ifndef GBA_HPP namespace GameBoyAdvance { #endif struct ID { enum : unsigned { System, GameBoyAdvance, }; enum : unsigned { BIOS, Manifest, ROM, RAM, EEPROM, FlashROM, }; enum : unsigned { Device = 1, }; }; struct Interface : Emulator::Interface { string title(); double videoFrequency(); double audioFrequency(); bool loaded(); unsigned group(unsigned id); void load(unsigned id); void save(); void load(unsigned id, const stream& stream); void save(unsigned id, const stream& stream); void unload(); void power(); void reset(); void run(); serializer serialize(); bool unserialize(serializer&); void paletteUpdate(PaletteMode mode); Interface(); private: vector device; }; extern Interface* interface; #ifndef GBA_HPP } #endif phoenix/cocoa/message-window.hpp000664 001750 001750 00000000522 12651764221 020107 0ustar00sergiosergio000000 000000 namespace phoenix { struct pMessageWindow { static MessageWindow::Response error(MessageWindow::State& state); static MessageWindow::Response information(MessageWindow::State& state); static MessageWindow::Response question(MessageWindow::State& state); static MessageWindow::Response warning(MessageWindow::State& state); }; } sfc/ppu/sprite/000700 001750 001750 00000000000 12656700342 014560 5ustar00sergiosergio000000 000000 nall/mosaic.hpp000664 001750 001750 00000000344 12651764221 014623 0ustar00sergiosergio000000 000000 #ifndef NALL_MOSAIC_HPP #define NALL_MOSAIC_HPP #define NALL_MOSAIC_INTERNAL_HPP #include #include #include #undef NALL_MOSAIC_INTERNAL_HPP #endif gba/ppu/mmio.cpp000664 001750 001750 00000013130 12651764221 014710 0ustar00sergiosergio000000 000000 uint8 PPU::read(uint32 addr) { switch(addr) { //DISPCNT case 0x04000000: return regs.control >> 0; case 0x04000001: return regs.control >> 8; //GRSWP case 0x04000002: return regs.greenswap; case 0x04000003: return 0u; //DISPSTAT case 0x04000004: return regs.status >> 0; case 0x04000005: return regs.status >> 8; //VCOUNT case 0x04000006: return regs.vcounter >> 0; case 0x04000007: return regs.vcounter >> 8; //BG0CNT,BG1CNT,BG2CNT,BG3CNT case 0x04000008: case 0x04000009: case 0x0400000a: case 0x0400000b: case 0x0400000c: case 0x0400000d: case 0x0400000e: case 0x0400000f: { auto& bg = regs.bg[(addr >> 1) & 3]; unsigned shift = (addr & 1) * 8; return bg.control >> shift; } //WININ case 0x04000048: return regs.windowflags[In0]; case 0x04000049: return regs.windowflags[In1]; case 0x0400004a: return regs.windowflags[Out]; case 0x0400004b: return regs.windowflags[Obj]; //BLTCNT case 0x04000050: return regs.blend.control >> 0; case 0x04000051: return regs.blend.control >> 8; } return 0u; } void PPU::write(uint32 addr, uint8 byte) { switch(addr) { //DISPCNT case 0x04000000: regs.control = (regs.control & 0xff00) | (byte << 0); return; case 0x04000001: regs.control = (regs.control & 0x00ff) | (byte << 8); return; //GRSWP case 0x04000002: regs.greenswap = byte >> 0; return; case 0x04000003: return; //DISPSTAT case 0x04000004: regs.status.irqvblank = byte >> 3; regs.status.irqhblank = byte >> 4; regs.status.irqvcoincidence = byte >> 5; return; case 0x04000005: regs.status.vcompare = byte; return; //BG0CNT,BG1CNT,BG2CNT,BG3CNT case 0x04000008: case 0x04000009: case 0x0400000a: case 0x0400000b: case 0x0400000c: case 0x0400000d: case 0x0400000e: case 0x0400000f: { auto& bg = regs.bg[(addr >> 1) & 3]; unsigned shift = (addr & 1) * 8; bg.control = (bg.control & ~(255 << shift)) | (byte << shift); return; } //BG0HOFS,BG1HOFS,BG2BOFS,BG3HOFS case 0x04000010: case 0x04000011: case 0x04000014: case 0x04000015: case 0x04000018: case 0x04000019: case 0x0400001c: case 0x0400001d: { auto& bg = regs.bg[(addr >> 2) & 3]; unsigned shift = (addr & 1) * 8; bg.hoffset = (bg.hoffset & ~(255 << shift)) | (byte << shift); return; } //BG0VOFS,BG1VOFS,BG2VOFS,BG3VOFS case 0x04000012: case 0x04000013: case 0x04000016: case 0x04000017: case 0x0400001a: case 0x0400001b: case 0x0400001e: case 0x0400001f: { auto& bg = regs.bg[(addr >> 2) & 3]; unsigned shift = (addr & 1) * 8; bg.voffset = (bg.voffset & ~(255 << shift)) | (byte << shift); return; } //BG2PA,BG3PA case 0x04000020: case 0x04000021: case 0x04000030: case 0x04000031: { auto& bg = regs.bg[(addr >> 4) & 3]; unsigned shift = (addr & 1) * 8; bg.pa = (bg.pa & ~(255 << shift)) | (byte << shift); return; } //BG2PB,BG3PB case 0x04000022: case 0x04000023: case 0x04000032: case 0x04000033: { auto& bg = regs.bg[(addr >> 4) & 3]; unsigned shift = (addr & 1) * 8; bg.pb = (bg.pb & ~(255 << shift)) | (byte << shift); return; } //BG2PC,BG3PC case 0x04000024: case 0x04000025: case 0x04000034: case 0x04000035: { auto& bg = regs.bg[(addr >> 4) & 3]; unsigned shift = (addr & 1) * 8; bg.pc = (bg.pc & ~(255 << shift)) | (byte << shift); return; } //BG2PD,BG3PD case 0x04000026: case 0x04000027: case 0x04000036: case 0x04000037: { auto& bg = regs.bg[(addr >> 4) & 3]; unsigned shift = (addr & 1) * 8; bg.pd = (bg.pd & ~(255 << shift)) | (byte << shift); return; } //BG2X_L,BG2X_H,BG3X_L,BG3X_H case 0x04000028: case 0x04000029: case 0x0400002a: case 0x0400002b: case 0x04000038: case 0x04000039: case 0x0400003a: case 0x0400003b: { auto& bg = regs.bg[(addr >> 4) & 3]; unsigned shift = (addr & 3) * 8; bg.lx = bg.x = (bg.x & ~(255 << shift)) | (byte << shift); return; } //BG2Y_L,BG2Y_H,BG3Y_L,BG3Y_H case 0x0400002c: case 0x0400002d: case 0x0400002e: case 0x0400002f: case 0x0400003c: case 0x0400003d: case 0x0400003e: case 0x0400003f: { auto& bg = regs.bg[(addr >> 4) & 3]; unsigned shift = (addr & 3) * 8; bg.ly = bg.y = (bg.y & ~(255 << shift)) | (byte << shift); return; } //WIN0H case 0x04000040: regs.window[0].x2 = byte; return; case 0x04000041: regs.window[0].x1 = byte; return; //WIN1H case 0x04000042: regs.window[1].x2 = byte; return; case 0x04000043: regs.window[1].x1 = byte; return; //WIN0V case 0x04000044: regs.window[0].y2 = byte; return; case 0x04000045: regs.window[0].y1 = byte; return; //WIN1V case 0x04000046: regs.window[1].y2 = byte; return; case 0x04000047: regs.window[1].y1 = byte; return; //WININ case 0x04000048: regs.windowflags[In0] = byte; return; case 0x04000049: regs.windowflags[In1] = byte; return; //WINOUT case 0x0400004a: regs.windowflags[Out] = byte; return; case 0x0400004b: regs.windowflags[Obj] = byte; return; //MOSAIC case 0x0400004c: regs.mosaic.bghsize = byte >> 0; regs.mosaic.bgvsize = byte >> 4; return; case 0x0400004d: regs.mosaic.objhsize = byte >> 0; regs.mosaic.objvsize = byte >> 4; return; //BLDCNT case 0x04000050: regs.blend.control = (regs.blend.control & 0xff00) | (byte << 0); return; case 0x04000051: regs.blend.control = (regs.blend.control & 0x00ff) | (byte << 8); return; //BLDALPHA case 0x04000052: regs.blend.eva = std::min(16, byte & 0x1f); return; case 0x04000053: regs.blend.evb = std::min(16, byte & 0x1f); return; //BLDY case 0x04000054: regs.blend.evy = std::min(16, byte & 0x1f); return; case 0x04000055: return; } } phoenix/windows/action/radio-item.cpp000664 001750 001750 00000001634 12651764221 021073 0ustar00sergiosergio000000 000000 namespace phoenix { void pRadioItem::setChecked() { for(auto &item : radioItem.state.group) { //CheckMenuRadioItem takes: lo, hi, id; checking only id when lo <= id <= hi //phoenix does not force IDs to be linear, so to uncheck id, we use: lo == hi == id + 1 (out of range) //to check id, we use: lo == hi == id (only ID, but in range) if(item.p.parentMenu) CheckMenuRadioItem(item.p.parentMenu->p.hmenu, item.p.id, item.p.id, item.p.id + (id != item.p.id), MF_BYCOMMAND); } } void pRadioItem::setGroup(const group& group) { } void pRadioItem::setText(string text) { if(parentWindow) parentWindow->p.updateMenu(); } void pRadioItem::constructor() { } void pRadioItem::destructor() { if(parentMenu) parentMenu->remove(radioItem); } void pRadioItem::onActivate() { if(radioItem.state.checked) return; radioItem.setChecked(); if(radioItem.onActivate) radioItem.onActivate(); } } phoenix/cocoa/000700 001750 001750 00000000000 12656700342 014431 5ustar00sergiosergio000000 000000 phoenix/reference/platform.hpp000664 001750 001750 00000002502 12651764221 017654 0ustar00sergiosergio000000 000000 namespace phoenix { struct pFont; struct pWindow; struct pMenu; struct pLayout; struct pWidget; } #include "font.hpp" #include "desktop.hpp" #include "monitor.hpp" #include "keyboard.hpp" #include "mouse.hpp" #include "browser-window.hpp" #include "message-window.hpp" #include "object.hpp" #include "timer.hpp" #include "window.hpp" #include "action/action.hpp" #include "action/menu.hpp" #include "action/separator.hpp" #include "action/item.hpp" #include "action/check-item.hpp" #include "action/radio-item.hpp" #include "widget/sizable.hpp" #include "widget/layout.hpp" #include "widget/widget.hpp" #include "widget/button.hpp" #include "widget/canvas.hpp" #include "widget/check-button.hpp" #include "widget/check-label.hpp" #include "widget/combo-button.hpp" #include "widget/console.hpp" #include "widget/frame.hpp" #include "widget/hex-edit.hpp" #include "widget/horizontal-scroller.hpp" #include "widget/horizontal-slider.hpp" #include "widget/label.hpp" #include "widget/line-edit.hpp" #include "widget/list-view.hpp" #include "widget/progress-bar.hpp" #include "widget/radio-button.hpp" #include "widget/radio-label.hpp" #include "widget/tab-frame.hpp" #include "widget/text-edit.hpp" #include "widget/vertical-scroller.hpp" #include "widget/vertical-slider.hpp" #include "widget/viewport.hpp" #include "application.hpp" phoenix/cocoa/widget/text-edit.cpp000664 001750 001750 00000004647 12651764221 020357 0ustar00sergiosergio000000 000000 @implementation CocoaTextEdit : NSScrollView -(id) initWith:(phoenix::TextEdit&)textEditReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { textEdit = &textEditReference; content = [[[NSTextView alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)] autorelease]; [content setDelegate:self]; [content setRichText:NO]; [self setBorderType:NSBezelBorder]; [self setDocumentView:content]; [self configure]; } return self; } -(NSTextView*) content { return content; } -(void) configure { [content setMinSize:NSMakeSize(0, 0)]; [content setMaxSize:NSMakeSize(FLT_MAX, FLT_MAX)]; [[content textContainer] setContainerSize:NSMakeSize(FLT_MAX, FLT_MAX)]; [[content textContainer] setWidthTracksTextView:textEdit->wordWrap()]; [content setHorizontallyResizable:YES]; [content setVerticallyResizable:YES]; [content setAutoresizingMask:NSViewNotSizable]; [self setHasHorizontalScroller:!textEdit->wordWrap()]; [self setHasVerticalScroller:YES]; } -(void) textDidChange:(NSNotification*)notification { textEdit->state.text = [[content string] UTF8String]; if(textEdit->onChange) textEdit->onChange(); } @end namespace phoenix { void pTextEdit::setCursorPosition(unsigned position) { @autoreleasepool { string text = [[[cocoaView content] string] UTF8String]; position = min(position, text.length()); [[cocoaView content] setSelectedRange:NSMakeRange(position, 0)]; } } void pTextEdit::setEditable(bool editable) { @autoreleasepool { [[cocoaView content] setEditable:editable]; } } void pTextEdit::setFont(string font) { @autoreleasepool { [[cocoaView content] setFont:pFont::cocoaFont(font)]; } } void pTextEdit::setText(string text) { @autoreleasepool { [[cocoaView content] setString:[NSString stringWithUTF8String:text]]; } } void pTextEdit::setWordWrap(bool wordWrap) { @autoreleasepool { [cocoaView configure]; } } string pTextEdit::text() { @autoreleasepool { return [[[cocoaView content] string] UTF8String]; } } void pTextEdit::constructor() { @autoreleasepool { cocoaView = cocoaTextEdit = [[CocoaTextEdit alloc] initWith:textEdit]; setEditable(textEdit.state.editable); setWordWrap(textEdit.state.wordWrap); setFont(textEdit.font()); setText(textEdit.state.text); setCursorPosition(textEdit.state.cursorPosition); } } void pTextEdit::destructor() { @autoreleasepool { [cocoaView release]; } } } sfc/chip/epsonrtc/epsonrtc.cpp000664 001750 001750 00000007232 12651764221 017610 0ustar00sergiosergio000000 000000 #include #define EPSONRTC_CPP namespace SuperFamicom { #include "memory.cpp" #include "time.cpp" #include "serialization.cpp" EpsonRTC epsonrtc; void EpsonRTC::Enter() { epsonrtc.enter(); } void EpsonRTC::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(wait) { if(--wait == 0) ready = 1; } clocks++; if((clocks & ~0x00ff) == 0) round_seconds(); //125 microseconds if((clocks & ~0x3fff) == 0) duty(); //1/128th second if((clocks & ~0x7fff) == 0) irq(0); //1/64th second if(clocks == 0) { //1 second seconds++; irq(1); if(seconds % 60 == 0) irq(2); //1 minute if(seconds % 1440 == 0) irq(3), seconds = 0; //1 hour tick(); } step(1); synchronize_cpu(); } } void EpsonRTC::init() { } void EpsonRTC::load() { return; secondlo = 0; secondhi = 0; batteryfailure = 1; minutelo = 0; minutehi = 0; resync = 0; hourlo = 0; hourhi = 0; meridian = 0; daylo = 0; dayhi = 0; dayram = 0; monthlo = 0; monthhi = 0; monthram = 0; yearlo = 0; yearhi = 0; weekday = 0; hold = 0; calendar = 0; irqflag = 0; roundseconds = 0; irqmask = 0; irqduty = 0; irqperiod = 0; pause = 0; stop = 0; atime = 0; test = 0; } void EpsonRTC::unload() { } void EpsonRTC::power() { } void EpsonRTC::reset() { create(EpsonRTC::Enter, 32768 * 64); clocks = 0; seconds = 0; chipselect = 0; state = State::Mode; offset = 0; wait = 0; ready = 0; holdtick = 0; } void EpsonRTC::sync() { time_t systime = time(0); tm* timeinfo = localtime(&systime); unsigned second = min(59, timeinfo->tm_sec); secondlo = second % 10; secondhi = second / 10; unsigned minute = timeinfo->tm_min; minutelo = minute % 10; minutehi = minute / 10; unsigned hour = timeinfo->tm_hour; if(atime) { hourlo = hour % 10; hourhi = hour / 10; } else { meridian = hour >= 12; hour %= 12; if(hour == 0) hour = 12; hourlo = hour % 10; hourhi = hour / 10; } unsigned day = timeinfo->tm_mday; daylo = day % 10; dayhi = day / 10; unsigned month = 1 + timeinfo->tm_mon; monthlo = month % 10; monthhi = month / 10; unsigned year = timeinfo->tm_year % 100; yearlo = year % 10; yearhi = year / 10; weekday = timeinfo->tm_wday; resync = true; //alert program that time has changed } uint8 EpsonRTC::read(unsigned addr) { cpu.synchronize_coprocessors(); addr &= 3; if(addr == 0) { return chipselect; } if(addr == 1) { if(chipselect != 1) return 0; if(ready == 0) return 0; if(state == State::Write) return mdr; if(state != State::Read) return 0; ready = 0; wait = 8; return rtc_read(offset++); } if(addr == 2) { return ready << 7; } // TODO: byuu returned nothing if addr == 3 return 0; } void EpsonRTC::write(unsigned addr, uint8 data) { cpu.synchronize_coprocessors(); addr &= 3, data &= 15; if(addr == 0) { chipselect = data; if(chipselect != 1) rtc_reset(); ready = 1; } if(addr == 1) { if(chipselect != 1) return; if(ready == 0) return; if(state == State::Mode) { if(data != 0x03 && data != 0x0c) return; state = State::Seek; ready = 0; wait = 8; mdr = data; } else if(state == State::Seek) { if(mdr == 0x03) state = State::Write; if(mdr == 0x0c) state = State::Read; offset = data; ready = 0; wait = 8; mdr = data; } else if(state == State::Write) { rtc_write(offset++, data); ready = 0; wait = 8; mdr = data; } } } } fc/cartridge/000700 001750 001750 00000000000 12656700342 014227 5ustar00sergiosergio000000 000000 phoenix/cocoa/utility.cpp000664 001750 001750 00000003231 12651764221 016654 0ustar00sergiosergio000000 000000 NSImage* NSMakeImage(nall::image image, unsigned width = 0, unsigned height = 0) { if(image.empty()) return nil; if(width && height) image.scale(width, height, Interpolation::Linear); image.transform(0, 32, 255u << 24, 255u << 0, 255u << 8, 255u << 16); NSImage* cocoaImage = [[[NSImage alloc] initWithSize:NSMakeSize(image.width, image.height)] autorelease]; NSBitmapImageRep* bitmap = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil pixelsWide:image.width pixelsHigh:image.height bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bitmapFormat:NSAlphaNonpremultipliedBitmapFormat bytesPerRow:image.pitch bitsPerPixel:32 ] autorelease]; memcpy([bitmap bitmapData], image.data, image.height * image.pitch); [cocoaImage addRepresentation:bitmap]; return cocoaImage; } NSDragOperation DropPathsOperation(id sender) { NSPasteboard* pboard = [sender draggingPasteboard]; if([[pboard types] containsObject:NSFilenamesPboardType]) { if([sender draggingSourceOperationMask] & NSDragOperationGeneric) { return NSDragOperationGeneric; } } return NSDragOperationNone; } lstring DropPaths(id sender) { lstring paths; NSPasteboard* pboard = [sender draggingPasteboard]; if([[pboard types] containsObject:NSFilenamesPboardType]) { NSArray* files = [pboard propertyListForType:NSFilenamesPboardType]; for(unsigned n = 0; n < [files count]; n++) { string path = [[files objectAtIndex:n] UTF8String]; if(directory::exists(path) && !path.endsWith("/")) path.append("/"); paths.append(path); } } return paths; } fc/input/000700 001750 001750 00000000000 12656700342 013422 5ustar00sergiosergio000000 000000 phoenix/reference/action/menu.cpp000664 001750 001750 00000000370 12651764221 020245 0ustar00sergiosergio000000 000000 namespace phoenix { void pMenu::append(Action& action) { } void pMenu::remove(Action& action) { } void pMenu::setImage(const image& image) { } void pMenu::setText(string text) { } void pMenu::constructor() { } void pMenu::destructor() { } } target-ethos/general/general.cpp000664 001750 001750 00000000147 12651764221 020056 0ustar00sergiosergio000000 000000 #include "../ethos.hpp" #include "library.cpp" #include "presentation.cpp" #include "dip-switches.cpp" phoenix/qt/action/radio-item.cpp000664 001750 001750 00000001720 12651764221 020021 0ustar00sergiosergio000000 000000 namespace phoenix { void pRadioItem::setChecked() { locked = true; for(auto& item : radioItem.state.group) { bool checkState = item.p.qtAction == qtAction; item.state.checked = checkState; item.p.qtAction->setChecked(checkState); } locked = false; } void pRadioItem::setGroup(const group& group) { } void pRadioItem::setText(string text) { qtAction->setText(QString::fromUtf8(text)); } void pRadioItem::constructor() { qtAction = new QAction(0); qtGroup = new QActionGroup(0); qtAction->setCheckable(true); qtAction->setActionGroup(qtGroup); qtAction->setChecked(true); connect(qtAction, SIGNAL(triggered()), SLOT(onActivate())); } void pRadioItem::destructor() { if(action.state.menu) action.state.menu->remove(radioItem); delete qtAction; qtAction = nullptr; } void pRadioItem::onActivate() { if(!radioItem.state.checked) { setChecked(); if(!locked && radioItem.onActivate) radioItem.onActivate(); } } } processor/lr35902/serialization.cpp000664 001750 001750 00000000636 12651764221 020335 0ustar00sergiosergio000000 000000 void LR35902::serialize(serializer& s) { s.integer(r.a.data); s.integer(r.f.z); s.integer(r.f.n); s.integer(r.f.h); s.integer(r.f.c); s.integer(r.b.data); s.integer(r.c.data); s.integer(r.d.data); s.integer(r.e.data); s.integer(r.h.data); s.integer(r.l.data); s.integer(r.sp.data); s.integer(r.pc.data); s.integer(r.halt); s.integer(r.stop); s.integer(r.ei); s.integer(r.ime); } sfc/alt/smp/core/op_misc.b000664 001750 001750 00000005724 12651764221 016576 0ustar00sergiosergio000000 000000 nop(0x00) { 1:op_io(); } sleep(0xef), stop(0xff) { 1:op_io(); 2:op_io(); regs.pc--; } xcn(0x9f) { 1:op_io(); 2:op_io(); 3:op_io(); 4:op_io(); regs.a = (regs.a >> 4) | (regs.a << 4); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); } daa(0xdf) { 1:op_io(); 2:op_io(); if(regs.p.c || (regs.a) > 0x99) { regs.a += 0x60; regs.p.c = 1; } if(regs.p.h || (regs.a & 15) > 0x09) { regs.a += 0x06; } regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); } das(0xbe) { 1:op_io(); 2:op_io(); if(!regs.p.c || (regs.a) > 0x99) { regs.a -= 0x60; regs.p.c = 0; } if(!regs.p.h || (regs.a & 15) > 0x09) { regs.a -= 0x06; } regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); } clrc(0x60, regs.p.c = 0), clrp(0x20, regs.p.p = 0), setc(0x80, regs.p.c = 1), setp(0x40, regs.p.p = 1) { 1:op_io(); $1; } clrv(0xe0) { 1:op_io(); regs.p.v = 0; regs.p.h = 0; } notc(0xed) { 1:op_io(); 2:op_io(); regs.p.c = !regs.p.c; } ei(0xa0, 1), di(0xc0, 0) { 1:op_io(); 2:op_io(); regs.p.i = $1; } set0_dp(0x02, rd |= 0x01), clr0_dp(0x12, rd &= ~0x01), set1_dp(0x22, rd |= 0x02), clr1_dp(0x32, rd &= ~0x02), set2_dp(0x42, rd |= 0x04), clr2_dp(0x52, rd &= ~0x04), set3_dp(0x62, rd |= 0x08), clr3_dp(0x72, rd &= ~0x08), set4_dp(0x82, rd |= 0x10), clr4_dp(0x92, rd &= ~0x10), set5_dp(0xa2, rd |= 0x20), clr5_dp(0xb2, rd &= ~0x20), set6_dp(0xc2, rd |= 0x40), clr6_dp(0xd2, rd &= ~0x40), set7_dp(0xe2, rd |= 0x80), clr7_dp(0xf2, rd &= ~0x80) { 1:dp = op_readpc(); 2:rd = op_readdp(dp); 3:$1; op_writedp(dp, rd); } push_a(0x2d, a), push_x(0x4d, x), push_y(0x6d, y), push_p(0x0d, p) { 1:op_io(); 2:op_io(); 3:op_writestack(regs.$1); } pop_a(0xae, a), pop_x(0xce, x), pop_y(0xee, y), pop_p(0x8e, p) { 1:op_io(); 2:op_io(); 3:regs.$1 = op_readstack(); } mul_ya(0xcf) { 1:op_io(); 2:op_io(); 3:op_io(); 4:op_io(); 5:op_io(); 6:op_io(); 7:op_io(); 8:op_io(); ya = regs.y * regs.a; regs.a = ya; regs.y = ya >> 8; //result is set based on y (high-byte) only regs.p.n = !!(regs.y & 0x80); regs.p.z = (regs.y == 0); } div_ya_x(0x9e) { 1:op_io(); 2:op_io(); 3:op_io(); 4:op_io(); 5:op_io(); 6:op_io(); 7:op_io(); 8:op_io(); 9:op_io(); 10:op_io(); 11:op_io(); ya = regs.ya; //overflow set if quotient >= 256 regs.p.v = !!(regs.y >= regs.x); regs.p.h = !!((regs.y & 15) >= (regs.x & 15)); if(regs.y < (regs.x << 1)) { //if quotient is <= 511 (will fit into 9-bit result) regs.a = ya / regs.x; regs.y = ya % regs.x; } else { //otherwise, the quotient won't fit into regs.p.v + regs.a //this emulates the odd behavior of the S-SMP in this case regs.a = 255 - (ya - (regs.x << 9)) / (256 - regs.x); regs.y = regs.x + (ya - (regs.x << 9)) % (256 - regs.x); } //result is set based on a (quotient) only regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); } phoenix/cocoa/widget/vertical-scroller.cpp000664 001750 001750 00000003543 12651764221 022076 0ustar00sergiosergio000000 000000 @implementation CocoaVerticalScroller : NSScroller -(id) initWith:(phoenix::VerticalScroller&)verticalScrollerReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 1)]) { verticalScroller = &verticalScrollerReference; [self setTarget:self]; [self setAction:@selector(scroll:)]; [self setControlSize:NSRegularControlSize]; [self setScrollerStyle:NSScrollerStyleLegacy]; [self setEnabled:YES]; [self update]; } return self; } -(void) update { double d = 1.0 / verticalScroller->state.length; double f = d * verticalScroller->state.position; [self setDoubleValue:f]; [self setKnobProportion:d]; } -(IBAction) scroll:(id)sender { auto& state = verticalScroller->state; switch([self hitPart]) { case NSScrollerIncrementLine: case NSScrollerIncrementPage: if(state.position < state.length - 1) state.position++; [self update]; break; case NSScrollerDecrementLine: case NSScrollerDecrementPage: if(state.position) state.position--; [self update]; break; case NSScrollerKnob: state.position = [self doubleValue] * state.length; break; } if(verticalScroller->onChange) verticalScroller->onChange(); } @end namespace phoenix { Size pVerticalScroller::minimumSize() { @autoreleasepool { return {[NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy], 32}; } } void pVerticalScroller::setLength(unsigned length) { @autoreleasepool { [cocoaView update]; } } void pVerticalScroller::setPosition(unsigned position) { @autoreleasepool { [cocoaView update]; } } void pVerticalScroller::constructor() { @autoreleasepool { cocoaView = cocoaVerticalScroller = [[CocoaVerticalScroller alloc] initWith:verticalScroller]; } } void pVerticalScroller::destructor() { @autoreleasepool { [cocoaView release]; } } } nall/image.hpp000664 001750 001750 00000000776 12651764221 014443 0ustar00sergiosergio000000 000000 #ifndef NALL_IMAGE_HPP #define NALL_IMAGE_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif phoenix/gtk/action/action.cpp000664 001750 001750 00000001144 12651764221 017405 0ustar00sergiosergio000000 000000 namespace phoenix { void pAction::setEnabled(bool enabled) { gtk_widget_set_sensitive(widget, enabled); } void pAction::setVisible(bool visible) { gtk_widget_set_visible(widget, visible); } void pAction::constructor() { } void pAction::orphan() { } //GTK+ uses _ for mnemonics, __ for _ //transform so that & is used for mnemonics, && for & string pAction::mnemonic(string text) { text.transform("&_", "\x01\x02"); text.replace("\x01\x01", "&"); text.transform("\x01", "_"); text.replace("\x02", "__"); return text; } void pAction::setFont(string font) { pFont::setFont(widget, font); } } sfc/chip/cx4/cx4.cpp000664 001750 001750 00000010011 12651764221 015277 0ustar00sergiosergio000000 000000 //============= //Cx4 emulation //============= //Used in Rockman X2/X3 (Megaman X2/X3) //Portions (c) anomie, Overload, zsKnight, Nach, byuu #include #define CX4_CPP namespace SuperFamicom { Cx4 cx4; #include "serialization.cpp" #include "data.cpp" #include "functions.cpp" #include "oam.cpp" #include "opcodes.cpp" void Cx4::init() { } void Cx4::load() { } void Cx4::unload() { } uint32 Cx4::ldr(uint8 r) { uint16 addr = 0x0080 + (r * 3); return (reg[addr + 0] << 0) | (reg[addr + 1] << 8) | (reg[addr + 2] << 16); } void Cx4::str(uint8 r, uint32 data) { uint16 addr = 0x0080 + (r * 3); reg[addr + 0] = (data >> 0); reg[addr + 1] = (data >> 8); reg[addr + 2] = (data >> 16); } void Cx4::mul(uint32 x, uint32 y, uint32 &rl, uint32 &rh) { int64 rx = x & 0xffffff; int64 ry = y & 0xffffff; if(rx & 0x800000)rx |= ~0x7fffff; if(ry & 0x800000)ry |= ~0x7fffff; rx *= ry; rl = (rx) & 0xffffff; rh = (rx >> 24) & 0xffffff; } uint32 Cx4::sin(uint32 rx) { r0 = rx & 0x1ff; if(r0 & 0x100)r0 ^= 0x1ff; if(r0 & 0x080)r0 ^= 0x0ff; if(rx & 0x100) { return sin_table[r0 + 0x80]; } else { return sin_table[r0]; } } uint32 Cx4::cos(uint32 rx) { return sin(rx + 0x080); } void Cx4::immediate_reg(uint32 start) { r0 = ldr(0); for(uint32 i = start; i < 48; i++) { if((r0 & 0x0fff) < 0x0c00) { ram[r0 & 0x0fff] = immediate_data[i]; } r0++; } str(0, r0); } void Cx4::transfer_data() { uint32 src; uint16 dest, count; src = (reg[0x40]) | (reg[0x41] << 8) | (reg[0x42] << 16); count = (reg[0x43]) | (reg[0x44] << 8); dest = (reg[0x45]) | (reg[0x46] << 8); for(uint32 i=0;i> 2; return; } switch(data) { case 0x00: op00(); break; case 0x01: op01(); break; case 0x05: op05(); break; case 0x0d: op0d(); break; case 0x10: op10(); break; case 0x13: op13(); break; case 0x15: op15(); break; case 0x1f: op1f(); break; case 0x22: op22(); break; case 0x25: op25(); break; case 0x2d: op2d(); break; case 0x40: op40(); break; case 0x54: op54(); break; case 0x5c: op5c(); break; case 0x5e: op5e(); break; case 0x60: op60(); break; case 0x62: op62(); break; case 0x64: op64(); break; case 0x66: op66(); break; case 0x68: op68(); break; case 0x6a: op6a(); break; case 0x6c: op6c(); break; case 0x6e: op6e(); break; case 0x70: op70(); break; case 0x72: op72(); break; case 0x74: op74(); break; case 0x76: op76(); break; case 0x78: op78(); break; case 0x7a: op7a(); break; case 0x7c: op7c(); break; case 0x89: op89(); break; } } } void Cx4::writeb(uint16 addr, uint8 data) { write(addr, data); } void Cx4::writew(uint16 addr, uint16 data) { write(addr + 0, data >> 0); write(addr + 1, data >> 8); } void Cx4::writel(uint16 addr, uint32 data) { write(addr + 0, data >> 0); write(addr + 1, data >> 8); write(addr + 2, data >> 16); } uint8 Cx4::read(unsigned addr) { addr &= 0x1fff; if(addr < 0x0c00) { return ram[addr]; } if(addr >= 0x1f00) { return reg[addr & 0xff]; } return cpu.regs.mdr; } uint8 Cx4::readb(uint16 addr) { return read(addr); } uint16 Cx4::readw(uint16 addr) { return read(addr) | (read(addr + 1) << 8); } uint32 Cx4::readl(uint16 addr) { return read(addr) | (read(addr + 1) << 8) + (read(addr + 2) << 16); } void Cx4::power() { } void Cx4::reset() { memset(ram, 0, 0x0c00); memset(reg, 0, 0x0100); } }; nall/bmp.hpp000664 001750 001750 00000006415 12651764221 014133 0ustar00sergiosergio000000 000000 #ifndef NALL_BMP_HPP #define NALL_BMP_HPP #include //BMP reader / writer //note: only 24-bit RGB and 32-bit ARGB uncompressed images supported namespace nall { struct bmp { inline static bool read(const string& filename, uint32_t*& data, unsigned& width, unsigned& height); inline static bool write(const string& filename, const uint32_t* data, unsigned width, unsigned height, unsigned pitch, bool alpha = false); }; bool bmp::read(const string& filename, uint32_t*& data, unsigned& width, unsigned& height) { file fp; if(fp.open(filename, file::mode::read) == false) return false; if(fp.size() < 0x36) return false; if(fp.readm(2) != 0x424d) return false; fp.seek(0x000a); unsigned offset = fp.readl(4); unsigned dibsize = fp.readl(4); if(dibsize != 40) return false; signed headerWidth = fp.readl(4); if(headerWidth < 0) return false; signed headerHeight = fp.readl(4); fp.readl(2); unsigned bitsPerPixel = fp.readl(2); if(bitsPerPixel != 24 && bitsPerPixel != 32) return false; unsigned compression = fp.readl(4); if(compression != 0) return false; fp.seek(offset); bool noFlip = headerHeight < 0; width = headerWidth, height = abs(headerHeight); data = new uint32_t[width * height]; unsigned bytesPerPixel = bitsPerPixel / 8; unsigned alignedWidth = width * bytesPerPixel; unsigned paddingLength = 0; while(alignedWidth % 4) alignedWidth++, paddingLength++; for(unsigned y = 0; y < height; y++) { uint32_t* p = noFlip ? data + y * width : data + (height - 1 - y) * width; for(unsigned x = 0; x < width; x++, p++) { *p = fp.readl(bytesPerPixel); if(bytesPerPixel == 3) *p |= 255 << 24; } if(paddingLength) fp.readl(paddingLength); } fp.close(); return true; } bool bmp::write(const string& filename, const uint32_t* data, unsigned width, unsigned height, unsigned pitch, bool alpha) { file fp; if(fp.open(filename, file::mode::write) == false) return false; unsigned bitsPerPixel = alpha ? 32 : 24; unsigned bytesPerPixel = bitsPerPixel / 8; unsigned alignedWidth = width * bytesPerPixel; unsigned paddingLength = 0; unsigned imageSize = alignedWidth * height; unsigned fileSize = 0x36 + imageSize; while(alignedWidth % 4) alignedWidth++, paddingLength++; fp.writem(0x424d, 2); //signature fp.writel(fileSize, 4); //file size fp.writel(0, 2); //reserved fp.writel(0, 2); //reserved fp.writel(0x36, 4); //offset fp.writel(40, 4); //DIB size fp.writel(width, 4); //width fp.writel(-height, 4); //height fp.writel(1, 2); //color planes fp.writel(bitsPerPixel, 2); //bits per pixel fp.writel(0, 4); //compression method (BI_RGB) fp.writel(imageSize, 4); //image data size fp.writel(3780, 4); //horizontal resolution fp.writel(3780, 4); //vertical resolution fp.writel(0, 4); //palette size fp.writel(0, 4); //important color count for(unsigned y = 0; y < height; y++) { const uint32_t* p = (const uint32_t*)((const uint8_t*)data + y * pitch); for(unsigned x = 0; x < width; x++) fp.writel(*p++, bytesPerPixel); if(paddingLength) fp.writel(0, paddingLength); } fp.close(); return true; } } #endif ruby/input/joypad/directinput.cpp000664 001750 001750 00000016466 12651764221 020371 0ustar00sergiosergio000000 000000 #ifndef RUBY_INPUT_JOYPAD_DIRECTINPUT #define RUBY_INPUT_JOYPAD_DIRECTINPUT namespace ruby { BOOL CALLBACK DirectInput_EnumJoypadsCallback(const DIDEVICEINSTANCE* instance, void* p); BOOL CALLBACK DirectInput_EnumJoypadAxesCallback(const DIDEVICEOBJECTINSTANCE* instance, void* p); BOOL CALLBACK DirectInput_EnumJoypadEffectsCallback(const DIDEVICEOBJECTINSTANCE* instance, void* p); struct InputJoypadDirectInput { struct Joypad { HID::Joypad hid; LPDIRECTINPUTDEVICE8 device = nullptr; LPDIRECTINPUTEFFECT effect = nullptr; uint32_t pathID = 0; uint16_t vendorID = 0; uint16_t productID = 0; bool isXInputDevice = false; }; vector joypads; uintptr_t handle = 0; LPDIRECTINPUT8 context = nullptr; LPDIRECTINPUTDEVICE8 device = nullptr; bool xinputAvailable = false; unsigned effects = 0; void assign(HID::Joypad& hid, unsigned groupID, unsigned inputID, int16_t value) { auto& group = hid.group[groupID]; if(group.input[inputID].value == value) return; if(input.onChange) input.onChange(hid, groupID, inputID, group.input[inputID].value, value); group.input[inputID].value = value; } void poll(vector& devices) { for(auto& jp : joypads) { if(FAILED(jp.device->Poll())) jp.device->Acquire(); DIJOYSTATE2 state; if(FAILED(jp.device->GetDeviceState(sizeof(DIJOYSTATE2), &state))) continue; for(unsigned n = 0; n < 4; n++) { assign(jp.hid, HID::Joypad::GroupID::Axis, 0, state.lX); assign(jp.hid, HID::Joypad::GroupID::Axis, 1, state.lY); assign(jp.hid, HID::Joypad::GroupID::Axis, 2, state.lZ); assign(jp.hid, HID::Joypad::GroupID::Axis, 3, state.lRx); assign(jp.hid, HID::Joypad::GroupID::Axis, 4, state.lRy); assign(jp.hid, HID::Joypad::GroupID::Axis, 5, state.lRz); unsigned pov = state.rgdwPOV[n]; int16_t xaxis = 0; int16_t yaxis = 0; if(pov < 36000) { if(pov >= 31500 || pov <= 4500) yaxis = -32768; if(pov >= 4500 && pov <= 13500) xaxis = +32767; if(pov >= 13500 && pov <= 22500) yaxis = +32767; if(pov >= 22500 && pov <= 31500) xaxis = -32768; } assign(jp.hid, HID::Joypad::GroupID::Hat, n * 2 + 0, xaxis); assign(jp.hid, HID::Joypad::GroupID::Hat, n * 2 + 1, yaxis); } for(unsigned n = 0; n < 128; n++) { assign(jp.hid, HID::Joypad::GroupID::Button, n, (bool)state.rgbButtons[n]); } devices.append(&jp.hid); } } bool rumble(uint64_t id, bool enable) { for(auto& jp : joypads) { if(jp.hid.id != id) continue; if(jp.effect == nullptr) continue; if(enable) jp.effect->Start(1, 0); else jp.effect->Stop(); return true; } return false; } bool init(uintptr_t handle, LPDIRECTINPUT8 context, bool xinputAvailable) { this->handle = handle; this->context = context; this->xinputAvailable = xinputAvailable; context->EnumDevices(DI8DEVCLASS_GAMECTRL, DirectInput_EnumJoypadsCallback, (void*)this, DIEDFL_ATTACHEDONLY); return true; } void term() { for(auto& jp : joypads) { jp.device->Unacquire(); if(jp.effect) jp.effect->Release(); jp.device->Release(); } joypads.reset(); context = nullptr; } bool initJoypad(const DIDEVICEINSTANCE* instance) { Joypad jp; jp.vendorID = instance->guidProduct.Data1 >> 0; jp.productID = instance->guidProduct.Data1 >> 16; if(auto device = rawinput.find(jp.vendorID, jp.productID)) { jp.pathID = crc32_calculate((const uint8_t*)device().path.data(), device().path.size()); jp.hid.id = (uint64_t)jp.pathID << 32 | jp.vendorID << 16 | jp.productID << 0; jp.isXInputDevice = device().isXInputDevice; } else { //this should never occur return DIENUM_CONTINUE; } //Microsoft has intentionally imposed artificial restrictions on XInput devices when used with DirectInput //a) the two triggers are merged into a single axis, making uniquely distinguishing them impossible //b) rumble support is not exposed //thus, it's always preferred to let the XInput driver handle these joypads //but if the driver is not available (XInput 1.3 does not ship with stock Windows XP), fall back on DirectInput if(jp.isXInputDevice && xinputAvailable) return DIENUM_CONTINUE; if(FAILED(context->CreateDevice(instance->guidInstance, &device, 0))) return DIENUM_CONTINUE; jp.device = device; device->SetDataFormat(&c_dfDIJoystick2); device->SetCooperativeLevel((HWND)handle, DISCL_NONEXCLUSIVE | DISCL_BACKGROUND); effects = 0; device->EnumObjects(DirectInput_EnumJoypadAxesCallback, (void*)this, DIDFT_ABSAXIS); device->EnumObjects(DirectInput_EnumJoypadEffectsCallback, (void*)this, DIDFT_FFACTUATOR); jp.hid.rumble = effects > 0; if(jp.hid.rumble) { //disable auto-centering spring for rumble support DIPROPDWORD property; memset(&property, 0, sizeof(DIPROPDWORD)); property.diph.dwSize = sizeof(DIPROPDWORD); property.diph.dwHeaderSize = sizeof(DIPROPHEADER); property.diph.dwObj = 0; property.diph.dwHow = DIPH_DEVICE; property.dwData = false; device->SetProperty(DIPROP_AUTOCENTER, &property.diph); DWORD dwAxes[2] = {DIJOFS_X, DIJOFS_Y}; LONG lDirection[2] = {0, 0}; DICONSTANTFORCE force; force.lMagnitude = DI_FFNOMINALMAX; //full force DIEFFECT effect; memset(&effect, 0, sizeof(DIEFFECT)); effect.dwSize = sizeof(DIEFFECT); effect.dwFlags = DIEFF_CARTESIAN | DIEFF_OBJECTOFFSETS; effect.dwDuration = INFINITE; effect.dwSamplePeriod = 0; effect.dwGain = DI_FFNOMINALMAX; effect.dwTriggerButton = DIEB_NOTRIGGER; effect.dwTriggerRepeatInterval = 0; effect.cAxes = 2; effect.rgdwAxes = dwAxes; effect.rglDirection = lDirection; effect.lpEnvelope = 0; effect.cbTypeSpecificParams = sizeof(DICONSTANTFORCE); effect.lpvTypeSpecificParams = &force; effect.dwStartDelay = 0; device->CreateEffect(GUID_ConstantForce, &effect, &jp.effect, NULL); } for(unsigned n = 0; n < 6; n++) jp.hid.axis().append({n}); for(unsigned n = 0; n < 8; n++) jp.hid.hat().append({n}); for(unsigned n = 0; n < 128; n++) jp.hid.button().append({n}); joypads.append(jp); return DIENUM_CONTINUE; } bool initAxis(const DIDEVICEOBJECTINSTANCE* instance) { DIPROPRANGE range; memset(&range, 0, sizeof(DIPROPRANGE)); range.diph.dwSize = sizeof(DIPROPRANGE); range.diph.dwHeaderSize = sizeof(DIPROPHEADER); range.diph.dwHow = DIPH_BYID; range.diph.dwObj = instance->dwType; range.lMin = -32768; range.lMax = +32767; device->SetProperty(DIPROP_RANGE, &range.diph); return DIENUM_CONTINUE; } bool initEffect(const DIDEVICEOBJECTINSTANCE* instance) { effects++; return DIENUM_CONTINUE; } }; BOOL CALLBACK DirectInput_EnumJoypadsCallback(const DIDEVICEINSTANCE* instance, void* p) { return ((InputJoypadDirectInput*)p)->initJoypad(instance); } BOOL CALLBACK DirectInput_EnumJoypadAxesCallback(const DIDEVICEOBJECTINSTANCE* instance, void* p) { return ((InputJoypadDirectInput*)p)->initAxis(instance); } BOOL CALLBACK DirectInput_EnumJoypadEffectsCallback(const DIDEVICEOBJECTINSTANCE* instance, void* p) { return ((InputJoypadDirectInput*)p)->initEffect(instance); } } #endif processor/gsu/table.cpp000664 001750 001750 00000014074 12651764221 016326 0ustar00sergiosergio000000 000000 void GSU::initialize_opcode_table() { #define op4(id, name) \ op(id+ 0, name< 1>) op(id+ 1, name< 2>) op(id+ 2, name< 3>) op(id+ 3, name< 4>) #define op6(id, name) \ op(id+ 0, name< 8>) op(id+ 1, name< 9>) op(id+ 2, name<10>) op(id+ 3, name<11>) \ op(id+ 4, name<12>) op(id+ 5, name<13>) #define op12(id, name) \ op(id+ 0, name< 0>) op(id+ 1, name< 1>) op(id+ 2, name< 2>) op(id+ 3, name< 3>) \ op(id+ 4, name< 4>) op(id+ 5, name< 5>) op(id+ 6, name< 6>) op(id+ 7, name< 7>) \ op(id+ 8, name< 8>) op(id+ 9, name< 9>) op(id+10, name<10>) op(id+11, name<11>) #define op15l(id, name) \ op(id+ 0, name< 0>) op(id+ 1, name< 1>) op(id+ 2, name< 2>) op(id+ 3, name< 3>) \ op(id+ 4, name< 4>) op(id+ 5, name< 5>) op(id+ 6, name< 6>) op(id+ 7, name< 7>) \ op(id+ 8, name< 8>) op(id+ 9, name< 9>) op(id+10, name<10>) op(id+11, name<11>) \ op(id+12, name<12>) op(id+13, name<13>) op(id+14, name<14>) #define op15h(id, name) \ op(id+ 0, name< 1>) op(id+ 1, name< 2>) op(id+ 2, name< 3>) op(id+ 3, name< 4>) \ op(id+ 4, name< 5>) op(id+ 5, name< 6>) op(id+ 6, name< 7>) op(id+ 7, name< 8>) \ op(id+ 8, name< 9>) op(id+ 9, name<10>) op(id+10, name<11>) op(id+11, name<12>) \ op(id+12, name<13>) op(id+13, name<14>) op(id+14, name<15>) #define op16(id, name) \ op(id+ 0, name< 0>) op(id+ 1, name< 1>) op(id+ 2, name< 2>) op(id+ 3, name< 3>) \ op(id+ 4, name< 4>) op(id+ 5, name< 5>) op(id+ 6, name< 6>) op(id+ 7, name< 7>) \ op(id+ 8, name< 8>) op(id+ 9, name< 9>) op(id+10, name<10>) op(id+11, name<11>) \ op(id+12, name<12>) op(id+13, name<13>) op(id+14, name<14>) op(id+15, name<15>) //====== // ALT0 //====== #define op(id, name) opcode_table[ 0 + id] = &GSU::op_##name; op (0x00, stop) op (0x01, nop) op (0x02, cache) op (0x03, lsr) op (0x04, rol) op (0x05, bra) op (0x06, blt) op (0x07, bge) op (0x08, bne) op (0x09, beq) op (0x0a, bpl) op (0x0b, bmi) op (0x0c, bcc) op (0x0d, bcs) op (0x0e, bvc) op (0x0f, bvs) op16 (0x10, to_r) op16 (0x20, with_r) op12 (0x30, stw_ir) op (0x3c, loop) op (0x3d, alt1) op (0x3e, alt2) op (0x3f, alt3) op12 (0x40, ldw_ir) op (0x4c, plot) op (0x4d, swap) op (0x4e, color) op (0x4f, not) op16 (0x50, add_r) op16 (0x60, sub_r) op (0x70, merge) op15h(0x71, and_r) op16 (0x80, mult_r) op (0x90, sbk) op4 (0x91, link) op (0x95, sex) op (0x96, asr) op (0x97, ror) op6 (0x98, jmp_r) op (0x9e, lob) op (0x9f, fmult) op16 (0xa0, ibt_r) op16 (0xb0, from_r) op (0xc0, hib) op15h(0xc1, or_r) op15l(0xd0, inc_r) op (0xdf, getc) op15l(0xe0, dec_r) op (0xef, getb) op16 (0xf0, iwt_r) #undef op //====== // ALT1 //====== #define op(id, name) opcode_table[256 + id] = &GSU::op_##name; op (0x00, stop) op (0x01, nop) op (0x02, cache) op (0x03, lsr) op (0x04, rol) op (0x05, bra) op (0x06, blt) op (0x07, bge) op (0x08, bne) op (0x09, beq) op (0x0a, bpl) op (0x0b, bmi) op (0x0c, bcc) op (0x0d, bcs) op (0x0e, bvc) op (0x0f, bvs) op16 (0x10, to_r) op16 (0x20, with_r) op12 (0x30, stb_ir) op (0x3c, loop) op (0x3d, alt1) op (0x3e, alt2) op (0x3f, alt3) op12 (0x40, ldb_ir) op (0x4c, rpix) op (0x4d, swap) op (0x4e, cmode) op (0x4f, not) op16 (0x50, adc_r) op16 (0x60, sbc_r) op (0x70, merge) op15h(0x71, bic_r) op16 (0x80, umult_r) op (0x90, sbk) op4 (0x91, link) op (0x95, sex) op (0x96, div2) op (0x97, ror) op6 (0x98, ljmp_r) op (0x9e, lob) op (0x9f, lmult) op16 (0xa0, lms_r) op16 (0xb0, from_r) op (0xc0, hib) op15h(0xc1, xor_r) op15l(0xd0, inc_r) op (0xdf, getc) op15l(0xe0, dec_r) op (0xef, getbh) op16 (0xf0, lm_r) #undef op //====== // ALT2 //====== #define op(id, name) opcode_table[512 + id] = &GSU::op_##name; op (0x00, stop) op (0x01, nop) op (0x02, cache) op (0x03, lsr) op (0x04, rol) op (0x05, bra) op (0x06, blt) op (0x07, bge) op (0x08, bne) op (0x09, beq) op (0x0a, bpl) op (0x0b, bmi) op (0x0c, bcc) op (0x0d, bcs) op (0x0e, bvc) op (0x0f, bvs) op16 (0x10, to_r) op16 (0x20, with_r) op12 (0x30, stw_ir) op (0x3c, loop) op (0x3d, alt1) op (0x3e, alt2) op (0x3f, alt3) op12 (0x40, ldw_ir) op (0x4c, plot) op (0x4d, swap) op (0x4e, color) op (0x4f, not) op16 (0x50, add_i) op16 (0x60, sub_i) op (0x70, merge) op15h(0x71, and_i) op16 (0x80, mult_i) op (0x90, sbk) op4 (0x91, link) op (0x95, sex) op (0x96, asr) op (0x97, ror) op6 (0x98, jmp_r) op (0x9e, lob) op (0x9f, fmult) op16 (0xa0, sms_r) op16 (0xb0, from_r) op (0xc0, hib) op15h(0xc1, or_i) op15l(0xd0, inc_r) op (0xdf, ramb) op15l(0xe0, dec_r) op (0xef, getbl) op16 (0xf0, sm_r) #undef op //====== // ALT3 //====== #define op(id, name) opcode_table[768 + id] = &GSU::op_##name; op (0x00, stop) op (0x01, nop) op (0x02, cache) op (0x03, lsr) op (0x04, rol) op (0x05, bra) op (0x06, blt) op (0x07, bge) op (0x08, bne) op (0x09, beq) op (0x0a, bpl) op (0x0b, bmi) op (0x0c, bcc) op (0x0d, bcs) op (0x0e, bvc) op (0x0f, bvs) op16 (0x10, to_r) op16 (0x20, with_r) op12 (0x30, stb_ir) op (0x3c, loop) op (0x3d, alt1) op (0x3e, alt2) op (0x3f, alt3) op12 (0x40, ldb_ir) op (0x4c, rpix) op (0x4d, swap) op (0x4e, cmode) op (0x4f, not) op16 (0x50, adc_i) op16 (0x60, cmp_r) op (0x70, merge) op15h(0x71, bic_i) op16 (0x80, umult_i) op (0x90, sbk) op4 (0x91, link) op (0x95, sex) op (0x96, div2) op (0x97, ror) op6 (0x98, ljmp_r) op (0x9e, lob) op (0x9f, lmult) op16 (0xa0, lms_r) op16 (0xb0, from_r) op (0xc0, hib) op15h(0xc1, xor_i) op15l(0xd0, inc_r) op (0xdf, romb) op15l(0xe0, dec_r) op (0xef, getbs) op16 (0xf0, lm_r) #undef op #undef op4 #undef op6 #undef op12 #undef op15l #undef op15h #undef op16 } processor/lr35902/registers.hpp000664 001750 001750 00000006357 12651764221 017502 0ustar00sergiosergio000000 000000 enum { A, F, AF, B, C, BC, D, E, DE, H, L, HL, SP, PC, }; enum { ZF, NF, HF, CF, }; //register base class //the idea here is to have all registers derive from a single base class. //this allows construction of opcodes that can take any register as input or output, //despite the fact that behind-the-scenes, special handling is done for eg: F, AF, HL, etc. //registers can also be chained together: eg af = 0x0000 writes both a and f. struct Register { virtual operator unsigned() const = 0; virtual unsigned operator=(unsigned x) = 0; Register& operator=(const Register& x) { operator=((unsigned)x); return *this; } unsigned operator++(int) { unsigned r = *this; operator=(*this + 1); return r; } unsigned operator--(int) { unsigned r = *this; operator=(*this - 1); return r; } unsigned operator++() { return operator=(*this + 1); } unsigned operator--() { return operator=(*this - 1); } unsigned operator |=(unsigned x) { return operator=(*this | x); } unsigned operator ^=(unsigned x) { return operator=(*this ^ x); } unsigned operator &=(unsigned x) { return operator=(*this & x); } unsigned operator<<=(unsigned x) { return operator=(*this << x); } unsigned operator>>=(unsigned x) { return operator=(*this >> x); } unsigned operator +=(unsigned x) { return operator=(*this + x); } unsigned operator -=(unsigned x) { return operator=(*this - x); } unsigned operator *=(unsigned x) { return operator=(*this * x); } unsigned operator /=(unsigned x) { return operator=(*this / x); } unsigned operator %=(unsigned x) { return operator=(*this % x); } }; struct Register8 : Register { uint8 data; operator unsigned() const { return data; } unsigned operator=(unsigned x) { return data = x; } }; struct RegisterF : Register { bool z, n, h, c; operator unsigned() const { return (z << 7) | (n << 6) | (h << 5) | (c << 4); } unsigned operator=(unsigned x) { z = x & 0x80; n = x & 0x40; h = x & 0x20; c = x & 0x10; return *this; } bool& operator[](unsigned r) { static bool* table[] = {&z, &n, &h, &c}; return *table[r]; } }; struct Register16 : Register { uint16 data; operator unsigned() const { return data; } unsigned operator=(unsigned x) { return data = x; } }; struct RegisterAF : Register { Register8& hi; RegisterF& lo; operator unsigned() const { return (hi << 8) | (lo << 0); } unsigned operator=(unsigned x) { hi = x >> 8; lo = x >> 0; return *this; } RegisterAF(Register8& hi, RegisterF& lo) : hi(hi), lo(lo) {} }; struct RegisterW : Register { Register8& hi; Register8& lo; operator unsigned() const { return (hi << 8) | (lo << 0); } unsigned operator=(unsigned x) { hi = x >> 8; lo = x >> 0; return *this; } RegisterW(Register8& hi, Register8& lo) : hi(hi), lo(lo) {} }; struct Registers { Register8 a; RegisterF f; RegisterAF af; Register8 b; Register8 c; RegisterW bc; Register8 d; Register8 e; RegisterW de; Register8 h; Register8 l; RegisterW hl; Register16 sp; Register16 pc; bool halt; bool stop; bool ei; bool ime; Register& operator[](unsigned r) { static Register* table[] = {&a, &f, &af, &b, &c, &bc, &d, &e, &de, &h, &l, &hl, &sp, &pc}; return *table[r]; } Registers() : af(a, f), bc(b, c), de(d, e), hl(h, l) {} } r; ananke/resource/000700 001750 001750 00000000000 12656700342 014757 5ustar00sergiosergio000000 000000 sfc/ppu/screen/screen.hpp000664 001750 001750 00000001743 12651764221 016543 0ustar00sergiosergio000000 000000 struct Screen { uint32* output; struct Regs { bool addsub_mode; bool direct_color; bool color_mode; bool color_halve; bool bg1_color_enable; bool bg2_color_enable; bool bg3_color_enable; bool bg4_color_enable; bool oam_color_enable; bool back_color_enable; uint5 color_b; uint5 color_g; uint5 color_r; } regs; struct Math { struct Layer { uint16 color; bool color_enable; } main, sub; bool transparent; bool addsub_mode; bool color_halve; } math; inline void scanline(); inline void run(); inline void reset(); inline uint16 get_pixel_sub(bool hires); inline uint16 get_pixel_main(); inline uint16 addsub(unsigned x, unsigned y); inline uint16 get_color(unsigned palette); inline uint16 get_direct_color(unsigned palette, unsigned tile); inline uint16 fixed_color() const; inline void serialize(serializer&); inline Screen(PPU& self); PPU& self; friend class PPU; }; nall/random.hpp000664 001750 001750 00000001605 12651764221 014631 0ustar00sergiosergio000000 000000 #ifndef NALL_RANDOM_HPP #define NALL_RANDOM_HPP #include #include namespace nall { struct RandomNumberGenerator { virtual void seed(uint64_t) = 0; virtual uint64_t operator()() = 0; virtual void serialize(serializer&) = 0; }; //Galois LFSR using CRC64 polynomials struct LinearFeedbackShiftRegisterGenerator : RandomNumberGenerator { void seed(uint64_t seed) { lfsr = seed; for(unsigned n = 0; n < 8; n++) operator()(); } uint64_t operator()() { return lfsr = (lfsr >> 1) ^ (-(lfsr & 1) & crc64jones); } void serialize(serializer& s) { s.integer(lfsr); } private: static const uint64_t crc64ecma = 0x42f0e1eba9ea3693; static const uint64_t crc64jones = 0xad93d23594c935a9; uint64_t lfsr = crc64ecma; }; inline uint64_t random() { static LinearFeedbackShiftRegisterGenerator lfsr; return lfsr(); } } #endif sfc/chip/superfx/memory/memory.cpp000664 001750 001750 00000005615 12651764221 020435 0ustar00sergiosergio000000 000000 #ifdef SUPERFX_CPP uint8 SuperFX::bus_read(unsigned addr) { if((addr & 0xc00000) == 0x000000) { //$00-3f:0000-7fff, $00-3f:8000-ffff while(!regs.scmr.ron && scheduler.sync != Scheduler::SynchronizeMode::All) { step(6); synchronize_cpu(); } return rom.read((((addr & 0x3f0000) >> 1) | (addr & 0x7fff)) & rom_mask); } if((addr & 0xe00000) == 0x400000) { //$40-5f:0000-ffff while(!regs.scmr.ron && scheduler.sync != Scheduler::SynchronizeMode::All) { step(6); synchronize_cpu(); } return rom.read(addr & rom_mask); } if((addr & 0xe00000) == 0x600000) { //$60-7f:0000-ffff while(!regs.scmr.ran && scheduler.sync != Scheduler::SynchronizeMode::All) { step(6); synchronize_cpu(); } return ram.read(addr & ram_mask); } // TODO: invalid address, what does real hardware do? return 0; } void SuperFX::bus_write(unsigned addr, uint8 data) { if((addr & 0xe00000) == 0x600000) { //$60-7f:0000-ffff while(!regs.scmr.ran && scheduler.sync != Scheduler::SynchronizeMode::All) { step(6); synchronize_cpu(); } return ram.write(addr & ram_mask, data); } } uint8 SuperFX::op_read(uint16 addr) { uint16 offset = addr - regs.cbr; if(offset < 512) { if(cache.valid[offset >> 4] == false) { unsigned dp = offset & 0xfff0; unsigned sp = (regs.pbr << 16) + ((regs.cbr + dp) & 0xfff0); for(unsigned n = 0; n < 16; n++) { step(memory_access_speed); cache.buffer[dp++] = bus_read(sp++); } cache.valid[offset >> 4] = true; } else { step(cache_access_speed); } return cache.buffer[offset]; } if(regs.pbr <= 0x5f) { //$[00-5f]:[0000-ffff] ROM rombuffer_sync(); step(memory_access_speed); return bus_read((regs.pbr << 16) + addr); } else { //$[60-7f]:[0000-ffff] RAM rambuffer_sync(); step(memory_access_speed); return bus_read((regs.pbr << 16) + addr); } } uint8 SuperFX::peekpipe() { uint8 result = regs.pipeline; regs.pipeline = op_read(regs.r[15]); r15_modified = false; return result; } uint8 SuperFX::pipe() { uint8 result = regs.pipeline; regs.pipeline = op_read(++regs.r[15]); r15_modified = false; return result; } void SuperFX::cache_flush() { for(unsigned n = 0; n < 32; n++) cache.valid[n] = false; } uint8 SuperFX::cache_mmio_read(uint16 addr) { addr = (addr + regs.cbr) & 511; return cache.buffer[addr]; } void SuperFX::cache_mmio_write(uint16 addr, uint8 data) { addr = (addr + regs.cbr) & 511; cache.buffer[addr] = data; if((addr & 15) == 15) cache.valid[addr >> 4] = true; } void SuperFX::memory_reset() { rom_mask = rom.size() - 1; ram_mask = ram.size() - 1; for(unsigned n = 0; n < 512; n++) cache.buffer[n] = 0x00; for(unsigned n = 0; n < 32; n++) cache.valid[n] = false; for(unsigned n = 0; n < 2; n++) { pixelcache[n].offset = ~0; pixelcache[n].bitpend = 0x00; } } #endif phoenix/cocoa/widget/list-view.hpp000664 001750 001750 00000004337 12651764221 020374 0ustar00sergiosergio000000 000000 @class CocoaListViewContent; @interface CocoaListView : NSScrollView { @public phoenix::ListView* listView; CocoaListViewContent* content; NSFont* font; } -(id) initWith:(phoenix::ListView&)listView; -(void) dealloc; -(CocoaListViewContent*) content; -(NSFont*) font; -(void) setFont:(NSFont*)font; -(void) reloadColumns; -(NSInteger) numberOfRowsInTableView:(NSTableView*)table; -(id) tableView:(NSTableView*)table objectValueForTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row; -(BOOL) tableView:(NSTableView*)table shouldShowCellExpansionForTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row; -(NSString*) tableView:(NSTableView*)table toolTipForCell:(NSCell*)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row mouseLocation:(NSPoint)mouseLocation; -(void) tableView:(NSTableView*)table setObjectValue:(id)object forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row; -(void) tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row; -(void) tableViewSelectionDidChange:(NSNotification*)notification; -(IBAction) activate:(id)sender; -(IBAction) doubleAction:(id)sender; @end @interface CocoaListViewContent : NSTableView { } -(void) keyDown:(NSEvent*)event; @end @interface CocoaListViewCell : NSTextFieldCell { } -(NSString*) stringValue; -(void) drawWithFrame:(NSRect)frame inView:(NSView*)view; @end namespace phoenix { struct pListView : public pWidget { ListView& listView; CocoaListView* cocoaListView = nullptr; void append(const lstring& text); void autoSizeColumns(); void remove(unsigned selection); void reset(); void setCheckable(bool checkable); void setChecked(unsigned selection, bool checked); void setFont(string font); void setHeaderText(const lstring& text); void setHeaderVisible(bool visible); void setImage(unsigned selection, unsigned position, const image& image); void setSelected(bool selected); void setSelection(unsigned selection); void setText(unsigned selection, unsigned position, string text); pListView(ListView& listView) : pWidget(listView), listView(listView) {} void constructor(); void destructor(); }; } phoenix/qt/widget/vertical-slider.cpp000664 001750 001750 00000001722 12651764221 021070 0ustar00sergiosergio000000 000000 namespace phoenix { Size pVerticalSlider::minimumSize() { return {20, 0}; } void pVerticalSlider::setLength(unsigned length) { length += length == 0; qtSlider->setRange(0, length - 1); qtSlider->setPageStep(length >> 3); } void pVerticalSlider::setPosition(unsigned position) { qtSlider->setValue(position); } void pVerticalSlider::constructor() { qtWidget = qtSlider = new QSlider(Qt::Vertical); qtSlider->setRange(0, 100); qtSlider->setPageStep(101 >> 3); connect(qtSlider, SIGNAL(valueChanged(int)), SLOT(onChange())); pWidget::synchronizeState(); setLength(verticalSlider.state.length); setPosition(verticalSlider.state.position); } void pVerticalSlider::destructor() { delete qtSlider; qtWidget = qtSlider = nullptr; } void pVerticalSlider::orphan() { destructor(); constructor(); } void pVerticalSlider::onChange() { verticalSlider.state.position = qtSlider->value(); if(verticalSlider.onChange) verticalSlider.onChange(); } } sfc/controller/justifier/justifier.cpp000664 001750 001750 00000006601 12651764221 021365 0ustar00sergiosergio000000 000000 #ifdef CONTROLLER_CPP void Justifier::enter() { unsigned prev = 0; while(true) { unsigned next = cpu.vcounter() * 1364 + cpu.hcounter(); signed x = (active == 0 ? player1.x : player2.x), y = (active == 0 ? player1.y : player2.y); bool offscreen = (x < 0 || y < 0 || x >= 256 || y >= (ppu.overscan() ? 240 : 225)); if(offscreen == false) { unsigned target = y * 1364 + (x + 24) * 4; if(next >= target && prev < target) { //CRT raster detected, toggle iobit to latch counters iobit(0); iobit(1); } } if(next < prev) { int nx1 = interface->inputPoll(port, device, 0 + (unsigned)Input::JustifierID::X); int ny1 = interface->inputPoll(port, device, 0 + (unsigned)Input::JustifierID::Y); nx1 += player1.x; ny1 += player1.y; player1.x = max(-16, min(256 + 16, nx1)); player1.y = max(-16, min(240 + 16, ny1)); } if(next < prev && chained) { int nx2 = interface->inputPoll(port, device, 4 + (unsigned)Input::JustifierID::X); int ny2 = interface->inputPoll(port, device, 4 + (unsigned)Input::JustifierID::Y); nx2 += player2.x; ny2 += player2.y; player2.x = max(-16, min(256 + 16, nx2)); player2.y = max(-16, min(240 + 16, ny2)); } prev = next; step(2); } } uint2 Justifier::data() { if(counter >= 32) return 1; if(counter == 0) { player1.trigger = interface->inputPoll(port, device, 0 + (unsigned)Input::JustifierID::Trigger); player1.start = interface->inputPoll(port, device, 0 + (unsigned)Input::JustifierID::Start); } if(counter == 0 && chained) { player2.trigger = interface->inputPoll(port, device, 4 + (unsigned)Input::JustifierID::Trigger); player2.start = interface->inputPoll(port, device, 4 + (unsigned)Input::JustifierID::Start); } switch(counter++) { case 0: return 0; case 1: return 0; case 2: return 0; case 3: return 0; case 4: return 0; case 5: return 0; case 6: return 0; case 7: return 0; case 8: return 0; case 9: return 0; case 10: return 0; case 11: return 0; case 12: return 1; //signature case 13: return 1; // || case 14: return 1; // || case 15: return 0; // || case 16: return 0; case 17: return 1; case 18: return 0; case 19: return 1; case 20: return 0; case 21: return 1; case 22: return 0; case 23: return 1; case 24: return player1.trigger; case 25: return player2.trigger; case 26: return player1.start; case 27: return player2.start; case 28: return active; case 29: return 0; case 30: return 0; case 31: return 0; } // NOT REACHED return 0; } void Justifier::latch(bool data) { if(latched == data) return; latched = data; counter = 0; if(latched == 0) active = !active; //toggle between both controllers, even when unchained } Justifier::Justifier(bool port, bool chained): Controller(port), chained(chained), device(chained == false ? (unsigned)Input::Device::Justifier : (unsigned)Input::Device::Justifiers) { create(Controller::Enter, 21477272); latched = 0; counter = 0; active = 0; player1.x = 256 / 2; player1.y = 240 / 2; player1.trigger = false; player2.start = false; player2.x = 256 / 2; player2.y = 240 / 2; player2.trigger = false; player2.start = false; if(chained == false) { player2.x = -1; player2.y = -1; } else { player1.x -= 16; player2.x += 16; } } #endif gb/cheat/cheat.cpp000664 001750 001750 00000001014 12651764221 015150 0ustar00sergiosergio000000 000000 #include namespace GameBoy { Cheat cheat; void Cheat::reset() { codes.reset(); } void Cheat::append(unsigned addr, unsigned data) { codes.append({addr, Unused, data}); } void Cheat::append(unsigned addr, unsigned comp, unsigned data) { codes.append({addr, comp, data}); } optional Cheat::find(unsigned addr, unsigned comp) { for(auto& code : codes) { if(code.addr == addr && (code.comp == Unused || code.comp == comp)) { return {true, code.data}; } } return false; } } gb/ppu/000700 001750 001750 00000000000 12656700342 013067 5ustar00sergiosergio000000 000000 nall/sort.hpp000664 001750 001750 00000004046 12651764221 014342 0ustar00sergiosergio000000 000000 #ifndef NALL_SORT_HPP #define NALL_SORT_HPP #include #include //class: merge sort //average: O(n log n) //worst: O(n log n) //memory: O(n) //stack: O(log n) //stable?: yes //note: merge sort was chosen over quick sort, because: //* it is a stable sort //* it lacks O(n^2) worst-case overhead #define NALL_SORT_INSERTION //#define NALL_SORT_SELECTION namespace nall { template void sort(T list[], unsigned size, const Comparator& lessthan) { if(size <= 1) return; //nothing to sort //use insertion sort to quickly sort smaller blocks if(size < 64) { #if defined(NALL_SORT_INSERTION) for(signed i = 1, j; i < size; i++) { T copy = std::move(list[i]); for(j = i - 1; j >= 0; j--) { if(!lessthan(copy, list[j])) break; list[j + 1] = std::move(list[j]); } list[j + 1] = std::move(copy); } #elif defined(NALL_SORT_SELECTION) for(unsigned i = 0; i < size; i++) { unsigned min = i; for(unsigned j = i + 1; j < size; j++) { if(lessthan(list[j], list[min])) min = j; } if(min != i) std::swap(list[i], list[min]); } #endif return; } //split list in half and recursively sort both unsigned middle = size / 2; sort(list, middle, lessthan); sort(list + middle, size - middle, lessthan); //left and right are sorted here; perform merge sort T* buffer = new T[size]; unsigned offset = 0, left = 0, right = middle; while(left < middle && right < size) { if(!lessthan(list[right], list[left])) { buffer[offset++] = std::move(list[left++]); } else { buffer[offset++] = std::move(list[right++]); } } while(left < middle) buffer[offset++] = std::move(list[left++]); while(right < size) buffer[offset++] = std::move(list[right++]); for(unsigned i = 0; i < size; i++) list[i] = std::move(buffer[i]); delete[] buffer; } template void sort(T list[], unsigned size) { return sort(list, size, [](const T& l, const T& r) { return l < r; }); } } #endif ananke/patch.cpp000664 001750 001750 00000000764 12651764221 014757 0ustar00sergiosergio000000 000000 void Ananke::applyBeatPatch(vector &buffer) { string name = {information.path, nall::basename(information.name), ".bps"}; if(!file::exists(name)) return; bpspatch patch; if(patch.modify(name) == false) return; patch.source(buffer.data(), buffer.size()); vector output; output.resize(patch.size()); patch.target(output.data(), output.size()); if(patch.apply() == bpspatch::result::success) { buffer = output; information.manifest = patch.metadata(); } } phoenix/reference/widget/combo-button.hpp000664 001750 001750 00000000621 12651764221 021723 0ustar00sergiosergio000000 000000 namespace phoenix { struct pComboButton : public pWidget { ComboButton& comboButton; void append(string text); void remove(unsigned selection); void reset(); void setSelection(unsigned selection); void setText(unsigned selection, string text); pComboButton(ComboButton& comboButton) : pWidget(comboButton), comboButton(comboButton) {} void constructor(); void destructor(); }; } ananke/resource/resource.cpp000664 001750 001750 00000036420 12651764221 017334 0ustar00sergiosergio000000 000000 namespace resource { const uint8_t home[606] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255, 97,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187,127,0,0,0,9,112,72,89,115,0,0,13,215,0, 0,13,215,1,66,40,155,120,0,0,0,7,116,73,77,69,7,213,10,14,20,37,19,83,42,210,59,0,0,1,235,73, 68,65,84,56,203,149,147,191,107,83,81,20,128,191,123,251,222,75,211,64,242,36,160,85,135,100,81,123,19,104,85,172, 17,92,28,140,66,19,167,135,212,74,39,145,162,163,24,92,58,180,110,193,169,254,24,234,212,37,139,245,199,96,19,240, 15,240,63,16,121,91,92,196,90,219,240,98,81,137,33,121,215,33,246,217,151,80,33,103,186,92,206,247,221,115,14,231, 194,1,225,41,85,172,128,174,128,246,148,122,200,48,177,7,123,74,105,79,169,61,73,113,104,120,177,56,163,203,55,111, 252,87,34,250,225,154,235,110,20,148,98,253,220,89,182,39,78,113,228,240,56,39,188,38,83,107,107,212,92,151,130,82, 215,14,185,110,117,64,176,31,126,83,156,97,247,248,49,148,202,50,22,141,210,106,181,24,219,252,74,182,92,30,144,136, 126,184,122,251,22,157,100,146,116,42,77,42,149,2,64,107,104,183,219,236,214,235,156,44,149,66,18,177,31,126,247,160, 68,199,48,201,229,46,96,219,118,208,154,214,26,0,223,247,249,185,181,69,114,110,46,144,136,10,232,130,82,188,127,84, 198,107,54,57,63,157,35,30,143,35,132,8,9,124,223,15,206,134,16,140,230,243,212,92,23,3,184,3,172,78,157,62, 195,253,210,61,54,170,111,3,240,201,202,51,86,30,63,69,139,17,116,167,133,48,70,209,221,223,44,47,45,209,238,165, 204,202,121,120,190,48,153,33,17,79,0,160,212,4,153,140,34,155,205,244,94,20,146,145,244,149,222,196,83,121,144,22, 90,107,22,38,51,204,195,186,236,239,211,178,44,76,211,196,48,140,224,254,75,227,7,0,31,234,59,116,187,126,144,11, 48,32,144,82,34,165,196,146,159,1,232,96,241,241,83,3,128,111,222,47,58,34,18,90,36,99,96,179,254,14,207,231, 40,0,151,46,78,115,53,26,67,234,113,46,75,147,237,77,66,21,24,253,21,252,155,126,239,165,239,222,14,162,217,56, 112,245,3,65,36,18,193,182,109,18,137,4,2,137,16,16,139,197,112,28,103,0,178,44,43,252,23,174,207,58,175,0, 135,225,98,245,229,139,215,119,255,0,86,248,213,163,133,187,128,26,0,0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t up[652] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255, 97,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100,136,0,0,0,25,116,69,88,116,83,111,102,116,119,97,114, 101,0,119,119,119,46,105,110,107,115,99,97,112,101,46,111,114,103,155,238,60,26,0,0,2,30,73,68,65,84,56,141, 149,147,79,104,19,65,20,198,191,55,187,51,217,141,133,122,104,76,255,209,130,4,237,193,64,42,168,208,213,138,104,68, 98,69,45,20,114,107,74,201,73,144,98,22,193,171,199,82,145,160,23,15,69,79,30,165,66,241,226,77,42,94,68,80, 208,67,41,180,42,149,148,52,137,166,154,38,217,217,25,15,81,172,33,169,246,29,223,251,230,199,124,223,155,33,173,53, 218,213,201,155,124,30,0,150,102,189,233,118,26,214,110,224,184,60,221,223,21,73,246,117,29,76,58,46,79,239,9,224, 184,60,26,16,251,178,87,206,76,6,199,70,147,193,128,8,102,29,151,71,255,11,224,184,188,3,132,197,137,115,211,214, 150,151,199,150,183,137,248,200,37,11,132,69,199,229,29,255,4,16,225,209,232,112,162,167,55,52,72,159,75,31,240,177, 244,30,157,157,157,20,27,58,209,13,194,195,93,1,142,203,211,253,7,34,137,179,71,199,249,74,254,13,12,198,97,50, 142,87,107,11,136,13,29,23,161,253,61,137,230,60,216,142,195,81,193,237,108,42,225,218,235,229,101,104,242,32,132,137, 58,125,199,54,21,241,46,255,28,23,78,95,13,154,166,248,43,15,182,211,247,212,88,198,82,228,161,34,75,16,1,1, 30,224,40,203,117,8,219,64,65,174,162,168,86,113,254,212,69,139,216,159,60,216,111,223,241,99,227,221,135,250,98,148, 175,172,193,228,6,56,55,80,81,5,84,141,175,16,54,131,176,25,150,191,189,64,184,55,68,71,14,15,135,137,53,242, 160,145,140,153,30,232,142,100,111,76,220,177,5,15,64,65,194,135,135,215,185,5,188,45,60,131,100,21,16,35,36,6, 50,208,90,67,41,160,94,175,225,241,211,249,74,177,180,57,99,18,67,234,83,110,197,158,185,119,185,225,137,163,122,247, 250,19,171,44,115,240,141,109,112,193,192,76,130,193,9,115,15,110,87,101,77,91,191,236,7,137,33,101,46,205,122,78, 211,38,180,214,10,165,250,23,48,131,96,112,6,30,104,64,100,77,91,47,231,60,218,245,29,0,128,210,62,126,212,139, 141,43,251,26,178,174,160,85,235,63,99,182,106,250,74,162,90,219,134,50,53,160,21,124,73,240,189,61,0,164,47,17, 31,188,6,98,0,49,2,17,246,0,32,108,220,186,63,25,110,37,38,194,70,115,239,39,48,247,197,219,182,208,154,34, 0,0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t folder[1176] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122, 244,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100,136,0,0,0,9,112,72,89,115,0,0,13,215,0,0,13, 215,1,66,40,155,120,0,0,0,25,116,69,88,116,83,111,102,116,119,97,114,101,0,119,119,119,46,105,110,107,115,99, 97,112,101,46,111,114,103,155,238,60,26,0,0,4,21,73,68,65,84,88,133,237,151,61,111,28,69,24,199,127,51,187, 119,123,175,246,57,145,48,9,5,86,148,194,31,0,9,5,33,83,110,149,130,26,137,2,90,58,62,64,36,62,64,74, 132,68,133,104,161,67,72,167,64,23,201,138,2,138,210,69,194,198,196,40,22,198,247,186,119,222,151,153,157,25,138,123, 201,58,119,142,19,114,82,40,248,75,143,118,118,118,247,121,126,243,60,51,179,187,34,12,67,94,167,228,107,141,254,95, 0,240,1,110,220,184,225,43,165,126,54,198,188,119,209,3,66,136,220,90,251,249,195,135,15,191,92,25,64,154,166,91, 149,74,229,157,155,55,111,250,73,146,224,156,3,192,90,11,48,63,159,182,253,59,119,238,220,222,222,222,254,254,209,163, 71,199,43,1,80,74,101,213,106,213,29,29,29,209,233,116,112,206,45,53,0,33,4,155,155,155,249,193,193,193,71,192, 237,149,0,104,173,211,44,203,196,165,75,27,24,99,176,214,158,9,92,204,132,16,130,106,181,90,63,60,60,252,98,123, 123,251,214,172,127,153,156,115,218,90,251,241,222,222,222,143,207,5,0,178,44,203,188,78,167,75,167,211,153,3,204,142, 179,32,197,64,91,91,91,245,70,163,65,179,217,68,8,129,16,2,0,41,229,188,29,69,17,247,238,221,187,5,60,31, 224,242,229,203,105,191,223,247,54,54,90,104,173,23,0,150,149,98,166,56,142,1,230,16,69,139,227,24,99,76,237,188, 224,115,128,221,221,93,117,237,218,53,217,235,245,230,25,0,150,130,204,178,81,212,108,196,197,224,82,202,25,64,229,66, 0,0,99,140,109,54,215,100,154,102,220,63,180,220,221,63,27,228,188,58,63,171,25,204,228,153,22,206,93,185,206,219, 31,232,226,61,158,39,190,93,255,253,155,79,206,0,56,231,116,183,219,245,187,221,46,143,59,13,62,253,240,93,174,191, 181,81,112,54,61,62,47,250,18,200,105,207,60,206,147,206,152,175,190,187,255,254,236,188,152,1,221,104,212,171,90,107, 212,31,146,102,181,204,254,223,99,162,56,159,140,108,233,104,207,35,17,11,77,1,52,42,62,42,211,8,65,103,118,121, 190,21,27,99,116,191,63,160,219,237,18,103,150,122,181,132,53,147,27,228,212,193,179,134,59,207,220,83,179,19,179,214, 145,100,134,52,203,193,137,249,6,86,44,65,86,169,4,180,90,45,50,35,168,5,37,172,83,120,114,53,175,139,113,154, 83,111,250,140,134,57,214,186,39,11,0,121,158,171,40,26,209,239,15,208,230,13,170,129,143,115,14,79,158,155,231,23, 147,131,81,170,209,185,37,240,37,113,170,173,49,249,209,2,128,49,38,43,151,75,84,155,27,172,213,202,56,64,10,177, 188,248,47,40,227,28,163,84,147,91,135,231,9,130,178,199,105,146,41,33,196,201,2,128,181,54,27,141,198,28,15,20, 235,245,75,232,220,190,210,232,51,109,137,51,3,78,224,79,253,148,61,201,232,84,229,130,167,147,176,152,129,212,247,125, 188,32,160,73,153,76,217,11,131,76,230,152,195,186,201,62,97,236,196,84,110,151,173,72,156,131,193,40,181,185,115,139, 0,214,218,100,60,30,211,25,248,84,90,101,162,68,147,233,233,75,8,200,141,69,27,135,206,45,185,153,110,203,47,153, 149,68,25,134,227,196,19,210,91,90,130,84,8,129,12,26,148,74,62,163,68,19,37,154,84,25,148,182,47,29,108,153, 226,44,231,52,209,62,231,148,32,142,227,83,122,81,133,74,13,30,159,196,12,99,189,212,209,191,145,0,134,177,66,25, 83,250,245,234,94,47,124,252,12,128,181,54,6,129,245,107,100,185,37,138,53,74,95,60,15,94,84,82,10,78,134,9, 82,200,56,220,221,157,59,62,51,7,146,36,33,74,12,87,175,4,84,3,143,160,188,186,111,86,41,4,105,170,144,82, 12,139,253,197,18,36,0,154,18,235,85,143,122,105,21,85,127,42,231,28,253,36,65,88,59,88,0,104,183,219,98,103, 103,199,68,177,98,112,234,248,243,100,136,236,190,226,14,184,68,199,199,67,155,36,195,7,187,237,118,45,12,195,120,14, 0,120,81,20,253,244,203,161,248,76,173,227,255,182,255,202,31,187,103,228,192,2,88,157,30,28,63,248,225,235,226,53, 49,251,53,107,183,219,205,96,109,237,205,90,208,218,116,56,41,133,92,201,18,200,141,49,42,75,107,185,16,121,62,58, 233,1,127,133,97,216,91,0,152,66,72,32,96,146,153,124,21,0,83,5,64,10,168,48,12,207,44,45,241,255,207,233, 235,6,248,7,188,50,165,151,203,8,55,43,0,0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t file[844] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122, 244,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100,136,0,0,3,3,73,68,65,84,88,133,229,151,79,110,212, 48,24,197,127,182,227,56,81,39,116,36,132,0,169,167,226,2,101,209,93,239,192,150,37,171,46,43,245,4,92,164,183, 40,82,89,21,36,134,84,76,18,59,44,90,91,142,243,103,50,21,59,62,201,138,227,120,236,247,189,247,252,37,3,255, 123,136,116,224,234,234,234,67,150,101,55,64,165,148,66,74,137,115,14,107,109,104,93,215,133,107,220,95,26,3,118,93, 215,125,188,185,185,249,26,239,151,141,16,9,113,125,113,113,81,61,247,195,120,223,247,131,121,241,253,202,126,117,121,121, 121,13,44,3,176,214,110,1,110,111,111,17,66,32,165,12,87,41,37,74,41,148,82,8,33,80,74,177,221,110,209,90, 15,158,167,125,33,4,251,253,158,166,105,182,233,126,50,29,232,251,30,33,68,104,64,88,208,55,207,78,215,117,24,99, 70,191,247,109,77,140,24,112,206,133,13,98,6,210,38,165,164,40,138,48,127,42,60,16,159,200,20,168,17,3,206,185, 17,11,177,4,49,40,231,28,77,211,28,204,114,137,141,17,0,107,109,232,207,177,224,159,41,165,208,90,31,100,97,9, 200,36,3,233,230,233,189,181,150,60,207,41,203,146,186,174,233,186,46,204,91,202,124,21,0,207,192,156,9,1,140,49, 20,69,65,93,215,100,89,70,158,231,3,173,231,50,127,17,128,88,123,127,239,105,55,198,96,140,161,109,219,85,174,95, 13,96,202,132,41,35,62,218,182,5,240,213,110,113,211,163,25,72,179,23,66,208,52,13,90,235,80,92,252,243,199,199, 199,229,244,97,210,172,7,37,136,93,47,165,164,170,42,178,44,67,8,193,201,201,73,232,151,101,57,152,63,197,194,139, 37,136,77,168,181,198,90,27,42,97,215,117,97,222,210,113,92,205,128,215,50,205,222,103,16,75,226,156,11,12,120,64, 62,203,41,38,142,146,32,213,190,239,123,172,181,225,69,228,105,143,193,214,117,141,115,110,86,134,163,0,196,11,11,33, 200,178,140,170,170,6,115,235,186,14,114,120,79,40,165,70,155,28,205,64,74,181,7,32,165,28,248,195,24,67,158,231, 1,172,82,106,117,89,158,5,144,158,231,212,7,113,40,165,6,12,120,169,210,170,184,20,171,142,161,47,54,177,254,254, 236,123,205,227,58,177,219,237,86,3,152,250,34,26,80,37,132,96,179,217,80,150,229,200,96,155,205,6,173,245,96,190, 49,38,48,177,6,196,162,9,189,15,178,44,27,140,123,96,109,219,142,36,136,95,90,107,98,214,3,177,9,211,240,99, 190,8,77,197,161,162,52,11,32,149,96,238,37,3,79,18,164,0,60,232,135,135,135,17,107,171,1,132,135,82,6,157, 227,240,0,119,187,221,8,160,63,5,167,167,167,65,138,163,62,201,226,5,189,235,167,88,232,251,30,173,245,36,56,95, 71,252,247,229,82,164,167,160,146,82,254,234,251,254,213,217,217,89,24,156,211,185,40,138,197,197,211,242,155,231,249,14, 120,7,252,4,246,41,128,10,120,115,127,127,255,249,252,252,252,19,80,46,174,190,50,242,60,167,105,26,132,16,127,238, 238,238,190,0,239,1,5,124,7,92,156,90,14,188,5,94,3,91,192,60,79,252,23,241,135,167,100,107,224,7,240,13, 248,13,19,127,78,159,55,46,158,1,173,43,103,135,195,1,45,79,180,239,129,96,140,191,182,58,238,12,241,249,173,246, 0,0,0,0,73,69,78,68,174,66,96,130, }; const uint8_t archive[1067] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122, 244,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100,136,0,0,3,226,73,68,65,84,88,133,237,150,95,136,212, 85,20,199,63,231,222,251,251,253,102,102,103,255,142,166,27,150,150,88,144,102,127,31,218,40,49,200,36,136,68,200,30, 20,218,212,13,89,84,8,138,30,138,222,10,122,232,205,212,44,89,55,145,192,146,32,168,232,37,42,208,212,84,212,165, 32,162,168,101,21,203,221,213,253,51,237,56,51,191,223,189,61,252,134,217,217,117,86,155,26,240,161,253,194,225,222,115, 239,253,157,251,189,231,158,223,57,23,102,49,139,255,59,228,90,147,189,47,164,151,26,63,120,51,12,243,107,156,184,60, 14,59,229,75,135,2,130,234,70,5,45,114,196,89,121,233,185,247,198,142,215,68,96,223,150,166,37,126,144,58,168,148, 190,115,249,163,107,82,205,109,237,68,81,136,32,24,63,0,229,163,76,2,209,1,202,76,138,232,4,202,11,80,58,32, 180,206,253,240,117,143,244,159,250,232,47,27,113,209,138,125,165,115,87,246,208,117,9,236,239,106,190,77,18,254,137,101, 43,58,91,231,45,186,67,141,12,156,117,103,15,127,38,78,0,231,112,81,30,163,4,163,193,211,130,209,130,167,193,76, 235,39,146,45,100,30,123,195,93,56,190,215,133,131,167,213,207,231,70,115,69,203,182,141,239,142,247,84,238,167,43,149, 3,93,201,5,36,147,199,239,93,221,221,182,248,129,213,122,252,66,31,167,191,249,88,10,133,43,216,40,196,218,8,37, 160,68,80,10,180,18,148,18,180,2,53,173,47,46,79,225,242,79,114,83,199,139,146,255,227,20,173,137,208,27,30,203, 175,122,250,65,51,240,233,201,98,223,85,30,120,191,171,97,94,50,149,60,185,108,229,166,246,246,37,29,218,141,253,138, 23,52,80,140,38,157,100,157,5,107,65,25,68,123,177,168,88,40,181,162,13,136,46,27,78,54,207,167,144,27,167,175, 119,45,162,52,191,93,24,155,112,214,110,234,220,147,61,88,38,208,179,49,61,55,104,76,29,107,91,176,116,161,56,114, 67,3,125,233,71,158,121,141,230,185,183,146,27,57,55,121,95,162,64,52,136,138,5,13,74,226,13,69,202,115,18,7, 40,0,65,67,134,200,193,151,59,214,227,108,33,151,12,252,68,54,151,15,113,172,239,220,147,61,36,123,55,55,181,25, 99,135,1,252,32,117,62,44,230,191,187,253,190,39,215,221,179,122,27,209,200,47,224,44,206,89,112,46,182,234,92,172, 151,250,255,100,204,207,220,69,118,228,34,95,125,240,242,69,92,120,38,178,246,9,0,177,108,85,198,68,111,3,160,100, 205,149,98,126,69,208,152,121,106,249,170,173,68,163,191,99,139,19,216,98,14,23,94,41,139,13,167,233,197,220,117,199, 242,127,158,165,113,206,34,238,94,185,161,69,180,30,182,74,47,22,56,234,20,59,167,252,5,7,182,207,57,252,248,230, 221,15,167,51,11,175,153,31,254,11,190,221,191,61,55,116,254,199,141,157,187,42,98,0,96,95,119,211,67,98,237,81, 165,117,81,68,121,162,52,206,70,53,152,118,51,206,136,196,182,28,46,111,163,40,0,120,126,79,86,166,16,112,32,31, 118,55,183,0,20,109,116,169,99,237,171,12,28,235,169,110,177,70,220,124,255,58,190,255,124,7,158,210,109,0,158,248, 197,103,119,13,102,1,76,153,37,56,118,143,94,6,232,221,146,38,145,74,147,76,165,235,66,32,72,54,2,176,161,100, 191,18,230,170,213,37,40,109,240,147,13,117,33,160,141,55,227,220,140,4,180,241,240,19,245,241,128,54,126,237,4,140, 246,8,18,245,241,128,249,247,30,184,145,4,60,143,160,78,49,96,252,242,21,248,64,225,90,4,2,160,21,226,138,103, 252,20,184,90,114,65,21,136,66,169,114,209,189,5,24,3,46,1,81,53,2,205,64,198,41,111,112,184,255,204,220,204, 194,142,210,112,69,146,113,149,9,199,149,117,87,117,77,220,14,245,247,97,197,27,2,230,151,246,140,74,36,166,16,208, 37,221,251,226,244,196,91,216,157,175,11,97,75,141,231,173,10,135,25,249,228,196,196,59,64,2,240,168,120,135,76,207, 249,173,64,166,212,6,196,119,86,15,20,0,5,100,137,79,126,30,40,86,35,0,144,4,90,74,155,207,24,164,53,34, 36,190,143,81,96,28,38,31,183,215,171,122,245,170,138,51,87,170,89,220,104,252,13,162,179,143,166,193,167,182,66,0, 0,0,0,73,69,78,68,174,66,96,130, }; }; ruby/video.hpp000664 001750 001750 00000001360 12651764221 014510 0ustar00sergiosergio000000 000000 struct Video { static const char* Handle; static const char* Synchronize; static const char* Depth; static const char* Filter; static const char* Shader; static const unsigned FilterNearest; static const unsigned FilterLinear; virtual bool cap(const nall::string& name) { return false; } virtual nall::any get(const nall::string& name) { return false; } virtual bool set(const nall::string& name, const nall::any& value) { return false; } virtual bool lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) { return false; } virtual void unlock() {} virtual void clear() {} virtual void refresh() {} virtual bool init() { return true; } virtual void term() {} Video() {} virtual ~Video() {} }; nall/inflate.hpp000664 001750 001750 00000017644 12651764221 015005 0ustar00sergiosergio000000 000000 #ifndef NALL_INFLATE_HPP #define NALL_INFLATE_HPP #include namespace nall { namespace puff { inline int puff( unsigned char* dest, unsigned long* destlen, unsigned char* source, unsigned long* sourcelen ); } inline bool inflate( uint8_t* target, unsigned targetLength, const uint8_t* source, unsigned sourceLength ) { unsigned long tl = targetLength, sl = sourceLength; int result = puff::puff((unsigned char*)target, &tl, (unsigned char*)source, &sl); return result == 0; } namespace puff { enum { MAXBITS = 15, MAXLCODES = 286, MAXDCODES = 30, FIXLCODES = 288, MAXCODES = MAXLCODES + MAXDCODES, }; struct state { unsigned char* out; unsigned long outlen; unsigned long outcnt; unsigned char* in; unsigned long inlen; unsigned long incnt; int bitbuf; int bitcnt; jmp_buf env; }; struct huffman { short* count; short* symbol; }; inline int bits(state* s, int need) { long val; val = s->bitbuf; while(s->bitcnt < need) { if(s->incnt == s->inlen) longjmp(s->env, 1); val |= (long)(s->in[s->incnt++]) << s->bitcnt; s->bitcnt += 8; } s->bitbuf = (int)(val >> need); s->bitcnt -= need; return (int)(val & ((1L << need) - 1)); } inline int stored(state* s) { unsigned len; s->bitbuf = 0; s->bitcnt = 0; if(s->incnt + 4 > s->inlen) return 2; len = s->in[s->incnt++]; len |= s->in[s->incnt++] << 8; if(s->in[s->incnt++] != (~len & 0xff) || s->in[s->incnt++] != ((~len >> 8) & 0xff) ) return 2; if(s->incnt + len > s->inlen) return 2; if(s->out != nullptr) { if(s->outcnt + len > s->outlen) return 1; while(len--) s->out[s->outcnt++] = s->in[s->incnt++]; } else { s->outcnt += len; s->incnt += len; } return 0; } inline int decode(state* s, huffman* h) { int len, code, first, count, index, bitbuf, left; short* next; bitbuf = s->bitbuf; left = s->bitcnt; code = first = index = 0; len = 1; next = h->count + 1; while(true) { while(left--) { code |= bitbuf & 1; bitbuf >>= 1; count = *next++; if(code - count < first) { s->bitbuf = bitbuf; s->bitcnt = (s->bitcnt - len) & 7; return h->symbol[index + (code - first)]; } index += count; first += count; first <<= 1; code <<= 1; len++; } left = (MAXBITS + 1) - len; if(left == 0) break; if(s->incnt == s->inlen) longjmp(s->env, 1); bitbuf = s->in[s->incnt++]; if(left > 8) left = 8; } return -10; } inline int construct(huffman* h, short* length, int n) { int symbol, len, left; short offs[MAXBITS + 1]; for(len = 0; len <= MAXBITS; len++) h->count[len] = 0; for(symbol = 0; symbol < n; symbol++) h->count[length[symbol]]++; if(h->count[0] == n) return 0; left = 1; for(len = 1; len <= MAXBITS; len++) { left <<= 1; left -= h->count[len]; if(left < 0) return left; } offs[1] = 0; for(len = 1; len < MAXBITS; len++) offs[len + 1] = offs[len] + h->count[len]; for(symbol = 0; symbol < n; symbol++) { if(length[symbol] != 0) h->symbol[offs[length[symbol]]++] = symbol; } return left; } inline int codes(state* s, huffman* lencode, huffman* distcode) { int symbol, len; unsigned dist; static const short lens[29] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 }; static const short lext[29] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; static const short dists[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 }; static const short dext[30] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 }; do { symbol = decode(s, lencode); if(symbol < 0) return symbol; if(symbol < 256) { if(s->out != nullptr) { if(s->outcnt == s->outlen) return 1; s->out[s->outcnt] = symbol; } s->outcnt++; } else if(symbol > 256) { symbol -= 257; if(symbol >= 29) return -10; len = lens[symbol] + bits(s, lext[symbol]); symbol = decode(s, distcode); if(symbol < 0) return symbol; dist = dists[symbol] + bits(s, dext[symbol]); #ifndef INFLATE_ALLOW_INVALID_DISTANCE_TOO_FAR if(dist > s->outcnt) return -11; #endif if(s->out != nullptr) { if(s->outcnt + len > s->outlen) return 1; while(len--) { s->out[s->outcnt] = #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOO_FAR dist > s->outcnt ? 0 : #endif s->out[s->outcnt - dist]; s->outcnt++; } } else { s->outcnt += len; } } } while(symbol != 256); return 0; } inline int fixed(state* s) { static int virgin = 1; static short lencnt[MAXBITS + 1], lensym[FIXLCODES]; static short distcnt[MAXBITS + 1], distsym[MAXDCODES]; static huffman lencode, distcode; if(virgin) { int symbol = 0; short lengths[FIXLCODES]; lencode.count = lencnt; lencode.symbol = lensym; distcode.count = distcnt; distcode.symbol = distsym; for(; symbol < 144; symbol++) lengths[symbol] = 8; for(; symbol < 256; symbol++) lengths[symbol] = 9; for(; symbol < 280; symbol++) lengths[symbol] = 7; for(; symbol < FIXLCODES; symbol++) lengths[symbol] = 8; construct(&lencode, lengths, FIXLCODES); for(symbol = 0; symbol < MAXDCODES; symbol++) lengths[symbol] = 5; construct(&distcode, lengths, MAXDCODES); virgin = 0; } return codes(s, &lencode, &distcode); } inline int dynamic(state* s) { int nlen, ndist, ncode, index, err; short lengths[MAXCODES]; short lencnt[MAXBITS + 1], lensym[MAXLCODES]; short distcnt[MAXBITS + 1], distsym[MAXDCODES]; huffman lencode, distcode; static const short order[19] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; lencode.count = lencnt; lencode.symbol = lensym; distcode.count = distcnt; distcode.symbol = distsym; nlen = bits(s, 5) + 257; ndist = bits(s, 5) + 1; ncode = bits(s, 4) + 4; if(nlen > MAXLCODES || ndist > MAXDCODES) return -3; for(index = 0; index < ncode; index++) lengths[order[index]] = bits(s, 3); for(; index < 19; index++) lengths[order[index]] = 0; err = construct(&lencode, lengths, 19); if(err != 0) return -4; index = 0; while(index < nlen + ndist) { int symbol, len; symbol = decode(s, &lencode); if(symbol < 16) { lengths[index++] = symbol; } else { len = 0; if(symbol == 16) { if(index == 0) return -5; len = lengths[index - 1]; symbol = 3 + bits(s, 2); } else if(symbol == 17) { symbol = 3 + bits(s, 3); } else { symbol = 11 + bits(s, 7); } if(index + symbol > nlen + ndist) return -6; while(symbol--) lengths[index++] = len; } } if(lengths[256] == 0) return -9; err = construct(&lencode, lengths, nlen); if(err < 0 || (err > 0 && nlen - lencode.count[0] != 1)) return -7; err = construct(&distcode, lengths + nlen, ndist); if(err < 0 || (err > 0 && ndist - distcode.count[0] != 1)) return -8; return codes(s, &lencode, &distcode); } inline int puff( unsigned char* dest, unsigned long* destlen, unsigned char* source, unsigned long* sourcelen ) { state s; int last, type, err; s.out = dest; s.outlen = *destlen; s.outcnt = 0; s.in = source; s.inlen = *sourcelen; s.incnt = 0; s.bitbuf = 0; s.bitcnt = 0; if(setjmp(s.env) != 0) { err = 2; } else { do { last = bits(&s, 1); type = bits(&s, 2); err = type == 0 ? stored(&s) : type == 1 ? fixed(&s) : type == 2 ? dynamic(&s) : -1; if(err != 0) break; } while(!last); } if(err <= 0) { *destlen = s.outcnt; *sourcelen = s.incnt; } return err; } } } #endif sfc/scheduler/scheduler.hpp000664 001750 001750 00000000776 12651764221 017142 0ustar00sergiosergio000000 000000 struct Scheduler : property { enum class SynchronizeMode : unsigned { None, CPU, All } sync; enum class ExitReason : unsigned { UnknownEvent, FrameEvent, SynchronizeEvent, DebuggerEvent }; readonly exit_reason; cothread_t host_thread; //program thread (used to exit emulation) cothread_t thread; //active emulation thread (used to enter emulation) void enter(); void exit(ExitReason); void debug(); void init(); Scheduler(); }; extern Scheduler scheduler; gba/video/000700 001750 001750 00000000000 12656700342 013532 5ustar00sergiosergio000000 000000 sfc/chip/dsp2/serialization.cpp000664 001750 001750 00000001167 12651764221 017644 0ustar00sergiosergio000000 000000 #ifdef DSP2_CPP void DSP2::serialize(serializer &s) { s.integer(status.waiting_for_command); s.integer(status.command); s.integer(status.in_count); s.integer(status.in_index); s.integer(status.out_count); s.integer(status.out_index); s.array(status.parameters); s.array(status.output); s.integer(status.op05transparent); s.integer(status.op05haslen); s.integer(status.op05len); s.integer(status.op06haslen); s.integer(status.op06len); s.integer(status.op09word1); s.integer(status.op09word2); s.integer(status.op0dhaslen); s.integer(status.op0doutlen); s.integer(status.op0dinlen); } #endif shaders/Edge Detection.shader/000700 001750 001750 00000000000 12656700342 017334 5ustar00sergiosergio000000 000000 sfc/interface/interface.cpp000664 001750 001750 00000036525 12651764221 017102 0ustar00sergiosergio000000 000000 #include namespace SuperFamicom { Interface* interface = nullptr; string Interface::title() { return cartridge.title(); } double Interface::videoFrequency() { switch(system.region()) { default: case System::Region::NTSC: return system.cpu_frequency() / (262.0 * 1364.0 - 4.0); case System::Region::PAL: return system.cpu_frequency() / (312.0 * 1364.0); } } double Interface::audioFrequency() { return system.apu_frequency() / 768.0; } bool Interface::loaded() { return cartridge.loaded(); } string Interface::sha256() { return cartridge.sha256(); } unsigned Interface::group(unsigned id) { switch(id) { case ID::IPLROM: return 0; case ID::Manifest: case ID::ROM: case ID::RAM: case ID::EventROM0: case ID::EventROM1: case ID::EventROM2: case ID::EventROM3: case ID::EventRAM: case ID::SA1ROM: case ID::SA1IRAM: case ID::SA1BWRAM: case ID::SuperFXROM: case ID::SuperFXRAM: case ID::ArmDSPPROM: case ID::ArmDSPDROM: case ID::ArmDSPRAM: case ID::HitachiDSPROM: case ID::HitachiDSPRAM: case ID::HitachiDSPDROM: case ID::HitachiDSPDRAM: case ID::Nec7725DSPPROM: case ID::Nec7725DSPDROM: case ID::Nec7725DSPRAM: case ID::Nec96050DSPPROM: case ID::Nec96050DSPDROM: case ID::Nec96050DSPRAM: case ID::EpsonRTC: case ID::SharpRTC: case ID::SPC7110PROM: case ID::SPC7110DROM: case ID::SPC7110RAM: case ID::SDD1ROM: case ID::SDD1RAM: case ID::OBC1RAM: case ID::SuperGameBoyBootROM: case ID::BsxROM: case ID::BsxRAM: case ID::BsxPSRAM: return 1; case ID::SuperGameBoy: case ID::SuperGameBoyManifest: case ID::SuperGameBoyROM: case ID::SuperGameBoyRAM: return 2; case ID::Satellaview: case ID::SatellaviewManifest: case ID::SatellaviewROM: return 3; case ID::SufamiTurboSlotA: case ID::SufamiTurboSlotAManifest: case ID::SufamiTurboSlotAROM: case ID::SufamiTurboSlotARAM: return 4; case ID::SufamiTurboSlotB: case ID::SufamiTurboSlotBManifest: case ID::SufamiTurboSlotBROM: case ID::SufamiTurboSlotBRAM: return 5; } throw; } void Interface::load(unsigned id) { if(id == ID::SuperFamicom) cartridge.load(); if(id == ID::SuperGameBoy) cartridge.load_super_game_boy(); if(id == ID::Satellaview) cartridge.load_satellaview(); if(id == ID::SufamiTurboSlotA) cartridge.load_sufami_turbo_a(); if(id == ID::SufamiTurboSlotB) cartridge.load_sufami_turbo_b(); } void Interface::save() { for(auto& memory : cartridge.memory) { saveRequest(memory.id, memory.name); } } void Interface::load(unsigned id, const stream& stream) { if(id == ID::IPLROM) { stream.read(smp.iplrom, min(64u, stream.size())); } if(id == ID::Manifest) cartridge.information.markup.cartridge = stream.text(); if(id == ID::ROM) cartridge.rom.read(stream); if(id == ID::RAM) cartridge.ram.read(stream); if(id == ID::EventROM0) event.rom[0].read(stream); if(id == ID::EventROM1) event.rom[1].read(stream); if(id == ID::EventROM2) event.rom[2].read(stream); if(id == ID::EventROM3) event.rom[3].read(stream); if(id == ID::EventRAM) event.ram.read(stream); if(id == ID::SA1ROM) sa1.rom.read(stream); if(id == ID::SA1IRAM) sa1.iram.read(stream); if(id == ID::SA1BWRAM) sa1.bwram.read(stream); if(id == ID::SuperFXROM) superfx.rom.read(stream); if(id == ID::SuperFXRAM) superfx.ram.read(stream); if(id == ID::ArmDSPPROM) { for(unsigned n = 0; n < 128 * 1024; n++) armdsp.programROM[n] = stream.read(); } if(id == ID::ArmDSPDROM) { for(unsigned n = 0; n < 32 * 1024; n++) armdsp.dataROM[n] = stream.read(); } if(id == ID::ArmDSPRAM) { for(unsigned n = 0; n < 16 * 1024; n++) armdsp.programRAM[n] = stream.read(); } if(id == ID::HitachiDSPROM) hitachidsp.rom.read(stream); if(id == ID::HitachiDSPRAM) hitachidsp.ram.read(stream); if(id == ID::HitachiDSPDROM) { for(unsigned n = 0; n < 1024; n++) hitachidsp.dataROM[n] = stream.readl(3); } if(id == ID::HitachiDSPDRAM) { for(unsigned n = 0; n < 3072; n++) hitachidsp.dataRAM[n] = stream.readl(1); } if(id == ID::Nec7725DSPPROM) { for(unsigned n = 0; n < 2048; n++) necdsp.programROM[n] = stream.readl(3); } if(id == ID::Nec7725DSPDROM) { for(unsigned n = 0; n < 1024; n++) necdsp.dataROM[n] = stream.readl(2); } if(id == ID::Nec7725DSPRAM) { for(unsigned n = 0; n < 256; n++) necdsp.dataRAM[n] = stream.readl(2); } if(id == ID::Nec96050DSPPROM) { for(unsigned n = 0; n < 16384; n++) necdsp.programROM[n] = stream.readl(3); } if(id == ID::Nec96050DSPDROM) { for(unsigned n = 0; n < 2048; n++) necdsp.dataROM[n] = stream.readl(2); } if(id == ID::Nec96050DSPRAM) { for(unsigned n = 0; n < 2048; n++) necdsp.dataRAM[n] = stream.readl(2); } if(id == ID::EpsonRTC) { uint8 data[16] = {0}; stream.read(data, min(stream.size(), sizeof data)); epsonrtc.load(data); } if(id == ID::SharpRTC) { uint8 data[16] = {0}; stream.read(data, min(stream.size(), sizeof data)); sharprtc.load(data); } if(id == ID::SPC7110PROM) spc7110.prom.read(stream); if(id == ID::SPC7110DROM) spc7110.drom.read(stream); if(id == ID::SPC7110RAM) spc7110.ram.read(stream); if(id == ID::SDD1ROM) sdd1.rom.read(stream); if(id == ID::SDD1RAM) sdd1.ram.read(stream); if(id == ID::OBC1RAM) obc1.ram.read(stream); if(id == ID::SuperGameBoyBootROM) { stream.read(GameBoy::system.bootROM.sgb, min(stream.size(), 256u)); } if(id == ID::BsxROM) bsxcartridge.rom.read(stream); if(id == ID::BsxRAM) bsxcartridge.ram.read(stream); if(id == ID::BsxPSRAM) bsxcartridge.psram.read(stream); if(id == ID::SuperGameBoyManifest) cartridge.information.markup.gameBoy = stream.text(); if(id == ID::SuperGameBoyROM) { stream.read(GameBoy::cartridge.romdata, min(GameBoy::cartridge.romsize, stream.size())); } if(id == ID::SuperGameBoyRAM) { stream.read(GameBoy::cartridge.ramdata, min(GameBoy::cartridge.ramsize, stream.size())); } if(id == ID::SatellaviewManifest) cartridge.information.markup.satellaview = stream.text(); if(id == ID::SatellaviewROM) satellaviewcartridge.memory.read(stream); if(id == ID::SufamiTurboSlotAManifest) cartridge.information.markup.sufamiTurboA = stream.text(); if(id == ID::SufamiTurboSlotAROM) sufamiturboA.rom.read(stream); if(id == ID::SufamiTurboSlotBROM) sufamiturboB.rom.read(stream); if(id == ID::SufamiTurboSlotBManifest) cartridge.information.markup.sufamiTurboB = stream.text(); if(id == ID::SufamiTurboSlotARAM) sufamiturboA.ram.read(stream); if(id == ID::SufamiTurboSlotBRAM) sufamiturboB.ram.read(stream); } void Interface::save(unsigned id, const stream& stream) { if(id == ID::RAM) stream.write(cartridge.ram.data(), cartridge.ram.size()); if(id == ID::EventRAM) stream.write(event.ram.data(), event.ram.size()); if(id == ID::SA1IRAM) stream.write(sa1.iram.data(), sa1.iram.size()); if(id == ID::SA1BWRAM) stream.write(sa1.bwram.data(), sa1.bwram.size()); if(id == ID::SuperFXRAM) stream.write(superfx.ram.data(), superfx.ram.size()); if(id == ID::ArmDSPRAM) { for(unsigned n = 0; n < 16 * 1024; n++) stream.write(armdsp.programRAM[n]); } if(id == ID::HitachiDSPRAM) stream.write(hitachidsp.ram.data(), hitachidsp.ram.size()); if(id == ID::HitachiDSPDRAM) { for(unsigned n = 0; n < 3072; n++) stream.writel(hitachidsp.dataRAM[n], 1); } if(id == ID::Nec7725DSPRAM) { for(unsigned n = 0; n < 256; n++) stream.writel(necdsp.dataRAM[n], 2); } if(id == ID::Nec96050DSPRAM) { for(unsigned n = 0; n < 2048; n++) stream.writel(necdsp.dataRAM[n], 2); } if(id == ID::EpsonRTC) { uint8 data[16] = {0}; epsonrtc.save(data); stream.write(data, sizeof data); } if(id == ID::SharpRTC) { uint8 data[16] = {0}; sharprtc.save(data); stream.write(data, sizeof data); } if(id == ID::SPC7110RAM) stream.write(spc7110.ram.data(), spc7110.ram.size()); if(id == ID::SDD1RAM) stream.write(sdd1.ram.data(), sdd1.ram.size()); if(id == ID::OBC1RAM) stream.write(obc1.ram.data(), obc1.ram.size()); if(id == ID::SuperGameBoyRAM) stream.write(GameBoy::cartridge.ramdata, GameBoy::cartridge.ramsize); if(id == ID::BsxRAM) stream.write(bsxcartridge.ram.data(), bsxcartridge.ram.size()); if(id == ID::BsxPSRAM) stream.write(bsxcartridge.psram.data(), bsxcartridge.psram.size()); if(id == ID::SufamiTurboSlotARAM) stream.write(sufamiturboA.ram.data(), sufamiturboA.ram.size()); if(id == ID::SufamiTurboSlotBRAM) stream.write(sufamiturboB.ram.data(), sufamiturboB.ram.size()); } void Interface::unload() { save(); cartridge.unload(); tracerEnable(false); } void Interface::connect(unsigned port, unsigned device) { input.connect(port, (Input::Device)device); } void Interface::power() { system.power(); } void Interface::reset() { system.reset(); } void Interface::run() { system.run(); } bool Interface::rtc() { if(cartridge.has_epsonrtc()) return true; if(cartridge.has_sharprtc()) return true; return false; } void Interface::rtcsync() { if(cartridge.has_epsonrtc()) epsonrtc.sync(); if(cartridge.has_sharprtc()) sharprtc.sync(); } serializer Interface::serialize() { system.runtosave(); return system.serialize(); } bool Interface::unserialize(serializer& s) { return system.unserialize(s); } void Interface::cheatSet(const lstring& list) { cheat.reset(); //Super Game Boy if(cartridge.has_gb_slot()) { GameBoy::cheat.reset(); for(auto& codeset : list) { lstring codes = codeset.split("+"); for(auto& code : codes) { lstring part = code.split("/"); if(part.size() == 2) GameBoy::cheat.append(hex(part[0]), hex(part[1])); if(part.size() == 3) GameBoy::cheat.append(hex(part[0]), hex(part[1]), hex(part[2])); } } return; } //Super Famicom, Broadcast Satellaview, Sufami Turbo for(auto& codeset : list) { lstring codes = codeset.split("+"); for(auto& code : codes) { lstring part = code.split("/"); if(part.size() == 2) cheat.append(hex(part[0]), hex(part[1])); if(part.size() == 3) cheat.append(hex(part[0]), hex(part[1]), hex(part[2])); } } } void Interface::paletteUpdate(PaletteMode mode) { video.generate_palette(mode); } bool Interface::tracerEnable(bool trace) { string pathname = {path(group(ID::ROM)), "debug/"}; if(trace == true) directory::create(pathname); if(trace == true && !tracer.open()) { for(unsigned n = 0; n <= 999; n++) { string filename = {pathname, "trace-", format<3, '0'>(n), ".log"}; if(file::exists(filename)) continue; tracer.open(filename, file::mode::write); return true; } } if(trace == false && tracer.open()) { tracer.close(); return true; } return false; } void Interface::exportMemory() { string pathname = {path(group(ID::ROM)), "debug/"}; directory::create(pathname); file::write({pathname, "work.ram"}, cpu.wram, 128 * 1024); file::write({pathname, "video.ram"}, ppu.vram, 64 * 1024); file::write({pathname, "sprite.ram"}, ppu.oam, 544); file::write({pathname, "palette.ram"}, ppu.cgram, 512); file::write({pathname, "apu.ram"}, smp.apuram, 64 * 1024); } Interface::Interface() { interface = this; system.init(); information.name = "Super Famicom"; information.width = 256; information.height = 240; information.overscan = true; information.aspectRatio = 8.0 / 7.0; information.resettable = true; information.capability.states = true; information.capability.cheats = true; media.append({ID::SuperFamicom, "Super Famicom", "sfc", true }); media.append({ID::SuperFamicom, "Game Boy", "gb", false}); media.append({ID::SuperFamicom, "BS-X Satellaview", "bs", false}); media.append({ID::SuperFamicom, "Sufami Turbo", "st", false}); { Device device{0, ID::Port1 | ID::Port2, "Controller"}; device.input.append({ 0, 0, "B" }); device.input.append({ 1, 0, "Y" }); device.input.append({ 2, 0, "Select"}); device.input.append({ 3, 0, "Start" }); device.input.append({ 4, 0, "Up" }); device.input.append({ 5, 0, "Down" }); device.input.append({ 6, 0, "Left" }); device.input.append({ 7, 0, "Right" }); device.input.append({ 8, 0, "A" }); device.input.append({ 9, 0, "X" }); device.input.append({10, 0, "L" }); device.input.append({11, 0, "R" }); device.order = {4, 5, 6, 7, 0, 8, 1, 9, 10, 11, 2, 3}; this->device.append(device); } { Device device{1, ID::Port1 | ID::Port2, "Multitap"}; for(unsigned p = 1, n = 0; p <= 4; p++, n += 12) { device.input.append({n + 0, 0, {"Port ", p, " - ", "B" }}); device.input.append({n + 1, 0, {"Port ", p, " - ", "Y" }}); device.input.append({n + 2, 0, {"Port ", p, " - ", "Select"}}); device.input.append({n + 3, 0, {"Port ", p, " - ", "Start" }}); device.input.append({n + 4, 0, {"Port ", p, " - ", "Up" }}); device.input.append({n + 5, 0, {"Port ", p, " - ", "Down" }}); device.input.append({n + 6, 0, {"Port ", p, " - ", "Left" }}); device.input.append({n + 7, 0, {"Port ", p, " - ", "Right" }}); device.input.append({n + 8, 0, {"Port ", p, " - ", "A" }}); device.input.append({n + 9, 0, {"Port ", p, " - ", "X" }}); device.input.append({n + 10, 0, {"Port ", p, " - ", "L" }}); device.input.append({n + 11, 0, {"Port ", p, " - ", "R" }}); device.order.append(n + 4, n + 5, n + 6, n + 7, n + 0, n + 8); device.order.append(n + 1, n + 9, n + 10, n + 11, n + 2, n + 3); } this->device.append(device); } { Device device{2, ID::Port1 | ID::Port2, "Mouse"}; device.input.append({0, 1, "X-axis"}); device.input.append({1, 1, "Y-axis"}); device.input.append({2, 0, "Left" }); device.input.append({3, 0, "Right" }); device.order = {0, 1, 2, 3}; this->device.append(device); } { Device device{3, ID::Port2, "Super Scope"}; device.input.append({0, 1, "X-axis" }); device.input.append({1, 1, "Y-axis" }); device.input.append({2, 0, "Trigger"}); device.input.append({3, 0, "Cursor" }); device.input.append({4, 0, "Turbo" }); device.input.append({5, 0, "Pause" }); device.order = {0, 1, 2, 3, 4, 5}; this->device.append(device); } { Device device{4, ID::Port2, "Justifier"}; device.input.append({0, 1, "X-axis" }); device.input.append({1, 1, "Y-axis" }); device.input.append({2, 0, "Trigger"}); device.input.append({3, 0, "Start" }); device.order = {0, 1, 2, 3}; this->device.append(device); } { Device device{5, ID::Port2, "Justifiers"}; device.input.append({0, 1, "Port 1 - X-axis" }); device.input.append({1, 1, "Port 1 - Y-axis" }); device.input.append({2, 0, "Port 1 - Trigger"}); device.input.append({3, 0, "Port 1 - Start" }); device.order.append(0, 1, 2, 3); device.input.append({4, 1, "Port 2 - X-axis" }); device.input.append({5, 1, "Port 2 - Y-axis" }); device.input.append({6, 0, "Port 2 - Trigger"}); device.input.append({7, 0, "Port 2 - Start" }); device.order.append(4, 5, 6, 7); this->device.append(device); } { Device device{6, ID::Port1, "Serial USART"}; this->device.append(device); } { Device device{7, ID::Port1 | ID::Port2, "None"}; this->device.append(device); } port.append({0, "Port 1"}); port.append({1, "Port 2"}); for(auto& device : this->device) { for(auto& port : this->port) { if(device.portmask & (1 << port.id)) { port.device.append(device); } } } } } phoenix/qt/widget/canvas.cpp000664 001750 001750 00000010577 12651764221 017262 0ustar00sergiosergio000000 000000 namespace phoenix { void pCanvas::setDroppable(bool droppable) { qtCanvas->setAcceptDrops(droppable); } void pCanvas::setGeometry(Geometry geometry) { if(canvas.state.width == 0 || canvas.state.height == 0) rasterize(); unsigned width = canvas.state.width; unsigned height = canvas.state.height; if(width == 0) width = widget.state.geometry.width; if(height == 0) height = widget.state.geometry.height; if(width < geometry.width) { geometry.x += (geometry.width - width) / 2; geometry.width = width; } if(height < geometry.height) { geometry.y += (geometry.height - height) / 2; geometry.height = height; } pWidget::setGeometry(geometry); } void pCanvas::setMode(Canvas::Mode mode) { rasterize(); qtCanvas->update(); } void pCanvas::setSize(Size size) { rasterize(); qtCanvas->update(); } void pCanvas::constructor() { qtWidget = qtCanvas = new QtCanvas(*this); qtCanvas->setMouseTracking(true); pWidget::synchronizeState(); rasterize(), qtCanvas->update(); } void pCanvas::destructor() { release(); delete qtCanvas; qtWidget = qtCanvas = nullptr; } void pCanvas::orphan() { destructor(); constructor(); } void pCanvas::rasterize() { unsigned width = canvas.state.width; unsigned height = canvas.state.height; if(width == 0) width = widget.state.geometry.width; if(height == 0) height = widget.state.geometry.height; if(canvas.state.mode != Canvas::Mode::Color) { if(width != surfaceWidth || height != surfaceHeight) release(); if(!surface) surface = new QImage(width, height, QImage::Format_ARGB32); } if(canvas.state.mode == Canvas::Mode::Gradient) { nall::image image; image.allocate(width, height); image.gradient( canvas.state.gradient[0].argb(), canvas.state.gradient[1].argb(), canvas.state.gradient[2].argb(), canvas.state.gradient[3].argb() ); memcpy(surface->bits(), image.data, image.size); } if(canvas.state.mode == Canvas::Mode::Image) { nall::image image = canvas.state.image; image.scale(width, height); image.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0); memcpy(surface->bits(), image.data, image.size); } if(canvas.state.mode == Canvas::Mode::Data) { if(width == canvas.state.width && height == canvas.state.height) { memcpy(surface->bits(), canvas.state.data, width * height * sizeof(uint32_t)); } else { memset(surface->bits(), 0x00, width * height * sizeof(uint32_t)); } } surfaceWidth = width; surfaceHeight = height; } void pCanvas::release() { if(surface == nullptr) return; delete surface; surface = nullptr; surfaceWidth = 0; surfaceHeight = 0; } void pCanvas::QtCanvas::dragEnterEvent(QDragEnterEvent* event) { if(event->mimeData()->hasUrls()) { event->acceptProposedAction(); } } void pCanvas::QtCanvas::dropEvent(QDropEvent* event) { lstring paths = DropPaths(event); if(paths.empty()) return; if(self.canvas.onDrop) self.canvas.onDrop(paths); } void pCanvas::QtCanvas::leaveEvent(QEvent* event) { if(self.canvas.onMouseLeave) self.canvas.onMouseLeave(); } void pCanvas::QtCanvas::mouseMoveEvent(QMouseEvent* event) { if(self.canvas.onMouseMove) self.canvas.onMouseMove({event->pos().x(), event->pos().y()}); } void pCanvas::QtCanvas::mousePressEvent(QMouseEvent* event) { if(!self.canvas.onMousePress) return; switch(event->button()) { case Qt::LeftButton: self.canvas.onMousePress(Mouse::Button::Left); break; case Qt::MidButton: self.canvas.onMousePress(Mouse::Button::Middle); break; case Qt::RightButton: self.canvas.onMousePress(Mouse::Button::Right); break; } } void pCanvas::QtCanvas::mouseReleaseEvent(QMouseEvent* event) { if(!self.canvas.onMouseRelease) return; switch(event->button()) { case Qt::LeftButton: self.canvas.onMouseRelease(Mouse::Button::Left); break; case Qt::MidButton: self.canvas.onMouseRelease(Mouse::Button::Middle); break; case Qt::RightButton: self.canvas.onMouseRelease(Mouse::Button::Right); break; } } void pCanvas::QtCanvas::paintEvent(QPaintEvent* event) { Canvas& canvas = self.canvas; QPainter painter(self.qtCanvas); if(canvas.state.mode == Canvas::Mode::Color) { painter.fillRect(event->rect(), QBrush(QColor(canvas.state.color.red, canvas.state.color.green, canvas.state.color.blue, canvas.state.color.alpha))); } else { painter.drawImage(0, 0, *self.surface); } } pCanvas::QtCanvas::QtCanvas(pCanvas& self) : self(self) { } } phoenix/qt/font.cpp000664 001750 001750 00000002716 12651764221 015466 0ustar00sergiosergio000000 000000 namespace phoenix { string pFont::serif(unsigned size, string style) { if(size == 0) size = 8; if(style == "") style = "Normal"; return {"Serif, ", size, ", ", style}; } string pFont::sans(unsigned size, string style) { if(size == 0) size = 8; if(style == "") style = "Normal"; return {"Sans, ", size, ", ", style}; } string pFont::monospace(unsigned size, string style) { if(size == 0) size = 8; if(style == "") style = "Normal"; return {"Liberation Mono, ", size, ", ", style}; } Size pFont::size(string font, string text) { return pFont::size(pFont::create(font), text); } QFont pFont::create(string description) { lstring part; part.split<2>(",", description); for(auto& item : part) item.trim(" "); string family = "Sans"; unsigned size = 8u; bool bold = false; bool italic = false; if(part[0] != "") family = part[0]; if(part.size() >= 2) size = decimal(part[1]); if(part.size() >= 3) bold = part[2].find("Bold"); if(part.size() >= 3) italic = part[2].find("Italic"); QFont qtFont; qtFont.setFamily(family); qtFont.setPointSize(size); if(bold) qtFont.setBold(true); if(italic) qtFont.setItalic(true); return qtFont; } Size pFont::size(const QFont& qtFont, string text) { QFontMetrics metrics(qtFont); lstring lines; lines.split("\n", text); unsigned maxWidth = 0; for(auto& line : lines) { maxWidth = max(maxWidth, metrics.width(line)); } return {maxWidth, metrics.height() * lines.size()}; } } phoenix/cocoa/widget/hex-edit.cpp000664 001750 001750 00000001237 12651764221 020147 0ustar00sergiosergio000000 000000 @implementation CocoaHexEdit : NSScrollView -(id) initWith:(phoenix::HexEdit&)hexEditReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { hexEdit = &hexEditReference; } return self; } @end namespace phoenix { void pHexEdit::setColumns(unsigned columns) { } void pHexEdit::setLength(unsigned length) { } void pHexEdit::setOffset(unsigned offset) { } void pHexEdit::setRows(unsigned rows) { } void pHexEdit::update() { } void pHexEdit::constructor() { @autoreleasepool { cocoaView = cocoaHexEdit = [[CocoaHexEdit alloc] initWith:hexEdit]; } } void pHexEdit::destructor() { @autoreleasepool { [cocoaView release]; } } } sfc/system/audio.cpp000664 001750 001750 00000003475 12651764221 015625 0ustar00sergiosergio000000 000000 #ifdef SYSTEM_CPP Audio audio; void Audio::coprocessor_enable(bool state) { coprocessor = state; dspaudio.clear(); dsp_rdoffset = cop_rdoffset = 0; dsp_wroffset = cop_wroffset = 0; dsp_length = cop_length = 0; } void Audio::coprocessor_frequency(double input_frequency) { dspaudio.setFrequency(input_frequency); dspaudio.setResampler(nall::DSP::ResampleEngine::Sinc); dspaudio.setResamplerFrequency(system.apu_frequency() / 768.0); } void Audio::sample(int16 lsample, int16 rsample) { if(coprocessor == false) return interface->audioSample(lsample, rsample); dsp_buffer[dsp_wroffset] = ((uint16)lsample << 0) + ((uint16)rsample << 16); dsp_wroffset = (dsp_wroffset + 1) & buffer_mask; dsp_length = (dsp_length + 1) & buffer_mask; flush(); } void Audio::coprocessor_sample(int16 lsample, int16 rsample) { signed samples[] = {lsample, rsample}; dspaudio.sample(samples); while(dspaudio.pending()) { dspaudio.read(samples); cop_buffer[cop_wroffset] = ((uint16)samples[0] << 0) + ((uint16)samples[1] << 16); cop_wroffset = (cop_wroffset + 1) & buffer_mask; cop_length = (cop_length + 1) & buffer_mask; flush(); } } void Audio::init() { } void Audio::flush() { while(dsp_length > 0 && cop_length > 0) { uint32 dsp_sample = dsp_buffer[dsp_rdoffset]; uint32 cop_sample = cop_buffer[cop_rdoffset]; dsp_rdoffset = (dsp_rdoffset + 1) & buffer_mask; cop_rdoffset = (cop_rdoffset + 1) & buffer_mask; dsp_length--; cop_length--; signed dsp_left = (int16)(dsp_sample >> 0); signed dsp_right = (int16)(dsp_sample >> 16); signed cop_left = (int16)(cop_sample >> 0); signed cop_right = (int16)(cop_sample >> 16); interface->audioSample( sclamp<16>((dsp_left + cop_left ) / 2), sclamp<16>((dsp_right + cop_right) / 2) ); } } #endif nall/string/000700 001750 001750 00000000000 12656700342 014127 5ustar00sergiosergio000000 000000 fc/apu/triangle.cpp000664 001750 001750 00000002253 12651764221 015400 0ustar00sergiosergio000000 000000 void APU::Triangle::clock_length() { if(halt_length_counter == 0) { if(length_counter > 0) length_counter--; } } void APU::Triangle::clock_linear_length() { if(reload_linear) { linear_length_counter = linear_length; } else if(linear_length_counter) { linear_length_counter--; } if(halt_length_counter == 0) reload_linear = false; } uint8 APU::Triangle::clock() { uint8 result = step_counter & 0x0f; if((step_counter & 0x10) == 0) result ^= 0x0f; if(length_counter == 0 || linear_length_counter == 0) return result; if(--period_counter == 0) { step_counter++; period_counter = period + 1; } return result; } void APU::Triangle::power() { reset(); } void APU::Triangle::reset() { length_counter = 0; linear_length = 0; halt_length_counter = 0; period = 0; period_counter = 1; step_counter = 0; linear_length_counter = 0; reload_linear = 0; } void APU::Triangle::serialize(serializer& s) { s.integer(length_counter); s.integer(linear_length); s.integer(halt_length_counter); s.integer(period); s.integer(period_counter); s.integer(step_counter); s.integer(linear_length_counter); s.integer(reload_linear); } phoenix/cocoa/action/action.cpp000664 001750 001750 00000000456 12651764221 017711 0ustar00sergiosergio000000 000000 namespace phoenix { void pAction::setEnabled(bool enabled) { @autoreleasepool { [cocoaAction setEnabled:enabled]; } } void pAction::setVisible(bool visible) { @autoreleasepool { [cocoaAction setHidden:!visible]; } } void pAction::constructor() { } void pAction::destructor() { } } phoenix/qt/message-window.cpp000664 001750 001750 00000005343 12651764221 017450 0ustar00sergiosergio000000 000000 namespace phoenix { static QMessageBox::StandardButtons MessageWindow_buttons(MessageWindow::Buttons buttons) { QMessageBox::StandardButtons standardButtons = QMessageBox::NoButton; if(buttons == MessageWindow::Buttons::Ok) standardButtons = QMessageBox::Ok; if(buttons == MessageWindow::Buttons::OkCancel) standardButtons = QMessageBox::Ok | QMessageBox::Cancel; if(buttons == MessageWindow::Buttons::YesNo) standardButtons = QMessageBox::Yes | QMessageBox::No; if(buttons == MessageWindow::Buttons::YesNoCancel) standardButtons = QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel; return standardButtons; } static MessageWindow::Response MessageWindow_response(MessageWindow::Buttons buttons, QMessageBox::StandardButton response) { if(response == QMessageBox::Ok) return MessageWindow::Response::Ok; if(response == QMessageBox::Cancel) return MessageWindow::Response::Cancel; if(response == QMessageBox::Yes) return MessageWindow::Response::Yes; if(response == QMessageBox::No) return MessageWindow::Response::No; //MessageWindow was closed via window manager, rather than by a button; assume a cancel/no response if(buttons == MessageWindow::Buttons::Ok) return MessageWindow::Response::Ok; if(buttons == MessageWindow::Buttons::OkCancel) return MessageWindow::Response::Cancel; if(buttons == MessageWindow::Buttons::YesNo) return MessageWindow::Response::No; if(buttons == MessageWindow::Buttons::YesNoCancel) return MessageWindow::Response::Cancel; throw; } MessageWindow::Response pMessageWindow::error(MessageWindow::State& state) { return MessageWindow_response( state.buttons, QMessageBox::critical(state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : " ", QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons)) ); } MessageWindow::Response pMessageWindow::information(MessageWindow::State& state) { return MessageWindow_response( state.buttons, QMessageBox::information(state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : " ", QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons)) ); } MessageWindow::Response pMessageWindow::question(MessageWindow::State& state) { return MessageWindow_response( state.buttons, QMessageBox::question(state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : " ", QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons)) ); } MessageWindow::Response pMessageWindow::warning(MessageWindow::State& state) { return MessageWindow_response( state.buttons, QMessageBox::warning(state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : " ", QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons)) ); } } phoenix/gtk/widget/vertical-slider.cpp000664 001750 001750 00000002227 12651764221 021232 0ustar00sergiosergio000000 000000 namespace phoenix { static void VerticalSlider_change(GtkRange* gtkRange, VerticalSlider* self) { unsigned position = (unsigned)gtk_range_get_value(gtkRange); if(self->state.position == position) return; self->state.position = position; if(self->onChange) self->onChange(); } Size pVerticalSlider::minimumSize() { return {20, 0}; } void pVerticalSlider::setLength(unsigned length) { length += length == 0; gtk_range_set_range(GTK_RANGE(gtkWidget), 0, max(1u, length - 1)); gtk_range_set_increments(GTK_RANGE(gtkWidget), 1, length >> 3); } void pVerticalSlider::setPosition(unsigned position) { gtk_range_set_value(GTK_RANGE(gtkWidget), position); } void pVerticalSlider::constructor() { gtkWidget = gtk_vscale_new_with_range(0, 100, 1); gtk_scale_set_draw_value(GTK_SCALE(gtkWidget), false); g_signal_connect(G_OBJECT(gtkWidget), "value-changed", G_CALLBACK(VerticalSlider_change), (gpointer)&verticalSlider); setLength(verticalSlider.state.length); setPosition(verticalSlider.state.position); } void pVerticalSlider::destructor() { gtk_widget_destroy(gtkWidget); } void pVerticalSlider::orphan() { destructor(); constructor(); } } gb/apu/000700 001750 001750 00000000000 12656700342 013050 5ustar00sergiosergio000000 000000 sfc/controller/superscope/000700 001750 001750 00000000000 12656700342 017021 5ustar00sergiosergio000000 000000 gba/interface/000700 001750 001750 00000000000 12656700342 014364 5ustar00sergiosergio000000 000000 target-ethos/ethos.hpp000664 001750 001750 00000002417 12651764221 016155 0ustar00sergiosergio000000 000000 #include #include #include #include #include #include #include #include #include #include #include using namespace nall; #include using namespace phoenix; #include using namespace ruby; #include "configuration/configuration.hpp" #include "interface/interface.hpp" #include "utility/utility.hpp" #include "input/input.hpp" #include "window/window.hpp" #include "general/general.hpp" #include "settings/settings.hpp" #include "tools/tools.hpp" #include "resource/resource.hpp" Emulator::Interface& system(); struct Program { vector emulator; Emulator::Interface* active = nullptr; library ananke; bool pause; bool autopause; unsigned depth; //color depth; 24(bpp) or 30(bpp) string basepath; string userpath; string sharedpath; string normalFont; string boldFont; string titleFont; string monospaceFont; bool focused(); string path(string filename); void main(); void bootstrap(); Program(int argc, char** argv); }; extern Program* program; extern DSP dspaudio; sfc/chip/sdd1/000700 001750 001750 00000000000 12656700342 014224 5ustar00sergiosergio000000 000000 sfc/chip/sa1/dma/dma.cpp000664 001750 001750 00000007476 12651764221 016116 0ustar00sergiosergio000000 000000 #ifdef SA1_CPP //==================== //direct data transfer //==================== void SA1::dma_normal() { while(mmio.dtc--) { uint8 data = regs.mdr; uint32 dsa = mmio.dsa++; uint32 dda = mmio.dda++; //source and destination cannot be the same if(mmio.sd == DMA::SourceBWRAM && mmio.dd == DMA::DestBWRAM) continue; if(mmio.sd == DMA::SourceIRAM && mmio.dd == DMA::DestIRAM ) continue; switch(mmio.sd) { case DMA::SourceROM: if((dsa & 0x408000) == 0x008000 || (dsa & 0xc00000) == 0xc00000) { data = bus_read(dsa); } break; case DMA::SourceBWRAM: if((dsa & 0x40e000) == 0x006000 || (dsa & 0xf00000) == 0x400000) { data = bus_read(dsa); } break; case DMA::SourceIRAM: data = iram.read(dsa & 0x07ff); break; } if (mmio.dd == DMA::DestBWRAM) { if((dda & 0x40e000) == 0x006000 || (dda & 0xf00000) == 0x400000) { bus_write(dda, data); } } else { // mmio.dd == DMA::DestIRAM iram.write(dda & 0x07ff, data); } } mmio.dma_irqfl = true; if(mmio.dma_irqen) mmio.dma_irqcl = 0; } //((byte & 6) << 3) + (byte & 1) explanation: //transforms a byte index (0-7) into a planar index: //result[] = { 0, 1, 16, 17, 32, 33, 48, 49 }; //works for 2bpp, 4bpp and 8bpp modes //=========================== //type-1 character conversion //=========================== void SA1::dma_cc1() { cpubwram.dma = true; mmio.chdma_irqfl = true; if(mmio.chdma_irqen) { mmio.chdma_irqcl = 0; cpu.regs.irq = 1; } } uint8 SA1::dma_cc1_read(unsigned addr) { //16 bytes/char (2bpp); 32 bytes/char (4bpp); 64 bytes/char (8bpp) unsigned charmask = (1 << (6 - mmio.dmacb)) - 1; if((addr & charmask) == 0) { //buffer next character to I-RAM unsigned bpp = 2 << (2 - mmio.dmacb); unsigned bpl = (8 << mmio.dmasize) >> mmio.dmacb; unsigned bwmask = bwram.size() - 1; unsigned tile = ((addr - mmio.dsa) & bwmask) >> (6 - mmio.dmacb); unsigned ty = (tile >> mmio.dmasize); unsigned tx = tile & ((1 << mmio.dmasize) - 1); unsigned bwaddr = mmio.dsa + ty * 8 * bpl + tx * bpp; for(unsigned y = 0; y < 8; y++) { uint64 data = 0; for(unsigned byte = 0; byte < bpp; byte++) { data |= (uint64)bwram.read((bwaddr + byte) & bwmask) << (byte << 3); } bwaddr += bpl; uint8 out[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; for(unsigned x = 0; x < 8; x++) { out[0] |= (data & 1) << (7 - x); data >>= 1; out[1] |= (data & 1) << (7 - x); data >>= 1; if(mmio.dmacb == 2) continue; out[2] |= (data & 1) << (7 - x); data >>= 1; out[3] |= (data & 1) << (7 - x); data >>= 1; if(mmio.dmacb == 1) continue; out[4] |= (data & 1) << (7 - x); data >>= 1; out[5] |= (data & 1) << (7 - x); data >>= 1; out[6] |= (data & 1) << (7 - x); data >>= 1; out[7] |= (data & 1) << (7 - x); data >>= 1; } for(unsigned byte = 0; byte < bpp; byte++) { unsigned p = mmio.dda + (y << 1) + ((byte & 6) << 3) + (byte & 1); iram.write(p & 0x07ff, out[byte]); } } } return iram.read((mmio.dda + (addr & charmask)) & 0x07ff); } //=========================== //type-2 character conversion //=========================== void SA1::dma_cc2() { //select register file index (0-7 or 8-15) const uint8 *brf = &mmio.brf[(dma.line & 1) << 3]; unsigned bpp = 2 << (2 - mmio.dmacb); unsigned addr = mmio.dda & 0x07ff; addr &= ~((1 << (7 - mmio.dmacb)) - 1); addr += (dma.line & 8) * bpp; addr += (dma.line & 7) * 2; for(unsigned byte = 0; byte < bpp; byte++) { uint8 output = 0; for(unsigned bit = 0; bit < 8; bit++) { output |= ((brf[bit] >> byte) & 1) << (7 - bit); } iram.write(addr + ((byte & 6) << 3) + (byte & 1), output); } dma.line = (dma.line + 1) & 15; } #endif phoenix/cocoa/widget/progress-bar.cpp000664 001750 001750 00000001370 12651764221 021044 0ustar00sergiosergio000000 000000 @implementation CocoaProgressBar : NSProgressIndicator -(id) initWith:(phoenix::ProgressBar&)progressBarReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { progressBar = &progressBarReference; [self setIndeterminate:NO]; [self setMinValue:0.0]; [self setMaxValue:100.0]; } return self; } @end namespace phoenix { void pProgressBar::setPosition(unsigned position) { @autoreleasepool { [cocoaView setDoubleValue:position]; } } void pProgressBar::constructor() { @autoreleasepool { cocoaView = cocoaProgressBar = [[CocoaProgressBar alloc] initWith:progressBar]; setPosition(progressBar.state.position); } } void pProgressBar::destructor() { @autoreleasepool { [cocoaView release]; } } } nall/any.hpp000664 001750 001750 00000005415 12651764221 014143 0ustar00sergiosergio000000 000000 #ifndef NALL_ANY_HPP #define NALL_ANY_HPP #include #include namespace nall { struct any { bool empty() const { return container; } void reset() { if(container) { delete container; container = nullptr; } } const std::type_info& type() const { return container ? container->type() : typeid(void); } template any& operator=(const T& value) { typedef typename type_if< std::is_array::value, typename std::remove_extent::type>::type*, T >::type auto_t; if(type() == typeid(auto_t)) { static_cast*>(container)->value = (auto_t)value; } else { if(container) delete container; container = new holder((auto_t)value); } return *this; } any& operator=(const any& source) { if(container) { delete container; container = nullptr; } if(source.container) container = source.container->copy(); return *this; } any& operator=(any&& source) { if(container) delete container; container = source.container; source.container = nullptr; return *this; } any() = default; any(const any& source) { operator=(source); } any(any&& source) { operator=(std::move(source)); } template any(const T& value) { operator=(value); } ~any() { reset(); } private: struct placeholder { virtual const std::type_info& type() const = 0; virtual placeholder* copy() const = 0; virtual ~placeholder() {} }; placeholder* container = nullptr; template struct holder : placeholder { T value; const std::type_info& type() const { return typeid(T); } placeholder* copy() const { return new holder(value); } holder(const T& value) : value(value) {} }; template friend T any_cast(any&); template friend T any_cast(const any&); template friend T* any_cast(any*); template friend const T* any_cast(const any*); }; template T any_cast(any& value) { typedef typename std::remove_reference::type nonref; if(value.type() != typeid(nonref)) throw; return static_cast*>(value.container)->value; } template T any_cast(const any& value) { typedef const typename std::remove_reference::type nonref; if(value.type() != typeid(nonref)) throw; return static_cast*>(value.container)->value; } template T* any_cast(any* value) { if(!value || value->type() != typeid(T)) return nullptr; return &static_cast*>(value->container)->value; } template const T* any_cast(const any* value) { if(!value || value->type() != typeid(T)) return nullptr; return &static_cast*>(value->container)->value; } } #endif phoenix/cocoa/widget/button.cpp000664 001750 001750 00000003567 12651764221 017763 0ustar00sergiosergio000000 000000 @implementation CocoaButton : NSButton -(id) initWith:(phoenix::Button&)buttonReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { button = &buttonReference; [self setTarget:self]; [self setAction:@selector(activate:)]; //NSRoundedBezelStyle has a fixed height; which breaks both icons and larger/smaller text [self setBezelStyle:NSRegularSquareBezelStyle]; } return self; } -(IBAction) activate:(id)sender { if(button->onActivate) button->onActivate(); } @end namespace phoenix { Size pButton::minimumSize() { Size size = Font::size(button.font(), button.state.text); if(button.state.orientation == Orientation::Horizontal) { size.width += button.state.image.width; size.height = max(button.state.image.height, size.height); } if(button.state.orientation == Orientation::Vertical) { size.width = max(button.state.image.width, size.width); size.height += button.state.image.height; } return {size.width + 20, size.height + 4}; } void pButton::setGeometry(Geometry geometry) { pWidget::setGeometry({ geometry.x - 2, geometry.y - 2, geometry.width + 4, geometry.height + 4 }); } void pButton::setImage(const image& image, Orientation orientation) { @autoreleasepool { if(image.empty()) { [cocoaView setImage:nil]; return; } [cocoaView setImage:NSMakeImage(image)]; if(orientation == Orientation::Horizontal) [cocoaView setImagePosition:NSImageLeft]; if(orientation == Orientation::Vertical ) [cocoaView setImagePosition:NSImageAbove]; } } void pButton::setText(string text) { @autoreleasepool { [cocoaView setTitle:[NSString stringWithUTF8String:text]]; } } void pButton::constructor() { @autoreleasepool { cocoaView = cocoaButton = [[CocoaButton alloc] initWith:button]; } } void pButton::destructor() { @autoreleasepool { [cocoaView release]; } } } sfc/chip/superfx/000700 001750 001750 00000000000 12656700342 015065 5ustar00sergiosergio000000 000000 fc/cartridge/chip/vrc7.cpp000664 001750 001750 00000006453 12651764221 016564 0ustar00sergiosergio000000 000000 //Konami VRC7 //Yamaha YM2413 OPLL audio - not emulated struct VRC7 : Chip { uint8 prg_bank[3]; uint8 chr_bank[8]; uint2 mirror; uint8 irq_latch; bool irq_mode; bool irq_enable; bool irq_acknowledge; uint8 irq_counter; signed irq_scalar; bool irq_line; void main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(irq_enable) { if(irq_mode == 0) { irq_scalar -= 3; if(irq_scalar <= 0) { irq_scalar += 341; if(irq_counter == 0xff) { irq_counter = irq_latch; irq_line = 1; } else { irq_counter++; } } } if(irq_mode == 1) { if(irq_counter == 0xff) { irq_counter = irq_latch; irq_line = 1; } else { irq_counter++; } } } cpu.set_irq_line(irq_line); tick(); } } void reg_write(unsigned addr, uint8 data) { switch(addr) { case 0x8000: prg_bank[0] = data; break; case 0x8010: prg_bank[1] = data; break; case 0x9000: prg_bank[2] = data; break; case 0x9010: break; //APU addr port case 0x9030: break; //APU data port case 0xa000: chr_bank[0] = data; break; case 0xa010: chr_bank[1] = data; break; case 0xb000: chr_bank[2] = data; break; case 0xb010: chr_bank[3] = data; break; case 0xc000: chr_bank[4] = data; break; case 0xc010: chr_bank[5] = data; break; case 0xd000: chr_bank[6] = data; break; case 0xd010: chr_bank[7] = data; break; case 0xe000: mirror = data & 0x03; break; case 0xe010: irq_latch = data; break; case 0xf000: irq_mode = data & 0x04; irq_enable = data & 0x02; irq_acknowledge = data & 0x01; if(irq_enable) { irq_counter = irq_latch; irq_scalar = 341; } irq_line = 0; break; case 0xf010: irq_enable = irq_acknowledge; irq_line = 0; break; } } unsigned prg_addr(unsigned addr) const { unsigned bank = 0; switch(addr & 0xe000) { case 0x8000: bank = prg_bank[0]; break; case 0xa000: bank = prg_bank[1]; break; case 0xc000: bank = prg_bank[2]; break; case 0xe000: bank = 0xff; break; } return (bank * 0x2000) + (addr & 0x1fff); } unsigned chr_addr(unsigned addr) const { unsigned bank = chr_bank[addr / 0x0400]; return (bank * 0x0400) + (addr & 0x03ff); } unsigned ciram_addr(unsigned addr) const { switch(mirror) { case 0: return ((addr & 0x0400) >> 0) | (addr & 0x03ff); //vertical mirroring case 1: return ((addr & 0x0800) >> 1) | (addr & 0x03ff); //horizontal mirroring case 2: return 0x0000 | (addr & 0x03ff); //one-screen mirroring (first) case 3: return 0x0400 | (addr & 0x03ff); //one-screen mirroring (second) } } void power() { } void reset() { for(auto& n : prg_bank) n = 0; for(auto& n : chr_bank) n = 0; mirror = 0; irq_latch = 0; irq_mode = 0; irq_enable = 0; irq_acknowledge = 0; irq_counter = 0; irq_scalar = 0; irq_line = 0; } void serialize(serializer& s) { s.array(prg_bank); s.array(chr_bank); s.integer(mirror); s.integer(irq_latch); s.integer(irq_mode); s.integer(irq_enable); s.integer(irq_acknowledge); s.integer(irq_counter); s.integer(irq_scalar); s.integer(irq_line); } VRC7(Board& board) : Chip(board) { } }; fc/ppu/ppu.hpp000664 001750 001750 00000003427 12651764221 014427 0ustar00sergiosergio000000 000000 struct PPU : Thread { static void Main(); void main(); void tick(); void scanline(); void frame(); void power(); void reset(); uint8 read(uint16 addr); void write(uint16 addr, uint8 data); uint8 ciram_read(uint16 addr); void ciram_write(uint16 addr, uint8 data); uint8 cgram_read(uint16 addr); void cgram_write(uint16 addr, uint8 data); bool raster_enable() const; unsigned nametable_addr() const; unsigned scrollx() const; unsigned scrolly() const; unsigned sprite_height() const; uint8 chr_load(uint16 addr); void scrollx_increment(); void scrolly_increment(); void raster_pixel(); void raster_sprite(); void raster_scanline(); void serialize(serializer&); struct Status { uint8 mdr; bool field; unsigned lx; unsigned ly; uint8 bus_data; bool address_latch; uint15 vaddr; uint15 taddr; uint8 xaddr; bool nmi_hold; bool nmi_flag; //$2000 bool nmi_enable; bool master_select; bool sprite_size; unsigned bg_addr; unsigned sprite_addr; unsigned vram_increment; //$2001 uint3 emphasis; bool sprite_enable; bool bg_enable; bool sprite_edge_enable; bool bg_edge_enable; bool grayscale; //$2002 bool sprite_zero_hit; bool sprite_overflow; //$2003 uint8 oam_addr; } status; struct Raster { uint16 nametable; uint16 attribute; uint16 tiledatalo; uint16 tiledatahi; unsigned oam_iterator; unsigned oam_counter; struct OAM { uint8 id; uint8 y; uint8 tile; uint8 attr; uint8 x; uint8 tiledatalo; uint8 tiledatahi; } oam[8], soam[8]; } raster; uint32 buffer[256 * 262]; uint8 ciram[2048]; uint8 cgram[32]; uint8 oam[256]; }; extern PPU ppu; sfc/alt/smp/core/opcycle_pc.cpp000664 001750 001750 00000045676 12651764221 017640 0ustar00sergiosergio000000 000000 case 0x2f: { switch(opcode_cycle++) { case 1: rd = op_readpc(); if(0){ opcode_cycle = 0; break; } break; case 2: op_io(); break; case 3: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0xf0: { switch(opcode_cycle++) { case 1: rd = op_readpc(); if(!regs.p.z){ opcode_cycle = 0; break; } break; case 2: op_io(); break; case 3: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0xd0: { switch(opcode_cycle++) { case 1: rd = op_readpc(); if(regs.p.z){ opcode_cycle = 0; break; } break; case 2: op_io(); break; case 3: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0xb0: { switch(opcode_cycle++) { case 1: rd = op_readpc(); if(!regs.p.c){ opcode_cycle = 0; break; } break; case 2: op_io(); break; case 3: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x90: { switch(opcode_cycle++) { case 1: rd = op_readpc(); if(regs.p.c){ opcode_cycle = 0; break; } break; case 2: op_io(); break; case 3: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x70: { switch(opcode_cycle++) { case 1: rd = op_readpc(); if(!regs.p.v){ opcode_cycle = 0; break; } break; case 2: op_io(); break; case 3: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x50: { switch(opcode_cycle++) { case 1: rd = op_readpc(); if(regs.p.v){ opcode_cycle = 0; break; } break; case 2: op_io(); break; case 3: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x30: { switch(opcode_cycle++) { case 1: rd = op_readpc(); if(!regs.p.n){ opcode_cycle = 0; break; } break; case 2: op_io(); break; case 3: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x10: { switch(opcode_cycle++) { case 1: rd = op_readpc(); if(regs.p.n){ opcode_cycle = 0; break; } break; case 2: op_io(); break; case 3: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x03: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x01) != 0x01){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x13: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x01) == 0x01){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x23: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x02) != 0x02){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x33: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x02) == 0x02){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x43: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x04) != 0x04){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x53: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x04) == 0x04){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x63: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x08) != 0x08){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x73: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x08) == 0x08){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x83: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x10) != 0x10){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x93: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x10) == 0x10){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0xa3: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x20) != 0x20){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0xb3: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x20) == 0x20){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0xc3: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x40) != 0x40){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0xd3: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x40) == 0x40){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0xe3: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x80) != 0x80){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0xf3: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if((sp & 0x80) == 0x80){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x2e: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: sp = op_readdp(dp); break; case 3: rd = op_readpc(); break; case 4: op_io(); if(regs.a == sp){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0xde: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: sp = op_readdp(dp + regs.x); break; case 4: rd = op_readpc(); break; case 5: op_io(); if(regs.a == sp){ opcode_cycle = 0; break; } break; case 6: op_io(); break; case 7: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x6e: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: wr = op_readdp(dp); break; case 3: op_writedp(dp, --wr); break; case 4: rd = op_readpc(); if(wr == 0x00){ opcode_cycle = 0; break; } break; case 5: op_io(); break; case 6: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0xfe: { switch(opcode_cycle++) { case 1: rd = op_readpc(); break; case 2: op_io(); regs.y--; break; case 3: op_io(); if(regs.y == 0x00){ opcode_cycle = 0; break; } break; case 4: op_io(); break; case 5: op_io(); regs.pc += (int8)rd; opcode_cycle = 0; break; } break; } case 0x5f: { switch(opcode_cycle++) { case 1: rd = op_readpc(); break; case 2: rd |= op_readpc() << 8; regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x1f: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); dp += regs.x; break; case 4: rd = op_readaddr(dp); break; case 5: rd |= op_readaddr(dp + 1) << 8; regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x3f: { switch(opcode_cycle++) { case 1: rd = op_readpc(); break; case 2: rd |= op_readpc() << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x4f: { switch(opcode_cycle++) { case 1: rd = op_readpc(); break; case 2: op_io(); break; case 3: op_io(); break; case 4: op_writestack(regs.pc >> 8); break; case 5: op_writestack(regs.pc); regs.pc = 0xff00 | rd; opcode_cycle = 0; break; } break; } case 0x01: { switch(opcode_cycle++) { case 1: dp = 0xffde - (0 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x11: { switch(opcode_cycle++) { case 1: dp = 0xffde - (1 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x21: { switch(opcode_cycle++) { case 1: dp = 0xffde - (2 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x31: { switch(opcode_cycle++) { case 1: dp = 0xffde - (3 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x41: { switch(opcode_cycle++) { case 1: dp = 0xffde - (4 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x51: { switch(opcode_cycle++) { case 1: dp = 0xffde - (5 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x61: { switch(opcode_cycle++) { case 1: dp = 0xffde - (6 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x71: { switch(opcode_cycle++) { case 1: dp = 0xffde - (7 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x81: { switch(opcode_cycle++) { case 1: dp = 0xffde - (8 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x91: { switch(opcode_cycle++) { case 1: dp = 0xffde - (9 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0xa1: { switch(opcode_cycle++) { case 1: dp = 0xffde - (10 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0xb1: { switch(opcode_cycle++) { case 1: dp = 0xffde - (11 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0xc1: { switch(opcode_cycle++) { case 1: dp = 0xffde - (12 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0xd1: { switch(opcode_cycle++) { case 1: dp = 0xffde - (13 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0xe1: { switch(opcode_cycle++) { case 1: dp = 0xffde - (14 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0xf1: { switch(opcode_cycle++) { case 1: dp = 0xffde - (15 << 1); rd = op_readaddr(dp); break; case 2: rd |= op_readaddr(dp + 1) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_writestack(regs.pc >> 8); break; case 7: op_writestack(regs.pc); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x0f: { switch(opcode_cycle++) { case 1: rd = op_readaddr(0xffde); break; case 2: rd |= op_readaddr(0xffdf) << 8; break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_writestack(regs.pc >> 8); break; case 6: op_writestack(regs.pc); break; case 7: op_writestack(regs.p); regs.pc = rd; regs.p.b = 1; regs.p.i = 0; opcode_cycle = 0; break; } break; } case 0x6f: { switch(opcode_cycle++) { case 1: rd = op_readstack(); break; case 2: rd |= op_readstack() << 8; break; case 3: op_io(); break; case 4: op_io(); regs.pc = rd; opcode_cycle = 0; break; } break; } case 0x7f: { switch(opcode_cycle++) { case 1: regs.p = op_readstack(); break; case 2: rd = op_readstack(); break; case 3: rd |= op_readstack() << 8; break; case 4: op_io(); break; case 5: op_io(); regs.pc = rd; opcode_cycle = 0; break; } break; } gb/video/000700 001750 001750 00000000000 12656700342 013371 5ustar00sergiosergio000000 000000 target-ethos/resource/unverified.png000664 001750 001750 00000003213 12651764221 021012 0ustar00sergiosergio000000 000000 PNG  IHDR szzsBIT|dBIDATXsTUǿwNҷ;ktHЀ hʒOS֤4> >X5%fE :AQB;[ol`!I{nbgVꜪ{|WuvtwjL%^ꋿ}$kg~^ CڇmǺN<:Ic缾X8FϸOvtwjC>;-(UD[vtwӅW^{E*+7iYzf§ǒض@[G8zi閧ůA C04߁]0[,< q7utŸ^K--Mvp^+ic 9oGCSےx@[G1p!iϞfD@,DK8dd[J-P<|!TC`|Ufw㘻s[wBH(tRb>~#;>6'g {q%Q9(PaNDvs nv}~h?} L=QpFc&EgGܜ3p{;&IAETp~Awm b4++)pTanaT};@DXLʵƦJݚd dT7kH3طۅ\}}ShO`] &xZGfbQbM Nܽ'®TC(ʃsBm7bmU$rՖC1P]iNDCa;a*VO^g[u$-2? PUPlq:B gm,f?]Noo*`FVk9?zp7dYC*$k()P_WՕiC1 Pf)mr:V_R`DÝS*(@9dQ@nG%"#ܪ08@Ot&P;2<t8jH*2aV Xp * WyxCDӳwdh趟żSPvRjuG"siQ{zӪ9n ߖ@N"hwbɊ*rwXa.)*f"Ғ" ^Oozumtߗ3$@P@Oll<~% M EWR,ch8w{..KW9Fic:[k'bnki:MYٞK|/?~gkn<xN@2DAbf:+U*&rةamƧ'r=7B@QBNB dDd'E+hΛ_0@@-øf1/ s,n5~cHiCRY$h ekq]!nnOÍ1(n׏+?Fx~2M|"IENDB`sfc/chip/necdsp/necdsp.cpp000664 001750 001750 00000002233 12651764221 016642 0ustar00sergiosergio000000 000000 #include #define NECDSP_CPP namespace SuperFamicom { #include "serialization.cpp" NECDSP necdsp; void NECDSP::Enter() { necdsp.enter(); } void NECDSP::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } exec(); step(1); synchronize_cpu(); } } uint8 NECDSP::read(unsigned addr) { cpu.synchronize_coprocessors(); if(addr & Select) { return uPD96050::sr_read(); } else { return uPD96050::dr_read(); } } void NECDSP::write(unsigned addr, uint8 data) { cpu.synchronize_coprocessors(); if(addr & Select) { return uPD96050::sr_write(data); } else { return uPD96050::dr_write(data); } } uint8 NECDSP::ram_read(unsigned addr) { cpu.synchronize_coprocessors(); return uPD96050::dp_read(addr); } void NECDSP::ram_write(unsigned addr, uint8 data) { cpu.synchronize_coprocessors(); return uPD96050::dp_write(addr, data); } void NECDSP::init() { } void NECDSP::load() { } void NECDSP::unload() { } void NECDSP::power() { } void NECDSP::reset() { create(NECDSP::Enter, frequency); uPD96050::power(); } } sfc/alt/ppu-performance/mmio/mmio.hpp000664 001750 001750 00000003012 12651764221 020755 0ustar00sergiosergio000000 000000 public: uint8 mmio_read(unsigned addr); void mmio_write(unsigned addr, uint8 data); private: struct Regs { //internal uint8 ppu1_mdr; uint8 ppu2_mdr; uint16 vram_readbuffer; uint8 oam_latchdata; uint8 cgram_latchdata; uint8 bgofs_latchdata; uint8 mode7_latchdata; bool counters_latched; bool latch_hcounter; bool latch_vcounter; //$2100 bool display_disable; unsigned display_brightness; //$2102-$2103 uint16 oam_baseaddr; uint16 oam_addr; bool oam_priority; //$2105 bool bg3_priority; unsigned bgmode; //$210d uint16 mode7_hoffset; //$210e uint16 mode7_voffset; //$2115 bool vram_incmode; unsigned vram_mapping; unsigned vram_incsize; //$2116-$2117 uint16 vram_addr; //$211a unsigned mode7_repeat; bool mode7_vflip; bool mode7_hflip; //$211b-$2120 uint16 m7a; uint16 m7b; uint16 m7c; uint16 m7d; uint16 m7x; uint16 m7y; //$2121 uint16 cgram_addr; //$2126-$212a unsigned window_one_left; unsigned window_one_right; unsigned window_two_left; unsigned window_two_right; //$2133 bool mode7_extbg; bool pseudo_hires; bool overscan; bool interlace; //$213c uint16 hcounter; //$213d uint16 vcounter; } regs; uint16 get_vram_addr(); uint8 vram_read(unsigned addr); void vram_write(unsigned addr, uint8 data); uint8 oam_read(unsigned addr); void oam_write(unsigned addr, uint8 data); uint8 cgram_read(unsigned addr); void cgram_write(unsigned addr, uint8 data); void mmio_update_video_mode(); void mmio_reset(); sfc/ppu/mmio/mmio.cpp000664 001750 001750 00000060636 12651764221 015710 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP bool PPU::interlace() const { return display.interlace; } bool PPU::overscan() const { return display.overscan; } bool PPU::hires() const { return true; } void PPU::latch_counters() { cpu.synchronize_ppu(); regs.hcounter = hdot(); regs.vcounter = vcounter(); regs.counters_latched = true; } uint16 PPU::get_vram_address() { uint16 addr = regs.vram_addr; switch(regs.vram_mapping) { case 0: break; //direct mapping case 1: addr = (addr & 0xff00) | ((addr & 0x001f) << 3) | ((addr >> 5) & 7); break; case 2: addr = (addr & 0xfe00) | ((addr & 0x003f) << 3) | ((addr >> 6) & 7); break; case 3: addr = (addr & 0xfc00) | ((addr & 0x007f) << 3) | ((addr >> 7) & 7); break; } return (addr << 1); } uint8 PPU::vram_read(unsigned addr) { debugger.vram_read(addr); if(regs.display_disable || vcounter() >= (!regs.overscan ? 225 : 240)) { return vram[addr]; } return 0x00; } void PPU::vram_write(unsigned addr, uint8 data) { debugger.vram_write(addr, data); if(regs.display_disable || vcounter() >= (!regs.overscan ? 225 : 240)) { vram[addr] = data; } } uint8 PPU::oam_read(unsigned addr) { debugger.oam_read(addr); return oam[addr]; } void PPU::oam_write(unsigned addr, uint8 data) { debugger.oam_write(addr, data); oam[addr] = data; sprite.update(addr, data); } uint8 PPU::cgram_read(unsigned addr) { debugger.cgram_read(addr); return cgram[addr]; } void PPU::cgram_write(unsigned addr, uint8 data) { debugger.cgram_write(addr, data); cgram[addr] = data; } void PPU::mmio_update_video_mode() { switch(regs.bgmode) { case 0: bg1.regs.mode = Background::Mode::BPP2; bg1.regs.priority0 = 8; bg1.regs.priority1 = 11; bg2.regs.mode = Background::Mode::BPP2; bg2.regs.priority0 = 7; bg2.regs.priority1 = 10; bg3.regs.mode = Background::Mode::BPP2; bg3.regs.priority0 = 2; bg3.regs.priority1 = 5; bg4.regs.mode = Background::Mode::BPP2; bg4.regs.priority0 = 1; bg4.regs.priority1 = 4; sprite.regs.priority0 = 3; sprite.regs.priority1 = 6; sprite.regs.priority2 = 9; sprite.regs.priority3 = 12; break; case 1: bg1.regs.mode = Background::Mode::BPP4; bg2.regs.mode = Background::Mode::BPP4; bg3.regs.mode = Background::Mode::BPP2; bg4.regs.mode = Background::Mode::Inactive; if(regs.bg3_priority) { bg1.regs.priority0 = 5; bg1.regs.priority1 = 8; bg2.regs.priority0 = 4; bg2.regs.priority1 = 7; bg3.regs.priority0 = 1; bg3.regs.priority1 = 10; sprite.regs.priority0 = 2; sprite.regs.priority1 = 3; sprite.regs.priority2 = 6; sprite.regs.priority3 = 9; } else { bg1.regs.priority0 = 6; bg1.regs.priority1 = 9; bg2.regs.priority0 = 5; bg2.regs.priority1 = 8; bg3.regs.priority0 = 1; bg3.regs.priority1 = 3; sprite.regs.priority0 = 2; sprite.regs.priority1 = 4; sprite.regs.priority2 = 7; sprite.regs.priority3 = 10; } break; case 2: bg1.regs.mode = Background::Mode::BPP4; bg2.regs.mode = Background::Mode::BPP4; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 3; bg1.regs.priority1 = 7; bg2.regs.priority0 = 1; bg2.regs.priority1 = 5; sprite.regs.priority0 = 2; sprite.regs.priority1 = 4; sprite.regs.priority2 = 6; sprite.regs.priority3 = 8; break; case 3: bg1.regs.mode = Background::Mode::BPP8; bg2.regs.mode = Background::Mode::BPP4; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 3; bg1.regs.priority1 = 7; bg2.regs.priority0 = 1; bg2.regs.priority1 = 5; sprite.regs.priority0 = 2; sprite.regs.priority1 = 4; sprite.regs.priority2 = 6; sprite.regs.priority3 = 8; break; case 4: bg1.regs.mode = Background::Mode::BPP8; bg2.regs.mode = Background::Mode::BPP2; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 3; bg1.regs.priority1 = 7; bg2.regs.priority0 = 1; bg2.regs.priority1 = 5; sprite.regs.priority0 = 2; sprite.regs.priority1 = 4; sprite.regs.priority2 = 6; sprite.regs.priority3 = 8; break; case 5: bg1.regs.mode = Background::Mode::BPP4; bg2.regs.mode = Background::Mode::BPP2; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 3; bg1.regs.priority1 = 7; bg2.regs.priority0 = 1; bg2.regs.priority1 = 5; sprite.regs.priority0 = 2; sprite.regs.priority1 = 4; sprite.regs.priority2 = 6; sprite.regs.priority3 = 8; break; case 6: bg1.regs.mode = Background::Mode::BPP4; bg2.regs.mode = Background::Mode::Inactive; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 2; bg1.regs.priority1 = 5; sprite.regs.priority0 = 1; sprite.regs.priority1 = 3; sprite.regs.priority2 = 4; sprite.regs.priority3 = 6; break; case 7: if(regs.mode7_extbg == false) { bg1.regs.mode = Background::Mode::Mode7; bg2.regs.mode = Background::Mode::Inactive; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 2; bg1.regs.priority1 = 2; sprite.regs.priority0 = 1; sprite.regs.priority1 = 3; sprite.regs.priority2 = 4; sprite.regs.priority3 = 5; } else { bg1.regs.mode = Background::Mode::Mode7; bg2.regs.mode = Background::Mode::Mode7; bg3.regs.mode = Background::Mode::Inactive; bg4.regs.mode = Background::Mode::Inactive; bg1.regs.priority0 = 3; bg1.regs.priority1 = 3; bg2.regs.priority0 = 1; bg2.regs.priority1 = 5; sprite.regs.priority0 = 2; sprite.regs.priority1 = 4; sprite.regs.priority2 = 6; sprite.regs.priority3 = 7; } break; } } //INIDISP void PPU::mmio_w2100(uint8 data) { if(regs.display_disable && vcounter() == (!regs.overscan ? 225 : 240)) sprite.address_reset(); regs.display_disable = data & 0x80; regs.display_brightness = data & 0x0f; } //OBSEL void PPU::mmio_w2101(uint8 data) { sprite.regs.base_size = (data >> 5) & 7; sprite.regs.nameselect = (data >> 3) & 3; sprite.regs.tiledata_addr = (data & 3) << 14; } //OAMADDL void PPU::mmio_w2102(uint8 data) { regs.oam_baseaddr = (regs.oam_baseaddr & 0x0200) | (data << 1); sprite.address_reset(); } //OAMADDH void PPU::mmio_w2103(uint8 data) { regs.oam_priority = data & 0x80; regs.oam_baseaddr = ((data & 0x01) << 9) | (regs.oam_baseaddr & 0x01fe); sprite.address_reset(); } //OAMDATA void PPU::mmio_w2104(uint8 data) { bool latch = regs.oam_addr & 1; uint10 addr = regs.oam_addr++; if(regs.display_disable == false && vcounter() < (!regs.overscan ? 225 : 240)) addr = regs.oam_iaddr; if(addr & 0x0200) addr &= 0x021f; if(latch == 0) regs.oam_latchdata = data; if(addr & 0x0200) { oam_write(addr, data); } else if(latch == 1) { oam_write((addr & ~1) + 0, regs.oam_latchdata); oam_write((addr & ~1) + 1, data); } sprite.set_first_sprite(); } //BGMODE void PPU::mmio_w2105(uint8 data) { bg4.regs.tile_size = (data & 0x80); bg3.regs.tile_size = (data & 0x40); bg2.regs.tile_size = (data & 0x20); bg1.regs.tile_size = (data & 0x10); regs.bg3_priority = (data & 0x08); regs.bgmode = (data & 0x07); mmio_update_video_mode(); } //MOSAIC void PPU::mmio_w2106(uint8 data) { unsigned mosaic_size = (data >> 4) & 15; bg4.regs.mosaic = (data & 0x08 ? mosaic_size : 0); bg3.regs.mosaic = (data & 0x04 ? mosaic_size : 0); bg2.regs.mosaic = (data & 0x02 ? mosaic_size : 0); bg1.regs.mosaic = (data & 0x01 ? mosaic_size : 0); } //BG1SC void PPU::mmio_w2107(uint8 data) { bg1.regs.screen_addr = (data & 0x7c) << 9; bg1.regs.screen_size = data & 3; } //BG2SC void PPU::mmio_w2108(uint8 data) { bg2.regs.screen_addr = (data & 0x7c) << 9; bg2.regs.screen_size = data & 3; } //BG3SC void PPU::mmio_w2109(uint8 data) { bg3.regs.screen_addr = (data & 0x7c) << 9; bg3.regs.screen_size = data & 3; } //BG4SC void PPU::mmio_w210a(uint8 data) { bg4.regs.screen_addr = (data & 0x7c) << 9; bg4.regs.screen_size = data & 3; } //BG12NBA void PPU::mmio_w210b(uint8 data) { bg1.regs.tiledata_addr = (data & 0x07) << 13; bg2.regs.tiledata_addr = (data & 0x70) << 9; } //BG34NBA void PPU::mmio_w210c(uint8 data) { bg3.regs.tiledata_addr = (data & 0x07) << 13; bg4.regs.tiledata_addr = (data & 0x70) << 9; } //BG1HOFS void PPU::mmio_w210d(uint8 data) { regs.mode7_hoffset = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; bg1.regs.hoffset = (data << 8) | (regs.bgofs_latchdata & ~7) | ((bg1.regs.hoffset >> 8) & 7); regs.bgofs_latchdata = data; } //BG1VOFS void PPU::mmio_w210e(uint8 data) { regs.mode7_voffset = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; bg1.regs.voffset = (data << 8) | regs.bgofs_latchdata; regs.bgofs_latchdata = data; } //BG2HOFS void PPU::mmio_w210f(uint8 data) { bg2.regs.hoffset = (data << 8) | (regs.bgofs_latchdata & ~7) | ((bg2.regs.hoffset >> 8) & 7); regs.bgofs_latchdata = data; } //BG2VOFS void PPU::mmio_w2110(uint8 data) { bg2.regs.voffset = (data << 8) | regs.bgofs_latchdata; regs.bgofs_latchdata = data; } //BG3HOFS void PPU::mmio_w2111(uint8 data) { bg3.regs.hoffset = (data << 8) | (regs.bgofs_latchdata & ~7) | ((bg3.regs.hoffset >> 8) & 7); regs.bgofs_latchdata = data; } //BG3VOFS void PPU::mmio_w2112(uint8 data) { bg3.regs.voffset = (data << 8) | regs.bgofs_latchdata; regs.bgofs_latchdata = data; } //BG4HOFS void PPU::mmio_w2113(uint8 data) { bg4.regs.hoffset = (data << 8) | (regs.bgofs_latchdata & ~7) | ((bg4.regs.hoffset >> 8) & 7); regs.bgofs_latchdata = data; } //BG4VOFS void PPU::mmio_w2114(uint8 data) { bg4.regs.voffset = (data << 8) | regs.bgofs_latchdata; regs.bgofs_latchdata = data; } //VMAIN void PPU::mmio_w2115(uint8 data) { regs.vram_incmode = data & 0x80; regs.vram_mapping = (data >> 2) & 3; switch(data & 3) { case 0: regs.vram_incsize = 1; break; case 1: regs.vram_incsize = 32; break; case 2: regs.vram_incsize = 128; break; case 3: regs.vram_incsize = 128; break; } } //VMADDL void PPU::mmio_w2116(uint8 data) { regs.vram_addr &= 0xff00; regs.vram_addr |= (data << 0); uint16 addr = get_vram_address(); regs.vram_readbuffer = vram_read(addr + 0) << 0; regs.vram_readbuffer |= vram_read(addr + 1) << 8; } //VMADDH void PPU::mmio_w2117(uint8 data) { regs.vram_addr &= 0x00ff; regs.vram_addr |= (data << 8); uint16 addr = get_vram_address(); regs.vram_readbuffer = vram_read(addr + 0) << 0; regs.vram_readbuffer |= vram_read(addr + 1) << 8; } //VMDATAL void PPU::mmio_w2118(uint8 data) { uint16 addr = get_vram_address() + 0; vram_write(addr, data); if(regs.vram_incmode == 0) regs.vram_addr += regs.vram_incsize; } //VMDATAH void PPU::mmio_w2119(uint8 data) { uint16 addr = get_vram_address() + 1; vram_write(addr, data); if(regs.vram_incmode == 1) regs.vram_addr += regs.vram_incsize; } //M7SEL void PPU::mmio_w211a(uint8 data) { regs.mode7_repeat = (data >> 6) & 3; regs.mode7_vflip = data & 0x02; regs.mode7_hflip = data & 0x01; } //M7A void PPU::mmio_w211b(uint8 data) { regs.m7a = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; } //M7B void PPU::mmio_w211c(uint8 data) { regs.m7b = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; } //M7C void PPU::mmio_w211d(uint8 data) { regs.m7c = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; } //M7D void PPU::mmio_w211e(uint8 data) { regs.m7d = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; } //M7X void PPU::mmio_w211f(uint8 data) { regs.m7x = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; } //M7Y void PPU::mmio_w2120(uint8 data) { regs.m7y = (data << 8) | regs.mode7_latchdata; regs.mode7_latchdata = data; } //CGADD void PPU::mmio_w2121(uint8 data) { regs.cgram_addr = data << 1; } //CGDATA void PPU::mmio_w2122(uint8 data) { bool latch = regs.cgram_addr & 1; uint9 addr = regs.cgram_addr++; if(regs.display_disable == false && vcounter() > 0 && vcounter() < (!regs.overscan ? 225 : 240) && hcounter() >= 88 && hcounter() < 1096 ) addr = regs.cgram_iaddr; if(latch == 0) { regs.cgram_latchdata = data; } else { cgram_write((addr & ~1) + 0, regs.cgram_latchdata); cgram_write((addr & ~1) + 1, data & 0x7f); } } //W12SEL void PPU::mmio_w2123(uint8 data) { window.regs.bg2_two_enable = data & 0x80; window.regs.bg2_two_invert = data & 0x40; window.regs.bg2_one_enable = data & 0x20; window.regs.bg2_one_invert = data & 0x10; window.regs.bg1_two_enable = data & 0x08; window.regs.bg1_two_invert = data & 0x04; window.regs.bg1_one_enable = data & 0x02; window.regs.bg1_one_invert = data & 0x01; } //W34SEL void PPU::mmio_w2124(uint8 data) { window.regs.bg4_two_enable = data & 0x80; window.regs.bg4_two_invert = data & 0x40; window.regs.bg4_one_enable = data & 0x20; window.regs.bg4_one_invert = data & 0x10; window.regs.bg3_two_enable = data & 0x08; window.regs.bg3_two_invert = data & 0x04; window.regs.bg3_one_enable = data & 0x02; window.regs.bg3_one_invert = data & 0x01; } //WOBJSEL void PPU::mmio_w2125(uint8 data) { window.regs.col_two_enable = data & 0x80; window.regs.col_two_invert = data & 0x40; window.regs.col_one_enable = data & 0x20; window.regs.col_one_invert = data & 0x10; window.regs.oam_two_enable = data & 0x08; window.regs.oam_two_invert = data & 0x04; window.regs.oam_one_enable = data & 0x02; window.regs.oam_one_invert = data & 0x01; } //WH0 void PPU::mmio_w2126(uint8 data) { window.regs.one_left = data; } //WH1 void PPU::mmio_w2127(uint8 data) { window.regs.one_right = data; } //WH2 void PPU::mmio_w2128(uint8 data) { window.regs.two_left = data; } //WH3 void PPU::mmio_w2129(uint8 data) { window.regs.two_right = data; } //WBGLOG void PPU::mmio_w212a(uint8 data) { window.regs.bg4_mask = (data >> 6) & 3; window.regs.bg3_mask = (data >> 4) & 3; window.regs.bg2_mask = (data >> 2) & 3; window.regs.bg1_mask = (data >> 0) & 3; } //WOBJLOG void PPU::mmio_w212b(uint8 data) { window.regs.col_mask = (data >> 2) & 3; window.regs.oam_mask = (data >> 0) & 3; } //TM void PPU::mmio_w212c(uint8 data) { sprite.regs.main_enable = data & 0x10; bg4.regs.main_enable = data & 0x08; bg3.regs.main_enable = data & 0x04; bg2.regs.main_enable = data & 0x02; bg1.regs.main_enable = data & 0x01; } //TS void PPU::mmio_w212d(uint8 data) { sprite.regs.sub_enable = data & 0x10; bg4.regs.sub_enable = data & 0x08; bg3.regs.sub_enable = data & 0x04; bg2.regs.sub_enable = data & 0x02; bg1.regs.sub_enable = data & 0x01; } //TMW void PPU::mmio_w212e(uint8 data) { window.regs.oam_main_enable = data & 0x10; window.regs.bg4_main_enable = data & 0x08; window.regs.bg3_main_enable = data & 0x04; window.regs.bg2_main_enable = data & 0x02; window.regs.bg1_main_enable = data & 0x01; } //TSW void PPU::mmio_w212f(uint8 data) { window.regs.oam_sub_enable = data & 0x10; window.regs.bg4_sub_enable = data & 0x08; window.regs.bg3_sub_enable = data & 0x04; window.regs.bg2_sub_enable = data & 0x02; window.regs.bg1_sub_enable = data & 0x01; } //CGWSEL void PPU::mmio_w2130(uint8 data) { window.regs.col_main_mask = (data >> 6) & 3; window.regs.col_sub_mask = (data >> 4) & 3; screen.regs.addsub_mode = data & 0x02; screen.regs.direct_color = data & 0x01; } //CGADDSUB void PPU::mmio_w2131(uint8 data) { screen.regs.color_mode = data & 0x80; screen.regs.color_halve = data & 0x40; screen.regs.back_color_enable = data & 0x20; screen.regs.oam_color_enable = data & 0x10; screen.regs.bg4_color_enable = data & 0x08; screen.regs.bg3_color_enable = data & 0x04; screen.regs.bg2_color_enable = data & 0x02; screen.regs.bg1_color_enable = data & 0x01; } //COLDATA void PPU::mmio_w2132(uint8 data) { if(data & 0x80) screen.regs.color_b = data & 0x1f; if(data & 0x40) screen.regs.color_g = data & 0x1f; if(data & 0x20) screen.regs.color_r = data & 0x1f; } //SETINI void PPU::mmio_w2133(uint8 data) { regs.mode7_extbg = data & 0x40; regs.pseudo_hires = data & 0x08; regs.overscan = data & 0x04; sprite.regs.interlace = data & 0x02; regs.interlace = data & 0x01; mmio_update_video_mode(); } //MPYL uint8 PPU::mmio_r2134() { unsigned result = ((int16)regs.m7a * (int8)(regs.m7b >> 8)); regs.ppu1_mdr = (result >> 0); return regs.ppu1_mdr; } //MPYM uint8 PPU::mmio_r2135() { unsigned result = ((int16)regs.m7a * (int8)(regs.m7b >> 8)); regs.ppu1_mdr = (result >> 8); return regs.ppu1_mdr; } //MPYH uint8 PPU::mmio_r2136() { unsigned result = ((int16)regs.m7a * (int8)(regs.m7b >> 8)); regs.ppu1_mdr = (result >> 16); return regs.ppu1_mdr; } //SLHV uint8 PPU::mmio_r2137() { if(cpu.pio() & 0x80) latch_counters(); return cpu.regs.mdr; } //OAMDATAREAD uint8 PPU::mmio_r2138() { uint10 addr = regs.oam_addr++; if(regs.display_disable == false && vcounter() < (!regs.overscan ? 225 : 240)) addr = regs.oam_iaddr; if(addr & 0x0200) addr &= 0x021f; regs.ppu1_mdr = oam_read(addr); sprite.set_first_sprite(); return regs.ppu1_mdr; } //VMDATALREAD uint8 PPU::mmio_r2139() { uint16 addr = get_vram_address() + 0; regs.ppu1_mdr = regs.vram_readbuffer >> 0; if(regs.vram_incmode == 0) { addr &= ~1; regs.vram_readbuffer = vram_read(addr + 0) << 0; regs.vram_readbuffer |= vram_read(addr + 1) << 8; regs.vram_addr += regs.vram_incsize; } return regs.ppu1_mdr; } //VMDATAHREAD uint8 PPU::mmio_r213a() { uint16 addr = get_vram_address() + 1; regs.ppu1_mdr = regs.vram_readbuffer >> 8; if(regs.vram_incmode == 1) { addr &= ~1; regs.vram_readbuffer = vram_read(addr + 0) << 0; regs.vram_readbuffer |= vram_read(addr + 1) << 8; regs.vram_addr += regs.vram_incsize; } return regs.ppu1_mdr; } //CGDATAREAD uint8 PPU::mmio_r213b() { bool latch = regs.cgram_addr & 1; uint9 addr = regs.cgram_addr++; if(regs.display_disable == false && vcounter() > 0 && vcounter() < (!regs.overscan ? 225 : 240) && hcounter() >= 88 && hcounter() < 1096 ) addr = regs.cgram_iaddr; if(latch == 0) { regs.ppu2_mdr = cgram_read(addr); } else { regs.ppu2_mdr &= 0x80; regs.ppu2_mdr |= cgram_read(addr); } return regs.ppu2_mdr; } //OPHCT uint8 PPU::mmio_r213c() { if(regs.latch_hcounter == 0) { regs.ppu2_mdr = (regs.hcounter >> 0); } else { regs.ppu2_mdr &= 0xfe; regs.ppu2_mdr |= (regs.hcounter >> 8) & 1; } regs.latch_hcounter ^= 1; return regs.ppu2_mdr; } //OPVCT uint8 PPU::mmio_r213d() { if(regs.latch_vcounter == 0) { regs.ppu2_mdr = (regs.vcounter >> 0); } else { regs.ppu2_mdr &= 0xfe; regs.ppu2_mdr |= (regs.vcounter >> 8) & 1; } regs.latch_vcounter ^= 1; return regs.ppu2_mdr; } //STAT77 uint8 PPU::mmio_r213e() { regs.ppu1_mdr &= 0x10; regs.ppu1_mdr |= sprite.regs.time_over << 7; regs.ppu1_mdr |= sprite.regs.range_over << 6; regs.ppu1_mdr |= ppu1_version & 0x0f; return regs.ppu1_mdr; } //STAT78 uint8 PPU::mmio_r213f() { regs.latch_hcounter = 0; regs.latch_vcounter = 0; regs.ppu2_mdr &= 0x20; regs.ppu2_mdr |= field() << 7; if((cpu.pio() & 0x80) == 0) { regs.ppu2_mdr |= 0x40; } else if(regs.counters_latched) { regs.ppu2_mdr |= 0x40; regs.counters_latched = false; } regs.ppu2_mdr |= (system.region() == System::Region::NTSC ? 0 : 1) << 4; regs.ppu2_mdr |= ppu2_version & 0x0f; return regs.ppu2_mdr; } void PPU::mmio_reset() { regs.ppu1_mdr = random(0xff); regs.ppu2_mdr = random(0xff); regs.vram_readbuffer = random(0x0000); regs.oam_latchdata = random(0x00); regs.cgram_latchdata = random(0x00); regs.bgofs_latchdata = random(0x00); regs.mode7_latchdata = random(0x00); regs.counters_latched = false; regs.latch_hcounter = 0; regs.latch_vcounter = 0; regs.oam_iaddr = 0x0000; regs.cgram_iaddr = 0x00; //$2100 INIDISP regs.display_disable = true; regs.display_brightness = 0; //$2102 OAMADDL //$2103 OAMADDH regs.oam_baseaddr = random(0x0000); regs.oam_addr = random(0x0000); regs.oam_priority = random(false); //$2105 BGMODE regs.bg3_priority = false; regs.bgmode = 0; //$210d BG1HOFS regs.mode7_hoffset = random(0x0000); //$210e BG1VOFS regs.mode7_voffset = random(0x0000); //$2115 VMAIN regs.vram_incmode = random(1); regs.vram_mapping = random(0); regs.vram_incsize = 1; //$2116 VMADDL //$2117 VMADDH regs.vram_addr = random(0x0000); //$211a M7SEL regs.mode7_repeat = random(0); regs.mode7_vflip = random(false); regs.mode7_hflip = random(false); //$211b M7A regs.m7a = random(0x0000); //$211c M7B regs.m7b = random(0x0000); //$211d M7C regs.m7c = random(0x0000); //$211e M7D regs.m7d = random(0x0000); //$211f M7X regs.m7x = random(0x0000); //$2120 M7Y regs.m7y = random(0x0000); //$2121 CGADD regs.cgram_addr = random(0x0000); //$2133 SETINI regs.mode7_extbg = random(false); regs.pseudo_hires = random(false); regs.overscan = false; regs.interlace = false; //$213c OPHCT regs.hcounter = 0; //$213d OPVCT regs.vcounter = 0; } uint8 PPU::mmio_read(unsigned addr) { cpu.synchronize_ppu(); switch(addr & 0xffff) { case 0x2104: case 0x2105: case 0x2106: case 0x2108: case 0x2109: case 0x210a: case 0x2114: case 0x2115: case 0x2116: case 0x2118: case 0x2119: case 0x211a: case 0x2124: case 0x2125: case 0x2126: case 0x2128: case 0x2129: case 0x212a: return regs.ppu1_mdr; case 0x2134: return mmio_r2134(); //MPYL case 0x2135: return mmio_r2135(); //MPYM case 0x2136: return mmio_r2136(); //MYPH case 0x2137: return mmio_r2137(); //SLHV case 0x2138: return mmio_r2138(); //OAMDATAREAD case 0x2139: return mmio_r2139(); //VMDATALREAD case 0x213a: return mmio_r213a(); //VMDATAHREAD case 0x213b: return mmio_r213b(); //CGDATAREAD case 0x213c: return mmio_r213c(); //OPHCT case 0x213d: return mmio_r213d(); //OPVCT case 0x213e: return mmio_r213e(); //STAT77 case 0x213f: return mmio_r213f(); //STAT78 } return cpu.regs.mdr; } void PPU::mmio_write(unsigned addr, uint8 data) { cpu.synchronize_ppu(); switch(addr & 0xffff) { case 0x2100: return mmio_w2100(data); //INIDISP case 0x2101: return mmio_w2101(data); //OBSEL case 0x2102: return mmio_w2102(data); //OAMADDL case 0x2103: return mmio_w2103(data); //OAMADDH case 0x2104: return mmio_w2104(data); //OAMDATA case 0x2105: return mmio_w2105(data); //BGMODE case 0x2106: return mmio_w2106(data); //MOSAIC case 0x2107: return mmio_w2107(data); //BG1SC case 0x2108: return mmio_w2108(data); //BG2SC case 0x2109: return mmio_w2109(data); //BG3SC case 0x210a: return mmio_w210a(data); //BG4SC case 0x210b: return mmio_w210b(data); //BG12NBA case 0x210c: return mmio_w210c(data); //BG34NBA case 0x210d: return mmio_w210d(data); //BG1HOFS case 0x210e: return mmio_w210e(data); //BG1VOFS case 0x210f: return mmio_w210f(data); //BG2HOFS case 0x2110: return mmio_w2110(data); //BG2VOFS case 0x2111: return mmio_w2111(data); //BG3HOFS case 0x2112: return mmio_w2112(data); //BG3VOFS case 0x2113: return mmio_w2113(data); //BG4HOFS case 0x2114: return mmio_w2114(data); //BG4VOFS case 0x2115: return mmio_w2115(data); //VMAIN case 0x2116: return mmio_w2116(data); //VMADDL case 0x2117: return mmio_w2117(data); //VMADDH case 0x2118: return mmio_w2118(data); //VMDATAL case 0x2119: return mmio_w2119(data); //VMDATAH case 0x211a: return mmio_w211a(data); //M7SEL case 0x211b: return mmio_w211b(data); //M7A case 0x211c: return mmio_w211c(data); //M7B case 0x211d: return mmio_w211d(data); //M7C case 0x211e: return mmio_w211e(data); //M7D case 0x211f: return mmio_w211f(data); //M7X case 0x2120: return mmio_w2120(data); //M7Y case 0x2121: return mmio_w2121(data); //CGADD case 0x2122: return mmio_w2122(data); //CGDATA case 0x2123: return mmio_w2123(data); //W12SEL case 0x2124: return mmio_w2124(data); //W34SEL case 0x2125: return mmio_w2125(data); //WOBJSEL case 0x2126: return mmio_w2126(data); //WH0 case 0x2127: return mmio_w2127(data); //WH1 case 0x2128: return mmio_w2128(data); //WH2 case 0x2129: return mmio_w2129(data); //WH3 case 0x212a: return mmio_w212a(data); //WBGLOG case 0x212b: return mmio_w212b(data); //WOBJLOG case 0x212c: return mmio_w212c(data); //TM case 0x212d: return mmio_w212d(data); //TS case 0x212e: return mmio_w212e(data); //TMW case 0x212f: return mmio_w212f(data); //TSW case 0x2130: return mmio_w2130(data); //CGWSEL case 0x2131: return mmio_w2131(data); //CGADDSUB case 0x2132: return mmio_w2132(data); //COLDATA case 0x2133: return mmio_w2133(data); //SETINI } } #endif phoenix/gtk/utility.cpp000664 001750 001750 00000024532 12651764221 016364 0ustar00sergiosergio000000 000000 namespace phoenix { static GdkColor CreateColor(uint8_t r, uint8_t g, uint8_t b) { GdkColor color; color.pixel = (r << 16) | (g << 8) | (b << 0); color.red = (r << 8) | (r << 0); color.green = (g << 8) | (g << 0); color.blue = (b << 8) | (b << 0); return color; } static GdkPixbuf* CreatePixbuf(const nall::image& image, bool scale = false) { nall::image gdkImage = image; gdkImage.transform(0, 32, 255u << 24, 255u << 0, 255u << 8, 255u << 16); if(scale) gdkImage.scale(15, 15); GdkPixbuf* pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, gdkImage.width, gdkImage.height); memcpy(gdk_pixbuf_get_pixels(pixbuf), gdkImage.data, gdkImage.width * gdkImage.height * 4); return pixbuf; } static GtkImage* CreateImage(const nall::image& image, bool scale = false) { GdkPixbuf* pixbuf = CreatePixbuf(image, scale); GtkImage* gtkImage = (GtkImage*)gtk_image_new_from_pixbuf(pixbuf); g_object_unref(pixbuf); return gtkImage; } static lstring DropPaths(GtkSelectionData* data) { gchar** uris = gtk_selection_data_get_uris(data); if(uris == nullptr) return {}; lstring paths; for(unsigned n = 0; uris[n] != nullptr; n++) { gchar* pathname = g_filename_from_uri(uris[n], nullptr, nullptr); if(pathname == nullptr) continue; string path = pathname; g_free(pathname); if(directory::exists(path) && !path.endsWith("/")) path.append("/"); paths.append(path); } g_strfreev(uris); return paths; } static Position GetDisplacement(Sizable* sizable) { Position position; while(sizable->state.parent) { Position displacement = sizable->state.parent->p.displacement(); position.x += displacement.x; position.y += displacement.y; sizable = sizable->state.parent; } return position; } static Layout* GetParentWidgetLayout(Sizable* sizable) { while(sizable) { if(sizable->state.parent && dynamic_cast(sizable->state.parent)) return (Layout*)sizable; sizable = sizable->state.parent; } return nullptr; } static Widget* GetParentWidget(Sizable* sizable) { while(sizable) { if(sizable->state.parent && dynamic_cast(sizable->state.parent)) return (Widget*)sizable->state.parent; sizable = sizable->state.parent; } return nullptr; } static Keyboard::Keycode Keysym(unsigned keysym) { switch(keysym) { case GDK_Escape: return Keyboard::Keycode::Escape; case GDK_F1: return Keyboard::Keycode::F1; case GDK_F2: return Keyboard::Keycode::F2; case GDK_F3: return Keyboard::Keycode::F3; case GDK_F4: return Keyboard::Keycode::F4; case GDK_F5: return Keyboard::Keycode::F5; case GDK_F6: return Keyboard::Keycode::F6; case GDK_F7: return Keyboard::Keycode::F7; case GDK_F8: return Keyboard::Keycode::F8; case GDK_F9: return Keyboard::Keycode::F9; case GDK_F10: return Keyboard::Keycode::F10; case GDK_F11: return Keyboard::Keycode::F11; case GDK_F12: return Keyboard::Keycode::F12; case GDK_Print: return Keyboard::Keycode::PrintScreen; //Keyboard::Keycode::SysRq case GDK_Scroll_Lock: return Keyboard::Keycode::ScrollLock; case GDK_Pause: return Keyboard::Keycode::Pause; //Keyboard::Keycode::Break case GDK_Insert: return Keyboard::Keycode::Insert; case GDK_Delete: return Keyboard::Keycode::Delete; case GDK_Home: return Keyboard::Keycode::Home; case GDK_End: return Keyboard::Keycode::End; case GDK_Prior: return Keyboard::Keycode::PageUp; case GDK_Next: return Keyboard::Keycode::PageDown; case GDK_Up: return Keyboard::Keycode::Up; case GDK_Down: return Keyboard::Keycode::Down; case GDK_Left: return Keyboard::Keycode::Left; case GDK_Right: return Keyboard::Keycode::Right; case GDK_grave: return Keyboard::Keycode::Grave; case GDK_1: return Keyboard::Keycode::Number1; case GDK_2: return Keyboard::Keycode::Number2; case GDK_3: return Keyboard::Keycode::Number3; case GDK_4: return Keyboard::Keycode::Number4; case GDK_5: return Keyboard::Keycode::Number5; case GDK_6: return Keyboard::Keycode::Number6; case GDK_7: return Keyboard::Keycode::Number7; case GDK_8: return Keyboard::Keycode::Number8; case GDK_9: return Keyboard::Keycode::Number9; case GDK_0: return Keyboard::Keycode::Number0; case GDK_minus: return Keyboard::Keycode::Minus; case GDK_equal: return Keyboard::Keycode::Equal; case GDK_BackSpace: return Keyboard::Keycode::Backspace; case GDK_asciitilde: return Keyboard::Keycode::Tilde; case GDK_exclam: return Keyboard::Keycode::Exclamation; case GDK_at: return Keyboard::Keycode::At; case GDK_numbersign: return Keyboard::Keycode::Pound; case GDK_dollar: return Keyboard::Keycode::Dollar; case GDK_percent: return Keyboard::Keycode::Percent; case GDK_asciicircum: return Keyboard::Keycode::Power; case GDK_ampersand: return Keyboard::Keycode::Ampersand; case GDK_asterisk: return Keyboard::Keycode::Asterisk; case GDK_parenleft: return Keyboard::Keycode::ParenthesisLeft; case GDK_parenright: return Keyboard::Keycode::ParenthesisRight; case GDK_underscore: return Keyboard::Keycode::Underscore; case GDK_plus: return Keyboard::Keycode::Plus; case GDK_bracketleft: return Keyboard::Keycode::BracketLeft; case GDK_bracketright: return Keyboard::Keycode::BracketRight; case GDK_backslash: return Keyboard::Keycode::Backslash; case GDK_semicolon: return Keyboard::Keycode::Semicolon; case GDK_apostrophe: return Keyboard::Keycode::Apostrophe; case GDK_comma: return Keyboard::Keycode::Comma; case GDK_period: return Keyboard::Keycode::Period; case GDK_slash: return Keyboard::Keycode::Slash; case GDK_braceleft: return Keyboard::Keycode::BraceLeft; case GDK_braceright: return Keyboard::Keycode::BraceRight; case GDK_bar: return Keyboard::Keycode::Pipe; case GDK_colon: return Keyboard::Keycode::Colon; case GDK_quotedbl: return Keyboard::Keycode::Quote; case GDK_less: return Keyboard::Keycode::CaretLeft; case GDK_greater: return Keyboard::Keycode::CaretRight; case GDK_question: return Keyboard::Keycode::Question; case GDK_Tab: return Keyboard::Keycode::Tab; case GDK_Caps_Lock: return Keyboard::Keycode::CapsLock; case GDK_Return: return Keyboard::Keycode::Return; case GDK_Shift_L: return Keyboard::Keycode::ShiftLeft; case GDK_Shift_R: return Keyboard::Keycode::ShiftRight; case GDK_Control_L: return Keyboard::Keycode::ControlLeft; case GDK_Control_R: return Keyboard::Keycode::ControlRight; case GDK_Super_L: return Keyboard::Keycode::SuperLeft; case GDK_Super_R: return Keyboard::Keycode::SuperRight; case GDK_Alt_L: return Keyboard::Keycode::AltLeft; case GDK_Alt_R: return Keyboard::Keycode::AltRight; case GDK_space: return Keyboard::Keycode::Space; case GDK_Menu: return Keyboard::Keycode::Menu; case GDK_A: return Keyboard::Keycode::A; case GDK_B: return Keyboard::Keycode::B; case GDK_C: return Keyboard::Keycode::C; case GDK_D: return Keyboard::Keycode::D; case GDK_E: return Keyboard::Keycode::E; case GDK_F: return Keyboard::Keycode::F; case GDK_G: return Keyboard::Keycode::G; case GDK_H: return Keyboard::Keycode::H; case GDK_I: return Keyboard::Keycode::I; case GDK_J: return Keyboard::Keycode::J; case GDK_K: return Keyboard::Keycode::K; case GDK_L: return Keyboard::Keycode::L; case GDK_M: return Keyboard::Keycode::M; case GDK_N: return Keyboard::Keycode::N; case GDK_O: return Keyboard::Keycode::O; case GDK_P: return Keyboard::Keycode::P; case GDK_Q: return Keyboard::Keycode::Q; case GDK_R: return Keyboard::Keycode::R; case GDK_S: return Keyboard::Keycode::S; case GDK_T: return Keyboard::Keycode::T; case GDK_U: return Keyboard::Keycode::U; case GDK_V: return Keyboard::Keycode::V; case GDK_W: return Keyboard::Keycode::W; case GDK_X: return Keyboard::Keycode::X; case GDK_Y: return Keyboard::Keycode::Y; case GDK_Z: return Keyboard::Keycode::Z; case GDK_a: return Keyboard::Keycode::a; case GDK_b: return Keyboard::Keycode::b; case GDK_c: return Keyboard::Keycode::c; case GDK_d: return Keyboard::Keycode::d; case GDK_e: return Keyboard::Keycode::e; case GDK_f: return Keyboard::Keycode::f; case GDK_g: return Keyboard::Keycode::g; case GDK_h: return Keyboard::Keycode::h; case GDK_i: return Keyboard::Keycode::i; case GDK_j: return Keyboard::Keycode::j; case GDK_k: return Keyboard::Keycode::k; case GDK_l: return Keyboard::Keycode::l; case GDK_m: return Keyboard::Keycode::m; case GDK_n: return Keyboard::Keycode::n; case GDK_o: return Keyboard::Keycode::o; case GDK_p: return Keyboard::Keycode::p; case GDK_q: return Keyboard::Keycode::q; case GDK_r: return Keyboard::Keycode::r; case GDK_s: return Keyboard::Keycode::s; case GDK_t: return Keyboard::Keycode::t; case GDK_u: return Keyboard::Keycode::u; case GDK_v: return Keyboard::Keycode::v; case GDK_w: return Keyboard::Keycode::w; case GDK_x: return Keyboard::Keycode::x; case GDK_y: return Keyboard::Keycode::y; case GDK_z: return Keyboard::Keycode::z; case GDK_Num_Lock: return Keyboard::Keycode::NumLock; case GDK_KP_Divide: return Keyboard::Keycode::Divide; case GDK_KP_Multiply: return Keyboard::Keycode::Multiply; case GDK_KP_Subtract: return Keyboard::Keycode::Subtract; case GDK_KP_Add: return Keyboard::Keycode::Add; case GDK_KP_Enter: return Keyboard::Keycode::Enter; case GDK_KP_Decimal: return Keyboard::Keycode::Point; case GDK_KP_1: return Keyboard::Keycode::Keypad1; case GDK_KP_2: return Keyboard::Keycode::Keypad2; case GDK_KP_3: return Keyboard::Keycode::Keypad3; case GDK_KP_4: return Keyboard::Keycode::Keypad4; case GDK_KP_5: return Keyboard::Keycode::Keypad5; case GDK_KP_6: return Keyboard::Keycode::Keypad6; case GDK_KP_7: return Keyboard::Keycode::Keypad7; case GDK_KP_8: return Keyboard::Keycode::Keypad8; case GDK_KP_9: return Keyboard::Keycode::Keypad9; case GDK_KP_0: return Keyboard::Keycode::Keypad0; case GDK_KP_Home: return Keyboard::Keycode::KeypadHome; case GDK_KP_End: return Keyboard::Keycode::KeypadEnd; case GDK_KP_Page_Up: return Keyboard::Keycode::KeypadPageUp; case GDK_KP_Page_Down: return Keyboard::Keycode::KeypadPageDown; case GDK_KP_Up: return Keyboard::Keycode::KeypadUp; case GDK_KP_Down: return Keyboard::Keycode::KeypadDown; case GDK_KP_Left: return Keyboard::Keycode::KeypadLeft; case GDK_KP_Right: return Keyboard::Keycode::KeypadRight; case GDK_KP_Begin: return Keyboard::Keycode::KeypadCenter; case GDK_KP_Insert: return Keyboard::Keycode::KeypadInsert; case GDK_KP_Delete: return Keyboard::Keycode::KeypadDelete; } return Keyboard::Keycode::None; } } sfc/cartridge/000700 001750 001750 00000000000 12656700342 014412 5ustar00sergiosergio000000 000000 phoenix/reference/font.cpp000664 001750 001750 00000000444 12651764221 016774 0ustar00sergiosergio000000 000000 namespace phoenix { string pFont::serif(unsigned size, string style) { return ""; } string pFont::sans(unsigned size, string style) { return ""; } string pFont::monospace(unsigned size, string style) { return ""; } Size pFont::size(string font, string text) { return {0, 0}; } } fc/cartridge/board/nes-gxrom.cpp000664 001750 001750 00000002423 12651764221 017757 0ustar00sergiosergio000000 000000 //NES-GNROM //NES-MHROM struct NES_GxROM : Board { struct Settings { bool mirror; //0 = horizontal, 1 = vertical } settings; uint2 prg_bank; uint2 chr_bank; uint8 prg_read(unsigned addr) { if(addr & 0x8000) return prgrom.read((prg_bank << 15) | (addr & 0x7fff)); return cpu.mdr(); } void prg_write(unsigned addr, uint8 data) { if(addr & 0x8000) { prg_bank = (data & 0x30) >> 4; chr_bank = (data & 0x03) >> 0; } } uint8 chr_read(unsigned addr) { if(addr & 0x2000) { if(settings.mirror == 0) addr = ((addr & 0x0800) >> 1) | (addr & 0x03ff); return ppu.ciram_read(addr & 0x07ff); } addr = (chr_bank * 0x2000) + (addr & 0x1fff); return Board::chr_read(addr); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) { if(settings.mirror == 0) addr = ((addr & 0x0800) >> 1) | (addr & 0x03ff); return ppu.ciram_write(addr & 0x07ff, data); } addr = (chr_bank * 0x2000) + (addr & 0x1fff); Board::chr_write(addr, data); } void power() { } void reset() { prg_bank = 0; chr_bank = 0; } void serialize(serializer& s) { Board::serialize(s); s.integer(prg_bank); s.integer(chr_bank); } NES_GxROM(Markup::Node& document) : Board(document) { settings.mirror = document["cartridge"]["mirror"]["mode"].data == "vertical" ? 1 : 0; } }; sfc/chip/chip.hpp000664 001750 001750 00000002246 12651764221 015046 0ustar00sergiosergio000000 000000 struct Coprocessor : Thread { alwaysinline void step(unsigned clocks); alwaysinline void synchronize_cpu(); }; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void Coprocessor::step(unsigned clocks) { clock += clocks * (uint64)cpu.frequency; } void Coprocessor::synchronize_cpu() { if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cpu.thread); } sfc/chip/armdsp/000700 001750 001750 00000000000 12656700342 014657 5ustar00sergiosergio000000 000000 sfc/ppu/ppu.cpp000664 001750 001750 00000005565 12651764221 014612 0ustar00sergiosergio000000 000000 #include #define PPU_CPP namespace SuperFamicom { PPU ppu; #include "background/background.cpp" #include "mmio/mmio.cpp" #include "screen/screen.cpp" #include "sprite/sprite.cpp" #include "window/window.cpp" #include "serialization.cpp" void PPU::step(unsigned clocks) { clock += clocks; } void PPU::synchronize_cpu() { if(CPU::Threaded == true) { if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cpu.thread); } else { while(clock >= 0) cpu.enter(); } } void PPU::Enter() { ppu.enter(); } void PPU::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } scanline(); add_clocks(28); bg1.begin(); bg2.begin(); bg3.begin(); bg4.begin(); if(vcounter() <= 239) { for(signed pixel = -7; pixel <= 255; pixel++) { bg1.run(1); bg2.run(1); bg3.run(1); bg4.run(1); add_clocks(2); bg1.run(0); bg2.run(0); bg3.run(0); bg4.run(0); if(pixel >= 0) { sprite.run(); window.run(); screen.run(); } add_clocks(2); } add_clocks(14); sprite.tilefetch(); } else { add_clocks(1052 + 14 + 136); } add_clocks(lineclocks() - 28 - 1052 - 14 - 136); } } void PPU::add_clocks(unsigned clocks) { clocks >>= 1; while(clocks--) { tick(2); step(2); synchronize_cpu(); } } void PPU::enable() { function reader = {&PPU::mmio_read, (PPU*)&ppu}; function writer = {&PPU::mmio_write, (PPU*)&ppu}; bus.map(reader, writer, 0x00, 0x3f, 0x2100, 0x213f); bus.map(reader, writer, 0x80, 0xbf, 0x2100, 0x213f); } void PPU::power() { for(auto& n : vram) n = random(0x00); for(auto& n : oam) n = random(0x00); for(auto& n : cgram) n = random(0x00); } void PPU::reset() { create(Enter, system.cpu_frequency()); PPUcounter::reset(); memset(surface, 0, 512 * 512 * sizeof(uint32)); mmio_reset(); bg1.reset(); bg2.reset(); bg3.reset(); bg4.reset(); sprite.reset(); window.reset(); screen.reset(); frame(); } void PPU::scanline() { if(vcounter() == 0) { frame(); bg1.frame(); bg2.frame(); bg3.frame(); bg4.frame(); } bg1.scanline(); bg2.scanline(); bg3.scanline(); bg4.scanline(); sprite.scanline(); window.scanline(); screen.scanline(); } void PPU::frame() { system.frame(); sprite.frame(); display.interlace = regs.interlace; display.overscan = regs.overscan; } PPU::PPU() : bg1(*this, Background::ID::BG1), bg2(*this, Background::ID::BG2), bg3(*this, Background::ID::BG3), bg4(*this, Background::ID::BG4), sprite(*this), window(*this), screen(*this) { surface = new uint32[512 * 512]; output = surface + 16 * 512; } PPU::~PPU() { delete[] surface; } } sfc/ppu/background/background.cpp000664 001750 001750 00000020072 12651764221 020232 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP #include "mode7.cpp" unsigned PPU::Background::voffset() const { if(regs.mosaic) return cache.voffset; return regs.voffset; } unsigned PPU::Background::hoffset() const { if(regs.mosaic) return cache.hoffset; return regs.hoffset; } //V = 0, H = 0 void PPU::Background::frame() { } //H = 0 void PPU::Background::scanline() { } //H = 28 void PPU::Background::begin() { bool hires = (self.regs.bgmode == 5 || self.regs.bgmode == 6); x = -7; y = self.vcounter(); if(y == 1) { mosaic.vcounter = regs.mosaic + 1; mosaic.voffset = 1; cache.hoffset = regs.hoffset; cache.voffset = regs.voffset; } else if(--mosaic.vcounter == 0) { mosaic.vcounter = regs.mosaic + 1; mosaic.voffset += regs.mosaic + 1; cache.hoffset = regs.hoffset; cache.voffset = regs.voffset; } tile_counter = (7 - (cache.hoffset & 7)) << hires; for(unsigned n = 0; n < 8; n++) data[n] = 0; mosaic.hcounter = regs.mosaic + 1; mosaic.hoffset = 0; if(regs.mode == Mode::Mode7) return begin_mode7(); if(regs.mosaic == 0) { cache.hoffset = regs.hoffset; cache.voffset = regs.voffset; } } void PPU::Background::get_tile() { bool hires = (self.regs.bgmode == 5 || self.regs.bgmode == 6); unsigned color_depth = (regs.mode == Mode::BPP2 ? 0 : regs.mode == Mode::BPP4 ? 1 : 2); unsigned palette_offset = (self.regs.bgmode == 0 ? id << 5 : 0); unsigned palette_size = 2 << color_depth; unsigned tile_mask = 0x0fff >> color_depth; unsigned tiledata_index = regs.tiledata_addr >> (4 + color_depth); unsigned tile_height = (regs.tile_size == TileSize::Size8x8 ? 3 : 4); unsigned tile_width = (!hires ? tile_height : 4); unsigned width = 256 << hires; unsigned hmask = (tile_height == 3 ? width : width << 1); unsigned vmask = hmask; if(regs.screen_size & 1) hmask <<= 1; if(regs.screen_size & 2) vmask <<= 1; hmask--; vmask--; unsigned px = x << hires; unsigned py = (regs.mosaic == 0 ? y : mosaic.voffset); unsigned hscroll = hoffset(); unsigned vscroll = voffset(); if(hires) { hscroll <<= 1; if(self.regs.interlace) py = (py << 1) + self.field(); } unsigned hoffset = hscroll + px; unsigned voffset = vscroll + py; if(self.regs.bgmode == 2 || self.regs.bgmode == 4 || self.regs.bgmode == 6) { uint16 offset_x = (x + (hscroll & 7)); if(offset_x >= 8) { unsigned hval = self.bg3.get_tile((offset_x - 8) + (self.bg3.hoffset() & ~7), self.bg3.voffset() + 0); unsigned vval = self.bg3.get_tile((offset_x - 8) + (self.bg3.hoffset() & ~7), self.bg3.voffset() + 8); unsigned valid_mask = (id == ID::BG1 ? 0x2000 : 0x4000); if(self.regs.bgmode == 4) { if(hval & valid_mask) { if((hval & 0x8000) == 0) { hoffset = offset_x + (hval & ~7); } else { voffset = y + hval; } } } else { if(hval & valid_mask) hoffset = offset_x + (hval & ~7); if(vval & valid_mask) voffset = y + vval; } } } hoffset &= hmask; voffset &= vmask; unsigned screen_x = (regs.screen_size & 1 ? 32 << 5 : 0); unsigned screen_y = (regs.screen_size & 2 ? 32 << 5 : 0); if(regs.screen_size == 3) screen_y <<= 1; unsigned tx = hoffset >> tile_width; unsigned ty = voffset >> tile_height; uint16 offset = ((ty & 0x1f) << 5) + (tx & 0x1f); if(tx & 0x20) offset += screen_x; if(ty & 0x20) offset += screen_y; uint16 addr = regs.screen_addr + (offset << 1); tile = (ppu.vram[addr + 0] << 0) + (ppu.vram[addr + 1] << 8); bool mirror_y = tile & 0x8000; bool mirror_x = tile & 0x4000; priority = (tile & 0x2000 ? regs.priority1 : regs.priority0); palette_number = (tile >> 10) & 7; palette_index = palette_offset + (palette_number << palette_size); if(tile_width == 4 && (bool)(hoffset & 8) != mirror_x) tile += 1; if(tile_height == 4 && (bool)(voffset & 8) != mirror_y) tile += 16; uint16 character = ((tile & 0x03ff) + tiledata_index) & tile_mask; if(mirror_y) voffset ^= 7; offset = (character << (4 + color_depth)) + ((voffset & 7) << 1); switch(regs.mode) { case Mode::BPP8: data[7] = ppu.vram[offset + 49]; data[6] = ppu.vram[offset + 48]; data[5] = ppu.vram[offset + 33]; data[4] = ppu.vram[offset + 32]; case Mode::BPP4: data[3] = ppu.vram[offset + 17]; data[2] = ppu.vram[offset + 16]; case Mode::BPP2: data[1] = ppu.vram[offset + 1]; data[0] = ppu.vram[offset + 0]; } if(mirror_x) for(unsigned n = 0; n < 8; n++) { //reverse data bits in data[n]: 01234567 -> 76543210 data[n] = ((data[n] >> 4) & 0x0f) | ((data[n] << 4) & 0xf0); data[n] = ((data[n] >> 2) & 0x33) | ((data[n] << 2) & 0xcc); data[n] = ((data[n] >> 1) & 0x55) | ((data[n] << 1) & 0xaa); } } void PPU::Background::run(bool screen) { if(self.vcounter() == 0) return; bool hires = (self.regs.bgmode == 5 || self.regs.bgmode == 6); if(screen == Screen::Sub) { output.main.priority = 0; output.sub.priority = 0; if(hires == false) return; } if(regs.mode == Mode::Inactive) return; if(regs.mode == Mode::Mode7) return run_mode7(); if(tile_counter-- == 0) { tile_counter = 7; get_tile(); } uint8 palette = get_tile_color(); if(x == 0) mosaic.hcounter = 1; if(x >= 0 && --mosaic.hcounter == 0) { mosaic.hcounter = regs.mosaic + 1; mosaic.priority = priority; mosaic.palette = palette ? palette_index + palette : 0; mosaic.tile = tile; } if(screen == Screen::Main) x++; if(mosaic.palette == 0) return; if(hires == false || screen == Screen::Main) if(regs.main_enable) output.main = mosaic; if(hires == false || screen == Screen::Sub ) if(regs.sub_enable ) output.sub = mosaic; } unsigned PPU::Background::get_tile_color() { unsigned color = 0; switch(regs.mode) { case Mode::BPP8: color += (data[7] >> 0) & 0x80; data[7] <<= 1; color += (data[6] >> 1) & 0x40; data[6] <<= 1; color += (data[5] >> 2) & 0x20; data[5] <<= 1; color += (data[4] >> 3) & 0x10; data[4] <<= 1; case Mode::BPP4: color += (data[3] >> 4) & 0x08; data[3] <<= 1; color += (data[2] >> 5) & 0x04; data[2] <<= 1; case Mode::BPP2: color += (data[1] >> 6) & 0x02; data[1] <<= 1; color += (data[0] >> 7) & 0x01; data[0] <<= 1; } return color; } void PPU::Background::reset() { regs.tiledata_addr = (random(0x0000) & 0x07) << 13; regs.screen_addr = (random(0x0000) & 0x7c) << 9; regs.screen_size = random(0); regs.mosaic = random(0); regs.tile_size = random(0); regs.mode = 0; regs.priority0 = 0; regs.priority1 = 0; regs.main_enable = random(0); regs.sub_enable = random(0); regs.hoffset = random(0x0000); regs.voffset = random(0x0000); cache.hoffset = 0; cache.voffset = 0; output.main.palette = 0; output.main.priority = 0; output.sub.palette = 0; output.sub.priority = 0; mosaic.priority = 0; mosaic.palette = 0; mosaic.tile = 0; mosaic.vcounter = 0; mosaic.voffset = 0; mosaic.hcounter = 0; mosaic.hoffset = 0; x = 0; y = 0; tile_counter = 0; tile = 0; priority = 0; palette_number = 0; palette_index = 0; for(unsigned n = 0; n < 8; n++) data[n] = 0; } unsigned PPU::Background::get_tile(unsigned x, unsigned y) { bool hires = (self.regs.bgmode == 5 || self.regs.bgmode == 6); unsigned tile_height = (regs.tile_size == TileSize::Size8x8 ? 3 : 4); unsigned tile_width = (!hires ? tile_height : 4); unsigned width = (!hires ? 256 : 512); unsigned mask_x = (tile_height == 3 ? width : width << 1); unsigned mask_y = mask_x; if(regs.screen_size & 1) mask_x <<= 1; if(regs.screen_size & 2) mask_y <<= 1; mask_x--; mask_y--; unsigned screen_x = (regs.screen_size & 1 ? 32 << 5 : 0); unsigned screen_y = (regs.screen_size & 2 ? 32 << 5 : 0); if(regs.screen_size == 3) screen_y <<= 1; x = (x & mask_x) >> tile_width; y = (y & mask_y) >> tile_height; uint16 offset = ((y & 0x1f) << 5) + (x & 0x1f); if(x & 0x20) offset += screen_x; if(y & 0x20) offset += screen_y; uint16 addr = regs.screen_addr + (offset << 1); return (ppu.vram[addr + 0] << 0) + (ppu.vram[addr + 1] << 8); } PPU::Background::Background(PPU &self, unsigned id) : self(self), id(id) { } #endif nall/emulation/000700 001750 001750 00000000000 12656700342 014616 5ustar00sergiosergio000000 000000 phoenix/qt/widget/hex-edit.cpp000664 001750 001750 00000017546 12651764221 017521 0ustar00sergiosergio000000 000000 namespace phoenix { void pHexEdit::setColumns(unsigned columns) { update(); } void pHexEdit::setLength(unsigned length) { //add one if last row is not equal to column length (eg only part of the row is present) bool indivisible = hexEdit.state.columns == 0 || (hexEdit.state.length % hexEdit.state.columns) != 0; qtScroll->setRange(0, hexEdit.state.length / hexEdit.state.columns + indivisible - hexEdit.state.rows); update(); } void pHexEdit::setOffset(unsigned offset) { locked = true; qtScroll->setSliderPosition(hexEdit.state.offset / hexEdit.state.columns); locked = false; update(); } void pHexEdit::setRows(unsigned rows) { qtScroll->setPageStep(hexEdit.state.rows); update(); } void pHexEdit::update() { if(!hexEdit.onRead) { qtHexEdit->setPlainText(""); return; } unsigned cursorPosition = qtHexEdit->textCursor().position(); string output; unsigned offset = hexEdit.state.offset; for(unsigned row = 0; row < hexEdit.state.rows; row++) { output.append(hex<8>(offset)); output.append(" "); string hexdata; string ansidata = " "; for(unsigned column = 0; column < hexEdit.state.columns; column++) { if(offset < hexEdit.state.length) { uint8_t data = hexEdit.onRead(offset++); hexdata.append(hex<2>(data)); hexdata.append(" "); ansidata.append(data >= 0x20 && data <= 0x7e ? (char)data : '.'); } else { hexdata.append(" "); ansidata.append(" "); } } output.append(hexdata); output.append(ansidata); if(offset >= hexEdit.state.length) break; if(row != hexEdit.state.rows - 1) output.append("\n"); } qtHexEdit->setPlainText(QString::fromUtf8(output)); QTextCursor cursor = qtHexEdit->textCursor(); cursor.setPosition(cursorPosition); qtHexEdit->setTextCursor(cursor); } void pHexEdit::constructor() { qtWidget = qtHexEdit = new QtHexEdit(*this); qtHexEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); qtHexEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); qtHexEdit->setTextInteractionFlags(Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse); qtLayout = new QHBoxLayout; qtLayout->setAlignment(Qt::AlignRight); qtLayout->setMargin(0); qtLayout->setSpacing(0); qtHexEdit->setLayout(qtLayout); qtScroll = new QtHexEditScrollBar(*this); qtScroll->setSingleStep(1); qtLayout->addWidget(qtScroll); connect(qtScroll, SIGNAL(actionTriggered(int)), SLOT(onScroll())); pWidget::synchronizeState(); setColumns(hexEdit.state.columns); setRows(hexEdit.state.rows); setLength(hexEdit.state.length); setOffset(hexEdit.state.offset); update(); } void pHexEdit::destructor() { delete qtScroll; delete qtLayout; delete qtHexEdit; qtWidget = qtHexEdit = nullptr; qtLayout = nullptr; qtScroll = nullptr; } void pHexEdit::orphan() { destructor(); constructor(); } void pHexEdit::keyPressEvent(QKeyEvent* event) { if(!hexEdit.onRead) return; //allow Ctrl+C (copy) if(event->key() == Qt::Key_C && event->modifiers() == Qt::ControlModifier) { qtHexEdit->keyPressEventAcknowledge(event); return; } //disallow other text operations (cut, paste, etc) if(event->modifiers() & (Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier)) return; QTextCursor cursor = qtHexEdit->textCursor(); signed lineWidth = 10 + (hexEdit.state.columns * 3) + 1 + hexEdit.state.columns + 1; signed cursorY = cursor.position() / lineWidth; signed cursorX = cursor.position() % lineWidth; unsigned nibble = 0; switch(event->key()) { default: return; case Qt::Key_Left: if(cursorX > 0) { cursor.setPosition(cursor.position() - 1); qtHexEdit->setTextCursor(cursor); } return; case Qt::Key_Right: if(cursorX < lineWidth - 1) { cursor.setPosition(cursor.position() + 1); qtHexEdit->setTextCursor(cursor); } return; case Qt::Key_Home: cursor.setPosition(cursorY * lineWidth + 10); qtHexEdit->setTextCursor(cursor); return; case Qt::Key_End: cursor.setPosition(cursorY * lineWidth + 57); qtHexEdit->setTextCursor(cursor); return; case Qt::Key_Up: if(cursorY > 0) { cursor.setPosition(cursor.position() - lineWidth); qtHexEdit->setTextCursor(cursor); } else { scrollTo(qtScroll->sliderPosition() - 1); } return; case Qt::Key_Down: if(cursorY >= rows() - 1) { //cannot scroll down further } else if(cursorY < hexEdit.state.rows - 1) { cursor.setPosition(cursor.position() + lineWidth); qtHexEdit->setTextCursor(cursor); } else { scrollTo(qtScroll->sliderPosition() + 1); } return; case Qt::Key_PageUp: scrollTo(qtScroll->sliderPosition() - hexEdit.state.rows); return; case Qt::Key_PageDown: scrollTo(qtScroll->sliderPosition() + hexEdit.state.rows); return; case Qt::Key_0: nibble = 0; break; case Qt::Key_1: nibble = 1; break; case Qt::Key_2: nibble = 2; break; case Qt::Key_3: nibble = 3; break; case Qt::Key_4: nibble = 4; break; case Qt::Key_5: nibble = 5; break; case Qt::Key_6: nibble = 6; break; case Qt::Key_7: nibble = 7; break; case Qt::Key_8: nibble = 8; break; case Qt::Key_9: nibble = 9; break; case Qt::Key_A: nibble = 10; break; case Qt::Key_B: nibble = 11; break; case Qt::Key_C: nibble = 12; break; case Qt::Key_D: nibble = 13; break; case Qt::Key_E: nibble = 14; break; case Qt::Key_F: nibble = 15; break; } if(cursorX >= 10) { //not on an offset cursorX -= 10; if((cursorX % 3) != 2) { //not on a space bool cursorNibble = (cursorX % 3) == 1; //0 = high, 1 = low cursorX /= 3; if(cursorX < hexEdit.state.columns) { //not in ANSI region unsigned offset = hexEdit.state.offset + (cursorY * hexEdit.state.columns + cursorX); if(offset >= hexEdit.state.length) return; //do not edit past end of file uint8_t data = hexEdit.onRead(offset); //write modified value if(cursorNibble == 1) { data = (data & 0xf0) | (nibble << 0); } else { data = (data & 0x0f) | (nibble << 4); } if(hexEdit.onWrite) hexEdit.onWrite(offset, data); //auto-advance cursor to next nibble/byte unsigned step = 1; if(cursorNibble && cursorX != hexEdit.state.columns - 1) step = 2; cursor.setPosition(cursor.position() + step); qtHexEdit->setTextCursor(cursor); //refresh output to reflect modified data update(); } } } } //number of actual rows signed pHexEdit::rows() { return (max(1u, hexEdit.state.length) + hexEdit.state.columns - 1) / hexEdit.state.columns; } //number of scrollable row positions signed pHexEdit::rowsScrollable() { return max(0u, rows() - hexEdit.state.rows); } void pHexEdit::scrollTo(signed position) { if(position > rowsScrollable()) position = rowsScrollable(); if(position < 0) position = 0; qtScroll->setSliderPosition(position); } void pHexEdit::onScroll() { if(locked) return; unsigned offset = qtScroll->sliderPosition(); hexEdit.state.offset = offset * hexEdit.state.columns; update(); } void pHexEdit::QtHexEdit::keyPressEvent(QKeyEvent* event) { self.keyPressEvent(event); } void pHexEdit::QtHexEdit::keyPressEventAcknowledge(QKeyEvent* event) { QTextEdit::keyPressEvent(event); } void pHexEdit::QtHexEdit::wheelEvent(QWheelEvent* event) { if(event->orientation() == Qt::Vertical) { signed offset = event->delta() < 0 ? +1 : -1; self.scrollTo(self.qtScroll->sliderPosition() + offset); event->accept(); } } bool pHexEdit::QtHexEditScrollBar::event(QEvent* event) { if(event->type() == QEvent::Wheel) { QWheelEvent* wheelEvent = (QWheelEvent*)event; if(wheelEvent->orientation() == Qt::Vertical) { signed offset = wheelEvent->delta() < 0 ? +1 : -1; self.scrollTo(sliderPosition() + offset); return true; } } return QScrollBar::event(event); } } phoenix/cocoa/action/menu.cpp000664 001750 001750 00000002423 12651764221 017374 0ustar00sergiosergio000000 000000 @implementation CocoaMenu : NSMenuItem -(id) initWith:(phoenix::Menu&)menuReference { if(self = [super initWithTitle:@"" action:nil keyEquivalent:@""]) { menu = &menuReference; cocoaMenu = [[NSMenu alloc] initWithTitle:@""]; [self setSubmenu:cocoaMenu]; } return self; } -(NSMenu*) cocoaMenu { return cocoaMenu; } @end namespace phoenix { void pMenu::append(Action& action) { @autoreleasepool { [[cocoaAction cocoaMenu] addItem:action.p.cocoaAction]; } } void pMenu::remove(Action& action) { @autoreleasepool { [[cocoaAction cocoaMenu] removeItem:action.p.cocoaAction]; } } void pMenu::setImage(const image& image) { @autoreleasepool { unsigned size = 15; //there is no API to retrieve the optimal size [cocoaAction setImage:NSMakeImage(image, size, size)]; } } void pMenu::setText(string text) { @autoreleasepool { [[cocoaAction cocoaMenu] setTitle:[NSString stringWithUTF8String:text]]; [cocoaAction setTitle:[NSString stringWithUTF8String:text]]; } } void pMenu::constructor() { @autoreleasepool { cocoaAction = cocoaMenu = [[CocoaMenu alloc] initWith:menu]; setText(menu.state.text); } } void pMenu::destructor() { @autoreleasepool { [[cocoaAction cocoaMenu] release]; [cocoaAction release]; } } } sfc/controller/usart/usart.cpp000664 001750 001750 00000004646 12651764221 017660 0ustar00sergiosergio000000 000000 #ifdef CONTROLLER_CPP //Synchronous serial communications cable emulation //Hardware: //Teensy++ 2.0 USB //AT90USB1286 //Connection Diagram: //SNES GND <> Teensy GND //SNES IOBit <> Teensy B0 //SNES Latch <> Teensy D2 //SNES Data1 <> Teensy D3 //SNES Clock <> 1Kohm Resistor <> Teensy D5 //Teensy D5 <> Teensy D7 void USART::enter() { if(init && main) { init( {&USART::quit, this}, {&USART::usleep, this}, {&USART::readable, this}, {&USART::read, this}, {&USART::writable, this}, {&USART::write, this} ); main(); } while(true) step(10000000); } bool USART::quit() { step(1); return false; } void USART::usleep(unsigned milliseconds) { step(10 * milliseconds); } bool USART::readable() { step(1); return txbuffer.size(); } //SNES -> USART uint8 USART::read() { step(1); while(txbuffer.size() == 0) step(1); uint8 data = txbuffer[0]; txbuffer.remove(0); return data; } bool USART::writable() { step(1); return true; } //USART -> SNES void USART::write(uint8 data) { step(1); rxbuffer.append(data ^ 0xff); } //clock uint2 USART::data() { //Joypad if(iobit()) { if(counter >= 16) return 1; uint2 result = 0; if(counter < 12) result = interface->inputPoll(port, (unsigned)Input::Device::Joypad, counter); if(latched == 0) counter++; return result; } //SNES -> USART if(txlength == 0) { if(latched == 0) txlength++; } else if(txlength <= 8) { txdata = (latched << 7) | (txdata >> 1); txlength++; } else { if(latched == 1) txbuffer.append(txdata); txlength = 0; } //USART -> SNES if(rxlength == 0 && rxbuffer.size()) { data1 = 1; rxdata = rxbuffer[0]; rxbuffer.remove(0); rxlength++; } else if(rxlength <= 8) { data1 = rxdata & 1; rxdata >>= 1; rxlength++; } else { data1 = 0; rxlength = 0; } return (data2 << 1) | (data1 << 0); } //latch void USART::latch(bool data) { if(latched == data) return; latched = data; counter = 0; } USART::USART(bool port) : Controller(port) { latched = 0; data1 = 0; data2 = 0; counter = 0; rxlength = 0; rxdata = 0; txlength = 0; txdata = 0; string filename = {interface->path(ID::SuperFamicom), "usart.so"}; if(open_absolute(filename)) { init = sym("usart_init"); main = sym("usart_main"); if(init && main) create(Controller::Enter, 10000000); } } USART::~USART() { if(open()) close(); } #endif processor/r65816/serialization.cpp000664 001750 001750 00000001155 12651764221 020165 0ustar00sergiosergio000000 000000 void R65816::serialize(serializer& s) { s.integer(regs.pc.d); s.integer(regs.a.w); s.integer(regs.x.w); s.integer(regs.y.w); s.integer(regs.z.w); s.integer(regs.s.w); s.integer(regs.d.w); s.integer(regs.p.n); s.integer(regs.p.v); s.integer(regs.p.m); s.integer(regs.p.x); s.integer(regs.p.d); s.integer(regs.p.i); s.integer(regs.p.z); s.integer(regs.p.c); s.integer(regs.db); s.integer(regs.e); s.integer(regs.irq); s.integer(regs.wai); s.integer(regs.mdr); s.integer(regs.vector); s.integer(aa.d); s.integer(rd.d); s.integer(sp); s.integer(dp); update_table(); } nall/priority-queue.hpp000664 001750 001750 00000005363 12651764221 016361 0ustar00sergiosergio000000 000000 #ifndef NALL_PRIORITY_QUEUE_HPP #define NALL_PRIORITY_QUEUE_HPP #include #include #include #include namespace nall { template void priority_queue_nocallback(type_t) {} //priority queue implementation using binary min-heap array; //does not require normalize() function. //O(1) find (tick) //O(log n) append (enqueue) //O(log n) remove (dequeue) template struct priority_queue { inline void tick(unsigned ticks) { basecounter += ticks; while(heapsize && gte(basecounter, heap[0].counter)) callback(dequeue()); } //counter is relative to current time (eg enqueue(64, ...) fires in 64 ticks); //counter cannot exceed std::numeric_limits::max() >> 1. void enqueue(unsigned counter, type_t event) { unsigned child = heapsize++; counter += basecounter; while(child) { unsigned parent = (child - 1) >> 1; if(gte(counter, heap[parent].counter)) break; heap[child].counter = heap[parent].counter; heap[child].event = heap[parent].event; child = parent; } heap[child].counter = counter; heap[child].event = event; } type_t dequeue() { type_t event(heap[0].event); unsigned parent = 0; unsigned counter = heap[--heapsize].counter; while(true) { unsigned child = (parent << 1) + 1; if(child >= heapsize) break; if(child + 1 < heapsize && gte(heap[child].counter, heap[child + 1].counter)) child++; if(gte(heap[child].counter, counter)) break; heap[parent].counter = heap[child].counter; heap[parent].event = heap[child].event; parent = child; } heap[parent].counter = counter; heap[parent].event = heap[heapsize].event; return event; } void reset() { basecounter = 0; heapsize = 0; } void serialize(serializer& s) { s.integer(basecounter); s.integer(heapsize); for(unsigned n = 0; n < heapcapacity; n++) { s.integer(heap[n].counter); s.integer(heap[n].event); } } priority_queue(unsigned size, function callback = &priority_queue_nocallback) : callback(callback) { heap = new heap_t[size]; heapcapacity = size; reset(); } ~priority_queue() { delete[] heap; } priority_queue& operator=(const priority_queue&) = delete; priority_queue(const priority_queue&) = delete; private: function callback; unsigned basecounter; unsigned heapsize; unsigned heapcapacity; struct heap_t { unsigned counter; type_t event; } *heap; //return true if x is greater than or equal to y inline bool gte(unsigned x, unsigned y) { return x - y < (std::numeric_limits::max() >> 1); } }; } #endif nall/string/core.hpp000664 001750 001750 00000004770 12651764221 015615 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP //only allocators may access _data or modify _size and _capacity //all other functions must use data(), size(), capacity() #if defined(NALL_STRING_ALLOCATOR_COPY_ON_WRITE) #include #elif defined(NALL_STRING_ALLOCATOR_SMALL_STRING_OPTIMIZATION) #include #elif defined(NALL_STRING_ALLOCATOR_VECTOR) #include #endif namespace nall { unsigned string::length() const { return strlen(data()); } unsigned string::size() const { return _size; } unsigned string::capacity() const { return _capacity; } bool string::empty() const { return _size == 0; } void string::clear(char c) { for(unsigned n = 0; n < size(); n++) data()[n] = c; } unsigned string::hash() const { const char* p = data(); unsigned result = 5381; while(*p) result = (result << 5) + result + *p++; return result; } template string& string::assign(Args&&... args) { resize(0); sprint(*this, std::forward(args)...); return *this; } template string& string::append(Args&&... args) { sprint(*this, std::forward(args)...); return *this; } string& string::_append(const char* s) { if(s == nullptr) return *this; unsigned basesize = size(), length = strlen(s); reserve(basesize + length); memcpy(data() + basesize, s, length); resize(basesize + length); return *this; } string::operator bool() const { return !empty(); } string::operator const char*() const { return data(); } char& string::operator[](signed position) { if(position > size() + 1) throw exception_out_of_bounds{}; return data()[position]; } const char& string::operator[](signed position) const { if(position > size() + 1) throw exception_out_of_bounds{}; return data()[position]; } bool string::operator==(const char* str) const { return strcmp(data(), str) == 0; } bool string::operator!=(const char* str) const { return strcmp(data(), str) != 0; } bool string::operator< (const char* str) const { return strcmp(data(), str) < 0; } bool string::operator<=(const char* str) const { return strcmp(data(), str) <= 0; } bool string::operator> (const char* str) const { return strcmp(data(), str) > 0; } bool string::operator>=(const char* str) const { return strcmp(data(), str) >= 0; } string::string(const string& source) { construct(); operator=(source); } string::string(string&& source) { construct(); operator=(std::move(source)); } } #endif gb/000700 001750 001750 00000000000 12656700342 012263 5ustar00sergiosergio000000 000000 gb/memory/memory.cpp000664 001750 001750 00000001630 12651764221 015624 0ustar00sergiosergio000000 000000 #include #define MEMORY_CPP namespace GameBoy { Unmapped unmapped; Bus bus; uint8_t& Memory::operator[](unsigned addr) { return data[addr]; } void Memory::allocate(unsigned size_) { free(); size = size_; data = new uint8_t[size](); } void Memory::copy(const uint8_t* data_, unsigned size_) { free(); size = size_; data = new uint8_t[size]; memcpy(data, data_, size); } void Memory::free() { if(data) { delete[] data; data = 0; } } Memory::Memory() { data = 0; size = 0; } Memory::~Memory() { free(); } // uint8 Bus::read(uint16 addr) { uint8 data = mmio[addr]->mmio_read(addr); if(cheat.enable()) { if(auto result = cheat.find(addr, data)) return result(); } return data; } void Bus::write(uint16 addr, uint8 data) { mmio[addr]->mmio_write(addr, data); } void Bus::power() { for(unsigned n = 0x0000; n <= 0xffff; n++) mmio[n] = &unmapped; } } ananke/000700 001750 001750 00000000000 12656700342 013130 5ustar00sergiosergio000000 000000 phoenix/cocoa/window.hpp000664 001750 001750 00000003422 12651764221 016467 0ustar00sergiosergio000000 000000 @interface CocoaWindow : NSWindow { @public phoenix::Window* window; NSMenu* menuBar; NSMenu* rootMenu; NSTextField* statusBar; } -(id) initWith:(phoenix::Window&)window; -(BOOL) canBecomeKeyWindow; -(BOOL) canBecomeMainWindow; -(void) windowDidBecomeMain:(NSNotification*)notification; -(void) windowDidMove:(NSNotification*)notification; -(void) windowDidResize:(NSNotification*)notification; -(BOOL) windowShouldClose:(id)sender; -(NSDragOperation) draggingEntered:(id)sender; -(BOOL) performDragOperation:(id)sender; -(NSMenu*) menuBar; -(void) menuAbout; -(void) menuPreferences; -(void) menuQuit; -(NSTextField*) statusBar; @end namespace phoenix { struct pWindow : public pObject { Window& window; CocoaWindow* cocoaWindow = nullptr; static Window& none(); void append(Layout& layout); void append(Menu& menu); void append(Widget& widget); bool focused(); Geometry frameMargin(); Geometry geometry(); void remove(Layout& layout); void remove(Menu& menu); void remove(Widget& widget); void setBackgroundColor(Color color); void setDroppable(bool droppable); void setFocused(); void setFullScreen(bool fullScreen); void setGeometry(Geometry geometry); void setMenuFont(string font); void setMenuVisible(bool visible); void setModal(bool modal); void setResizable(bool resizable); void setStatusFont(string font); void setStatusText(string text); void setStatusVisible(bool visible); void setTitle(string text); void setVisible(bool visible); void setWidgetFont(string font); pWindow(Window& window) : pObject(window), window(window) {} void constructor(); void destructor(); void moveEvent(); void sizeEvent(); unsigned statusBarHeight(); void statusBarReposition(); }; } profile/Game Boy Color.sys/000700 001750 001750 00000000000 12656700342 016572 5ustar00sergiosergio000000 000000 ananke/configuration.cpp000664 001750 001750 00000000666 12651764221 016530 0ustar00sergiosergio000000 000000 struct Settings : Configuration::Document { string path; string geometry; Settings() { Configuration::Node node; node.append(path = userpath(), "Path"); node.append(geometry = "64,64,480,600", "Geometry"); append(node, "Settings"); directory::create({configpath(), "ananke/"}); load({configpath(), "ananke/settings.bml"}); } ~Settings() { save({configpath(), "ananke/settings.bml"}); } } config; libco/fiber.c000664 001750 001750 00000001710 12651764221 014232 0ustar00sergiosergio000000 000000 /* libco.win (2008-01-28) authors: Nach, byuu license: public domain */ #define LIBCO_C #include "libco.h" #define WINVER 0x0400 #define _WIN32_WINNT 0x0400 #define WIN32_LEAN_AND_MEAN #include #ifdef __cplusplus extern "C" { #endif static thread_local cothread_t co_active_ = 0; static void __stdcall co_thunk(void *coentry) { ((void (*)(void))coentry)(); } cothread_t co_active(void) { if(!co_active_) { ConvertThreadToFiber(0); co_active_ = GetCurrentFiber(); } return co_active_; } cothread_t co_create(unsigned int heapsize, void (*coentry)(void)) { if(!co_active_) { ConvertThreadToFiber(0); co_active_ = GetCurrentFiber(); } return (cothread_t)CreateFiber(heapsize, co_thunk, (void*)coentry); } void co_delete(cothread_t cothread) { DeleteFiber(cothread); } void co_switch(cothread_t cothread) { co_active_ = cothread; SwitchToFiber(cothread); } #ifdef __cplusplus } #endif processor/gsu/registers.hpp000664 001750 001750 00000011432 12651764221 017246 0ustar00sergiosergio000000 000000 //accepts a callback binding so r14 writes can trigger ROM buffering transparently struct reg16_t { uint16 data; function modify; inline operator unsigned() const { return data; } inline uint16 assign(uint16 i) { if(modify) modify(i); else data = i; return data; } inline unsigned operator++() { return assign(data + 1); } inline unsigned operator--() { return assign(data - 1); } inline unsigned operator++(int) { unsigned r = data; assign(data + 1); return r; } inline unsigned operator--(int) { unsigned r = data; assign(data - 1); return r; } inline unsigned operator = (unsigned i) { return assign(i); } inline unsigned operator |= (unsigned i) { return assign(data | i); } inline unsigned operator ^= (unsigned i) { return assign(data ^ i); } inline unsigned operator &= (unsigned i) { return assign(data & i); } inline unsigned operator <<= (unsigned i) { return assign(data << i); } inline unsigned operator >>= (unsigned i) { return assign(data >> i); } inline unsigned operator += (unsigned i) { return assign(data + i); } inline unsigned operator -= (unsigned i) { return assign(data - i); } inline unsigned operator *= (unsigned i) { return assign(data * i); } inline unsigned operator /= (unsigned i) { return assign(data / i); } inline unsigned operator %= (unsigned i) { return assign(data % i); } inline unsigned operator = (const reg16_t& i) { return assign(i); } reg16_t() : data(0) {} reg16_t(const reg16_t&) = delete; }; struct sfr_t { bool irq; //interrupt flag bool b; //WITH flag bool ih; //immediate higher 8-bit flag bool il; //immediate lower 8-bit flag bool alt2; //ALT2 mode bool alt1; //ALT2 instruction mode bool r; //ROM r14 read flag bool g; //GO flag bool ov; //overflow flag bool s; //sign flag bool cy; //carry flag bool z; //zero flag operator unsigned() const { return (irq << 15) | (b << 12) | (ih << 11) | (il << 10) | (alt2 << 9) | (alt1 << 8) | (r << 6) | (g << 5) | (ov << 4) | (s << 3) | (cy << 2) | (z << 1); } sfr_t& operator=(uint16_t data) { irq = data & 0x8000; b = data & 0x1000; ih = data & 0x0800; il = data & 0x0400; alt2 = data & 0x0200; alt1 = data & 0x0100; r = data & 0x0040; g = data & 0x0020; ov = data & 0x0010; s = data & 0x0008; cy = data & 0x0004; z = data & 0x0002; return *this; } }; struct scmr_t { unsigned ht; bool ron; bool ran; unsigned md; operator unsigned() const { return ((ht >> 1) << 5) | (ron << 4) | (ran << 3) | ((ht & 1) << 2) | (md); } scmr_t& operator=(uint8 data) { ht = (bool)(data & 0x20) << 1; ht |= (bool)(data & 0x04) << 0; ron = data & 0x10; ran = data & 0x08; md = data & 0x03; return *this; } }; struct por_t { bool obj; bool freezehigh; bool highnibble; bool dither; bool transparent; operator unsigned() const { return (obj << 4) | (freezehigh << 3) | (highnibble << 2) | (dither << 1) | (transparent); } por_t& operator=(uint8 data) { obj = data & 0x10; freezehigh = data & 0x08; highnibble = data & 0x04; dither = data & 0x02; transparent = data & 0x01; return *this; } }; struct cfgr_t { bool irq; bool ms0; operator unsigned() const { return (irq << 7) | (ms0 << 5); } cfgr_t& operator=(uint8 data) { irq = data & 0x80; ms0 = data & 0x20; return *this; } }; struct regs_t { uint8 pipeline; uint16 ramaddr; reg16_t r[16]; //general purpose registers sfr_t sfr; //status flag register uint8 pbr; //program bank register uint8 rombr; //game pack ROM bank register bool rambr; //game pack RAM bank register uint16 cbr; //cache base register uint8 scbr; //screen base register scmr_t scmr; //screen mode register uint8 colr; //color register por_t por; //plot option register bool bramr; //back-up RAM register uint8 vcr; //version code register cfgr_t cfgr; //config register bool clsr; //clock select register unsigned romcl; //clock ticks until romdr is valid uint8 romdr; //ROM buffer data register unsigned ramcl; //clock ticks until ramdr is valid uint16 ramar; //RAM buffer address register uint8 ramdr; //RAM buffer data register unsigned sreg, dreg; reg16_t& sr() { return r[sreg]; } //source register (from) reg16_t& dr() { return r[dreg]; } //destination register (to) void reset() { sfr.b = 0; sfr.alt1 = 0; sfr.alt2 = 0; sreg = 0; dreg = 0; } } regs; struct cache_t { uint8 buffer[512]; bool valid[32]; } cache; struct pixelcache_t { uint16 offset; uint8 bitpend; uint8 data[8]; } pixelcache[2]; profile/000700 001750 001750 00000000000 12656700342 013333 5ustar00sergiosergio000000 000000 nall/string/char/utf8.hpp000664 001750 001750 00000001574 12651764221 016467 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { UTF8 utf8_read(const char* s) { UTF8 utf8; if((*s & 0xfe) == 0xfc) utf8.size = 6; else if((*s & 0xfc) == 0xf8) utf8.size = 5; else if((*s & 0xf8) == 0xf0) utf8.size = 4; else if((*s & 0xf0) == 0xe0) utf8.size = 3; else if((*s & 0xe0) == 0xc0) utf8.size = 2; else utf8.size = 1; utf8.data = 0; for(unsigned n = 0; n < utf8.size; n++) { utf8.data = (utf8.data << 8) | (uint8_t)s[n]; } static uint8_t mask[] = { 0, 0x7f, 0x1f, 0x0f, 0x07, 0x03, 0x01 }; utf8.codepoint = s[0] & mask[utf8.size]; for(unsigned n = 1; n < utf8.size; n++) { utf8.codepoint = (utf8.codepoint << 6) | (s[n] & 0x3f); } return utf8; } void utf8_write(char* s, const UTF8& utf8) { for(signed n = utf8.size - 1, shift = 0; n >= 0; n--, shift += 8) { s[n] = utf8.data >> shift; } } } #endif nall/set.hpp000664 001750 001750 00000015347 12651764221 014154 0ustar00sergiosergio000000 000000 #ifndef NALL_SET_HPP #define NALL_SET_HPP //set //implementation: red-black tree // //search: O(log n) average; O(log n) worst //insert: O(log n) average; O(log n) worst //remove: O(log n) average; O(log n) worst // //requirements: // bool T::operator==(const T&) const; // bool T::operator< (const T&) const; #include #include namespace nall { template struct set { struct node_t { T value; bool red = 1; node_t* link[2] = {nullptr, nullptr}; node_t() = default; node_t(const T& value) : value(value) {} }; node_t* root = nullptr; unsigned nodes = 0; set& operator=(const set& source) { copy(source); return *this; } set& operator=(set&& source) { move(std::move(source)); return *this; } set(const set& source) { operator=(source); } set(set&& source) { operator=(std::move(source)); } set(std::initializer_list list) { for(auto& value : list) insert(value); } set() = default; ~set() { reset(); } unsigned size() const { return nodes; } bool empty() const { return nodes == 0; } void reset() { reset(root); nodes = 0; } optional find(const T& value) { if(node_t* node = find(root, value)) return node->value; return false; } optional find(const T& value) const { if(node_t* node = find(root, value)) return node->value; return false; } optional insert(const T& value) { unsigned count = size(); node_t* v = insert(root, value); root->red = 0; if(size() == count) return false; return {true, v->value}; } template bool insert(const T& value, Args&&... args) { bool result = insert(value); insert(std::forward(args)...) | result; return result; } bool remove(const T& value) { unsigned count = size(); bool done = 0; remove(root, &value, done); if(root) root->red = 0; return size() < count; } template bool remove(const T& value, Args&&... args) { bool result = remove(value); return remove(std::forward(args)...) | result; } struct base_iterator { bool operator!=(const base_iterator& source) const { return position != source.position; } base_iterator& operator++() { if(++position >= source.size()) { position = source.size(); return *this; } if(stack.last()->link[1]) { stack.append(stack.last()->link[1]); while(stack.last()->link[0]) stack.append(stack.last()->link[0]); } else { node_t* child; do child = stack.take(); while(child == stack.last()->link[1]); } return *this; } base_iterator(const set& source, unsigned position) : source(source), position(position) { node_t* node = source.root; while(node) { stack.append(node); node = node->link[0]; } } protected: const set& source; unsigned position; vector stack; }; struct iterator : base_iterator { T& operator*() const { return base_iterator::stack.last()->value; } iterator(const set& source, unsigned position) : base_iterator(source, position) {} }; iterator begin() { return iterator(*this, 0); } iterator end() { return iterator(*this, size()); } struct const_iterator : base_iterator { const T& operator*() const { return base_iterator::stack.last()->value; } const_iterator(const set& source, unsigned position) : base_iterator(source, position) {} }; const const_iterator begin() const { return const_iterator(*this, 0); } const const_iterator end() const { return const_iterator(*this, size()); } private: void reset(node_t*& node) { if(!node) return; if(node->link[0]) reset(node->link[0]); if(node->link[1]) reset(node->link[1]); delete node; node = nullptr; } void copy(const set& source) { reset(); copy(root, source.root); nodes = source.nodes; } void copy(node_t*& target, const node_t* source) { if(!source) return; target = new node_t(source->value); target->red = source->red; copy(target->link[0], source->link[0]); copy(target->link[1], source->link[1]); } void move(set&& source) { root = source.root; nodes = source.nodes; source.root = nullptr; source.nodes = 0; } node_t* find(node_t* node, const T& value) const { if(node == nullptr) return nullptr; if(node->value == value) return node; return find(node->link[node->value < value], value); } bool red(node_t* node) const { return node && node->red; } bool black(node_t* node) const { return !red(node); } void rotate(node_t*& a, bool dir) { node_t*& b = a->link[!dir]; node_t*& c = b->link[dir]; a->red = 1, b->red = 0; std::swap(a, b); std::swap(b, c); } void rotateTwice(node_t*& node, bool dir) { rotate(node->link[!dir], !dir); rotate(node, dir); } node_t* insert(node_t*& node, const T& value) { if(!node) { nodes++; node = new node_t(value); return node; } if(node->value == value) { node->value = value; return node; } //prevent duplicate entries bool dir = node->value < value; node_t* v = insert(node->link[dir], value); if(black(node->link[dir])) return v; if(red(node->link[!dir])) { node->red = 1; node->link[0]->red = 0; node->link[1]->red = 0; } else if(red(node->link[dir]->link[dir])) { rotate(node, !dir); } else if(red(node->link[dir]->link[!dir])) { rotateTwice(node, !dir); } return v; } void balance(node_t*& node, bool dir, bool& done) { node_t* p = node; node_t* s = node->link[!dir]; if(!s) return; if(red(s)) { rotate(node, dir); s = p->link[!dir]; } if(black(s->link[0]) && black(s->link[1])) { if(red(p)) done = 1; p->red = 0, s->red = 1; } else { bool save = p->red; bool head = node == p; if(red(s->link[!dir])) rotate(p, dir); else rotateTwice(p, dir); p->red = save; p->link[0]->red = 0; p->link[1]->red = 0; if(head) node = p; else node->link[dir] = p; done = 1; } } void remove(node_t*& node, const T* value, bool& done) { if(!node) { done = 1; return; } if(node->value == *value) { if(!node->link[0] || !node->link[1]) { node_t* save = node->link[!node->link[0]]; if(red(node)) done = 1; else if(red(save)) save->red = 0, done = 1; nodes--; delete node; node = save; return; } else { node_t* heir = node->link[0]; while(heir->link[1]) heir = heir->link[1]; node->value = heir->value; value = &heir->value; } } bool dir = node->value < *value; remove(node->link[dir], value, done); if(!done) balance(node, dir, done); } }; } #endif gb/apu/square1/square1.cpp000664 001750 001750 00000007150 12651764221 016536 0ustar00sergiosergio000000 000000 #ifdef APU_CPP bool APU::Square1::dac_enable() { return (envelope_volume || envelope_direction); } void APU::Square1::run() { if(period && --period == 0) { period = 2 * (2048 - frequency); phase++; switch(duty) { case 0: duty_output = (phase == 6); break; //______-_ case 1: duty_output = (phase >= 6); break; //______-- case 2: duty_output = (phase >= 4); break; //____---- case 3: duty_output = (phase <= 5); break; //------__ } } uint4 sample = (duty_output ? volume : (uint4)0); if(enable == false) sample = 0; output = sample; } void APU::Square1::sweep(bool update) { if(sweep_enable == false) return; sweep_negate = sweep_direction; unsigned delta = frequency_shadow >> sweep_shift; signed freq = frequency_shadow + (sweep_negate ? -delta : delta); if(freq > 2047) { enable = false; } else if(sweep_shift && update) { frequency_shadow = freq; frequency = freq & 2047; period = 2 * (2048 - frequency); } } void APU::Square1::clock_length() { if(counter && enable) { if(++length == 0) enable = false; } } void APU::Square1::clock_sweep() { if(enable && sweep_frequency && --sweep_period == 0) { sweep_period = sweep_frequency; sweep(1); sweep(0); } } void APU::Square1::clock_envelope() { if(enable && envelope_frequency && --envelope_period == 0) { envelope_period = envelope_frequency; if(envelope_direction == 0 && volume > 0) volume--; if(envelope_direction == 1 && volume < 15) volume++; } } void APU::Square1::write(unsigned r, uint8 data) { if(r == 0) { //$ff10 NR10 if(sweep_negate && sweep_direction && !(data & 0x08)) enable = false; sweep_frequency = (data >> 4) & 7; sweep_direction = data & 0x08; sweep_shift = data & 0x07; } if(r == 1) { //$ff11 NR11 duty = data >> 6; length = data & 0x3f; } if(r == 2) { //$ff12 NR12 envelope_volume = data >> 4; envelope_direction = data & 0x08; envelope_frequency = data & 0x07; if(dac_enable() == false) enable = false; } if(r == 3) { //$ff13 NR13 frequency = (frequency & 0x0700) | data; } if(r == 4) { //$ff14 NR14 bool initialize = data & 0x80; counter = data & 0x40; frequency = ((data & 7) << 8) | (frequency & 0x00ff); if(initialize) { enable = dac_enable(); period = 2 * (2048 - frequency); envelope_period = envelope_frequency; volume = envelope_volume; frequency_shadow = frequency; sweep_period = sweep_frequency; sweep_enable = sweep_period || sweep_shift; sweep_negate = false; if(sweep_shift) sweep(0); } } } void APU::Square1::power() { enable = 0; sweep_frequency = 0; sweep_direction = 0; sweep_shift = 0; sweep_negate = 0; duty = 0; length = 0; envelope_volume = 0; envelope_direction = 0; envelope_frequency = 0; frequency = 0; counter = 0; output = 0; duty_output = 0; phase = 0; period = 0; envelope_period = 0; sweep_period = 0; frequency_shadow = 0; sweep_enable = 0; volume = 0; } void APU::Square1::serialize(serializer& s) { s.integer(enable); s.integer(sweep_frequency); s.integer(sweep_direction); s.integer(sweep_shift); s.integer(sweep_negate); s.integer(duty); s.integer(length); s.integer(envelope_volume); s.integer(envelope_direction); s.integer(envelope_frequency); s.integer(frequency); s.integer(counter); s.integer(output); s.integer(duty_output); s.integer(phase); s.integer(period); s.integer(envelope_period); s.integer(sweep_period); s.integer(frequency_shadow); s.integer(sweep_enable); s.integer(volume); } #endif ananke/obj/.gitignore000664 001750 001750 00000000004 12651764221 015701 0ustar00sergiosergio000000 000000 *.o sfc/slot/000700 001750 001750 00000000000 12656700342 013427 5ustar00sergiosergio000000 000000 processor/gsu/000700 001750 001750 00000000000 12656700342 014510 5ustar00sergiosergio000000 000000 phoenix/windows/window.cpp000664 001750 001750 00000022616 12651764221 017076 0ustar00sergiosergio000000 000000 namespace phoenix { vector pWindow::modal; //EnableWindow(hwnd, false) sends WM_KILLFOCUS; deactivating said window //EnableWindow(hwnd, true) does not restore lost focus //when a modal loop finishes, and the dialog is dismissed, the application loses focus entirely //due to anti-focus-stealing code in Windows, SetForegroundWindow() cannot restore lost focus //further, GetActiveWindow() returns nothing when all windows have lost focus //thus, we must use a focus-stealing hack to reclaim the focus we never intended to dismiss; //and we must replicate GetActiveWindow() by scanning the Z-order of windows for this process void pWindow::updateModality() { //bind thread input to process that currently has input focus auto threadId = GetWindowThreadProcessId(GetForegroundWindow(), NULL); AttachThreadInput(threadId, GetCurrentThreadId(), TRUE); pWindow* topMost = nullptr; for(auto& object : pObject::objects) { if(dynamic_cast(object) == nullptr) continue; pWindow* p = (pWindow*)object; bool enable = modal.size() == 0 || modal.find(p); if(IsWindowEnabled(p->hwnd) != enable) EnableWindow(p->hwnd, enable); if(enable && p->window.visible()) { if(topMost == nullptr) topMost = p; else if(GetWindowZOrder(p->hwnd) < GetWindowZOrder(topMost->hwnd)) topMost = p; } } //set input focus on top-most window if(topMost) { SetForegroundWindow(topMost->hwnd); SetActiveWindow(topMost->hwnd); } //unbind thread input hook AttachThreadInput(threadId, GetCurrentThreadId(), FALSE); } static const unsigned FixedStyle = WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX | WS_BORDER; static const unsigned ResizableStyle = WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_THICKFRAME; Window& pWindow::none() { static Window* window = nullptr; if(window == nullptr) window = new Window; return *window; } void pWindow::append(Layout& layout) { Geometry geom = window.state.geometry; geom.x = geom.y = 0; layout.setGeometry(geom); } void pWindow::append(Menu& menu) { menu.p.parentWindow = &window; updateMenu(); } void pWindow::append(Widget& widget) { if(GetParentWidget(&widget)) { widget.p.parentHwnd = GetParentWidget(&widget)->p.hwnd; } else { widget.p.parentHwnd = window.p.hwnd; } widget.p.orphan(); if(widget.font().empty() && !window.state.widgetFont.empty()) { widget.setFont(window.state.widgetFont); } } bool pWindow::focused() { return (GetForegroundWindow() == hwnd); } Geometry pWindow::frameMargin() { unsigned style = window.state.resizable ? ResizableStyle : FixedStyle; if(window.state.fullScreen) style = 0; RECT rc = {0, 0, 640, 480}; AdjustWindowRect(&rc, style, window.state.menuVisible); unsigned statusHeight = 0; if(window.state.statusVisible) { RECT src; GetClientRect(hstatus, &src); statusHeight = src.bottom - src.top; } return {abs(rc.left), abs(rc.top), (rc.right - rc.left) - 640, (rc.bottom - rc.top) + statusHeight - 480}; } Geometry pWindow::geometry() { Geometry margin = frameMargin(); RECT rc; if(IsIconic(hwnd)) { //GetWindowRect returns -32000(x),-32000(y) when window is minimized WINDOWPLACEMENT wp; GetWindowPlacement(hwnd, &wp); rc = wp.rcNormalPosition; } else { GetWindowRect(hwnd, &rc); } signed x = rc.left + margin.x; signed y = rc.top + margin.y; unsigned width = (rc.right - rc.left) - margin.width; unsigned height = (rc.bottom - rc.top) - margin.height; return {x, y, width, height}; } void pWindow::remove(Layout& layout) { } void pWindow::remove(Menu& menu) { updateMenu(); } void pWindow::remove(Widget& widget) { widget.p.orphan(); } void pWindow::setBackgroundColor(Color color) { if(brush) DeleteObject(brush); brushColor = RGB(color.red, color.green, color.blue); brush = CreateSolidBrush(brushColor); } void pWindow::setDroppable(bool droppable) { DragAcceptFiles(hwnd, droppable); } void pWindow::setFocused() { if(window.state.visible == false) setVisible(true); SetFocus(hwnd); } void pWindow::setFullScreen(bool fullScreen) { locked = true; if(fullScreen == false) { SetWindowLongPtr(hwnd, GWL_STYLE, WS_VISIBLE | (window.state.resizable ? ResizableStyle : FixedStyle)); setGeometry(window.state.geometry); } else { HMONITOR monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST); MONITORINFOEX info; memset(&info, 0, sizeof(MONITORINFOEX)); info.cbSize = sizeof(MONITORINFOEX); GetMonitorInfo(monitor, &info); RECT rc = info.rcMonitor; Geometry geometry = {rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top}; SetWindowLongPtr(hwnd, GWL_STYLE, WS_VISIBLE | WS_POPUP); Geometry margin = frameMargin(); setGeometry({ geometry.x + margin.x, geometry.y + margin.y, geometry.width - margin.width, geometry.height - margin.height }); } locked = false; } void pWindow::setGeometry(Geometry geometry) { locked = true; Geometry margin = frameMargin(); SetWindowPos( hwnd, NULL, geometry.x - margin.x, geometry.y - margin.y, geometry.width + margin.width, geometry.height + margin.height, SWP_NOZORDER | SWP_FRAMECHANGED ); SetWindowPos(hstatus, NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_FRAMECHANGED); for(auto& layout : window.state.layout) { Geometry geom = this->geometry(); geom.x = geom.y = 0; layout.setGeometry(geom); } locked = false; } void pWindow::setMenuFont(string font) { } void pWindow::setMenuVisible(bool visible) { locked = true; SetMenu(hwnd, visible ? hmenu : 0); setGeometry(window.state.geometry); locked = false; } void pWindow::setModal(bool modality) { if(modality == true) { modal.appendOnce(this); updateModality(); while(window.state.modal) { Application::processEvents(); usleep(20 * 1000); } if(auto position = modal.find(this)) modal.remove(position()); updateModality(); } } void pWindow::setResizable(bool resizable) { SetWindowLongPtr(hwnd, GWL_STYLE, window.state.resizable ? ResizableStyle : FixedStyle); setGeometry(window.state.geometry); } void pWindow::setStatusFont(string font) { if(hstatusfont) DeleteObject(hstatusfont); hstatusfont = pFont::create(font); SendMessage(hstatus, WM_SETFONT, (WPARAM)hstatusfont, 0); } void pWindow::setStatusText(string text) { SendMessage(hstatus, SB_SETTEXT, 0, (LPARAM)(wchar_t*)utf16_t(text)); } void pWindow::setStatusVisible(bool visible) { locked = true; ShowWindow(hstatus, visible ? SW_SHOWNORMAL : SW_HIDE); setGeometry(window.state.geometry); locked = false; } void pWindow::setTitle(string text) { SetWindowText(hwnd, utf16_t(text)); } void pWindow::setVisible(bool visible) { ShowWindow(hwnd, visible ? SW_SHOWNORMAL : SW_HIDE); if(visible == false) setModal(false); } void pWindow::setWidgetFont(string font) { } void pWindow::constructor() { brush = 0; hwnd = CreateWindow(L"phoenix_window", L"", ResizableStyle, 128, 128, 256, 256, 0, 0, GetModuleHandle(0), 0); hmenu = CreateMenu(); hstatus = CreateWindow(STATUSCLASSNAME, L"", WS_CHILD, 0, 0, 0, 0, hwnd, 0, GetModuleHandle(0), 0); hstatusfont = 0; setStatusFont(Font::sans(8)); //status bar will be capable of receiving tab focus if it is not disabled SetWindowLongPtr(hstatus, GWL_STYLE, GetWindowLong(hstatus, GWL_STYLE) | WS_DISABLED); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&window); setDroppable(window.state.droppable); setGeometry({128, 128, 256, 256}); DWORD color = GetSysColor(COLOR_3DFACE); window.state.backgroundColor = Color((uint8_t)(color >> 16), (uint8_t)(color >> 8), (uint8_t)(color >> 0), 255u); } void pWindow::destructor() { DeleteObject(hstatusfont); DestroyWindow(hstatus); DestroyMenu(hmenu); DestroyWindow(hwnd); } void pWindow::updateMenu() { if(hmenu) DestroyMenu(hmenu); hmenu = CreateMenu(); for(auto& menu : window.state.menu) { menu.p.update(window); if(menu.visible()) { AppendMenu(hmenu, MF_STRING | MF_POPUP, (UINT_PTR)menu.p.hmenu, utf16_t(menu.state.text)); } } SetMenu(hwnd, window.state.menuVisible ? hmenu : 0); } void pWindow::onClose() { if(window.onClose) window.onClose(); else window.setVisible(false); if(window.state.modal && !window.state.visible) window.setModal(false); } void pWindow::onDrop(WPARAM wparam) { lstring paths = DropPaths(wparam); if(paths.empty()) return; if(window.onDrop) window.onDrop(paths); } bool pWindow::onEraseBackground() { if(brush == 0) return false; RECT rc; GetClientRect(hwnd, &rc); PAINTSTRUCT ps; BeginPaint(hwnd, &ps); FillRect(ps.hdc, &rc, brush); EndPaint(hwnd, &ps); return true; } void pWindow::onModalBegin() { if(Application::Windows::onModalBegin) Application::Windows::onModalBegin(); } void pWindow::onModalEnd() { if(Application::Windows::onModalEnd) Application::Windows::onModalEnd(); } void pWindow::onMove() { if(locked) return; Geometry windowGeometry = geometry(); window.state.geometry.x = windowGeometry.x; window.state.geometry.y = windowGeometry.y; if(window.onMove) window.onMove(); } void pWindow::onSize() { if(locked) return; SetWindowPos(hstatus, NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_FRAMECHANGED); Geometry windowGeometry = geometry(); window.state.geometry.width = windowGeometry.width; window.state.geometry.height = windowGeometry.height; for(auto& layout : window.state.layout) { Geometry geom = geometry(); geom.x = geom.y = 0; layout.setGeometry(geom); } if(window.onSize) window.onSize(); } } fc/000700 001750 001750 00000000000 12656700342 012263 5ustar00sergiosergio000000 000000 sfc/ppu/counter/000700 001750 001750 00000000000 12656700342 014731 5ustar00sergiosergio000000 000000 phoenix/windows/application.cpp000664 001750 001750 00000016152 12651764221 020070 0ustar00sergiosergio000000 000000 namespace phoenix { static bool Application_keyboardProc(HWND, UINT, WPARAM, LPARAM); static void Application_processDialogMessage(MSG&); static LRESULT CALLBACK Application_windowProc(HWND, UINT, WPARAM, LPARAM); void pApplication::run() { MSG msg; if(Application::main) { while(applicationState.quit == false) { Application::main(); processEvents(); } } else { MSG msg; while(GetMessage(&msg, 0, 0, 0)) { Application_processDialogMessage(msg); } } } bool pApplication::pendingEvents() { MSG msg; return PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE); } void pApplication::processEvents() { while(pendingEvents()) { MSG msg; if(PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { Application_processDialogMessage(msg); } } } void Application_processDialogMessage(MSG& msg) { if(msg.message == WM_KEYDOWN || msg.message == WM_KEYUP || msg.message == WM_SYSKEYDOWN || msg.message == WM_SYSKEYUP) { if(Application_keyboardProc(msg.hwnd, msg.message, msg.wParam, msg.lParam)) { DispatchMessage(&msg); return; } } if(!IsDialogMessage(GetForegroundWindow(), &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } void pApplication::quit() { PostQuitMessage(0); } void pApplication::initialize() { CoInitialize(0); InitCommonControls(); WNDCLASS wc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE); wc.hCursor = LoadCursor(0, IDC_ARROW); wc.hIcon = LoadIcon(GetModuleHandle(0), MAKEINTRESOURCE(2)); wc.hInstance = GetModuleHandle(0); wc.lpfnWndProc = Application_windowProc; wc.lpszClassName = L"phoenix_window"; wc.lpszMenuName = 0; wc.style = CS_HREDRAW | CS_VREDRAW; RegisterClass(&wc); wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE); wc.hCursor = LoadCursor(0, IDC_ARROW); wc.hIcon = LoadIcon(0, IDI_APPLICATION); wc.hInstance = GetModuleHandle(0); wc.lpfnWndProc = Canvas_windowProc; wc.lpszClassName = L"phoenix_canvas"; wc.lpszMenuName = 0; wc.style = CS_HREDRAW | CS_VREDRAW; RegisterClass(&wc); wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE); wc.hCursor = LoadCursor(0, IDC_ARROW); wc.hIcon = LoadIcon(0, IDI_APPLICATION); wc.hInstance = GetModuleHandle(0); wc.lpfnWndProc = Label_windowProc; wc.lpszClassName = L"phoenix_label"; wc.lpszMenuName = 0; wc.style = CS_HREDRAW | CS_VREDRAW; RegisterClass(&wc); wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hbrBackground = CreateSolidBrush(RGB(0, 0, 0)); wc.hCursor = LoadCursor(0, IDC_ARROW); wc.hIcon = LoadIcon(0, IDI_APPLICATION); wc.hInstance = GetModuleHandle(0); wc.lpfnWndProc = Viewport_windowProc; wc.lpszClassName = L"phoenix_viewport"; wc.lpszMenuName = 0; wc.style = CS_HREDRAW | CS_VREDRAW; RegisterClass(&wc); settings = new Settings; pKeyboard::initialize(); } static bool Application_keyboardProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { if(msg != WM_KEYDOWN && msg != WM_SYSKEYDOWN && msg != WM_KEYUP && msg != WM_SYSKEYUP) return false; GUITHREADINFO info; memset(&info, 0, sizeof(GUITHREADINFO)); info.cbSize = sizeof(GUITHREADINFO); GetGUIThreadInfo(GetCurrentThreadId(), &info); Object* object = (Object*)GetWindowLongPtr(info.hwndFocus, GWLP_USERDATA); if(object == nullptr) return false; if(dynamic_cast(object)) { Window& window = (Window&)*object; if(pWindow::modal.size() > 0 && !pWindow::modal.find(&window.p)) return false; Keyboard::Keycode keysym = Keysym(wparam, lparam); if(keysym != Keyboard::Keycode::None) { if((msg == WM_KEYDOWN || msg == WM_SYSKEYDOWN) && window.onKeyPress) window.onKeyPress(keysym); if((msg == WM_KEYUP || msg == WM_SYSKEYUP) && window.onKeyRelease) window.onKeyRelease(keysym); } return false; } if(msg == WM_KEYDOWN) { if(dynamic_cast(object)) { ListView& listView = (ListView&)*object; if(wparam == VK_RETURN) { if(listView.selected()) return true; //returning true generates LVN_ITEMACTIVATE message } } else if(dynamic_cast(object)) { LineEdit& lineEdit = (LineEdit&)*object; if(wparam == VK_RETURN) { if(lineEdit.onActivate) lineEdit.onActivate(); } } else if(dynamic_cast(object)) { TextEdit& textEdit = (TextEdit&)*object; if(wparam == 'A' && GetKeyState(VK_CONTROL) < 0) { //Ctrl+A = select all text //note: this is not a standard accelerator on Windows Edit_SetSel(textEdit.p.hwnd, 0, ~0); return true; } else if(wparam == 'V' && GetKeyState(VK_CONTROL) < 0) { //Ctrl+V = paste text //note: this formats Unix (LF) and OS9 (CR) line-endings to Windows (CR+LF) line-endings //this is necessary as the EDIT control only supports Windows line-endings OpenClipboard(hwnd); HANDLE handle = GetClipboardData(CF_UNICODETEXT); if(handle) { wchar_t* text = (wchar_t*)GlobalLock(handle); if(text) { string data = (const char*)utf8_t(text); data.replace("\r\n", "\n"); data.replace("\r", "\n"); data.replace("\n", "\r\n"); GlobalUnlock(handle); utf16_t output(data); HGLOBAL resource = GlobalAlloc(GMEM_MOVEABLE, (wcslen(output) + 1) * sizeof(wchar_t)); if(resource) { wchar_t* write = (wchar_t*)GlobalLock(resource); if(write) { wcscpy(write, output); GlobalUnlock(write); if(SetClipboardData(CF_UNICODETEXT, resource) == FALSE) { GlobalFree(resource); } } } } } CloseClipboard(); return false; } } } return false; } /*case WM_GETMINMAXINFO: { MINMAXINFO* mmi = (MINMAXINFO*)lparam; mmi->ptMinTrackSize.x = 256 + window.p.frameMargin().width; mmi->ptMinTrackSize.y = 256 + window.p.frameMargin().height; return TRUE; break; }*/ static LRESULT CALLBACK Application_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { Object* object = (Object*)GetWindowLongPtr(hwnd, GWLP_USERDATA); if(object == nullptr) return DefWindowProc(hwnd, msg, wparam, lparam); Window& window = dynamic_cast(object) ? (Window&)*object : *((Widget*)object)->Sizable::state.window; bool process = true; if(!pWindow::modal.empty() && !pWindow::modal.find(&window.p)) process = false; if(applicationState.quit) process = false; if(process == false) return DefWindowProc(hwnd, msg, wparam, lparam); switch(msg) { case WM_CLOSE: window.p.onClose(); return TRUE; case WM_MOVE: window.p.onMove(); break; case WM_SIZE: window.p.onSize(); break; case WM_DROPFILES: window.p.onDrop(wparam); return FALSE; case WM_ERASEBKGND: if(window.p.onEraseBackground()) return true; break; case WM_ENTERMENULOOP: case WM_ENTERSIZEMOVE: window.p.onModalBegin(); return FALSE; case WM_EXITMENULOOP: case WM_EXITSIZEMOVE: window.p.onModalEnd(); return FALSE; } return Shared_windowProc(DefWindowProc, hwnd, msg, wparam, lparam); } } sfc/chip/superfx/superfx.hpp000664 001750 001750 00000001075 12651764221 017312 0ustar00sergiosergio000000 000000 struct SuperFX : Processor::GSU, Coprocessor { MappedRAM rom; MappedRAM ram; #include "bus/bus.hpp" #include "core/core.hpp" #include "memory/memory.hpp" #include "mmio/mmio.hpp" #include "timing/timing.hpp" #include "disassembler/disassembler.hpp" static void Enter(); void enter(); void init(); void load(); void unload(); void power(); void reset(); void serialize(serializer&); privileged: unsigned clockmode = 0; //0 = selectable, 1 = force 10.74mhz, 2 = force 21.48mhz unsigned instruction_counter; }; extern SuperFX superfx; gba/apu/mmio.cpp000664 001750 001750 00000013047 12651764221 014700 0ustar00sergiosergio000000 000000 uint8 APU::read(uint32 addr) { switch(addr) { //NR10 case 0x04000060: return square1.read(0); case 0x04000061: return 0u; //NR11 + NR12 case 0x04000062: return square1.read(1); case 0x04000063: return square1.read(2); //NR13 + NR14 case 0x04000064: return square1.read(3); case 0x04000065: return square1.read(4); //NR21 + NR22 case 0x04000068: return square2.read(1); case 0x04000069: return square2.read(2); //NR23 + NR24 case 0x0400006c: return square2.read(3); case 0x0400006d: return square2.read(4); //NR30 case 0x04000070: return wave.read(0); case 0x04000071: return 0u; //NR31 + NR32 case 0x04000072: return wave.read(1); case 0x04000073: return wave.read(2); //NR33 + NR34 case 0x04000074: return wave.read(3); case 0x04000075: return wave.read(4); //NR41 + NR42 case 0x04000078: return noise.read(1); case 0x04000079: return noise.read(2); //NR43 + NR44 case 0x0400007c: return noise.read(3); case 0x0400007d: return noise.read(4); //NR50 + NR51 case 0x04000080: return sequencer.read(0); case 0x04000081: return sequencer.read(1); //SOUND_CNT_H case 0x04000082: return (fifo[1].volume << 3) | (fifo[0].volume << 2) | (sequencer.volume << 0); case 0x04000083: return (fifo[1].timer << 6) | (fifo[1].lenable << 5) | (fifo[1].renable << 4) | (fifo[0].timer << 2) | (fifo[0].lenable << 1) | (fifo[0].renable << 0); //NR52 case 0x04000084: return sequencer.read(2); case 0x04000085: return 0u; //SOUNDBIAS case 0x04000088: return regs.bias >> 0; case 0x04000089: return regs.bias >> 8; //WAVE_RAM0_L case 0x04000090: return wave.readram( 0); case 0x04000091: return wave.readram( 1); //WAVE_RAM0_H case 0x04000092: return wave.readram( 2); case 0x04000093: return wave.readram( 3); //WAVE_RAM1_L case 0x04000094: return wave.readram( 4); case 0x04000095: return wave.readram( 5); //WAVE_RAM1_H case 0x04000096: return wave.readram( 6); case 0x04000097: return wave.readram( 7); //WAVE_RAM2_L case 0x04000098: return wave.readram( 8); case 0x04000099: return wave.readram( 9); //WAVE_RAM2_H case 0x0400009a: return wave.readram(10); case 0x0400009b: return wave.readram(11); //WAVE_RAM3_L case 0x0400009c: return wave.readram(12); case 0x0400009d: return wave.readram(13); //WAVE_RAM3_H case 0x0400009e: return wave.readram(14); case 0x0400009f: return wave.readram(15); } return 0u; } void APU::write(uint32 addr, uint8 byte) { switch(addr) { //NR10 case 0x04000060: return square1.write(0, byte); case 0x04000061: return; //NR11 + NR12 case 0x04000062: return square1.write(1, byte); case 0x04000063: return square1.write(2, byte); //NR13 + NR14 case 0x04000064: return square1.write(3, byte); case 0x04000065: return square1.write(4, byte); //NR21 + NR22 case 0x04000068: return square2.write(1, byte); case 0x04000069: return square2.write(2, byte); //NR23 + NR24 case 0x0400006c: return square2.write(3, byte); case 0x0400006d: return square2.write(4, byte); //NR30 case 0x04000070: return wave.write(0, byte); case 0x04000071: return; //NR31 + NR32 case 0x04000072: return wave.write(1, byte); case 0x04000073: return wave.write(2, byte); //NR33 + NR34 case 0x04000074: return wave.write(3, byte); case 0x04000075: return wave.write(4, byte); //NR41 + NR42 case 0x04000078: return noise.write(1, byte); case 0x04000079: return noise.write(2, byte); //NR43 + NR44 case 0x0400007c: return noise.write(3, byte); case 0x0400007d: return noise.write(4, byte); //NR50 + NR51 case 0x04000080: return sequencer.write(0, byte); case 0x04000081: return sequencer.write(1, byte); //SOUND_CNT_H case 0x04000082: sequencer.volume = byte >> 0; fifo[0].volume = byte >> 2; fifo[1].volume = byte >> 3; return; case 0x04000083: fifo[0].renable = byte >> 0; fifo[0].lenable = byte >> 1; fifo[0].timer = byte >> 2; if(byte & 1 << 3) fifo[0].reset(); fifo[1].renable = byte >> 4; fifo[1].lenable = byte >> 5; fifo[1].timer = byte >> 6; if(byte & 1 << 7) fifo[1].reset(); return; //NR52 case 0x04000084: return sequencer.write(2, byte); case 0x04000085: return; //SOUNDBIAS case 0x04000088: regs.bias = (regs.bias & 0xff00) | (byte << 0); return; case 0x04000089: regs.bias = (regs.bias & 0x00ff) | (byte << 8); return; //WAVE_RAM0_L case 0x04000090: return wave.writeram( 0, byte); case 0x04000091: return wave.writeram( 1, byte); //WAVE_RAM0_H case 0x04000092: return wave.writeram( 2, byte); case 0x04000093: return wave.writeram( 3, byte); //WAVE_RAM1_L case 0x04000094: return wave.writeram( 4, byte); case 0x04000095: return wave.writeram( 5, byte); //WAVE_RAM1_H case 0x04000096: return wave.writeram( 6, byte); case 0x04000097: return wave.writeram( 7, byte); //WAVE_RAM2_L case 0x04000098: return wave.writeram( 8, byte); case 0x04000099: return wave.writeram( 9, byte); //WAVE_RAM2_H case 0x0400009a: return wave.writeram(10, byte); case 0x0400009b: return wave.writeram(11, byte); //WAVE_RAM3_L case 0x0400009c: return wave.writeram(12, byte); case 0x0400009d: return wave.writeram(13, byte); //WAVE_RAM3_H case 0x0400009e: return wave.writeram(14, byte); case 0x0400009f: return wave.writeram(15, byte); //FIFO_A_L //FIFO_A_H case 0x040000a0: case 0x040000a1: case 0x040000a2: case 0x040000a3: return fifo[0].write(byte); //FIFO_B_L //FIFO_B_H case 0x040000a4: case 0x040000a5: case 0x040000a6: case 0x040000a7: return fifo[1].write(byte); } } sfc/alt/smp/core/op_read.b000664 001750 001750 00000010477 12651764221 016557 0ustar00sergiosergio000000 000000 adc_a_const(0x88, adc, a), and_a_const(0x28, and, a), cmp_a_const(0x68, cmp, a), cmp_x_const(0xc8, cmp, x), cmp_y_const(0xad, cmp, y), eor_a_const(0x48, eor, a), or_a_const(0x08, or, a), sbc_a_const(0xa8, sbc, a) { 1:rd = op_readpc(); regs.$2 = op_$1(regs.$2, rd); } adc_a_ix(0x86, adc), and_a_ix(0x26, and), cmp_a_ix(0x66, cmp), eor_a_ix(0x46, eor), or_a_ix(0x06, or), sbc_a_ix(0xa6, sbc) { 1:op_io(); 2:rd = op_readdp(regs.x); regs.a = op_$1(regs.a, rd); } adc_a_dp(0x84, adc, a), and_a_dp(0x24, and, a), cmp_a_dp(0x64, cmp, a), cmp_x_dp(0x3e, cmp, x), cmp_y_dp(0x7e, cmp, y), eor_a_dp(0x44, eor, a), or_a_dp(0x04, or, a), sbc_a_dp(0xa4, sbc, a) { 1:dp = op_readpc(); 2:rd = op_readdp(dp); regs.$2 = op_$1(regs.$2, rd); } adc_a_dpx(0x94, adc), and_a_dpx(0x34, and), cmp_a_dpx(0x74, cmp), eor_a_dpx(0x54, eor), or_a_dpx(0x14, or), sbc_a_dpx(0xb4, sbc) { 1:dp = op_readpc(); 2:op_io(); 3:rd = op_readdp(dp + regs.x); regs.a = op_$1(regs.a, rd); } adc_a_addr(0x85, adc, a), and_a_addr(0x25, and, a), cmp_a_addr(0x65, cmp, a), cmp_x_addr(0x1e, cmp, x), cmp_y_addr(0x5e, cmp, y), eor_a_addr(0x45, eor, a), or_a_addr(0x05, or, a), sbc_a_addr(0xa5, sbc, a) { 1:dp = op_readpc(); 2:dp |= op_readpc() << 8; 3:rd = op_readaddr(dp); regs.$2 = op_$1(regs.$2, rd); } adc_a_addrx(0x95, adc, x), adc_a_addry(0x96, adc, y), and_a_addrx(0x35, and, x), and_a_addry(0x36, and, y), cmp_a_addrx(0x75, cmp, x), cmp_a_addry(0x76, cmp, y), eor_a_addrx(0x55, eor, x), eor_a_addry(0x56, eor, y), or_a_addrx(0x15, or, x), or_a_addry(0x16, or, y), sbc_a_addrx(0xb5, sbc, x), sbc_a_addry(0xb6, sbc, y) { 1:dp = op_readpc(); 2:dp |= op_readpc() << 8; 3:op_io(); 4:rd = op_readaddr(dp + regs.$2); regs.a = op_$1(regs.a, rd); } adc_a_idpx(0x87, adc), and_a_idpx(0x27, and), cmp_a_idpx(0x67, cmp), eor_a_idpx(0x47, eor), or_a_idpx(0x07, or), sbc_a_idpx(0xa7, sbc) { 1:dp = op_readpc() + regs.x; 2:op_io(); 3:sp = op_readdp(dp); 4:sp |= op_readdp(dp + 1) << 8; 5:rd = op_readaddr(sp); regs.a = op_$1(regs.a, rd); } adc_a_idpy(0x97, adc), and_a_idpy(0x37, and), cmp_a_idpy(0x77, cmp), eor_a_idpy(0x57, eor), or_a_idpy(0x17, or), sbc_a_idpy(0xb7, sbc) { 1:dp = op_readpc(); 2:op_io(); 3:sp = op_readdp(dp); 4:sp |= op_readdp(dp + 1) << 8; 5:rd = op_readaddr(sp + regs.y); regs.a = op_$1(regs.a, rd); } adc_ix_iy(0x99, adc, 1), and_ix_iy(0x39, and, 1), cmp_ix_iy(0x79, cmp, 0), eor_ix_iy(0x59, eor, 1), or_ix_iy(0x19, or, 1), sbc_ix_iy(0xb9, sbc, 1) { 1:op_io(); 2:rd = op_readdp(regs.y); 3:wr = op_readdp(regs.x); wr = op_$1(wr, rd); 4:($2) ? op_writedp(regs.x, wr) : op_io(); } adc_dp_dp(0x89, adc, 1), and_dp_dp(0x29, and, 1), cmp_dp_dp(0x69, cmp, 0), eor_dp_dp(0x49, eor, 1), or_dp_dp(0x09, or, 1), sbc_dp_dp(0xa9, sbc, 1) { 1:sp = op_readpc(); 2:rd = op_readdp(sp); 3:dp = op_readpc(); 4:wr = op_readdp(dp); 5:wr = op_$1(wr, rd); ($2) ? op_writedp(dp, wr) : op_io(); } adc_dp_const(0x98, adc, 1), and_dp_const(0x38, and, 1), cmp_dp_const(0x78, cmp, 0), eor_dp_const(0x58, eor, 1), or_dp_const(0x18, or, 1), sbc_dp_const(0xb8, sbc, 1) { 1:rd = op_readpc(); 2:dp = op_readpc(); 3:wr = op_readdp(dp); 4:wr = op_$1(wr, rd); ($2) ? op_writedp(dp, wr) : op_io(); } addw_ya_dp(0x7a, addw), subw_ya_dp(0x9a, subw) { 1:dp = op_readpc(); 2:rd = op_readdp(dp); 3:op_io(); 4:rd |= op_readdp(dp + 1) << 8; regs.ya = op_$1(regs.ya, rd); } cmpw_ya_dp(0x5a) { 1:dp = op_readpc(); 2:rd = op_readdp(dp); 3:rd |= op_readdp(dp + 1) << 8; op_cmpw(regs.ya, rd); } and1_bit(0x4a, !!), and1_notbit(0x6a, !) { 1:dp = op_readpc(); 2:dp |= op_readpc() << 8; 3:bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); regs.p.c = regs.p.c & $1(rd & (1 << bit)); } eor1_bit(0x8a) { 1:dp = op_readpc(); 2:dp |= op_readpc() << 8; 3:bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); 4:op_io(); regs.p.c = regs.p.c ^ !!(rd & (1 << bit)); } not1_bit(0xea) { 1:dp = op_readpc(); 2:dp |= op_readpc() << 8; 3:bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); rd ^= (1 << bit); 4:op_writeaddr(dp, rd); } or1_bit(0x0a, !!), or1_notbit(0x2a, !) { 1:dp = op_readpc(); 2:dp |= op_readpc() << 8; 3:bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); 4:op_io(); regs.p.c = regs.p.c | $1(rd & (1 << bit)); } ruby/implementation.cpp000664 001750 001750 00000007366 12651764221 016436 0ustar00sergiosergio000000 000000 /* Global Headers */ #if defined(PLATFORM_X) #include #include #include #elif defined(PLATFORM_MACOSX) #define decimal CocoaDecimal #include #include #undef decimal #elif defined(PLATFORM_WINDOWS) #define _WIN32_WINNT 0x0501 #include #endif using namespace nall; /* Video */ #define DeclareVideo(Name) \ struct Video##Name : Video { \ bool cap(const string& name) { return p.cap(name); } \ any get(const string& name) { return p.get(name); } \ bool set(const string& name, const any& value) { return p.set(name, value); } \ \ bool lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) { return p.lock(data, pitch, width, height); } \ void unlock() { p.unlock(); } \ \ void clear() { p.clear(); } \ void refresh() { p.refresh(); } \ bool init() { return p.init(); } \ void term() { p.term(); } \ \ Video##Name() : p(*new pVideo##Name) {} \ ~Video##Name() { delete &p; } \ \ private: \ pVideo##Name& p; \ }; #ifdef VIDEO_CGL #include #endif #ifdef VIDEO_DIRECT3D #include #endif #ifdef VIDEO_DIRECTDRAW #include #endif #ifdef VIDEO_GDI #include #endif #ifdef VIDEO_GLX #include #endif #ifdef VIDEO_SDL #include #endif #ifdef VIDEO_WGL #include #endif #ifdef VIDEO_XSHM #include #endif #ifdef VIDEO_XV #include #endif /* Audio */ #define DeclareAudio(Name) \ struct Audio##Name : Audio { \ bool cap(const string& name) { return p.cap(name); } \ any get(const string& name) { return p.get(name); } \ bool set(const string& name, const any& value) { return p.set(name, value); } \ \ void sample(uint16_t left, uint16_t right) { p.sample(left, right); } \ void clear() { p.clear(); } \ bool init() { return p.init(); } \ void term() { p.term(); } \ \ Audio##Name() : p(*new pAudio##Name) {} \ ~Audio##Name() { delete &p; } \ \ private: \ pAudio##Name& p; \ }; #ifdef AUDIO_ALSA #include #endif #ifdef AUDIO_AO #include #endif #ifdef AUDIO_DIRECTSOUND #include #endif #ifdef AUDIO_OPENAL #include #endif #ifdef AUDIO_OSS #include #endif #ifdef AUDIO_PULSEAUDIO #include #endif #ifdef AUDIO_PULSEAUDIOSIMPLE #include #endif #ifdef AUDIO_XAUDIO2 #include #endif /* Input */ #define DeclareInput(Name) \ struct Input##Name : Input { \ bool cap(const string& name) { return p.cap(name); } \ any get(const string& name) { return p.get(name); } \ bool set(const string& name, const any& value) { return p.set(name, value); } \ \ bool acquire() { return p.acquire(); } \ bool unacquire() { return p.unacquire(); } \ bool acquired() { return p.acquired(); } \ \ vector poll() { return p.poll(); } \ bool rumble(uint64_t id, bool enable) { return p.rumble(id, enable); } \ bool init() { return p.init(); } \ void term() { p.term(); } \ \ Input##Name() : p(*new pInput##Name) {} \ ~Input##Name() { delete &p; } \ \ private: \ pInput##Name& p; \ }; #ifdef INPUT_CARBON #include #endif #ifdef INPUT_SDL #include #endif #ifdef INPUT_UDEV #include #endif #ifdef INPUT_WINDOWS #include #endif #ifdef INPUT_XLIB #include #endif gba/apu/apu.hpp000664 001750 001750 00000000433 12651764221 014524 0ustar00sergiosergio000000 000000 struct APU : Thread, MMIO { #include "registers.hpp" static void Enter(); void main(); void step(unsigned clocks); uint8 read(uint32 addr); void write(uint32 addr, uint8 byte); void power(); void runsequencer(); void serialize(serializer&); }; extern APU apu; shaders/Makefile000664 001750 001750 00000000400 12651764221 014773 0ustar00sergiosergio000000 000000 install: if [ -d /usr/share/higan/Video\ Shaders ]; then sudo rm -r /usr/share/higan/Video\ Shaders; fi sudo mkdir -p /usr/share/higan/Video\ Shaders sudo cp -r *.shader /usr/share/higan/Video\ Shaders sudo chmod -R 777 /usr/share/higan/Video\ Shaders fc/apu/apu.cpp000664 001750 001750 00000020072 12651764221 014357 0ustar00sergiosergio000000 000000 #include namespace Famicom { #include "envelope.cpp" #include "sweep.cpp" #include "pulse.cpp" #include "triangle.cpp" #include "noise.cpp" #include "dmc.cpp" #include "serialization.cpp" APU apu; const uint8 APU::length_counter_table[32] = { 0x0a, 0xfe, 0x14, 0x02, 0x28, 0x04, 0x50, 0x06, 0xa0, 0x08, 0x3c, 0x0a, 0x0e, 0x0c, 0x1a, 0x0e, 0x0c, 0x10, 0x18, 0x12, 0x30, 0x14, 0x60, 0x16, 0xc0, 0x18, 0x48, 0x1a, 0x10, 0x1c, 0x20, 0x1e, }; const uint16 APU::ntsc_noise_period_table[16] = { 4, 8, 16, 32, 64, 96, 128, 160, 202, 254, 380, 508, 762, 1016, 2034, 4068, }; const uint16 APU::pal_noise_period_table[16] = { 4, 7, 14, 30, 60, 88, 118, 148, 188, 236, 354, 472, 708, 944, 1890, 3778, }; const uint16 APU::ntsc_dmc_period_table[16] = { 428, 380, 340, 320, 286, 254, 226, 214, 190, 160, 142, 128, 106, 84, 72, 54, }; const uint16 APU::pal_dmc_period_table[16] = { 398, 354, 316, 298, 276, 236, 210, 198, 176, 148, 132, 118, 98, 78, 66, 50, }; void APU::Main() { apu.main(); } void APU::main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } unsigned pulse_output, triangle_output, noise_output, dmc_output; pulse_output = pulse[0].clock(); pulse_output += pulse[1].clock(); triangle_output = triangle.clock(); noise_output = noise.clock(); dmc_output = dmc.clock(); clock_frame_counter_divider(); signed output = pulse_dac[pulse_output] + dmc_triangle_noise_dac[dmc_output][triangle_output][noise_output]; output = filter.run_hipass_strong(output); output += cartridge_sample; output = filter.run_hipass_weak(output); //output = filter.run_lopass(output); output = sclamp<16>(output); interface->audioSample(output, output); tick(); } } void APU::tick() { clock += 12; if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cpu.thread); } void APU::set_irq_line() { cpu.set_irq_apu_line(frame.irq_pending || dmc.irq_pending); } void APU::set_sample(int16 sample) { cartridge_sample = sample; } void APU::power() { filter.hipass_strong = 0; filter.hipass_weak = 0; filter.lopass = 0; pulse[0].power(); pulse[1].power(); triangle.power(); noise.power(); dmc.power(); } void APU::reset() { create(APU::Main, 21477272); pulse[0].reset(); pulse[1].reset(); triangle.reset(); noise.reset(); dmc.reset(); frame.irq_pending = 0; frame.mode = 0; frame.counter = 0; frame.divider = 1; enabled_channels = 0; cartridge_sample = 0; set_irq_line(); } uint8 APU::read(uint16 addr) { if(addr == 0x4015) { uint8 result = 0x00; result |= pulse[0].length_counter ? 0x01 : 0; result |= pulse[1].length_counter ? 0x02 : 0; result |= triangle.length_counter ? 0x04 : 0; result |= noise.length_counter ? 0x08 : 0; result |= dmc.length_counter ? 0x10 : 0; result |= frame.irq_pending ? 0x40 : 0; result |= dmc.irq_pending ? 0x80 : 0; frame.irq_pending = false; set_irq_line(); return result; } return cpu.mdr(); } void APU::write(uint16 addr, uint8 data) { const unsigned n = (addr >> 2) & 1; //pulse# switch(addr) { case 0x4000: case 0x4004: pulse[n].duty = data >> 6; pulse[n].envelope.loop_mode = data & 0x20; pulse[n].envelope.use_speed_as_volume = data & 0x10; pulse[n].envelope.speed = data & 0x0f; break; case 0x4001: case 0x4005: pulse[n].sweep.enable = data & 0x80; pulse[n].sweep.period = (data & 0x70) >> 4; pulse[n].sweep.decrement = data & 0x08; pulse[n].sweep.shift = data & 0x07; pulse[n].sweep.reload = true; break; case 0x4002: case 0x4006: pulse[n].period = (pulse[n].period & 0x0700) | (data << 0); pulse[n].sweep.pulse_period = (pulse[n].sweep.pulse_period & 0x0700) | (data << 0); break; case 0x4003: case 0x4007: pulse[n].period = (pulse[n].period & 0x00ff) | (data << 8); pulse[n].sweep.pulse_period = (pulse[n].sweep.pulse_period & 0x00ff) | (data << 8); pulse[n].duty_counter = 7; pulse[n].envelope.reload_decay = true; if(enabled_channels & (1 << n)) { pulse[n].length_counter = length_counter_table[(data >> 3) & 0x1f]; } break; case 0x4008: triangle.halt_length_counter = data & 0x80; triangle.linear_length = data & 0x7f; break; case 0x400a: triangle.period = (triangle.period & 0x0700) | (data << 0); break; case 0x400b: triangle.period = (triangle.period & 0x00ff) | (data << 8); triangle.reload_linear = true; if(enabled_channels & (1 << 2)) { triangle.length_counter = length_counter_table[(data >> 3) & 0x1f]; } break; case 0x400c: noise.envelope.loop_mode = data & 0x20; noise.envelope.use_speed_as_volume = data & 0x10; noise.envelope.speed = data & 0x0f; break; case 0x400e: noise.short_mode = data & 0x80; noise.period = data & 0x0f; break; case 0x400f: noise.envelope.reload_decay = true; if(enabled_channels & (1 << 3)) { noise.length_counter = length_counter_table[(data >> 3) & 0x1f]; } break; case 0x4010: dmc.irq_enable = data & 0x80; dmc.loop_mode = data & 0x40; dmc.period = data & 0x0f; dmc.irq_pending = dmc.irq_pending && dmc.irq_enable && !dmc.loop_mode; set_irq_line(); break; case 0x4011: dmc.dac_latch = data & 0x7f; break; case 0x4012: dmc.addr_latch = data; break; case 0x4013: dmc.length_latch = data; break; case 0x4015: if((data & 0x01) == 0) pulse[0].length_counter = 0; if((data & 0x02) == 0) pulse[1].length_counter = 0; if((data & 0x04) == 0) triangle.length_counter = 0; if((data & 0x08) == 0) noise.length_counter = 0; (data & 0x10) ? dmc.start() : dmc.stop(); dmc.irq_pending = false; set_irq_line(); enabled_channels = data & 0x1f; break; case 0x4017: frame.mode = data >> 6; frame.counter = 0; if(frame.mode & 2) clock_frame_counter(); if(frame.mode & 1) { frame.irq_pending = false; set_irq_line(); } frame.divider = FrameCounter::NtscPeriod; break; } } signed APU::Filter::run_hipass_strong(signed sample) { hipass_strong += ((((int64)sample << 16) - (hipass_strong >> 16)) * HiPassStrong) >> 16; return sample - (hipass_strong >> 32); } signed APU::Filter::run_hipass_weak(signed sample) { hipass_weak += ((((int64)sample << 16) - (hipass_weak >> 16)) * HiPassWeak) >> 16; return sample - (hipass_weak >> 32); } signed APU::Filter::run_lopass(signed sample) { lopass += ((((int64)sample << 16) - (lopass >> 16)) * LoPass) >> 16; return (lopass >> 32); } void APU::clock_frame_counter() { frame.counter++; if(frame.counter & 1) { pulse[0].clock_length(); pulse[0].sweep.clock(0); pulse[1].clock_length(); pulse[1].sweep.clock(1); triangle.clock_length(); noise.clock_length(); } pulse[0].envelope.clock(); pulse[1].envelope.clock(); triangle.clock_linear_length(); noise.envelope.clock(); if(frame.counter == 0) { if(frame.mode & 2) frame.divider += FrameCounter::NtscPeriod; if(frame.mode == 0) { frame.irq_pending = true; set_irq_line(); } } } void APU::clock_frame_counter_divider() { frame.divider -= 2; if(frame.divider <= 0) { clock_frame_counter(); frame.divider += FrameCounter::NtscPeriod; } } APU::APU() { for(unsigned amp = 0; amp < 32; amp++) { if(amp == 0) { pulse_dac[amp] = 0; } else { pulse_dac[amp] = 16384.0 * 95.88 / (8128.0 / amp + 100.0); } } for(unsigned dmc_amp = 0; dmc_amp < 128; dmc_amp++) { for(unsigned triangle_amp = 0; triangle_amp < 16; triangle_amp++) { for(unsigned noise_amp = 0; noise_amp < 16; noise_amp++) { if(dmc_amp == 0 && triangle_amp == 0 && noise_amp == 0) { dmc_triangle_noise_dac[dmc_amp][triangle_amp][noise_amp] = 0; } else { dmc_triangle_noise_dac[dmc_amp][triangle_amp][noise_amp] = 16384.0 * 159.79 / (100.0 + 1.0 / (triangle_amp / 8227.0 + noise_amp / 12241.0 + dmc_amp / 22638.0)); } } } } } } emulator/interface.hpp000664 001750 001750 00000010305 12651764221 016210 0ustar00sergiosergio000000 000000 #ifndef EMULATOR_INTERFACE_HPP #define EMULATOR_INTERFACE_HPP namespace Emulator { struct Interface { struct Information { string name; unsigned width; unsigned height; bool overscan; double aspectRatio; bool resettable; struct Capability { bool states; bool cheats; } capability; } information; struct Media { unsigned id; string name; string type; bool bootable; //false for cartridge slots (eg Sufami Turbo cartridges) }; vector media; struct Device { unsigned id; unsigned portmask; string name; struct Input { unsigned id; unsigned type; //0 = digital, 1 = analog (relative), 2 = rumble string name; unsigned guid; }; vector input; vector order; }; struct Port { unsigned id; string name; vector device; }; vector port; struct Bind { virtual void loadRequest(unsigned, string, string) {} virtual void loadRequest(unsigned, string) {} virtual void saveRequest(unsigned, string) {} virtual uint32_t videoColor(unsigned, uint16_t, uint16_t, uint16_t, uint16_t) { return 0u; } virtual void videoRefresh(const uint32_t*, const uint32_t*, unsigned, unsigned, unsigned) {} virtual void audioSample(int16_t, int16_t) {} virtual int16_t inputPoll(unsigned, unsigned, unsigned) { return 0; } virtual void inputRumble(unsigned, unsigned, unsigned, bool) {} virtual unsigned dipSettings(const Markup::Node&) { return 0; } virtual string path(unsigned) { return ""; } virtual string server() { return ""; } virtual void notify(string text) { print(text, "\n"); } virtual unsigned altImplementation(unsigned) { return 0; } }; Bind* bind = nullptr; //callback bindings (provided by user interface) void loadRequest(unsigned id, string name, string type) { return bind->loadRequest(id, name, type); } void loadRequest(unsigned id, string path) { return bind->loadRequest(id, path); } void saveRequest(unsigned id, string path) { return bind->saveRequest(id, path); } uint32_t videoColor(unsigned source, uint16_t alpha, uint16_t red, uint16_t green, uint16_t blue) { return bind->videoColor(source, alpha, red, green, blue); } void videoRefresh(const uint32_t* palette, const uint32_t* data, unsigned pitch, unsigned width, unsigned height) { return bind->videoRefresh(palette, data, pitch, width, height); } void audioSample(int16_t lsample, int16_t rsample) { return bind->audioSample(lsample, rsample); } int16_t inputPoll(unsigned port, unsigned device, unsigned input) { return bind->inputPoll(port, device, input); } void inputRumble(unsigned port, unsigned device, unsigned input, bool enable) { return bind->inputRumble(port, device, input, enable); } unsigned dipSettings(const Markup::Node& node) { return bind->dipSettings(node); } string path(unsigned group) { return bind->path(group); } string server() { return bind->server(); } template void notify(Args&&... args) { return bind->notify({std::forward(args)...}); } //information virtual string title() = 0; virtual double videoFrequency() = 0; virtual double audioFrequency() = 0; //media interface virtual bool loaded() { return false; } virtual string sha256() { return ""; } virtual unsigned group(unsigned id) = 0; virtual void load(unsigned id) {} virtual void save() {} virtual void load(unsigned id, const stream& memory) {} virtual void save(unsigned id, const stream& memory) {} virtual void unload() {} //system interface virtual void connect(unsigned port, unsigned device) {} virtual void power() {} virtual void reset() {} virtual void run() {} //time functions virtual bool rtc() { return false; } virtual void rtcsync() {} //state functions virtual serializer serialize() = 0; virtual bool unserialize(serializer&) = 0; //cheat functions virtual void cheatSet(const lstring& = lstring{}) {} //utility functions enum class PaletteMode : unsigned { Literal, Channel, Standard, Emulation }; virtual void paletteUpdate(PaletteMode mode) {} //debugger functions virtual bool tracerEnable(bool) { return false; } virtual void exportMemory() {} }; } #endif phoenix/cocoa/browser-window.cpp000664 001750 001750 00000004413 12651764221 020144 0ustar00sergiosergio000000 000000 namespace phoenix { string pBrowserWindow::directory(BrowserWindow::State& state) { string result; @autoreleasepool { NSOpenPanel* panel = [NSOpenPanel openPanel]; if(state.title) [panel setTitle:[NSString stringWithUTF8String:state.title]]; [panel setCanChooseDirectories:YES]; [panel setCanChooseFiles:NO]; if([panel runModalForDirectory:[NSString stringWithUTF8String:state.path] file:nil] == NSOKButton) { NSArray* names = [panel filenames]; const char* name = [[names objectAtIndex:0] UTF8String]; if(name) result = name; } } return result; } string pBrowserWindow::open(BrowserWindow::State& state) { string result; @autoreleasepool { NSMutableArray* filters = [[NSMutableArray alloc] init]; for(auto& rule : state.filters) { string pattern = rule.split<1>("(")(1).rtrim<1>(")"); if(!pattern.empty()) [filters addObject:[NSString stringWithUTF8String:pattern]]; } NSOpenPanel* panel = [NSOpenPanel openPanel]; if(state.title) [panel setTitle:[NSString stringWithUTF8String:state.title]]; [panel setCanChooseDirectories:NO]; [panel setCanChooseFiles:YES]; [panel setAllowedFileTypes:filters]; if([panel runModalForDirectory:[NSString stringWithUTF8String:state.path] file:nil] == NSOKButton) { NSArray* names = [panel filenames]; const char* name = [[names objectAtIndex:0] UTF8String]; if(name) result = name; } [filters release]; } return result; } string pBrowserWindow::save(BrowserWindow::State& state) { string result; @autoreleasepool { NSMutableArray* filters = [[NSMutableArray alloc] init]; for(auto& rule : state.filters) { string pattern = rule.split<1>("(")(1).rtrim<1>(")"); if(!pattern.empty()) [filters addObject:[NSString stringWithUTF8String:pattern]]; } NSSavePanel* panel = [NSSavePanel savePanel]; if(state.title) [panel setTitle:[NSString stringWithUTF8String:state.title]]; [panel setAllowedFileTypes:filters]; if([panel runModalForDirectory:[NSString stringWithUTF8String:state.path] file:nil] == NSOKButton) { NSArray* names = [panel filenames]; const char* name = [[names objectAtIndex:0] UTF8String]; if(name) result = name; } [filters release]; } return result; } } phoenix/cocoa/font.cpp000664 001750 001750 00000003547 12651764221 016131 0ustar00sergiosergio000000 000000 namespace phoenix { string pFont::serif(unsigned size, string style) { if(size == 0) size = 8; if(style == "") style = "Normal"; return {"Georgia, ", size, ", ", style}; } string pFont::sans(unsigned size, string style) { if(size == 0) size = 8; if(style == "") style = "Normal"; return {"Lucida Grande, ", size, ", ", style}; } string pFont::monospace(unsigned size, string style) { if(size == 0) size = 8; if(style == "") style = "Normal"; return {"Menlo, ", size, ", ", style}; } Size pFont::size(string font, string text) { @autoreleasepool { if(NSFont* nsFont = cocoaFont(font)) { return size(nsFont, text); } } return {0, 0}; } NSFont* pFont::cocoaFont(string description) { lstring part = description.split<2>(",").strip(); NSString* family = @"Lucida Grande"; NSFontTraitMask traits = 0; CGFloat size = 8.0; if(!part(0).empty()) family = [NSString stringWithUTF8String:part(0)]; if(!part(1).empty()) size = decimal(part(1)); if(part(2).ifind("bold")) traits |= NSBoldFontMask; if(part(2).ifind("italic")) traits |= NSItalicFontMask; if(part(2).ifind("narrow")) traits |= NSNarrowFontMask; if(part(2).ifind("expanded")) traits |= NSExpandedFontMask; if(part(2).ifind("condensed")) traits |= NSCondensedFontMask; if(part(2).ifind("smallcaps")) traits |= NSSmallCapsFontMask; size *= 1.5; //scale to point sizes (for consistency with other operating systems) return [[NSFontManager sharedFontManager] fontWithFamily:family traits:traits weight:5 size:size]; } Size pFont::size(NSFont* font, string text) { @autoreleasepool { NSString* cocoaText = [NSString stringWithUTF8String:text]; NSDictionary* fontAttributes = [NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName, nil]; NSSize size = [cocoaText sizeWithAttributes:fontAttributes]; return {size.width, size.height}; } } } nall/string/eval/evaluator.hpp000664 001750 001750 00000014061 12651764221 017610 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { namespace Eval { inline string evaluateExpression(Node* node) { #define p(n) evaluateExpression(node->link[n]) switch(node->type) { case Node::Type::Null: return "Null"; case Node::Type::Literal: return {"Literal:", node->literal}; case Node::Type::Function: return {"Function(0:", p(0), ", 1:", p(1), ")"}; case Node::Type::Subscript: return {"Subscript(0:", p(0), ", 1:", p(1), ")"}; case Node::Type::Member: return {"Member(0:", p(0), ", 1:", p(1), ")"}; case Node::Type::SuffixIncrement: return {"SuffixIncrement(0:", p(0), ")"}; case Node::Type::SuffixDecrement: return {"SuffixDecrement(0:", p(0), ")"}; case Node::Type::Reference: return {"Reference(0:", p(0), ")"}; case Node::Type::Dereference: return {"Dereference(0:", p(0), ")"}; case Node::Type::BitwiseNot: return {"Complement(0:", p(0), ")"}; case Node::Type::PrefixIncrement: return {"PrefixIncrement(0:", p(0), ")"}; case Node::Type::PrefixDecrement: return {"PrefixDecrement(0:", p(0), ")"}; case Node::Type::Add: return {"Add(0:", p(0), ", 1:", p(1), ")"}; case Node::Type::Multiply: return {"Multiply(0:", p(0), ", 1:", p(1), ")"}; case Node::Type::Concatenate: return {"Concatenate(0:", p(0), ", ", p(1), ")"}; case Node::Type::Coalesce: return {"Coalesce(0:", p(0), ", ", p(1), ")"}; case Node::Type::Condition: return {"Condition(0:", p(0), ", ", p(1), ", ", p(2), ")"}; case Node::Type::Assign: return {"Assign(0:", p(0), ", ", p(1), ")"}; case Node::Type::Separator: { string result = "Separator("; for(auto& link : node->link) { result.append(evaluateExpression(link), ", "); } return result.rtrim<1>(", ").append(")"); } default: throw "invalid operator"; } #undef p } inline int64_t evaluateInteger(Node* node) { if(node->type == Node::Type::Literal) { if(node->literal.beginsWith("0b")) return nall::binary(node->literal); if(node->literal.beginsWith("0o")) return nall::octal(node->literal); if(node->literal.beginsWith("0x")) return nall::hex(node->literal); if(node->literal.beginsWith("%")) return nall::binary(node->literal); if(node->literal.beginsWith("$")) return nall::hex(node->literal); return nall::integer(node->literal); } #define p(n) evaluateInteger(node->link[n]) switch(node->type) { case Node::Type::SuffixIncrement: return p(0); case Node::Type::SuffixDecrement: return p(0); case Node::Type::LogicalNot: return !p(0); case Node::Type::BitwiseNot: return ~p(0); case Node::Type::Positive: return +p(0); case Node::Type::Negative: return -p(0); case Node::Type::PrefixIncrement: return p(0) + 1; case Node::Type::PrefixDecrement: return p(0) - 1; case Node::Type::Multiply: return p(0) * p(1); case Node::Type::Divide: return p(0) / p(1); case Node::Type::Modulo: return p(0) % p(1); case Node::Type::Add: return p(0) + p(1); case Node::Type::Subtract: return p(0) - p(1); case Node::Type::ShiftLeft: return p(0) << p(1); case Node::Type::ShiftRight: return p(0) >> p(1); case Node::Type::BitwiseAnd: return p(0) & p(1); case Node::Type::BitwiseOr: return p(0) | p(1); case Node::Type::BitwiseXor: return p(0) ^ p(1); case Node::Type::Equal: return p(0) == p(1); case Node::Type::NotEqual: return p(0) != p(1); case Node::Type::LessThanEqual: return p(0) <= p(1); case Node::Type::GreaterThanEqual: return p(0) >= p(1); case Node::Type::LessThan: return p(0) < p(1); case Node::Type::GreaterThan: return p(0) > p(1); case Node::Type::LogicalAnd: return p(0) && p(1); case Node::Type::LogicalOr: return p(0) || p(1); case Node::Type::Condition: return p(0) ? p(1) : p(2); case Node::Type::Assign: return p(1); case Node::Type::AssignMultiply: return p(0) * p(1); case Node::Type::AssignDivide: return p(0) / p(1); case Node::Type::AssignModulo: return p(0) % p(1); case Node::Type::AssignAdd: return p(0) + p(1); case Node::Type::AssignSubtract: return p(0) - p(1); case Node::Type::AssignShiftLeft: return p(0) << p(1); case Node::Type::AssignShiftRight: return p(0) >> p(1); case Node::Type::AssignBitwiseAnd: return p(0) & p(1); case Node::Type::AssignBitwiseOr: return p(0) | p(1); case Node::Type::AssignBitwiseXor: return p(0) ^ p(1); default: throw "invalid operator"; } #undef p } inline optional integer(const string& expression) { try { auto tree = new Node; const char* p = expression; parse(tree, p, 0); auto result = evaluateInteger(tree); delete tree; return {true, result}; } catch(const char*) { return false; } } inline long double evaluateReal(Node* node) { if(node->type == Node::Type::Literal) return nall::real(node->literal); #define p(n) evaluateReal(node->link[n]) switch(node->type) { case Node::Type::LogicalNot: return !p(0); case Node::Type::Positive: return +p(0); case Node::Type::Negative: return -p(0); case Node::Type::Multiply: return p(0) * p(1); case Node::Type::Divide: return p(0) / p(1); case Node::Type::Add: return p(0) + p(1); case Node::Type::Subtract: return p(0) - p(1); case Node::Type::Equal: return p(0) == p(1); case Node::Type::NotEqual: return p(0) != p(1); case Node::Type::LessThanEqual: return p(0) <= p(1); case Node::Type::GreaterThanEqual: return p(0) >= p(1); case Node::Type::LessThan: return p(0) < p(1); case Node::Type::GreaterThan: return p(0) > p(1); case Node::Type::LogicalAnd: return p(0) && p(1); case Node::Type::LogicalOr: return p(0) || p(1); case Node::Type::Condition: return p(0) ? p(1) : p(2); case Node::Type::Assign: return p(1); case Node::Type::AssignMultiply: return p(0) * p(1); case Node::Type::AssignDivide: return p(0) / p(1); case Node::Type::AssignAdd: return p(0) + p(1); case Node::Type::AssignSubtract: return p(0) - p(1); default: throw "invalid operator"; } #undef p } inline optional real(const string& expression) { try { auto tree = new Node; const char* p = expression; parse(tree, p, 0); auto result = evaluateReal(tree); delete tree; return {true, result}; } catch(const char*) { return false; } } } } #endif phoenix/qt/mouse.cpp000664 001750 001750 00000000706 12651764221 015645 0ustar00sergiosergio000000 000000 namespace phoenix { Position pMouse::position() { QPoint point = QCursor::pos(); return {point.x(), point.y()}; } bool pMouse::pressed(Mouse::Button button) { Qt::MouseButtons buttons = QApplication::mouseButtons(); switch(button) { case Mouse::Button::Left: return buttons & Qt::LeftButton; case Mouse::Button::Middle: return buttons & Qt::MidButton; case Mouse::Button::Right: return buttons & Qt::RightButton; } return false; } } processor/r6502/r6502.hpp000664 001750 001750 00000006043 12651764221 015777 0ustar00sergiosergio000000 000000 #ifndef PROCESSOR_R6502_HPP #define PROCESSOR_R6502_HPP namespace Processor { //Ricoh 6502 //* Ricoh 2A03 //* Ricoh 2A07 struct R6502 { #include "registers.hpp" virtual uint8 op_read(uint16 addr) = 0; virtual void op_write(uint16 addr, uint8 data) = 0; virtual void last_cycle() = 0; virtual void nmi(uint16& vector) = 0; virtual uint8 debugger_read(uint16 addr) { return 0u; } uint8 mdr() const; void power(); void reset(); void interrupt(); void exec(); void serialize(serializer&); //memory.cpp uint8 op_readpc(); uint8 op_readpci(); uint8 op_readsp(); uint8 op_readzp(uint8 addr); void op_writesp(uint8 data); void op_writezp(uint8 addr, uint8 data); void op_page(uint16 x, uint16 y); void op_page_always(uint16 x, uint16 y); //instructions.cpp void opf_asl(); void opf_adc(); void opf_and(); void opf_bit(); void opf_cmp(); void opf_cpx(); void opf_cpy(); void opf_dec(); void opf_eor(); void opf_inc(); void opf_lda(); void opf_ldx(); void opf_ldy(); void opf_lsr(); void opf_ora(); void opf_rla(); void opf_rol(); void opf_ror(); void opf_rra(); void opf_sbc(); void opf_sla(); void opf_sra(); void opi_branch(bool condition); void opi_clear_flag(bool& flag); void opi_decrement(uint8& r); void opi_increment(uint8& r); void opi_pull(uint8& r); void opi_push(uint8& r); template void opi_read_absolute(); template void opi_read_absolute_x(); template void opi_read_absolute_y(); template void opi_read_immediate(); template void opi_read_indirect_zero_page_x(); template void opi_read_indirect_zero_page_y(); template void opi_read_zero_page(); template void opi_read_zero_page_x(); template void opi_read_zero_page_y(); template void opi_rmw_absolute(); template void opi_rmw_absolute_x(); template void opi_rmw_zero_page(); template void opi_rmw_zero_page_x(); void opi_set_flag(bool& flag); template void opi_shift(); void opi_store_absolute(uint8& r); void opi_store_absolute_x(uint8& r); void opi_store_absolute_y(uint8& r); void opi_store_indirect_zero_page_x(uint8& r); void opi_store_indirect_zero_page_y(uint8& r); void opi_store_zero_page(uint8& r); void opi_store_zero_page_x(uint8& r); void opi_store_zero_page_y(uint8& r); void opi_transfer(uint8& s, uint8& d, bool flag); void op_brk(); void op_jmp_absolute(); void op_jmp_indirect_absolute(); void op_jsr_absolute(); void op_nop(); void op_php(); void op_plp(); void op_rti(); void op_rts(); void opill_arr_immediate(); void opill_nop_absolute(); void opill_nop_absolute_x(); void opill_nop_immediate(); void opill_nop_implied(); void opill_nop_zero_page(); void opill_nop_zero_page_x(); //disassembler.cpp string disassemble(); }; } #endif nall/compositor.hpp000664 001750 001750 00000007072 12651764221 015553 0ustar00sergiosergio000000 000000 #ifndef NALL_COMPOSITOR_HPP #define NALL_COMPOSITOR_HPP #include namespace nall { struct compositor { inline static bool enabled(); inline static bool enable(bool status); #if defined(PLATFORM_X) enum class Compositor : unsigned { Unknown, Metacity, Xfwm4 }; inline static Compositor detect(); inline static bool enabled_metacity(); inline static bool enable_metacity(bool status); inline static bool enabled_xfwm4(); inline static bool enable_xfwm4(bool status); #endif }; #if defined(PLATFORM_X) //Metacity bool compositor::enabled_metacity() { FILE* fp = popen("gconftool-2 --get /apps/metacity/general/compositing_manager", "r"); if(!fp) return false; char buffer[512]; if(!fgets(buffer, sizeof buffer, fp)) return false; if(!memcmp(buffer, "true", 4)) return true; return false; } bool compositor::enable_metacity(bool status) { FILE* fp; if(status) { fp = popen("gconftool-2 --set --type bool /apps/metacity/general/compositing_manager true", "r"); } else { fp = popen("gconftool-2 --set --type bool /apps/metacity/general/compositing_manager false", "r"); } if(!fp) return false; pclose(fp); return true; } //Xfwm4 bool compositor::enabled_xfwm4() { FILE* fp = popen("xfconf-query -c xfwm4 -p '/general/use_compositing'", "r"); if(!fp) return false; char buffer[512]; if(!fgets(buffer, sizeof buffer, fp)) return false; if(!memcmp(buffer, "true", 4)) return true; return false; } bool compositor::enable_xfwm4(bool status) { FILE* fp; if(status) { fp = popen("xfconf-query -c xfwm4 -p '/general/use_compositing' -t 'bool' -s 'true'", "r"); } else { fp = popen("xfconf-query -c xfwm4 -p '/general/use_compositing' -t 'bool' -s 'false'", "r"); } if(!fp) return false; pclose(fp); return true; } //General compositor::Compositor compositor::detect() { Compositor result = Compositor::Unknown; FILE* fp; char buffer[512]; fp = popen("pidof metacity", "r"); if(fp && fgets(buffer, sizeof buffer, fp)) result = Compositor::Metacity; pclose(fp); fp = popen("pidof xfwm4", "r"); if(fp && fgets(buffer, sizeof buffer, fp)) result = Compositor::Xfwm4; pclose(fp); return result; } bool compositor::enabled() { switch(detect()) { case Compositor::Metacity: return enabled_metacity(); case Compositor::Xfwm4: return enabled_xfwm4(); default: return false; } } bool compositor::enable(bool status) { switch(detect()) { case Compositor::Metacity: return enable_metacity(status); case Compositor::Xfwm4: return enable_xfwm4(status); default: return false; } } #elif defined(PLATFORM_WINDOWS) bool compositor::enabled() { HMODULE module = GetModuleHandleW(L"dwmapi"); if(module == nullptr) module = LoadLibraryW(L"dwmapi"); if(module == nullptr) return false; auto pDwmIsCompositionEnabled = (HRESULT (WINAPI*)(BOOL*))GetProcAddress(module, "DwmIsCompositionEnabled"); if(pDwmIsCompositionEnabled == nullptr) return false; BOOL result; if(pDwmIsCompositionEnabled(&result) != S_OK) return false; return result; } bool compositor::enable(bool status) { HMODULE module = GetModuleHandleW(L"dwmapi"); if(module == nullptr) module = LoadLibraryW(L"dwmapi"); if(module == nullptr) return false; auto pDwmEnableComposition = (HRESULT (WINAPI*)(UINT))GetProcAddress(module, "DwmEnableComposition"); if(pDwmEnableComposition == nullptr) return false; if(pDwmEnableComposition(status) != S_OK) return false; return true; } #else bool compositor::enabled() { return false; } bool compositor::enable(bool) { return false; } #endif } #endif sfc/alt/ppu-balanced/render/addsub.cpp000664 001750 001750 00000001273 12651764221 021026 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP //color addition / subtraction //thanks go to blargg for the optimized algorithms inline uint16 PPU::addsub(uint32 x, uint32 y, bool halve) { if(!regs.color_mode) { if(!halve) { unsigned sum = x + y; unsigned carry = (sum - ((x ^ y) & 0x0421)) & 0x8420; return (sum - carry) | (carry - (carry >> 5)); } else { return (x + y - ((x ^ y) & 0x0421)) >> 1; } } else { unsigned diff = x - y + 0x8420; unsigned borrow = (diff - ((x ^ y) & 0x8420)) & 0x8420; if(!halve) { return (diff - borrow) & (borrow - (borrow >> 5)); } else { return (((diff - borrow) & (borrow - (borrow >> 5))) & 0x7bde) >> 1; } } } #endif processor/r65816/table.cpp000664 001750 001750 00000026154 12651764221 016405 0ustar00sergiosergio000000 000000 void R65816::initialize_opcode_table() { #define opA( id, name ) op_table[table_EM + id] = op_table[table_MX + id] = op_table[table_Mx + id] = op_table[table_mX + id] = op_table[table_mx + id] = &R65816::op_##name; #define opAII(id, name, x, y ) op_table[table_EM + id] = op_table[table_MX + id] = op_table[table_Mx + id] = op_table[table_mX + id] = op_table[table_mx + id] = &R65816::op_##name; #define opE( id, name ) op_table[table_EM + id] = &R65816::op_##name##_e; op_table[table_MX + id] = op_table[table_Mx + id] = op_table[table_mX + id] = op_table[table_mx + id] = &R65816::op_##name##_n; #define opEI( id, name, x ) op_table[table_EM + id] = &R65816::op_##name##_e; op_table[table_MX + id] = op_table[table_Mx + id] = op_table[table_mX + id] = op_table[table_mx + id] = &R65816::op_##name##_n; #define opEII(id, name, x, y ) op_table[table_EM + id] = &R65816::op_##name##_e; op_table[table_MX + id] = op_table[table_Mx + id] = op_table[table_mX + id] = op_table[table_mx + id] = &R65816::op_##name##_n; #define opM( id, name ) op_table[table_EM + id] = op_table[table_MX + id] = op_table[table_Mx + id] = &R65816::op_##name##_b; op_table[table_mX + id] = op_table[table_mx + id] = &R65816::op_##name##_w; #define opMI( id, name, x ) op_table[table_EM + id] = op_table[table_MX + id] = op_table[table_Mx + id] = &R65816::op_##name##_b; op_table[table_mX + id] = op_table[table_mx + id] = &R65816::op_##name##_w; #define opMII(id, name, x, y ) op_table[table_EM + id] = op_table[table_MX + id] = op_table[table_Mx + id] = &R65816::op_##name##_b; op_table[table_mX + id] = op_table[table_mx + id] = &R65816::op_##name##_w; #define opMF( id, name, fn ) op_table[table_EM + id] = op_table[table_MX + id] = op_table[table_Mx + id] = &R65816::op_##name##_b<&R65816::op_##fn##_b>; op_table[table_mX + id] = op_table[table_mx + id] = &R65816::op_##name##_w<&R65816::op_##fn##_w>; #define opMFI(id, name, fn, x) op_table[table_EM + id] = op_table[table_MX + id] = op_table[table_Mx + id] = &R65816::op_##name##_b<&R65816::op_##fn##_b, x>; op_table[table_mX + id] = op_table[table_mx + id] = &R65816::op_##name##_w<&R65816::op_##fn##_w, x>; #define opX( id, name ) op_table[table_EM + id] = op_table[table_MX + id] = op_table[table_mX + id] = &R65816::op_##name##_b; op_table[table_Mx + id] = op_table[table_mx + id] = &R65816::op_##name##_w; #define opXI( id, name, x ) op_table[table_EM + id] = op_table[table_MX + id] = op_table[table_mX + id] = &R65816::op_##name##_b; op_table[table_Mx + id] = op_table[table_mx + id] = &R65816::op_##name##_w; #define opXII(id, name, x, y ) op_table[table_EM + id] = op_table[table_MX + id] = op_table[table_mX + id] = &R65816::op_##name##_b; op_table[table_Mx + id] = op_table[table_mx + id] = &R65816::op_##name##_w; #define opXF( id, name, fn ) op_table[table_EM + id] = op_table[table_MX + id] = op_table[table_mX + id] = &R65816::op_##name##_b<&R65816::op_##fn##_b>; op_table[table_Mx + id] = op_table[table_mx + id] = &R65816::op_##name##_w<&R65816::op_##fn##_w>; #define opXFI(id, name, fn, x) op_table[table_EM + id] = op_table[table_MX + id] = op_table[table_mX + id] = &R65816::op_##name##_b<&R65816::op_##fn##_b, x>; op_table[table_Mx + id] = op_table[table_mx + id] = &R65816::op_##name##_w<&R65816::op_##fn##_w, x>; opEII(0x00, interrupt, 0xfffe, 0xffe6) opMF (0x01, read_idpx, ora) opEII(0x02, interrupt, 0xfff4, 0xffe4) opMF (0x03, read_sr, ora) opMF (0x04, adjust_dp, tsb) opMF (0x05, read_dp, ora) opMF (0x06, adjust_dp, asl) opMF (0x07, read_ildp, ora) opA (0x08, php) opMF (0x09, read_const, ora) opM (0x0a, asl_imm) opE (0x0b, phd) opMF (0x0c, adjust_addr, tsb) opMF (0x0d, read_addr, ora) opMF (0x0e, adjust_addr, asl) opMF (0x0f, read_long, ora) opAII(0x10, branch, 0x80, false) opMF (0x11, read_idpy, ora) opMF (0x12, read_idp, ora) opMF (0x13, read_isry, ora) opMF (0x14, adjust_dp, trb) opMFI(0x15, read_dpr, ora, X) opMF (0x16, adjust_dpx, asl) opMF (0x17, read_ildpy, ora) opAII(0x18, flag, 0x01, 0x00) opMF (0x19, read_addry, ora) opMII(0x1a, adjust_imm, A, +1) opE (0x1b, tcs) opMF (0x1c, adjust_addr, trb) opMF (0x1d, read_addrx, ora) opMF (0x1e, adjust_addrx, asl) opMF (0x1f, read_longx, ora) opA (0x20, jsr_addr) opMF (0x21, read_idpx, and) opE (0x22, jsr_long) opMF (0x23, read_sr, and) opMF (0x24, read_dp, bit) opMF (0x25, read_dp, and) opMF (0x26, adjust_dp, rol) opMF (0x27, read_ildp, and) opE (0x28, plp) opMF (0x29, read_const, and) opM (0x2a, rol_imm) opE (0x2b, pld) opMF (0x2c, read_addr, bit) opMF (0x2d, read_addr, and) opMF (0x2e, adjust_addr, rol) opMF (0x2f, read_long, and) opAII(0x30, branch, 0x80, true) opMF (0x31, read_idpy, and) opMF (0x32, read_idp, and) opMF (0x33, read_isry, and) opMFI(0x34, read_dpr, bit, X) opMFI(0x35, read_dpr, and, X) opMF (0x36, adjust_dpx, rol) opMF (0x37, read_ildpy, and) opAII(0x38, flag, 0x01, 0x01) opMF (0x39, read_addry, and) opMII(0x3a, adjust_imm, A, -1) opAII(0x3b, transfer_w, S, A) opMF (0x3c, read_addrx, bit) opMF (0x3d, read_addrx, and) opMF (0x3e, adjust_addrx, rol) opMF (0x3f, read_longx, and) opE (0x40, rti) opMF (0x41, read_idpx, eor) opA (0x42, wdm) opMF (0x43, read_sr, eor) opXI (0x44, move, -1) opMF (0x45, read_dp, eor) opMF (0x46, adjust_dp, lsr) opMF (0x47, read_ildp, eor) opMI (0x48, push, A) opMF (0x49, read_const, eor) opM (0x4a, lsr_imm) opA (0x4b, phk) opA (0x4c, jmp_addr) opMF (0x4d, read_addr, eor) opMF (0x4e, adjust_addr, lsr) opMF (0x4f, read_long, eor) opAII(0x50, branch, 0x40, false) opMF (0x51, read_idpy, eor) opMF (0x52, read_idp, eor) opMF (0x53, read_isry, eor) opXI (0x54, move, +1) opMFI(0x55, read_dpr, eor, X) opMF (0x56, adjust_dpx, lsr) opMF (0x57, read_ildpy, eor) opAII(0x58, flag, 0x04, 0x00) opMF (0x59, read_addry, eor) opXI (0x5a, push, Y) opAII(0x5b, transfer_w, A, D) opA (0x5c, jmp_long) opMF (0x5d, read_addrx, eor) opMF (0x5e, adjust_addrx, lsr) opMF (0x5f, read_longx, eor) opA (0x60, rts) opMF (0x61, read_idpx, adc) opE (0x62, per) opMF (0x63, read_sr, adc) opMI (0x64, write_dp, Z) opMF (0x65, read_dp, adc) opMF (0x66, adjust_dp, ror) opMF (0x67, read_ildp, adc) opMI (0x68, pull, A) opMF (0x69, read_const, adc) opM (0x6a, ror_imm) opE (0x6b, rtl) opA (0x6c, jmp_iaddr) opMF (0x6d, read_addr, adc) opMF (0x6e, adjust_addr, ror) opMF (0x6f, read_long, adc) opAII(0x70, branch, 0x40, true) opMF (0x71, read_idpy, adc) opMF (0x72, read_idp, adc) opMF (0x73, read_isry, adc) opMII(0x74, write_dpr, Z, X) opMFI(0x75, read_dpr, adc, X) opMF (0x76, adjust_dpx, ror) opMF (0x77, read_ildpy, adc) opAII(0x78, flag, 0x04, 0x04) opMF (0x79, read_addry, adc) opXI (0x7a, pull, Y) opAII(0x7b, transfer_w, D, A) opA (0x7c, jmp_iaddrx) opMF (0x7d, read_addrx, adc) opMF (0x7e, adjust_addrx, ror) opMF (0x7f, read_longx, adc) opA (0x80, bra) opM (0x81, sta_idpx) opA (0x82, brl) opM (0x83, sta_sr) opXI (0x84, write_dp, Y) opMI (0x85, write_dp, A) opXI (0x86, write_dp, X) opM (0x87, sta_ildp) opXII(0x88, adjust_imm, Y, -1) opM (0x89, read_bit_const) opMII(0x8a, transfer, X, A) opA (0x8b, phb) opXI (0x8c, write_addr, Y) opMI (0x8d, write_addr, A) opXI (0x8e, write_addr, X) opMI (0x8f, write_longr, Z) opAII(0x90, branch, 0x01, false) opM (0x91, sta_idpy) opM (0x92, sta_idp) opM (0x93, sta_isry) opXII(0x94, write_dpr, Y, X) opMII(0x95, write_dpr, A, X) opXII(0x96, write_dpr, X, Y) opM (0x97, sta_ildpy) opMII(0x98, transfer, Y, A) opMII(0x99, write_addrr, A, Y) opE (0x9a, txs) opXII(0x9b, transfer, X, Y) opMI (0x9c, write_addr, Z) opMII(0x9d, write_addrr, A, X) opMII(0x9e, write_addrr, Z, X) opMI (0x9f, write_longr, X) opXF (0xa0, read_const, ldy) opMF (0xa1, read_idpx, lda) opXF (0xa2, read_const, ldx) opMF (0xa3, read_sr, lda) opXF (0xa4, read_dp, ldy) opMF (0xa5, read_dp, lda) opXF (0xa6, read_dp, ldx) opMF (0xa7, read_ildp, lda) opXII(0xa8, transfer, A, Y) opMF (0xa9, read_const, lda) opXII(0xaa, transfer, A, X) opA (0xab, plb) opXF (0xac, read_addr, ldy) opMF (0xad, read_addr, lda) opXF (0xae, read_addr, ldx) opMF (0xaf, read_long, lda) opAII(0xb0, branch, 0x01, true) opMF (0xb1, read_idpy, lda) opMF (0xb2, read_idp, lda) opMF (0xb3, read_isry, lda) opXFI(0xb4, read_dpr, ldy, X) opMFI(0xb5, read_dpr, lda, X) opXFI(0xb6, read_dpr, ldx, Y) opMF (0xb7, read_ildpy, lda) opAII(0xb8, flag, 0x40, 0x00) opMF (0xb9, read_addry, lda) opX (0xba, tsx) opXII(0xbb, transfer, Y, X) opXF (0xbc, read_addrx, ldy) opMF (0xbd, read_addrx, lda) opXF (0xbe, read_addry, ldx) opMF (0xbf, read_longx, lda) opXF (0xc0, read_const, cpy) opMF (0xc1, read_idpx, cmp) opEI (0xc2, pflag, 0) opMF (0xc3, read_sr, cmp) opXF (0xc4, read_dp, cpy) opMF (0xc5, read_dp, cmp) opMF (0xc6, adjust_dp, dec) opMF (0xc7, read_ildp, cmp) opXII(0xc8, adjust_imm, Y, +1) opMF (0xc9, read_const, cmp) opXII(0xca, adjust_imm, X, -1) opA (0xcb, wai) opXF (0xcc, read_addr, cpy) opMF (0xcd, read_addr, cmp) opMF (0xce, adjust_addr, dec) opMF (0xcf, read_long, cmp) opAII(0xd0, branch, 0x02, false) opMF (0xd1, read_idpy, cmp) opMF (0xd2, read_idp, cmp) opMF (0xd3, read_isry, cmp) opE (0xd4, pei) opMFI(0xd5, read_dpr, cmp, X) opMF (0xd6, adjust_dpx, dec) opMF (0xd7, read_ildpy, cmp) opAII(0xd8, flag, 0x08, 0x00) opMF (0xd9, read_addry, cmp) opXI (0xda, push, X) opA (0xdb, stp) opA (0xdc, jmp_iladdr) opMF (0xdd, read_addrx, cmp) opMF (0xde, adjust_addrx, dec) opMF (0xdf, read_longx, cmp) opXF (0xe0, read_const, cpx) opMF (0xe1, read_idpx, sbc) opEI (0xe2, pflag, 1) opMF (0xe3, read_sr, sbc) opXF (0xe4, read_dp, cpx) opMF (0xe5, read_dp, sbc) opMF (0xe6, adjust_dp, inc) opMF (0xe7, read_ildp, sbc) opXII(0xe8, adjust_imm, X, +1) opMF (0xe9, read_const, sbc) opA (0xea, nop) opA (0xeb, xba) opXF (0xec, read_addr, cpx) opMF (0xed, read_addr, sbc) opMF (0xee, adjust_addr, inc) opMF (0xef, read_long, sbc) opAII(0xf0, branch, 0x02, true) opMF (0xf1, read_idpy, sbc) opMF (0xf2, read_idp, sbc) opMF (0xf3, read_isry, sbc) opE (0xf4, pea) opMFI(0xf5, read_dpr, sbc, X) opMF (0xf6, adjust_dpx, inc) opMF (0xf7, read_ildpy, sbc) opAII(0xf8, flag, 0x08, 0x08) opMF (0xf9, read_addry, sbc) opXI (0xfa, pull, X) opA (0xfb, xce) opE (0xfc, jsr_iaddrx) opMF (0xfd, read_addrx, sbc) opMF (0xfe, adjust_addrx, inc) opMF (0xff, read_longx, sbc) #undef opA #undef opAII #undef opE #undef opEI #undef opEII #undef opM #undef opMI #undef opMII #undef opMF #undef opMFI #undef opX #undef opXI #undef opXII #undef opXF #undef opXFI } void R65816::update_table() { if(regs.e) { opcode_table = &op_table[table_EM]; } else if(regs.p.m) { if(regs.p.x) { opcode_table = &op_table[table_MX]; } else { opcode_table = &op_table[table_Mx]; } } else { if(regs.p.x) { opcode_table = &op_table[table_mX]; } else { opcode_table = &op_table[table_mx]; } } } sfc/chip/spc7110/spc7110.cpp000664 001750 001750 00000016640 12651764221 016315 0ustar00sergiosergio000000 000000 #include #define SPC7110_CPP namespace SuperFamicom { #include "dcu.cpp" #include "data.cpp" #include "alu.cpp" #include "serialization.cpp" SPC7110 spc7110; SPC7110::SPC7110() { decompressor = new Decompressor(*this); } SPC7110::~SPC7110() { delete decompressor; } void SPC7110::Enter() { spc7110.enter(); } void SPC7110::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(dcu_pending) { dcu_pending = 0; dcu_begin_transfer(); } if(mul_pending) { mul_pending = 0; alu_multiply(); } if(div_pending) { div_pending = 0; alu_divide(); } add_clocks(1); } } void SPC7110::add_clocks(unsigned clocks) { step(clocks); synchronize_cpu(); } void SPC7110::init() { } void SPC7110::load() { } void SPC7110::unload() { prom.reset(); drom.reset(); ram.reset(); } void SPC7110::power() { } void SPC7110::reset() { create(SPC7110::Enter, 21477272); r4801 = 0x00; r4802 = 0x00; r4803 = 0x00; r4804 = 0x00; r4805 = 0x00; r4806 = 0x00; r4807 = 0x00; r4809 = 0x00; r480a = 0x00; r480b = 0x00; r480c = 0x00; dcu_pending = 0; dcu_mode = 0; dcu_addr = 0; r4810 = 0x00; r4811 = 0x00; r4812 = 0x00; r4813 = 0x00; r4814 = 0x00; r4815 = 0x00; r4816 = 0x00; r4817 = 0x00; r4818 = 0x00; r481a = 0x00; r4820 = 0x00; r4821 = 0x00; r4822 = 0x00; r4823 = 0x00; r4824 = 0x00; r4825 = 0x00; r4826 = 0x00; r4827 = 0x00; r4828 = 0x00; r4829 = 0x00; r482a = 0x00; r482b = 0x00; r482c = 0x00; r482d = 0x00; r482e = 0x00; r482f = 0x00; mul_pending = 0; div_pending = 0; r4830 = 0x00; r4831 = 0x00; r4832 = 0x01; r4833 = 0x02; r4834 = 0x00; } uint8 SPC7110::read(unsigned addr) { cpu.synchronize_coprocessors(); if((addr & 0xff0000) == 0x500000) addr = 0x4800; addr = 0x4800 | (addr & 0x3f); switch(addr) { //================== //decompression unit //================== case 0x4800: { uint16 counter = r4809 | r480a << 8; counter--; r4809 = counter >> 0; r480a = counter >> 8; return dcu_read(); } case 0x4801: return r4801; case 0x4802: return r4802; case 0x4803: return r4803; case 0x4804: return r4804; case 0x4805: return r4805; case 0x4806: return r4806; case 0x4807: return r4807; case 0x4808: return 0x00; case 0x4809: return r4809; case 0x480a: return r480a; case 0x480b: return r480b; case 0x480c: return r480c; //============== //data port unit //============== case 0x4810: { uint8 data = r4810; data_port_increment_4810(); return data; } case 0x4811: return r4811; case 0x4812: return r4812; case 0x4813: return r4813; case 0x4814: return r4814; case 0x4815: return r4815; case 0x4816: return r4816; case 0x4817: return r4817; case 0x4818: return r4818; case 0x481a: { data_port_increment_481a(); return 0x00; } //===================== //arithmetic logic unit //===================== case 0x4820: return r4820; case 0x4821: return r4821; case 0x4822: return r4822; case 0x4823: return r4823; case 0x4824: return r4824; case 0x4825: return r4825; case 0x4826: return r4826; case 0x4827: return r4827; case 0x4828: return r4828; case 0x4829: return r4829; case 0x482a: return r482a; case 0x482b: return r482b; case 0x482c: return r482c; case 0x482d: return r482d; case 0x482e: return r482e; case 0x482f: return r482f; //=================== //memory control unit //=================== case 0x4830: return r4830; case 0x4831: return r4831; case 0x4832: return r4832; case 0x4833: return r4833; case 0x4834: return r4834; } return cpu.regs.mdr; } void SPC7110::write(unsigned addr, uint8 data) { cpu.synchronize_coprocessors(); addr = 0x4800 | (addr & 0x3f); switch(addr) { //================== //decompression unit //================== case 0x4801: r4801 = data; break; case 0x4802: r4802 = data; break; case 0x4803: r4803 = data; break; case 0x4804: r4804 = data; dcu_load_address(); break; case 0x4805: r4805 = data; break; case 0x4806: r4806 = data; r480c &= 0x7f; dcu_pending = 1; break; case 0x4807: r4807 = data; break; case 0x4808: break; case 0x4809: r4809 = data; break; case 0x480a: r480a = data; break; case 0x480b: r480b = data & 0x03; break; //============== //data port unit //============== case 0x4811: r4811 = data; break; case 0x4812: r4812 = data; break; case 0x4813: r4813 = data; data_port_read(); break; case 0x4814: r4814 = data; data_port_increment_4814(); break; case 0x4815: r4815 = data; if(r4818 & 2) data_port_read(); data_port_increment_4815(); break; case 0x4816: r4816 = data; break; case 0x4817: r4817 = data; break; case 0x4818: r4818 = data & 0x7f; data_port_read(); break; //===================== //arithmetic logic unit //===================== case 0x4820: r4820 = data; break; case 0x4821: r4821 = data; break; case 0x4822: r4822 = data; break; case 0x4823: r4823 = data; break; case 0x4824: r4824 = data; break; case 0x4825: r4825 = data; r482f |= 0x81; mul_pending = 1; break; case 0x4826: r4826 = data; break; case 0x4827: r4827 = data; r482f |= 0x80; div_pending = 1; break; case 0x482e: r482e = data & 0x01; break; //=================== //memory control unit //=================== case 0x4830: r4830 = data & 0x87; break; case 0x4831: r4831 = data & 0x07; break; case 0x4832: r4832 = data & 0x07; break; case 0x4833: r4833 = data & 0x07; break; case 0x4834: r4834 = data & 0x07; break; } } //=============== //SPC7110::MCUROM //=============== uint8 SPC7110::mcurom_read(unsigned addr) { unsigned mask = (1 << (r4834 & 3)) - 1; //8mbit, 16mbit, 32mbit, 64mbit DROM if((addr & 0x708000) == 0x008000 //$00-0f|80-8f:8000-ffff || (addr & 0xf00000) == 0xc00000 // $c0-cf:0000-ffff ) { addr &= 0x0fffff; if(prom.size()) { //8mbit PROM return prom.read(bus.mirror(0x000000 + addr, prom.size())); } addr |= 0x100000 * (r4830 & 7); return datarom_read(addr); } if((addr & 0x708000) == 0x108000 //$10-1f|90-9f:8000-ffff || (addr & 0xf00000) == 0xd00000 // $d0-df:0000-ffff ) { addr &= 0x0fffff; if(r4834 & 4) { //16mbit PROM return prom.read(bus.mirror(0x100000 + addr, prom.size())); } addr |= 0x100000 * (r4831 & 7); return datarom_read(addr); } if((addr & 0x708000) == 0x208000 //$20-2f|a0-af:8000-ffff || (addr & 0xf00000) == 0xe00000 // $e0-ef:0000-ffff ) { addr &= 0x0fffff; addr |= 0x100000 * (r4832 & 7); return datarom_read(addr); } if((addr & 0x708000) == 0x308000 //$30-3f|b0-bf:8000-ffff || (addr & 0xf00000) == 0xf00000 // $f0-ff:0000-ffff ) { addr &= 0x0fffff; addr |= 0x100000 * (r4833 & 7); return datarom_read(addr); } return cpu.regs.mdr; } void SPC7110::mcurom_write(unsigned addr, uint8 data) { } //=============== //SPC7110::MCURAM //=============== uint8 SPC7110::mcuram_read(unsigned addr) { //$00-3f|80-bf:6000-7fff if(r4830 & 0x80) { unsigned bank = (addr >> 16) & 0x3f; addr = bus.mirror(bank * 0x2000 + (addr & 0x1fff), ram.size()); return ram.read(addr); } return 0x00; } void SPC7110::mcuram_write(unsigned addr, uint8 data) { //$00-3f|80-bf:6000-7fff if(r4830 & 0x80) { unsigned bank = (addr >> 16) & 0x3f; addr = bus.mirror(bank * 0x2000 + (addr & 0x1fff), ram.size()); ram.write(addr, data); } } } gb/scheduler/000700 001750 001750 00000000000 12656700342 014241 5ustar00sergiosergio000000 000000 data/higan.ico000664 001750 001750 00000071161 12651764221 014411 0ustar00sergiosergio000000 000000  s7F00 %7  a] h nPNG  IHDR\rf7:IDATx |T93HB!bŽ0(XjRiKhkiU}CDQTD\+Պ@fYE %a 9˒e{3sϘ'>flBFYj4:h41&0Z"1o^HOF҈ߟJ(MN!B_) I?W5#~^yoTYc>Zl(*7zsJa &p`Nrի~N`]h\ܯtt|tmknΏ-Eҍ%ZG O2Z\į{`|(ce>sviG EerH} cc?Sm|/|Yb"2pRڮXG $`"\ajL* E_H󷨶)`"b<(?~t6mÇq.MHGRmO#`jGFiN 㯮&V${}D$[7нrޟ4`fP q!,Ҷms=ڦhF @K;Oa?=ᇤw ?teg&gE{&aىm1b6,/SD#Z@,XF$'_e`|饠~%'~ Ahs&\"2X=тEE51u++Iq$Y-O=avU?K!QJeϗtz6sO^oKv6w C{hIA Bk'Ì`j["ݹ'?GBO4O=E?Lݎ4cX*Kh|%K5 af[ږHC 1Gq|;:xRa%mΏ"pTPBL+VC  C= ￷,.P p@ǀ)4-m>Fl^TYp>{+Wsٿj#Fx%r !,Ì)c0{j[JL X6N{t,|e_Tp6,;8jF1BG)O&@x83Z}#1]qff4_vNӷ@Inb% zTFq6RmK?4^FM=fΌc%Tk`6`?D_Ro]-p/IԩhI76C)RhN^|* )$q dѶ ˓Wm-!XĜοRkj[d/o/yrj[3a ; Gz<aIIM $?em1wRmK`n`'!ݧ ہw0IնID z^.+:D~5l'C6ö`]Ѳ/1#0xsGUU]L!񹹪Ͱ50x] "B Pڝ#{Wm3+t2f(`]I]jնNfޣY#>vj3 0ת6#bhLA6m  (*rzEPA~?Ֆ!D8 [(cj[B8xR|b Vm? 6и8c&p!vQc0ZնF,^_:/UbU|@RPR(" ^iFl% S0}Tb%>RF ~MUy_-b?:TǍlh=8D`j[ ͋癙 競E*sbGИ>AvڐP.b8F.-8Yjʠs%N"~Qa@oQmKK(<؎=*oR(^ 0"r9 tGw9v-)Sy84"|5Ð2^ﭔ]8k)V1kl}/^ 3A08ږQ"!8Ef!ΈCk- B]A  XUՕt0~ .+veð|DMitN:v#oBOQp;@d%v%n:aH|N"9siUDMͧU7ڮH_{]O:T~HI]2)X SG`gtaT`;Sdo[w(4j.|s{)X8ˍڇteDL7zEucN3,_4n];撎j,T YN-&]GPLۨlh$Pe /crL,1tw[0g7"UtP]-ܑ P2 !$L E UUD _jF`8ޔX7eѬĈhP.,M`=ofhT$cۿ_p+.cPqfdUE ={U8 IݟIw#h fX)&iFLrXzS"AE ">~=԰/&r M@ MmÇɖԦ\/ I믷lKɣYrFo,\tB`իW11x\#՛5Vb7`+R:e׌҅ze߱~dKp5L=~"&GcӦeۢ&k䗥ρFgniʧڴ1b%>ےvX}4h0jXᵵۈ_Ҹ^K/Ie =#:uRX1i[9eho~C2Z)ilР63mY>/*"; {K/%)KoI~ܛK/)s5DB[M߾$_"T|#?ߒ _2U~Jn;}{k۶˅H8];^^L3z4IS}!W11E>tԕ0dW$t ȮWM`T\8Idxrx&EYE'C]|4lEEgr'cV}U.FJͻL*f͒z_L:YPWRBݣv,>]'m5JN%־ JKCm[q#1q{FVnj`o8S,`5˻PVp VȀF(f]pfe0HQ};vR2>V;ݺU)8tÃƊC{ ׀+WšD VŐظܿ)p9"5KQlp7L.0 TU,|Ѣ".Fp @o_YIxDz&x4svdi,?M!f {ILsW#fGk}@Y,ANiԶ1 0?/(v1,8!߲͉vj$hhS4ˈ}>gfB]c18R뮓ՆǎUھP-.n6% LCÇv=\ SĂNf 0eIa=xaH`*d (yA9^F"6 D Π#?10Y6}:9}ِ)n" $D^GkMသ;~ؚLI&!b0  ͺ^ptc;{\d @"~;KF8t{U٣Fz4s5;dǻ XL? a5DɄ ˺|H,D2+a7#;wNQ2]eHf#f\+pF55`l(`<* 3f-NÔ`M,OpďU}`f(K@ ֮UUcݤʸ [Jt`XBk12Td.զ f Y"vzj/<d-oX0 X3V*8q+V2̰k}\[9Tc0mN?]F1އYp+vLLjƪ t?-7 -9%$H?T+8D1XHAs٠A;ùN.$m~{o^U]0ZOTOa*0;e_Rڔ@0<:4dN!0'S@O `l,mG>9YҺM.ф:¬=lcFK.!IښfBwx}oˀZC:hI0~ՕcĎqFa! o`F It`ԸSt.";!F1'M Lou"eӦ׫6'o4p{1܇3S+.',6M|>,yFbYr"$Ȏ$t\tdUXGeֶc5$h1QMae!hg3(3F*B,d :Y΄);_|_L.4u;v2Ƚ^K][.ZDv!/TwYS;"' /(2ƴ.g$T{]R^++35juo@wNA01Bx@i]8̮Yvͤxxt2Jӏ;fGs #C'9;Lq`xWDU<.+g%')eИǠ;~!3@ +U7"TՈ3b1=//`dEm,/Fae?ꈲ=I ?*RF T7fuƬ>ႉ75A ^G0 P݈`QP"I5ט~}d=KR5X4!.;^m;c=˵5$b6<9 Ƈx֍iʮ_7 NK`s%TN#i^JB"y<zͧRl@VsmKz̜)Z{d_=MvSӏypǼ{Bx*d|pAWZc& QN{=3@c6aނa^Bc?` Xs^{665HM/ ~3(fluY˳&vT*%Y3=t7g(p50.XcgQYCD+TU055 wyat8O7tnAՂdϼy\۷9̆ծEH@ >_7fjeQu+oK+* 3OČҋ'GvGga<0K%@^3CϦ1\#5h w{</Cq 6 #CĂIRY᜿o5TA oB3ɠ~T]:ݕW6DI޼ ںN F(bRV$LN_wx{Cg|^LFOMVypp$ְr#%f<nu}QKڡQAJ)m1xAܪVvd>\h}P*Ef&P?>'c@CדiƔߝǎ5rk"+B*yx gV:iaɪMфC:H)=F}j3+7#t8B~57)s$cfhB p`DGv$ŷݦڌɽ>$&(!N O>!<ڌVqfd.&G۶MA@)tRPu`L `@D`IAuZpeLHoܨڌ|FdMDXZp]D xfG 0{/IG%0. o%;`]i`1p6E AհI6#$*C0\PqP.n=D*CaRzRj{c*ÿJ(5B1XcOc]U{ L{E1X+G:LզhNY^^*D[O6:V_,0ҋ?1 ;[{_|7KT CTb#T9? ٪X(5!o}|1hbh%&&E5>=c`=ҕvX/nݪ )"Ta,romD:{6)d\@/f4&FOÂcU pմ_IZ~j3bbG~~@p7RT#(Xq8wXثjSb.O3 *]%Hu۷m?#sP&TզB3'AxJn@47>0˜æ{ m%['zPkk o=/}TupNr h6^hs&^Zi<~HfD$Y^^Hf-i2IѪIXT<R,(0/f H,yARWZW0:S+5^ˀa_Ս$cemt׾}п~ Al[X P@mFׯ'eӦIG|׮#VPAx [ oMpP$k;g&?‡M@+p!;<¹Fti'plcO-`N{pG`=> jebXCyKOl׎tiSul;%;w6N;m۪6vp)6E@ˀFyٿl2.d^si3,Н؆IDEi8!;^' kMnn7p$v=(%ݦM3b̤Ȟ&ZN${sÎ4 8]+FUpaWIii\Ii#\93D@ F͸VhQHHUBͷߒ&Yr/wym/Pg%Z *a;zGSJu`l`'g0bd%cu ̊k`7m$NVJ55?,܅h|%K&+o!;L1| @'X932Tb9diKh Bw&𯗎Ϳػx1k+X;46c3ͼfdIp:a(3bOX[Q^ JU]z 3n0_ ͼfHE۸{Ԛ/w{\qgmi O d"v dx#IկT"X}˖/KǏ7u},ZV3U?+PZ*.gOeR=)P2)kH!-#`7}mrV=_Ʃ|(V>vQqmN?]YqiM9稫F kͬ76?DC ؊Œ[Xz*z&03H9<#@T :,aI%zo7$jn%%Y:b̤SOUt] @"=:*‚5˻jqQ!kaqǢbg‡'7nTmJ`Eb 9#Ryˆp~F؋%%|4EIb^~B(3٩PJw+M<7 <3Rdĉ) 8 "TK rI6Eʕ;tIԩxud˼B#˞z'/G,bn;cڼH|XLtlHy9>nQZJliL8)nզ|L]EC0LΟo8}#:&d"U:[. POcYipkXƛɡ--vyaߥ'?OXڌp#GsQmq!`eno_ =oI>RXJi 'qdgXzEW]6N$"p=t =M+^Ȯ 2ggwE={eT(A0 aufR:mǖ8h у(X4spL`_ΜγUR1{XQѸP)SVS~ F~*=2%ߛ _FlQjm3V{!8~P;+܃Iеkׂ1,+7P, {s#U6nWr;i{)]"! JIE]}5qt@\VnXSSX (qԥ=c^SAvVy+-??-F?cXo6 IRYvUp+fPd? W_% T["퍍T"(gIâ]K\ߌvhW:;1y-Rpj3(kΫ>/;Tz,JҤL`^z=摪 T4@w|]Rj3yovya꿀UU]٧%I^ﭔ2.jͰw"7T!t 2`@"D]. jDi~aFf^˞|S`$yc qvG<գX <"`O,&ĝەw1~ xŨ 2xByy.Eq۫ù3g*+e%1g\ǎJT)xوUmr@ļy<3s!eal%E f5L(iBRJg&2Vג҉MEE)sT̚E}#<] FHvD畂`&4Ν$69dƒXH Qg[E&8iS߳J)ʀ# ^R#;\l%x}–ʍ[~uekGƂkX~*(؍Bpor. 9œB`IDV`1NY_yYl!rr~91~IHT?Ώ"{AOkN)+3J;+S'~%󍎟x)*1k\R7M4psvamQzj0 kVq(peS'(tXu+5//LݪilHdҥzjM?pοe~.]o߾W}mha**D!4S5&-m@O>!?,&wwC}Ll賸'%&rN9F$t#5 q"5udEI9G``~0 3t% Q%(W)|_ J_;j22nPrcËAGBAC .?(Ċ3+*. 0JO5>];b֬Dm邐GJpjP }k 7_{)9uu98ЩFVnໜ,wB1J4q>WW++MBBnn""**55AAww꿿0TAADD%%((&&22hhʲ'ώZZ66''%%xx##00hh ""BB))""ss""00hhP]>>yy))pp!!//aaη̽xx bb))nn!!##>>znEE..vv((wwgg22׿$ý33((XX%%dd<<BBrOppNNjj""PPggYY::))ss߼=||))llᄒc&eey-JJee %//@@载m 콽''˽JKQQ!!==鼼#hǽ>>%%>>ee輼?V}}VVssスʻ7$Oƽռܼ߽ٽѽm; " ???( @ &?QYR@' 7㼼佽»: **(- 9鼼뽽>88 $$)ۇ۲BB㝙䷷OOڽ۳۟_ @@g55))WWXX""ہ3TT//??%%''޴J aa%%||::""SSi\\++@@66r'ؽEELLLLLLݼ.((""aaWWս````zz!!SS۽#T((;;,,FF^MM!!--55{{&&öҽ&&mmټ۽77RRỻ"۽JJ??ỻ"ҽ]]||ټaa<>ee뽽= 7ss㗗佽»: &?QYR@'?(  @Yw; 9`rrvӽ~~!!sma:zzss==UU[[""&&څ255CCRR((kk޴08罽&&mmaa33SS;;oo --漼.Ž##!!##_ڽ..ee}ڽ>>@@}ŽbbTTJJPPww_vv<>NN@@&&11FF11eeּ.55""پG jӖ..??3Y򍬬w; gba/memory/memory.cpp000664 001750 001750 00000006355 12651764221 015776 0ustar00sergiosergio000000 000000 #include namespace GameBoyAdvance { #include "mmio.cpp" #include "serialization.cpp" Bus bus; struct UnmappedMemory : Memory { uint32 read(uint32 addr, uint32 size) { return 0u; } void write(uint32 addr, uint32 size, uint32 word) {} }; static UnmappedMemory unmappedMemory; uint32 Bus::mirror(uint32 addr, uint32 size) { uint32 base = 0; if(size) { uint32 mask = 1 << 27; //28-bit bus while(addr >= size) { while(!(addr & mask)) mask >>= 1; addr -= mask; if(size > mask) { size -= mask; base += mask; } mask >>= 1; } base += addr; } return base; } uint32 Bus::speed(uint32 addr, uint32 size) { if(addr & 0x08000000) { static unsigned timing[] = {5, 4, 3, 9}; unsigned n = cpu.regs.wait.control.nwait[addr >> 25 & 3]; unsigned s = cpu.regs.wait.control.swait[addr >> 25 & 3]; n = timing[n]; switch(addr >> 25 & 3) { case 0: s = s ? 3 : 2; break; case 1: s = s ? 5 : 2; break; case 2: s = s ? 9 : 2; break; case 3: s = n; break; } bool sequential = cpu.sequential(); if((addr & 0xffff << 1) == 0) sequential = false; //N cycle on 16-bit ROM crossing page boundary (RAM S==N) if(idleflag) sequential = false; //LDR/LDM interrupts instruction fetches if(sequential) return s << (size == Word); //16-bit bus requires two transfers for words if(size == Word) n += s; return n; } switch(addr >> 24 & 7) { case 0: return 1; case 1: return 1; case 2: return (1 + 15 - cpu.regs.memory.control.ewramwait) << (size == Word); case 3: return 1; case 4: return 1; case 5: return 1 << (size == Word); case 6: return 1 << (size == Word); case 7: return 1; } } void Bus::idle(uint32 addr) { if(addr & 0x08000000) idleflag = true; } uint32 Bus::read(uint32 addr, uint32 size) { idleflag = false; if(addr & 0x08000000) return cartridge.read(addr, size); switch(addr >> 24 & 7) { case 0: return bios.read(addr, size); case 1: return bios.read(addr, size); case 2: return cpu.ewram_read(addr, size); case 3: return cpu.iwram_read(addr, size); case 4: if((addr & 0xfffffc00) == 0x04000000) return mmio[addr & 0x3ff]->read(addr, size); if((addr & 0xff00ffff) == 0x04000800) return ((MMIO&)cpu).read(0x04000800 | (addr & 3), size); return cpu.pipeline.fetch.instruction; case 5: return ppu.pram_read(addr, size); case 6: return ppu.vram_read(addr, size); case 7: return ppu.oam_read(addr, size); } } void Bus::write(uint32 addr, uint32 size, uint32 word) { idleflag = false; if(addr & 0x08000000) return cartridge.write(addr, size, word); switch(addr >> 24 & 7) { case 0: return; case 1: return; case 2: return cpu.ewram_write(addr, size, word); case 3: return cpu.iwram_write(addr, size, word); case 4: if((addr & 0xfffffc00) == 0x04000000) return mmio[addr & 0x3ff]->write(addr, size, word); if((addr & 0xff00ffff) == 0x04000800) return ((MMIO&)cpu).write(0x04000800 | (addr & 3), size, word); return; case 5: return ppu.pram_write(addr, size, word); case 6: return ppu.vram_write(addr, size, word); case 7: return ppu.oam_write(addr, size, word); } } void Bus::power() { for(unsigned n = 0; n < 0x400; n++) mmio[n] = &unmappedMemory; idleflag = false; } } phoenix/core/keyboard.hpp000664 001750 001750 00000004336 12651764221 016631 0ustar00sergiosergio000000 000000 //each code refers to a physical key //names are taken assuming: NumLock on, CapsLock off, Shift off //layout uses US-104 keyboard enum class Scancode : unsigned { None, Escape, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PrintScreen, ScrollLock, Pause, Insert, Delete, Home, End, PageUp, PageDown, Up, Down, Left, Right, Grave, Number1, Number2, Number3, Number4, Number5, Number6, Number7, Number8, Number9, Number0, Minus, Equal, Backspace, BracketLeft, BracketRight, Backslash, Semicolon, Apostrophe, Comma, Period, Slash, Tab, CapsLock, Return, ShiftLeft, ShiftRight, ControlLeft, ControlRight, SuperLeft, SuperRight, AltLeft, AltRight, Space, Menu, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, NumLock, Divide, Multiply, Subtract, Add, Enter, Point, Keypad1, Keypad2, Keypad3, Keypad4, Keypad5, Keypad6, Keypad7, Keypad8, Keypad9, Keypad0, Limit, }; //each enum refers to a translated scancode (eg Shift+1 = !) enum class Keycode : unsigned { None, Escape, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PrintScreen, SysRq, ScrollLock, Pause, Break, Insert, Delete, Home, End, PageUp, PageDown, Up, Down, Left, Right, Grave, Number1, Number2, Number3, Number4, Number5, Number6, Number7, Number8, Number9, Number0, Minus, Equal, Backspace, Tilde, Exclamation, At, Pound, Dollar, Percent, Power, Ampersand, Asterisk, ParenthesisLeft, ParenthesisRight, Underscore, Plus, BracketLeft, BracketRight, Backslash, Semicolon, Apostrophe, Comma, Period, Slash, BraceLeft, BraceRight, Pipe, Colon, Quote, CaretLeft, CaretRight, Question, Tab, CapsLock, Return, ShiftLeft, ShiftRight, ControlLeft, ControlRight, SuperLeft, SuperRight, AltLeft, AltRight, Space, Menu, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, NumLock, Divide, Multiply, Subtract, Add, Enter, Point, Keypad1, Keypad2, Keypad3, Keypad4, Keypad5, Keypad6, Keypad7, Keypad8, Keypad9, Keypad0, KeypadInsert, KeypadDelete, KeypadHome, KeypadEnd, KeypadPageUp, KeypadPageDown, KeypadUp, KeypadDown, KeypadLeft, KeypadRight, KeypadCenter, Limit, }; nall/zip.hpp000664 001750 001750 00000007051 12651764221 014154 0ustar00sergiosergio000000 000000 #ifndef NALL_ZIP_HPP #define NALL_ZIP_HPP //creates uncompressed ZIP archives #include #include namespace nall { struct zip { zip(const string& filename) { fp.open(filename, file::mode::write); time_t currentTime = time(nullptr); tm* info = localtime(¤tTime); dosTime = (info->tm_hour << 11) | (info->tm_min << 5) | (info->tm_sec >> 1); dosDate = ((info->tm_year - 80) << 9) | ((1 + info->tm_mon) << 5) + (info->tm_mday); } //append path: append("path/"); //append file: append("path/file", data, size); void append(string filename, const uint8_t* data = nullptr, unsigned size = 0u) { filename.transform("\\", "/"); uint32_t checksum = crc32_calculate(data, size); directory.append({filename, checksum, size, fp.offset()}); fp.writel(0x04034b50, 4); //signature fp.writel(0x0014, 2); //minimum version (2.0) fp.writel(0x0000, 2); //general purpose bit flags fp.writel(0x0000, 2); //compression method (0 = uncompressed) fp.writel(dosTime, 2); fp.writel(dosDate, 2); fp.writel(checksum, 4); fp.writel(size, 4); //compressed size fp.writel(size, 4); //uncompressed size fp.writel(filename.length(), 2); //file name length fp.writel(0x0000, 2); //extra field length fp.print(filename); //file name fp.write(data, size); //file data } ~zip() { //central directory unsigned baseOffset = fp.offset(); for(auto& entry : directory) { fp.writel(0x02014b50, 4); //signature fp.writel(0x0014, 2); //version made by (2.0) fp.writel(0x0014, 2); //version needed to extract (2.0) fp.writel(0x0000, 2); //general purpose bit flags fp.writel(0x0000, 2); //compression method (0 = uncompressed) fp.writel(dosTime, 2); fp.writel(dosDate, 2); fp.writel(entry.checksum, 4); fp.writel(entry.size, 4); //compressed size fp.writel(entry.size, 4); //uncompressed size fp.writel(entry.filename.length(), 2); //file name length fp.writel(0x0000, 2); //extra field length fp.writel(0x0000, 2); //file comment length fp.writel(0x0000, 2); //disk number start fp.writel(0x0000, 2); //internal file attributes fp.writel(0x00000000, 4); //external file attributes fp.writel(entry.offset, 4); //relative offset of file header fp.print(entry.filename); } unsigned finishOffset = fp.offset(); //end of central directory fp.writel(0x06054b50, 4); //signature fp.writel(0x0000, 2); //number of this disk fp.writel(0x0000, 2); //disk where central directory starts fp.writel(directory.size(), 2); //number of central directory records on this disk fp.writel(directory.size(), 2); //total number of central directory records fp.writel(finishOffset - baseOffset, 4); //size of central directory fp.writel(baseOffset, 4); //offset of central directory fp.writel(0x0000, 2); //comment length fp.close(); } protected: file fp; uint16_t dosTime, dosDate; struct entry_t { string filename; uint32_t checksum; uint32_t size; uint32_t offset; }; vector directory; }; } #endif libco/000700 001750 001750 00000000000 12656700342 012763 5ustar00sergiosergio000000 000000 gba/ppu/screen.cpp000664 001750 001750 00000006023 12651764221 015231 0ustar00sergiosergio000000 000000 void PPU::render_forceblank() { uint32* line = output + regs.vcounter * 240; for(unsigned x = 0; x < 240; x++) { line[x] = 0x7fff; } } void PPU::render_screen() { uint32* line = output + regs.vcounter * 240; if(regs.bg[0].control.mosaic) render_mosaic_background(BG0); if(regs.bg[1].control.mosaic) render_mosaic_background(BG1); if(regs.bg[2].control.mosaic) render_mosaic_background(BG2); if(regs.bg[3].control.mosaic) render_mosaic_background(BG3); render_mosaic_object(); for(unsigned x = 0; x < 240; x++) { Registers::WindowFlags flags; flags = ~0; //enable all layers if no windows are enabled //determine active window if(regs.control.enablewindow[In0] || regs.control.enablewindow[In1] || regs.control.enablewindow[Obj]) { flags = (uint8)regs.windowflags[Out]; if(regs.control.enablewindow[Obj] && windowmask[Obj][x]) flags = (uint8)regs.windowflags[Obj]; if(regs.control.enablewindow[In1] && windowmask[In1][x]) flags = (uint8)regs.windowflags[In1]; if(regs.control.enablewindow[In0] && windowmask[In0][x]) flags = (uint8)regs.windowflags[In0]; } //priority sorting: find topmost two pixels unsigned a = 5, b = 5; for(signed p = 3; p >= 0; p--) { for(signed l = 5; l >= 0; l--) { if(layer[l][x].enable && layer[l][x].priority == p && flags.enable[l]) { b = a; a = l; } } } auto& above = layer[a]; auto& below = layer[b]; bool blendabove = regs.blend.control.above[a]; bool blendbelow = regs.blend.control.below[b]; unsigned color = above[x].color; //perform blending, if needed if(flags.enable[SFX] == false) { } else if(above[x].translucent && blendbelow) { color = blend(above[x].color, regs.blend.eva, below[x].color, regs.blend.evb); } else if(regs.blend.control.mode == 1 && blendabove && blendbelow) { color = blend(above[x].color, regs.blend.eva, below[x].color, regs.blend.evb); } else if(regs.blend.control.mode == 2 && blendabove) { color = blend(above[x].color, 16 - regs.blend.evy, 0x7fff, regs.blend.evy); } else if(regs.blend.control.mode == 3 && blendabove) { color = blend(above[x].color, 16 - regs.blend.evy, 0x0000, regs.blend.evy); } //output pixel line[x] = color; } } void PPU::render_window(unsigned w) { unsigned y = regs.vcounter; unsigned y1 = regs.window[w].y1, y2 = regs.window[w].y2; unsigned x1 = regs.window[w].x1, x2 = regs.window[w].x2; if(y2 < y1 || y2 > 160) y2 = 160; if(x2 < x1 || x2 > 240) x2 = 240; if(y >= y1 && y < y2) { for(unsigned x = x1; x < x2; x++) { windowmask[w][x] = true; } } } unsigned PPU::blend(unsigned above, unsigned eva, unsigned below, unsigned evb) { uint5 ar = above >> 0, ag = above >> 5, ab = above >> 10; uint5 br = below >> 0, bg = below >> 5, bb = below >> 10; unsigned r = (ar * eva + br * evb) >> 4; unsigned g = (ag * eva + bg * evb) >> 4; unsigned b = (ab * eva + bb * evb) >> 4; return min(31, r) << 0 | min(31, g) << 5 | min(31, b) << 10; } nall/string/allocator/vector.hpp000664 001750 001750 00000003330 12651764221 020136 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP /* vector allocator sizeof(string) == 16 (amd64) utilizes a raw string pointer always allocates memory onto the heap when string is not empty pros: * potential for in-place resize * simplicity cons: * always allocates heap memory on (capacity > 0) * pass-by-value requires heap allocation */ namespace nall { char* string::data() { if(_capacity == 0) reserve(1); return _data; } const char* string::data() const { if(_capacity == 0) return ""; return _data; } void string::reserve(unsigned capacity) { if(capacity > _capacity) { _capacity = bit::round(capacity + 1) - 1; _data = (char*)realloc(_data, _capacity + 1); _data[_capacity] = 0; } } void string::resize(unsigned size) { reserve(size); data()[_size = size] = 0; } void string::reset() { if(_data) { free(_data); _data = nullptr; } _capacity = 0; _size = 0; } string& string::operator=(const string& source) { if(&source == this) return *this; reset(); _data = (char*)malloc(source._size + 1); _capacity = source._size; _size = source._size; memcpy(_data, source.data(), source.size() + 1); return *this; } string& string::operator=(string&& source) { if(&source == this) return *this; reset(); _data = source._data; _capacity = source._capacity; _size = source._size; source._data = nullptr; source._capacity = 0; source._size = 0; return *this; } template string::string(T&& source, Args&&... args) { construct(); sprint(*this, std::forward(source), std::forward(args)...); } string::string() { construct(); } string::~string() { reset(); } void string::construct() { _data = nullptr; _capacity = 0; _size = 0; } } #endif phoenix/core/layout/vertical-layout.hpp000664 001750 001750 00000001234 12651764221 021464 0ustar00sergiosergio000000 000000 struct VerticalLayout : public Layout { void append(Sizable& sizable, Size size, unsigned spacing = 0); void append(Sizable& sizable); Size minimumSize(); void remove(Sizable& sizable); void reset(); void setAlignment(double alignment); void setEnabled(bool enabled = true); void setGeometry(Geometry geometry); void setMargin(unsigned margin); void setVisible(bool visible = true); void synchronizeLayout(); ~VerticalLayout(); //private: struct State { double alignment = 0.0; unsigned margin = 0; } state; struct Children { Sizable* sizable; unsigned width, height, spacing; }; nall::vector children; }; nall/string/char/convert.hpp000664 001750 001750 00000002365 12651764221 017260 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { char* strlower(char* str) { if(!str) return nullptr; int i = 0; while(str[i]) { str[i] = chrlower(str[i]); i++; } return str; } char* strupper(char* str) { if(!str) return nullptr; int i = 0; while(str[i]) { str[i] = chrupper(str[i]); i++; } return str; } char* qstrlower(char* s) { if(!s) return nullptr; bool quoted = false; while(*s) { if(*s == '\"' || *s == '\'') quoted ^= 1; if(quoted == false && *s >= 'A' && *s <= 'Z') *s += 0x20; s++; } return s; } char* qstrupper(char* s) { if(!s) return nullptr; bool quoted = false; while(*s) { if(*s == '\"' || *s == '\'') quoted ^= 1; if(quoted == false && *s >= 'a' && *s <= 'z') *s -= 0x20; s++; } return s; } char* strtr(char* dest, const char* before, const char* after) { if(!dest || !before || !after) return dest; int sl = strlen(dest), bsl = strlen(before), asl = strlen(after); if(bsl != asl || bsl == 0) return dest; //patterns must be the same length for 1:1 replace for(unsigned i = 0; i < sl; i++) { for(unsigned l = 0; l < bsl; l++) { if(dest[i] == before[l]) { dest[i] = after[l]; break; } } } return dest; } } #endif gb/cartridge/mbc0/mbc0.hpp000664 001750 001750 00000000171 12651764221 016416 0ustar00sergiosergio000000 000000 struct MBC0 : MMIO { uint8 mmio_read(uint16 addr); void mmio_write(uint16 addr, uint8 data); void power(); } mbc0; sfc/cpu/timing/joypad.cpp000664 001750 001750 00000001727 12651764221 016542 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP //called every 256 clocks; see CPU::add_clocks() void CPU::step_auto_joypad_poll() { if(vcounter() >= (ppu.overscan() == false ? 225 : 240)) { //cache enable state at first iteration if(status.auto_joypad_counter == 0) status.auto_joypad_latch = status.auto_joypad_poll; status.auto_joypad_active = status.auto_joypad_counter <= 15; if(status.auto_joypad_active && status.auto_joypad_latch) { if(status.auto_joypad_counter == 0) { input.port1->latch(1); input.port2->latch(1); input.port1->latch(0); input.port2->latch(0); } uint2 port0 = input.port1->data(); uint2 port1 = input.port2->data(); status.joy1 = (status.joy1 << 1) | (bool)(port0 & 1); status.joy2 = (status.joy2 << 1) | (bool)(port1 & 1); status.joy3 = (status.joy3 << 1) | (bool)(port0 & 2); status.joy4 = (status.joy4 << 1) | (bool)(port1 & 2); } status.auto_joypad_counter++; } } #endif sfc/chip/icd2/icd2.cpp000664 001750 001750 00000003127 12651764221 015557 0ustar00sergiosergio000000 000000 #include #define ICD2_CPP namespace SuperFamicom { #include "interface/interface.cpp" #include "mmio/mmio.cpp" #include "serialization.cpp" ICD2 icd2; void ICD2::Enter() { icd2.enter(); } void ICD2::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { GameBoy::system.runtosave(); scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(r6003 & 0x80) { GameBoy::system.run(); step(GameBoy::system.clocks_executed); GameBoy::system.clocks_executed = 0; } else { //DMG halted audio.coprocessor_sample(0x0000, 0x0000); step(1); } synchronize_cpu(); } } void ICD2::init() { } void ICD2::load() { bind = GameBoy::interface->bind; hook = GameBoy::interface->hook; GameBoy::interface->bind = this; GameBoy::interface->hook = this; } void ICD2::unload() { GameBoy::interface->bind = bind; GameBoy::interface->hook = hook; } void ICD2::power() { audio.coprocessor_enable(true); audio.coprocessor_frequency(2 * 1024 * 1024); } void ICD2::reset() { create(ICD2::Enter, cpu.frequency / 5); r6000_ly = 0x00; r6000_row = 0x00; r6003 = 0x00; r6004 = 0xff; r6005 = 0xff; r6006 = 0xff; r6007 = 0xff; for(auto& r : r7000) r = 0x00; r7800 = 0x0000; mlt_req = 0; for(auto& n : lcd.buffer) n = 0; for(auto& n : lcd.output) n = 0; lcd.row = 0; packetsize = 0; joyp_id = 3; joyp15lock = 0; joyp14lock = 0; pulselock = true; GameBoy::video.generate_palette(Emulator::Interface::PaletteMode::Literal); GameBoy::system.init(); GameBoy::system.power(); } } ruby/input/joypad/sdl.cpp000664 001750 001750 00000004522 12651764221 016607 0ustar00sergiosergio000000 000000 #ifndef RUBY_INPUT_JOYPAD_SDL #define RUBY_INPUT_JOYPAD_SDL namespace ruby { struct InputJoypadSDL { struct Joypad { HID::Joypad hid; unsigned id = 0; SDL_Joystick* handle = nullptr; }; vector joypads; void assign(HID::Joypad& hid, unsigned groupID, unsigned inputID, int16_t value) { auto& group = hid.group[groupID]; if(group.input[inputID].value == value) return; if(input.onChange) input.onChange(hid, groupID, inputID, group.input[inputID].value, value); group.input[inputID].value = value; } void poll(vector& devices) { SDL_JoystickUpdate(); for(auto& jp : joypads) { for(unsigned n = 0; n < jp.hid.axis().input.size(); n++) { assign(jp.hid, HID::Joypad::GroupID::Axis, n, (int16_t)SDL_JoystickGetAxis(jp.handle, n)); } for(signed n = 0; n < (signed)jp.hid.hat().input.size() - 1; n += 2) { uint8_t state = SDL_JoystickGetHat(jp.handle, n >> 1); assign(jp.hid, HID::Joypad::GroupID::Hat, n + 0, state & SDL_HAT_LEFT ? -32768 : state & SDL_HAT_RIGHT ? +32767 : 0); assign(jp.hid, HID::Joypad::GroupID::Hat, n + 1, state & SDL_HAT_UP ? -32768 : state & SDL_HAT_DOWN ? +32767 : 0); } for(unsigned n = 0; n < jp.hid.button().input.size(); n++) { assign(jp.hid, HID::Joypad::GroupID::Button, n, (bool)SDL_JoystickGetButton(jp.handle, n)); } devices.append(&jp.hid); } } bool init() { SDL_InitSubSystem(SDL_INIT_JOYSTICK); SDL_JoystickEventState(SDL_IGNORE); unsigned joypadCount = SDL_NumJoysticks(); for(unsigned id = 0; id < joypadCount; id++) { Joypad jp; jp.id = id; jp.handle = SDL_JoystickOpen(id); unsigned axes = SDL_JoystickNumAxes(jp.handle); unsigned hats = SDL_JoystickNumHats(jp.handle) * 2; unsigned buttons = 32; //there is no SDL_JoystickNumButtons() jp.hid.id = 2 + jp.id; for(unsigned n = 0; n < axes; n++) jp.hid.axis().append({n}); for(unsigned n = 0; n < hats; n++) jp.hid.hat().append({n}); for(unsigned n = 0; n < buttons; n++) jp.hid.button().append({n}); jp.hid.rumble = false; joypads.append(jp); } return true; } void term() { for(auto& jp : joypads) { SDL_JoystickClose(jp.handle); } joypads.reset(); SDL_QuitSubSystem(SDL_INIT_JOYSTICK); } }; } #endif emulator/emulator.hpp000664 001750 001750 00000007645 12651764221 016115 0ustar00sergiosergio000000 000000 #ifndef EMULATOR_HPP #define EMULATOR_HPP namespace Emulator { static const char Name[] = "higan"; static const char Version[] = "094"; static const char Author[] = "byuu"; static const char License[] = "GPLv3"; static const char Website[] = "http://byuu.org/"; #if defined(PROFILE_ACCURACY) static const char Profile[] = "Accuracy"; #elif defined(PROFILE_BALANCED) static const char Profile[] = "Balanced"; #elif defined(PROFILE_PERFORMANCE) static const char Profile[] = "Performance"; #endif } #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace nall; #include "interface.hpp" //debugging function hook: //no overhead (and no debugger invocation) if not compiled with -DDEBUGGER //wraps testing of function to allow invocation without a defined callback template struct hook; template struct hook { function callback; R operator()(P... p) const { #if defined(DEBUGGER) if(callback) return callback(std::forward

(p)...); #endif return R(); } hook() {} hook(const hook& hook) { callback = hook.callback; } hook(void* function) { callback = function; } hook(R (*function)(P...)) { callback = function; } template hook(R (C::*function)(P...), C* object) { callback = {function, object}; } template hook(R (C::*function)(P...) const, C* object) { callback = {function, object}; } template hook(const L& function) { callback = function; } hook& operator=(const hook& hook) { callback = hook.callback; return *this; } }; #if defined(DEBUGGER) #define privileged public #else #define privileged private #endif typedef int1_t int1; typedef int2_t int2; typedef int3_t int3; typedef int4_t int4; typedef int5_t int5; typedef int6_t int6; typedef int7_t int7; typedef int8_t int8; typedef int9_t int9; typedef int10_t int10; typedef int11_t int11; typedef int12_t int12; typedef int13_t int13; typedef int14_t int14; typedef int15_t int15; typedef int16_t int16; typedef int17_t int17; typedef int18_t int18; typedef int19_t int19; typedef int20_t int20; typedef int21_t int21; typedef int22_t int22; typedef int23_t int23; typedef int24_t int24; typedef int25_t int25; typedef int26_t int26; typedef int27_t int27; typedef int28_t int28; typedef int29_t int29; typedef int30_t int30; typedef int31_t int31; typedef int32_t int32; typedef int64_t int64; typedef uint1_t uint1; typedef uint2_t uint2; typedef uint3_t uint3; typedef uint4_t uint4; typedef uint5_t uint5; typedef uint6_t uint6; typedef uint7_t uint7; typedef uint8_t uint8; typedef uint9_t uint9; typedef uint10_t uint10; typedef uint11_t uint11; typedef uint12_t uint12; typedef uint13_t uint13; typedef uint14_t uint14; typedef uint15_t uint15; typedef uint16_t uint16; typedef uint17_t uint17; typedef uint18_t uint18; typedef uint19_t uint19; typedef uint20_t uint20; typedef uint21_t uint21; typedef uint22_t uint22; typedef uint23_t uint23; typedef uint24_t uint24; typedef uint25_t uint25; typedef uint26_t uint26; typedef uint27_t uint27; typedef uint28_t uint28; typedef uint29_t uint29; typedef uint30_t uint30; typedef uint31_t uint31; typedef uint32_t uint32; typedef nall::uint_t<33> uint33; typedef uint64_t uint64; typedef varuint_t varuint; #endif gba/apu/registers.cpp000664 001750 001750 00000000431 12651764221 015737 0ustar00sergiosergio000000 000000 APU::Registers::SoundBias::operator uint16() const { return ( (level << 0) | (amplitude << 14) ); } uint16 APU::Registers::SoundBias::operator=(uint16 source) { level = (source >> 0) & 1023; amplitude = (source >> 14) & 3; return operator uint16(); } phoenix/cocoa/widget/line-edit.hpp000664 001750 001750 00000001104 12651764221 020310 0ustar00sergiosergio000000 000000 @interface CocoaLineEdit : NSTextField { @public phoenix::LineEdit* lineEdit; } -(id) initWith:(phoenix::LineEdit&)lineEdit; -(void) textDidChange:(NSNotification*)n; -(IBAction) activate:(id)sender; @end namespace phoenix { struct pLineEdit : public pWidget { LineEdit& lineEdit; CocoaLineEdit* cocoaLineEdit = nullptr; Size minimumSize(); void setEditable(bool editable); void setText(string text); string text(); pLineEdit(LineEdit& lineEdit) : pWidget(lineEdit), lineEdit(lineEdit) {} void constructor(); void destructor(); }; } gba/cartridge/000700 001750 001750 00000000000 12656700342 014370 5ustar00sergiosergio000000 000000 gb/cpu/timing.cpp000664 001750 001750 00000004605 12651764221 015067 0ustar00sergiosergio000000 000000 //70224 clocks/frame // 456 clocks/scanline // 154 scanlines/frame #ifdef CPU_CPP void CPU::add_clocks(unsigned clocks) { if(oamdma.active) { for(unsigned n = 0; n < 4 * clocks; n++) { bus.write(0xfe00 + oamdma.offset, bus.read((oamdma.bank << 8) + oamdma.offset)); if(++oamdma.offset == 160) { oamdma.active = false; break; } } } system.clocks_executed += clocks; if(system.sgb()) scheduler.exit(Scheduler::ExitReason::StepEvent); status.clock += clocks; if(status.clock >= 4 * 1024 * 1024) { status.clock -= 4 * 1024 * 1024; cartridge.mbc3.second(); } //4MHz / N(hz) - 1 = mask if((status.clock & 15) == 0) timer_262144hz(); if((status.clock & 63) == 0) timer_65536hz(); if((status.clock & 255) == 0) timer_16384hz(); if((status.clock & 511) == 0) timer_8192hz(); if((status.clock & 1023) == 0) timer_4096hz(); ppu.clock -= clocks * ppu.frequency; if(ppu.clock < 0) co_switch(scheduler.active_thread = ppu.thread); apu.clock -= clocks * apu.frequency; if(apu.clock < 0) co_switch(scheduler.active_thread = apu.thread); } void CPU::timer_262144hz() { if(status.timer_enable && status.timer_clock == 1) { if(++status.tima == 0) { status.tima = status.tma; interrupt_raise(Interrupt::Timer); } } } void CPU::timer_65536hz() { if(status.timer_enable && status.timer_clock == 2) { if(++status.tima == 0) { status.tima = status.tma; interrupt_raise(Interrupt::Timer); } } } void CPU::timer_16384hz() { if(status.timer_enable && status.timer_clock == 3) { if(++status.tima == 0) { status.tima = status.tma; interrupt_raise(Interrupt::Timer); } } status.div++; } void CPU::timer_8192hz() { if(status.serial_transfer && status.serial_clock) { if(--status.serial_bits == 0) { status.serial_transfer = 0; interrupt_raise(Interrupt::Serial); } } } void CPU::timer_4096hz() { if(status.timer_enable && status.timer_clock == 0) { if(++status.tima == 0) { status.tima = status.tma; interrupt_raise(Interrupt::Timer); } } } void CPU::hblank() { if(status.dma_mode == 1 && status.dma_length && ppu.status.ly < 144) { for(unsigned n = 0; n < 16; n++) { dma_write(status.dma_target++, dma_read(status.dma_source++)); } add_clocks(8 << status.speed_double); status.dma_length -= 16; } } #endif gb/cartridge/mbc3/mbc3.cpp000664 001750 001750 00000005661 12651764221 016430 0ustar00sergiosergio000000 000000 #ifdef CARTRIDGE_CPP void Cartridge::MBC3::second() { if(rtc_halt == false) { if(++rtc_second >= 60) { rtc_second = 0; if(++rtc_minute >= 60) { rtc_minute = 0; if(++rtc_hour >= 24) { rtc_hour = 0; if(++rtc_day >= 512) { rtc_day = 0; rtc_day_carry = true; } } } } } } uint8 Cartridge::MBC3::mmio_read(uint16 addr) { if((addr & 0xc000) == 0x0000) { //$0000-3fff return cartridge.rom_read(addr); } if((addr & 0xc000) == 0x4000) { //$4000-7fff return cartridge.rom_read((rom_select << 14) | (addr & 0x3fff)); } if((addr & 0xe000) == 0xa000) { //$a000-bfff if(ram_enable) { if(ram_select >= 0x00 && ram_select <= 0x03) { return cartridge.ram_read((ram_select << 13) | (addr & 0x1fff)); } if(ram_select == 0x08) return rtc_latch_second; if(ram_select == 0x09) return rtc_latch_minute; if(ram_select == 0x0a) return rtc_latch_hour; if(ram_select == 0x0b) return rtc_latch_day; if(ram_select == 0x0c) return (rtc_latch_day_carry << 7) | (rtc_latch_day >> 8); } return 0x00; } return 0x00; } void Cartridge::MBC3::mmio_write(uint16 addr, uint8 data) { if((addr & 0xe000) == 0x0000) { //$0000-1fff ram_enable = (data & 0x0f) == 0x0a; return; } if((addr & 0xe000) == 0x2000) { //$2000-3fff rom_select = (data & 0x7f) + ((data & 0x7f) == 0); return; } if((addr & 0xe000) == 0x4000) { //$4000-5fff ram_select = data; return; } if((addr & 0xe000) == 0x6000) { //$6000-7fff if(rtc_latch == 0 && data == 1) { rtc_latch_second = rtc_second; rtc_latch_minute = rtc_minute; rtc_latch_hour = rtc_hour; rtc_latch_day = rtc_day; rtc_latch_day_carry = rtc_day_carry; } rtc_latch = data; return; } if((addr & 0xe000) == 0xa000) { //$a000-bfff if(ram_enable) { if(ram_select >= 0x00 && ram_select <= 0x03) { cartridge.ram_write((ram_select << 13) | (addr & 0x1fff), data); } else if(ram_select == 0x08) { if(data >= 60) data = 0; rtc_second = data; } else if(ram_select == 0x09) { if(data >= 60) data = 0; rtc_minute = data; } else if(ram_select == 0x0a) { if(data >= 24) data = 0; rtc_hour = data; } else if(ram_select == 0x0b) { rtc_day = (rtc_day & 0x0100) | data; } else if(ram_select == 0x0c) { rtc_day = ((data & 1) << 8) | (rtc_day & 0xff); rtc_halt = data & 0x40; rtc_day_carry = data & 0x80; } } return; } } void Cartridge::MBC3::power() { ram_enable = false; rom_select = 0x01; ram_select = 0x00; rtc_latch = 0; rtc_halt = true; rtc_second = 0; rtc_minute = 0; rtc_hour = 0; rtc_day = 0; rtc_day_carry = false; rtc_latch_second = 0; rtc_latch_minute = 0; rtc_latch_hour = 0; rtc_latch_day = 0; rtc_latch_day_carry = false; } #endif processor/r65816/r65816.hpp000664 001750 001750 00000014577 12651764221 016204 0ustar00sergiosergio000000 000000 #ifndef PROCESSOR_R65816_HPP #define PROCESSOR_R65816_HPP namespace Processor { //WDC 65C816 CPU core //* Ricoh 5A22 //* Nintendo SA-1 struct R65816 { #include "registers.hpp" #include "memory.hpp" #include "disassembler.hpp" regs_t regs; reg24_t aa, rd; uint8_t sp, dp; virtual void op_io() = 0; virtual uint8_t op_read(uint32_t addr) = 0; virtual void op_write(uint32_t addr, uint8_t data) = 0; virtual void last_cycle() = 0; virtual bool interrupt_pending() = 0; virtual void op_irq(); virtual uint8 disassembler_read(uint32 addr) { return 0u; } void op_io_irq(); void op_io_cond2(); void op_io_cond4(uint16 x, uint16 y); void op_io_cond6(uint16 addr); void op_adc_b(); void op_adc_w(); void op_and_b(); void op_and_w(); void op_bit_b(); void op_bit_w(); void op_cmp_b(); void op_cmp_w(); void op_cpx_b(); void op_cpx_w(); void op_cpy_b(); void op_cpy_w(); void op_eor_b(); void op_eor_w(); void op_lda_b(); void op_lda_w(); void op_ldx_b(); void op_ldx_w(); void op_ldy_b(); void op_ldy_w(); void op_ora_b(); void op_ora_w(); void op_sbc_b(); void op_sbc_w(); void op_inc_b(); void op_inc_w(); void op_dec_b(); void op_dec_w(); void op_asl_b(); void op_asl_w(); void op_lsr_b(); void op_lsr_w(); void op_rol_b(); void op_rol_w(); void op_ror_b(); void op_ror_w(); void op_trb_b(); void op_trb_w(); void op_tsb_b(); void op_tsb_w(); template void op_read_const_b(); template void op_read_const_w(); void op_read_bit_const_b(); void op_read_bit_const_w(); template void op_read_addr_b(); template void op_read_addr_w(); template void op_read_addrx_b(); template void op_read_addrx_w(); template void op_read_addry_b(); template void op_read_addry_w(); template void op_read_long_b(); template void op_read_long_w(); template void op_read_longx_b(); template void op_read_longx_w(); template void op_read_dp_b(); template void op_read_dp_w(); template void op_read_dpr_b(); template void op_read_dpr_w(); template void op_read_idp_b(); template void op_read_idp_w(); template void op_read_idpx_b(); template void op_read_idpx_w(); template void op_read_idpy_b(); template void op_read_idpy_w(); template void op_read_ildp_b(); template void op_read_ildp_w(); template void op_read_ildpy_b(); template void op_read_ildpy_w(); template void op_read_sr_b(); template void op_read_sr_w(); template void op_read_isry_b(); template void op_read_isry_w(); template void op_write_addr_b(); template void op_write_addr_w(); template void op_write_addrr_b(); template void op_write_addrr_w(); template void op_write_longr_b(); template void op_write_longr_w(); template void op_write_dp_b(); template void op_write_dp_w(); template void op_write_dpr_b(); template void op_write_dpr_w(); void op_sta_idp_b(); void op_sta_idp_w(); void op_sta_ildp_b(); void op_sta_ildp_w(); void op_sta_idpx_b(); void op_sta_idpx_w(); void op_sta_idpy_b(); void op_sta_idpy_w(); void op_sta_ildpy_b(); void op_sta_ildpy_w(); void op_sta_sr_b(); void op_sta_sr_w(); void op_sta_isry_b(); void op_sta_isry_w(); template void op_adjust_imm_b(); template void op_adjust_imm_w(); void op_asl_imm_b(); void op_asl_imm_w(); void op_lsr_imm_b(); void op_lsr_imm_w(); void op_rol_imm_b(); void op_rol_imm_w(); void op_ror_imm_b(); void op_ror_imm_w(); template void op_adjust_addr_b(); template void op_adjust_addr_w(); template void op_adjust_addrx_b(); template void op_adjust_addrx_w(); template void op_adjust_dp_b(); template void op_adjust_dp_w(); template void op_adjust_dpx_b(); template void op_adjust_dpx_w(); template void op_branch(); void op_bra(); void op_brl(); void op_jmp_addr(); void op_jmp_long(); void op_jmp_iaddr(); void op_jmp_iaddrx(); void op_jmp_iladdr(); void op_jsr_addr(); void op_jsr_long_e(); void op_jsr_long_n(); void op_jsr_iaddrx_e(); void op_jsr_iaddrx_n(); void op_rti_e(); void op_rti_n(); void op_rts(); void op_rtl_e(); void op_rtl_n(); void op_nop(); void op_wdm(); void op_xba(); template void op_move_b(); template void op_move_w(); template void op_interrupt_e(); template void op_interrupt_n(); void op_stp(); void op_wai(); void op_xce(); template void op_flag(); template void op_pflag_e(); template void op_pflag_n(); template void op_transfer_b(); template void op_transfer_w(); void op_tcs_e(); void op_tcs_n(); void op_tsx_b(); void op_tsx_w(); void op_txs_e(); void op_txs_n(); template void op_push_b(); template void op_push_w(); void op_phd_e(); void op_phd_n(); void op_phb(); void op_phk(); void op_php(); template void op_pull_b(); template void op_pull_w(); void op_pld_e(); void op_pld_n(); void op_plb(); void op_plp_e(); void op_plp_n(); void op_pea_e(); void op_pea_n(); void op_pei_e(); void op_pei_n(); void op_per_e(); void op_per_n(); void (R65816::**opcode_table)(); void (R65816::*op_table[5 * 256])(); void initialize_opcode_table(); void update_table(); enum { table_EM = 0, // 8-bit accumulator, 8-bit index (emulation mode) table_MX = 256, // 8-bit accumulator, 8-bit index table_Mx = 512, // 8-bit accumulator, 16-bit index table_mX = 768, //16-bit accumulator, 8-bit index table_mx = 1024, //16-bit accumulator, 16-bit index }; void serialize(serializer&); R65816(); }; } #endif sfc/profile-accuracy.hpp000664 001750 001750 00000000154 12651764221 016424 0ustar00sergiosergio000000 000000 #include #include #include #include ananke/heuristics/famicom.hpp000664 001750 001750 00000010231 12651764221 017450 0ustar00sergiosergio000000 000000 #ifndef NALL_EMULATION_FAMICOM_HPP #define NALL_EMULATION_FAMICOM_HPP #include #include namespace nall { struct FamicomCartridge { string markup; inline FamicomCartridge(const uint8_t *data, unsigned size); //private: unsigned mapper; unsigned mirror; unsigned prgrom; unsigned prgram; unsigned chrrom; unsigned chrram; }; FamicomCartridge::FamicomCartridge(const uint8_t *data, unsigned size) { markup = ""; if(size < 16) return; if(data[0] != 'N') return; if(data[1] != 'E') return; if(data[2] != 'S') return; if(data[3] != 26) return; mapper = ((data[7] >> 4) << 4) | (data[6] >> 4); mirror = ((data[6] & 0x08) >> 2) | (data[6] & 0x01); prgrom = data[4] * 0x4000; chrrom = data[5] * 0x2000; prgram = 0u; chrram = chrrom == 0u ? 8192u : 0u; markup.append("cartridge\n"); switch(mapper) { default: markup.append(" board type=NES-NROM-256\n"); markup.append(" mirror mode=", mirror == 0 ? "horizontal" : "vertical", "\n"); break; case 1: markup.append(" board type=NES-SXROM\n"); markup.append(" chip type=MMC1B2\n"); prgram = 8192; break; case 2: markup.append(" board type=NES-UOROM\n"); markup.append(" mirror mode=", mirror == 0 ? "horizontal" : "vertical", "\n"); break; case 3: markup.append(" board type=NES-CNROM\n"); markup.append(" mirror mode=", mirror == 0 ? "horizontal" : "vertical", "\n"); break; case 4: //MMC3 markup.append(" board type=NES-TLROM\n"); markup.append(" chip type=MMC3B\n"); prgram = 8192; //MMC6 //markup.append(" board type=NES-HKROM\n"); //markup.append(" chip type=MMC6n"); //prgram = 1024; break; case 5: markup.append(" board type=NES-ELROM\n"); markup.append(" chip type=MMC5\n"); prgram = 65536; break; case 7: markup.append(" board type=NES-AOROM\n"); break; case 9: markup.append(" board type=NES-PNROM\n"); markup.append(" chip type=MMC2\n"); prgram = 8192; break; case 10: markup.append(" board type=NES-FKROM\n"); markup.append(" chip type=MMC4\n"); prgram = 8192; break; case 16: markup.append(" board type=BANDAI-FCG\n"); markup.append(" chip type=LZ93D50\n"); break; case 21: case 23: case 25: //VRC4 markup.append(" board type=KONAMI-VRC-4\n"); markup.append(" chip type=VRC4\n"); markup.append(" pinout a0=1 a1=0\n"); prgram = 8192; break; case 22: //VRC2 markup.append(" board type=KONAMI-VRC-2\n"); markup.append(" chip type=VRC2\n"); markup.append(" pinout a0=0 a1=1\n"); break; case 24: markup.append(" board type=KONAMI-VRC-6\n"); markup.append(" chip type=VRC6\n"); break; case 26: markup.append(" board type=KONAMI-VRC-6\n"); markup.append(" chip type=VRC6\n"); prgram = 8192; break; case 34: markup.append(" board type=NES-BNROM\n"); markup.append(" mirror mode=", mirror == 0 ? "horizontal" : "vertical", "\n"); break; case 66: markup.append(" board type=NES-GNROM\n"); markup.append(" mirror mode=", mirror == 0 ? "horizontal" : "vertical", "\n"); break; case 69: markup.append(" board type=SUNSOFT-5B\n"); markup.append(" chip type=5B\n"); prgram = 8192; break; case 73: markup.append(" board type=KONAMI-VRC-3\n"); markup.append(" chip type=VRC3\n"); markup.append(" mirror mode=", mirror == 0 ? "horizontal" : "vertical", "\n"); prgram = 8192; break; case 75: markup.append(" board type=KONAMI-VRC-1\n"); markup.append(" chip type=VRC1\n"); break; case 85: markup.append(" board type=KONAMI-VRC-7\n"); markup.append(" chip type=VRC7\n"); prgram = 8192; break; } markup.append(" prg\n"); if(prgrom) markup.append(" rom name=program.rom size=0x", hex(prgrom), "\n"); if(prgram) markup.append(" ram name=save.ram size=0x", hex(prgram), "\n"); markup.append(" chr\n"); if(chrrom) markup.append(" rom name=character.rom size=0x", hex(chrrom), "\n"); if(chrram) markup.append(" ram size=0x", hex(chrram), "\n"); } } #endif nall/windows/000700 001750 001750 00000000000 12656700342 014313 5ustar00sergiosergio000000 000000 processor/arm/instructions-thumb.cpp000664 001750 001750 00000025462 12651764221 021104 0ustar00sergiosergio000000 000000 #ifdef PROCESSOR_ARM_HPP void ARM::thumb_step() { if(pipeline.reload) { pipeline.reload = false; r(15).data &= ~1; sequential() = false; pipeline.fetch.address = r(15) & ~1; pipeline.fetch.instruction = read(pipeline.fetch.address, Half); pipeline_step(); } pipeline_step(); if(processor.irqline && cpsr().i == 0) { vector(0x00000018, Processor::Mode::IRQ); r(14) += 2; return; } instructions++; if(trace) { print(disassemble_registers(), "\n"); print(disassemble_thumb_instruction(pipeline.execute.address), "\n"); } #define decode(pattern, execute) if( \ (instruction() & std::integral_constant::value) \ == std::integral_constant::value \ ) return thumb_op_ ## execute() decode("0001 10?? ???? ????", adjust_register); decode("0001 11?? ???? ????", adjust_immediate); decode("000? ???? ???? ????", shift_immediate); decode("001? ???? ???? ????", immediate); decode("0100 00?? ???? ????", alu); decode("0100 0111 0??? ?---", branch_exchange); decode("0100 01?? ???? ????", alu_hi); decode("0100 1??? ???? ????", load_literal); decode("0101 ???? ???? ????", move_register_offset); decode("0110 ???? ???? ????", move_word_immediate); decode("0111 ???? ???? ????", move_byte_immediate); decode("1000 ???? ???? ????", move_half_immediate); decode("1001 ???? ???? ????", move_stack); decode("1010 ???? ???? ????", add_register_hi); decode("1011 0000 ???? ????", adjust_stack); decode("1011 ?10? ???? ????", stack_multiple); decode("1100 ???? ???? ????", move_multiple); decode("1101 1111 ???? ????", software_interrupt); decode("1101 ???? ???? ????", branch_conditional); decode("1110 0??? ???? ????", branch_short); decode("1111 0??? ???? ????", branch_long_prefix); decode("1111 1??? ???? ????", branch_long_suffix); #undef decode crash = true; } void ARM::thumb_opcode(uint4 opcode, uint4 d, uint4 m) { switch(opcode) { case 0: r(d) = bit(r(d) & r(m)); break; //AND case 1: r(d) = bit(r(d) ^ r(m)); break; //EOR case 2: r(d) = bit(lsl(r(d), r(m))); break; //LSL case 3: r(d) = bit(lsr(r(d), r(m))); break; //LSR case 4: r(d) = bit(asr(r(d), r(m))); break; //ASR case 5: r(d) = add(r(d), r(m), cpsr().c); break; //ADC case 6: r(d) = sub(r(d), r(m), cpsr().c); break; //SBC case 7: r(d) = bit(ror(r(d), r(m))); break; //ROR case 8: bit(r(d) & r(m)); break; //TST case 9: r(d) = sub(0, r(m), 1); break; //NEG case 10: sub(r(d), r(m), 1); break; //CMP case 11: add(r(d), r(m), 0); break; //CMN case 12: r(d) = bit(r(d) | r(m)); break; //ORR case 13: r(d) = mul(0, r(d), r(m)); break; //MUL case 14: r(d) = bit(r(d) & ~r(m)); break; //BIC case 15: r(d) = bit(~r(m)); break; //MVN } } //(add,sub) rd,rn,rm //0001 10om mmnn nddd //o = opcode //m = rm //n = rn //d = rd void ARM::thumb_op_adjust_register() { uint1 opcode = instruction() >> 9; uint3 m = instruction() >> 6; uint3 n = instruction() >> 3; uint3 d = instruction() >> 0; switch(opcode) { case 0: r(d) = add(r(n), r(m), 0); break; case 1: r(d) = sub(r(n), r(m), 1); break; } } //(add,sub) rd,rn,#immediate //0001 11oi iinn nddd //o = opcode //i = immediate //n = rn //d = rd void ARM::thumb_op_adjust_immediate() { uint1 opcode = instruction() >> 9; uint3 immediate = instruction() >> 6; uint3 n = instruction() >> 3; uint3 d = instruction() >> 0; switch(opcode) { case 0: r(d) = add(r(n), immediate, 0); break; case 1: r(d) = sub(r(n), immediate, 1); break; } } //(lsl,lsr,asr) rd,rm,#immediate //000o oiii iimm mddd //o = opcode //i = immediate //m = rm //d = rd void ARM::thumb_op_shift_immediate() { uint2 opcode = instruction() >> 11; uint5 immediate = instruction() >> 6; uint3 m = instruction() >> 3; uint3 d = instruction() >> 0; switch(opcode) { case 0: r(d) = bit(lsl(r(m), immediate)); break; case 1: r(d) = bit(lsr(r(m), immediate == 0 ? 32u : (unsigned)immediate)); break; case 2: r(d) = bit(asr(r(m), immediate == 0 ? 32u : (unsigned)immediate)); break; } } //(mov,cmp,add,sub) (rd,rn),#immediate //001o orrr iiii iiii //o = opcode //r = (rd,rn) //i = immediate void ARM::thumb_op_immediate() { uint2 opcode = instruction() >> 11; uint3 d = instruction() >> 8; uint8 immediate = instruction(); switch(opcode) { case 0: r(d) = bit( immediate ); break; case 1: sub(r(d), immediate, 1); break; case 2: r(d) = add(r(d), immediate, 0); break; case 3: r(d) = sub(r(d), immediate, 1); break; } } //{opcode} rd,rm //0100 00oo oomm mddd //o = opcode //m = rm //d = rd void ARM::thumb_op_alu() { uint4 opcode = instruction() >> 6; uint3 m = instruction() >> 3; uint3 d = instruction(); thumb_opcode(opcode, d, m); } //bx rm //0100 0111 0mmm m--- //m = rm void ARM::thumb_op_branch_exchange() { uint4 m = instruction() >> 3; cpsr().t = r(m) & 1; r(15) = r(m); } //{opcode} rd,rm //0100 01oo DMmm mddd //o = opcode //M:m = rm //D:d = rd void ARM::thumb_op_alu_hi() { uint2 opcode = instruction() >> 8; uint4 m = instruction() >> 3; uint3 dl = instruction(); uint1 dh = instruction() >> 7; uint4 d = (dh << 3) + (dl << 0); switch(opcode) { case 0: r(d) = r(d) + r(m); break; //ADD (does not modify flags) case 1: sub(r(d), r(m), 1); break; //SUB case 2: r(d) = r(m); break; //MOV (does not modify flags) } } //ldr rd,[pc,#+/-offset] //0100 1ddd oooo oooo //d = rd //o = offset void ARM::thumb_op_load_literal() { uint3 d = instruction() >> 8; uint8 displacement = instruction(); unsigned rm = (r(15) & ~3) + displacement * 4; r(d) = load(rm, Word); } //(ld(r,s),str){b,h} rd,[rn,rm] //0101 ooom mmnn nddd //o = opcode //m = rm //n = rn //d = rd void ARM::thumb_op_move_register_offset() { uint3 opcode = instruction() >> 9; uint3 m = instruction() >> 6; uint3 n = instruction() >> 3; uint3 d = instruction() >> 0; switch(opcode) { case 0: store(r(n) + r(m), Word, r(d)); break; //STR case 1: store(r(n) + r(m), Half, r(d)); break; //STRH case 2: store(r(n) + r(m), Byte, r(d)); break; //STRB case 3: r(d) = (int8)load(r(n) + r(m), Byte); break; //LDSB case 4: r(d) = load(r(n) + r(m), Word); break; //LDR case 5: r(d) = load(r(n) + r(m), Half); break; //LDRH case 6: r(d) = load(r(n) + r(m), Byte); break; //LDRB case 7: r(d) = (int16)load(r(n) + r(m), Half); break; //LDSH } } //(ldr,str) rd,[rn,#offset] //0110 looo oonn nddd //l = load //o = offset //n = rn //d = rd void ARM::thumb_op_move_word_immediate() { uint1 l = instruction() >> 11; uint5 offset = instruction() >> 6; uint3 n = instruction() >> 3; uint3 d = instruction() >> 0; if(l == 1) r(d) = load(r(n) + offset * 4, Word); if(l == 0) store(r(n) + offset * 4, Word, r(d)); } //(ldr,str)b rd,[rn,#offset] //0111 looo oonn nddd //l = load //o = offset //n = rn //d = rd void ARM::thumb_op_move_byte_immediate() { uint1 l = instruction() >> 11; uint5 offset = instruction() >> 6; uint3 n = instruction() >> 3; uint3 d = instruction() >> 0; if(l == 1) r(d) = load(r(n) + offset, Byte); if(l == 0) store(r(n) + offset, Byte, r(d)); } //(ldr,str)h rd,[rn,#offset] //1000 looo oonn nddd //l = load //o = offset //n = rn //d = rd void ARM::thumb_op_move_half_immediate() { uint1 l = instruction() >> 11; uint5 offset = instruction() >> 6; uint3 n = instruction() >> 3; uint3 d = instruction() >> 0; if(l == 1) r(d) = load(r(n) + offset * 2, Half); if(l == 0) store(r(n) + offset * 2, Half, r(d)); } //(ldr,str) rd,[sp,#immediate] //1001 oddd iiii iiii //l = load //d = rd //i = immediate void ARM::thumb_op_move_stack() { uint1 l = instruction() >> 11; uint3 d = instruction() >> 8; uint8 immediate = instruction(); if(l == 1) r(d) = load(r(13) + immediate * 4, Word); if(l == 0) store(r(13) + immediate * 4, Word, r(d)); } //add rd,{pc,sp},#immediate //1010 sddd iiii iiii //s = sp (0 = pc) //d = rd //i = immediate void ARM::thumb_op_add_register_hi() { uint1 sp = instruction() >> 11; uint3 d = instruction() >> 8; uint8 immediate = instruction(); if(sp == 0) r(d) = (r(15) & ~2) + immediate * 4; if(sp == 1) r(d) = r(13) + immediate * 4; } //(add,sub) sp,#immediate //1011 0000 oiii iiii //o = opcode //i = immediate void ARM::thumb_op_adjust_stack() { uint1 opcode = instruction() >> 7; uint7 immediate = instruction(); if(opcode == 0) r(13) += immediate * 4; if(opcode == 1) r(13) -= immediate * 4; } //push {r...{,lr}} //pop {r...{,pc}} //1011 o10r llll llll //o = opcode (0 = push, 1 = pop) //r = push lr -or- pop pc //l = register list void ARM::thumb_op_stack_multiple() { uint1 l = instruction() >> 11; uint1 branch = instruction() >> 8; uint8 list = instruction(); uint32 sp = 0; if(l == 1) sp = r(13); if(l == 0) sp = r(13) - (bit::count(list) + branch) * 4; sequential() = false; for(unsigned m = 0; m < 8; m++) { if(list & (1 << m)) { if(l == 1) r(m) = read(sp, Word); //POP if(l == 0) write(sp, Word, r(m)); //PUSH sp += 4; } } if(branch) { //note: ARMv5+ POP sets cpsr().t if(l == 1) r(15) = read(sp, Word); //POP if(l == 0) write(sp, Word, r(14)); //PUSH sp += 4; } if(l == 1) idle(); if(l == 1) r(13) += (bit::count(list) + branch) * 4; if(l == 0) r(13) -= (bit::count(list) + branch) * 4; } //(ldmia,stmia) rn!,{r...} //1100 lnnn llll llll //l = load (0 = save) //n = rn //l = register list void ARM::thumb_op_move_multiple() { uint1 l = instruction() >> 11; uint3 n = instruction() >> 8; uint8 list = instruction(); sequential() = false; for(unsigned m = 0; m < 8; m++) { if(list & (1 << m)) { if(l == 1) r(m) = read(r(n), Word); //LDMIA if(l == 0) write(r(n), Word, r(m)); //STMIA r(n) += 4; } } if(l == 1) idle(); } //swi #immediate //1101 1111 iiii iiii //i = immediate void ARM::thumb_op_software_interrupt() { uint8 immediate = instruction(); vector(0x00000008, Processor::Mode::SVC); } //b{condition} //1101 cccc dddd dddd //c = condition //d = displacement void ARM::thumb_op_branch_conditional() { uint4 flagcondition = instruction() >> 8; int8 displacement = instruction(); if(condition(flagcondition) == false) return; r(15) = r(15) + displacement * 2; } //b address //1110 0ooo oooo oooo //o = offset void ARM::thumb_op_branch_short() { int11 displacement = instruction(); r(15) += displacement * 2; } //bl address //1111 0ooo oooo oooo //o = offset void ARM::thumb_op_branch_long_prefix() { int11 offsethi = instruction(); r(14) = r(15) + ((offsethi * 2) << 11); } //bl address //1111 1ooo oooo oooo //o = offset void ARM::thumb_op_branch_long_suffix() { uint11 offsetlo = instruction(); r(15) = r(14) + (offsetlo * 2); r(14) = pipeline.decode.address | 1; } #endif sfc/profile-performance.hpp000664 001750 001750 00000000351 12651764221 017132 0ustar00sergiosergio000000 000000 #if defined(DEBUGGER) #error "bsnes: debugger not supported with performance profile." #endif #include #include #include #include ananke/archive.cpp000664 001750 001750 00000001537 12651764221 015300 0ustar00sergiosergio000000 000000 vector Ananke::extractROM() { unzip archive; if(archive.open(information.archive)) { for(auto& file : archive.file) { if(file.name.endsWith(".fc") || file.name.endsWith(".nes") || file.name.endsWith(".sfc") || file.name.endsWith(".smc") || file.name.endsWith(".st") || file.name.endsWith(".bs") || file.name.endsWith(".gb") || file.name.endsWith(".gbc") || file.name.endsWith(".gba") ) { information.name = notdir(file.name); return archive.extract(file); } } } return vector(); } vector Ananke::extractFile(const string& filename) { unzip archive; if(archive.open(information.archive)) { for(auto& file : archive.file) { if(notdir(file.name) == filename) { return archive.extract(file); } } } return vector(); } sfc/alt/ppu-balanced/memory/memory.cpp000664 001750 001750 00000007277 12651764221 021137 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP void PPU::latch_counters() { regs.hcounter = cpu.hdot(); regs.vcounter = cpu.vcounter(); regs.counters_latched = true; } uint16 PPU::get_vram_address() { uint16 addr = regs.vram_addr; switch(regs.vram_mapping) { case 0: break; //direct mapping case 1: addr = (addr & 0xff00) | ((addr & 0x001f) << 3) | ((addr >> 5) & 7); break; case 2: addr = (addr & 0xfe00) | ((addr & 0x003f) << 3) | ((addr >> 6) & 7); break; case 3: addr = (addr & 0xfc00) | ((addr & 0x007f) << 3) | ((addr >> 7) & 7); break; } return (addr << 1); } //NOTE: all VRAM writes during active display are invalid. Unlike OAM and CGRAM, they will //not be written anywhere at all. The below address ranges for where writes are invalid have //been validated on hardware, as has the edge case where the S-CPU MDR can be written if the //write occurs during the very last clock cycle of vblank. uint8 PPU::vram_mmio_read(uint16 addr) { uint8 data; if(regs.display_disabled == true) { data = vram[addr]; } else { uint16 v = cpu.vcounter(); uint16 h = cpu.hcounter(); uint16 ls = ((system.region() == System::Region::NTSC ? 525 : 625) >> 1) - 1; if(interlace() && !cpu.field()) ls++; if(v == ls && h == 1362) { data = 0x00; } else if(v < (!overscan() ? 224 : 239)) { data = 0x00; } else if(v == (!overscan() ? 224 : 239)) { if(h == 1362) { data = vram[addr]; } else { data = 0x00; } } else { data = vram[addr]; } } return data; } void PPU::vram_mmio_write(uint16 addr, uint8 data) { if(regs.display_disabled == true) { vram[addr] = data; } else { uint16 v = cpu.vcounter(); uint16 h = cpu.hcounter(); if(v == 0) { if(h <= 4) { vram[addr] = data; } else if(h == 6) { vram[addr] = cpu.regs.mdr; } else { //no write } } else if(v < (!overscan() ? 225 : 240)) { //no write } else if(v == (!overscan() ? 225 : 240)) { if(h <= 4) { //no write } else { vram[addr] = data; } } else { vram[addr] = data; } } } uint8 PPU::oam_mmio_read(uint16 addr) { addr &= 0x03ff; if(addr & 0x0200) addr &= 0x021f; uint8 data; if(regs.display_disabled == true) { data = oam[addr]; } else { if(cpu.vcounter() < (!overscan() ? 225 : 240)) { data = oam[regs.ioamaddr]; } else { data = oam[addr]; } } return data; } void PPU::oam_mmio_write(uint16 addr, uint8 data) { addr &= 0x03ff; if(addr & 0x0200) addr &= 0x021f; sprite_list_valid = false; if(regs.display_disabled == true) { oam[addr] = data; update_sprite_list(addr, data); } else { if(cpu.vcounter() < (!overscan() ? 225 : 240)) { oam[regs.ioamaddr] = data; update_sprite_list(regs.ioamaddr, data); } else { oam[addr] = data; update_sprite_list(addr, data); } } } uint8 PPU::cgram_mmio_read(uint16 addr) { addr &= 0x01ff; uint8 data; if(1 || regs.display_disabled == true) { data = cgram[addr]; } else { uint16 v = cpu.vcounter(); uint16 h = cpu.hcounter(); if(v < (!overscan() ? 225 : 240) && h >= 128 && h < 1096) { data = cgram[regs.icgramaddr] & 0x7f; } else { data = cgram[addr]; } } if(addr & 1) data &= 0x7f; return data; } void PPU::cgram_mmio_write(uint16 addr, uint8 data) { addr &= 0x01ff; if(addr & 1) data &= 0x7f; if(1 || regs.display_disabled == true) { cgram[addr] = data; } else { uint16 v = cpu.vcounter(); uint16 h = cpu.hcounter(); if(v < (!overscan() ? 225 : 240) && h >= 128 && h < 1096) { cgram[regs.icgramaddr] = data & 0x7f; } else { cgram[addr] = data; } } } #endif sfc/chip/sa1/mmio/mmio.cpp000664 001750 001750 00000036720 12651764221 016510 0ustar00sergiosergio000000 000000 #ifdef SA1_CPP //(CCNT) SA-1 control void SA1::mmio_w2200(uint8 data) { if(mmio.sa1_resb && !(data & 0x80)) { //reset SA-1 CPU regs.pc.w = mmio.crv; regs.pc.b = 0x00; } mmio.sa1_irq = (data & 0x80); mmio.sa1_rdyb = (data & 0x40); mmio.sa1_resb = (data & 0x20); mmio.sa1_nmi = (data & 0x10); mmio.smeg = (data & 0x0f); if(mmio.sa1_irq) { mmio.sa1_irqfl = true; if(mmio.sa1_irqen) mmio.sa1_irqcl = 0; } if(mmio.sa1_nmi) { mmio.sa1_nmifl = true; if(mmio.sa1_nmien) mmio.sa1_nmicl = 0; } } //(SIE) S-CPU interrupt enable void SA1::mmio_w2201(uint8 data) { if(!mmio.cpu_irqen && (data & 0x80)) { if(mmio.cpu_irqfl) { mmio.cpu_irqcl = 0; cpu.regs.irq = 1; } } if(!mmio.chdma_irqen && (data & 0x20)) { if(mmio.chdma_irqfl) { mmio.chdma_irqcl = 0; cpu.regs.irq = 1; } } mmio.cpu_irqen = (data & 0x80); mmio.chdma_irqen = (data & 0x20); } //(SIC) S-CPU interrupt clear void SA1::mmio_w2202(uint8 data) { mmio.cpu_irqcl = (data & 0x80); mmio.chdma_irqcl = (data & 0x20); if(mmio.cpu_irqcl ) mmio.cpu_irqfl = false; if(mmio.chdma_irqcl) mmio.chdma_irqfl = false; if(!mmio.cpu_irqfl && !mmio.chdma_irqfl) cpu.regs.irq = 0; } //(CRV) SA-1 reset vector void SA1::mmio_w2203(uint8 data) { mmio.crv = (mmio.crv & 0xff00) | data; } void SA1::mmio_w2204(uint8 data) { mmio.crv = (data << 8) | (mmio.crv & 0xff); } //(CNV) SA-1 NMI vector void SA1::mmio_w2205(uint8 data) { mmio.cnv = (mmio.cnv & 0xff00) | data; } void SA1::mmio_w2206(uint8 data) { mmio.cnv = (data << 8) | (mmio.cnv & 0xff); } //(CIV) SA-1 IRQ vector void SA1::mmio_w2207(uint8 data) { mmio.civ = (mmio.civ & 0xff00) | data; } void SA1::mmio_w2208(uint8 data) { mmio.civ = (data << 8) | (mmio.civ & 0xff); } //(SCNT) S-CPU control void SA1::mmio_w2209(uint8 data) { mmio.cpu_irq = (data & 0x80); mmio.cpu_ivsw = (data & 0x40); mmio.cpu_nvsw = (data & 0x10); mmio.cmeg = (data & 0x0f); if(mmio.cpu_irq) { mmio.cpu_irqfl = true; if(mmio.cpu_irqen) { mmio.cpu_irqcl = 0; cpu.regs.irq = 1; } } } //(CIE) SA-1 interrupt enable void SA1::mmio_w220a(uint8 data) { if(!mmio.sa1_irqen && (data & 0x80) && mmio.sa1_irqfl ) mmio.sa1_irqcl = 0; if(!mmio.timer_irqen && (data & 0x40) && mmio.timer_irqfl) mmio.timer_irqcl = 0; if(!mmio.dma_irqen && (data & 0x20) && mmio.dma_irqfl ) mmio.dma_irqcl = 0; if(!mmio.sa1_nmien && (data & 0x10) && mmio.sa1_nmifl ) mmio.sa1_nmicl = 0; mmio.sa1_irqen = (data & 0x80); mmio.timer_irqen = (data & 0x40); mmio.dma_irqen = (data & 0x20); mmio.sa1_nmien = (data & 0x10); } //(CIC) SA-1 interrupt clear void SA1::mmio_w220b(uint8 data) { mmio.sa1_irqcl = (data & 0x80); mmio.timer_irqcl = (data & 0x40); mmio.dma_irqcl = (data & 0x20); mmio.sa1_nmicl = (data & 0x10); if(mmio.sa1_irqcl) mmio.sa1_irqfl = false; if(mmio.timer_irqcl) mmio.timer_irqfl = false; if(mmio.dma_irqcl) mmio.dma_irqfl = false; if(mmio.sa1_nmicl) mmio.sa1_nmifl = false; } //(SNV) S-CPU NMI vector void SA1::mmio_w220c(uint8 data) { mmio.snv = (mmio.snv & 0xff00) | data; } void SA1::mmio_w220d(uint8 data) { mmio.snv = (data << 8) | (mmio.snv & 0xff); } //(SIV) S-CPU IRQ vector void SA1::mmio_w220e(uint8 data) { mmio.siv = (mmio.siv & 0xff00) | data; } void SA1::mmio_w220f(uint8 data) { mmio.siv = (data << 8) | (mmio.siv & 0xff); } //(TMC) H/V timer control void SA1::mmio_w2210(uint8 data) { mmio.hvselb = (data & 0x80); mmio.ven = (data & 0x02); mmio.hen = (data & 0x01); } //(CTR) SA-1 timer restart void SA1::mmio_w2211(uint8 data) { status.vcounter = 0; status.hcounter = 0; } //(HCNT) H-count void SA1::mmio_w2212(uint8 data) { mmio.hcnt = (mmio.hcnt & 0xff00) | (data << 0); } void SA1::mmio_w2213(uint8 data) { mmio.hcnt = (mmio.hcnt & 0x00ff) | (data << 8); } //(VCNT) V-count void SA1::mmio_w2214(uint8 data) { mmio.vcnt = (mmio.vcnt & 0xff00) | (data << 0); } void SA1::mmio_w2215(uint8 data) { mmio.vcnt = (mmio.vcnt & 0x00ff) | (data << 8); } //(CXB) Super MMC bank C void SA1::mmio_w2220(uint8 data) { mmio.cbmode = (data & 0x80); mmio.cb = (data & 0x07); } //(DXB) Super MMC bank D void SA1::mmio_w2221(uint8 data) { mmio.dbmode = (data & 0x80); mmio.db = (data & 0x07); } //(EXB) Super MMC bank E void SA1::mmio_w2222(uint8 data) { mmio.ebmode = (data & 0x80); mmio.eb = (data & 0x07); } //(FXB) Super MMC bank F void SA1::mmio_w2223(uint8 data) { mmio.fbmode = (data & 0x80); mmio.fb = (data & 0x07); } //(BMAPS) S-CPU BW-RAM address mapping void SA1::mmio_w2224(uint8 data) { mmio.sbm = (data & 0x1f); } //(BMAP) SA-1 BW-RAM address mapping void SA1::mmio_w2225(uint8 data) { mmio.sw46 = (data & 0x80); mmio.cbm = (data & 0x7f); } //(SWBE) S-CPU BW-RAM write enable void SA1::mmio_w2226(uint8 data) { mmio.swen = (data & 0x80); } //(CWBE) SA-1 BW-RAM write enable void SA1::mmio_w2227(uint8 data) { mmio.cwen = (data & 0x80); } //(BWPA) BW-RAM write-protected area void SA1::mmio_w2228(uint8 data) { mmio.bwp = (data & 0x0f); } //(SIWP) S-CPU I-RAM write protection void SA1::mmio_w2229(uint8 data) { mmio.siwp = data; } //(CIWP) SA-1 I-RAM write protection void SA1::mmio_w222a(uint8 data) { mmio.ciwp = data; } //(DCNT) DMA control void SA1::mmio_w2230(uint8 data) { mmio.dmaen = (data & 0x80); mmio.dprio = (data & 0x40); mmio.cden = (data & 0x20); mmio.cdsel = (data & 0x10); mmio.dd = (data & 0x04); mmio.sd = (data & 0x03); if(mmio.dmaen == 0) dma.line = 0; } //(CDMA) character conversion DMA parameters void SA1::mmio_w2231(uint8 data) { mmio.chdend = (data & 0x80); mmio.dmasize = (data >> 2) & 7; mmio.dmacb = (data & 0x03); if(mmio.chdend) cpubwram.dma = false; if(mmio.dmasize > 5) mmio.dmasize = 5; if(mmio.dmacb > 2) mmio.dmacb = 2; } //(SDA) DMA source device start address void SA1::mmio_w2232(uint8 data) { mmio.dsa = (mmio.dsa & 0xffff00) | (data << 0); } void SA1::mmio_w2233(uint8 data) { mmio.dsa = (mmio.dsa & 0xff00ff) | (data << 8); } void SA1::mmio_w2234(uint8 data) { mmio.dsa = (mmio.dsa & 0x00ffff) | (data << 16); } //(DDA) DMA destination start address void SA1::mmio_w2235(uint8 data) { mmio.dda = (mmio.dda & 0xffff00) | (data << 0); } void SA1::mmio_w2236(uint8 data) { mmio.dda = (mmio.dda & 0xff00ff) | (data << 8); if(mmio.dmaen == true) { if(mmio.cden == 0 && mmio.dd == DMA::DestIRAM) { dma_normal(); } else if(mmio.cden == 1 && mmio.cdsel == 1) { dma_cc1(); } } } void SA1::mmio_w2237(uint8 data) { mmio.dda = (mmio.dda & 0x00ffff) | (data << 16); if(mmio.dmaen == true) { if(mmio.cden == 0 && mmio.dd == DMA::DestBWRAM) { dma_normal(); } } } //(DTC) DMA terminal counter void SA1::mmio_w2238(uint8 data) { mmio.dtc = (mmio.dtc & 0xff00) | (data << 0); } void SA1::mmio_w2239(uint8 data) { mmio.dtc = (mmio.dtc & 0x00ff) | (data << 8); } //(BBF) BW-RAM bitmap format void SA1::mmio_w223f(uint8 data) { mmio.bbf = (data & 0x80); } //(BRF) bitmap register files void SA1::mmio_w2240(uint8 data) { mmio.brf[ 0] = data; } void SA1::mmio_w2241(uint8 data) { mmio.brf[ 1] = data; } void SA1::mmio_w2242(uint8 data) { mmio.brf[ 2] = data; } void SA1::mmio_w2243(uint8 data) { mmio.brf[ 3] = data; } void SA1::mmio_w2244(uint8 data) { mmio.brf[ 4] = data; } void SA1::mmio_w2245(uint8 data) { mmio.brf[ 5] = data; } void SA1::mmio_w2246(uint8 data) { mmio.brf[ 6] = data; } void SA1::mmio_w2247(uint8 data) { mmio.brf[ 7] = data; if(mmio.dmaen == true) { if(mmio.cden == 1 && mmio.cdsel == 0) { dma_cc2(); } } } void SA1::mmio_w2248(uint8 data) { mmio.brf[ 8] = data; } void SA1::mmio_w2249(uint8 data) { mmio.brf[ 9] = data; } void SA1::mmio_w224a(uint8 data) { mmio.brf[10] = data; } void SA1::mmio_w224b(uint8 data) { mmio.brf[11] = data; } void SA1::mmio_w224c(uint8 data) { mmio.brf[12] = data; } void SA1::mmio_w224d(uint8 data) { mmio.brf[13] = data; } void SA1::mmio_w224e(uint8 data) { mmio.brf[14] = data; } void SA1::mmio_w224f(uint8 data) { mmio.brf[15] = data; if(mmio.dmaen == true) { if(mmio.cden == 1 && mmio.cdsel == 0) { dma_cc2(); } } } //(MCNT) arithmetic control void SA1::mmio_w2250(uint8 data) { mmio.acm = (data & 0x02); mmio.md = (data & 0x01); if(mmio.acm) mmio.mr = 0; } //(MAL) multiplicand / dividend low void SA1::mmio_w2251(uint8 data) { mmio.ma = (mmio.ma & 0xff00) | data; } //(MAH) multiplicand / dividend high void SA1::mmio_w2252(uint8 data) { mmio.ma = (data << 8) | (mmio.ma & 0x00ff); } //(MBL) multiplier / divisor low void SA1::mmio_w2253(uint8 data) { mmio.mb = (mmio.mb & 0xff00) | data; } //(MBH) multiplier / divisor high //multiplication / cumulative sum only resets MB //division resets both MA and MB void SA1::mmio_w2254(uint8 data) { mmio.mb = (data << 8) | (mmio.mb & 0x00ff); if(mmio.acm == 0) { if(mmio.md == 0) { //signed multiplication mmio.mr = (int16)mmio.ma * (int16)mmio.mb; mmio.mb = 0; } else { //unsigned division if(mmio.mb == 0) { mmio.mr = 0; } else { int16 quotient = (int16)mmio.ma / (uint16)mmio.mb; uint16 remainder = (int16)mmio.ma % (uint16)mmio.mb; mmio.mr = (remainder << 16) | quotient; } mmio.ma = 0; mmio.mb = 0; } } else { //sigma (accumulative multiplication) mmio.mr += (int16)mmio.ma * (int16)mmio.mb; mmio.overflow = (mmio.mr >= (1ULL << 40)); mmio.mr &= (1ULL << 40) - 1; mmio.mb = 0; } } //(VBD) variable-length bit processing void SA1::mmio_w2258(uint8 data) { mmio.hl = (data & 0x80); mmio.vb = (data & 0x0f); if(mmio.vb == 0) mmio.vb = 16; if(mmio.hl == 0) { //fixed mode mmio.vbit += mmio.vb; mmio.va += (mmio.vbit >> 3); mmio.vbit &= 7; } } //(VDA) variable-length bit game pak ROM start address void SA1::mmio_w2259(uint8 data) { mmio.va = (mmio.va & 0xffff00) | (data << 0); } void SA1::mmio_w225a(uint8 data) { mmio.va = (mmio.va & 0xff00ff) | (data << 8); } void SA1::mmio_w225b(uint8 data) { mmio.va = (mmio.va & 0x00ffff) | (data << 16); mmio.vbit = 0; } //(SFR) S-CPU flag read uint8 SA1::mmio_r2300() { uint8 data; data = mmio.cpu_irqfl << 7; data |= mmio.cpu_ivsw << 6; data |= mmio.chdma_irqfl << 5; data |= mmio.cpu_nvsw << 4; data |= mmio.cmeg; return data; } //(CFR) SA-1 flag read uint8 SA1::mmio_r2301() { uint8 data; data = mmio.sa1_irqfl << 7; data |= mmio.timer_irqfl << 6; data |= mmio.dma_irqfl << 5; data |= mmio.sa1_nmifl << 4; data |= mmio.smeg; return data; } //(HCR) hcounter read uint8 SA1::mmio_r2302() { //latch counters mmio.hcr = status.hcounter >> 2; mmio.vcr = status.vcounter; return mmio.hcr >> 0; } uint8 SA1::mmio_r2303() { return mmio.hcr >> 8; } //(VCR) vcounter read uint8 SA1::mmio_r2304() { return mmio.vcr >> 0; } uint8 SA1::mmio_r2305() { return mmio.vcr >> 8; } //(MR) arithmetic result uint8 SA1::mmio_r2306() { return mmio.mr >> 0; } uint8 SA1::mmio_r2307() { return mmio.mr >> 8; } uint8 SA1::mmio_r2308() { return mmio.mr >> 16; } uint8 SA1::mmio_r2309() { return mmio.mr >> 24; } uint8 SA1::mmio_r230a() { return mmio.mr >> 32; } //(OF) arithmetic overflow flag uint8 SA1::mmio_r230b() { return mmio.overflow << 7; } //(VDPL) variable-length data read port low uint8 SA1::mmio_r230c() { uint32 data = (vbr_read(mmio.va + 0) << 0) | (vbr_read(mmio.va + 1) << 8) | (vbr_read(mmio.va + 2) << 16); data >>= mmio.vbit; return data >> 0; } //(VDPH) variable-length data read port high uint8 SA1::mmio_r230d() { uint32 data = (vbr_read(mmio.va + 0) << 0) | (vbr_read(mmio.va + 1) << 8) | (vbr_read(mmio.va + 2) << 16); data >>= mmio.vbit; if(mmio.hl == 1) { //auto-increment mode mmio.vbit += mmio.vb; mmio.va += (mmio.vbit >> 3); mmio.vbit &= 7; } return data >> 8; } //(VC) version code register uint8 SA1::mmio_r230e() { return 0x01; //true value unknown } uint8 SA1::mmio_read(unsigned addr) { (co_active() == cpu.thread ? cpu.synchronize_coprocessors() : synchronize_cpu()); addr &= 0xffff; switch(addr) { case 0x2300: return mmio_r2300(); case 0x2301: return mmio_r2301(); case 0x2302: return mmio_r2302(); case 0x2303: return mmio_r2303(); case 0x2304: return mmio_r2304(); case 0x2305: return mmio_r2305(); case 0x2306: return mmio_r2306(); case 0x2307: return mmio_r2307(); case 0x2308: return mmio_r2308(); case 0x2309: return mmio_r2309(); case 0x230a: return mmio_r230a(); case 0x230b: return mmio_r230b(); case 0x230c: return mmio_r230c(); case 0x230d: return mmio_r230d(); case 0x230e: return mmio_r230e(); } return 0x00; } void SA1::mmio_write(unsigned addr, uint8 data) { (co_active() == cpu.thread ? cpu.synchronize_coprocessors() : synchronize_cpu()); addr &= 0xffff; switch(addr) { case 0x2200: return mmio_w2200(data); case 0x2201: return mmio_w2201(data); case 0x2202: return mmio_w2202(data); case 0x2203: return mmio_w2203(data); case 0x2204: return mmio_w2204(data); case 0x2205: return mmio_w2205(data); case 0x2206: return mmio_w2206(data); case 0x2207: return mmio_w2207(data); case 0x2208: return mmio_w2208(data); case 0x2209: return mmio_w2209(data); case 0x220a: return mmio_w220a(data); case 0x220b: return mmio_w220b(data); case 0x220c: return mmio_w220c(data); case 0x220d: return mmio_w220d(data); case 0x220e: return mmio_w220e(data); case 0x220f: return mmio_w220f(data); case 0x2210: return mmio_w2210(data); case 0x2211: return mmio_w2211(data); case 0x2212: return mmio_w2212(data); case 0x2213: return mmio_w2213(data); case 0x2214: return mmio_w2214(data); case 0x2215: return mmio_w2215(data); case 0x2220: return mmio_w2220(data); case 0x2221: return mmio_w2221(data); case 0x2222: return mmio_w2222(data); case 0x2223: return mmio_w2223(data); case 0x2224: return mmio_w2224(data); case 0x2225: return mmio_w2225(data); case 0x2226: return mmio_w2226(data); case 0x2227: return mmio_w2227(data); case 0x2228: return mmio_w2228(data); case 0x2229: return mmio_w2229(data); case 0x222a: return mmio_w222a(data); case 0x2230: return mmio_w2230(data); case 0x2231: return mmio_w2231(data); case 0x2232: return mmio_w2232(data); case 0x2233: return mmio_w2233(data); case 0x2234: return mmio_w2234(data); case 0x2235: return mmio_w2235(data); case 0x2236: return mmio_w2236(data); case 0x2237: return mmio_w2237(data); case 0x2238: return mmio_w2238(data); case 0x2239: return mmio_w2239(data); case 0x223f: return mmio_w223f(data); case 0x2240: return mmio_w2240(data); case 0x2241: return mmio_w2241(data); case 0x2242: return mmio_w2242(data); case 0x2243: return mmio_w2243(data); case 0x2244: return mmio_w2244(data); case 0x2245: return mmio_w2245(data); case 0x2246: return mmio_w2246(data); case 0x2247: return mmio_w2247(data); case 0x2248: return mmio_w2248(data); case 0x2249: return mmio_w2249(data); case 0x224a: return mmio_w224a(data); case 0x224b: return mmio_w224b(data); case 0x224c: return mmio_w224c(data); case 0x224d: return mmio_w224d(data); case 0x224e: return mmio_w224e(data); case 0x224f: return mmio_w224f(data); case 0x2250: return mmio_w2250(data); case 0x2251: return mmio_w2251(data); case 0x2252: return mmio_w2252(data); case 0x2253: return mmio_w2253(data); case 0x2254: return mmio_w2254(data); case 0x2258: return mmio_w2258(data); case 0x2259: return mmio_w2259(data); case 0x225a: return mmio_w225a(data); case 0x225b: return mmio_w225b(data); } } #endif gba/ppu/background.cpp000664 001750 001750 00000011606 12651764221 016074 0ustar00sergiosergio000000 000000 void PPU::render_backgrounds() { switch(regs.control.bgmode) { case 0: render_background_linear(regs.bg[3]); render_background_linear(regs.bg[2]); render_background_linear(regs.bg[1]); render_background_linear(regs.bg[0]); break; case 1: render_background_affine(regs.bg[2]); render_background_linear(regs.bg[1]); render_background_linear(regs.bg[0]); break; case 2: render_background_affine(regs.bg[3]); render_background_affine(regs.bg[2]); break; case 3: case 4: case 5: render_background_bitmap(regs.bg[2]); break; } } void PPU::render_background_linear(Registers::Background& bg) { if(regs.control.enable[bg.id] == false) return; auto& output = layer[bg.id]; if(bg.control.mosaic == false || (regs.vcounter % (1 + regs.mosaic.bgvsize)) == 0) { bg.vmosaic = regs.vcounter; } uint9 voffset = bg.vmosaic + bg.voffset; uint9 hoffset = bg.hoffset; unsigned basemap = bg.control.screenbaseblock << 11; unsigned basechr = bg.control.characterbaseblock << 14; unsigned px = hoffset & 7, py = voffset & 7; Tile tile; uint8 data[8]; for(unsigned x = 0; x < 240; x++) { if(x == 0 || px & 8) { px &= 7; unsigned tx = hoffset / 8, ty = voffset / 8; unsigned offset = (ty & 31) * 32 + (tx & 31); if(bg.control.screensize & 1) if(tx & 32) offset += 32 * 32; if(bg.control.screensize & 2) if(ty & 32) offset += 32 * 32 * (1 + (bg.control.screensize & 1)); offset = basemap + offset * 2; uint16 mapdata = vram_read(offset, Half); tile.character = mapdata >> 0; tile.hflip = mapdata >> 10; tile.vflip = mapdata >> 11; tile.palette = mapdata >> 12; if(bg.control.colormode == 0) { offset = basechr + tile.character * 32 + (py ^ (tile.vflip ? 7 : 0)) * 4; uint32 word = vram_read(offset, Word); for(unsigned n = 0; n < 8; n++) data[n] = (word >> (n * 4)) & 15; } else { offset = basechr + tile.character * 64 + (py ^ (tile.vflip ? 7 : 0)) * 8; uint32 wordlo = vram_read(offset + 0, Word); uint32 wordhi = vram_read(offset + 4, Word); for(unsigned n = 0; n < 4; n++) data[0 + n] = (wordlo >> (n * 8)) & 255; for(unsigned n = 0; n < 4; n++) data[4 + n] = (wordhi >> (n * 8)) & 255; } } hoffset++; uint8 color = data[px++ ^ (tile.hflip ? 7 : 0)]; if(color) { if(bg.control.colormode == 0) output[x].write(true, bg.control.priority, pram[tile.palette * 16 + color]); if(bg.control.colormode == 1) output[x].write(true, bg.control.priority, pram[color]); } } } void PPU::render_background_affine(Registers::Background& bg) { if(regs.control.enable[bg.id] == false) return; auto& output = layer[bg.id]; unsigned basemap = bg.control.screenbaseblock << 11; unsigned basechr = bg.control.characterbaseblock << 14; unsigned screensize = 16 << bg.control.screensize; unsigned screenwrap = (1 << (bg.control.affinewrap ? 7 + bg.control.screensize : 20)) - 1; if(bg.control.mosaic == false || (regs.vcounter % (1 + regs.mosaic.bgvsize)) == 0) { bg.hmosaic = bg.lx; bg.vmosaic = bg.ly; } int28 fx = bg.hmosaic; int28 fy = bg.vmosaic; for(unsigned x = 0; x < 240; x++) { unsigned cx = (fx >> 8) & screenwrap, tx = cx / 8, px = cx & 7; unsigned cy = (fy >> 8) & screenwrap, ty = cy / 8, py = cy & 7; if(tx < screensize && ty < screensize) { uint8 character = vram[basemap + ty * screensize + tx]; uint8 color = vram[basechr + (character * 64) + py * 8 + px]; if(color) output[x].write(true, bg.control.priority, pram[color]); } fx += bg.pa; fy += bg.pc; } bg.lx += bg.pb; bg.ly += bg.pd; } void PPU::render_background_bitmap(Registers::Background& bg) { if(regs.control.enable[bg.id] == false) return; auto& output = layer[bg.id]; uint1 depth = regs.control.bgmode != 4; //0 = 8-bit (Mode 4), 1 = 15-bit (Mode 3, Mode 5) unsigned basemap = regs.control.bgmode == 3 ? 0 : 0xa000 * regs.control.frame; unsigned width = regs.control.bgmode == 5 ? 160 : 240; unsigned height = regs.control.bgmode == 5 ? 128 : 160; unsigned size = depth ? Half : Byte; if(bg.control.mosaic == false || (regs.vcounter % (1 + regs.mosaic.bgvsize)) == 0) { bg.hmosaic = bg.lx; bg.vmosaic = bg.ly; } int28 fx = bg.hmosaic; int28 fy = bg.vmosaic; for(unsigned x = 0; x < 240; x++) { unsigned px = fx >> 8; unsigned py = fy >> 8; if(px < width && py < height) { unsigned offset = py * width + px; unsigned color = vram_read(basemap + (offset << depth), size); if(depth || color) { //8bpp color 0 is transparent; 15bpp color is always opaque if(depth == 0) color = pram[color]; if(depth == 1) color = color & 0x7fff; output[x].write(true, bg.control.priority, color); } } fx += bg.pa; fy += bg.pc; } bg.lx += bg.pb; bg.ly += bg.pd; } target-ethos/general/000700 001750 001750 00000000000 12656700342 015716 5ustar00sergiosergio000000 000000 sfc/alt/smp/core/op_pc.b000664 001750 001750 00000006072 12651764221 016242 0ustar00sergiosergio000000 000000 bra(0x2f, 0), beq(0xf0, !regs.p.z), bne(0xd0, regs.p.z), bcs(0xb0, !regs.p.c), bcc(0x90, regs.p.c), bvs(0x70, !regs.p.v), bvc(0x50, regs.p.v), bmi(0x30, !regs.p.n), bpl(0x10, regs.p.n) { 1:rd = op_readpc(); if($1)end; 2:op_io(); 3:op_io(); regs.pc += (int8)rd; } bbs0(0x03, 0x01, !=), bbc0(0x13, 0x01, ==), bbs1(0x23, 0x02, !=), bbc1(0x33, 0x02, ==), bbs2(0x43, 0x04, !=), bbc2(0x53, 0x04, ==), bbs3(0x63, 0x08, !=), bbc3(0x73, 0x08, ==), bbs4(0x83, 0x10, !=), bbc4(0x93, 0x10, ==), bbs5(0xa3, 0x20, !=), bbc5(0xb3, 0x20, ==), bbs6(0xc3, 0x40, !=), bbc6(0xd3, 0x40, ==), bbs7(0xe3, 0x80, !=), bbc7(0xf3, 0x80, ==) { 1:dp = op_readpc(); 2:sp = op_readdp(dp); 3:rd = op_readpc(); 4:op_io(); if((sp & $1) $2 $1)end; 5:op_io(); 6:op_io(); regs.pc += (int8)rd; } cbne_dp(0x2e) { 1:dp = op_readpc(); 2:sp = op_readdp(dp); 3:rd = op_readpc(); 4:op_io(); if(regs.a == sp)end; 5:op_io(); 6:op_io(); regs.pc += (int8)rd; } cbne_dpx(0xde) { 1:dp = op_readpc(); 2:op_io(); 3:sp = op_readdp(dp + regs.x); 4:rd = op_readpc(); 5:op_io(); if(regs.a == sp)end; 6:op_io(); 7:op_io(); regs.pc += (int8)rd; } dbnz_dp(0x6e) { 1:dp = op_readpc(); 2:wr = op_readdp(dp); 3:op_writedp(dp, --wr); 4:rd = op_readpc(); if(wr == 0x00)end; 5:op_io(); 6:op_io(); regs.pc += (int8)rd; } dbnz_y(0xfe) { 1:rd = op_readpc(); 2:op_io(); regs.y--; 3:op_io(); if(regs.y == 0x00)end; 4:op_io(); 5:op_io(); regs.pc += (int8)rd; } jmp_addr(0x5f) { 1:rd = op_readpc(); 2:rd |= op_readpc() << 8; regs.pc = rd; } jmp_iaddrx(0x1f) { 1:dp = op_readpc(); 2:dp |= op_readpc() << 8; 3:op_io(); dp += regs.x; 4:rd = op_readaddr(dp); 5:rd |= op_readaddr(dp + 1) << 8; regs.pc = rd; } call(0x3f) { 1:rd = op_readpc(); 2:rd |= op_readpc() << 8; 3:op_io(); 4:op_io(); 5:op_io(); 6:op_writestack(regs.pc >> 8); 7:op_writestack(regs.pc); regs.pc = rd; } pcall(0x4f) { 1:rd = op_readpc(); 2:op_io(); 3:op_io(); 4:op_writestack(regs.pc >> 8); 5:op_writestack(regs.pc); regs.pc = 0xff00 | rd; } tcall_0(0x01, 0), tcall_1(0x11, 1), tcall_2(0x21, 2), tcall_3(0x31, 3), tcall_4(0x41, 4), tcall_5(0x51, 5), tcall_6(0x61, 6), tcall_7(0x71, 7), tcall_8(0x81, 8), tcall_9(0x91, 9), tcall_10(0xa1, 10), tcall_11(0xb1, 11), tcall_12(0xc1, 12), tcall_13(0xd1, 13), tcall_14(0xe1, 14), tcall_15(0xf1, 15) { 1:dp = 0xffde - ($1 << 1); rd = op_readaddr(dp); 2:rd |= op_readaddr(dp + 1) << 8; 3:op_io(); 4:op_io(); 5:op_io(); 6:op_writestack(regs.pc >> 8); 7:op_writestack(regs.pc); regs.pc = rd; } brk(0x0f) { 1:rd = op_readaddr(0xffde); 2:rd |= op_readaddr(0xffdf) << 8; 3:op_io(); 4:op_io(); 5:op_writestack(regs.pc >> 8); 6:op_writestack(regs.pc); 7:op_writestack(regs.p); regs.pc = rd; regs.p.b = 1; regs.p.i = 0; } ret(0x6f) { 1:rd = op_readstack(); 2:rd |= op_readstack() << 8; 3:op_io(); 4:op_io(); regs.pc = rd; } reti(0x7f) { 1:regs.p = op_readstack(); 2:rd = op_readstack(); 3:rd |= op_readstack() << 8; 4:op_io(); 5:op_io(); regs.pc = rd; } sfc/alt/dsp/SPC_DSP.h000664 001750 001750 00000017107 12651764221 015343 0ustar00sergiosergio000000 000000 // Highly accurate SNES SPC-700 DSP emulator // snes_spc 0.9.0 #ifndef SPC_DSP_H #define SPC_DSP_H #include "blargg_common.h" extern "C" { typedef void (*dsp_copy_func_t)( unsigned char** io, void* state, size_t ); } class SPC_DSP { public: typedef BOOST::uint8_t uint8_t; // Setup // Initializes DSP and has it use the 64K RAM provided void init( void* ram_64k ); // Sets destination for output samples. If out is NULL or out_size is 0, // doesn't generate any. typedef short sample_t; void set_output( sample_t* out, int out_size ); // Number of samples written to output since it was last set, always // a multiple of 2. Undefined if more samples were generated than // output buffer could hold. int sample_count() const; // Emulation // Resets DSP to power-on state void reset(); // Emulates pressing reset switch on SNES void soft_reset(); // Reads/writes DSP registers. For accuracy, you must first call run() // to catch the DSP up to present. int read ( int addr ) const; void write( int addr, int data ); // Runs DSP for specified number of clocks (~1024000 per second). Every 32 clocks // a pair of samples is be generated. void run( int clock_count ); // Sound control // Mutes voices corresponding to non-zero bits in mask (issues repeated KOFF events). // Reduces emulation accuracy. enum { voice_count = 8 }; void mute_voices( int mask ); // State // Resets DSP and uses supplied values to initialize registers enum { register_count = 128 }; void load( uint8_t const regs [register_count] ); // Saves/loads exact emulator state enum { state_size = 640 }; // maximum space needed when saving typedef dsp_copy_func_t copy_func_t; void copy_state( unsigned char** io, copy_func_t ); // Returns non-zero if new key-on events occurred since last call bool check_kon(); // DSP register addresses // Global registers enum { r_mvoll = 0x0C, r_mvolr = 0x1C, r_evoll = 0x2C, r_evolr = 0x3C, r_kon = 0x4C, r_koff = 0x5C, r_flg = 0x6C, r_endx = 0x7C, r_efb = 0x0D, r_pmon = 0x2D, r_non = 0x3D, r_eon = 0x4D, r_dir = 0x5D, r_esa = 0x6D, r_edl = 0x7D, r_fir = 0x0F // 8 coefficients at 0x0F, 0x1F ... 0x7F }; // Voice registers enum { v_voll = 0x00, v_volr = 0x01, v_pitchl = 0x02, v_pitchh = 0x03, v_srcn = 0x04, v_adsr0 = 0x05, v_adsr1 = 0x06, v_gain = 0x07, v_envx = 0x08, v_outx = 0x09 }; public: enum { extra_size = 16 }; sample_t* extra() { return m.extra; } sample_t const* out_pos() const { return m.out; } void disable_surround( bool ) { } // not supported public: BLARGG_DISABLE_NOTHROW typedef BOOST::int8_t int8_t; typedef BOOST::int16_t int16_t; enum { echo_hist_size = 8 }; enum env_mode_t { env_release, env_attack, env_decay, env_sustain }; enum { brr_buf_size = 12 }; struct voice_t { int buf [brr_buf_size*2];// decoded samples (twice the size to simplify wrap handling) int buf_pos; // place in buffer where next samples will be decoded int interp_pos; // relative fractional position in sample (0x1000 = 1.0) int brr_addr; // address of current BRR block int brr_offset; // current decoding offset in BRR block uint8_t* regs; // pointer to voice's DSP registers int vbit; // bitmask for voice: 0x01 for voice 0, 0x02 for voice 1, etc. int kon_delay; // KON delay/current setup phase env_mode_t env_mode; int env; // current envelope level int hidden_env; // used by GAIN mode 7, very obscure quirk uint8_t t_envx_out; }; private: enum { brr_block_size = 9 }; struct state_t { uint8_t regs [register_count]; // Echo history keeps most recent 8 samples (twice the size to simplify wrap handling) int echo_hist [echo_hist_size * 2] [2]; int (*echo_hist_pos) [2]; // &echo_hist [0 to 7] int every_other_sample; // toggles every sample int kon; // KON value when last checked int noise; int counter; int echo_offset; // offset from ESA in echo buffer int echo_length; // number of bytes that echo_offset will stop at int phase; // next clock cycle to run (0-31) bool kon_check; // set when a new KON occurs // Hidden registers also written to when main register is written to int new_kon; uint8_t endx_buf; uint8_t envx_buf; uint8_t outx_buf; // Temporary state between clocks // read once per sample int t_pmon; int t_non; int t_eon; int t_dir; int t_koff; // read a few clocks ahead then used int t_brr_next_addr; int t_adsr0; int t_brr_header; int t_brr_byte; int t_srcn; int t_esa; int t_echo_enabled; // internal state that is recalculated every sample int t_dir_addr; int t_pitch; int t_output; int t_looped; int t_echo_ptr; // left/right sums int t_main_out [2]; int t_echo_out [2]; int t_echo_in [2]; voice_t voices [voice_count]; // non-emulation state uint8_t* ram; // 64K shared RAM between DSP and SMP int mute_mask; sample_t* out; sample_t* out_end; sample_t* out_begin; sample_t extra [extra_size]; }; state_t m; void init_counter(); void run_counters(); unsigned read_counter( int rate ); int interpolate( voice_t const* v ); void run_envelope( voice_t* const v ); void decode_brr( voice_t* v ); void misc_27(); void misc_28(); void misc_29(); void misc_30(); void voice_output( voice_t const* v, int ch ); void voice_V1( voice_t* const ); void voice_V2( voice_t* const ); void voice_V3( voice_t* const ); void voice_V3a( voice_t* const ); void voice_V3b( voice_t* const ); void voice_V3c( voice_t* const ); void voice_V4( voice_t* const ); void voice_V5( voice_t* const ); void voice_V6( voice_t* const ); void voice_V7( voice_t* const ); void voice_V8( voice_t* const ); void voice_V9( voice_t* const ); void voice_V7_V4_V1( voice_t* const ); void voice_V8_V5_V2( voice_t* const ); void voice_V9_V6_V3( voice_t* const ); void echo_read( int ch ); int echo_output( int ch ); void echo_write( int ch ); void echo_22(); void echo_23(); void echo_24(); void echo_25(); void echo_26(); void echo_27(); void echo_28(); void echo_29(); void echo_30(); void soft_reset_common(); public: bool mute() { return m.regs[r_flg] & 0x40; } }; #include inline int SPC_DSP::sample_count() const { return m.out - m.out_begin; } inline int SPC_DSP::read( int addr ) const { assert( (unsigned) addr < register_count ); return m.regs [addr]; } inline void SPC_DSP::write( int addr, int data ) { assert( (unsigned) addr < register_count ); m.regs [addr] = (uint8_t) data; switch ( addr & 0x0F ) { case v_envx: m.envx_buf = (uint8_t) data; break; case v_outx: m.outx_buf = (uint8_t) data; break; case 0x0C: if ( addr == r_kon ) m.new_kon = (uint8_t) data; if ( addr == r_endx ) // always cleared, regardless of data written { m.endx_buf = 0; m.regs [r_endx] = 0; } break; } } inline void SPC_DSP::mute_voices( int mask ) { m.mute_mask = mask; } inline bool SPC_DSP::check_kon() { bool old = m.kon_check; m.kon_check = 0; return old; } #if !SPC_NO_COPY_STATE_FUNCS class SPC_State_Copier { SPC_DSP::copy_func_t func; unsigned char** buf; public: SPC_State_Copier( unsigned char** p, SPC_DSP::copy_func_t f ) { func = f; buf = p; } void copy( void* state, size_t size ); int copy_int( int state, int size ); void skip( int count ); void extra(); }; #define SPC_COPY( type, state )\ {\ state = (BOOST::type) copier.copy_int( state, sizeof (BOOST::type) );\ assert( (BOOST::type) state == state );\ } #endif #endif nall/string.hpp000664 001750 001750 00000002634 12651764221 014662 0ustar00sergiosergio000000 000000 #ifndef NALL_STRING_HPP #define NALL_STRING_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define NALL_STRING_INTERNAL_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef NALL_STRING_INTERNAL_HPP #endif sfc/system/input.cpp000664 001750 001750 00000002133 12651764221 015651 0ustar00sergiosergio000000 000000 #ifdef SYSTEM_CPP Input input; void Input::connect(bool port, Input::Device id) { Controller*& controller = (port == Controller::Port1 ? port1 : port2); if(controller) { delete controller; controller = nullptr; } switch(id) { default: case Device::None: controller = new Controller(port); break; case Device::Joypad: controller = new Gamepad(port); break; case Device::Multitap: controller = new Multitap(port); break; case Device::Mouse: controller = new Mouse(port); break; case Device::SuperScope: controller = new SuperScope(port); break; case Device::Justifier: controller = new Justifier(port, false); break; case Device::Justifiers: controller = new Justifier(port, true); break; case Device::USART: controller = new USART(port); break; } if (port == Controller::Port1) configuration.controller_port1 = id; else configuration.controller_port2 = id; } Input::Input() { connect(Controller::Port1, Input::Device::Joypad); connect(Controller::Port2, Input::Device::Joypad); } Input::~Input() { if(port1) delete port1; if(port2) delete port2; } #endif fc/video/video.cpp000664 001750 001750 00000005117 12651764221 015224 0ustar00sergiosergio000000 000000 #include #include #define VIDEO_CPP namespace Famicom { Video video; void Video::generate_palette(Emulator::Interface::PaletteMode mode) { for(unsigned color = 0; color < (1 << 9); color++) { if(mode == Emulator::Interface::PaletteMode::Literal) { palette[color] = color; } else if(mode == Emulator::Interface::PaletteMode::Channel) { unsigned emphasis = (color >> 6) & 7; unsigned luma = (color >> 4) & 3; unsigned chroma = (color >> 0) & 15; emphasis = image::normalize(emphasis, 3, 16); luma = image::normalize(luma, 2, 16); chroma = image::normalize(chroma, 4, 16); palette[color] = interface->videoColor(color, 0, emphasis, luma, chroma); } else if(mode == Emulator::Interface::PaletteMode::Standard) { palette[color] = generate_color(color, 2.0, 0.0, 1.0, 1.0, 2.2); } else if(mode == Emulator::Interface::PaletteMode::Emulation) { palette[color] = generate_color(color, 2.0, 0.0, 1.0, 1.0, 1.8); } } } Video::Video() { palette = new uint32_t[1 << 9](); } Video::~Video() { delete[] palette; } uint32_t Video::generate_color( unsigned n, double saturation, double hue, double contrast, double brightness, double gamma ) { signed color = (n & 0x0f), level = color < 0xe ? (n >> 4) & 3 : 1; static const double black = 0.518, white = 1.962, attenuation = 0.746; static const double levels[8] = { 0.350, 0.518, 0.962, 1.550, 1.094, 1.506, 1.962, 1.962, }; double lo_and_hi[2] = { levels[level + 4 * (color == 0x0)], levels[level + 4 * (color < 0xd)], }; double y = 0.0, i = 0.0, q = 0.0; auto wave = [](signed p, signed color) { return (color + p + 8) % 12 < 6; }; for(signed p = 0; p < 12; p++) { double spot = lo_and_hi[wave(p, color)]; if(((n & 0x040) && wave(p, 12)) || ((n & 0x080) && wave(p, 4)) || ((n & 0x100) && wave(p, 8)) ) spot *= attenuation; double v = (spot - black) / (white - black); v = (v - 0.5) * contrast + 0.5; v *= brightness / 12.0; y += v; i += v * std::cos((3.141592653 / 6.0) * (p + hue)); q += v * std::sin((3.141592653 / 6.0) * (p + hue)); } i *= saturation; q *= saturation; auto gammaAdjust = [=](double f) { return f < 0.0 ? 0.0 : std::pow(f, 2.2 / gamma); }; unsigned r = 65535.0 * gammaAdjust(y + 0.946882 * i + 0.623557 * q); unsigned g = 65535.0 * gammaAdjust(y + -0.274788 * i + -0.635691 * q); unsigned b = 65535.0 * gammaAdjust(y + -1.108545 * i + 1.709007 * q); return interface->videoColor(n, 0, uclamp<16>(r), uclamp<16>(g), uclamp<16>(b)); } } target-ethos/resource/home.png000664 001750 001750 00000001136 12651764221 017604 0ustar00sergiosergio000000 000000 PNG  IHDRabKGDC pHYs B(xtIME %S*;IDAT8˕kSQ{K@$UdQ{hU\BJ'\:n%`?y[\ZbQ!y!ٗP!g\s)Uz0{JiO=Iqhx87oW"nbY'Nq8'&Skk\Rnu@~Sa12jJ\~zdt*M*@kh,B~D0.`vКErn. RTk69?## |Ά\N>=6o3V?Et0F,/-yx0!O"^SyZk&3úӲ,L0K;t~ 0 R"Ē`So/:"Z$c`(.Ns5Cq.KMB~8pA$mpg,+:bwVգIENDB`target-ethos/settings/server.cpp000664 001750 001750 00000001774 12651764221 020201 0ustar00sergiosergio000000 000000 ServerSettings* serverSettings = nullptr; ServerSettings::ServerSettings() { hostLabel.setText("Hostname:"); userLabel.setText("Username:"); passLabel.setText("Password:"); unsigned width = min( Font::size(program->normalFont, "Hostname:").width, Font::size(program->normalFont, "Username:").width ); append(hostLayout, {~0, 0}, 5); hostLayout.append(hostLabel, {width, 0}, 5); hostLayout.append(hostEdit, {~0, 0}); append(userLayout, {~0, 0}); userLayout.append(userLabel, {width, 0}, 5); userLayout.append(userEdit, {~0, 0}, 5); userLayout.append(passLabel, {0, 0}, 5); userLayout.append(passEdit, {~0, 0}); hostEdit.setText(config->server.hostname); userEdit.setText(config->server.username); passEdit.setText(config->server.password); hostEdit.onChange = [&] { config->server.hostname = hostEdit.text(); }; userEdit.onChange = [&] { config->server.username = userEdit.text(); }; passEdit.onChange = [&] { config->server.password = passEdit.text(); }; } nall/dsp.hpp000664 001750 001750 00000000351 12651764221 014134 0ustar00sergiosergio000000 000000 #ifndef NALL_DSP_HPP #define NALL_DSP_HPP #include #include #ifdef __SSE__ #include #endif #define NALL_DSP_INTERNAL_HPP #include #undef NALL_DSP_INTERNAL_HPP #endif sfc/chip/armdsp/armdsp.hpp000664 001750 001750 00000001214 12651764221 016671 0ustar00sergiosergio000000 000000 //ARMv3 (ARM6) struct ArmDSP : Processor::ARM, Coprocessor { uint8* programROM; uint8* dataROM; uint8* programRAM; #include "registers.hpp" static void Enter(); void enter(); void step(unsigned clocks); void bus_idle(uint32 addr); uint32 bus_read(uint32 addr, uint32 size); void bus_write(uint32 addr, uint32 size, uint32 word); uint8 mmio_read(unsigned addr); void mmio_write(unsigned addr, uint8 data); void init(); void load(); void unload(); void power(); void reset(); void arm_reset(); nall::vector firmware(); void serialize(serializer&); ArmDSP(); ~ArmDSP(); }; extern ArmDSP armdsp; target-ethos/settings/hotkey.hpp000664 001750 001750 00000000673 12651764221 020200 0ustar00sergiosergio000000 000000 struct HotkeySettings : SettingsLayout { ListView inputList; HorizontalLayout controlLayout; Widget spacer; Button eraseButton; void synchronize(); void refresh(); void eraseInput(); void assignInput(); void inputEvent(HID::Device& device, unsigned group, unsigned input, int16_t oldValue, int16_t newValue); HotkeySettings(); private: HotkeyInput* activeInput = nullptr; }; extern HotkeySettings* hotkeySettings; sfc/chip/hsu1/hsu1.cpp000664 001750 001750 00000004633 12651764221 015660 0ustar00sergiosergio000000 000000 #include #define HSU1_CPP namespace SuperFamicom { #include "serialization.cpp" HSU1 hsu1; void HSU1::init() { } void HSU1::load() { } void HSU1::unload() { } void HSU1::power() { } void HSU1::reset() { txbusy = 0; rxbusy = 1; txlatch = 0; txbuffer.reset(); rxbuffer.reset(); } uint8 HSU1::read(unsigned addr) { addr &= 1; if(addr == 0) { return (txbusy << 7) | (rxbusy << 6) | (1 << 0); } if(addr == 1) { if(rxbusy) return 0x00; uint8 data = rxbuffer.take(0); if(rxbuffer.size() == 0) rxbusy = 1; return data; } //unreachable return cpu.regs.mdr; } void HSU1::write(unsigned addr, uint8 data) { addr &= 1; if(addr == 0) { if(txbusy) return; bool latch = data & 0x01; if(txlatch == 1 && latch == 0) { //username:password@http://server:port/path lstring side = interface->server().split<1>("@"); string username = side(0).split<1>(":")(0); string password = side(0).split<1>(":")(1); side(1).ltrim<1>("http://"); string hostname = side(1).split<1>("/")(0); string hostpath = side(1).split<1>("/")(1); side = hostname.split<1>(":"); hostname = side(0); string hostport = side(1); if(hostport.empty()) hostport = "80"; http server; if(server.connect(hostname, decimal(hostport))) { string header { "username:", username, "\n", "password:", password, "\n", "emulator:bsnes\n", "sha256:", interface->sha256(), "\n", "\n" }; string packet { "POST /", hostpath, " HTTP/1.0\r\n", "Host: ", hostname, "\r\n", "Connection: close\r\n", "Content-Type: application/octet-stream\r\n", "Content-Length: ", header.length() + txbuffer.size(), "\r\n", "\r\n", }; server.send(packet); server.send(header); server.send(txbuffer.data(), txbuffer.size()); txbuffer.reset(); server.header = server.downloadHeader(); uint8_t* data = nullptr; unsigned size = 0; server.downloadContent(data, size); rxbuffer.resize(size); memcpy(rxbuffer.data(), data, size); rxbusy = rxbuffer.size() == 0; free(data); server.disconnect(); } } txlatch = latch; } if(addr == 1) { if(txbusy) return; if(txlatch == 0) return; txbuffer.append(data); } } } sfc/alt/ppu-performance/window/000700 001750 001750 00000000000 12656700342 017640 5ustar00sergiosergio000000 000000 sfc/slot/satellaview/000700 001750 001750 00000000000 12656700342 015747 5ustar00sergiosergio000000 000000 phoenix/qt/browser-window.cpp000664 001750 001750 00000003410 12651764221 017500 0ustar00sergiosergio000000 000000 namespace phoenix { string pBrowserWindow::directory(BrowserWindow::State& state) { QString directory = QFileDialog::getExistingDirectory( state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : "Select Directory", QString::fromUtf8(state.path), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks ); string name = directory.toUtf8().constData(); if(name && name.endsWith("/") == false) name.append("/"); return name; } string pBrowserWindow::open(BrowserWindow::State& state) { string filters = state.filters.merge(";;"); //convert filter list from phoenix to Qt format, example: //"Text, XML files (*.txt,*.xml)" -> "Text, XML files (*.txt *.xml)" signed parentheses = 0; for(auto& n : filters) { if(n == '(') parentheses++; if(n == ')') parentheses--; if(n == ',' && parentheses) n = ' '; } QString filename = QFileDialog::getOpenFileName( state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : "Open File", QString::fromUtf8(state.path), QString::fromUtf8(filters) ); return filename.toUtf8().constData(); } string pBrowserWindow::save(BrowserWindow::State& state) { string filters = state.filters.merge(";;"); //convert filter list from phoenix to Qt format, example: //"Text, XML files (*.txt,*.xml)" -> "Text, XML files (*.txt *.xml)" signed parentheses = 0; for(auto& n : filters) { if(n == '(') parentheses++; if(n == ')') parentheses--; if(n == ',' && parentheses) n = ' '; } QString filename = QFileDialog::getSaveFileName( state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : "Save File", QString::fromUtf8(state.path), QString::fromUtf8(filters) ); return filename.toUtf8().constData(); } } target-ethos/resource/advanced.png000664 001750 001750 00000001143 12651764221 020417 0ustar00sergiosergio000000 000000 PNG  IHDRabKGD pHYs  tIME  9cHIDAT8˥KhaLM JƅE.4bfBp!T-RCBkAte@‰bW6IUiӗ DD:3nf1³{?'#Q X"M4QlRTlb4u#Q ZêEtFZdfx>XBr"2>06א:%Z,1`o %nFa~N(/;+tHRa %Nʿ4J'{( LA0: ԬN Gl6y75 irtI4Mk @ҾB0L8;77TIENDB`sfc/ppu/mmio/000700 001750 001750 00000000000 12656700342 014213 5ustar00sergiosergio000000 000000 sfc/base/base.hpp000664 001750 001750 00000000060 12651764221 015014 0ustar00sergiosergio000000 000000 #include sfc/controller/mouse/mouse.hpp000664 001750 001750 00000000610 12651764221 017634 0ustar00sergiosergio000000 000000 struct Mouse : Controller { uint2 data(); void latch(bool data); Mouse(bool port); private: bool latched; unsigned counter; unsigned speed; //0 = slow, 1 = normal, 2 = fast signed x; //x-coordinate signed y; //y-coordinate bool dx; //x-direction bool dy; //y-direction bool l; //left button bool r; //right button }; gba/cartridge/cartridge.cpp000664 001750 001750 00000012213 12651764221 017054 0ustar00sergiosergio000000 000000 #include namespace GameBoyAdvance { #include "eeprom.cpp" #include "flashrom.cpp" #include "serialization.cpp" Cartridge cartridge; string Cartridge::title() { return information.title; } void Cartridge::load() { interface->loadRequest(ID::Manifest, "manifest.bml"); auto document = Markup::Document(information.markup); information.title = document["information/title"].text(); unsigned rom_size = 0; if(document["cartridge/rom"].exists()) { auto info = document["cartridge/rom"]; interface->loadRequest(ID::ROM, info["name"].data); rom_size = numeral(info["size"].data); for(unsigned addr = rom_size; addr < rom.size; addr++) { rom.data[addr] = rom.data[Bus::mirror(addr, rom_size)]; } } has_sram = false; has_eeprom = false; has_flashrom = false; if(document["cartridge/ram"].exists()) { auto info = document["cartridge/ram"]; if(info["type"].data == "SRAM" || info["type"].data == "FRAM") { has_sram = true; ram.size = numeral(info["size"].data); ram.mask = ram.size - 1; for(unsigned n = 0; n < ram.size; n++) ram.data[n] = 0xff; interface->loadRequest(ID::RAM, info["name"].data); memory.append({ID::RAM, info["name"].data}); } if(info["type"].data == "EEPROM") { has_eeprom = true; eeprom.size = numeral(info["size"].data); eeprom.bits = eeprom.size <= 512 ? 6 : 14; if(eeprom.size == 0) eeprom.size = 8192, eeprom.bits = 0; //auto-detect size eeprom.mask = rom_size > 16 * 1024 * 1024 ? 0x0fffff00 : 0x0f000000; eeprom.test = rom_size > 16 * 1024 * 1024 ? 0x0dffff00 : 0x0d000000; for(unsigned n = 0; n < eeprom.size; n++) eeprom.data[n] = 0xff; interface->loadRequest(ID::EEPROM, info["name"].data); memory.append({ID::EEPROM, info["name"].data}); } if(info["type"].data == "FlashROM") { has_flashrom = true; flashrom.id = numeral(info["id"].data); flashrom.size = numeral(info["size"].data); for(unsigned n = 0; n < flashrom.size; n++) flashrom.data[n] = 0xff; interface->loadRequest(ID::FlashROM, info["name"].data); memory.append({ID::FlashROM, info["name"].data}); } } sha256 = nall::sha256(rom.data, rom_size); system.load(); loaded = true; } void Cartridge::unload() { if(loaded == false) return; loaded = false; memory.reset(); } void Cartridge::power() { eeprom.power(); flashrom.power(); } uint8* Cartridge::ram_data() { if(has_sram) return ram.data; if(has_eeprom) return eeprom.data; if(has_flashrom) return flashrom.data; return nullptr; } unsigned Cartridge::ram_size() { if(has_sram) return ram.size; if(has_eeprom) return eeprom.size; if(has_flashrom) return flashrom.size; return 0u; } uint32 Cartridge::read(uint8 *data, uint32 addr, uint32 size) { if(size == Word) addr &= ~3; if(size == Half) addr &= ~1; data += addr; if(size == Word) return data[0] << 0 | data[1] << 8 | data[2] << 16 | data[3] << 24; if(size == Half) return data[0] << 0 | data[1] << 8; return data[0]; } void Cartridge::write(uint8 *data, uint32 addr, uint32 size, uint32 word) { if(size == Word) addr &= ~3; if(size == Half) addr &= ~1; data += addr; switch(size) { case Word: data[3] = word >> 24; data[2] = word >> 16; case Half: data[1] = word >> 8; case Byte: data[0] = word >> 0; } } #define RAM_ANALYZE uint32 Cartridge::read(uint32 addr, uint32 size) { #ifdef RAM_ANALYZE if((addr & 0x0e000000) == 0x0e000000) { static bool once = true; if(once) once = false, print("* SRAM/FlashROM read detected\n"); } #endif if(has_sram && (addr & 0x0e000000 ) == 0x0e000000 ) return read(ram.data, addr & ram.mask, size); if(has_eeprom && (addr & eeprom.mask) == eeprom.test) return eeprom.read(); if(has_flashrom && (addr & 0x0e000000 ) == 0x0e000000 ) return flashrom.read(addr); if(addr < 0x0e000000) return read(rom.data, addr & 0x01ffffff, size); return cpu.pipeline.fetch.instruction; } void Cartridge::write(uint32 addr, uint32 size, uint32 word) { #ifdef RAM_ANALYZE if((addr & 0x0e000000) == 0x0e000000) { static bool once = true; if(once) once = false, print("* SRAM/FlashROM write detected\n"); } if((addr & 0x0f000000) == 0x0d000000) { static bool once = true; if(once) once = false, print("* EEPROM write detected\n"); } if((addr & 0x0e00ffff) == 0x0e005555 && (word & 0xff) == 0xaa) { static bool once = true; if(once) once = false, print("* FlashROM write detected\n"); } #endif if(has_sram && (addr & 0x0e000000 ) == 0x0e000000 ) return write(ram.data, addr & ram.mask, size, word); if(has_eeprom && (addr & eeprom.mask) == eeprom.test) return eeprom.write(word & 1); if(has_flashrom && (addr & 0x0e000000 ) == 0x0e000000 ) return flashrom.write(addr, word); } Cartridge::Cartridge() { loaded = false; rom.data = new uint8[rom.size = 32 * 1024 * 1024]; ram.data = new uint8[ram.size = 32 * 1024]; eeprom.data = new uint8[eeprom.size = 8 * 1024]; flashrom.data = new uint8[flashrom.size = 128 * 1024]; } Cartridge::~Cartridge() { delete[] rom.data; delete[] ram.data; delete[] eeprom.data; delete[] flashrom.data; } } phoenix/gtk/widget/vertical-scroller.cpp000664 001750 001750 00000002235 12651764221 021574 0ustar00sergiosergio000000 000000 namespace phoenix { static void VerticalScroller_change(GtkRange* gtkRange, VerticalScroller* self) { unsigned position = (unsigned)gtk_range_get_value(gtkRange); if(self->state.position == position) return; self->state.position = position; if(!self->p.locked && self->onChange) self->onChange(); } Size pVerticalScroller::minimumSize() { return {20, 0}; } void pVerticalScroller::setLength(unsigned length) { locked = true; length += length == 0; gtk_range_set_range(GTK_RANGE(gtkWidget), 0, max(1u, length - 1)); gtk_range_set_increments(GTK_RANGE(gtkWidget), 1, length >> 3); locked = false; } void pVerticalScroller::setPosition(unsigned position) { gtk_range_set_value(GTK_RANGE(gtkWidget), position); } void pVerticalScroller::constructor() { gtkWidget = gtk_vscrollbar_new(0); g_signal_connect(G_OBJECT(gtkWidget), "value-changed", G_CALLBACK(VerticalScroller_change), (gpointer)&verticalScroller); setLength(verticalScroller.state.length); setPosition(verticalScroller.state.position); } void pVerticalScroller::destructor() { gtk_widget_destroy(gtkWidget); } void pVerticalScroller::orphan() { destructor(); constructor(); } } gba/cartridge/flashrom.cpp000664 001750 001750 00000004536 12651764221 016734 0ustar00sergiosergio000000 000000 //Dev.ID Size Blocks Manufacturer //====== ===== ======== ============ //0xd4bf 64KB 16x4096 SST //0x1cc2 64KB 16x4096 Macronix //0x1b32 64KB 16x4096 Panasonic //0x3d1f 64KB 512x 128 Atmel //0x1362 128KB 32x4096 Sanyo //0x09c2 128KB 32x4096 Macronix uint8 Cartridge::FlashROM::read(uint16 addr) { if(idmode) { if(addr == 0x0000) return id >> 0; if(addr == 0x0001) return id >> 8; return 0u; } return data[bank << 16 | addr]; } void Cartridge::FlashROM::write(uint16 addr, uint8 byte) { if(bankselect) { bankselect = false; //bank select is only applicable on 128KB chips if(addr == 0x0000) bank = byte & (size > 64 * 1024); return; } if(writeselect) { //Atmel writes 128 bytes per command; all others write 1 byte per command if(id != 0x3d1f || (addr & 0x007f) == 0x007f) writeselect = false; data[bank << 16 | addr] = byte; return; } if(byte == 0xaa && addr == 0x5555) { unlockhi = true; return; } if(byte == 0x55 && addr == 0x2aaa) { unlocklo = true; return; } if(unlockhi && unlocklo) { unlockhi = false; unlocklo = false; if(byte == 0x10 && addr == 0x5555) { if(erasemode) { erasemode = false; for(unsigned n = 0; n < size; n++) data[n] = 0xff; } } if(byte == 0x30 && (addr & 0x0fff) == 0x0000) { //command only valid for non-Atmel chips if(erasemode && id != 0x3d1f) { erasemode = false; unsigned offset = bank << 16 | (addr & ~4095); for(unsigned n = 0; n < 4096; n++) data[offset++] = 0xff; } } if(byte == 0x80 && addr == 0x5555) { erasemode = true; } if(byte == 0x90 && addr == 0x5555) { idmode = true; } if(byte == 0xa0 && addr == 0x5555) { writeselect = true; } if(byte == 0xb0 && addr == 0x5555) { bankselect = true; } if(byte == 0xf0 && addr == 0x5555) { idmode = false; } } } void Cartridge::FlashROM::power() { unlockhi = false; unlocklo = false; idmode = false; bankselect = false; writeselect = false; bank = 0; } void Cartridge::FlashROM::serialize(serializer& s) { s.array(data, size); s.integer(size); s.integer(id); s.integer(unlockhi); s.integer(unlocklo); s.integer(idmode); s.integer(erasemode); s.integer(bankselect); s.integer(writeselect); s.integer(bank); } gba/cpu/000700 001750 001750 00000000000 12656700342 013213 5ustar00sergiosergio000000 000000 processor/arm/registers.hpp000664 001750 001750 00000006445 12651764221 017237 0ustar00sergiosergio000000 000000 struct GPR { uint32 data; function modify; inline operator uint32() const { return data; } inline GPR& operator=(uint32 n) { data = n; if(modify) modify(); return *this; } inline GPR& operator=(const GPR& source) { return operator=(source.data); } inline GPR& operator &=(uint32 n) { return operator=(data & n); } inline GPR& operator |=(uint32 n) { return operator=(data | n); } inline GPR& operator ^=(uint32 n) { return operator=(data ^ n); } inline GPR& operator +=(uint32 n) { return operator=(data + n); } inline GPR& operator -=(uint32 n) { return operator=(data - n); } inline GPR& operator *=(uint32 n) { return operator=(data * n); } inline GPR& operator /=(uint32 n) { return operator=(data / n); } inline GPR& operator %=(uint32 n) { return operator=(data % n); } inline GPR& operator<<=(uint32 n) { return operator=(data << n); } inline GPR& operator>>=(uint32 n) { return operator=(data >> n); } }; struct PSR { bool n; //negative bool z; //zero bool c; //carry bool v; //overflow bool i; //irq bool f; //fiq bool t; //thumb unsigned m; //mode inline operator uint32() const { return (n << 31) + (z << 30) + (c << 29) + (v << 28) + (i << 7) + (f << 6) + (t << 5) + (m << 0); } inline PSR& operator=(uint32 d) { n = d & (1 << 31); z = d & (1 << 30); c = d & (1 << 29); v = d & (1 << 28); i = d & (1 << 7); f = d & (1 << 6); t = d & (1 << 5); m = d & 31; return *this; } void serialize(serializer&); }; struct Pipeline { bool reload; struct Instruction { uint32 address; uint32 instruction; }; Instruction execute; Instruction decode; Instruction fetch; }; struct Processor { enum class Mode : unsigned { USR = 0x10, //user FIQ = 0x11, //fast interrupt request IRQ = 0x12, //interrupt request SVC = 0x13, //supervisor (software interrupt) ABT = 0x17, //abort UND = 0x1b, //undefined SYS = 0x1f, //system }; GPR r0, r1, r2, r3, r4, r5, r6, r7; struct USR { GPR r8, r9, r10, r11, r12, sp, lr; } usr; struct FIQ { GPR r8, r9, r10, r11, r12, sp, lr; PSR spsr; } fiq; struct IRQ { GPR sp, lr; PSR spsr; } irq; struct SVC { GPR sp, lr; PSR spsr; } svc; struct ABT { GPR sp, lr; PSR spsr; } abt; struct UND { GPR sp, lr; PSR spsr; } und; GPR pc; PSR cpsr; bool carryout; bool sequential; bool irqline; GPR* r[16]; PSR* spsr; void power(); void setMode(Mode); }; Processor processor; Pipeline pipeline; bool crash; void pipeline_step(); alwaysinline GPR& r(unsigned n) { return *processor.r[n]; } alwaysinline PSR& cpsr() { return processor.cpsr; } alwaysinline PSR& spsr() { return *processor.spsr; } alwaysinline bool& carryout() { return processor.carryout; } alwaysinline bool& sequential() { return processor.sequential; } alwaysinline uint32 instruction() { return pipeline.execute.instruction; } alwaysinline Processor::Mode mode() { return (Processor::Mode)processor.cpsr.m; } alwaysinline bool privilegedmode() const { return (Processor::Mode)processor.cpsr.m != Processor::Mode::USR; } alwaysinline bool exceptionmode() const { return privilegedmode() && (Processor::Mode)processor.cpsr.m != Processor::Mode::SYS; } fc/apu/dmc.cpp000664 001750 001750 00000004450 12651764221 014337 0ustar00sergiosergio000000 000000 void APU::DMC::start() { if(length_counter == 0) { read_addr = 0x4000 + (addr_latch << 6); length_counter = (length_latch << 4) + 1; } } void APU::DMC::stop() { length_counter = 0; dma_delay_counter = 0; cpu.set_rdy_line(1); cpu.set_rdy_addr(false); } uint8 APU::DMC::clock() { uint8 result = dac_latch; if(dma_delay_counter > 0) { dma_delay_counter--; if(dma_delay_counter == 1) { cpu.set_rdy_addr(true, 0x8000 | read_addr); } else if(dma_delay_counter == 0) { cpu.set_rdy_line(1); cpu.set_rdy_addr(false); dma_buffer = cpu.mdr(); have_dma_buffer = true; length_counter--; read_addr++; if(length_counter == 0) { if(loop_mode) { start(); } else if(irq_enable) { irq_pending = true; apu.set_irq_line(); } } } } if(--period_counter == 0) { if(have_sample) { signed delta = (((sample >> bit_counter) & 1) << 2) - 2; unsigned data = dac_latch + delta; if((data & 0x80) == 0) dac_latch = data; } if(++bit_counter == 0) { if(have_dma_buffer) { have_sample = true; sample = dma_buffer; have_dma_buffer = false; } else { have_sample = false; } } period_counter = ntsc_dmc_period_table[period]; } if(length_counter > 0 && have_dma_buffer == false && dma_delay_counter == 0) { cpu.set_rdy_line(0); dma_delay_counter = 4; } return result; } void APU::DMC::power() { } void APU::DMC::reset() { length_counter = 0; irq_pending = 0; period = 0; period_counter = ntsc_dmc_period_table[0]; irq_enable = 0; loop_mode = 0; dac_latch = 0; addr_latch = 0; length_latch = 0; read_addr = 0; dma_delay_counter = 0; bit_counter = 0; have_dma_buffer = 0; dma_buffer = 0; have_sample = 0; sample = 0; } void APU::DMC::serialize(serializer& s) { s.integer(length_counter); s.integer(irq_pending); s.integer(period); s.integer(period_counter); s.integer(irq_enable); s.integer(loop_mode); s.integer(dac_latch); s.integer(addr_latch); s.integer(length_latch); s.integer(read_addr); s.integer(dma_delay_counter); s.integer(bit_counter); s.integer(have_dma_buffer); s.integer(dma_buffer); s.integer(have_sample); s.integer(sample); } gb/video/video.cpp000664 001750 001750 00000005637 12651764221 015233 0ustar00sergiosergio000000 000000 #include #define VIDEO_CPP namespace GameBoy { Video video; void Video::generate_palette(Emulator::Interface::PaletteMode mode) { this->mode = mode; if(system.dmg()) for(unsigned n = 0; n < 4; n++) palette[n] = palette_dmg(n); if(system.sgb()) for(unsigned n = 0; n < 4; n++) palette[n] = palette_sgb(n); if(system.cgb()) for(unsigned n = 0; n < (1 << 15); n++) palette[n] = palette_cgb(n); } Video::Video() { palette = new uint32_t[1 << 15](); } Video::~Video() { delete[] palette; } unsigned Video::palette_dmg(unsigned color) const { if(mode == Emulator::Interface::PaletteMode::Literal) { return color; } if(mode == Emulator::Interface::PaletteMode::Channel) { unsigned L = image::normalize(color, 2, 16); return interface->videoColor(color, 0, 0, 0, L); } if(mode == Emulator::Interface::PaletteMode::Standard) { unsigned L = image::normalize(3 - color, 2, 16); return interface->videoColor(color, 0, L, L, L); } if(mode == Emulator::Interface::PaletteMode::Emulation) { unsigned R = monochrome[color][0]; unsigned G = monochrome[color][1]; unsigned B = monochrome[color][2]; return interface->videoColor(color, 0, R, G, B); } return 0; } unsigned Video::palette_sgb(unsigned color) const { return color; } unsigned Video::palette_cgb(unsigned color) const { if(mode == Emulator::Interface::PaletteMode::Literal) { return color; } unsigned r = (color >> 0) & 31; unsigned g = (color >> 5) & 31; unsigned b = (color >> 10) & 31; if(mode == Emulator::Interface::PaletteMode::Channel) { r = image::normalize(r, 5, 16); g = image::normalize(g, 5, 16); b = image::normalize(b, 5, 16); return interface->videoColor(color, 0, r, g, b); } if(mode == Emulator::Interface::PaletteMode::Standard) { r = image::normalize(r, 5, 16); g = image::normalize(g, 5, 16); b = image::normalize(b, 5, 16); return interface->videoColor(color, 0, r, g, b); } if(mode == Emulator::Interface::PaletteMode::Emulation) { unsigned R = (r * 26 + g * 4 + b * 2); unsigned G = ( g * 24 + b * 8); unsigned B = (r * 6 + g * 4 + b * 22); R = min(960, R); G = min(960, G); B = min(960, B); R = R << 6 | R >> 4; G = G << 6 | G >> 4; B = B << 6 | B >> 4; return interface->videoColor(color, 0, R, G, B); } return 0; } #define DMG_PALETTE_GREEN //#define DMG_PALETTE_YELLOW //#define DMG_PALETTE_WHITE const uint16 Video::monochrome[4][3] = { #if defined(DMG_PALETTE_GREEN) {0xaeae, 0xd9d9, 0x2727}, {0x5858, 0xa0a0, 0x2828}, {0x2020, 0x6262, 0x2929}, {0x1a1a, 0x4545, 0x2a2a}, #elif defined(DMG_PALETTE_YELLOW) {0xffff, 0xf7f7, 0x7b7b}, {0xb5b5, 0xaeae, 0x4a4a}, {0x6b6b, 0x6969, 0x3131}, {0x2121, 0x2020, 0x1010}, #else //DMG_PALETTE_WHITE {0xffff, 0xffff, 0xffff}, {0xaaaa, 0xaaaa, 0xaaaa}, {0x5555, 0x5555, 0x5555}, {0x0000, 0x0000, 0x0000}, #endif }; } sfc/memory/memory.cpp000664 001750 001750 00000007433 12651764221 016016 0ustar00sergiosergio000000 000000 #include #define MEMORY_CPP namespace SuperFamicom { Bus bus; void Bus::map( const function& reader, const function& writer, unsigned banklo, unsigned bankhi, unsigned addrlo, unsigned addrhi, unsigned size, unsigned base, unsigned mask, unsigned fastmode, uint8* fastptr ) { assert(banklo <= bankhi && banklo <= 0xff); assert(addrlo <= addrhi && addrlo <= 0xffff); assert(idcount < 255); bool do_fast=(size%(addrhi+1-addrlo)==0 && !((mask|addrlo|addrhi|size)&fast_page_size_mask)); bool do_fast_read =(fastmode!=Cartridge::Mapping::fastmode_slow && do_fast); bool do_fast_write=(fastmode==Cartridge::Mapping::fastmode_readwrite && do_fast); for(unsigned bank = banklo; bank <= bankhi; bank++) { for(unsigned addr = addrlo&~fast_page_size_mask; addr<=addrhi; addr+=fast_page_size) { unsigned origpos = (bank << 16 | addr); unsigned fastoffset = origpos >> fast_page_size_bits; unsigned accesspos = reduce(origpos, mask); if(size) accesspos = base + mirror(accesspos, size - base); if(do_fast_read) fast_read[fastoffset] = fastptr - origpos + accesspos; else fast_read[fastoffset] = NULL; if(do_fast_write) fast_write[fastoffset] = fastptr - origpos + accesspos; else fast_write[fastoffset] = NULL; } } #ifdef __LIBRETRO__ if (((banklo&-banklo)|0x01000000)>(bankhi-banklo) && (bankhi&(bankhi+1)&~banklo)==0 && ((addrlo&-addrlo)|0x01000000)>(addrhi-addrlo) && (addrhi&(addrhi+1)&~addrlo)==0) { retro_memory_descriptor desc; desc.flags=(fastmode==Cartridge::Mapping::fastmode_readwrite ? 0 : RETRO_MEMDESC_CONST); desc.ptr=fastptr; desc.offset=0; desc.start=banklo<<16 | addrlo; desc.select=(banklo<<16 | addrlo) ^ (bankhi<<16 | addrhi) ^ 0xFFFFFF; desc.disconnect=mask; desc.len=size; if (!size) desc.len=0x01000000; desc.addrspace=NULL; libretro_mem_map.append(desc); } #endif unsigned id = idcount++; this->reader[id] = reader; this->writer[id] = writer; if (!(mask & (addrlo^addrhi)) && size%(addrhi+1-addrlo)==0) { //fastpath for common cases for(unsigned bank = banklo; bank <= bankhi; bank++) { unsigned offset = reduce(bank << 16 | addrlo, mask); if (size) offset = base + mirror(offset, size - base); unsigned pos = (bank<<16 | addrlo); unsigned end = (bank<<16 | addrhi); while (pos <= end) { lookup[pos] = id; target[pos] = offset++; pos++; } } } else { for(unsigned bank = banklo; bank <= bankhi; bank++) { for(unsigned addr = addrlo; addr <= addrhi; addr++) { unsigned offset = reduce(bank << 16 | addr, mask); if(size) offset = base + mirror(offset, size - base); lookup[bank << 16 | addr] = id; target[bank << 16 | addr] = offset; } } } } void Bus::map_reset() { function reader = [](unsigned) { return cpu.regs.mdr; }; function writer = [](unsigned, uint8) {}; #ifdef __LIBRETRO__ libretro_mem_map.reset(); #endif idcount = 0; map(reader, writer, 0x00, 0xff, 0x0000, 0xffff); } void Bus::map_xml() { for(auto& m : cartridge.mapping) { lstring part = m.addr.split<1>(":"); lstring banks = part(0).split(","); lstring addrs = part(1).split(","); for(auto& bank : banks) { for(auto& addr : addrs) { lstring bankpart = bank.split<1>("-"); lstring addrpart = addr.split<1>("-"); unsigned banklo = hex(bankpart(0)); unsigned bankhi = hex(bankpart(1, bankpart(0))); unsigned addrlo = hex(addrpart(0)); unsigned addrhi = hex(addrpart(1, addrpart(0))); map(m.reader, m.writer, banklo, bankhi, addrlo, addrhi, m.size, m.base, m.mask, m.fastmode, m.fastptr); } } } } } ananke/sufami-turbo.cpp000664 001750 001750 00000005511 12651764221 016270 0ustar00sergiosergio000000 000000 void Ananke::copySufamiTurboSaves(const string &pathname) { if(!file::exists({pathname, "save.ram"})) { if(file::exists({information.path, nall::basename(information.name), ".srm"})) { file::copy({information.path, nall::basename(information.name), ".srm"}, {pathname, "save.ram"}); } } } string Ananke::createSufamiTurboDatabase(vector &buffer, Markup::Node &document, const string &manifest) { string pathname = { libraryPath, "Sufami Turbo/", document["release/information/name"].text(), " (", document["release/information/region"].text(), ")", " (", document["release/information/revision"].text(), ")", ".st/" }; directory::create(pathname); //strip "release" root node from database entry (since a single game manifest isn't part of a database) string markup = manifest; markup.replace("\n ", "\n"); markup.replace("information", "\ninformation"); markup.ltrim<1>("release\n"); file::write({pathname, "manifest.bml"}, markup); file::write({pathname, "program.rom"}, buffer); copySufamiTurboSaves(pathname); return pathname; } string Ananke::createSufamiTurboHeuristic(vector &buffer) { string pathname = { libraryPath, "Sufami Turbo/", nall::basename(information.name), ".st/" }; directory::create(pathname); file::write({pathname, "manifest.bml"}, { "unverified\n", "\n", "cartridge\n", " rom name=program.rom size=0x", hex(buffer.size()), "\n", " ram name=save.ram size=0x2000\n", "\n", "information\n", " title: ", nall::basename(information.name), "\n" }); file::write({pathname, "program.rom"}, buffer); copySufamiTurboSaves(pathname); return pathname; } string Ananke::openSufamiTurbo(vector &buffer) { string sha256 = nall::sha256(buffer.data(), buffer.size()); string databaseText = string::read({configpath(), "ananke/database/Sufami Turbo.bml"}).strip(); if(databaseText.empty()) databaseText = string{Database::SufamiTurbo}.strip(); lstring databaseItem = databaseText.split("\n\n"); for(auto &item : databaseItem) { item.append("\n"); auto document = Markup::Document(item); if(document["release/information/sha256"].text() == sha256) { return createSufamiTurboDatabase(buffer, document, item); } } return createSufamiTurboHeuristic(buffer); } string Ananke::syncSufamiTurbo(const string &pathname) { auto buffer = file::read({pathname, "program.rom"}); if(buffer.size() == 0) return ""; auto save = file::read({pathname, "save.ram"}); if(save.size() == 0) save = file::read({pathname, "save.rwm"}); directory::remove(pathname); information.path = pathname; information.name = notdir(string{pathname}.rtrim<1>("/")); string outputPath = openSufamiTurbo(buffer); if(save.size()) file::write({outputPath, "save.ram"}, save); return outputPath; } nall/crc16.hpp000664 001750 001750 00000001017 12651764221 014264 0ustar00sergiosergio000000 000000 #ifndef NALL_CRC16_HPP #define NALL_CRC16_HPP #include namespace nall { inline uint16_t crc16_adjust(uint16_t crc16, uint8_t data) { for(unsigned n = 0; n < 8; n++) { if((crc16 & 1) ^ (data & 1)) crc16 = (crc16 >> 1) ^ 0x8408; else crc16 >>= 1; data >>= 1; } return crc16; } inline uint16_t crc16_calculate(const uint8_t* data, unsigned length) { uint16_t crc16 = ~0; for(unsigned n = 0; n < length; n++) { crc16 = crc16_adjust(crc16, data[n]); } return ~crc16; } } #endif nall/string/format.hpp000664 001750 001750 00000003063 12651764221 016147 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { template string format(const string& value) { if(precision == 0) return value; bool padright = precision >= 0; unsigned padding = abs(precision); if(padding <= value.size()) { if(padright) return substr(value, value.size() - padding); else return substr(value, 0, padding); } string buffer; buffer.resize(padding); buffer.clear(padchar); memcpy(buffer.data() + (padright ? padding - value.size() : 0), value, value.size()); return buffer; } template string hex(uintmax_t value) { string buffer; buffer.resize(sizeof(uintmax_t) * 2); unsigned size = 0; do { unsigned n = value & 15; buffer[size++] = n < 10 ? '0' + n : 'a' + n - 10; value >>= 4; } while(value); buffer.resize(size); buffer.reverse(); return format(buffer); } template string octal(uintmax_t value) { string buffer; buffer.resize(sizeof(uintmax_t) * 3); unsigned size = 0; do { buffer[size++] = '0' + (value & 7); value >>= 3; } while(value); buffer.resize(size); buffer.reverse(); return format(buffer); } template string binary(uintmax_t value) { string buffer; buffer.resize(sizeof(uintmax_t) * 8); unsigned size = 0; do { buffer[size++] = '0' + (value & 1); value >>= 1; } while(value); buffer.resize(size); buffer.reverse(); return format(buffer); } } #endif target-ethos/resource.rc000664 001750 001750 00000000105 12651764221 016467 0ustar00sergiosergio000000 000000 1 24 "../data/higan.Manifest" 2 ICON DISCARDABLE "../data/higan.ico" target-ethos/resource/audio.png000664 001750 001750 00000001120 12651764221 017746 0ustar00sergiosergio000000 000000 PNG  IHDRasBIT|dtEXtSoftwarewww.inkscape.org<IDAT8OSQ?D?@cBqdGX(X.$j:1] iąĨE:L]=A9{{*#F~: O 8ԁ i?TU^pzvy.MO@󼯨I333J :h5<ߨL~in H|V+Jё3x@nv8rm' h|͂ = 192, disables color add/sub effects uint8 ce_main, ce_sub; //priority level of src_n. to set src_n, //the priority of the pixel must be >pri_n uint8 pri_main, pri_sub; } pixel_cache[256]; uint8* bg_tiledata[3]; uint8* bg_tiledata_state[3]; //0 = valid, 1 = dirty template void render_bg_tile(uint16 tile_num); inline void flush_pixel_cache(); void alloc_tiledata_cache(); void flush_tiledata_cache(); void free_tiledata_cache(); //windows.cpp struct window_t { uint8 main[256], sub[256]; } window[6]; void build_window_table(uint8 bg, bool mainscreen); void build_window_tables(uint8 bg); //bg.cpp struct { uint16 tw, th; //tile width, height uint16 mx, my; //screen mask x, y uint16 scx, scy; //sc index offsets } bg_info[4]; void update_bg_info(); template uint16 bg_get_tile(uint16 x, uint16 y); template void render_line_bg(uint8 pri0_pos, uint8 pri1_pos); //oam.cpp struct sprite_item { uint8 width, height; uint16 x, y; uint8 character; bool use_nameselect; bool vflip, hflip; uint8 palette; uint8 priority; bool size; } sprite_list[128]; bool sprite_list_valid; unsigned active_sprite; uint8 oam_itemlist[32]; struct oam_tileitem { uint16 x, y, pri, pal, tile; bool hflip; } oam_tilelist[34]; enum { OAM_PRI_NONE = 4 }; uint8 oam_line_pal[256], oam_line_pri[256]; void update_sprite_list(unsigned addr, uint8 data); void build_sprite_list(); bool is_sprite_on_scanline(); void load_oam_tiles(); void render_oam_tile(int tile_num); void render_line_oam_rto(); void render_line_oam(uint8 pri0_pos, uint8 pri1_pos, uint8 pri2_pos, uint8 pri3_pos); //mode7.cpp template void render_line_mode7(uint8 pri0_pos, uint8 pri1_pos); //addsub.cpp inline uint16 addsub(uint32 x, uint32 y, bool halve); //line.cpp inline uint16 get_palette(uint8 index); inline uint16 get_direct_color(uint8 p, uint8 t); inline uint16 get_pixel_normal(uint32 x); inline uint16 get_pixel_swap(uint32 x); void render_line_output(); void render_line_clear(); shaders/Edge Detection.shader/edge-detection.fs000664 001750 001750 00000000774 12651764221 022573 0ustar00sergiosergio000000 000000 #version 150 uniform sampler2D source[]; uniform vec4 sourceSize[]; in Vertex { vec2 texCoord; }; out vec4 fragColor; vec3 grayscale(vec3 color) { return vec3(dot(color, vec3(0.3, 0.59, 0.11))); } void main() { vec2 offset = fract(texCoord * sourceSize[0].xy) - 0.5; offset /= sourceSize[0].xy; vec3 cx = texture(source[0], texCoord - offset).xyz; vec3 cy = texture(source[0], texCoord).xyz; vec3 cz = vec3(5.0 * grayscale(abs(cx - cy))); fragColor = vec4(clamp(cz, 0.0, 1.0), 1.0); } nall/ips.hpp000664 001750 001750 00000004611 12651764221 014144 0ustar00sergiosergio000000 000000 #ifndef NALL_IPS_HPP #define NALL_IPS_HPP #include #include #include namespace nall { struct ips { inline bool apply(); inline void source(const uint8_t* data, unsigned size); inline void modify(const uint8_t* data, unsigned size); inline ips(); inline ~ips(); uint8_t* data = nullptr; unsigned size = 0; const uint8_t* sourceData = nullptr; unsigned sourceSize = 0; const uint8_t* modifyData = nullptr; unsigned modifySize = 0; }; bool ips::apply() { if(modifySize < 8) return false; if(modifyData[0] != 'P') return false; if(modifyData[1] != 'A') return false; if(modifyData[2] != 'T') return false; if(modifyData[3] != 'C') return false; if(modifyData[4] != 'H') return false; if(data) delete[] data; data = new uint8_t[16 * 1024 * 1024 + 65536](); //maximum size of IPS patch + single-tag padding size = sourceSize; memcpy(data, sourceData, sourceSize); unsigned offset = 5; while(true) { unsigned address, length; if(offset > modifySize - 3) break; address = modifyData[offset++] << 16; address |= modifyData[offset++] << 8; address |= modifyData[offset++] << 0; if(address == 0x454f46) { //EOF if(offset == modifySize) return true; if(offset == modifySize - 3) { size = modifyData[offset++] << 16; size |= modifyData[offset++] << 8; size |= modifyData[offset++] << 0; return true; } } if(offset > modifySize - 2) break; length = modifyData[offset++] << 8; length |= modifyData[offset++] << 0; if(length) { //Copy if(offset > modifySize - length) break; while(length--) data[address++] = modifyData[offset++]; } else { //RLE if(offset > modifySize - 3) break; length = modifyData[offset++] << 8; length |= modifyData[offset++] << 0; if(length == 0) break; //illegal while(length--) data[address++] = modifyData[offset]; offset++; } size = max(size, address); } delete[] data; data = nullptr; return false; } void ips::source(const uint8_t* data, unsigned size) { sourceData = data, sourceSize = size; } void ips::modify(const uint8_t* data, unsigned size) { modifyData = data, modifySize = size; } ips::ips() { } ips::~ips() { if(data) delete[] data; if(sourceData) delete[] sourceData; if(modifyData) delete[] modifyData; } } #endif gba/ppu/state.hpp000664 001750 001750 00000002106 12651764221 015075 0ustar00sergiosergio000000 000000 struct Pixel { bool enable; unsigned priority; unsigned color; //objects only bool translucent; bool mosaic; alwaysinline void write(bool e) { enable = e; } alwaysinline void write(bool e, unsigned p, unsigned c) { enable = e; priority = p; color = c; } alwaysinline void write(bool e, unsigned p, unsigned c, bool t, bool m) { enable = e; priority = p; color = c; translucent = t; mosaic = m; } } layer[6][240]; bool windowmask[3][240]; unsigned vmosaic[5]; unsigned hmosaic[5]; struct Object { uint8 y; uint1 affine; uint1 affinesize; uint2 mode; uint1 mosaic; uint1 colors; //0 = 16, 1 = 256 uint2 shape; //0 = square, 1 = horizontal, 2 = vertical uint9 x; uint5 affineparam; uint1 hflip; uint1 vflip; uint2 size; uint10 character; uint2 priority; uint4 palette; //ancillary data unsigned width; unsigned height; } object[128]; struct ObjectParam { int16 pa; int16 pb; int16 pc; int16 pd; } objectparam[32]; struct Tile { uint10 character; uint1 hflip; uint1 vflip; uint4 palette; }; ananke/heuristics/game-boy.hpp000664 001750 001750 00000010475 12651764221 017547 0ustar00sergiosergio000000 000000 #ifndef NALL_EMULATION_GAME_BOY_HPP #define NALL_EMULATION_GAME_BOY_HPP #include #include namespace nall { struct GameBoyCartridge { string markup; inline GameBoyCartridge(uint8_t *data, unsigned size); //private: struct Information { string mapper; bool ram; bool battery; bool rtc; bool rumble; unsigned romsize; unsigned ramsize; bool cgb; bool cgbonly; } info; }; GameBoyCartridge::GameBoyCartridge(uint8_t *romdata, unsigned romsize) { markup = ""; if(romsize < 0x4000) return; info.mapper = "unknown"; info.ram = false; info.battery = false; info.rtc = false; info.rumble = false; info.romsize = 0; info.ramsize = 0; unsigned base = romsize - 0x8000; if(romdata[base + 0x0104] == 0xce && romdata[base + 0x0105] == 0xed && romdata[base + 0x0106] == 0x66 && romdata[base + 0x0107] == 0x66 && romdata[base + 0x0108] == 0xcc && romdata[base + 0x0109] == 0x0d && romdata[base + 0x0147] >= 0x0b && romdata[base + 0x0147] <= 0x0d ) { //MMM01 stores header at bottom of image //flip this around for consistency with all other mappers uint8_t header[0x8000]; memcpy(header, romdata + base, 0x8000); memmove(romdata + 0x8000, romdata, romsize - 0x8000); memcpy(romdata, header, 0x8000); } info.cgb = (romdata[0x0143] & 0x80) == 0x80; info.cgbonly = (romdata[0x0143] & 0xc0) == 0xc0; switch(romdata[0x0147]) { case 0x00: info.mapper = "none"; break; case 0x01: info.mapper = "MBC1"; break; case 0x02: info.mapper = "MBC1"; info.ram = true; break; case 0x03: info.mapper = "MBC1"; info.ram = true; info.battery = true; break; case 0x05: info.mapper = "MBC2"; info.ram = true; break; case 0x06: info.mapper = "MBC2"; info.ram = true; info.battery = true; break; case 0x08: info.mapper = "none"; info.ram = true; break; case 0x09: info.mapper = "MBC0"; info.ram = true; info.battery = true; break; case 0x0b: info.mapper = "MMM01"; break; case 0x0c: info.mapper = "MMM01"; info.ram = true; break; case 0x0d: info.mapper = "MMM01"; info.ram = true; info.battery = true; break; case 0x0f: info.mapper = "MBC3"; info.rtc = true; info.battery = true; break; case 0x10: info.mapper = "MBC3"; info.rtc = true; info.ram = true; info.battery = true; break; case 0x11: info.mapper = "MBC3"; break; case 0x12: info.mapper = "MBC3"; info.ram = true; break; case 0x13: info.mapper = "MBC3"; info.ram = true; info.battery = true; break; case 0x19: info.mapper = "MBC5"; break; case 0x1a: info.mapper = "MBC5"; info.ram = true; break; case 0x1b: info.mapper = "MBC5"; info.ram = true; info.battery = true; break; case 0x1c: info.mapper = "MBC5"; info.rumble = true; break; case 0x1d: info.mapper = "MBC5"; info.rumble = true; info.ram = true; break; case 0x1e: info.mapper = "MBC5"; info.rumble = true; info.ram = true; info.battery = true; break; case 0xfc: break; //Pocket Camera case 0xfd: break; //Bandai TAMA5 case 0xfe: info.mapper = "HuC3"; break; case 0xff: info.mapper = "HuC1"; info.ram = true; info.battery = true; break; } switch(romdata[0x0148]) { default: case 0x00: info.romsize = 2 * 16 * 1024; break; case 0x01: info.romsize = 4 * 16 * 1024; break; case 0x02: info.romsize = 8 * 16 * 1024; break; case 0x03: info.romsize = 16 * 16 * 1024; break; case 0x04: info.romsize = 32 * 16 * 1024; break; case 0x05: info.romsize = 64 * 16 * 1024; break; case 0x06: info.romsize = 128 * 16 * 1024; break; case 0x07: info.romsize = 256 * 16 * 1024; break; case 0x52: info.romsize = 72 * 16 * 1024; break; case 0x53: info.romsize = 80 * 16 * 1024; break; case 0x54: info.romsize = 96 * 16 * 1024; break; } switch(romdata[0x0149]) { default: case 0x00: info.ramsize = 0 * 1024; break; case 0x01: info.ramsize = 2 * 1024; break; case 0x02: info.ramsize = 8 * 1024; break; case 0x03: info.ramsize = 32 * 1024; break; } if(info.mapper == "MBC2") info.ramsize = 512; //512 x 4-bit markup = ""; markup.append("cartridge\n"); markup.append(" board type=", info.mapper, "\n"); markup.append(" rom name=program.rom size=0x", hex(romsize), "\n"); if(info.ramsize > 0) markup.append(" ram name=save.ram size=0x", hex(info.ramsize), "\n"); } } #endif fc/interface/interface.hpp000664 001750 001750 00000001603 12651764221 016711 0ustar00sergiosergio000000 000000 #ifndef FC_HPP namespace Famicom { #endif struct ID { enum : unsigned { System, Famicom, }; enum : unsigned { Manifest, ProgramROM, ProgramRAM, CharacterROM, CharacterRAM, }; enum : unsigned { Port1 = 1, Port2 = 2, }; }; struct Interface : Emulator::Interface { string title(); double videoFrequency(); double audioFrequency(); bool loaded(); string sha256(); unsigned group(unsigned id); void load(unsigned id); void save(); void load(unsigned id, const stream& stream); void save(unsigned id, const stream& stream); void unload(); void power(); void reset(); void run(); serializer serialize(); bool unserialize(serializer&); void cheatSet(const lstring&); void paletteUpdate(PaletteMode mode); Interface(); private: vector device; }; extern Interface* interface; #ifndef FC_HPP } #endif fc/cartridge/chip/vrc2.cpp000664 001750 001750 00000006355 12651764221 016560 0ustar00sergiosergio000000 000000 struct VRC2 : Chip { uint5 prg_bank[2]; uint8 chr_bank[8]; uint2 mirror; bool latch; unsigned prg_addr(unsigned addr) const { unsigned bank; switch(addr & 0xe000) { case 0x8000: bank = prg_bank[0]; break; case 0xa000: bank = prg_bank[1]; break; case 0xc000: bank = 0x1e; break; case 0xe000: bank = 0x1f; break; } return (bank * 0x2000) + (addr & 0x1fff); } unsigned chr_addr(unsigned addr) const { unsigned bank = chr_bank[addr / 0x0400]; return (bank * 0x0400) + (addr & 0x03ff); } unsigned ciram_addr(unsigned addr) const { switch(mirror) { case 0: return ((addr & 0x0400) >> 0) | (addr & 0x03ff); //vertical mirroring case 1: return ((addr & 0x0800) >> 1) | (addr & 0x03ff); //horizontal mirroring case 2: return 0x0000 | (addr & 0x03ff); //one-screen mirroring (first) case 3: return 0x0400 | (addr & 0x03ff); //one-screen mirroring (second) } throw; } uint8 ram_read(unsigned addr) { if(board.prgram.size == 0) { if((addr & 0xf000) == 0x6000) return cpu.mdr() | latch; return cpu.mdr(); } return board.prgram.read(addr & 0x1fff); } void ram_write(unsigned addr, uint8 data) { if(board.prgram.size == 0) { if((addr & 0xf000) == 0x6000) latch = data & 0x01; return; } return board.prgram.write(addr & 0x1fff, data); } void reg_write(unsigned addr, uint8 data) { switch(addr) { case 0x8000: case 0x8001: case 0x8002: case 0x8003: prg_bank[0] = data & 0x1f; break; case 0x9000: case 0x9001: case 0x9002: case 0x9003: mirror = data & 0x03; break; case 0xa000: case 0xa001: case 0xa002: case 0xa003: prg_bank[1] = data & 0x1f; break; case 0xb000: chr_bank[0] = (chr_bank[0] & 0xf0) | ((data & 0x0f) << 0); break; case 0xb001: chr_bank[0] = (chr_bank[0] & 0x0f) | ((data & 0x0f) << 4); break; case 0xb002: chr_bank[1] = (chr_bank[1] & 0xf0) | ((data & 0x0f) << 0); break; case 0xb003: chr_bank[1] = (chr_bank[1] & 0x0f) | ((data & 0x0f) << 4); break; case 0xc000: chr_bank[2] = (chr_bank[2] & 0xf0) | ((data & 0x0f) << 0); break; case 0xc001: chr_bank[2] = (chr_bank[2] & 0x0f) | ((data & 0x0f) << 4); break; case 0xc002: chr_bank[3] = (chr_bank[3] & 0xf0) | ((data & 0x0f) << 0); break; case 0xc003: chr_bank[3] = (chr_bank[3] & 0x0f) | ((data & 0x0f) << 4); break; case 0xd000: chr_bank[4] = (chr_bank[4] & 0xf0) | ((data & 0x0f) << 0); break; case 0xd001: chr_bank[4] = (chr_bank[4] & 0x0f) | ((data & 0x0f) << 4); break; case 0xd002: chr_bank[5] = (chr_bank[5] & 0xf0) | ((data & 0x0f) << 0); break; case 0xd003: chr_bank[5] = (chr_bank[5] & 0x0f) | ((data & 0x0f) << 4); break; case 0xe000: chr_bank[6] = (chr_bank[6] & 0xf0) | ((data & 0x0f) << 0); break; case 0xe001: chr_bank[6] = (chr_bank[6] & 0x0f) | ((data & 0x0f) << 4); break; case 0xe002: chr_bank[7] = (chr_bank[7] & 0xf0) | ((data & 0x0f) << 0); break; case 0xe003: chr_bank[7] = (chr_bank[7] & 0x0f) | ((data & 0x0f) << 4); break; } } void power() { } void reset() { for(auto& n : prg_bank) n = 0; for(auto& n : chr_bank) n = 0; mirror = 0; latch = 0; } void serialize(serializer& s) { for(auto& n : prg_bank) s.integer(n); for(auto& n : chr_bank) s.integer(n); s.integer(mirror); s.integer(latch); } VRC2(Board& board) : Chip(board) { } }; sfc/dsp/000700 001750 001750 00000000000 12656700342 013234 5ustar00sergiosergio000000 000000 processor/gsu/serialization.cpp000664 001750 001750 00000003424 12651764221 020111 0ustar00sergiosergio000000 000000 void GSU::serialize(serializer& s) { s.integer(regs.pipeline); s.integer(regs.ramaddr); s.integer(regs.r[ 0].data); s.integer(regs.r[ 1].data); s.integer(regs.r[ 2].data); s.integer(regs.r[ 3].data); s.integer(regs.r[ 4].data); s.integer(regs.r[ 5].data); s.integer(regs.r[ 6].data); s.integer(regs.r[ 7].data); s.integer(regs.r[ 8].data); s.integer(regs.r[ 9].data); s.integer(regs.r[10].data); s.integer(regs.r[11].data); s.integer(regs.r[12].data); s.integer(regs.r[13].data); s.integer(regs.r[14].data); s.integer(regs.r[15].data); s.integer(regs.sfr.irq); s.integer(regs.sfr.b); s.integer(regs.sfr.ih); s.integer(regs.sfr.il); s.integer(regs.sfr.alt2); s.integer(regs.sfr.alt1); s.integer(regs.sfr.r); s.integer(regs.sfr.g); s.integer(regs.sfr.ov); s.integer(regs.sfr.s); s.integer(regs.sfr.cy); s.integer(regs.sfr.z); s.integer(regs.pbr); s.integer(regs.rombr); s.integer(regs.rambr); s.integer(regs.cbr); s.integer(regs.scbr); s.integer(regs.scmr.ht); s.integer(regs.scmr.ron); s.integer(regs.scmr.ran); s.integer(regs.scmr.md); s.integer(regs.colr); s.integer(regs.por.obj); s.integer(regs.por.freezehigh); s.integer(regs.por.highnibble); s.integer(regs.por.dither); s.integer(regs.por.transparent); s.integer(regs.bramr); s.integer(regs.vcr); s.integer(regs.cfgr.irq); s.integer(regs.cfgr.ms0); s.integer(regs.clsr); s.integer(regs.romcl); s.integer(regs.romdr); s.integer(regs.ramcl); s.integer(regs.ramar); s.integer(regs.ramdr); s.integer(regs.sreg); s.integer(regs.dreg); s.array(cache.buffer); s.array(cache.valid); for(unsigned i = 0; i < 2; i++) { s.integer(pixelcache[i].offset); s.integer(pixelcache[i].bitpend); s.array(pixelcache[i].data); } } phoenix/windows/header.hpp000664 001750 001750 00000000612 12651764221 017014 0ustar00sergiosergio000000 000000 #define UNICODE #define WINVER 0x0501 #define _WIN32_WINNT 0x0501 #define _WIN32_IE 0x0600 #define __MSVCRT_VERSION__ 0x0601 #define NOMINMAX #include #include #include #include #include #include #include #include #include #define TBS_TRANSPARENTBKGND 0x1000 nall/beat/base.hpp000664 001750 001750 00000003664 12651764221 015205 0ustar00sergiosergio000000 000000 #ifndef NALL_BEAT_BASE_HPP #define NALL_BEAT_BASE_HPP namespace nall { struct beatBase { protected: file fp; uint32_t checksum; void ls(lstring& list, const string& path, const string& basepath) { lstring paths = directory::folders(path); for(auto& pathname : paths) { list.append(string{path, pathname}.ltrim<1>(basepath)); ls(list, {path, pathname}, basepath); } lstring files = directory::files(path); for(auto& filename : files) { list.append(string{path, filename}.ltrim<1>(basepath)); } } void write(uint8_t data) { fp.write(data); checksum = crc32_adjust(checksum, data); } void writeNumber(uint64_t data) { while(true) { uint64_t x = data & 0x7f; data >>= 7; if(data == 0) return write(0x80 | x); write(x); data--; } } void writeString(const string& text) { unsigned length = text.length(); for(unsigned n = 0; n < length; n++) write(text[n]); } void writeChecksum(uint32_t checksum) { write(checksum >> 0); write(checksum >> 8); write(checksum >> 16); write(checksum >> 24); } uint8_t read() { uint8_t data = fp.read(); checksum = crc32_adjust(checksum, data); return data; } uint64_t readNumber() { uint64_t data = 0, shift = 1; while(true) { uint8_t x = read(); data += (x & 0x7f) * shift; if(x & 0x80) break; shift <<= 7; data += shift; } return data; } string readString(unsigned length) { string text; text.reserve(length + 1); for(unsigned n = 0; n < length; n++) { text[n] = fp.read(); checksum = crc32_adjust(checksum, text[n]); } text[length] = 0; return text; } bool readChecksum(uint32_t source) { uint32_t checksum = 0; checksum |= read() << 0; checksum |= read() << 8; checksum |= read() << 16; checksum |= read() << 24; return checksum == source; } }; } #endif nall/string/markup/node.hpp000664 001750 001750 00000010204 12651764221 017076 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP //note: specific markups inherit from Markup::Node //vector will slice any data; so derived nodes must not contain data nor virtual functions //vector would incur a large performance penalty and greatly increased complexity namespace nall { namespace Markup { struct Node { string name; string data; bool attribute; bool exists() const { return !name.empty(); } string text() const { return string{data}.strip(); } intmax_t integer() const { return numeral(text()); } uintmax_t decimal() const { return numeral(text()); } void reset() { children.reset(); } bool evaluate(const string& query) const { if(query.empty()) return true; lstring rules = string{query}.replace(" ", "").split(","); for(auto& rule : rules) { enum class Comparator : unsigned { ID, EQ, NE, LT, LE, GT, GE }; auto comparator = Comparator::ID; if(rule.match("*!=*")) comparator = Comparator::NE; else if(rule.match("*<=*")) comparator = Comparator::LE; else if(rule.match("*>=*")) comparator = Comparator::GE; else if(rule.match ("*=*")) comparator = Comparator::EQ; else if(rule.match ("*<*")) comparator = Comparator::LT; else if(rule.match ("*>*")) comparator = Comparator::GT; if(comparator == Comparator::ID) { if(find(rule).size()) continue; return false; } lstring side; switch(comparator) { case Comparator::EQ: side = rule.split<1> ("="); break; case Comparator::NE: side = rule.split<1>("!="); break; case Comparator::LT: side = rule.split<1> ("<"); break; case Comparator::LE: side = rule.split<1>("<="); break; case Comparator::GT: side = rule.split<1> (">"); break; case Comparator::GE: side = rule.split<1>(">="); break; default: break; } string data = text(); if(side(0).empty() == false) { auto result = find(side(0)); if(result.size() == 0) return false; data = result(0).data; } switch(comparator) { case Comparator::EQ: if(data.match(side(1)) == true) continue; break; case Comparator::NE: if(data.match(side(1)) == false) continue; break; case Comparator::LT: if(numeral(data) < numeral(side(1))) continue; break; case Comparator::LE: if(numeral(data) <= numeral(side(1))) continue; break; case Comparator::GT: if(numeral(data) > numeral(side(1))) continue; break; case Comparator::GE: if(numeral(data) >= numeral(side(1))) continue; break; default: break; } // NOT REACHED return false; } return true; } vector find(const string& query) const { vector result; lstring path = query.split("/"); string name = path.take(0), rule; unsigned lo = 0u, hi = ~0u; if(name.match("*[*]")) { lstring side = name.split<1>("["); name = side(0); side = side(1).rtrim<1>("]").split<1>("-"); lo = side(0).empty() ? 0u : numeral(side(0)); hi = side(1).empty() ? ~0u : numeral(side(1)); } if(name.match("*(*)")) { lstring side = name.split<1>("("); name = side(0); rule = side(1).rtrim<1>(")"); } unsigned position = 0; for(auto& node : children) { if(node.name.match(name) == false) continue; if(node.evaluate(rule) == false) continue; bool inrange = position >= lo && position <= hi; position++; if(inrange == false) continue; if(path.size() == 0) result.append(node); else { auto list = node.find(path.merge("/")); for(auto& item : list) result.append(item); } } return result; } Node operator[](const string& query) const { auto result = find(query); return result(0); } vector::iterator begin() { return children.begin(); } vector::iterator end() { return children.end(); } const vector::constIterator begin() const { return children.begin(); } const vector::constIterator end() const { return children.end(); } Node() : attribute(false), level(0) {} protected: unsigned level; vector children; }; } } #endif sfc/chip/icd2/mmio/mmio.hpp000664 001750 001750 00000001177 12651764221 016650 0ustar00sergiosergio000000 000000 void render(const uint32* source); uint8 r6000_ly; //SGB BIOS' cache of LY uint8 r6000_row; //SGB BIOS' cache of ROW uint8 r6001; //VRAM conversion uint8 r6003; //control port uint8 r6004; //joypad 1 uint8 r6005; //joypad 2 uint8 r6006; //joypad 3 uint8 r6007; //joypad 4 uint8 r7000[16]; //JOYP packet data unsigned r7800; //VRAM offset uint8 mlt_req; //number of active joypads struct LCD { uint32 buffer[4 * 160 * 8]; //four tile rows of linear video data uint16 output[320]; //one tile row of 2bpp video data unsigned row; //active ICD2 rendering tile row } lcd; nall/string/eval/node.hpp000664 001750 001750 00000002137 12651764221 016534 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { namespace Eval { struct Node { enum class Type : unsigned { Null, Literal, Function, Subscript, Member, SuffixIncrement, SuffixDecrement, Reference, Dereference, LogicalNot, BitwiseNot, Positive, Negative, PrefixIncrement, PrefixDecrement, Multiply, Divide, Modulo, Add, Subtract, RotateLeft, RotateRight, ShiftLeft, ShiftRight, BitwiseAnd, BitwiseOr, BitwiseXor, Concatenate, Equal, NotEqual, LessThanEqual, GreaterThanEqual, LessThan, GreaterThan, LogicalAnd, LogicalOr, Coalesce, Condition, Assign, Create, //all assignment operators have the same precedence AssignMultiply, AssignDivide, AssignModulo, AssignAdd, AssignSubtract, AssignRotateLeft, AssignRotateRight, AssignShiftLeft, AssignShiftRight, AssignBitwiseAnd, AssignBitwiseOr, AssignBitwiseXor, AssignConcatenate, Separator, }; Type type; string literal; vector link; Node() : type(Type::Null) {} Node(Type type) : type(type) {} ~Node() { for(auto& node : link) delete node; } }; } } #endif phoenix/windows/widget/label.cpp000664 001750 001750 00000003601 12651764221 020122 0ustar00sergiosergio000000 000000 namespace phoenix { Size pLabel::minimumSize() { Size size = pFont::size(hfont, label.state.text); return {size.width, size.height}; } void pLabel::setText(string text) { SetWindowText(hwnd, utf16_t(text)); InvalidateRect(hwnd, 0, false); } void pLabel::constructor() { hwnd = CreateWindow(L"phoenix_label", L"", WS_CHILD, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&label); setDefaultFont(); setText(label.state.text); synchronize(); } void pLabel::destructor() { DestroyWindow(hwnd); } void pLabel::orphan() { destructor(); constructor(); } static LRESULT CALLBACK Label_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { HWND parentHwnd = GetParent(hwnd); Label* label = (Label*)GetWindowLongPtr(hwnd, GWLP_USERDATA); if(label == nullptr) return DefWindowProc(hwnd, msg, wparam, lparam); Window* window = (Window*)label->Sizable::state.window; if(window == nullptr) return DefWindowProc(hwnd, msg, wparam, lparam); switch(msg) { case WM_GETDLGCODE: return DLGC_STATIC | DLGC_WANTCHARS; case WM_ERASEBKGND: return TRUE; case WM_PAINT: { PAINTSTRUCT ps; BeginPaint(hwnd, &ps); RECT rc; GetClientRect(hwnd, &rc); DrawThemeParentBackground(hwnd, ps.hdc, &rc); SetBkMode(ps.hdc, TRANSPARENT); SelectObject(ps.hdc, ((Widget*)label)->p.hfont); unsigned length = GetWindowTextLength(hwnd); wchar_t text[length + 1]; GetWindowText(hwnd, text, length + 1); text[length] = 0; DrawText(ps.hdc, text, -1, &rc, DT_CALCRECT | DT_END_ELLIPSIS); unsigned height = rc.bottom; GetClientRect(hwnd, &rc); rc.top = (rc.bottom - height) / 2; rc.bottom = rc.top + height; DrawText(ps.hdc, text, -1, &rc, DT_LEFT | DT_END_ELLIPSIS); EndPaint(hwnd, &ps); return FALSE; } } return DefWindowProc(hwnd, msg, wparam, lparam); } } phoenix/cocoa/widget/horizontal-scroller.hpp000664 001750 001750 00000001252 12651764221 022456 0ustar00sergiosergio000000 000000 @interface CocoaHorizontalScroller : NSScroller { @public phoenix::HorizontalScroller* horizontalScroller; } -(id) initWith:(phoenix::HorizontalScroller&)horizontalScroller; -(void) update; -(IBAction) scroll:(id)sender; @end namespace phoenix { struct pHorizontalScroller : public pWidget { HorizontalScroller& horizontalScroller; CocoaHorizontalScroller* cocoaHorizontalScroller = nullptr; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pHorizontalScroller(HorizontalScroller& horizontalScroller) : pWidget(horizontalScroller), horizontalScroller(horizontalScroller) {} void constructor(); void destructor(); }; } phoenix/qt/widget/list-view.cpp000664 001750 001750 00000011401 12651764221 017715 0ustar00sergiosergio000000 000000 namespace phoenix { void pListView::append(const lstring& text) { locked = true; auto items = qtListView->findItems("", Qt::MatchContains); QTreeWidgetItem* item = new QTreeWidgetItem(qtListView); item->setData(0, Qt::UserRole, (unsigned)items.size()); if(listView.state.checkable) item->setCheckState(0, Qt::Unchecked); for(unsigned position = 0; position < text.size(); position++) { item->setText(position, QString::fromUtf8(text[position])); } locked = false; } void pListView::autoSizeColumns() { for(unsigned n = 0; n < listView.state.headerText.size(); n++) qtListView->resizeColumnToContents(n); } void pListView::remove(unsigned selection) { locked = true; QTreeWidgetItem* item = qtListView->topLevelItem(selection); if(item == nullptr) return; delete item; locked = false; } void pListView::reset() { qtListView->clear(); } void pListView::setCheckable(bool checkable) { if(checkable) { auto items = qtListView->findItems("", Qt::MatchContains); for(unsigned n = 0; n < items.size(); n++) items[n]->setCheckState(0, Qt::Unchecked); } } void pListView::setChecked(unsigned selection, bool checked) { locked = true; QTreeWidgetItem* item = qtListView->topLevelItem(selection); if(item) item->setCheckState(0, checked ? Qt::Checked : Qt::Unchecked); locked = false; } void pListView::setHeaderText(const lstring& text) { QStringList labels; for(auto& column : text) labels << QString::fromUtf8(column); qtListView->setColumnCount(text.size()); qtListView->setAlternatingRowColors(text.size() >= 2); qtListView->setHeaderLabels(labels); autoSizeColumns(); } void pListView::setHeaderVisible(bool visible) { qtListView->setHeaderHidden(!visible); autoSizeColumns(); } void pListView::setImage(unsigned selection, unsigned position, const nall::image& image) { QTreeWidgetItem* item = qtListView->topLevelItem(selection); if(item) { if(image.empty() == 0) item->setIcon(position, CreateIcon(image)); if(image.empty() == 1) item->setIcon(position, QIcon()); } } void pListView::setSelected(bool selected) { QTreeWidgetItem* item = qtListView->currentItem(); if(item) item->setSelected(selected); } void pListView::setSelection(unsigned selection) { locked = true; QTreeWidgetItem* item = qtListView->currentItem(); if(item) item->setSelected(false); item = qtListView->topLevelItem(selection); if(item) qtListView->setCurrentItem(item); locked = false; } void pListView::setText(unsigned selection, unsigned position, string text) { locked = true; QTreeWidgetItem* item = qtListView->topLevelItem(selection); if(item) item->setText(position, QString::fromUtf8(text)); locked = false; } void pListView::constructor() { qtWidget = qtListView = new QTreeWidget; qtListView->setAllColumnsShowFocus(true); qtListView->setRootIsDecorated(false); connect(qtListView, SIGNAL(itemActivated(QTreeWidgetItem*, int)), SLOT(onActivate())); connect(qtListView, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), SLOT(onChange(QTreeWidgetItem*))); connect(qtListView, SIGNAL(itemChanged(QTreeWidgetItem*, int)), SLOT(onToggle(QTreeWidgetItem*))); pWidget::synchronizeState(); setCheckable(listView.state.checkable); setHeaderText(listView.state.headerText.size() ? listView.state.headerText : lstring{ " " }); setHeaderVisible(listView.state.headerVisible); for(auto& row : listView.state.text) append(row); if(listView.state.checkable) { for(unsigned n = 0; n < listView.state.checked.size(); n++) { setChecked(n, listView.state.checked[n]); } } setSelected(listView.state.selected); if(listView.state.selected) setSelection(listView.state.selection); autoSizeColumns(); } void pListView::destructor() { delete qtListView; qtWidget = qtListView = nullptr; } void pListView::orphan() { destructor(); constructor(); } void pListView::onActivate() { if(locked == false && listView.onActivate) listView.onActivate(); } void pListView::onChange(QTreeWidgetItem* item) { bool selected = listView.state.selected; unsigned selection = listView.state.selection; if(item) { item->setSelected(true); //Qt bug workaround: clicking items with mouse does not mark items as selected listView.state.selected = true; listView.state.selection = item->data(0, Qt::UserRole).toUInt(); } else { listView.state.selected = false; listView.state.selection = 0; } if(selected != listView.state.selected || selection != listView.state.selection) { if(!locked && listView.onChange) listView.onChange(); } } void pListView::onToggle(QTreeWidgetItem* item) { unsigned selection = item->data(0, Qt::UserRole).toUInt(); listView.state.checked[selection] = (item->checkState(0) == Qt::Checked); if(!locked && listView.onToggle) listView.onToggle(selection); } } ruby/input/carbon.cpp000664 001750 001750 00000011224 12651764221 016000 0ustar00sergiosergio000000 000000 namespace ruby { struct pInputCarbon { struct Key { uint8_t id; string name; }; vector keys; struct Keyboard { HID::Keyboard hid; } kb; bool cap(const string& name) { if(name == Input::KeyboardSupport) return true; return false; } any get(const string& name) { return false; } bool set(const string& name, const any& value) { return false; } bool acquire() { return false; } bool unacquire() { return false; } bool acquired() { return false; } void assign(HID::Device& hid, unsigned groupID, unsigned inputID, int16_t value) { auto& group = hid.group[groupID]; if(group.input[inputID].value == value) return; if(input.onChange) input.onChange(hid, groupID, inputID, group.input[inputID].value, value); group.input[inputID].value = value; } void poll(vector& devices) { KeyMap keymap; GetKeys(keymap); uint8_t* buffer = (uint8_t*)keymap; unsigned inputID = 0; for(auto& key : keys) { bool value = buffer[key.id >> 3] & (1 << (key.id & 7))); assign(kb.hid, HID::Keyboard::GroupID::Button, inputID++, value); } devices.append(&kb.hid); } bool rumble(uint64_t id, bool enable) { return false; } bool init() { keys.append({0x35, "Escape"}); keys.append({0x7a, "F1"}); keys.append({0x78, "F2"}); keys.append({0x63, "F3"}); keys.append({0x76, "F4"}); keys.append({0x60, "F5"}); keys.append({0x61, "F6"}); keys.append({0x62, "F7"}); keys.append({0x64, "F8"}); keys.append({0x65, "F9"}); keys.append({0x6d, "F10"}); keys.append({0x67, "F11"}); //keys.append({0x??, "F12"}); keys.append({0x69, "PrintScreen"}); //keys.append({0x??, "ScrollLock"}); keys.append({0x71, "Pause"}); keys.append({0x32, "Tilde"}); keys.append({0x12, "Num1"}); keys.append({0x13, "Num2"}); keys.append({0x14, "Num3"}); keys.append({0x15, "Num4"}); keys.append({0x17, "Num5"}); keys.append({0x16, "Num6"}); keys.append({0x1a, "Num7"}); keys.append({0x1c, "Num8"}); keys.append({0x19, "Num9"}); keys.append({0x1d, "Num0"}); keys.append({0x1b, "Dash"}); keys.append({0x18, "Equal"}); keys.append({0x33, "Backspace"}); keys.append({0x72, "Insert"}); keys.append({0x75, "Delete"}); keys.append({0x73, "Home"}); keys.append({0x77, "End"}); keys.append({0x74, "PageUp"}); keys.append({0x79, "PageDown"}); keys.append({0x00, "A"}); keys.append({0x0b, "B"}); keys.append({0x08, "C"}); keys.append({0x02, "D"}); keys.append({0x0e, "E"}); keys.append({0x03, "F"}); keys.append({0x05, "G"}); keys.append({0x04, "H"}); keys.append({0x22, "I"}); keys.append({0x26, "J"}); keys.append({0x28, "K"}); keys.append({0x25, "L"}); keys.append({0x2e, "M"}); keys.append({0x2d, "N"}); keys.append({0x1f, "O"}); keys.append({0x23, "P"}); keys.append({0x0c, "Q"}); keys.append({0x0f, "R"}); keys.append({0x01, "S"}); keys.append({0x11, "T"}); keys.append({0x20, "U"}); keys.append({0x09, "V"}); keys.append({0x0d, "W"}); keys.append({0x07, "X"}); keys.append({0x10, "Y"}); keys.append({0x06, "Z"}); keys.append({0x21, "LeftBracket"}); keys.append({0x1e, "RightBracket"}); keys.append({0x2a, "Backslash"}); keys.append({0x29, "Semicolon"}); keys.append({0x27, "Apostrophe"}); keys.append({0x2b, "Comma"}); keys.append({0x2f, "Period"}); keys.append({0x2c, "Slash"}); keys.append({0x53, "Keypad1"}); keys.append({0x54, "Keypad2"}); keys.append({0x55, "Keypad3"}); keys.append({0x56, "Keypad4"}); keys.append({0x57, "Keypad5"}); keys.append({0x58, "Keypad6"}); keys.append({0x59, "Keypad7"}); keys.append({0x5b, "Keypad8"}); keys.append({0x5c, "Keypad9"}); keys.append({0x52, "Keypad0"}); //keys.append({0x??, "Point"}); keys.append({0x4c, "Enter"}); keys.append({0x45, "Add"}); keys.append({0x4e, "Subtract"}); keys.append({0x43, "Multiply"}); keys.append({0x4b, "Divide"}); keys.append({0x47, "NumLock"}); //keys.append({0x39, "CapsLock"}); keys.append({0x7e, "Up"}); keys.append({0x7d, "Down"}); keys.append({0x7b, "Left"}); keys.append({0x7c, "Right"}); keys.append({0x30, "Tab"}); keys.append({0x24, "Return"}); keys.append({0x31, "Spacebar"}); //keys.append({0x??, "Menu"}); keys.append({0x38, "Shift"}); keys.append({0x3b, "Control"}); keys.append({0x3a, "Alt"}); keys.append({0x37, "Super"}); kb.hid.id = 1; for(auto& key : keys) kb.hid.button().append({key.name}); return true; } void term() { } }; DeclareInput(Carbon) }; sfc/alt/ppu-balanced/render/bg.cpp000664 001750 001750 00000015020 12651764221 020147 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP //called once at the start of every rendered scanline void PPU::update_bg_info() { const unsigned hires = (regs.bg_mode == 5 || regs.bg_mode == 6); const unsigned width = (!hires ? 256 : 512); for(unsigned bg = 0; bg < 4; bg++) { bg_info[bg].th = (regs.bg_tilesize[bg] ? 4 : 3); bg_info[bg].tw = (hires ? 4 : bg_info[bg].th); bg_info[bg].mx = (bg_info[bg].th == 4 ? (width << 1) : width); bg_info[bg].my = bg_info[bg].mx; if(regs.bg_scsize[bg] & 0x01) bg_info[bg].mx <<= 1; if(regs.bg_scsize[bg] & 0x02) bg_info[bg].my <<= 1; bg_info[bg].mx--; bg_info[bg].my--; bg_info[bg].scy = (regs.bg_scsize[bg] & 0x02) ? (32 << 5) : 0; bg_info[bg].scx = (regs.bg_scsize[bg] & 0x01) ? (32 << 5) : 0; if(regs.bg_scsize[bg] == 3) bg_info[bg].scy <<= 1; } } template uint16 PPU::bg_get_tile(uint16 x, uint16 y) { x = (x & bg_info[bg].mx) >> bg_info[bg].tw; y = (y & bg_info[bg].my) >> bg_info[bg].th; uint16 pos = ((y & 0x1f) << 5) + (x & 0x1f); if(y & 0x20) pos += bg_info[bg].scy; if(x & 0x20) pos += bg_info[bg].scx; const uint16 addr = regs.bg_scaddr[bg] + (pos << 1); return vram[addr] + (vram[addr + 1] << 8); } #define setpixel_main(x) \ if(pixel_cache[x].pri_main < tile_pri) { \ pixel_cache[x].pri_main = tile_pri; \ pixel_cache[x].bg_main = bg; \ pixel_cache[x].src_main = col; \ pixel_cache[x].ce_main = false; \ } #define setpixel_sub(x) \ if(pixel_cache[x].pri_sub < tile_pri) { \ pixel_cache[x].pri_sub = tile_pri; \ pixel_cache[x].bg_sub = bg; \ pixel_cache[x].src_sub = col; \ pixel_cache[x].ce_sub = false; \ } template void PPU::render_line_bg(uint8 pri0_pos, uint8 pri1_pos) { if(layer_enabled[bg][0] == false) pri0_pos = 0; if(layer_enabled[bg][1] == false) pri1_pos = 0; if(pri0_pos + pri1_pos == 0) return; if(regs.bg_enabled[bg] == false && regs.bgsub_enabled[bg] == false) return; const bool bg_enabled = regs.bg_enabled[bg]; const bool bgsub_enabled = regs.bgsub_enabled[bg]; const uint16 opt_valid_bit = (bg == BG1) ? 0x2000 : (bg == BG2) ? 0x4000 : 0x0000; const uint8 bgpal_index = (mode == 0 ? (bg << 5) : 0); const uint8 pal_size = 2 << color_depth; //<<2 (*4), <<4 (*16), <<8 (*256) const uint16 tile_mask = 0x0fff >> color_depth; //0x0fff, 0x07ff, 0x03ff //4 + color_depth = >>(4-6) -- / {16, 32, 64 } bytes/tile //index is a tile number count to add to base tile number const unsigned tiledata_index = regs.bg_tdaddr[bg] >> (4 + color_depth); const uint8 *bg_td = bg_tiledata[color_depth]; const uint8 *bg_td_state = bg_tiledata_state[color_depth]; const uint8 tile_width = bg_info[bg].tw; const uint8 tile_height = bg_info[bg].th; const uint16 mask_x = bg_info[bg].mx; //screen width mask const uint16 mask_y = bg_info[bg].my; //screen height mask uint16 y = regs.bg_y[bg]; uint16 hscroll = regs.bg_hofs[bg]; uint16 vscroll = regs.bg_vofs[bg]; const unsigned hires = (mode == 5 || mode == 6); const unsigned width = (!hires ? 256 : 512); if(hires) { hscroll <<= 1; if(regs.interlace) y = (y << 1) + field(); } uint16 hval, vval; uint16 tile_pri, tile_num; uint8 pal_index, pal_num; uint16 hoffset, voffset, opt_x, col; bool mirror_x, mirror_y; const uint8* tile_ptr; const uint16* mtable = mosaic_table[regs.mosaic_enabled[bg] ? regs.mosaic_size : 0]; const bool is_opt_mode = (mode == 2 || mode == 4 || mode == 6); const bool is_direct_color_mode = (regs.direct_color == true && bg == BG1 && (mode == 3 || mode == 4)); build_window_tables(bg); const uint8* wt_main = window[bg].main; const uint8* wt_sub = window[bg].sub; uint16 prev_x = 0xffff, prev_y = 0xffff, prev_optx = 0xffff; for(uint16 x = 0; x < width; x++) { hoffset = mtable[x] + hscroll; voffset = y + vscroll; if(is_opt_mode) { opt_x = (x + (hscroll & 7)); //tile 0 is unaffected by OPT mode... if(opt_x >= 8) { //cache tile data in hval, vval if possible if((opt_x >> 3) != (prev_optx >> 3)) { prev_optx = opt_x; hval = bg_get_tile((opt_x - 8) + (regs.bg_hofs[BG3] & ~7), regs.bg_vofs[BG3]); if(mode != 4) { vval = bg_get_tile((opt_x - 8) + (regs.bg_hofs[BG3] & ~7), regs.bg_vofs[BG3] + 8); } } if(mode == 4) { if(hval & opt_valid_bit) { if(!(hval & 0x8000)) { hoffset = opt_x + (hval & ~7); } else { voffset = y + hval; } } } else { if(hval & opt_valid_bit) { hoffset = opt_x + (hval & ~7); } if(vval & opt_valid_bit) { voffset = y + vval; } } } } hoffset &= mask_x; voffset &= mask_y; if((hoffset >> 3) != prev_x || (voffset >> 3) != prev_y) { prev_x = (hoffset >> 3); prev_y = (voffset >> 3); tile_num = bg_get_tile(hoffset, voffset); //format = vhopppcc cccccccc mirror_y = (tile_num & 0x8000); mirror_x = (tile_num & 0x4000); tile_pri = (tile_num & 0x2000) ? pri1_pos : pri0_pos; pal_num = ((tile_num >> 10) & 7); pal_index = bgpal_index + (pal_num << pal_size); if(tile_width == 4) { //16x16 horizontal tile mirroring if((bool)(hoffset & 8) != mirror_x) tile_num++; } if(tile_height == 4) { //16x16 vertical tile mirroring if((bool)(voffset & 8) != mirror_y) tile_num += 16; } tile_num &= 0x03ff; tile_num += tiledata_index; tile_num &= tile_mask; if(bg_td_state[tile_num] == 1) { render_bg_tile(tile_num); } if(mirror_y) voffset ^= 7; //invert y tile pos tile_ptr = bg_td + (tile_num * 64) + ((voffset & 7) * 8); } if(mirror_x) hoffset ^= 7; //invert x tile pos col = *(tile_ptr + (hoffset & 7)); if(col) { if(is_direct_color_mode) { col = get_direct_color(pal_num, col); } else { col = get_palette(col + pal_index); } if(!hires) { if(bg_enabled == true && !wt_main[x]) { setpixel_main(x); } if(bgsub_enabled == true && !wt_sub[x]) { setpixel_sub(x); } } else { int hx = x >> 1; if(x & 1) { if(bg_enabled == true && !wt_main[hx]) { setpixel_main(hx); } } else { if(bgsub_enabled == true && !wt_sub[hx]) { setpixel_sub(hx); } } } } } } #undef setpixel_main #undef setpixel_sub #endif nall/beat/archive.hpp000664 001750 001750 00000004454 12651764221 015712 0ustar00sergiosergio000000 000000 #ifndef NALL_BEAT_ARCHIVE_HPP #define NALL_BEAT_ARCHIVE_HPP #include namespace nall { struct beatArchive : beatBase { bool create(const string& beatname, string pathname, const string& metadata = "") { if(fp.open(beatname, file::mode::write) == false) return false; if(pathname.endsWith("/") == false) pathname.append("/"); checksum = ~0; writeString("BPA1"); writeNumber(metadata.length()); writeString(metadata); lstring list; ls(list, pathname, pathname); for(auto &name : list) { if(name.endsWith("/")) { name.rtrim<1>("/"); writeNumber(0 | ((name.length() - 1) << 1)); writeString(name); } else { file stream; if(stream.open({pathname, name}, file::mode::read) == false) return false; writeNumber(1 | ((name.length() - 1) << 1)); writeString(name); unsigned size = stream.size(); writeNumber(size); uint32_t checksum = ~0; while(size--) { uint8_t data = stream.read(); write(data); checksum = crc32_adjust(checksum, data); } writeChecksum(~checksum); } } writeChecksum(~checksum); fp.close(); return true; } bool unpack(const string& beatname, string pathname) { if(fp.open(beatname, file::mode::read) == false) return false; if(pathname.endsWith("/") == false) pathname.append("/"); checksum = ~0; if(readString(4) != "BPA1") return false; unsigned length = readNumber(); while(length--) read(); directory::create(pathname); while(fp.offset() < fp.size() - 4) { unsigned data = readNumber(); string name = readString((data >> 1) + 1); if(name.find("\\") || name.find("../")) return false; //block path exploits if((data & 1) == 0) { directory::create({pathname, name}); } else { file stream; if(stream.open({pathname, name}, file::mode::write) == false) return false; unsigned size = readNumber(); uint32_t checksum = ~0; while(size--) { uint8_t data = read(); stream.write(data); checksum = crc32_adjust(checksum, data); } if(readChecksum(~checksum) == false) return false; } } return readChecksum(~checksum); } }; } #endif phoenix/gtk/widget/list-view.cpp000664 001750 001750 00000017121 12651764221 020063 0ustar00sergiosergio000000 000000 namespace phoenix { static void ListView_activate(GtkTreeView* treeView, GtkTreePath* path, GtkTreeViewColumn* column, ListView* self) { char* pathname = gtk_tree_path_to_string(path); unsigned selection = decimal(pathname); g_free(pathname); self->state.selection = selection; if(self->onActivate) self->onActivate(); } static void ListView_change(GtkTreeView* treeView, ListView* self) { GtkTreeIter iter; if(!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(treeView), 0, &iter)) return; //should not be possible char* path = gtk_tree_model_get_string_from_iter(gtk_tree_view_get_model(treeView), &iter); unsigned selection = decimal(path); g_free(path); if(!self->state.selected || self->state.selection != selection) { self->state.selected = true; self->state.selection = selection; if(self->onChange) self->onChange(); } } static void ListView_toggle(GtkCellRendererToggle* cell, gchar* path, ListView* self) { unsigned selection = decimal(path); self->setChecked(selection, !self->checked(selection)); if(self->onToggle) self->onToggle(selection); } void pListView::append(const lstring& text) { GtkTreeIter iter; gtk_list_store_append(store, &iter); for(unsigned n = 0; n < text.size(); n++) { gtk_list_store_set(store, &iter, 1 + n * 2 + 1, (const char*)text[n], -1); } } void pListView::autoSizeColumns() { gtk_tree_view_columns_autosize(GTK_TREE_VIEW(subWidget)); } bool pListView::focused() { return GTK_WIDGET_HAS_FOCUS(subWidget); } void pListView::remove(unsigned selection) { GtkTreeModel* model = gtk_tree_view_get_model(GTK_TREE_VIEW(subWidget)); GtkTreeIter iter; gtk_tree_model_get_iter_from_string(model, &iter, string(selection)); gtk_list_store_remove(store, &iter); } void pListView::reset() { listView.state.selected = false; listView.state.selection = 0; gtk_list_store_clear(GTK_LIST_STORE(store)); gtk_tree_view_set_model(GTK_TREE_VIEW(subWidget), GTK_TREE_MODEL(store)); //reset gtk_scrolled_window scrollbar position to 0,0 (top-left), as ListView is now empty gtk_scrolled_window_set_hadjustment(GTK_SCROLLED_WINDOW(gtkWidget), 0); gtk_scrolled_window_set_vadjustment(GTK_SCROLLED_WINDOW(gtkWidget), 0); } void pListView::setCheckable(bool checkable) { gtk_cell_renderer_set_visible(column(0).checkbutton, checkable); } void pListView::setChecked(unsigned selection, bool checked) { GtkTreeModel* model = gtk_tree_view_get_model(GTK_TREE_VIEW(subWidget)); GtkTreeIter iter; gtk_tree_model_get_iter_from_string(model, &iter, string(selection)); gtk_list_store_set(GTK_LIST_STORE(model), &iter, 0, checked, -1); } void pListView::setHeaderText(const lstring& text) { destructor(); constructor(); } void pListView::setHeaderVisible(bool visible) { gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(subWidget), visible); } void pListView::setImage(unsigned selection, unsigned position, const image& image) { GtkTreeModel* model = gtk_tree_view_get_model(GTK_TREE_VIEW(subWidget)); GtkTreeIter iter; gtk_tree_model_get_iter_from_string(model, &iter, string(selection)); if(image.empty() == false) { GdkPixbuf* pixbuf = CreatePixbuf(image, true); gtk_list_store_set(store, &iter, 1 + position * 2, pixbuf, -1); } else { gtk_list_store_set(store, &iter, 1 + position * 2, nullptr, -1); } } void pListView::setSelected(bool selected) { if(selected == false) { GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(subWidget)); gtk_tree_selection_unselect_all(selection); } else { setSelection(listView.state.selection); } } void pListView::setSelection(unsigned selection) { GtkTreeSelection* treeSelection = gtk_tree_view_get_selection(GTK_TREE_VIEW(subWidget)); gtk_tree_selection_unselect_all(treeSelection); GtkTreePath* path = gtk_tree_path_new_from_string(string{selection}); gtk_tree_selection_select_path(treeSelection, path); gtk_tree_view_set_cursor(GTK_TREE_VIEW(subWidget), path, nullptr, false); gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(subWidget), path, nullptr, true, 0.5, 0.0); gtk_tree_path_free(path); } void pListView::setText(unsigned selection, unsigned position, string text) { GtkTreeModel* model = gtk_tree_view_get_model(GTK_TREE_VIEW(subWidget)); GtkTreeIter iter; gtk_tree_model_get_iter_from_string(model, &iter, string(selection)); gtk_list_store_set(store, &iter, 1 + position * 2 + 1, (const char*)text, -1); } void pListView::constructor() { gtkWidget = gtk_scrolled_window_new(0, 0); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(gtkWidget), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(gtkWidget), GTK_SHADOW_ETCHED_IN); lstring headerText = listView.state.headerText; if(headerText.size() == 0) headerText.append(""); //ListView must have at least one column column.reset(); vector gtype; for(auto& text : headerText) { GtkColumn cell; cell.label = gtk_label_new(text); cell.column = gtk_tree_view_column_new(); gtk_tree_view_column_set_resizable(cell.column, true); gtk_tree_view_column_set_title(cell.column, ""); if(column.size() == 0) { //first column checkbutton cell.checkbutton = gtk_cell_renderer_toggle_new(); gtk_tree_view_column_pack_start(cell.column, cell.checkbutton, false); gtk_tree_view_column_set_attributes(cell.column, cell.checkbutton, "active", gtype.size(), nullptr); gtype.append(G_TYPE_BOOLEAN); g_signal_connect(cell.checkbutton, "toggled", G_CALLBACK(ListView_toggle), (gpointer)&listView); } cell.icon = gtk_cell_renderer_pixbuf_new(); gtk_tree_view_column_pack_start(cell.column, cell.icon, false); gtk_tree_view_column_set_attributes(cell.column, cell.icon, "pixbuf", gtype.size(), nullptr); gtype.append(GDK_TYPE_PIXBUF); cell.text = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start(cell.column, cell.text, false); gtk_tree_view_column_set_attributes(cell.column, cell.text, "text", gtype.size(), nullptr); gtype.append(G_TYPE_STRING); column.append(cell); } store = gtk_list_store_newv(gtype.size(), gtype.data()); subWidget = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); gtk_container_add(GTK_CONTAINER(gtkWidget), subWidget); g_object_unref(G_OBJECT(store)); for(auto& cell : column) { gtk_tree_view_column_set_widget(GTK_TREE_VIEW_COLUMN(cell.column), cell.label); gtk_tree_view_append_column(GTK_TREE_VIEW(subWidget), cell.column); gtk_widget_show(cell.label); } gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(subWidget), headerText.size() >= 2); //two or more columns + checkbutton column gtk_tree_view_set_search_column(GTK_TREE_VIEW(subWidget), 2); g_signal_connect(G_OBJECT(subWidget), "cursor-changed", G_CALLBACK(ListView_change), (gpointer)&listView); g_signal_connect(G_OBJECT(subWidget), "row-activated", G_CALLBACK(ListView_activate), (gpointer)&listView); gtk_widget_show(subWidget); setHeaderVisible(listView.state.headerVisible); setCheckable(listView.state.checkable); for(auto& text : listView.state.text) append(text); for(unsigned n = 0; n < listView.state.checked.size(); n++) setChecked(n, listView.state.checked[n]); if(listView.state.selected) setSelection(listView.state.selection); autoSizeColumns(); } void pListView::destructor() { gtk_widget_destroy(subWidget); gtk_widget_destroy(gtkWidget); } void pListView::orphan() { destructor(); constructor(); } void pListView::setFocused() { gtk_widget_grab_focus(subWidget); } void pListView::setFont(string font) { pFont::setFont(gtkWidget, font); for(auto& cell : column) pFont::setFont(cell.label, font); } } ruby/audio/xaudio2.cpp000664 001750 001750 00000012127 12651764221 016054 0ustar00sergiosergio000000 000000 /* audio.xaudio2 (2010-08-14) author: OV2 */ #include "xaudio2.hpp" #include namespace ruby { class pAudioXAudio2: public IXAudio2VoiceCallback { public: IXAudio2* pXAudio2; IXAudio2MasteringVoice* pMasterVoice; IXAudio2SourceVoice* pSourceVoice; //inherited from IXAudio2VoiceCallback STDMETHODIMP_(void) OnBufferStart(void* pBufferContext){} STDMETHODIMP_(void) OnLoopEnd(void* pBufferContext){} STDMETHODIMP_(void) OnStreamEnd() {} STDMETHODIMP_(void) OnVoiceError(void* pBufferContext, HRESULT Error) {} STDMETHODIMP_(void) OnVoiceProcessingPassEnd() {} STDMETHODIMP_(void) OnVoiceProcessingPassStart(UINT32 BytesRequired) {} struct { unsigned buffers; unsigned latency; uint32_t* buffer; unsigned bufferoffset; volatile long submitbuffers; unsigned writebuffer; } device; struct { bool synchronize; unsigned frequency; unsigned latency; } settings; bool cap(const string& name) { if(name == Audio::Synchronize) return true; if(name == Audio::Frequency) return true; if(name == Audio::Latency) return true; return false; } any get(const string& name) { if(name == Audio::Synchronize) return settings.synchronize; if(name == Audio::Frequency) return settings.frequency; if(name == Audio::Latency) return settings.latency; return false; } bool set(const string& name, const any& value) { if(name == Audio::Synchronize) { settings.synchronize = any_cast(value); if(pXAudio2) clear(); return true; } if(name == Audio::Frequency) { settings.frequency = any_cast(value); if(pXAudio2) init(); return true; } if(name == Audio::Latency) { settings.latency = any_cast(value); if(pXAudio2) init(); return true; } return false; } void pushbuffer(unsigned bytes, uint32_t* pAudioData) { XAUDIO2_BUFFER xa2buffer = {0}; xa2buffer.AudioBytes = bytes; xa2buffer.pAudioData = reinterpret_cast(pAudioData); xa2buffer.pContext = 0; InterlockedIncrement(&device.submitbuffers); pSourceVoice->SubmitSourceBuffer(&xa2buffer); } void sample(uint16_t left, uint16_t right) { device.buffer[device.writebuffer * device.latency + device.bufferoffset++] = left + (right << 16); if(device.bufferoffset < device.latency) return; device.bufferoffset = 0; if(device.submitbuffers == device.buffers - 1) { if(settings.synchronize == true) { //wait until there is at least one other free buffer for the next sample while(device.submitbuffers == device.buffers - 1) { //Sleep(0); } } else { //we need one free buffer for the next sample, so ignore the current contents return; } } pushbuffer(device.latency * 4,device.buffer + device.writebuffer * device.latency); device.writebuffer = (device.writebuffer + 1) % device.buffers; } void clear() { if(!pSourceVoice) return; pSourceVoice->Stop(0); pSourceVoice->FlushSourceBuffers(); //calls OnBufferEnd for all currently submitted buffers device.writebuffer = 0; device.bufferoffset = 0; if(device.buffer) memset(device.buffer, 0, device.latency * device.buffers * 4); pSourceVoice->Start(0); } bool init() { term(); device.buffers = 8; device.latency = settings.frequency * settings.latency / device.buffers / 1000.0 + 0.5; device.buffer = new uint32_t[device.latency * device.buffers]; device.bufferoffset = 0; device.submitbuffers = 0; HRESULT hr; if(FAILED(hr = XAudio2Create(&pXAudio2, 0 , XAUDIO2_DEFAULT_PROCESSOR))) { return false; } if(FAILED(hr = pXAudio2->CreateMasteringVoice( &pMasterVoice, 2, settings.frequency, 0, 0 , NULL))) { return false; } WAVEFORMATEX wfx; wfx.wFormatTag = WAVE_FORMAT_PCM; wfx.nChannels = 2; wfx.nSamplesPerSec = settings.frequency; wfx.nBlockAlign = 4; wfx.wBitsPerSample = 16; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; wfx.cbSize = 0; if(FAILED(hr = pXAudio2->CreateSourceVoice(&pSourceVoice, (WAVEFORMATEX*)&wfx, XAUDIO2_VOICE_NOSRC , XAUDIO2_DEFAULT_FREQ_RATIO, this, NULL, NULL))) { return false; } clear(); return true; } void term() { if(pSourceVoice) { pSourceVoice->Stop(0); pSourceVoice->DestroyVoice(); pSourceVoice = nullptr; } if(pMasterVoice) { pMasterVoice->DestroyVoice(); pMasterVoice = nullptr; } if(pXAudio2) { pXAudio2->Release(); pXAudio2 = nullptr; } if(device.buffer) { delete[] device.buffer; device.buffer = nullptr; } } STDMETHODIMP_(void) OnBufferEnd(void* pBufferContext) { InterlockedDecrement(&device.submitbuffers); } pAudioXAudio2() { pXAudio2 = nullptr; pMasterVoice = nullptr; pSourceVoice = nullptr; device.buffer = nullptr; device.bufferoffset = 0; device.submitbuffers = 0; device.writebuffer = 0; settings.synchronize = false; settings.frequency = 22050; settings.latency = 120; } }; DeclareAudio(XAudio2) }; phoenix/qt/widget/progress-bar.cpp000664 001750 001750 00000001073 12651764221 020404 0ustar00sergiosergio000000 000000 namespace phoenix { Size pProgressBar::minimumSize() { return {0, 25}; } void pProgressBar::setPosition(unsigned position) { qtProgressBar->setValue(position); } void pProgressBar::constructor() { qtWidget = qtProgressBar = new QProgressBar; qtProgressBar->setRange(0, 100); qtProgressBar->setTextVisible(false); pWidget::synchronizeState(); setPosition(progressBar.state.position); } void pProgressBar::destructor() { delete qtProgressBar; qtWidget = qtProgressBar = nullptr; } void pProgressBar::orphan() { destructor(); constructor(); } } target-ethos/resource/timing.png000664 001750 001750 00000001601 12651764221 020140 0ustar00sergiosergio000000 000000 PNG  IHDRabKGDC pHYs B(xtIME :.UIDAT8eKL\ew8w`"#Xl0⢱;ܘ 6&DW5&,McDM5>ML.MU(:X+L ̽ wύm(9G`ҒaCzZU~^e^l0htG{ GZCqTKӃ< "uP|apx.U(vgqxA;S͍͕7=sп]I>>8<`X+Phִ-nkwoh. ȧy};vG[W#-[DJ3CDt4Y.gimmHg}w?K*^'rx{‘0B)gQv,F^چsm9lBûѡ()9DbLLLBkae+Z+U::کTPJQ,ïrUjRJRh H4 SrX;R ?5W=A:bRAkM 4M_My輷kna6c\!m[!7ʐ٥Lr:7Wf45Ģm-xEJ~r̭-.߮v@NlJ=gSu)]wB:pXv(@(_$d6IENDB`sfc/chip/necdsp/serialization.cpp000664 001750 001750 00000001270 12651764221 020243 0ustar00sergiosergio000000 000000 #ifdef NECDSP_CPP vector NECDSP::firmware() { vector buffer; if(cartridge.has_necdsp() == false) return buffer; unsigned plength = 2048, dlength = 1024; if(revision == Revision::uPD96050) plength = 16384, dlength = 2048; buffer.reserve(plength * 3 + dlength * 2); for(unsigned n = 0; n < plength; n++) { buffer.append(programROM[n] >> 0); buffer.append(programROM[n] >> 8); buffer.append(programROM[n] >> 16); } for(unsigned n = 0; n < dlength; n++) { buffer.append(dataROM[n] >> 0); buffer.append(dataROM[n] >> 8); } return buffer; } void NECDSP::serialize(serializer& s) { uPD96050::serialize(s); Thread::serialize(s); } #endif nall/thread.hpp000664 001750 001750 00000004777 12651764221 014635 0ustar00sergiosergio000000 000000 #ifndef NALL_THREAD_HPP #define NALL_THREAD_HPP #include #include #include #if defined(PLATFORM_X) || defined(PLATFORM_MACOSX) #include namespace nall { inline void* thread_entry_point(void*); struct thread { thread(function entryPoint) : entryPoint(entryPoint), completed(false), dead(false) { initialize(); pthread_create(&pthread, nullptr, thread_entry_point, (void*)this); } ~thread() { join(); } bool active() const { return completed == false; } void join() { if(dead) return; dead = true; pthread_join(pthread, nullptr); } static bool primary() { initialize(); return pthread_equal(primaryThread(), pthread_self()); } private: pthread_t pthread; function entryPoint; volatile bool completed, dead; friend void* thread_entry_point(void*); static void initialize() { static bool initialized = false; if(initialized) return; initialized = true; primaryThread() = pthread_self(); } static pthread_t& primaryThread() { static pthread_t thread; return thread; } }; void* thread_entry_point(void* parameter) { thread* context = (thread*)parameter; context->entryPoint(); context->completed = true; pthread_exit(nullptr); } } #elif defined(PLATFORM_WINDOWS) namespace nall { inline DWORD WINAPI thread_entry_point(LPVOID); struct thread { thread(function entryPoint) : entryPoint(entryPoint), completed(false), dead(false) { initialize(); hthread = CreateThread(nullptr, 0, thread_entry_point, (void*)this, 0, nullptr); } ~thread() { join(); } bool active() const { return completed == false; } void join() { if(dead) return; dead = true; WaitForSingleObject(hthread, INFINITE); CloseHandle(hthread); } static bool primary() { initialize(); return primaryThread() == GetCurrentThreadId(); } private: HANDLE hthread; function entryPoint; volatile bool completed, dead; friend DWORD WINAPI thread_entry_point(LPVOID); static void initialize() { static bool initialized = false; if(initialized) return; initialized = true; primaryThread() = GetCurrentThreadId(); } static DWORD& primaryThread() { static DWORD thread; return thread; } }; inline DWORD WINAPI thread_entry_point(LPVOID parameter) { thread *context = (thread*)parameter; context->entryPoint(); context->completed = true; return 0; } } #endif #endif sfc/controller/controller.hpp000664 001750 001750 00000002111 12651764221 017535 0ustar00sergiosergio000000 000000 // SNES controller port pinout: // ------------------------------- // | (1) (2) (3) (4) | (5) (6) (7) ) // ------------------------------- // pin name port1 port2 // 1: +5v // 2: clock $4016 read $4017 read // 3: latch $4016.d0 write $4016.d0 write // 4: data1 $4016.d0 read $4017.d0 read // 5: data2 $4016.d1 read $4017.d1 read // 6: iobit $4201.d6 write; $4213.d6 read $4201.d7 write; $4213.d7 read // 7: gnd struct Controller : Thread { enum : bool { Port1 = 0, Port2 = 1 }; const bool port; static void Enter(); virtual void enter(); void step(unsigned clocks); void synchronize_cpu(); bool iobit(); void iobit(bool data); virtual uint2 data() { return 0; } virtual void latch(bool data) {} Controller(bool port); }; #include "gamepad/gamepad.hpp" #include "multitap/multitap.hpp" #include "mouse/mouse.hpp" #include "superscope/superscope.hpp" #include "justifier/justifier.hpp" #include "usart/usart.hpp" phoenix/cocoa/action/radio-item.hpp000664 001750 001750 00000000777 12651764221 020501 0ustar00sergiosergio000000 000000 @interface CocoaRadioItem : NSMenuItem { @public phoenix::RadioItem* radioItem; } -(id) initWith:(phoenix::RadioItem&)radioItem; -(void) activate; @end namespace phoenix { struct pRadioItem : public pAction { RadioItem& radioItem; CocoaRadioItem* cocoaRadioItem = nullptr; void setChecked(); void setGroup(const group& group); void setText(string text); pRadioItem(RadioItem& radioItem) : pAction(radioItem), radioItem(radioItem) {} void constructor(); void destructor(); }; } nall/string/char/base.hpp000664 001750 001750 00000005307 12651764221 016511 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP //collection of functions to extend libc //none of these functions require nall::string //and thus, require no changes when nall::string is modified namespace nall { //compare.hpp inline char chrlower(char c); inline char chrupper(char c); inline int imemcmp(const char* str1, const char* str2, unsigned size); inline int istrcmp(const char* str1, const char* str2); inline bool strbegin(const char* str, const char* key); inline bool istrbegin(const char* str, const char* key); inline bool strend(const char* str, const char* key); inline bool istrend(const char* str, const char* key); //convert.hpp inline char* strlower(char* str); inline char* strupper(char* str); inline char* qstrlower(char* str); inline char* qstrupper(char* str); inline char* strtr(char* dest, const char* before, const char* after); //match.hpp inline bool strmatch(const char* str, const char* pattern); inline bool istrmatch(const char* str, const char* pattern); inline bool tokenize(const char* s, const char* p); //strm.hpp inline unsigned strmcpy(char* target, const char* source, unsigned length); inline unsigned strmcat(char* target, const char* source, unsigned length); inline bool strccpy(char* target, const char* source, unsigned length); inline bool strccat(char* target, const char* source, unsigned length); inline void strpcpy(char*& target, const char* source, unsigned& length); //strpos.hpp inline optional strpos(const char* str, const char* key); inline optional istrpos(const char* str, const char* key); inline optional qstrpos(const char* str, const char* key); inline optional iqstrpos(const char* str, const char* key); template inline optional ustrpos(const char* str, const char* key); //trim.hpp template inline char* ltrim(char* str, const char* key = " "); template inline char* rtrim(char* str, const char* key = " "); template inline char* trim(char* str, const char* key = " "); template inline char* trim(char* str, const char* lkey, const char* rkey); inline char* strip(char* s); //utf8.hpp struct UTF8 { unsigned size; //size of encoded codepoint uint64_t data; //encoded codepoint unsigned codepoint; //decoded codepoint }; inline UTF8 utf8_read(const char* s); inline void utf8_write(char* s, const UTF8& utf8); //utility.hpp template alwaysinline bool chrequal(char x, char y); template alwaysinline bool quoteskip(T*& p); template alwaysinline bool quotecopy(char*& t, T*& p); inline char* strduplicate(const char* s); } #endif phoenix/reference/widget/vertical-scroller.cpp000664 001750 001750 00000000340 12651764221 022740 0ustar00sergiosergio000000 000000 namespace phoenix { void pVerticalScroller::setLength(unsigned length) { } void pVerticalScroller::setPosition(unsigned position) { } void pVerticalScroller::constructor() { } void pVerticalScroller::destructor() { } } nall/string/file.hpp000664 001750 001750 00000001066 12651764221 015577 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { string string::read(const string& filename) { string result; #if !defined(_WIN32) FILE* fp = fopen(filename, "rb"); #else FILE* fp = _wfopen(utf16_t(filename), L"rb"); #endif if(!fp) return result; fseek(fp, 0, SEEK_END); unsigned fsize = ftell(fp); rewind(fp); char* fdata = new char[fsize + 1]; unsigned unused = fread(fdata, 1, fsize, fp); fclose(fp); fdata[fsize] = 0; result.resize(fsize); memcpy(result.data(), fdata, fsize); delete[] fdata; return result; } } #endif nall/beat/linear.hpp000664 001750 001750 00000007746 12651764221 015552 0ustar00sergiosergio000000 000000 #ifndef NALL_BEAT_LINEAR_HPP #define NALL_BEAT_LINEAR_HPP #include #include #include #include #include namespace nall { struct bpslinear { inline void source(const uint8_t* data, unsigned size); inline void target(const uint8_t* data, unsigned size); inline bool source(const string& filename); inline bool target(const string& filename); inline bool create(const string& filename, const string& metadata = ""); protected: enum : unsigned { SourceRead, TargetRead, SourceCopy, TargetCopy }; enum : unsigned { Granularity = 1 }; filemap sourceFile; const uint8_t* sourceData; unsigned sourceSize; filemap targetFile; const uint8_t* targetData; unsigned targetSize; }; void bpslinear::source(const uint8_t* data, unsigned size) { sourceData = data; sourceSize = size; } void bpslinear::target(const uint8_t* data, unsigned size) { targetData = data; targetSize = size; } bool bpslinear::source(const string& filename) { if(sourceFile.open(filename, filemap::mode::read) == false) return false; source(sourceFile.data(), sourceFile.size()); return true; } bool bpslinear::target(const string& filename) { if(targetFile.open(filename, filemap::mode::read) == false) return false; target(targetFile.data(), targetFile.size()); return true; } bool bpslinear::create(const string& filename, const string& metadata) { file modifyFile; if(modifyFile.open(filename, file::mode::write) == false) return false; uint32_t modifyChecksum = ~0; unsigned targetRelativeOffset = 0, outputOffset = 0; auto write = [&](uint8_t data) { modifyFile.write(data); modifyChecksum = crc32_adjust(modifyChecksum, data); }; auto encode = [&](uint64_t data) { while(true) { uint64_t x = data & 0x7f; data >>= 7; if(data == 0) { write(0x80 | x); break; } write(x); data--; } }; unsigned targetReadLength = 0; auto targetReadFlush = [&]() { if(targetReadLength) { encode(TargetRead | ((targetReadLength - 1) << 2)); unsigned offset = outputOffset - targetReadLength; while(targetReadLength) write(targetData[offset++]), targetReadLength--; } }; write('B'); write('P'); write('S'); write('1'); encode(sourceSize); encode(targetSize); unsigned markupSize = metadata.length(); encode(markupSize); for(unsigned n = 0; n < markupSize; n++) write(metadata[n]); while(outputOffset < targetSize) { unsigned sourceLength = 0; for(unsigned n = 0; outputOffset + n < min(sourceSize, targetSize); n++) { if(sourceData[outputOffset + n] != targetData[outputOffset + n]) break; sourceLength++; } unsigned rleLength = 0; for(unsigned n = 1; outputOffset + n < targetSize; n++) { if(targetData[outputOffset] != targetData[outputOffset + n]) break; rleLength++; } if(rleLength >= 4) { //write byte to repeat targetReadLength++; outputOffset++; targetReadFlush(); //copy starting from repetition byte encode(TargetCopy | ((rleLength - 1) << 2)); unsigned relativeOffset = (outputOffset - 1) - targetRelativeOffset; encode(relativeOffset << 1); outputOffset += rleLength; targetRelativeOffset = outputOffset - 1; } else if(sourceLength >= 4) { targetReadFlush(); encode(SourceRead | ((sourceLength - 1) << 2)); outputOffset += sourceLength; } else { targetReadLength += Granularity; outputOffset += Granularity; } } targetReadFlush(); uint32_t sourceChecksum = crc32_calculate(sourceData, sourceSize); for(unsigned n = 0; n < 32; n += 8) write(sourceChecksum >> n); uint32_t targetChecksum = crc32_calculate(targetData, targetSize); for(unsigned n = 0; n < 32; n += 8) write(targetChecksum >> n); uint32_t outputChecksum = ~modifyChecksum; for(unsigned n = 0; n < 32; n += 8) write(outputChecksum >> n); modifyFile.close(); return true; } } #endif gb/cpu/cpu.cpp000664 001750 001750 00000011455 12651764221 014370 0ustar00sergiosergio000000 000000 #include #define CPU_CPP namespace GameBoy { #include "mmio.cpp" #include "memory.cpp" #include "timing.cpp" #include "serialization.cpp" CPU cpu; void CPU::Main() { cpu.main(); } void CPU::main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::CPU) { scheduler.sync = Scheduler::SynchronizeMode::All; scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } interrupt_test(); exec(); } } void CPU::interrupt_raise(CPU::Interrupt id) { if(id == Interrupt::Vblank) { status.interrupt_request_vblank = 1; if(status.interrupt_enable_vblank) r.halt = false; } if(id == Interrupt::Stat) { status.interrupt_request_stat = 1; if(status.interrupt_enable_stat) r.halt = false; } if(id == Interrupt::Timer) { status.interrupt_request_timer = 1; if(status.interrupt_enable_timer) r.halt = false; } if(id == Interrupt::Serial) { status.interrupt_request_serial = 1; if(status.interrupt_enable_serial) r.halt = false; } if(id == Interrupt::Joypad) { status.interrupt_request_joypad = 1; if(status.interrupt_enable_joypad) r.halt = r.stop = false; } } void CPU::interrupt_test() { if(r.ime) { if(status.interrupt_request_vblank && status.interrupt_enable_vblank) { status.interrupt_request_vblank = 0; return interrupt_exec(0x0040); } if(status.interrupt_request_stat && status.interrupt_enable_stat) { status.interrupt_request_stat = 0; return interrupt_exec(0x0048); } if(status.interrupt_request_timer && status.interrupt_enable_timer) { status.interrupt_request_timer = 0; return interrupt_exec(0x0050); } if(status.interrupt_request_serial && status.interrupt_enable_serial) { status.interrupt_request_serial = 0; return interrupt_exec(0x0058); } if(status.interrupt_request_joypad && status.interrupt_enable_joypad) { status.interrupt_request_joypad = 0; return interrupt_exec(0x0060); } } } void CPU::interrupt_exec(uint16 pc) { r.ime = 0; op_write(--r[SP], r[PC] >> 8); op_write(--r[SP], r[PC] >> 0); r[PC] = pc; op_io(); op_io(); op_io(); } bool CPU::stop() { if(status.speed_switch) { status.speed_switch = 0; status.speed_double ^= 1; if(status.speed_double == 0) frequency = 4 * 1024 * 1024; if(status.speed_double == 1) frequency = 8 * 1024 * 1024; return true; } return false; } void CPU::power() { create(Main, 4 * 1024 * 1024); LR35902::power(); for(unsigned n = 0xc000; n <= 0xdfff; n++) bus.mmio[n] = this; //WRAM for(unsigned n = 0xe000; n <= 0xfdff; n++) bus.mmio[n] = this; //WRAM (mirror) for(unsigned n = 0xff80; n <= 0xfffe; n++) bus.mmio[n] = this; //HRAM bus.mmio[0xff00] = this; //JOYP bus.mmio[0xff01] = this; //SB bus.mmio[0xff02] = this; //SC bus.mmio[0xff04] = this; //DIV bus.mmio[0xff05] = this; //TIMA bus.mmio[0xff06] = this; //TMA bus.mmio[0xff07] = this; //TAC bus.mmio[0xff0f] = this; //IF bus.mmio[0xff46] = this; //DMA bus.mmio[0xffff] = this; //IE if(system.cgb()) { bus.mmio[0xff4d] = this; //KEY1 bus.mmio[0xff51] = this; //HDMA1 bus.mmio[0xff52] = this; //HDMA2 bus.mmio[0xff53] = this; //HDMA3 bus.mmio[0xff54] = this; //HDMA4 bus.mmio[0xff55] = this; //HDMA5 bus.mmio[0xff56] = this; //RP bus.mmio[0xff6c] = this; //??? bus.mmio[0xff70] = this; //SVBK bus.mmio[0xff72] = this; //??? bus.mmio[0xff73] = this; //??? bus.mmio[0xff74] = this; //??? bus.mmio[0xff75] = this; //??? bus.mmio[0xff76] = this; //??? bus.mmio[0xff77] = this; //??? } for(auto& n : wram) n = 0x00; for(auto& n : hram) n = 0x00; r[PC] = 0x0000; r[SP] = 0x0000; r[AF] = 0x0000; r[BC] = 0x0000; r[DE] = 0x0000; r[HL] = 0x0000; status.clock = 0; status.p15 = 0; status.p14 = 0; status.joyp = 0; status.mlt_req = 0; status.serial_data = 0; status.serial_bits = 0; status.serial_transfer = 0; status.serial_clock = 0; status.div = 0; status.tima = 0; status.tma = 0; status.timer_enable = 0; status.timer_clock = 0; status.interrupt_request_joypad = 0; status.interrupt_request_serial = 0; status.interrupt_request_timer = 0; status.interrupt_request_stat = 0; status.interrupt_request_vblank = 0; status.speed_double = 0; status.speed_switch = 0; status.dma_source = 0; status.dma_target = 0; status.dma_mode = 0; status.dma_length = 0; status.dma_completed = true; status.ff6c = 0; status.ff72 = 0; status.ff73 = 0; status.ff74 = 0; status.ff75 = 0; status.wram_bank = 1; status.interrupt_enable_joypad = 0; status.interrupt_enable_serial = 0; status.interrupt_enable_timer = 0; status.interrupt_enable_stat = 0; status.interrupt_enable_vblank = 0; oamdma.active = false; oamdma.bank = 0; oamdma.offset = 0; } } nall/config.hpp000664 001750 001750 00000005466 12651764221 014627 0ustar00sergiosergio000000 000000 #ifndef NALL_CONFIG_HPP #define NALL_CONFIG_HPP #include #include #include namespace nall { namespace Configuration { struct Node { string name; string desc; enum class Type : unsigned { Null, Bool, Signed, Unsigned, Double, String } type = Type::Null; void* data = nullptr; vector children; bool empty() const { return data == nullptr; } string get() const { switch(type) { case Type::Bool: return {*(bool*)data}; case Type::Signed: return {*(signed*)data}; case Type::Unsigned: return {*(unsigned*)data}; case Type::Double: return {*(double*)data}; case Type::String: return {*(string*)data}; } return ""; } void set(const string& value) { switch(type) { case Type::Bool: *(bool*)data = (value != "false"); break; case Type::Signed: *(signed*)data = integer(value); break; case Type::Unsigned: *(unsigned*)data = decimal(value); break; case Type::Double: *(double*)data = real(value); break; case Type::String: *(string*)data = value; break; } } void assign() { type = Type::Null; data = nullptr; } void assign(bool& bind) { type = Type::Bool; data = (void*)&bind; } void assign(signed& bind) { type = Type::Signed; data = (void*)&bind; } void assign(unsigned& bind) { type = Type::Unsigned; data = (void*)&bind; } void assign(double& bind) { type = Type::Double; data = (void*)&bind; } void assign(string& bind) { type = Type::String; data = (void*)&bind; } void assign(const Node& node) { operator=(node); } template void append(T& data, const string& name, const string& desc = "") { Node node; node.assign(data); node.name = name; node.desc = desc; children.append(node); } void load(Markup::Node path) { for(auto& child : children) { auto leaf = path[child.name]; if(!leaf.exists()) continue; if(!child.empty()) child.set(leaf.data.trim<1>(" ", "\r")); child.load(leaf); } } void save(file& fp, unsigned depth = 0) { for(auto& child : children) { if(child.desc) { for(unsigned n = 0; n < depth; n++) fp.print(" "); fp.print("//", child.desc, "\n"); } for(unsigned n = 0; n < depth; n++) fp.print(" "); fp.print(child.name); if(!child.empty()) fp.print(": ", child.get()); fp.print("\n"); child.save(fp, depth + 1); if(depth == 0) fp.print("\n"); } } }; struct Document : Node { bool load(const string& filename) { if(!file::exists(filename)) return false; auto document = Markup::Document(string::read(filename)); Node::load(document); return true; } bool save(const string& filename) { file fp(filename, file::mode::write); if(!fp.open()) return false; Node::save(fp); return true; } }; } } #endif gba/ppu/registers.cpp000664 001750 001750 00000007067 12651764221 015772 0ustar00sergiosergio000000 000000 PPU::Registers::Control::operator uint16() const { return ( (bgmode << 0) | (cgbmode << 3) | (frame << 4) | (hblank << 5) | (objmapping << 6) | (forceblank << 7) | (enable[BG0] << 8) | (enable[BG1] << 9) | (enable[BG2] << 10) | (enable[BG3] << 11) | (enable[OBJ] << 12) | (enablewindow[In0] << 13) | (enablewindow[In1] << 14) | (enablewindow[Obj] << 15) ); } uint16 PPU::Registers::Control::operator=(uint16 source) { bgmode = source >> 0; cgbmode = source >> 3; frame = source >> 4; hblank = source >> 5; objmapping = source >> 6; forceblank = source >> 7; enable[BG0] = source >> 8; enable[BG1] = source >> 9; enable[BG2] = source >> 10; enable[BG3] = source >> 11; enable[OBJ] = source >> 12; enablewindow[In0] = source >> 13; enablewindow[In1] = source >> 14; enablewindow[Obj] = source >> 15; return operator uint16(); } PPU::Registers::Status::operator uint16() const { return ( (vblank << 0) | (hblank << 1) | (vcoincidence << 2) | (irqvblank << 3) | (irqhblank << 4) | (irqvcoincidence << 5) | (vcompare << 8) ); } uint16 PPU::Registers::Status::operator=(uint16 source) { vblank = source >> 0; hblank = source >> 1; vcoincidence = source >> 2; irqvblank = source >> 3; irqhblank = source >> 4; irqvcoincidence = source >> 5; vcompare = source >> 8; return operator uint16(); } PPU::Registers::BackgroundControl::operator uint16() const { return ( (priority << 0) | (characterbaseblock << 2) | (mosaic << 6) | (colormode << 7) | (screenbaseblock << 8) | (affinewrap << 13) | (screensize << 14) ); } uint16 PPU::Registers::BackgroundControl::operator=(uint16 source) { priority = source >> 0; characterbaseblock = source >> 2; mosaic = source >> 6; colormode = source >> 7; screenbaseblock = source >> 8; affinewrap = source >> 13; screensize = source >> 14; return operator uint16(); } PPU::Registers::WindowFlags::operator uint8() const { return ( (enable[BG0] << 0) | (enable[BG1] << 1) | (enable[BG2] << 2) | (enable[BG3] << 3) | (enable[OBJ] << 4) | (enable[SFX] << 5) ); } uint8 PPU::Registers::WindowFlags::operator=(uint8 source) { enable[BG0] = source >> 0; enable[BG1] = source >> 1; enable[BG2] = source >> 2; enable[BG3] = source >> 3; enable[OBJ] = source >> 4; enable[SFX] = source >> 5; return operator uint8(); } PPU::Registers::BlendControl::operator uint16() const { return ( (above[BG0] << 0) | (above[BG1] << 1) | (above[BG2] << 2) | (above[BG3] << 3) | (above[OBJ] << 4) | (above[SFX] << 5) | (mode << 6) | (below[BG0] << 8) | (below[BG1] << 9) | (below[BG2] << 10) | (below[BG3] << 11) | (below[OBJ] << 12) | (below[SFX] << 13) ); } uint16 PPU::Registers::BlendControl::operator=(uint16 source) { above[BG0] = source >> 0; above[BG1] = source >> 1; above[BG2] = source >> 2; above[BG3] = source >> 3; above[OBJ] = source >> 4; above[SFX] = source >> 5; mode = source >> 6; below[BG0] = source >> 8; below[BG1] = source >> 9; below[BG2] = source >> 10; below[BG3] = source >> 11; below[OBJ] = source >> 12; below[SFX] = source >> 13; return operator uint16(); } ruby/audio/directsound.cpp000664 001750 001750 00000012711 12651764221 017023 0ustar00sergiosergio000000 000000 /* audio.directsound (2007-12-26) author: byuu */ #include namespace ruby { class pAudioDS { public: LPDIRECTSOUND ds; LPDIRECTSOUNDBUFFER dsb_p, dsb_b; DSBUFFERDESC dsbd; WAVEFORMATEX wfx; struct { unsigned rings; unsigned latency; uint32_t* buffer; unsigned bufferoffset; unsigned readring; unsigned writering; int distance; } device; struct { HWND handle; bool synchronize; unsigned frequency; unsigned latency; } settings; bool cap(const string& name) { if(name == Audio::Handle) return true; if(name == Audio::Synchronize) return true; if(name == Audio::Frequency) return true; if(name == Audio::Latency) return true; return false; } any get(const string& name) { if(name == Audio::Handle) return (uintptr_t)settings.handle; if(name == Audio::Synchronize) return settings.synchronize; if(name == Audio::Frequency) return settings.frequency; if(name == Audio::Latency) return settings.latency; return false; } bool set(const string& name, const any& value) { if(name == Audio::Handle) { settings.handle = (HWND)any_cast(value); return true; } if(name == Audio::Synchronize) { settings.synchronize = any_cast(value); if(ds) clear(); return true; } if(name == Audio::Frequency) { settings.frequency = any_cast(value); if(ds) init(); return true; } if(name == Audio::Latency) { settings.latency = any_cast(value); if(ds) init(); return true; } return false; } void sample(uint16_t left, uint16_t right) { device.buffer[device.bufferoffset++] = left + (right << 16); if(device.bufferoffset < device.latency) return; device.bufferoffset = 0; DWORD pos, size; void* output; if(settings.synchronize) { //wait until playback buffer has an empty ring to write new audio data to while(device.distance >= device.rings - 1) { dsb_b->GetCurrentPosition(&pos, 0); unsigned activering = pos / (device.latency * 4); if(activering == device.readring) continue; //subtract number of played rings from ring distance counter device.distance -= (device.rings + activering - device.readring) % device.rings; device.readring = activering; if(device.distance < 2) { //buffer underflow; set max distance to recover quickly device.distance = device.rings - 1; device.writering = (device.rings + device.readring - 1) % device.rings; break; } } } device.writering = (device.writering + 1) % device.rings; device.distance = (device.distance + 1) % device.rings; if(dsb_b->Lock(device.writering * device.latency * 4, device.latency * 4, &output, &size, 0, 0, 0) == DS_OK) { memcpy(output, device.buffer, device.latency * 4); dsb_b->Unlock(output, size, 0, 0); } } void clear() { device.readring = 0; device.writering = device.rings - 1; device.distance = device.rings - 1; device.bufferoffset = 0; if(device.buffer) memset(device.buffer, 0, device.latency * device.rings * 4); if(!dsb_b) return; dsb_b->Stop(); dsb_b->SetCurrentPosition(0); DWORD size; void* output; dsb_b->Lock(0, device.latency * device.rings * 4, &output, &size, 0, 0, 0); memset(output, 0, size); dsb_b->Unlock(output, size, 0, 0); dsb_b->Play(0, 0, DSBPLAY_LOOPING); } bool init() { term(); device.rings = 8; device.latency = settings.frequency * settings.latency / device.rings / 1000.0 + 0.5; device.buffer = new uint32_t[device.latency * device.rings]; device.bufferoffset = 0; DirectSoundCreate(0, &ds, 0); ds->SetCooperativeLevel((HWND)settings.handle, DSSCL_PRIORITY); memset(&dsbd, 0, sizeof(dsbd)); dsbd.dwSize = sizeof(dsbd); dsbd.dwFlags = DSBCAPS_PRIMARYBUFFER; dsbd.dwBufferBytes = 0; dsbd.lpwfxFormat = 0; ds->CreateSoundBuffer(&dsbd, &dsb_p, 0); memset(&wfx, 0, sizeof(wfx)); wfx.wFormatTag = WAVE_FORMAT_PCM; wfx.nChannels = 2; wfx.nSamplesPerSec = settings.frequency; wfx.wBitsPerSample = 16; wfx.nBlockAlign = wfx.wBitsPerSample / 8 * wfx.nChannels; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; dsb_p->SetFormat(&wfx); memset(&dsbd, 0, sizeof(dsbd)); dsbd.dwSize = sizeof(dsbd); dsbd.dwFlags = DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_CTRLFREQUENCY | DSBCAPS_GLOBALFOCUS | DSBCAPS_LOCSOFTWARE; dsbd.dwBufferBytes = device.latency * device.rings * sizeof(uint32_t); dsbd.guid3DAlgorithm = GUID_NULL; dsbd.lpwfxFormat = &wfx; ds->CreateSoundBuffer(&dsbd, &dsb_b, 0); dsb_b->SetFrequency(settings.frequency); dsb_b->SetCurrentPosition(0); clear(); return true; } void term() { if(device.buffer) { delete[] device.buffer; device.buffer = 0; } if(dsb_b) { dsb_b->Stop(); dsb_b->Release(); dsb_b = 0; } if(dsb_p) { dsb_p->Stop(); dsb_p->Release(); dsb_p = 0; } if(ds) { ds->Release(); ds = 0; } } pAudioDS() { ds = 0; dsb_p = 0; dsb_b = 0; device.buffer = 0; device.bufferoffset = 0; device.readring = 0; device.writering = 0; device.distance = 0; settings.handle = GetDesktopWindow(); settings.synchronize = false; settings.frequency = 22050; settings.latency = 120; } }; DeclareAudio(DS) }; ananke/game-boy.cpp000664 001750 001750 00000004035 12651764221 015353 0ustar00sergiosergio000000 000000 void Ananke::copyGameBoySaves(const string &pathname) { if(!file::exists({pathname, "save.ram"})) { if(file::exists({information.path, nall::basename(information.name), ".sav"})) { file::copy({information.path, nall::basename(information.name), ".sav"}, {pathname, "save.ram"}); } } if(!file::exists({pathname, "rtc.ram"})) { if(file::exists({information.path, nall::basename(information.name), ".rtc"})) { file::copy({information.path, nall::basename(information.name), ".rtc"}, {pathname, "rtc.ram"}); } } } string Ananke::createGameBoyHeuristic(vector &buffer) { GameBoyCartridge info(buffer.data(), buffer.size()); string pathname = { libraryPath, "Game Boy", (info.info.cgb ? " Color" : ""), "/", nall::basename(information.name), ".", (info.info.cgb ? "gbc" : "gb"), "/" }; directory::create(pathname); string markup = {"unverified\n\n", info.markup}; markup.append("\ninformation\n title: ", nall::basename(information.name), "\n"); if(!information.manifest.empty()) markup = information.manifest; //override with embedded beat manifest, if one exists file::write({pathname, "manifest.bml"}, markup); file::write({pathname, "program.rom"}, buffer); copyGameBoySaves(pathname); return pathname; } string Ananke::openGameBoy(vector &buffer) { return createGameBoyHeuristic(buffer); } string Ananke::syncGameBoy(const string &pathname) { auto buffer = file::read({pathname, "program.rom"}); if(buffer.size() == 0) return ""; auto save = file::read({pathname, "save.ram"}); if(save.size() == 0) save = file::read({pathname, "save.rwm"}); auto rtc = file::read({pathname, "rtc.ram"}); if(rtc.size() == 0) rtc = file::read({pathname, "rtc.rwm"}); directory::remove(pathname); information.path = pathname; information.name = notdir(string{pathname}.rtrim<1>("/")); string outputPath = openGameBoy(buffer); if(save.size()) file::write({outputPath, "save.ram"}, save); if(rtc.size()) file::write({outputPath, "rtc.ram"}, rtc); return outputPath; } sfc/chip/epsonrtc/serialization.cpp000664 001750 001750 00000001661 12651764221 020630 0ustar00sergiosergio000000 000000 #ifdef EPSONRTC_CPP void EpsonRTC::serialize(serializer& s) { Thread::serialize(s); s.integer(clocks); s.integer(seconds); s.integer(chipselect); s.integer((unsigned&)state); s.integer(mdr); s.integer(offset); s.integer(wait); s.integer(ready); s.integer(holdtick); s.integer(secondlo); s.integer(secondhi); s.integer(batteryfailure); s.integer(minutelo); s.integer(minutehi); s.integer(resync); s.integer(hourlo); s.integer(hourhi); s.integer(meridian); s.integer(daylo); s.integer(dayhi); s.integer(dayram); s.integer(monthlo); s.integer(monthhi); s.integer(monthram); s.integer(yearlo); s.integer(yearhi); s.integer(weekday); s.integer(hold); s.integer(calendar); s.integer(irqflag); s.integer(roundseconds); s.integer(irqmask); s.integer(irqduty); s.integer(irqperiod); s.integer(pause); s.integer(stop); s.integer(atime); s.integer(test); } #endif nall/mosaic/bitstream.hpp000664 001750 001750 00000002157 12651764221 016621 0ustar00sergiosergio000000 000000 #ifdef NALL_MOSAIC_INTERNAL_HPP namespace nall { namespace mosaic { struct bitstream { filemap fp; uint8_t* data = nullptr; unsigned size = 0; bool readonly = false; bool endian = 1; bool read(uint64_t addr) const { if(data == nullptr || (addr >> 3) >= size) return 0; unsigned mask = endian == 0 ? (0x01 << (addr & 7)) : (0x80 >> (addr & 7)); return data[addr >> 3] & mask; } void write(uint64_t addr, bool value) { if(data == nullptr || readonly == true || (addr >> 3) >= size) return; unsigned mask = endian == 0 ? (0x01 << (addr & 7)) : (0x80 >> (addr & 7)); if(value == 0) data[addr >> 3] &= ~mask; if(value == 1) data[addr >> 3] |= mask; } bool open(const string& filename) { readonly = false; if(fp.open(filename, filemap::mode::readwrite) == false) { readonly = true; if(fp.open(filename, filemap::mode::read) == false) { return false; } } data = fp.data(); size = fp.size(); return true; } void close() { fp.close(); data = nullptr; } bitstream() { } ~bitstream() { close(); } }; } } #endif nall/string/platform.hpp000664 001750 001750 00000005132 12651764221 016502 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { string activepath() { char path[PATH_MAX] = ""; auto unused = getcwd(path, PATH_MAX); string result = path; if(result.empty()) result = "."; result.transform("\\", "/"); if(result.endsWith("/") == false) result.append("/"); return result; } string realpath(const string& name) { string result; char path[PATH_MAX] = ""; if(::realpath(name, path)) result = dir(path); if(result.empty()) result = activepath(); result.transform("\\", "/"); if(result.endsWith("/") == false) result.append("/"); return result; } // /home/username/ // c:/users/username/ string userpath() { #if defined(PLATFORM_WINDOWS) wchar_t path[PATH_MAX] = L""; SHGetFolderPathW(nullptr, CSIDL_PROFILE | CSIDL_FLAG_CREATE, nullptr, 0, path); string result = (const char*)utf8_t(path); result.transform("\\", "/"); #else struct passwd* userinfo = getpwuid(getuid()); string result = userinfo->pw_dir; #endif if(result.empty()) result = "."; if(result.endsWith("/") == false) result.append("/"); return result; } // /home/username/.config/ // c:/users/username/appdata/roaming/ string configpath() { #if defined(PLATFORM_WINDOWS) wchar_t path[PATH_MAX] = L""; SHGetFolderPathW(nullptr, CSIDL_APPDATA | CSIDL_FLAG_CREATE, nullptr, 0, path); string result = (const char*)utf8_t(path); result.transform("\\", "/"); #elif defined(PLATFORM_MACOSX) string result = {userpath(), "Library/Application Support/"}; #else string result = {userpath(), ".config/"}; #endif if(result.empty()) result = "."; if(result.endsWith("/") == false) result.append("/"); return result; } // /usr/share // /Library/Application Support/ // c:/ProgramData/ string sharedpath() { #if defined(PLATFORM_WINDOWS) wchar_t path[PATH_MAX] = L""; SHGetFolderPathW(nullptr, CSIDL_COMMON_APPDATA | CSIDL_FLAG_CREATE, nullptr, 0, path); string result = (const char*)utf8_t(path); result.transform("\\", "/"); #elif defined(PLATFORM_MACOSX) string result = "/Library/Application Support/"; #else string result = "/usr/share/"; #endif if(result.empty()) result = "."; if(result.endsWith("/") == false) result.append("/"); return result; } // /tmp // c:/users/username/AppData/Local/Temp/ string temppath() { #if defined(PLATFORM_WINDOWS) wchar_t path[PATH_MAX] = L""; GetTempPathW(PATH_MAX, path); string result = (const char*)utf8_t(path); result.transform("\\", "/"); #elif defined(P_tmpdir) string result = P_tmpdir; #else string result = "/tmp/"; #endif if(result.endsWith("/") == false) result.append("/"); return result; } } #endif sfc/alt/ppu-balanced/ppu.hpp000664 001750 001750 00000003244 12651764221 017116 0ustar00sergiosergio000000 000000 struct PPU : Thread, public PPUcounter { uint8 vram[128 * 1024]; uint8 oam[544]; uint8 cgram[512]; enum : bool { Threaded = true }; alwaysinline void step(unsigned clocks); alwaysinline void synchronize_cpu(); #include "memory/memory.hpp" #include "mmio/mmio.hpp" #include "render/render.hpp" uint32* surface; uint32* output; unsigned ppu1_version = 1; unsigned ppu2_version = 3; static void Enter(); void add_clocks(unsigned clocks); uint8 region; unsigned line; enum { NTSC = 0, PAL = 1 }; enum { BG1 = 0, BG2 = 1, BG3 = 2, BG4 = 3, OAM = 4, BACK = 5, COL = 5 }; enum { SC_32x32 = 0, SC_64x32 = 1, SC_32x64 = 2, SC_64x64 = 3 }; struct { bool interlace; bool overscan; } display; struct { //$2101 uint8 oam_basesize; uint8 oam_nameselect; uint16 oam_tdaddr; //$210d-$210e uint16 m7_hofs, m7_vofs; //$211b-$2120 uint16 m7a, m7b, m7c, m7d, m7x, m7y; } cache; alwaysinline bool interlace() const { return display.interlace; } alwaysinline bool overscan() const { return display.overscan; } alwaysinline bool hires() const { return (regs.pseudo_hires || regs.bg_mode == 5 || regs.bg_mode == 6); } uint16 mosaic_table[16][4096]; void render_line(); void update_oam_status(); //required functions void scanline(); void render_scanline(); void frame(); void enter(); void enable(); void power(); void reset(); bool layer_enabled[5][4]; void layer_enable(unsigned layer, unsigned priority, bool enable); unsigned frameskip; unsigned framecounter; void set_frameskip(unsigned frameskip); void serialize(serializer&); PPU(); ~PPU(); }; extern PPU ppu; sfc/chip/st0010/000700 001750 001750 00000000000 12656700342 014320 5ustar00sergiosergio000000 000000 gb/apu/noise/noise.cpp000664 001750 001750 00000004265 12651764221 016032 0ustar00sergiosergio000000 000000 #ifdef APU_CPP bool APU::Noise::dac_enable() { return (envelope_volume || envelope_direction); } void APU::Noise::run() { if(period && --period == 0) { period = divisor << frequency; if(frequency < 14) { bool bit = (lfsr ^ (lfsr >> 1)) & 1; lfsr = (lfsr >> 1) ^ (bit << (narrow_lfsr ? 6 : 14)); } } uint4 sample = (lfsr & 1) ? (uint4)0 : volume; if(enable == false) sample = 0; output = sample; } void APU::Noise::clock_length() { if(enable && counter) { if(++length == 0) enable = false; } } void APU::Noise::clock_envelope() { if(enable && envelope_frequency && --envelope_period == 0) { envelope_period = envelope_frequency; if(envelope_direction == 0 && volume > 0) volume--; if(envelope_direction == 1 && volume < 15) volume++; } } void APU::Noise::write(unsigned r, uint8 data) { if(r == 1) { //$ff20 NR41 length = data & 0x3f; } if(r == 2) { //$ff21 NR42 envelope_volume = data >> 4; envelope_direction = data & 0x08; envelope_frequency = data & 0x07; if(dac_enable() == false) enable = false; } if(r == 3) { //$ff22 NR43 frequency = data >> 4; narrow_lfsr = data & 0x08; divisor = (data & 0x07) << 3; if(divisor == 0) divisor = 4; period = divisor << frequency; } if(r == 4) { //$ff34 NR44 bool initialize = data & 0x80; counter = data & 0x40; if(initialize) { enable = dac_enable(); lfsr = ~0U; envelope_period = envelope_frequency; volume = envelope_volume; } } } void APU::Noise::power() { enable = 0; envelope_volume = 0; envelope_direction = 0; envelope_frequency = 0; frequency = 0; narrow_lfsr = 0; divisor = 0; counter = 0; output = 0; length = 0; envelope_period = 0; volume = 0; period = 0; lfsr = 0; } void APU::Noise::serialize(serializer& s) { s.integer(enable); s.integer(envelope_volume); s.integer(envelope_direction); s.integer(envelope_frequency); s.integer(frequency); s.integer(narrow_lfsr); s.integer(divisor); s.integer(counter); s.integer(output); s.integer(length); s.integer(envelope_period); s.integer(volume); s.integer(period); s.integer(lfsr); } #endif ananke/resource/archive.png000664 001750 001750 00000002053 12651764221 017123 0ustar00sergiosergio000000 000000 PNG  IHDR szzsBIT|dIDATX_U?ffgXf(1$D YT z,Y7 %*Tԥ e383߽=uVs9f1;Z/?x3 k<;KF-rYyƎD`ߖ%~:skRmDQ ?LL P: u/qъ}sWu jMe+:[-C ug&NpQӂтL'-d{]8ׅFsE˶T+]$]ݶzBX +(%DP 5/.OOrSNj˯zA3bUxa^2,濻'ݳz/,Yp.\dEv"_}E\x& lUDod͕b~EИyjDcb^) uq"^EJ/8;93  ݿ=7tǍ*b`_wCbQuQDy4F5v3ΈĶ.o(x~OVp v7mtc nF|:|mgw fL%8v^ݒ&JLB H6d%(m u!7܌6~devices) { if(id != device->id) continue; if(group == "Rumble") { item.device = device; item.id = id; item.group = 0; item.input = 0; break; } if(auto groupID = device->find(group)) { if(auto inputID = device->group[groupID()].find(input)) { item.device = device; item.id = id; item.group = groupID(); item.input = inputID(); item.qualifier = Input::Qualifier::None; if(qualifier == "Lo") item.qualifier = Input::Qualifier::Lo; if(qualifier == "Hi") item.qualifier = Input::Qualifier::Hi; break; } } } if(item.device == nullptr) continue; inputList.append(item); } } bool AbstractInput::append(string encode) { lstring mappings = mapping.split(","); if(mappings.find(encode)) return true; //mapping already bound if(mapping.empty() || mapping == "None") mapping = encode; //remove "None" else mapping.append(",", encode); //add to existing mapping list bind(); return true; } // bool DigitalInput::bind(HID::Device& device, unsigned group, unsigned input, int16_t oldValue, int16_t newValue) { if(device.isNull() || (device.isKeyboard() && device.group[group].input[input].name == "Escape")) { inputList.reset(); mapping = "None"; return true; } string encode = {hex(device.id), "/", device.group[group].name, "/", device.group[group].input[input].name}; if((device.isKeyboard() && group == HID::Keyboard::GroupID::Button) || (device.isMouse() && group == HID::Mouse::GroupID::Button) || (device.isJoypad() && group == HID::Joypad::GroupID::Button) ) { if(newValue != 0) return append(encode); } if((device.isJoypad() && group == HID::Joypad::GroupID::Axis) || (device.isJoypad() && group == HID::Joypad::GroupID::Hat) ) { if(newValue < -16384) return append({encode, "/Lo"}); if(newValue > +16384) return append({encode, "/Hi"}); } return false; } int16_t DigitalInput::poll() { if(program->focused() == false) return 0; if(inputList.size() == 0) return 0; bool result = logic; for(auto& item : inputList) { HID::Device& device = *(item.device); int16_t value = device.group[item.group].input[item.input].value; bool output = logic; if((device.isKeyboard() && item.group == HID::Keyboard::GroupID::Button) || (device.isMouse() && item.group == HID::Mouse::GroupID::Button) || (device.isJoypad() && item.group == HID::Joypad::GroupID::Button) ) { output = value; } if((device.isJoypad() && item.group == HID::Joypad::GroupID::Axis) || (device.isJoypad() && item.group == HID::Joypad::GroupID::Hat) ) { if(item.qualifier == Input::Qualifier::Lo) output = value < -16384; if(item.qualifier == Input::Qualifier::Hi) output = value > +16384; } if(logic == 0) result |= output; if(logic == 1) result &= output; } return result; } // bool RelativeInput::bind(HID::Device& device, unsigned group, unsigned input, int16_t oldValue, int16_t newValue) { if(device.isNull() || (device.isKeyboard() && device.group[group].input[input].name == "Escape")) { inputList.reset(); mapping = "None"; return true; } string encode = {hex(device.id), "/", device.group[group].name, "/", device.group[group].input[input].name}; if((device.isMouse() && group == HID::Mouse::GroupID::Axis) || (device.isJoypad() && group == HID::Joypad::GroupID::Axis) || (device.isJoypad() && group == HID::Joypad::GroupID::Hat) ) { if(newValue < -16384) return append(encode); if(newValue > +16384) return append(encode); } return false; } int16_t RelativeInput::poll() { if(program->focused() == false) return 0; if(inputList.size() == 0) return 0; int16_t result = 0; for(auto& item : inputList) { HID::Device& device = *(item.device); int16_t value = device.group[item.group].input[item.input].value; if(device.isJoypad() && item.group == HID::Joypad::GroupID::Axis) value >>= 8; if(device.isJoypad() && item.group == HID::Joypad::GroupID::Hat) value = (value < 0 ? -1 : value > 0 ? + 1 : 0); if(device.isMouse() && input.acquired() == false) value = 0; result += value; } return result; } // bool RumbleInput::bind(HID::Device& device, unsigned group, unsigned input, int16_t oldValue, int16_t newValue) { if(device.isNull() || (device.isKeyboard() && device.group[group].input[input].name == "Escape")) { inputList.reset(); mapping = "None"; return true; } string encode = {hex(device.id), "/Rumble"}; if(device.isJoypad() && group == HID::Joypad::GroupID::Button) { if(newValue != 0) return append(encode); } return false; } void RumbleInput::rumble(bool enable) { if(program->focused() == false) return; if(inputList.size() == 0) return; for(auto& item : inputList) { input.rumble(item.id, enable); } } // HotkeyInput::HotkeyInput() { logic = 1; //AND inputManager->hotkeyMap.append(this); } // //convert an input mapping string to a more human-readable form for the UI string InputManager::sanitize(string mapping, string concatenate) const { lstring values = mapping.split(","); for(auto& value : values) { lstring part = value.split("/"); if(part.size() < 2) continue; //skip "None" mapping if(part[0] == "1") part[0] = "Keyboard"; else if(part[0] == "2") part[0] = "Mouse"; else part[0] = {"Joypad(", part[0].slice(0, 3), ")"}; value = part.merge("."); } return values.merge(concatenate); } void InputManager::onChange(HID::Device& device, unsigned group, unsigned input, int16_t oldValue, int16_t newValue) { if(settings->focused()) { inputSettings->inputEvent(device, group, input, oldValue, newValue); hotkeySettings->inputEvent(device, group, input, oldValue, newValue); } } HID::Device* InputManager::findMouse() { for(auto device : devices) { if(device->isMouse()) return device; } return nullptr; } void InputManager::bind() { for(auto& input : inputMap) input->bind(); for(auto& input : hotkeyMap) input->bind(); } void InputManager::poll() { auto devices = input.poll(); bool changed = devices.size() != this->devices.size(); if(changed == false) { for(unsigned n = 0; n < devices.size(); n++) { changed = devices[n] != this->devices[n]; if(changed) break; } } if(changed == true) { this->devices = devices; bind(); } if(presentation->focused()) pollHotkeys(); } void InputManager::saveConfiguration() { config.save(program->path("input.bml")); } InputManager::InputManager() { inputManager = this; bootstrap(); input.onChange = {&InputManager::onChange, this}; } void InputManager::bootstrap() { unsigned guid = 0; for(auto& emulator : program->emulator) { Configuration::Node emulatorNode; for(auto& port : emulator->port) { Configuration::Node portNode; for(auto& device : port.device) { Configuration::Node deviceNode; for(auto& number : device.order) { auto& input = device.input[number]; AbstractInput* abstract = nullptr; if(input.type == 0) abstract = new DigitalInput; if(input.type == 1) abstract = new RelativeInput; if(input.type == 2) abstract = new RumbleInput; if(abstract == nullptr) continue; abstract->name = string{input.name}.replace(" ", ""); abstract->mapping = "None"; abstract->logic = 0; //OR input.guid = guid++; inputMap.append(abstract); deviceNode.append(abstract->mapping, abstract->name); } portNode.append(deviceNode, string{device.name}.replace(" ", "")); } emulatorNode.append(portNode, string{port.name}.replace(" ", "")); } config.append(emulatorNode, string{emulator->information.name}.replace(" ", "")); } appendHotkeys(); config.load(program->path("input.bml")); config.save(program->path("input.bml")); bind(); } gb/cartridge/serialization.cpp000664 001750 001750 00000002365 12651764221 017633 0ustar00sergiosergio000000 000000 #ifdef CARTRIDGE_CPP void Cartridge::serialize(serializer& s) { if(information.battery) s.array(ramdata, ramsize); s.integer(bootrom_enable); s.integer(mbc1.ram_enable); s.integer(mbc1.rom_select); s.integer(mbc1.ram_select); s.integer(mbc1.mode_select); s.integer(mbc2.ram_enable); s.integer(mbc2.rom_select); s.integer(mbc3.ram_enable); s.integer(mbc3.rom_select); s.integer(mbc3.ram_select); s.integer(mbc3.rtc_latch); s.integer(mbc3.rtc_halt); s.integer(mbc3.rtc_second); s.integer(mbc3.rtc_minute); s.integer(mbc3.rtc_hour); s.integer(mbc3.rtc_day); s.integer(mbc3.rtc_day_carry); s.integer(mbc3.rtc_latch_second); s.integer(mbc3.rtc_latch_minute); s.integer(mbc3.rtc_latch_hour); s.integer(mbc3.rtc_latch_day); s.integer(mbc3.rtc_latch_day_carry); s.integer(mbc5.ram_enable); s.integer(mbc5.rom_select); s.integer(mbc5.ram_select); s.integer(mmm01.rom_mode); s.integer(mmm01.rom_base); s.integer(mmm01.ram_enable); s.integer(mmm01.rom_select); s.integer(mmm01.ram_select); s.integer(huc1.ram_writable); s.integer(huc1.rom_select); s.integer(huc1.ram_select); s.integer(huc1.model); s.integer(huc3.ram_enable); s.integer(huc3.rom_select); s.integer(huc3.ram_select); } #endif phoenix/reference/widget/viewport.hpp000664 001750 001750 00000000410 12651764221 021166 0ustar00sergiosergio000000 000000 namespace phoenix { struct pViewport : public pWidget { Viewport& viewport; uintptr_t handle(); void setDroppable(bool droppable); pViewport(Viewport& viewport) : pWidget(viewport), viewport(viewport) {} void constructor(); void destructor(); }; } sfc/cheat/cheat.hpp000664 001750 001750 00000000642 12651764221 015346 0ustar00sergiosergio000000 000000 struct Cheat { struct Code { unsigned addr; unsigned comp; unsigned data; }; vector codes; enum : unsigned { Unused = ~0u }; alwaysinline bool enable() const { return codes.size() > 0; } void reset(); void append(unsigned addr, unsigned data); void append(unsigned addr, unsigned comp, unsigned data); optional find(unsigned addr, unsigned comp); }; extern Cheat cheat; processor/hg51b/registers.hpp000664 001750 001750 00000000545 12651764221 017361 0ustar00sergiosergio000000 000000 struct Registers { bool halt; uint24 pc; uint16 p; bool n; bool z; bool c; uint24 a; uint24 acch; uint24 accl; uint24 busdata; uint24 romdata; uint24 ramdata; uint24 busaddr; uint24 ramaddr; uint24 gpr[16]; } regs; uint24 stack[8]; uint16 opcode; uint24 reg_read(uint8 addr) const; void reg_write(uint8 addr, uint24 data); phoenix/qt/000700 001750 001750 00000000000 12656700342 013771 5ustar00sergiosergio000000 000000 sfc/base/satellaview/satellaview.hpp000664 001750 001750 00000001077 12651764221 020753 0ustar00sergiosergio000000 000000 struct SatellaviewBaseUnit : Memory { void init(); void load(); void unload(); void power(); void reset(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); private: struct { uint8 r2188, r2189, r218a, r218b; uint8 r218c, r218d, r218e, r218f; uint8 r2190, r2191, r2192, r2193; uint8 r2194, r2195, r2196, r2197; uint8 r2198, r2199, r219a, r219b; uint8 r219c, r219d, r219e, r219f; uint8 r2192_counter; uint8 r2192_hour, r2192_minute, r2192_second; } regs; }; extern SatellaviewBaseUnit satellaviewbaseunit; nall/hashset.hpp000664 001750 001750 00000005677 12651764221 015025 0ustar00sergiosergio000000 000000 #ifndef NALL_HASHSET_HPP #define NALL_HASHSET_HPP //hashset // //search: O(1) average; O(n) worst //insert: O(1) average; O(n) worst //remove: O(1) average; O(n) worst // //requirements: // unsigned T::hash() const; // bool T::operator==(const T&) const; namespace nall { template struct hashset { protected: T** pool = nullptr; unsigned length = 8; //length of pool unsigned count = 0; //number of objects inside of the pool public: hashset() {} hashset(unsigned length) : length(bit::round(length)) {} hashset(const hashset& source) { operator=(source); } hashset(hashset&& source) { operator=(std::move(source)); } ~hashset() { reset(); } hashset& operator=(const hashset& source) { reset(); if(source.pool) { for(unsigned n = 0; n < source.count; n++) { insert(*source.pool[n]); } } return *this; } hashset& operator=(hashset&& source) { reset(); pool = source.pool; length = source.length; count = source.count; source.pool = nullptr; source.length = 8; source.count = 0; return *this; } unsigned capacity() const { return length; } unsigned size() const { return count; } bool empty() const { return count == 0; } void reset() { if(pool) { for(unsigned n = 0; n < length; n++) { if(pool[n]) { delete pool[n]; pool[n] = nullptr; } } delete pool; pool = nullptr; } length = 8; count = 0; } void reserve(unsigned size) { //ensure all items will fit into pool (with <= 50% load) and amortize growth size = bit::round(max(size, count << 1)); T** copy = new T*[size](); if(pool) { for(unsigned n = 0; n < length; n++) { if(pool[n]) { unsigned hash = (*pool[n]).hash() & (size - 1); while(copy[hash]) if(++hash >= size) hash = 0; copy[hash] = pool[n]; pool[n] = nullptr; } } } delete pool; pool = copy; length = size; } optional find(const T& value) { if(!pool) return false; unsigned hash = value.hash() & (length - 1); while(pool[hash]) { if(value == *pool[hash]) return {true, *pool[hash]}; if(++hash >= length) hash = 0; } return false; } optional insert(const T& value) { if(!pool) pool = new T*[length](); //double pool size when load is >= 50% if(count >= (length >> 1)) reserve(length << 1); count++; unsigned hash = value.hash() & (length - 1); while(pool[hash]) if(++hash >= length) hash = 0; pool[hash] = new T(value); return {true, *pool[hash]}; } bool remove(const T& value) { if(!pool) return false; unsigned hash = value.hash() & (length - 1); while(pool[hash]) { if(value == *pool[hash]) { delete pool[hash]; pool[hash] = nullptr; count--; return true; } if(++hash >= length) hash = 0; } return false; } }; } #endif sfc/alt/ppu-balanced/render/mode7.cpp000664 001750 001750 00000010622 12651764221 020575 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP //bsnes mode7 renderer // //base algorithm written by anomie //bsnes implementation written by byuu // //supports mode 7 + extbg + rotate + zoom + direct color + scrolling + m7sel + windowing + mosaic //interlace and pseudo-hires support are automatic via main rendering routine //13-bit sign extend //--s---vvvvvvvvvv -> ssssssvvvvvvvvvv #define CLIP(x) ( ((x) & 0x2000) ? ( (x) | ~0x03ff) : ((x) & 0x03ff) ) template void PPU::render_line_mode7(uint8 pri0_pos, uint8 pri1_pos) { if(layer_enabled[bg][0] == false) pri0_pos = 0; if(layer_enabled[bg][1] == false) pri1_pos = 0; if(pri0_pos + pri1_pos == 0) return; if(regs.bg_enabled[bg] == false && regs.bgsub_enabled[bg] == false) return; int32 px, py; int32 tx, ty, tile, palette; int32 a = sclip<16>(cache.m7a); int32 b = sclip<16>(cache.m7b); int32 c = sclip<16>(cache.m7c); int32 d = sclip<16>(cache.m7d); int32 cx = sclip<13>(cache.m7x); int32 cy = sclip<13>(cache.m7y); int32 hofs = sclip<13>(cache.m7_hofs); int32 vofs = sclip<13>(cache.m7_vofs); int _pri, _x; bool _bg_enabled = regs.bg_enabled[bg]; bool _bgsub_enabled = regs.bgsub_enabled[bg]; build_window_tables(bg); uint8* wt_main = window[bg].main; uint8* wt_sub = window[bg].sub; int32 y = (regs.mode7_vflip == false ? line : 255 - line); uint16* mtable_x; uint16* mtable_y; if(bg == BG1) { mtable_x = (uint16*)mosaic_table[(regs.mosaic_enabled[BG1] == true) ? regs.mosaic_size : 0]; mtable_y = (uint16*)mosaic_table[(regs.mosaic_enabled[BG1] == true) ? regs.mosaic_size : 0]; } else { //bg == BG2 //Mode7 EXTBG BG2 uses BG1 mosaic enable to control vertical mosaic, //and BG2 mosaic enable to control horizontal mosaic... mtable_x = (uint16*)mosaic_table[(regs.mosaic_enabled[BG2] == true) ? regs.mosaic_size : 0]; mtable_y = (uint16*)mosaic_table[(regs.mosaic_enabled[BG1] == true) ? regs.mosaic_size : 0]; } int32 psx = ((a * CLIP(hofs - cx)) & ~63) + ((b * CLIP(vofs - cy)) & ~63) + ((b * mtable_y[y]) & ~63) + (cx << 8); int32 psy = ((c * CLIP(hofs - cx)) & ~63) + ((d * CLIP(vofs - cy)) & ~63) + ((d * mtable_y[y]) & ~63) + (cy << 8); for(int32 x = 0; x < 256; x++) { px = psx + (a * mtable_x[x]); py = psy + (c * mtable_x[x]); //mask floating-point bits (low 8 bits) px >>= 8; py >>= 8; switch(regs.mode7_repeat) { case 0: //screen repetition outside of screen area case 1: { //same as case 0 px &= 1023; py &= 1023; tx = ((px >> 3) & 127); ty = ((py >> 3) & 127); tile = vram[(ty * 128 + tx) << 1]; palette = vram[(((tile << 6) + ((py & 7) << 3) + (px & 7)) << 1) + 1]; } break; case 2: { //palette color 0 outside of screen area if((px | py) & ~1023) { palette = 0; } else { px &= 1023; py &= 1023; tx = ((px >> 3) & 127); ty = ((py >> 3) & 127); tile = vram[(ty * 128 + tx) << 1]; palette = vram[(((tile << 6) + ((py & 7) << 3) + (px & 7)) << 1) + 1]; } } break; case 3: { //character 0 repetition outside of screen area if((px | py) & ~1023) { tile = 0; } else { px &= 1023; py &= 1023; tx = ((px >> 3) & 127); ty = ((py >> 3) & 127); tile = vram[(ty * 128 + tx) << 1]; } palette = vram[(((tile << 6) + ((py & 7) << 3) + (px & 7)) << 1) + 1]; } break; } if(bg == BG1) { _pri = pri0_pos; } else { _pri = (palette >> 7) ? pri1_pos : pri0_pos; palette &= 0x7f; } if(!palette) continue; _x = (regs.mode7_hflip == false) ? (x) : (255 - x); uint32 col; if(regs.direct_color == true && bg == BG1) { //direct color mode does not apply to bg2, as it is only 128 colors... col = get_direct_color(0, palette); } else { col = get_palette(palette); } if(regs.bg_enabled[bg] == true && !wt_main[_x]) { if(pixel_cache[_x].pri_main < _pri) { pixel_cache[_x].pri_main = _pri; pixel_cache[_x].bg_main = bg; pixel_cache[_x].src_main = col; pixel_cache[_x].ce_main = false; } } if(regs.bgsub_enabled[bg] == true && !wt_sub[_x]) { if(pixel_cache[_x].pri_sub < _pri) { pixel_cache[_x].pri_sub = _pri; pixel_cache[_x].bg_sub = bg; pixel_cache[_x].src_sub = col; pixel_cache[_x].ce_sub = false; } } } } #undef CLIP #endif sfc/alt/ppu-performance/background/background.cpp000664 001750 001750 00000013627 12651764221 023321 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP #include "mode7.cpp" unsigned PPU::Background::get_tile(unsigned hoffset, unsigned voffset) { unsigned tile_x = (hoffset & mask_x) >> tile_width; unsigned tile_y = (voffset & mask_y) >> tile_height; unsigned tile_pos = ((tile_y & 0x1f) << 5) + (tile_x & 0x1f); if(tile_y & 0x20) tile_pos += scy; if(tile_x & 0x20) tile_pos += scx; const uint16 tiledata_addr = regs.screen_addr + (tile_pos << 1); return (ppu.vram[tiledata_addr + 0] << 0) + (ppu.vram[tiledata_addr + 1] << 8); } void PPU::Background::offset_per_tile(unsigned x, unsigned y, unsigned& hoffset, unsigned& voffset) { unsigned opt_x = (x + (hscroll & 7)), hval, vval; if(opt_x >= 8) { hval = self.bg3.get_tile((opt_x - 8) + (self.bg3.regs.hoffset & ~7), self.bg3.regs.voffset + 0); if(self.regs.bgmode != 4) vval = self.bg3.get_tile((opt_x - 8) + (self.bg3.regs.hoffset & ~7), self.bg3.regs.voffset + 8); if(self.regs.bgmode == 4) { if(hval & opt_valid_bit) { if(!(hval & 0x8000)) { hoffset = opt_x + (hval & ~7); } else { voffset = y + hval; } } } else { if(hval & opt_valid_bit) { hoffset = opt_x + (hval & ~7); } if(vval & opt_valid_bit) { voffset = y + vval; } } } } void PPU::Background::scanline() { if(self.vcounter() == 1) { mosaic_vcounter = regs.mosaic + 1; mosaic_voffset = 1; } else if(--mosaic_vcounter == 0) { mosaic_vcounter = regs.mosaic + 1; mosaic_voffset += regs.mosaic + 1; } if(self.regs.display_disable) return; hires = (self.regs.bgmode == 5 || self.regs.bgmode == 6); width = !hires ? 256 : 512; tile_height = regs.tile_size ? 4 : 3; tile_width = hires ? 4 : tile_height; mask_x = (tile_height == 4 ? width << 1 : width); mask_y = mask_x; if(regs.screen_size & 1) mask_x <<= 1; if(regs.screen_size & 2) mask_y <<= 1; mask_x--; mask_y--; scx = (regs.screen_size & 1 ? 32 << 5 : 0); scy = (regs.screen_size & 2 ? 32 << 5 : 0); if(regs.screen_size == 3) scy <<= 1; } void PPU::Background::render() { if(regs.mode == Mode::Inactive) return; if(regs.main_enable == false && regs.sub_enable == false) return; if(regs.main_enable) window.render(0); if(regs.sub_enable) window.render(1); if(regs.mode == Mode::Mode7) return render_mode7(); unsigned priority0 = (priority0_enable ? regs.priority0 : 0); unsigned priority1 = (priority1_enable ? regs.priority1 : 0); if(priority0 + priority1 == 0) return; unsigned mosaic_hcounter = 1; unsigned mosaic_palette = 0; unsigned mosaic_priority = 0; unsigned mosaic_color = 0; const unsigned bgpal_index = (self.regs.bgmode == 0 ? id << 5 : 0); const unsigned pal_size = 2 << regs.mode; const unsigned tile_mask = 0x0fff >> regs.mode; const unsigned tiledata_index = regs.tiledata_addr >> (4 + regs.mode); hscroll = regs.hoffset; vscroll = regs.voffset; unsigned y = (regs.mosaic == 0 ? self.vcounter() : mosaic_voffset); if(hires) { hscroll <<= 1; if(self.regs.interlace) y = (y << 1) + self.field(); } unsigned tile_pri, tile_num; unsigned pal_index, pal_num; unsigned hoffset, voffset, col; bool mirror_x, mirror_y; const bool is_opt_mode = (self.regs.bgmode == 2 || self.regs.bgmode == 4 || self.regs.bgmode == 6); const bool is_direct_color_mode = (self.screen.regs.direct_color == true && id == ID::BG1 && (self.regs.bgmode == 3 || self.regs.bgmode == 4)); signed x = 0 - (hscroll & 7); while(x < width) { hoffset = x + hscroll; voffset = y + vscroll; if(is_opt_mode) offset_per_tile(x, y, hoffset, voffset); hoffset &= mask_x; voffset &= mask_y; tile_num = get_tile(hoffset, voffset); mirror_y = tile_num & 0x8000; mirror_x = tile_num & 0x4000; tile_pri = tile_num & 0x2000 ? priority1 : priority0; pal_num = (tile_num >> 10) & 7; pal_index = (bgpal_index + (pal_num << pal_size)) & 0xff; if(tile_width == 4 && (bool)(hoffset & 8) != mirror_x) tile_num += 1; if(tile_height == 4 && (bool)(voffset & 8) != mirror_y) tile_num += 16; tile_num = ((tile_num & 0x03ff) + tiledata_index) & tile_mask; if(mirror_y) voffset ^= 7; unsigned mirror_xmask = !mirror_x ? 0 : 7; uint8* tiledata = self.cache.tile(regs.mode, tile_num); tiledata += ((voffset & 7) * 8); for(unsigned n = 0; n < 8; n++, x++) { if(x & width) continue; if(--mosaic_hcounter == 0) { mosaic_hcounter = regs.mosaic + 1; mosaic_palette = tiledata[n ^ mirror_xmask]; mosaic_priority = tile_pri; if(is_direct_color_mode) { mosaic_color = self.screen.get_direct_color(pal_num, mosaic_palette); } else { mosaic_color = self.screen.get_palette(pal_index + mosaic_palette); } } if(mosaic_palette == 0) continue; if(hires == false) { if(regs.main_enable && !window.main[x]) self.screen.output.plot_main(x, mosaic_color, mosaic_priority, id); if(regs.sub_enable && !window.sub[x]) self.screen.output.plot_sub(x, mosaic_color, mosaic_priority, id); } else { signed half_x = x >> 1; if(x & 1) { if(regs.main_enable && !window.main[half_x]) self.screen.output.plot_main(half_x, mosaic_color, mosaic_priority, id); } else { if(regs.sub_enable && !window.sub[half_x]) self.screen.output.plot_sub(half_x, mosaic_color, mosaic_priority, id); } } } } } PPU::Background::Background(PPU& self, unsigned id) : self(self), id(id) { priority0_enable = true; priority1_enable = true; opt_valid_bit = (id == ID::BG1 ? 0x2000 : id == ID::BG2 ? 0x4000 : 0x0000); mosaic_table = new uint16*[16]; for(unsigned m = 0; m < 16; m++) { mosaic_table[m] = new uint16[4096]; for(unsigned x = 0; x < 4096; x++) { mosaic_table[m][x] = (x / (m + 1)) * (m + 1); } } } PPU::Background::~Background() { for(unsigned m = 0; m < 16; m++) delete[] mosaic_table[m]; delete[] mosaic_table; } #endif phoenix/gtk/font.cpp000664 001750 001750 00000004602 12651764221 015623 0ustar00sergiosergio000000 000000 namespace phoenix { string pFont::serif(unsigned size, string style) { if(size == 0) size = 8; if(style == "") style = "Normal"; return {"Serif, ", size, ", ", style}; } string pFont::sans(unsigned size, string style) { if(size == 0) size = 8; if(style == "") style = "Normal"; return {"Sans, ", size, ", ", style}; } string pFont::monospace(unsigned size, string style) { if(size == 0) size = 8; return {"Liberation Mono, ", size, ", ", style}; } Size pFont::size(string font, string text) { PangoFontDescription* description = create(font); Size size = pFont::size(description, text); free(description); return size; } PangoFontDescription* pFont::create(string description) { lstring part; part.split<2>(",", description); for(auto& item : part) item.trim(" "); string family = "Sans"; unsigned size = 8u; bool bold = false; bool italic = false; if(part[0] != "") family = part[0]; if(part.size() >= 2) size = decimal(part[1]); if(part.size() >= 3) bold = part[2].find("Bold"); if(part.size() >= 3) italic = part[2].find("Italic"); PangoFontDescription* font = pango_font_description_new(); pango_font_description_set_family(font, family); pango_font_description_set_size(font, size * PANGO_SCALE); pango_font_description_set_weight(font, !bold ? PANGO_WEIGHT_NORMAL : PANGO_WEIGHT_BOLD); pango_font_description_set_style(font, !italic ? PANGO_STYLE_NORMAL : PANGO_STYLE_OBLIQUE); return font; } void pFont::free(PangoFontDescription* font) { pango_font_description_free(font); } Size pFont::size(PangoFontDescription* font, string text) { PangoContext* context = gdk_pango_context_get_for_screen(gdk_screen_get_default()); PangoLayout* layout = pango_layout_new(context); pango_layout_set_font_description(layout, font); pango_layout_set_text(layout, text, -1); int width = 0, height = 0; pango_layout_get_pixel_size(layout, &width, &height); g_object_unref((gpointer)layout); return {width, height}; } void pFont::setFont(GtkWidget* widget, string font) { auto gtkFont = pFont::create(font); pFont::setFont(widget, (gpointer)gtkFont); pFont::free(gtkFont); } void pFont::setFont(GtkWidget* widget, gpointer font) { if(font == nullptr) return; gtk_widget_modify_font(widget, (PangoFontDescription*)font); if(GTK_IS_CONTAINER(widget)) { gtk_container_foreach(GTK_CONTAINER(widget), (GtkCallback)pFont::setFont, font); } } } phoenix/qt/action/item.cpp000664 001750 001750 00000001002 12651764221 016716 0ustar00sergiosergio000000 000000 namespace phoenix { void pItem::setImage(const image& image) { qtAction->setIcon(CreateIcon(image)); } void pItem::setText(string text) { qtAction->setText(QString::fromUtf8(text)); } void pItem::constructor() { qtAction = new QAction(0); connect(qtAction, SIGNAL(triggered()), SLOT(onActivate())); } void pItem::destructor() { if(action.state.menu) action.state.menu->remove(item); delete qtAction; qtAction = nullptr; } void pItem::onActivate() { if(item.onActivate) item.onActivate(); } } data/higan.png000664 001750 001750 00000061672 12651764221 014431 0ustar00sergiosergio000000 000000 PNG  IHDRxsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org< IDATxwT{fvf.D1&~_L41hM,Į*hĂJ5D5(AN;ΜsSu하93|/ȃXy """b@DDA,< "" DDD!zT@ @h8@d^q_дDd5&R`{O_"9Ѐ MID}HJk.}D4t_w[iBh7,RT.&`<ֺ׎d9|}MI#D=I~_;F &sN]4 I)?qf`"\xG2,*h6HDK<$pLjc@ޡH;pg,4`ɶXy:y~ _"Bx&l߾Zg`i)rLA)w_ =h EH 2R>GJFItt`W ZS#|$ڝsKFq HdJMCF#\E<㏱c̟I L@^t$2W;E6 y  ˖vb=vW݁`It"2OBzhڗYXPϔthx9-Y"C*ƌ|mPHn!M:  R 9#%K~R  [ Ǐ/DƊ yЍIf8N8IZ,AsIǰ/B PX( ~$ r0,(IONbŋѸlt 9>FhC1p4B: 9 Sj$[D:_|=&6%%_<:p34M: 9 R.)pm֡bl􍣉'N?u~/)p9 Q*,$4њ|y%1l "{8M)Sѯt$J;.BKNױ鬳Gxj|5 3f ߅?;[:ݓ.aB,@}/t+͚ƍ1ɟC1p܎䎁0d_,LA򢞠p˹4@A9'bйrzy*\AhZB: RE~ yJ?ۮ,CVC)OQ6J?(o}$~^pONB}EroдtvBpJ#@?)Rg롔#."p&X \47}:(RVJǠԍ"(U$dp2Mpt;geem #P1t:zNckG)U|YY< X;DiʇRx h8N ,5< mJ]mCX8R3Q&##?'G:/<ˠe`Ju`t'*w cBh0dc)pt2 Sj,5H,EBL,2Y_1wȗCa`gJ=SAҖ{:gXB``GJ@ ə4 B.Jq˰~/@Kp,_(A yК7K BP.(ǭ8 /Ar_(ut2 ;Pj/o ym/(XZcc8R.|J-R4f"ЏZ'<+p :RA+ 8^7}:<ζOBÆ!c5o](utJ J,|rI}ԍ^RWac5&xxYΤI~xnLJrVRHK|7gd'"9%j!XXA (*5#s3q" QHpt3TMBː\5K63qtGt MߤPXIV)3atX(QRTt (5 Z㤣Pײه sH cs5(U,:r%I@X )u'~iq$d y0Jr}ne 5jt r"r}0BrKΑB}4t%gD@F !CA@*v(vd@Ct/c68`\B%%VX T)$?X_ 1c˓Aw2Tt/b aQ(},dJ?c-Y@_)5JG!p.,Z@_(TV.5vt׏%dgUA@o)upʅ2ޛ[v?$;VB) P $OjUge<r8OFXxNXR;.w9#/h0lG@O%{}=g G/ĭXtGS<H^'HG `%xw PXȃIX- ._$! W ?9!R\"JC?X: ً,șC6J7 BHY-^\\gAC8 |8R8 ٔvAOv=U6~.+s#X*sADZfJpoJce sAOE@K:ٟ/@Fw6p HxdpxPj*'}IG C(bw/7H W8 9Hp@x i?&8v4wQ*3xIG:,Ѫ*< 7l6 9&ਣ2D(0EAp?^qF} oڄ]=)+C  ; E'R΅Pmh?ؑ{i1șX$P9~7x_ᇑhk& H#wJ \^l;DO V[?_+?㣏LL os_^dB2 ؝eڔX}=x#{ z,fp2GP;v@LKxK\? 9|tꅶC=:^|ef!R^n\09M!]!2\^5k9ߝxk+o[ ٝv {,=,eKIxFT̞mW^ַrcss#"[k]Z:tO?nC]:NRK0} FW:a嗣7x?3S:!8o_ѹut Ӵ[*莿yP* )9H` "娜?e+›6Iq= 2Y˪ULF٬YZsIΑa{J}$^ŸYPu]Jq-Pgؓyr#Tsjw豘tt\KH|TV8:Z֬#,A"N:Wp9k~uN> ߤCK.{Ah =/i\/"R\#!MM^[PHqC PX_($v;VUIonF 7ȜĚ,< J#)+CM7;ojhnp~x =jzND٬Yh}(}qَ5mb}6> 2D:ex >:>P:#5Ѳj{O:%Q>{vHt/qV{KG\ oU܃xKt[c޸ Jp]G{ұ<J CfY^ȝ2E:+N33(lC553)mX7˄1`߹G'T[ZP1gNxNd$w2#x^g{??OgC!z˺@X>B9^{ ۮ-7vs!:/KDPq܁矣b\!v}ae$KRKG(42 ؅G"(=,?UwmMC}C5@[ύL#r0GP~)c&K38~_fk}͚;̝*/ ('@!cH<=$tt [c_MQ\; xRT:BO.3?#B'JGD[o_|!zr!Fv_V)ș`R<#@ȑgl)ގ7݄͛ϡk8o|>;^%f9Hns tNoE0rFc[nN/[۱(V8N9&xT| زE: ӣQTv _ #ǀOGhϕ ; ?4 kd'/.0d™31+1P8somtx0 "t/YhMtGH۱u!'-Fb|!C{ȝ:YF9vM7#R~?pjzH:cjkQ}=?ב0WQC֘1ȝ:yh-}F?HtttfwGgEއMJۺuhxx|>d/OGA!DV:J M[+0P*lÞgPE?)_:=$ƌA~IG4v ;iӐ7mݝs0F#4|t gI$Py睈75I'1C3 uz4oOLjy0c>Pt7>^|> 84ojBՂ1<|5t1A/mN5p5lb IDAT,?9'}:(Ҿa}SJG_(mS"8/D޴i(9Y# 0_:QkΆKd~|$Qǐ3yNr.;=Gwp樓Px(8N7x(u(4md ⿳ҏbCQxQh8Jͯ™3΁k  T}7χ P8s&r8?6q.O'bsSVMAҥH1<}먺~tcٳ1ː;e /48׀g8F芓-onFKWChYB:-eA眃c`It$_ ^p⿮;xdzg[k\=SShz5>rePpBґHt\O,۝/DJp=A˚51<ß#y / VƎŐ? î9'JqqPjSڸ(Β9R:p:\ҳƗ_FSOIǰ+FqHxh߷|_qL7nDN:'^믣GcBcWbW"{xIPJ5 KPYGcc8; Bϟ-ZVFE1eW_W\;;d8^ũTSLŧw>h}M;.u(br&L@'>{_\j\/فg)Q›6!ZS#Q9>x\:1l, rs"ʵr'OFu-nxtQi1\͗)6:>=bɓ5zt^xʗP*lO?#&Ɓ-cv:7oF#(ʝ2E'J񿰸He xMn@swe}W*:IE'$hG)Vvyo[s}>|0x#J/NDƘ ,a){ 'utn*֢UU(*Gl;G7)^I A.xY;ɣ =w_*|s=I}+\p܂Q# \pwܗH_L9r${,-b[NY+(*AQ#CQ#XZ*q$ʆu/YNVێL!8 @]wk΁,)NCBң}Do _ ŖS8@Eh{?cwd]@1ƘŝFF''؎SV''@1ҷsq'#4xtgIǽS?!ׯG'HGtXRK/cC(:d.]RB>3%-8%矏W\v^X:y NCt<S =P* b :,y\.tLpC=;DJS޴i(84?Q3H9E|Q,wTr :J@zAo 43λ`rYC_bː;e N>#FHG!gDf7@L W̽kNUU($M0dɓ׵&O1u>FBCQ1w31 K8 ؈nr~9'S5ztr>SfrNEI'~R("4)HG9&$1<2 3 J rŞ x)%t:m+Z>;&s˞gFd6(=7ŧ}Bt'x0ӎBCJ'Tp Gp?߮8*C3SA%{11Ofaփ(U X&geab_CpQNuTw֭Nҥ|EB`ZS-,)Az '9搥.^Uc|KرzzUJTi Cw~g@iSP1g,g1!')xC6QL((@>H-RҤmned xI XV$ ~Y̙駥"w}:uZޜe/oN >~d::#v E'xK ^yE:rLg8CT O}eqǡ@\`(z Fw~:mm\ *_( c:h1i_ۡb" 'C"\r|ȇ+=z$ַߖNc9?mNDQ~HÖ;{GΤI"Ϛ J/@zB4tM*@"!oPP~͈XN_(F1 sHKdCi`ʞCJߏANG?'(Ϝrͮ}aPxȟ1KIdwUL4%&~ ss;q9t:'v^Qq뭈_0QxюvJԍ}T4Ͱ9 򈢓NB 75 ge߱JHIY:Bٴb;ML{Gh}4 ; \C$ `@v{߃?7 BFJ18;uT-X  /D޴i(4dkldXx[ ;l5UP?^:FʜXرP7 }fhu]l<RF2GQkQ9>:>X:N >)sb`O=ېg CA!rإRD0X`ȟGeq%XRO ;u/?LZ1yi<ؠdD4ȇ^0@~sd msl/DE9r\h5-VG|5 yӦ!w44>3C!4C^pCr2GF͢E,꫁g̽6'NءоnﻯU|>d"s9D8Xp ӟвr%jyVyќXH9*̓ޒ@a!dS(,(!M`ȩpPa!gD.^leBaЯm;͔͒Jv"ee(=+%%;Yc";AD !A@!ws@AJ?%Kйyw٢m'~DkjP~H>BÆ!{`5v,2E2}Pߵ0ƨ}L о~=}|b;| }6g0ْ[L$PS?'c{͍6AvO?EϢ ynci!sCg'N@E[^"ʁR%дtcƎŐ.Cm֡m:t|a?;8W3`mDdXPj2 @̙(9z$?D' ЀXc#⍍0CFI B%%"XR)S}_o9u -k0[#M!,Pb+N- whN- r= B@"9t n@D6eh+vk\o8J}g]1Re+݇ S#YuyatD&N#w}#"/H{f@ԅhMtԱ  CJ)'D c )'ڕ#Z]-"eH ,HHYՎODhѪ*iܼU .̓2y@Aa\;6,ADJkfh7NGoH "5~ ڍӧvUcDdDFrKxwᪿ'"J@9_"-]|l$ڤ BxZ豘t E++Qqq(Ddo?AAͭ>B͢E18i,v]i 1ii$@&n8`Oxm#җA@):*7K'!p (nIDP1gb Q(u 2#ZS#2TvQ(5 2BH$cXsT{t "J .^:,A1o8@d,쒮ꮻ<8@d/Гxk+*oz$"z'):nE…1~,Hzвz5-AD{OuQ#DԳ B޴I:8*:(DԽovt~tۉ77b\Ѩt"@:7oF̓J q (VAoWcѷq (lY# 18@0 =qT̛냉SDěP9>x\: %q (\{>C%1(SD",Q^z mt "2q?{EV: ץ5~pUy&DXƓgun(›6ǤcyYZ7 D[HpƗ_F;H *D!]骺>DcyQ"O14jigqq:7oF1A@,ȓx^{ kJ nIz$β2Sp!oV$!@DY#y3FKè7g@i !r ӹu+jzH:0ADNj^-VI r3D@,ZHyt "2HADNkh@F:%:;"pi; >)?@:gDP1(qy kXG:۰ DK𜚇Bd6Dn+7".sH!KG!rдxY| DHEjx@:ҵO:zm/Z֬Aӿ- , | ]śѹet ϫ}~/ׯt]:(*GC: S G /ȩXsʹ^yE: -[onA}Q@7д*#kшWۓr|[[9aW~]hZ9zLd',l+ZS @w ǜ$%I!ɰLDN`j .&i߰HK_ 5̰v&;zl;ꮻNBdg?U:GAŤQݎzؽ+q5"["  ijyD:fim"LMUcٍ];Hu@L: D8gIǠ*AD_3q +z<.D}I 8| ;ZCvַFK/I 4-l*6hfw'@'H ~д7~Z֬aEx`-+e%W7k|Et "+>&w]hZ+LXp@d:]>D++cYŔ_juNcH]Ittb\葈t"+ '.+>TdIpHYx@:HNF"vp)(B(Ӳj^{M:1-o MDP "Gh}-ǵ }A~&ǑjyMUEeڢ=M> @Yc>q!9r<[y) 1,k}ǃ=4C]w.h{*c֋Բj#g?gg 9W_T:m7=9/z9Q>߷ >K@W3e3ޛ ȼl-i"1,^geuy$]jjk723ˑdwW<({[[QqУQ(D/M:!Rbh]k}|_|q]^<$?дv3_@:,73Q׭s=,-Šsα \矗A*ӧ{{9Ȗ#XZګ?7ot~{&'r%K1Ra v55hc=pi=ڤ4.먺ntn*/6A>3%+4m#F!eˀDB:FJzߕ/#]@^I+ىnCI: QoYu=m[[Ѽ|tbWGSPq@Naxۗ6^}q|GQ)9&hp oo܈ cI-K@I9zMD1R9|8)ŧ70wZgAԓ;vߙaD77KHY_~ߏ .@F~򘺧BoK ?zQ_:))zKד, Q;lNBzY_{<͌ DۈVUIHK־|?!=AŜ956JG!kд:^ַ y,!"1/(!-8а?DNb$V_J {yʗ?4c7mk%E7mB}I Td+њ^}5^-,e IDAT^G~iq(駑hoaO;wHGqBK wu.)!"] \|Qyd0k4MxSc M .$=Oɟ ơSc8ێ#?@: 9 }['09&ޢ9'Jp4=EEedd">$@) a ,)Nhz4;pUJ_q@r1BÞGҼ|9"۶I0LFșixYěcGGJDя,*;z6[:m@Xm-_vɓQ\,׊N>VJQ9oyG: g+ M ;q'>8hT: v χGh$㨜?o-gΎ[tmÌjsEŸֵ3DFq1r'Mgl Rh=G՝w}TxH:)'rD6GEuRo'zkGrY<oУQ=t N~cӥcѺftV'+|reCZ >Z:a{.BÇKpD e5gE=(`tgTrhUNCKJ3nt 331K˓˗K'!k= M,;Ewr]Gս")pN^ם(BoH$Pp!zJ: Yf='{Z C6e! ~t Sd?t WTskn=M &C)+C)((a~3cJʕV$::9t'VPaѻfxU Ŀ v_ }62G*6kkhB{^:ĞXShZ-yNҥK a:_0;"[k)+BƉF:DoX~[M1L㥛2QzŶib(GQq'YWhZ,{#T-X$luaB{텼ac1ӥcN܂UPz*0-~' }qD++c'?qֿ(9Gۑ{/Suд-!z@bfYNhzU9SJ3WB>Hp]Gݒ%Yȵ3 ak$Nx%$Qu}KG1/ed⋑ѿtWjR s,[M.//w~$]yNYc"gD2C_0(ŕ֭CI: YxލopwEʕ1LUHGѣ13cV(5 bs@w!$ěQ1L3~'EᇣccVefB]!R!Whڻ W77K0U3`adD[*AݓOzmCaaw#}ו8-+Wwc*wd-Ö|J/QK(f:4ͱ9@]աᇥcC{((K./j6`UW!qt#9Xc=Ew .TyӦ!sp9b}t ׋cu׹ XM "@pKǠT/\/a.E"1=}by!T}7 ^\]M{1o^xgz(BCHp?ș0A:'^Q[t48ۣHXh_uO+e U-t C1,c5ft ?ޡ`xSo /(-~Ma$INײb-a(>TG?BK=Gcoid/AK0= MOXrƍ^k}6O3BKw/GoKGqtjڞh^uT~;hT:% <Ip-_ =BCJGxs3*Uw݅xkt'34mt3طH:oG3&oהѿ?vt `Qa&la(^Ѷn,a@^1<)9",ЀٳQ}HttHDZ"l/@>pt /lۆ1; 8t cxVG̙1?mm!}vd`(ESKms|G}N>n!{ODڨ^(/KU!f@]P0xFSmimGs(>@fl "eS?N"Q rra @cNǛhfKy9wIOg-r 8 Q$yiv?oP $亯 T:3f"G}-*ﻏHC.g&lGV>큕!׭s 'QOmmeʕ}D=e;$bqHm@wvUKC%"*]1xTvQx18ϜI +EXZp!:QĎ([wτ\7b9OB1Ӏ \̿33|;("4؁`UU] nZ31Wˁ@L7a㏳gN@n oHQDun h.ArBpWu*c5x'ƤVWSq]4|Q,.% 03fh}$HCKR>-K)7id0f&D#z;(_{c+dR$VS楗?%!f[rݨo @8,j r*(`0q*(GDiv= l;=!׽w}MOQ1oH JJ7vI!Þի$\_p0xpEYb-{PvƏ׎}")سfV H:޲-9e|`Suؘ/E$EhܼKrYq4Ph;e ::~&亭;I_`ob\;U_ۯCIXc JH:yvމÀ8 `%o?C}`k4\W&3^8|~7亟ڍԉ1_n;M8N6/A G+[ԛAhIYx OAOֳLYN#") \`;ؗT  SE&`ۯSrq~2f88rI-BG $  u| 6` _!M Z B#p5vI.V @g!"x;XLYM49 IDo`9ɒ2p0x:ޭG"x%w}wq'-p9 H5>g;$p0x ޫxJ[#5c&wlGx1vI~I1@[-p%[/C, 0yvI*~e@Hq98~K1#Qvy=qlԤ cm;JJP3o;QD|oa;94c& "q#I@ǘoE$7oEҜ 1g?ӈzvm# c̗yӈr`1 ǩ{IDATFE@1Cw<(]^<B@bØ<`&]ӈ$g_8" eL LF$)4+;pMÈtP1f o,I-xKq-g*W[N#O*{=T$W3ФAI;o0"ݡ v| L2:Q> aDzJ@3x`piD% <<쳜GT$Uʀ$(8t Ke@Ѡ/iO@Rʀğ}I=^@P"&` }Im L $) zǩG Idcihyx^cw͖$I_ J@ p@ QZA'T?N&<ȴIbxx o8NH"O@˘8@; Fn$ԣ Cp ^!wd f,6轆lI$=1Xj>qʬIc*"qe/㕂c,ɒ]=(@6HbĒwX`xkDϏ%'6 [گu| Si)@@$bAEXɹ_>̵oSDzH@$aQ< tY@sc^DDS!m*""C*"""> ""C*"""> ""C*"""> ""C*"""> ""CNp+IENDB`target-ethos/tools/tools.cpp000664 001750 001750 00000001172 12651764221 017323 0ustar00sergiosergio000000 000000 #include "../ethos.hpp" #include "cheat-database.cpp" #include "cheat-editor.cpp" #include "state-manager.cpp" Tools* tools = nullptr; ToolsLayout::ToolsLayout() { setMargin(5); } Tools::Tools() { setGeometry({128, 128, 640, 360}); windowManager->append(this, "Tools"); setTitle("Tools"); layout.setMargin(5); panels.append("Cheat Editor", {resource::cheatEditor, sizeof resource::cheatEditor}); panels.append("State Manager", {resource::stateManager, sizeof resource::stateManager}); panels.setLayout(0, *cheatEditor); panels.setLayout(1, *stateManager); append(layout); layout.append(panels, {~0, ~0}); } sfc/alt/ppu-performance/serialization.cpp000664 001750 001750 00000012404 12651764221 021730 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP void PPUcounter::serialize(serializer& s) { s.integer(status.interlace); s.integer(status.field); s.integer(status.vcounter); s.integer(status.hcounter); s.array(history.field); s.array(history.vcounter); s.array(history.hcounter); s.integer(history.index); } void PPU::serialize(serializer& s) { Thread::serialize(s); PPUcounter::serialize(s); s.array(vram); s.array(oam); s.array(cgram); cache.serialize(s); bg1.serialize(s); bg2.serialize(s); bg3.serialize(s); bg4.serialize(s); sprite.serialize(s); screen.serialize(s); s.integer(display.interlace); s.integer(display.overscan); s.integer(display.width); s.integer(display.height); s.integer(regs.ppu1_mdr); s.integer(regs.ppu2_mdr); s.integer(regs.vram_readbuffer); s.integer(regs.oam_latchdata); s.integer(regs.cgram_latchdata); s.integer(regs.bgofs_latchdata); s.integer(regs.mode7_latchdata); s.integer(regs.counters_latched); s.integer(regs.latch_hcounter); s.integer(regs.latch_vcounter); s.integer(regs.display_disable); s.integer(regs.display_brightness); s.integer(regs.oam_baseaddr); s.integer(regs.oam_addr); s.integer(regs.oam_priority); s.integer(regs.bg3_priority); s.integer(regs.bgmode); s.integer(regs.mode7_hoffset); s.integer(regs.mode7_voffset); s.integer(regs.vram_incmode); s.integer(regs.vram_mapping); s.integer(regs.vram_incsize); s.integer(regs.vram_addr); s.integer(regs.mode7_repeat); s.integer(regs.mode7_vflip); s.integer(regs.mode7_hflip); s.integer(regs.m7a); s.integer(regs.m7b); s.integer(regs.m7c); s.integer(regs.m7d); s.integer(regs.m7x); s.integer(regs.m7y); s.integer(regs.cgram_addr); s.integer(regs.window_one_left); s.integer(regs.window_one_right); s.integer(regs.window_two_left); s.integer(regs.window_two_right); s.integer(regs.mode7_extbg); s.integer(regs.pseudo_hires); s.integer(regs.overscan); s.integer(regs.interlace); s.integer(regs.hcounter); s.integer(regs.vcounter); } void PPU::Cache::serialize(serializer& s) { //rather than save ~512KB worth of cached tiledata, invalidate it all for(unsigned i = 0; i < 4096; i++) tilevalid[0][i] = false; for(unsigned i = 0; i < 2048; i++) tilevalid[1][i] = false; for(unsigned i = 0; i < 1024; i++) tilevalid[2][i] = false; } void PPU::Background::serialize(serializer &s) { s.integer(regs.mode); s.integer(regs.priority0); s.integer(regs.priority1); s.integer(regs.tile_size); s.integer(regs.mosaic); s.integer(regs.screen_addr); s.integer(regs.screen_size); s.integer(regs.tiledata_addr); s.integer(regs.hoffset); s.integer(regs.voffset); s.integer(regs.main_enable); s.integer(regs.sub_enable); s.integer(hires); s.integer(width); s.integer(tile_width); s.integer(tile_height); s.integer(mask_x); s.integer(mask_y); s.integer(scx); s.integer(scy); s.integer(hscroll); s.integer(vscroll); s.integer(mosaic_vcounter); s.integer(mosaic_voffset); window.serialize(s); } void PPU::Sprite::serialize(serializer& s) { s.integer(regs.priority0); s.integer(regs.priority1); s.integer(regs.priority2); s.integer(regs.priority3); s.integer(regs.base_size); s.integer(regs.nameselect); s.integer(regs.tiledata_addr); s.integer(regs.first_sprite); s.integer(regs.main_enable); s.integer(regs.sub_enable); s.integer(regs.interlace); s.integer(regs.time_over); s.integer(regs.range_over); for(unsigned i = 0; i < 128; i++) { s.integer(list[i].width); s.integer(list[i].height); s.integer(list[i].x); s.integer(list[i].y); s.integer(list[i].character); s.integer(list[i].use_nameselect); s.integer(list[i].vflip); s.integer(list[i].hflip); s.integer(list[i].palette); s.integer(list[i].priority); s.integer(list[i].size); } s.integer(list_valid); s.array(itemlist); for(unsigned i = 0; i < 34; i++) { s.integer(tilelist[i].x); s.integer(tilelist[i].y); s.integer(tilelist[i].priority); s.integer(tilelist[i].palette); s.integer(tilelist[i].tile); s.integer(tilelist[i].hflip); } s.array(output.palette); s.array(output.priority); window.serialize(s); } void PPU::Screen::serialize(serializer& s) { s.integer(regs.addsub_mode); s.integer(regs.direct_color); s.integer(regs.color_mode); s.integer(regs.color_halve); s.array(regs.color_enable); s.integer(regs.color_b); s.integer(regs.color_g); s.integer(regs.color_r); s.integer(regs.color); for(unsigned i = 0; i < 256; i++) { s.integer(output.main[i].color); s.integer(output.main[i].priority); s.integer(output.main[i].source); s.integer(output.sub[i].color); s.integer(output.sub[i].priority); s.integer(output.sub[i].source); } window.serialize(s); } void PPU::LayerWindow::serialize(serializer& s) { s.integer(one_enable); s.integer(one_invert); s.integer(two_enable); s.integer(two_invert); s.integer(mask); s.integer(main_enable); s.integer(sub_enable); s.array(main); s.array(sub); } void PPU::ColorWindow::serialize(serializer& s) { s.integer(one_enable); s.integer(one_invert); s.integer(two_enable); s.integer(two_invert); s.integer(mask); s.integer(main_mask); s.integer(sub_mask); s.array(main); s.array(sub); } #endif ruby/video/000700 001750 001750 00000000000 12656700342 013762 5ustar00sergiosergio000000 000000 phoenix/windows/action/separator.cpp000664 001750 001750 00000000216 12651764221 021034 0ustar00sergiosergio000000 000000 namespace phoenix { void pSeparator::constructor() { } void pSeparator::destructor() { if(parentMenu) parentMenu->remove(separator); } } phoenix/core/core.hpp000664 001750 001750 00000050516 12651764221 015762 0ustar00sergiosergio000000 000000 #include #include #include #include #include #include #include #include #include #include #include namespace phoenix { struct Application; struct Font; struct Window; struct Menu; struct Sizable; struct Layout; struct Widget; struct pApplication; struct pFont; struct pObject; struct pTimer; struct pWindow; struct pAction; struct pMenu; struct pSeparator; struct pItem; struct pCheckItem; struct pRadioItem; struct pSizable; struct pLayout; struct pWidget; struct pButton; struct pCanvas; struct pCheckButton; struct pCheckLabel; struct pComboButton; struct pConsole; struct pFrame; struct pHexEdit; struct pHorizontalScroller; struct pHorizontalSlider; struct pLabel; struct pLineEdit; struct pListView; struct pProgressBar; struct pRadioButton; struct pRadioLabel; struct pTabFrame; struct pTextEdit; struct pVerticalScroller; struct pVerticalSlider; struct pViewport; struct Application { static nall::function main; static void run(); static bool pendingEvents(); static void processEvents(); static void quit(); static void setName(const nall::string& name); Application() = delete; struct State; static void initialize(); struct Windows { static nall::function onModalBegin; static nall::function onModalEnd; }; struct Cocoa { static nall::function onAbout; static nall::function onActivate; static nall::function onPreferences; static nall::function onQuit; }; }; struct Color { uint8_t red, green, blue, alpha; uint32_t rgb() const; uint32_t argb() const; inline Color() : alpha(255), red(0), green(0), blue(0) {} inline Color(uint8_t red, uint8_t green, uint8_t blue) : alpha(255), red(red), green(green), blue(blue) {} inline Color(uint8_t alpha, uint8_t red, uint8_t green, uint8_t blue) : alpha(alpha), red(red), green(green), blue(blue) {} }; struct Position { signed x, y; inline Position() : x(0), y(0) {} template inline Position(X x, Y y) : x(x), y(y) {} }; struct Size { static const unsigned Maximum = ~0u; static const unsigned Minimum = 0u; unsigned width, height; inline Size() : width(0), height(0) {} template inline Size(W width, H height) : width(width), height(height) {} }; struct Geometry { signed x, y; unsigned width, height; Position position() const; Size size() const; nall::string text() const; inline Geometry() : x(0), y(0), width(0), height(0) {} inline Geometry(Position position, Size size) : x(position.x), y(position.y), width(size.width), height(size.height) {} template inline Geometry(X x, Y y, W width, H height) : x(x), y(y), width(width), height(height) {} Geometry(const nall::string& text); }; enum class Orientation : unsigned { Horizontal, Vertical }; struct Font { static nall::string serif(unsigned size = 0, const nall::string& style = ""); static nall::string sans(unsigned size = 0, const nall::string& style = ""); static nall::string monospace(unsigned size = 0, const nall::string& style = ""); static Size size(const nall::string& font, const nall::string& text); Font() = delete; }; struct Desktop { static Size size(); static Geometry workspace(); Desktop() = delete; }; struct Monitor { static unsigned count(); static Geometry geometry(unsigned monitor); static unsigned primary(); }; struct Keyboard { #include "keyboard.hpp" static bool pressed(Scancode scancode); static bool released(Scancode scancode); static nall::vector state(); Keyboard() = delete; }; struct Mouse { enum class Button : unsigned { Left, Middle, Right }; static Position position(); static bool pressed(Button); static bool released(Button); Mouse() = delete; }; struct BrowserWindow { nall::string directory(); nall::string open(); nall::string save(); BrowserWindow& setFilters(const nall::lstring& filters); BrowserWindow& setParent(Window& parent); BrowserWindow& setPath(const nall::string& path); BrowserWindow& setTitle(const nall::string& title); BrowserWindow(); ~BrowserWindow(); struct State; State& state; }; struct MessageWindow { enum class Buttons : unsigned { Ok, OkCancel, YesNo, YesNoCancel, }; enum class Response : unsigned { Ok, Cancel, Yes, No, }; Response error(Buttons = Buttons::Ok); Response information(Buttons = Buttons::Ok); Response question(Buttons = Buttons::YesNo); MessageWindow& setParent(Window& parent); MessageWindow& setText(const nall::string& text); MessageWindow& setTitle(const nall::string& title); Response warning(Buttons = Buttons::Ok); MessageWindow(const nall::string& text = ""); ~MessageWindow(); struct State; State& state; }; struct Object { Object(pObject& p); Object& operator=(const Object&) = delete; Object(const Object&) = delete; virtual ~Object(); pObject& p; }; struct Timer : private nall::base_from_member, Object { nall::function onActivate; bool enabled() const; unsigned interval() const; void setEnabled(bool enabled = true); void setInterval(unsigned interval); //in milliseconds Timer(); ~Timer(); struct State; State& state; pTimer& p; }; struct Window : private nall::base_from_member, Object { nall::function onClose; nall::function onDrop; nall::function onKeyPress; nall::function onKeyRelease; nall::function onMove; nall::function onSize; void append(Layout& layout); void append(Menu& menu); void append(Widget& widget); Color backgroundColor() const; bool droppable() const; Geometry frameGeometry(); Geometry frameMargin(); bool focused(); bool fullScreen() const; Geometry geometry(); nall::string menuFont() const; bool menuVisible() const; bool modal() const; void remove(Layout& layout); void remove(Menu& menu); void remove(Widget& widget); bool resizable() const; void setBackgroundColor(Color color); void setDroppable(bool droppable = true); void setFrameGeometry(Geometry geometry); void setFocused(); void setFullScreen(bool fullScreen = true); void setGeometry(Geometry geometry); void setMenuFont(const nall::string& font); void setMenuVisible(bool visible = true); void setModal(bool modal = true); void setResizable(bool resizable = true); void setStatusFont(const nall::string& font); void setStatusText(const nall::string& text); void setStatusVisible(bool visible = true); void setTitle(const nall::string& text); void setVisible(bool visible = true); void setWidgetFont(const nall::string& font); void setWindowGeometry(Geometry geometry); nall::string statusFont() const; nall::string statusText() const; bool statusVisible() const; void synchronizeLayout(); nall::string title() const; bool visible() const; nall::string widgetFont() const; Window(); ~Window(); struct State; State& state; pWindow& p; }; struct Action : Object { bool enabled() const; void setEnabled(bool enabled = true); void setVisible(bool visible = true); bool visible() const; Action(pAction& p); ~Action(); struct State; State& state; pAction& p; }; struct Menu : private nall::base_from_member, Action { void append(const nall::group& list); nall::image image() const; void remove(const nall::group& list); void setImage(const nall::image& image = nall::image{}); void setText(const nall::string& text); nall::string text() const; Menu(); ~Menu(); struct State; State& state; pMenu& p; }; struct Separator : private nall::base_from_member, Action { Separator(); ~Separator(); pSeparator& p; }; struct Item : private nall::base_from_member, Action { nall::function onActivate; nall::image image() const; void setImage(const nall::image& image = nall::image{}); void setText(const nall::string& text); nall::string text() const; Item(); ~Item(); struct State; State& state; pItem& p; }; struct CheckItem : private nall::base_from_member, Action { nall::function onToggle; bool checked() const; void setChecked(bool checked = true); void setText(const nall::string& text); nall::string text() const; CheckItem(); ~CheckItem(); struct State; State& state; pCheckItem& p; }; struct RadioItem : private nall::base_from_member, Action { template static void group(Args&&... args) { group({std::forward(args)...}); } static void group(const nall::group& list); nall::function onActivate; bool checked() const; void setChecked(); void setText(const nall::string& text); nall::string text() const; RadioItem(); ~RadioItem(); struct State; State& state; pRadioItem& p; }; struct Sizable : Object { bool enabled() const; bool enabledToAll() const; Layout* layout() const; virtual Size minimumSize() = 0; Sizable* parent() const; virtual void setEnabled(bool enabled = true) = 0; virtual void setGeometry(Geometry geometry) = 0; virtual void setVisible(bool visible = true) = 0; virtual void synchronizeLayout() = 0; bool visible() const; bool visibleToAll() const; Window* window() const; Sizable(pSizable& p); ~Sizable(); struct State; State& state; pSizable& p; }; struct Layout : private nall::base_from_member, Sizable { virtual void append(Sizable& sizable); virtual void remove(Sizable& sizable); virtual void reset(); Layout(); Layout(pLayout& p); ~Layout(); struct State; State& state; pLayout& p; }; struct Widget : private nall::base_from_member, Sizable { nall::function onSize; bool focused(); nall::string font() const; Geometry geometry() const; Size minimumSize(); void setEnabled(bool enabled = true); void setFocused(); void setFont(const nall::string& font); void setGeometry(Geometry geometry); void setVisible(bool visible = true); void synchronizeLayout(); Widget(); Widget(pWidget& p); ~Widget(); struct State; State& state; pWidget& p; }; struct Button : private nall::base_from_member, Widget { nall::function onActivate; nall::image image() const; Orientation orientation() const; void setImage(const nall::image& image = nall::image{}, Orientation orientation = Orientation::Horizontal); void setText(const nall::string& text); nall::string text() const; Button(); ~Button(); struct State; State& state; pButton& p; }; struct Canvas : private nall::base_from_member, Widget { enum class Mode : unsigned { Color, Gradient, Image, Data }; nall::function onDrop; nall::function onMouseLeave; nall::function onMouseMove; nall::function onMousePress; nall::function onMouseRelease; Color color() const; uint32_t* data() const; bool droppable() const; nall::vector gradient() const; nall::image image() const; Mode mode() const; void setColor(Color color); void setData(); void setDroppable(bool droppable = true); void setHorizontalGradient(Color left, Color right); void setGradient(Color topLeft, Color topRight, Color bottomLeft, Color bottomRight); void setImage(const nall::image& image); void setMode(Mode mode); void setSize(Size size); void setVerticalGradient(Color top, Color bottom); Size size() const; Canvas(); ~Canvas(); struct State; State& state; pCanvas& p; }; struct CheckButton : private nall::base_from_member, Widget { nall::function onToggle; bool checked() const; nall::image image() const; void setChecked(bool checked = true); void setImage(const nall::image& image = nall::image{}, Orientation orientation = Orientation::Horizontal); void setText(const nall::string& text); nall::string text() const; CheckButton(); ~CheckButton(); struct State; State& state; pCheckButton& p; }; struct CheckLabel : private nall::base_from_member, Widget { nall::function onToggle; bool checked() const; void setChecked(bool checked = true); void setText(const nall::string& text); nall::string text() const; CheckLabel(); ~CheckLabel(); struct State; State& state; pCheckLabel& p; }; struct ComboButton : private nall::base_from_member, Widget { nall::function onChange; void append(const nall::string& text = ""); void remove(unsigned selection); void reset(); unsigned rows() const; unsigned selection() const; void setSelection(unsigned selection); void setText(unsigned selection, const nall::string& text); nall::string text() const; nall::string text(unsigned selection) const; ComboButton(); ~ComboButton(); struct State; State& state; pComboButton& p; }; struct Console : private nall::base_from_member, Widget { nall::function onActivate; template void print(Args&&... args) { print({args...}); } void print(const nall::string& text); void reset(); Console(); ~Console(); struct State; State& state; pConsole& p; }; struct Frame : private nall::base_from_member, Widget { void setLayout(Layout& layout); void setText(const nall::string& text); void synchronizeLayout(); nall::string text() const; Frame(); ~Frame(); struct State; State& state; pFrame& p; }; struct HexEdit : private nall::base_from_member, Widget { nall::function onRead; nall::function onWrite; unsigned columns() const; unsigned length() const; unsigned offset() const; unsigned rows() const; void setColumns(unsigned columns); void setLength(unsigned length); void setOffset(unsigned offset); void setRows(unsigned rows); void update(); HexEdit(); ~HexEdit(); struct State; State& state; pHexEdit& p; }; struct HorizontalScroller : private nall::base_from_member, Widget { nall::function onChange; unsigned length() const; unsigned position() const; void setLength(unsigned length); void setPosition(unsigned position); HorizontalScroller(); ~HorizontalScroller(); struct State; State& state; pHorizontalScroller& p; }; struct HorizontalSlider : private nall::base_from_member, Widget { nall::function onChange; unsigned length() const; unsigned position() const; void setLength(unsigned length); void setPosition(unsigned position); HorizontalSlider(); ~HorizontalSlider(); struct State; State& state; pHorizontalSlider& p; }; struct Label : private nall::base_from_member, Widget { void setText(const nall::string& text); nall::string text() const; Label(); ~Label(); struct State; State& state; pLabel& p; }; struct LineEdit : private nall::base_from_member, Widget { nall::function onActivate; nall::function onChange; bool editable() const; void setEditable(bool editable = true); void setText(const nall::string& text); nall::string text(); LineEdit(); ~LineEdit(); struct State; State& state; pLineEdit& p; }; struct ListView : private nall::base_from_member, Widget { nall::function onActivate; nall::function onChange; nall::function onToggle; void append(const nall::lstring& text); void autoSizeColumns(); bool checkable() const; bool checked(unsigned selection) const; unsigned columns() const; bool headerVisible() const; nall::image image(unsigned selection, unsigned position) const; void remove(unsigned selection); void reset(); unsigned rows() const; bool selected() const; unsigned selection() const; void setCheckable(bool checkable = true); void setChecked(unsigned selection, bool checked = true); void setHeaderText(const nall::lstring& text); void setHeaderVisible(bool visible = true); void setImage(unsigned selection, unsigned position, const nall::image& image = nall::image{}); void setSelected(bool selected = true); void setSelection(unsigned selection); void setText(unsigned selection, const nall::lstring& text); void setText(unsigned selection, unsigned position, const nall::string& text); nall::string text(unsigned selection, unsigned position) const; ListView(); ~ListView(); struct State; State& state; pListView& p; }; struct ProgressBar : private nall::base_from_member, Widget { unsigned position() const; void setPosition(unsigned position); ProgressBar(); ~ProgressBar(); struct State; State& state; pProgressBar& p; }; struct RadioButton : private nall::base_from_member, Widget { template static void group(Args&&... args) { group({std::forward(args)...}); } static void group(const nall::group& list); nall::function onActivate; bool checked() const; nall::image image() const; void setChecked(); void setImage(const nall::image& image = nall::image{}, Orientation orientation = Orientation::Horizontal); void setText(const nall::string& text); nall::string text() const; RadioButton(); ~RadioButton(); struct State; State& state; pRadioButton& p; }; struct RadioLabel : private nall::base_from_member, Widget { template static void group(Args&&... args) { group({std::forward(args)...}); } static void group(const nall::group& list); nall::function onActivate; bool checked() const; void setChecked(); void setText(const nall::string& text); nall::string text() const; RadioLabel(); ~RadioLabel(); struct State; State& state; pRadioLabel& p; }; struct TabFrame : private nall::base_from_member, Widget { nall::function onChange; void append(const nall::string& text = "", const nall::image& image = nall::image{}); nall::image image(unsigned selection) const; void remove(unsigned selection); unsigned selection() const; void setImage(unsigned selection, const nall::image& image = nall::image{}); void setLayout(unsigned selection, Layout& layout); void setSelection(unsigned selection); void setText(unsigned selection, const nall::string& text); void synchronizeLayout(); unsigned tabs() const; nall::string text(unsigned selection) const; TabFrame(); ~TabFrame(); struct State; State& state; pTabFrame& p; }; struct TextEdit : private nall::base_from_member, Widget { nall::function onChange; bool editable() const; void setCursorPosition(unsigned position); void setEditable(bool editable = true); void setText(const nall::string& text); void setWordWrap(bool wordWrap = true); nall::string text(); bool wordWrap() const; TextEdit(); ~TextEdit(); struct State; State& state; pTextEdit& p; }; struct VerticalScroller : private nall::base_from_member, Widget { nall::function onChange; unsigned length() const; unsigned position() const; void setLength(unsigned length); void setPosition(unsigned position); VerticalScroller(); ~VerticalScroller(); struct State; State& state; pVerticalScroller& p; }; struct VerticalSlider : private nall::base_from_member, Widget { nall::function onChange; unsigned length() const; unsigned position() const; void setLength(unsigned length); void setPosition(unsigned position); VerticalSlider(); ~VerticalSlider(); struct State; State& state; pVerticalSlider& p; }; struct Viewport : private nall::base_from_member, Widget { nall::function onDrop; nall::function onMouseLeave; nall::function onMouseMove; nall::function onMousePress; nall::function onMouseRelease; bool droppable() const; uintptr_t handle(); void setDroppable(bool droppable = true); Viewport(); ~Viewport(); struct State; State& state; pViewport& p; }; #include "layout/fixed-layout.hpp" #include "layout/horizontal-layout.hpp" #include "layout/vertical-layout.hpp" } nall/dsp/resample/cubic.hpp000664 001750 001750 00000001735 12651764221 017040 0ustar00sergiosergio000000 000000 #ifdef NALL_DSP_INTERNAL_HPP struct ResampleCubic : Resampler { inline void setFrequency(); inline void clear(); inline void sample(); ResampleCubic(DSP& dsp) : Resampler(dsp) {} real fraction; real step; }; void ResampleCubic::setFrequency() { fraction = 0.0; step = dsp.settings.frequency / frequency; } void ResampleCubic::clear() { fraction = 0.0; } void ResampleCubic::sample() { while(fraction <= 1.0) { real channel[dsp.settings.channels]; for(unsigned n = 0; n < dsp.settings.channels; n++) { real a = dsp.buffer.read(n, -3); real b = dsp.buffer.read(n, -2); real c = dsp.buffer.read(n, -1); real d = dsp.buffer.read(n, -0); real mu = fraction; real A = d - c - a + b; real B = a - b - A; real C = c - a; real D = b; channel[n] = A * (mu * 3) + B * (mu * 2) + C * mu + D; } dsp.write(channel); fraction += step; } dsp.buffer.rdoffset++; fraction -= 1.0; } #endif phoenix/windows/message-window.cpp000664 001750 001750 00000004537 12651764221 020522 0ustar00sergiosergio000000 000000 namespace phoenix { static MessageWindow::Response MessageWindow_response(MessageWindow::Buttons buttons, UINT response) { if(response == IDOK) return MessageWindow::Response::Ok; if(response == IDCANCEL) return MessageWindow::Response::Cancel; if(response == IDYES) return MessageWindow::Response::Yes; if(response == IDNO) return MessageWindow::Response::No; //default responses if window was closed without a button selected if(buttons == MessageWindow::Buttons::Ok) return MessageWindow::Response::Ok; if(buttons == MessageWindow::Buttons::OkCancel) return MessageWindow::Response::Cancel; if(buttons == MessageWindow::Buttons::YesNo) return MessageWindow::Response::No; if(buttons == MessageWindow::Buttons::YesNoCancel) return MessageWindow::Response::Cancel; throw; } static UINT MessageWindow_buttons(MessageWindow::Buttons buttons) { if(buttons == MessageWindow::Buttons::Ok) return MB_OK; if(buttons == MessageWindow::Buttons::OkCancel) return MB_OKCANCEL; if(buttons == MessageWindow::Buttons::YesNo) return MB_YESNO; if(buttons == MessageWindow::Buttons::YesNoCancel) return MB_YESNOCANCEL; throw; } MessageWindow::Response pMessageWindow::error(MessageWindow::State& state) { UINT flags = MB_ICONERROR | MessageWindow_buttons(state.buttons); return MessageWindow_response(state.buttons, MessageBox( state.parent ? state.parent->p.hwnd : 0, utf16_t(state.text), utf16_t(state.title), flags )); } MessageWindow::Response pMessageWindow::information(MessageWindow::State& state) { UINT flags = MB_ICONINFORMATION | MessageWindow_buttons(state.buttons); return MessageWindow_response(state.buttons, MessageBox( state.parent ? state.parent->p.hwnd : 0, utf16_t(state.text), utf16_t(state.title), flags )); } MessageWindow::Response pMessageWindow::question(MessageWindow::State& state) { UINT flags = MB_ICONQUESTION | MessageWindow_buttons(state.buttons); return MessageWindow_response(state.buttons, MessageBox( state.parent ? state.parent->p.hwnd : 0, utf16_t(state.text), utf16_t(state.title), flags )); } MessageWindow::Response pMessageWindow::warning(MessageWindow::State& state) { UINT flags = MB_ICONWARNING | MessageWindow_buttons(state.buttons); return MessageWindow_response(state.buttons, MessageBox( state.parent ? state.parent->p.hwnd : 0, utf16_t(state.text), utf16_t(state.title), flags )); } } target-ethos/configuration/configuration.hpp000664 001750 001750 00000002361 12651764221 022547 0ustar00sergiosergio000000 000000 struct ConfigurationSettings : Configuration::Document { struct Video : Configuration::Node { string driver; bool synchronize; string shader; unsigned scaleMode; bool aspectCorrection; bool colorEmulation; struct MaskOverscan : Configuration::Node { bool enable; unsigned horizontal; unsigned vertical; } maskOverscan; unsigned saturation; unsigned gamma; unsigned luminance; bool startFullScreen; } video; struct Audio : Configuration::Node { string driver; bool synchronize; unsigned frequency; unsigned latency; unsigned resampler; unsigned volume; bool mute; } audio; struct Input : Configuration::Node { string driver; struct Focus : Configuration::Node { bool pause; bool allow; } focus; } input; struct Timing : Configuration::Node { double video; double audio; } timing; struct Server : Configuration::Node { string hostname; string username; string password; } server; struct Library : Configuration::Node { signed selection; unsigned mediaMode; bool showOnStartup; } library; void load(); void save(); ConfigurationSettings(); }; extern ConfigurationSettings* config; phoenix/qt/widget/frame.cpp000664 001750 001750 00000003031 12651764221 017064 0ustar00sergiosergio000000 000000 namespace phoenix { void pFrame::setEnabled(bool enabled) { if(frame.state.layout) frame.state.layout->setEnabled(frame.state.layout->enabled()); pWidget::setEnabled(enabled); } void pFrame::setGeometry(Geometry geometry) { pWidget::setGeometry(geometry); if(frame.state.layout == nullptr) return; Size size = pFont::size(widget.state.font, frame.state.text); if(frame.state.text.empty()) size.height = 8; geometry.x += 1, geometry.width -= 2; geometry.y += size.height, geometry.height -= size.height + 1; frame.state.layout->setGeometry(geometry); } void pFrame::setText(string text) { qtFrame->setTitle(QString::fromUtf8(text)); } void pFrame::setVisible(bool visible) { if(frame.state.layout) frame.state.layout->setVisible(frame.state.layout->visible()); pWidget::setVisible(visible); } void pFrame::constructor() { qtWidget = qtFrame = new QGroupBox; if(QApplication::style()->objectName() == "gtk+") { //QGtkStyle (gtk+) theme disrespects font weight and omits the border, even if native GTK+ theme does not //bold Label controls already exist; so this style sheet forces QGtkStyle to look like a Frame instead qtFrame->setStyleSheet( "QGroupBox { border: 1px solid #aaa; border-radius: 5px; margin-top: 0.5em; }\n" "QGroupBox::title { left: 5px; subcontrol-origin: margin; }\n" ); } pWidget::synchronizeState(); setText(frame.state.text); } void pFrame::destructor() { delete qtFrame; qtWidget = qtFrame = nullptr; } void pFrame::orphan() { destructor(); constructor(); } } phoenix/reference/widget/label.hpp000664 001750 001750 00000000317 12651764221 020374 0ustar00sergiosergio000000 000000 namespace phoenix { struct pLabel : public pWidget { Label& label; void setText(string text); pLabel(Label& label) : pWidget(label), label(label) {} void constructor(); void destructor(); }; } ruby/audio/openal.cpp000664 001750 001750 00000012063 12651764221 015756 0ustar00sergiosergio000000 000000 /* audio.openal (2007-12-26) author: Nach contributors: byuu, wertigon, _willow_ */ #if defined(PLATFORM_MACOSX) #include #include #else #include #include #endif namespace ruby { class pAudioOpenAL { public: struct { ALCdevice* handle; ALCcontext* context; ALuint source; ALenum format; unsigned latency; unsigned queue_length; } device; struct { uint32_t* data; unsigned length; unsigned size; } buffer; struct { bool synchronize; unsigned frequency; unsigned latency; } settings; bool cap(const string& name) { if(name == Audio::Synchronize) return true; if(name == Audio::Frequency) return true; if(name == Audio::Latency) return true; return false; } any get(const string& name) { if(name == Audio::Synchronize) return settings.synchronize; if(name == Audio::Frequency) return settings.frequency; if(name == Audio::Latency) return settings.latency; return false; } bool set(const string& name, const any& value) { if(name == Audio::Synchronize) { settings.synchronize = any_cast(value); return true; } if(name == Audio::Frequency) { settings.frequency = any_cast(value); return true; } if(name == Audio::Latency) { if(settings.latency != any_cast(value)) { settings.latency = any_cast(value); update_latency(); } return true; } return false; } void sample(uint16_t sl, uint16_t sr) { buffer.data[buffer.length++] = sl + (sr << 16); if(buffer.length < buffer.size) return; ALuint albuffer = 0; int processed = 0; while(true) { alGetSourcei(device.source, AL_BUFFERS_PROCESSED, &processed); while(processed--) { alSourceUnqueueBuffers(device.source, 1, &albuffer); alDeleteBuffers(1, &albuffer); device.queue_length--; } //wait for buffer playback to catch up to sample generation if not synchronizing if(settings.synchronize == false || device.queue_length < 3) break; } if(device.queue_length < 3) { alGenBuffers(1, &albuffer); alBufferData(albuffer, device.format, buffer.data, buffer.size * 4, settings.frequency); alSourceQueueBuffers(device.source, 1, &albuffer); device.queue_length++; } ALint playing; alGetSourcei(device.source, AL_SOURCE_STATE, &playing); if(playing != AL_PLAYING) alSourcePlay(device.source); buffer.length = 0; } void clear() { } void update_latency() { if(buffer.data) delete[] buffer.data; buffer.size = settings.frequency * settings.latency / 1000.0 + 0.5; buffer.data = new uint32_t[buffer.size]; } bool init() { update_latency(); device.queue_length = 0; bool success = false; if(device.handle = alcOpenDevice(NULL)) { if(device.context = alcCreateContext(device.handle, NULL)) { alcMakeContextCurrent(device.context); alGenSources(1, &device.source); //alSourcef (device.source, AL_PITCH, 1.0); //alSourcef (device.source, AL_GAIN, 1.0); //alSource3f(device.source, AL_POSITION, 0.0, 0.0, 0.0); //alSource3f(device.source, AL_VELOCITY, 0.0, 0.0, 0.0); //alSource3f(device.source, AL_DIRECTION, 0.0, 0.0, 0.0); //alSourcef (device.source, AL_ROLLOFF_FACTOR, 0.0); //alSourcei (device.source, AL_SOURCE_RELATIVE, AL_TRUE); alListener3f(AL_POSITION, 0.0, 0.0, 0.0); alListener3f(AL_VELOCITY, 0.0, 0.0, 0.0); ALfloat listener_orientation[] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; alListenerfv(AL_ORIENTATION, listener_orientation); success = true; } } if(success == false) { term(); return false; } return true; } void term() { if(alIsSource(device.source) == AL_TRUE) { int playing = 0; alGetSourcei(device.source, AL_SOURCE_STATE, &playing); if(playing == AL_PLAYING) { alSourceStop(device.source); int queued = 0; alGetSourcei(device.source, AL_BUFFERS_QUEUED, &queued); while(queued--) { ALuint albuffer = 0; alSourceUnqueueBuffers(device.source, 1, &albuffer); alDeleteBuffers(1, &albuffer); device.queue_length--; } } alDeleteSources(1, &device.source); device.source = 0; } if(device.context) { alcMakeContextCurrent(NULL); alcDestroyContext(device.context); device.context = 0; } if(device.handle) { alcCloseDevice(device.handle); device.handle = 0; } if(buffer.data) { delete[] buffer.data; buffer.data = 0; } } pAudioOpenAL() { device.source = 0; device.handle = 0; device.context = 0; device.format = AL_FORMAT_STEREO16; device.queue_length = 0; buffer.data = 0; buffer.length = 0; buffer.size = 0; settings.synchronize = true; settings.frequency = 22050; settings.latency = 40; } ~pAudioOpenAL() { term(); } }; DeclareAudio(OpenAL) }; gba/ppu/000700 001750 001750 00000000000 12656700342 013230 5ustar00sergiosergio000000 000000 phoenix/windows/widget/text-edit.cpp000664 001750 001750 00000003370 12651764221 020755 0ustar00sergiosergio000000 000000 namespace phoenix { void pTextEdit::setCursorPosition(unsigned position) { if(position == ~0) position >>= 1; //Edit_SetSel takes signed type Edit_SetSel(hwnd, position, position); Edit_ScrollCaret(hwnd); } void pTextEdit::setEditable(bool editable) { SendMessage(hwnd, EM_SETREADONLY, editable == false, (LPARAM)0); } void pTextEdit::setText(string text) { locked = true; string output = text; output.replace("\r", ""); output.replace("\n", "\r\n"); SetWindowText(hwnd, utf16_t(output)); locked = false; } void pTextEdit::setWordWrap(bool wordWrap) { //ES_AUTOHSCROLL cannot be changed after widget creation. //As a result, we must destroy and re-create widget to change this setting. orphan(); } string pTextEdit::text() { unsigned length = GetWindowTextLength(hwnd); wchar_t buffer[length + 1]; GetWindowText(hwnd, buffer, length + 1); buffer[length] = 0; string text = (const char*)utf8_t(buffer); text.replace("\r", ""); return text; } void pTextEdit::constructor() { hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, L"EDIT", L"", WS_CHILD | WS_TABSTOP | WS_VSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_WANTRETURN | (textEdit.state.wordWrap == false ? WS_HSCROLL | ES_AUTOHSCROLL : 0), 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&textEdit); setDefaultFont(); setCursorPosition(textEdit.state.cursorPosition); setEditable(textEdit.state.editable); setText(textEdit.state.text); synchronize(); } void pTextEdit::destructor() { textEdit.state.text = text(); DestroyWindow(hwnd); } void pTextEdit::orphan() { destructor(); constructor(); } void pTextEdit::onChange() { if(locked) return; if(textEdit.onChange) textEdit.onChange(); } } nall/stream/http.hpp000664 001750 001750 00000002315 12651764221 015622 0ustar00sergiosergio000000 000000 #ifndef NALL_STREAM_HTTP_HPP #define NALL_STREAM_HTTP_HPP #include namespace nall { struct httpstream : stream { using stream::read; using stream::write; bool seekable() const { return true; } bool readable() const { return true; } bool writable() const { return true; } bool randomaccess() const { return true; } unsigned size() const { return psize; } unsigned offset() const { return poffset; } void seek(unsigned offset) const { poffset = offset; } uint8_t read() const { return pdata[poffset++]; } void write(uint8_t data) const { pdata[poffset++] = data; } uint8_t read(unsigned offset) const { return pdata[offset]; } void write(unsigned offset, uint8_t data) const { pdata[offset] = data; } httpstream(const string& url, unsigned port) : pdata(nullptr), psize(0), poffset(0) { string uri = url; uri.ltrim<1>("http://"); lstring part = uri.split<1>("/"); part[1] = { "/", part[1] }; http connection; if(connection.connect(part[0], port) == false) return; connection.download(part[1], pdata, psize); } ~httpstream() { if(pdata) delete[] pdata; } private: mutable uint8_t* pdata; mutable unsigned psize, poffset; }; } #endif gb/scheduler/scheduler.hpp000664 001750 001750 00000000614 12651764221 016746 0ustar00sergiosergio000000 000000 struct Scheduler : property { enum class SynchronizeMode : unsigned { None, CPU, All } sync; enum class ExitReason : unsigned { UnknownEvent, StepEvent, FrameEvent, SynchronizeEvent }; readonly exit_reason; cothread_t host_thread; cothread_t active_thread; void enter(); void exit(ExitReason); void init(); Scheduler(); }; extern Scheduler scheduler; fc/cartridge/board/nes-fxrom.cpp000664 001750 001750 00000004402 12651764221 017755 0ustar00sergiosergio000000 000000 //MMC4 struct NES_FxROM : Board { enum Revision : unsigned { FJROM, FKROM, } revision; uint4 prg_bank; uint5 chr_bank[2][2]; bool mirror; bool latch[2]; uint8 prg_read(unsigned addr) { if(addr < 0x6000) return cpu.mdr(); if(addr < 0x8000) return prgram.read(addr); unsigned bank = addr < 0xc000 ? prg_bank : (uint4)0x0f; return prgrom.read((bank * 0x4000) | (addr & 0x3fff)); } void prg_write(unsigned addr, uint8 data) { if(addr < 0x6000) return; if(addr < 0x8000) return prgram.write(addr, data); switch(addr & 0xf000) { case 0xa000: prg_bank = data & 0x0f; break; case 0xb000: chr_bank[0][0] = data & 0x1f; break; case 0xc000: chr_bank[0][1] = data & 0x1f; break; case 0xd000: chr_bank[1][0] = data & 0x1f; break; case 0xe000: chr_bank[1][1] = data & 0x1f; break; case 0xf000: mirror = data & 0x01; break; } } unsigned ciram_addr(unsigned addr) const { switch(mirror) { case 0: return ((addr & 0x0400) >> 0) | (addr & 0x03ff); //vertical mirroring case 1: return ((addr & 0x0800) >> 1) | (addr & 0x03ff); //horizontal mirroring } } uint8 chr_read(unsigned addr) { if(addr & 0x2000) return ppu.ciram_read(ciram_addr(addr)); bool region = addr & 0x1000; unsigned bank = chr_bank[region][latch[region]]; if((addr & 0x0ff8) == 0x0fd8) latch[region] = 0; if((addr & 0x0ff8) == 0x0fe8) latch[region] = 1; return Board::chr_read((bank * 0x1000) | (addr & 0x0fff)); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) return ppu.ciram_write(ciram_addr(addr), data); bool region = addr & 0x1000; unsigned bank = chr_bank[region][latch[region]]; if((addr & 0x0ff8) == 0x0fd8) latch[region] = 0; if((addr & 0x0ff8) == 0x0fe8) latch[region] = 1; return Board::chr_write((bank * 0x1000) | (addr & 0x0fff), data); } void power() { } void reset() { prg_bank = 0; chr_bank[0][0] = 0; chr_bank[0][1] = 0; chr_bank[1][0] = 0; chr_bank[1][1] = 0; mirror = 0; latch[0] = 0; latch[1] = 0; } void serialize(serializer& s) { Board::serialize(s); s.integer(prg_bank); s.integer(chr_bank[0][0]); s.integer(chr_bank[0][1]); s.integer(chr_bank[1][0]); s.integer(chr_bank[1][1]); s.integer(mirror); s.array(latch); } NES_FxROM(Markup::Node& document) : Board(document) { revision = Revision::FKROM; } }; gba/apu/noise.cpp000664 001750 001750 00000004056 12651764221 015054 0ustar00sergiosergio000000 000000 unsigned APU::Noise::divider() const { if(divisor == 0) return 4; return divisor * 8; } void APU::Noise::run() { if(period && --period == 0) { period = divider() << frequency; if(frequency < 14) { bool bit = (lfsr ^ (lfsr >> 1)) & 1; lfsr = (lfsr >> 1) ^ (bit << (narrowlfsr ? 6 : 14)); } } output = volume; if(enable == false || (lfsr & 1)) output = 0; } void APU::Noise::clocklength() { if(enable && counter) { if(++length == 0) enable = false; } } void APU::Noise::clockenvelope() { if(enable && envelope.frequency && --envelope.period == 0) { envelope.period = envelope.frequency; if(envelope.direction == 0 && volume > 0) volume--; if(envelope.direction == 1 && volume < 15) volume++; } } uint8 APU::Noise::read(unsigned addr) const { switch(addr) { case 1: return (length << 0); case 2: return (envelope.frequency << 0) | (envelope.direction << 3) | (envelope.volume << 4); case 3: return (divisor << 0) | (narrowlfsr << 3) | (frequency << 4); case 4: return (counter << 6) | (initialize << 7); } } void APU::Noise::write(unsigned addr, uint8 byte) { switch(addr) { case 1: //NR41 length = byte >> 0; break; case 2: //NR42 envelope.frequency = byte >> 0; envelope.direction = byte >> 3; envelope.volume = byte >> 4; if(envelope.dacenable() == false) enable = false; break; case 3: //NR43 divisor = byte >> 0; narrowlfsr = byte >> 3; frequency = byte >> 4; period = divider() << frequency; break; case 4: //NR44 counter = byte >> 6; initialize = byte >> 7; if(initialize) { enable = envelope.dacenable(); lfsr = ~0u; envelope.period = envelope.frequency; volume = envelope.volume; } break; } } void APU::Noise::power() { envelope.frequency = 0; envelope.direction = 0; envelope.volume = 0; envelope.period = 0; length = 0; divisor = 0; narrowlfsr = 0; frequency = 0; counter = 0; initialize = 0; enable = 0; lfsr = 0; output = 0; period = 0; volume = 0; } phoenix/reference/action/separator.cpp000664 001750 001750 00000000136 12651764221 021301 0ustar00sergiosergio000000 000000 namespace phoenix { void pSeparator::constructor() { } void pSeparator::destructor() { } } phoenix/reference/widget/widget.cpp000664 001750 001750 00000000666 12651764221 020602 0ustar00sergiosergio000000 000000 namespace phoenix { bool pWidget::enabled() { return false; } bool pWidget::focused() { return false; } Size pWidget::minimumSize() { return {0, 0}; } void pWidget::setEnabled(bool enabled) { } void pWidget::setFocused() { } void pWidget::setFont(string font) { } void pWidget::setGeometry(Geometry geometry) { } void pWidget::setVisible(bool visible) { } void pWidget::constructor() { } void pWidget::destructor() { } } nall/property.hpp000664 001750 001750 00000002301 12651764221 015227 0ustar00sergiosergio000000 000000 #ifndef NALL_PROPERTY_HPP #define NALL_PROPERTY_HPP namespace nall { template struct property { template struct readonly { const T* operator->() const { return &value; } const T& operator()() const { return value; } operator const T&() const { return value; } private: T* operator->() { return &value; } operator T&() { return value; } const T& operator=(const T& value_) { return value = value_; } T value; friend C; }; template struct writeonly { void operator=(const T& value_) { value = value_; } private: const T* operator->() const { return &value; } const T& operator()() const { return value; } operator const T&() const { return value; } T* operator->() { return &value; } operator T&() { return value; } T value; friend C; }; template struct readwrite { const T* operator->() const { return &value; } const T& operator()() const { return value; } operator const T&() const { return value; } T* operator->() { return &value; } operator T&() { return value; } const T& operator=(const T& value_) { return value = value_; } T value; }; }; } #endif phoenix/reference/mouse.cpp000664 001750 001750 00000000211 12651764221 017146 0ustar00sergiosergio000000 000000 namespace phoenix { Position pMouse::position() { return {0, 0}; } bool pMouse::pressed(Mouse::Button button) { return false; } } gb/apu/master/master.hpp000664 001750 001750 00000001067 12651764221 016370 0ustar00sergiosergio000000 000000 struct Master { bool left_in_enable; uint3 left_volume; bool right_in_enable; uint3 right_volume; bool channel4_left_enable; bool channel3_left_enable; bool channel2_left_enable; bool channel1_left_enable; bool channel4_right_enable; bool channel3_right_enable; bool channel2_right_enable; bool channel1_right_enable; bool enable; int16 center; int16 left; int16 right; int64 center_bias; int64 left_bias; int64 right_bias; void run(); void write(unsigned r, uint8 data); void power(); void serialize(serializer&); }; sfc/chip/superfx/mmio/mmio.cpp000664 001750 001750 00000003611 12651764221 017511 0ustar00sergiosergio000000 000000 #ifdef SUPERFX_CPP uint8 SuperFX::mmio_read(unsigned addr) { cpu.synchronize_coprocessors(); addr &= 0xffff; if(addr >= 0x3100 && addr <= 0x32ff) { return cache_mmio_read(addr - 0x3100); } if(addr >= 0x3000 && addr <= 0x301f) { return regs.r[(addr >> 1) & 15] >> ((addr & 1) << 3); } switch(addr) { case 0x3030: { return regs.sfr >> 0; } case 0x3031: { uint8 r = regs.sfr >> 8; regs.sfr.irq = 0; cpu.regs.irq = 0; return r; } case 0x3034: { return regs.pbr; } case 0x3036: { return regs.rombr; } case 0x303b: { return regs.vcr; } case 0x303c: { return regs.rambr; } case 0x303e: { return regs.cbr >> 0; } case 0x303f: { return regs.cbr >> 8; } } return 0x00; } void SuperFX::mmio_write(unsigned addr, uint8 data) { cpu.synchronize_coprocessors(); addr &= 0xffff; if(addr >= 0x3100 && addr <= 0x32ff) { return cache_mmio_write(addr - 0x3100, data); } if(addr >= 0x3000 && addr <= 0x301f) { unsigned n = (addr >> 1) & 15; if((addr & 1) == 0) { regs.r[n] = (regs.r[n] & 0xff00) | data; } else { regs.r[n] = (data << 8) | (regs.r[n] & 0xff); } if(addr == 0x301f) regs.sfr.g = 1; return; } switch(addr) { case 0x3030: { bool g = regs.sfr.g; regs.sfr = (regs.sfr & 0xff00) | (data << 0); if(g == 1 && regs.sfr.g == 0) { regs.cbr = 0x0000; cache_flush(); } } break; case 0x3031: { regs.sfr = (data << 8) | (regs.sfr & 0x00ff); } break; case 0x3033: { regs.bramr = data; } break; case 0x3034: { regs.pbr = data & 0x7f; cache_flush(); } break; case 0x3037: { regs.cfgr = data; update_speed(); } break; case 0x3038: { regs.scbr = data; } break; case 0x3039: { regs.clsr = data; update_speed(); } break; case 0x303a: { regs.scmr = data; } break; } } #endif phoenix/cocoa/platform.hpp000664 001750 001750 00000002502 12651764221 017002 0ustar00sergiosergio000000 000000 namespace phoenix { struct pFont; struct pWindow; struct pMenu; struct pLayout; struct pWidget; } #include "font.hpp" #include "desktop.hpp" #include "monitor.hpp" #include "keyboard.hpp" #include "mouse.hpp" #include "browser-window.hpp" #include "message-window.hpp" #include "object.hpp" #include "timer.hpp" #include "window.hpp" #include "action/action.hpp" #include "action/menu.hpp" #include "action/separator.hpp" #include "action/item.hpp" #include "action/check-item.hpp" #include "action/radio-item.hpp" #include "widget/sizable.hpp" #include "widget/layout.hpp" #include "widget/widget.hpp" #include "widget/button.hpp" #include "widget/canvas.hpp" #include "widget/check-button.hpp" #include "widget/check-label.hpp" #include "widget/combo-button.hpp" #include "widget/console.hpp" #include "widget/frame.hpp" #include "widget/hex-edit.hpp" #include "widget/horizontal-scroller.hpp" #include "widget/horizontal-slider.hpp" #include "widget/label.hpp" #include "widget/line-edit.hpp" #include "widget/list-view.hpp" #include "widget/progress-bar.hpp" #include "widget/radio-button.hpp" #include "widget/radio-label.hpp" #include "widget/tab-frame.hpp" #include "widget/text-edit.hpp" #include "widget/vertical-scroller.hpp" #include "widget/vertical-slider.hpp" #include "widget/viewport.hpp" #include "application.hpp" phoenix/cocoa/widget/label.hpp000664 001750 001750 00000000646 12651764221 017527 0ustar00sergiosergio000000 000000 @interface CocoaLabel : NSTextField { @public phoenix::Label* label; } -(id) initWith:(phoenix::Label&)label; @end namespace phoenix { struct pLabel : public pWidget { Label& label; CocoaLabel* cocoaLabel = nullptr; Size minimumSize(); void setGeometry(Geometry geometry); void setText(string text); pLabel(Label& label) : pWidget(label), label(label) {} void constructor(); void destructor(); }; } nall/string/markup/document.hpp000664 001750 001750 00000000335 12651764221 017773 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { namespace Markup { inline Node Document(const string& markup) { if(markup.beginsWith("<")) return XML::Document(markup); return BML::Document(markup); } } } #endif phoenix/reference/widget/text-edit.cpp000664 001750 001750 00000000476 12651764221 021225 0ustar00sergiosergio000000 000000 namespace phoenix { void pTextEdit::setCursorPosition(unsigned position) { } void pTextEdit::setEditable(bool editable) { } void pTextEdit::setText(string text) { } void pTextEdit::setWordWrap(bool wordWrap) { } string pTextEdit::text() { } void pTextEdit::constructor() { } void pTextEdit::destructor() { } } phoenix/reference/action/item.hpp000664 001750 001750 00000000353 12651764221 020245 0ustar00sergiosergio000000 000000 namespace phoenix { struct pItem : public pAction { Item& item; void setImage(const image& image); void setText(string text); pItem(Item& item) : pAction(item), item(item) {} void constructor(); void destructor(); }; } gba/apu/000700 001750 001750 00000000000 12656700342 013211 5ustar00sergiosergio000000 000000 processor/hg51b/instructions.cpp000664 001750 001750 00000017737 12651764221 020124 0ustar00sergiosergio000000 000000 #ifdef PROCESSOR_HG51B_HPP void HG51B::push() { stack[7] = stack[6]; stack[6] = stack[5]; stack[5] = stack[4]; stack[4] = stack[3]; stack[3] = stack[2]; stack[2] = stack[1]; stack[1] = stack[0]; stack[0] = regs.pc; } void HG51B::pull() { regs.pc = stack[0]; stack[0] = stack[1]; stack[1] = stack[2]; stack[2] = stack[3]; stack[3] = stack[4]; stack[4] = stack[5]; stack[5] = stack[6]; stack[6] = stack[7]; stack[7] = 0x0000; } //Shift-A: math opcodes can shift A register prior to ALU operation unsigned HG51B::sa() { switch(opcode & 0x0300) { default: case 0x0000: return regs.a << 0; case 0x0100: return regs.a << 1; case 0x0200: return regs.a << 8; case 0x0300: return regs.a << 16; } } //Register-or-Immediate: most opcodes can load from a register or immediate unsigned HG51B::ri() { if(opcode & 0x0400) return opcode & 0xff; return reg_read(opcode & 0xff); } //New-PC: determine jump target address; opcode.d9 = long jump flag (1 = yes) unsigned HG51B::np() { if(opcode & 0x0200) return (regs.p << 8) | (opcode & 0xff); return (regs.pc & 0xffff00) | (opcode & 0xff); } void HG51B::instruction() { if((opcode & 0xffff) == 0x0000) { //0000 0000 0000 0000 //nop } else if((opcode & 0xdd00) == 0x0800) { //00.0 10.0 .... .... //jump i if(opcode & 0x2000) push(); regs.pc = np(); } else if((opcode & 0xdd00) == 0x0c00) { //00.0 11.0 .... .... //jumpeq i if(regs.z) { if(opcode & 0x2000) push(); regs.pc = np(); } } else if((opcode & 0xdd00) == 0x1000) { //00.1 00.0 .... .... //jumpge i if(regs.c) { if(opcode & 0x2000) push(); regs.pc = np(); } } else if((opcode & 0xdd00) == 0x1400) { //00.1 01.0 .... .... //jumpmi i if(regs.n) { if(opcode & 0x2000) push(); regs.pc = np(); } } else if((opcode & 0xffff) == 0x1c00) { //0001 1100 0000 0000 //loop? } else if((opcode & 0xfffe) == 0x2500) { //0010 0101 0000 000. //skiplt/skipge if(regs.c == (opcode & 1)) regs.pc++; } else if((opcode & 0xfffe) == 0x2600) { //0010 0110 0000 000. //skipne/skipeq if(regs.z == (opcode & 1)) regs.pc++; } else if((opcode & 0xfffe) == 0x2700) { //0010 0111 0000 000. //skipmi/skippl if(regs.n == (opcode & 1)) regs.pc++; } else if((opcode & 0xffff) == 0x3c00) { //0011 1100 0000 0000 //ret pull(); } else if((opcode & 0xffff) == 0x4000) { //0100 0000 0000 0000 //rdbus regs.busdata = bus_read(regs.busaddr++); } else if((opcode & 0xf800) == 0x4800) { //0100 1... .... .... //cmpr a<= 0; } else if((opcode & 0xf800) == 0x5000) { //0101 0... .... .... //cmp a<= 0; } else if((opcode & 0xfb00) == 0x5900) { //0101 1.01 .... .... //sxb regs.a = (int8)ri(); } else if((opcode & 0xfb00) == 0x5a00) { //0101 1.10 .... .... //sxw regs.a = (int16)ri(); } else if((opcode & 0xfb00) == 0x6000) { //0110 0.00 .... .... //ld a,ri regs.a = ri(); } else if((opcode & 0xfb00) == 0x6100) { //0110 0.01 .... .... //ld ?,ri } else if((opcode & 0xfb00) == 0x6300) { //0110 0.11 .... .... //ld p,ri regs.p = ri(); } else if((opcode & 0xfb00) == 0x6800) { //0110 1.00 .... .... //rdraml uint24 target = ri() + (opcode & 0x0400 ? regs.ramaddr : (uint24)0); if(target < 0xc00) regs.ramdata = (regs.ramdata & 0xffff00) | (dataRAM[target] << 0); } else if((opcode & 0xfb00) == 0x6900) { //0110 1.01 .... .... //rdramh uint24 target = ri() + (opcode & 0x0400 ? regs.ramaddr : (uint24)0); if(target < 0xc00) regs.ramdata = (regs.ramdata & 0xff00ff) | (dataRAM[target] << 8); } else if((opcode & 0xfb00) == 0x6a00) { //0110 1.10 .... .... //rdramb uint24 target = ri() + (opcode & 0x0400 ? regs.ramaddr : (uint24)0); if(target < 0xc00) regs.ramdata = (regs.ramdata & 0x00ffff) | (dataRAM[target] << 16); } else if((opcode & 0xffff) == 0x7000) { //0111 0000 0000 0000 //rdrom regs.romdata = dataROM[regs.a & 0x3ff]; } else if((opcode & 0xff00) == 0x7c00) { //0111 1100 .... .... //ld pl,i regs.p = (regs.p & 0xff00) | ((opcode & 0xff) << 0); } else if((opcode & 0xff00) == 0x7d00) { //0111 1101 .... .... //ld ph,i regs.p = (regs.p & 0x00ff) | ((opcode & 0xff) << 8); } else if((opcode & 0xf800) == 0x8000) { //1000 0... .... .... //add a< 0xffffff; } else if((opcode & 0xf800) == 0x8800) { //1000 1... .... .... //subr a<= 0; } else if((opcode & 0xf800) == 0x9000) { //1001 0... .... .... //sub a<= 0; } else if((opcode & 0xfb00) == 0x9800) { //1001 1.00 .... .... //mul a,ri int64 x = (int24)regs.a; int64 y = (int24)ri(); x *= y; regs.accl = x >> 0ull; regs.acch = x >> 24ull; regs.n = regs.acch & 0x800000; regs.z = x == 0; } else if((opcode & 0xf800) == 0xa800) { //1010 1... .... .... //xor a<> ri(); regs.n = regs.a & 0x800000; regs.z = regs.a == 0; } else if((opcode & 0xfb00) == 0xc800) { //1100 1.00 .... .... //asr a,ri regs.a = (int24)regs.a >> ri(); regs.n = regs.a & 0x800000; regs.z = regs.a == 0; } else if((opcode & 0xfb00) == 0xd000) { //1101 0.00 .... .... //ror a,ri uint24 length = ri(); regs.a = (regs.a >> length) | (regs.a << (24 - length)); regs.n = regs.a & 0x800000; regs.z = regs.a == 0; } else if((opcode & 0xfb00) == 0xd800) { //1101 1.00 .... .... //shl a,ri regs.a = regs.a << ri(); regs.n = regs.a & 0x800000; regs.z = regs.a == 0; } else if((opcode & 0xff00) == 0xe000) { //1110 0000 .... .... //st r,a reg_write(opcode & 0xff, regs.a); } else if((opcode & 0xfb00) == 0xe800) { //1110 1.00 .... .... //wrraml uint24 target = ri() + (opcode & 0x0400 ? regs.ramaddr : (uint24)0); if(target < 0xc00) dataRAM[target] = regs.ramdata >> 0; } else if((opcode & 0xfb00) == 0xe900) { //1110 1.01 .... .... //wrramh uint24 target = ri() + (opcode & 0x0400 ? regs.ramaddr : (uint24)0); if(target < 0xc00) dataRAM[target] = regs.ramdata >> 8; } else if((opcode & 0xfb00) == 0xea00) { //1110 1.10 .... .... //wrramb uint24 target = ri() + (opcode & 0x0400 ? regs.ramaddr : (uint24)0); if(target < 0xc00) dataRAM[target] = regs.ramdata >> 16; } else if((opcode & 0xff00) == 0xf000) { //1111 0000 .... .... //swap a,r uint24 source = reg_read(opcode & 0xff); uint24 target = regs.a; regs.a = source; reg_write(opcode & 0xff, target); } else if((opcode & 0xffff) == 0xfc00) { //1111 1100 0000 0000 //halt regs.halt = true; } else { print("Hitachi DSP: unknown opcode @ ", hex<4>(regs.pc - 1), " = ", hex<4>(opcode), "\n"); regs.halt = true; } } #endif phoenix/windows/widget/vertical-scroller.cpp000664 001750 001750 00000002220 12651764221 022473 0ustar00sergiosergio000000 000000 namespace phoenix { Size pVerticalScroller::minimumSize() { return {18, 0}; } void pVerticalScroller::setLength(unsigned length) { length += (length == 0); SetScrollRange(hwnd, SB_CTL, 0, length - 1, TRUE); verticalScroller.setPosition(0); } void pVerticalScroller::setPosition(unsigned position) { SetScrollPos(hwnd, SB_CTL, position, TRUE); } void pVerticalScroller::constructor() { hwnd = CreateWindow( L"SCROLLBAR", L"", WS_CHILD | SBS_VERT, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&verticalScroller); unsigned position = verticalScroller.state.position; setLength(verticalScroller.state.length); verticalScroller.setPosition(position); synchronize(); } void pVerticalScroller::destructor() { DestroyWindow(hwnd); } void pVerticalScroller::orphan() { destructor(); constructor(); } void pVerticalScroller::onChange(WPARAM wparam) { unsigned position = ScrollEvent(hwnd, wparam); if(position == verticalScroller.state.position) return; verticalScroller.state.position = position; if(verticalScroller.onChange) verticalScroller.onChange(); } } sfc/alt/ppu-performance/background/000700 001750 001750 00000000000 12656700342 020450 5ustar00sergiosergio000000 000000 sfc/alt/smp/smp.cpp000664 001750 001750 00000005617 12651764221 015356 0ustar00sergiosergio000000 000000 #define CYCLE_ACCURATE #include #define SMP_CPP namespace SuperFamicom { SMP smp; #include "algorithms.cpp" #include "core.cpp" #include "memory.cpp" #include "timing.cpp" void SMP::synchronize_cpu() { if(CPU::Threaded == true) { //if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cpu.thread); } else { while(clock >= 0) cpu.enter(); } } void SMP::synchronize_dsp() { if(DSP::Threaded == true) { //if(dsp.clock < 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(dsp.thread); } else { while(dsp.clock < 0) dsp.enter(); } } void SMP::enter() { while(clock < 0) op_step(); } void SMP::power() { Thread::frequency = system.apu_frequency(); Thread::clock = 0; timer0.target = 0; timer1.target = 0; timer2.target = 0; for(unsigned n = 0; n < 256; n++) { cycle_table_dsp[n] = (cycle_count_table[n] * 24); cycle_table_cpu[n] = (cycle_count_table[n] * 24) * cpu.frequency; } cycle_step_cpu = 24 * cpu.frequency; reset(); } void SMP::reset() { for(unsigned n = 0x0000; n <= 0xffff; n++) apuram[n] = 0x00; opcode_number = 0; opcode_cycle = 0; regs.pc = 0xffc0; regs.sp = 0xef; regs.a = 0x00; regs.x = 0x00; regs.y = 0x00; regs.p = 0x02; //$00f1 status.iplrom_enable = true; //$00f2 status.dsp_addr = 0x00; //$00f8,$00f9 status.ram00f8 = 0x00; status.ram00f9 = 0x00; //timers timer0.enable = timer1.enable = timer2.enable = false; timer0.stage1_ticks = timer1.stage1_ticks = timer2.stage1_ticks = 0; timer0.stage2_ticks = timer1.stage2_ticks = timer2.stage2_ticks = 0; timer0.stage3_ticks = timer1.stage3_ticks = timer2.stage3_ticks = 0; } void SMP::serialize(serializer& s) { Thread::serialize(s); s.array(apuram, 64 * 1024); s.integer(opcode_number); s.integer(opcode_cycle); s.integer(regs.pc); s.integer(regs.sp); s.integer(regs.a); s.integer(regs.x); s.integer(regs.y); s.integer(regs.p.n); s.integer(regs.p.v); s.integer(regs.p.p); s.integer(regs.p.b); s.integer(regs.p.h); s.integer(regs.p.i); s.integer(regs.p.z); s.integer(regs.p.c); s.integer(rd); s.integer(wr); s.integer(dp); s.integer(sp); s.integer(ya); s.integer(bit); s.integer(status.iplrom_enable); s.integer(status.dsp_addr); s.integer(status.ram00f8); s.integer(status.ram00f9); s.integer(timer0.enable); s.integer(timer0.target); s.integer(timer0.stage1_ticks); s.integer(timer0.stage2_ticks); s.integer(timer0.stage3_ticks); s.integer(timer1.enable); s.integer(timer1.target); s.integer(timer1.stage1_ticks); s.integer(timer1.stage2_ticks); s.integer(timer1.stage3_ticks); s.integer(timer2.enable); s.integer(timer2.target); s.integer(timer2.stage1_ticks); s.integer(timer2.stage2_ticks); s.integer(timer2.stage3_ticks); } SMP::SMP() { apuram = new uint8[64 * 1024]; for(auto& byte : iplrom) byte = 0; } SMP::~SMP() { } } sfc/chip/nss/nss.cpp000664 001750 001750 00000000546 12651764221 015525 0ustar00sergiosergio000000 000000 #include #define NSS_CPP namespace SuperFamicom { NSS nss; void NSS::init() { dip = 0x00; } void NSS::load() { } void NSS::unload() { } void NSS::power() { } void NSS::reset() { } void NSS::set_dip(uint16 dip) { this->dip = dip; } uint8 NSS::read(unsigned addr) { return dip; } void NSS::write(unsigned addr, uint8 data) { } } sfc/chip/dsp1/000700 001750 001750 00000000000 12656700342 014240 5ustar00sergiosergio000000 000000 sfc/smp/smp.cpp000664 001750 001750 00000004453 12651764221 014573 0ustar00sergiosergio000000 000000 #include #define SMP_CPP namespace SuperFamicom { SMP smp; #include "memory.cpp" #include "timing.cpp" #include "serialization.cpp" void SMP::step(unsigned clocks) { clock += clocks * (uint64)cpu.frequency; dsp.clock -= clocks; } void SMP::synchronize_cpu() { if(CPU::Threaded == true) { if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cpu.thread); } else { while(clock >= 0) cpu.enter(); } } void SMP::synchronize_dsp() { if(DSP::Threaded == true) { if(dsp.clock < 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(dsp.thread); } else { while(dsp.clock < 0) dsp.enter(); } } void SMP::Enter() { smp.enter(); } void SMP::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } debugger.op_exec(regs.pc); op_step(); } } void SMP::power() { //targets not initialized/changed upon reset timer0.target = 0; timer1.target = 0; timer2.target = 0; } void SMP::reset() { create(Enter, system.apu_frequency()); regs.pc = 0xffc0; regs.a = 0x00; regs.x = 0x00; regs.y = 0x00; regs.s = 0xef; regs.p = 0x02; for(auto& n : apuram) n = random(0x00); apuram[0x00f4] = 0x00; apuram[0x00f5] = 0x00; apuram[0x00f6] = 0x00; apuram[0x00f7] = 0x00; status.clock_counter = 0; status.dsp_counter = 0; status.timer_step = 3; //$00f0 status.clock_speed = 0; status.timer_speed = 0; status.timers_enable = true; status.ram_disable = false; status.ram_writable = true; status.timers_disable = false; //$00f1 status.iplrom_enable = true; //$00f2 status.dsp_addr = 0x00; //$00f8,$00f9 status.ram00f8 = 0x00; status.ram00f9 = 0x00; timer0.stage0_ticks = 0; timer1.stage0_ticks = 0; timer2.stage0_ticks = 0; timer0.stage1_ticks = 0; timer1.stage1_ticks = 0; timer2.stage1_ticks = 0; timer0.stage2_ticks = 0; timer1.stage2_ticks = 0; timer2.stage2_ticks = 0; timer0.stage3_ticks = 0; timer1.stage3_ticks = 0; timer2.stage3_ticks = 0; timer0.current_line = 0; timer1.current_line = 0; timer2.current_line = 0; timer0.enable = false; timer1.enable = false; timer2.enable = false; } SMP::SMP() { for(auto& byte : iplrom) byte = 0; } SMP::~SMP() { } } phoenix/reference/widget/hex-edit.hpp000664 001750 001750 00000000537 12651764221 021030 0ustar00sergiosergio000000 000000 namespace phoenix { struct pHexEdit : public pWidget { HexEdit& hexEdit; void setColumns(unsigned columns); void setLength(unsigned length); void setOffset(unsigned offset); void setRows(unsigned rows); void update(); pHexEdit(HexEdit& hexEdit) : pWidget(hexEdit), hexEdit(hexEdit) {} void constructor(); void destructor(); }; } sfc/chip/dsp4/000700 001750 001750 00000000000 12656700342 014243 5ustar00sergiosergio000000 000000 sfc/chip/dsp3/000700 001750 001750 00000000000 12656700342 014242 5ustar00sergiosergio000000 000000 sfc/chip/dsp2/000700 001750 001750 00000000000 12656700342 014241 5ustar00sergiosergio000000 000000 sfc/slot/sufamiturbo/serialization.cpp000664 001750 001750 00000000173 12651764221 021366 0ustar00sergiosergio000000 000000 #ifdef SUFAMITURBO_CPP void SufamiTurboCartridge::serialize(serializer& s) { s.array(ram.data(), ram.size()); } #endif sfc/controller/superscope/superscope.cpp000664 001750 001750 00000007206 12651764221 021737 0ustar00sergiosergio000000 000000 #ifdef CONTROLLER_CPP //The Super Scope is a light-gun: it detects the CRT beam cannon position, //and latches the counters by toggling iobit. This only works on controller //port 2, as iobit there is connected to the PPU H/V counter latch. //(PIO $4201.d7) //It is obviously not possible to perfectly simulate an IR light detecting //a CRT beam cannon, hence this class will read the PPU raster counters. //A Super Scope can still technically be used in port 1, however it would //require manual polling of PIO ($4201.d6) to determine when iobit was written. //Note that no commercial game ever utilizes a Super Scope in port 1. void SuperScope::enter() { unsigned prev = 0; while(true) { unsigned next = cpu.vcounter() * 1364 + cpu.hcounter(); if(offscreen == false) { unsigned target = y * 1364 + (x + 24) * 4; if(next >= target && prev < target) { //CRT raster detected, toggle iobit to latch counters iobit(0); iobit(1); } } if(next < prev) { //Vcounter wrapped back to zero; update cursor coordinates for start of new frame int nx = interface->inputPoll(port, (unsigned)Input::Device::SuperScope, (unsigned)Input::SuperScopeID::X); int ny = interface->inputPoll(port, (unsigned)Input::Device::SuperScope, (unsigned)Input::SuperScopeID::Y); nx += x; ny += y; x = max(-16, min(256 + 16, nx)); y = max(-16, min(240 + 16, ny)); offscreen = (x < 0 || y < 0 || x >= 256 || y >= (ppu.overscan() ? 240 : 225)); } prev = next; step(2); } } uint2 SuperScope::data() { if(counter >= 8) return 1; if(counter == 0) { //turbo is a switch; toggle is edge sensitive bool newturbo = interface->inputPoll(port, (unsigned)Input::Device::SuperScope, (unsigned)Input::SuperScopeID::Turbo); if(newturbo && !turbo) { turbo = !turbo; //toggle state turbolock = true; } else { turbolock = false; } //trigger is a button //if turbo is active, trigger is level sensitive; otherwise, it is edge sensitive trigger = false; bool newtrigger = interface->inputPoll(port, (unsigned)Input::Device::SuperScope, (unsigned)Input::SuperScopeID::Trigger); if(newtrigger && (turbo || !triggerlock)) { trigger = true; triggerlock = true; } else if(!newtrigger) { triggerlock = false; } //cursor is a button; it is always level sensitive cursor = interface->inputPoll(port, (unsigned)Input::Device::SuperScope, (unsigned)Input::SuperScopeID::Cursor); //pause is a button; it is always edge sensitive pause = false; bool newpause = interface->inputPoll(port, (unsigned)Input::Device::SuperScope, (unsigned)Input::SuperScopeID::Pause); if(newpause && !pauselock) { pause = true; pauselock = true; } else if(!newpause) { pauselock = false; } offscreen = (x < 0 || y < 0 || x >= 256 || y >= (ppu.overscan() ? 240 : 225)); } switch(counter++) { case 0: return offscreen ? 0 : trigger; case 1: return cursor; case 2: return turbo; case 3: return pause; case 4: return 0; case 5: return 0; case 6: return offscreen; case 7: return 0; //noise (1 = yes) } // NOT REACHED return 0; } void SuperScope::latch(bool data) { if(latched == data) return; latched = data; counter = 0; } SuperScope::SuperScope(bool port) : Controller(port) { create(Controller::Enter, 21477272); latched = 0; counter = 0; //center cursor onscreen x = 256 / 2; y = 240 / 2; trigger = false; cursor = false; turbo = false; pause = false; offscreen = false; turbolock = false; triggerlock = false; pauselock = false; } #endif phoenix/reference/object.cpp000664 001750 001750 00000000130 12651764221 017264 0ustar00sergiosergio000000 000000 namespace phoenix { void pObject::constructor() { } void pObject::destructor() { } } sfc/chip/sharprtc/memory.cpp000664 001750 001750 00000004003 12651764221 017245 0ustar00sergiosergio000000 000000 uint4 SharpRTC::rtc_read(uint4 addr) { switch(addr) { case 0: return second % 10; case 1: return second / 10; case 2: return minute % 10; case 3: return minute / 10; case 4: return hour % 10; case 5: return hour / 10; case 6: return day % 10; case 7: return day / 10; case 8: return month; case 9: return year % 10; case 10: return year / 10 % 10; case 11: return year / 100; case 12: return weekday; default: return 0; } } void SharpRTC::rtc_write(uint4 addr, uint4 data) { switch(addr) { case 0: second = second / 10 * 10 + data; break; case 1: second = data * 10 + second % 10; break; case 2: minute = minute / 10 * 10 + data; break; case 3: minute = data * 10 + minute % 10; break; case 4: hour = hour / 10 * 10 + data; break; case 5: hour = data * 10 + hour % 10; break; case 6: day = day / 10 * 10 + data; break; case 7: day = data * 10 + day % 10; break; case 8: month = data; break; case 9: year = year / 10 * 10 + data; break; case 10: year = year / 100 * 100 + data * 10 + year % 10; break; case 11: year = data * 100 + year % 100; break; case 12: weekday = data; break; } } void SharpRTC::load(const uint8* data) { for(unsigned byte = 0; byte < 8; byte++) { rtc_write(byte * 2 + 0, data[byte] >> 0); rtc_write(byte * 2 + 1, data[byte] >> 4); } uint64 timestamp = 0; for(unsigned byte = 0; byte < 8; byte++) { timestamp |= data[8 + byte] << (byte * 8); } uint64 diff = (uint64)time(0) - timestamp; while(diff >= 60 * 60 * 24) { tick_day(); diff -= 60 * 60 * 24; } while(diff >= 60 * 60) { tick_hour(); diff -= 60 * 60; } while(diff >= 60) { tick_minute(); diff -= 60; } while(diff--) tick_second(); } void SharpRTC::save(uint8* data) { for(unsigned byte = 0; byte < 8; byte++) { data[byte] = rtc_read(byte * 2 + 0) << 0; data[byte] |= rtc_read(byte * 2 + 1) << 4; } uint64 timestamp = (uint64)time(0); for(unsigned byte = 0; byte < 8; byte++) { data[8 + byte] = timestamp; timestamp >>= 8; } } nall/directory.hpp000664 001750 001750 00000016012 12651764221 015353 0ustar00sergiosergio000000 000000 #ifndef NALL_DIRECTORY_HPP #define NALL_DIRECTORY_HPP #include #include #include #include #include #if defined(PLATFORM_WINDOWS) #include #else #include #include #include #endif namespace nall { struct directory { static bool create(const string& pathname, unsigned permissions = 0755); //recursive static bool remove(const string& pathname); //recursive static bool exists(const string& pathname); static lstring folders(const string& pathname, const string& pattern = "*") { lstring folders = directory::ufolders(pathname, pattern); folders.sort(); return folders; } static lstring files(const string& pathname, const string& pattern = "*") { lstring files = directory::ufiles(pathname, pattern); files.sort(); return files; } static lstring contents(const string& pathname, const string& pattern = "*") { lstring folders = directory::ufolders(pathname); //pattern search of contents should only filter files lstring files = directory::ufiles(pathname, pattern); folders.sort(); files.sort(); for(auto& file : files) folders.append(file); return folders; } static lstring ifolders(const string& pathname, const string& pattern = "*") { lstring folders = ufolders(pathname, pattern); folders.isort(); return folders; } static lstring ifiles(const string& pathname, const string& pattern = "*") { lstring files = ufiles(pathname, pattern); files.isort(); return files; } static lstring icontents(const string& pathname, const string& pattern = "*") { lstring folders = directory::ufolders(pathname); //pattern search of contents should only filter files lstring files = directory::ufiles(pathname, pattern); folders.isort(); files.isort(); for(auto& file : files) folders.append(file); return folders; } private: //internal functions; these return unsorted lists static lstring ufolders(const string& pathname, const string& pattern = "*"); static lstring ufiles(const string& pathname, const string& pattern = "*"); }; #if defined(PLATFORM_WINDOWS) inline bool directory::create(const string& pathname, unsigned permissions) { string path; lstring list = string{pathname}.transform("\\", "/").rtrim<1>("/").split("/"); bool result = true; for(auto& part : list) { path.append(part, "/"); result &= (_wmkdir(utf16_t(path)) == 0); } return result; } inline bool directory::remove(const string& pathname) { lstring list = directory::contents(pathname); for(auto& name : list) { if(name.endsWith("/")) directory::remove({pathname, name}); else file::remove({pathname, name}); } return _wrmdir(utf16_t(pathname)) == 0; } inline bool directory::exists(const string& pathname) { string name = pathname; name.trim<1>("\""); DWORD result = GetFileAttributes(utf16_t(name)); if(result == INVALID_FILE_ATTRIBUTES) return false; return (result & FILE_ATTRIBUTE_DIRECTORY); } inline lstring directory::ufolders(const string& pathname, const string& pattern) { lstring list; string path = pathname; path.transform("/", "\\"); if(!strend(path, "\\")) path.append("\\"); path.append("*"); HANDLE handle; WIN32_FIND_DATA data; handle = FindFirstFile(utf16_t(path), &data); if(handle != INVALID_HANDLE_VALUE) { if(wcscmp(data.cFileName, L".") && wcscmp(data.cFileName, L"..")) { if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { string name = (const char*)utf8_t(data.cFileName); if(name.match(pattern)) list.append(name); } } while(FindNextFile(handle, &data) != false) { if(wcscmp(data.cFileName, L".") && wcscmp(data.cFileName, L"..")) { if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { string name = (const char*)utf8_t(data.cFileName); if(name.match(pattern)) list.append(name); } } } FindClose(handle); } for(auto& name : list) name.append("/"); //must append after sorting return list; } inline lstring directory::ufiles(const string& pathname, const string& pattern) { lstring list; string path = pathname; path.transform("/", "\\"); if(!strend(path, "\\")) path.append("\\"); path.append("*"); HANDLE handle; WIN32_FIND_DATA data; handle = FindFirstFile(utf16_t(path), &data); if(handle != INVALID_HANDLE_VALUE) { if((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) { string name = (const char*)utf8_t(data.cFileName); if(name.match(pattern)) list.append(name); } while(FindNextFile(handle, &data) != false) { if((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) { string name = (const char*)utf8_t(data.cFileName); if(name.match(pattern)) list.append(name); } } FindClose(handle); } return list; } #else inline bool directory::create(const string& pathname, unsigned permissions) { string path; lstring list = string{pathname}.rtrim<1>("/").split("/"); bool result = true; for(auto& part : list) { path.append(part, "/"); result &= (mkdir(path, permissions) == 0); } return result; } inline bool directory::remove(const string& pathname) { lstring list = directory::contents(pathname); for(auto& name : list) { if(name.endsWith("/")) directory::remove({pathname, name}); else file::remove({pathname, name}); } return rmdir(pathname) == 0; } inline bool directory::exists(const string& pathname) { DIR *dp = opendir(pathname); if(!dp) return false; closedir(dp); return true; } inline lstring directory::ufolders(const string& pathname, const string& pattern) { lstring list; DIR* dp; struct dirent* ep; dp = opendir(pathname); if(dp) { while((ep = readdir(dp))) { if(!strcmp(ep->d_name, ".")) continue; if(!strcmp(ep->d_name, "..")) continue; bool is_directory = ep->d_type & DT_DIR; if(ep->d_type & DT_UNKNOWN) { struct stat sp = {0}; stat(string{pathname, ep->d_name}, &sp); is_directory = S_ISDIR(sp.st_mode); } if(is_directory) { if(strmatch(ep->d_name, pattern)) list.append(ep->d_name); } } closedir(dp); } for(auto& name : list) name.append("/"); //must append after sorting return list; } inline lstring directory::ufiles(const string& pathname, const string& pattern) { lstring list; DIR* dp; struct dirent* ep; dp = opendir(pathname); if(dp) { while((ep = readdir(dp))) { if(!strcmp(ep->d_name, ".")) continue; if(!strcmp(ep->d_name, "..")) continue; if((ep->d_type & DT_DIR) == 0) { if(strmatch(ep->d_name, pattern)) list.append(ep->d_name); } } closedir(dp); } return list; } #endif } #endif gba/apu/square1.cpp000664 001750 001750 00000005051 12651764221 015314 0ustar00sergiosergio000000 000000 void APU::Square1::runsweep(bool update) { if(sweep.enable == false) return; sweep.negate = sweep.direction; unsigned delta = shadowfrequency >> sweep.shift; signed updatefrequency = shadowfrequency + (sweep.negate ? -delta : delta); if(updatefrequency > 2047) { enable = false; } else if(sweep.shift && update) { shadowfrequency = updatefrequency; frequency = updatefrequency; period = 2 * (2048 - frequency); } } void APU::Square1::clocksweep() { if(enable && sweep.frequency && --sweep.period == 0) { sweep.period = sweep.frequency; runsweep(1); runsweep(0); } } uint8 APU::Square1::read(unsigned addr) const { switch(addr) { case 0: return (sweep.shift << 0) | (sweep.direction << 3) | (sweep.frequency << 4); case 1: return (length << 0) | (duty << 6); case 2: return (envelope.frequency << 0) | (envelope.direction << 3) | (envelope.volume << 4); case 3: return (frequency << 0); case 4: return (frequency >> 8) | (counter << 6) | (initialize << 7); } } void APU::Square1::write(unsigned addr, uint8 byte) { switch(addr) { case 0: //NR10 if(sweep.negate && sweep.direction && !(byte & 0x08)) enable = false; sweep.shift = byte >> 0; sweep.direction = byte >> 3; sweep.frequency = byte >> 4; break; case 1: //NR11 length = byte >> 0; duty = byte >> 6; break; case 2: //NR12 envelope.frequency = byte >> 0; envelope.direction = byte >> 3; envelope.volume = byte >> 4; if(envelope.dacenable() == false) enable = false; break; case 3: //NR13 frequency = (frequency & 0xff00) | (byte << 0); break; case 4: //NR14 frequency = (frequency & 0x00ff) | (byte << 8); counter = byte >> 6; initialize = byte >> 7; if(initialize) { enable = envelope.dacenable(); period = 2 * (2048 - frequency); envelope.period = envelope.frequency; volume = envelope.volume; shadowfrequency = frequency; sweep.period = sweep.frequency; sweep.enable = sweep.period || sweep.shift; sweep.negate = false; if(sweep.shift) runsweep(0); } break; } } void APU::Square1::power() { envelope.frequency = 0; envelope.direction = 0; envelope.direction = 0; envelope.period = 0; sweep.shift = 0; sweep.direction = 0; sweep.frequency = 0; sweep.enable = 0; sweep.negate = 0; sweep.period = 0; enable = 0; length = 0; duty = 0; frequency = 0; counter = 0; initialize = 0; shadowfrequency = 0; signal = 0; output = 0; period = 0; phase = 0; volume = 0; } phoenix/reference/widget/list-view.hpp000664 001750 001750 00000001306 12651764221 021237 0ustar00sergiosergio000000 000000 namespace phoenix { struct pListView : public pWidget { ListView& listView; void append(const lstring& text); void autoSizeColumns(); void remove(unsigned selection); void reset(); void setCheckable(bool checkable); void setChecked(unsigned selection, bool checked); void setHeaderText(const lstring& text); void setHeaderVisible(bool visible); void setImage(unsigned selection, unsigned position, const image& image); void setSelected(bool selected); void setSelection(unsigned selection); void setText(unsigned selection, unsigned position, string text); pListView(ListView& listView) : pWidget(listView), listView(listView) {} void constructor(); void destructor(); }; } gb/cartridge/mbc1/mbc1.hpp000664 001750 001750 00000000406 12651764221 016421 0ustar00sergiosergio000000 000000 struct MBC1 : MMIO { bool ram_enable; //$0000-1fff uint8 rom_select; //$2000-3fff uint8 ram_select; //$4000-5fff bool mode_select; //$6000-7fff uint8 mmio_read(uint16 addr); void mmio_write(uint16 addr, uint8 data); void power(); } mbc1; phoenix/reference/keyboard.cpp000664 001750 001750 00000000407 12651764221 017625 0ustar00sergiosergio000000 000000 namespace phoenix { bool pKeyboard::pressed(Keyboard::Scancode scancode) { return false; } vector pKeyboard::state() { vector output; output.resize((unsigned)Keyboard::Scancode::Limit); for(auto& n : output) n = false; return output; } } fc/memory/memory.cpp000664 001750 001750 00000001410 12651764221 015620 0ustar00sergiosergio000000 000000 #include namespace Famicom { Bus bus; //$0000-07ff = RAM (2KB) //$0800-1fff = RAM (mirror) //$2000-2007 = PPU //$2008-3fff = PPU (mirror) //$4000-4017 = APU + I/O //$4018-ffff = Cartridge uint8 Bus::read(uint16 addr) { uint8 data = cartridge.prg_read(addr); if(addr <= 0x1fff) data = cpu.ram_read(addr); else if(addr <= 0x3fff) data = ppu.read(addr); else if(addr <= 0x4017) data = cpu.read(addr); if(cheat.enable()) { if(auto result = cheat.find(addr, data)) return result(); } return data; } void Bus::write(uint16 addr, uint8 data) { cartridge.prg_write(addr, data); if(addr <= 0x1fff) return cpu.ram_write(addr, data); if(addr <= 0x3fff) return ppu.write(addr, data); if(addr <= 0x4017) return cpu.write(addr, data); } } sfc/alt/ppu-balanced/render/000700 001750 001750 00000000000 12656700342 017040 5ustar00sergiosergio000000 000000 sfc/smp/serialization.cpp000664 001750 001750 00000002334 12651764221 016645 0ustar00sergiosergio000000 000000 #ifdef SMP_CPP void SMP::serialize(serializer& s) { SPC700::serialize(s); Thread::serialize(s); s.array(apuram); s.integer(status.clock_counter); s.integer(status.dsp_counter); s.integer(status.timer_step); s.integer(status.clock_speed); s.integer(status.timer_speed); s.integer(status.timers_enable); s.integer(status.ram_disable); s.integer(status.ram_writable); s.integer(status.timers_disable); s.integer(status.iplrom_enable); s.integer(status.dsp_addr); s.integer(status.ram00f8); s.integer(status.ram00f9); s.integer(timer0.stage0_ticks); s.integer(timer0.stage1_ticks); s.integer(timer0.stage2_ticks); s.integer(timer0.stage3_ticks); s.integer(timer0.current_line); s.integer(timer0.enable); s.integer(timer0.target); s.integer(timer1.stage0_ticks); s.integer(timer1.stage1_ticks); s.integer(timer1.stage2_ticks); s.integer(timer1.stage3_ticks); s.integer(timer1.current_line); s.integer(timer1.enable); s.integer(timer1.target); s.integer(timer2.stage0_ticks); s.integer(timer2.stage1_ticks); s.integer(timer2.stage2_ticks); s.integer(timer2.stage3_ticks); s.integer(timer2.current_line); s.integer(timer2.enable); s.integer(timer2.target); } #endif sfc/chip/sharprtc/000700 001750 001750 00000000000 12656700342 015217 5ustar00sergiosergio000000 000000 phoenix/cocoa/widget/tab-frame.cpp000664 001750 001750 00000010103 12651764221 020266 0ustar00sergiosergio000000 000000 @implementation CocoaTabFrame : NSTabView -(id) initWith:(phoenix::TabFrame&)tabFrameReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { tabFrame = &tabFrameReference; [self setDelegate:self]; } return self; } -(void) tabView:(NSTabView*)tabView didSelectTabViewItem:(NSTabViewItem*)tabViewItem { tabFrame->state.selection = [tabView indexOfTabViewItem:tabViewItem]; tabFrame->p.synchronizeLayout(); if(tabFrame->onChange) tabFrame->onChange(); } @end @implementation CocoaTabFrameItem : NSTabViewItem -(id) initWith:(phoenix::TabFrame&)tabFrameReference { if(self = [super initWithIdentifier:nil]) { tabFrame = &tabFrameReference; cocoaTabFrame = tabFrame->p.cocoaTabFrame; } return self; } -(NSSize) sizeOfLabel:(BOOL)shouldTruncateLabel { NSSize sizeOfLabel = [super sizeOfLabel:shouldTruncateLabel]; signed selection = [cocoaTabFrame indexOfTabViewItem:self]; if(selection < 0) return sizeOfLabel; //should never happen if(tabFrame->state.image[selection].empty() == false) { unsigned iconSize = phoenix::Font::size(tabFrame->font(), " ").height; sizeOfLabel.width += iconSize + 2; } return sizeOfLabel; } -(void) drawLabel:(BOOL)shouldTruncateLabel inRect:(NSRect)tabRect { signed selection = [cocoaTabFrame indexOfTabViewItem:self]; if(selection >= 0 && tabFrame->state.image[selection].empty() == false) { unsigned iconSize = phoenix::Font::size(tabFrame->font(), " ").height; NSImage* image = NSMakeImage(tabFrame->state.image[selection]); [[NSGraphicsContext currentContext] saveGraphicsState]; NSRect targetRect = NSMakeRect(tabRect.origin.x, tabRect.origin.y + 2, iconSize, iconSize); [image drawInRect:targetRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil]; [[NSGraphicsContext currentContext] restoreGraphicsState]; tabRect.origin.x += iconSize + 2; tabRect.size.width -= iconSize + 2; } [super drawLabel:shouldTruncateLabel inRect:tabRect]; } @end namespace phoenix { void pTabFrame::append(string text, const image& image) { @autoreleasepool { CocoaTabFrameItem* item = [[CocoaTabFrameItem alloc] initWith:tabFrame]; [item setLabel:[NSString stringWithUTF8String:text]]; [cocoaView addTabViewItem:item]; tabs.append(item); } } void pTabFrame::remove(unsigned selection) { @autoreleasepool { CocoaTabFrameItem* item = tabs[selection]; [cocoaView removeTabViewItem:item]; tabs.remove(selection); } } void pTabFrame::setEnabled(bool enabled) { for(auto& layout : tabFrame.state.layout) { if(layout) layout->setEnabled(layout->enabled()); } pWidget::setEnabled(enabled); } void pTabFrame::setGeometry(Geometry geometry) { pWidget::setGeometry({ geometry.x - 7, geometry.y - 5, geometry.width + 14, geometry.height + 6 }); geometry.x += 1, geometry.width -= 2; geometry.y += 22, geometry.height -= 32; for(auto& layout : tabFrame.state.layout) { if(layout == nullptr) continue; layout->setGeometry(geometry); } synchronizeLayout(); } void pTabFrame::setImage(unsigned selection, const image& image) { } void pTabFrame::setSelection(unsigned selection) { @autoreleasepool { CocoaTabFrameItem* item = tabs[selection]; [cocoaView selectTabViewItem:item]; } synchronizeLayout(); } void pTabFrame::setText(unsigned selection, string text) { @autoreleasepool { CocoaTabFrameItem* item = tabs[selection]; [item setLabel:[NSString stringWithUTF8String:text]]; } } void pTabFrame::setVisible(bool visible) { for(auto& layout : tabFrame.state.layout) { if(layout) layout->setVisible(layout->visible()); } pWidget::setVisible(visible); } void pTabFrame::constructor() { @autoreleasepool { cocoaView = cocoaTabFrame = [[CocoaTabFrame alloc] initWith:tabFrame]; } } void pTabFrame::destructor() { @autoreleasepool { [cocoaView release]; } } void pTabFrame::synchronizeLayout() { unsigned selection = 0; for(auto& layout : tabFrame.state.layout) { if(layout) layout->setVisible(selection == tabFrame.state.selection); selection++; } } } target-ethos/resource/input.png000664 001750 001750 00000001454 12651764221 020016 0ustar00sergiosergio000000 000000 PNG  IHDRabKGDM4{ pHYs  tIME 'ɣtEXtCommentMenu-sized icon ========== (c) 2003 Jakub 'jimmac' Steiner, http://jimmac.musichall.cz created with the GIMP, http://www.gimp.orggG!IDAT8˕kSA&Ҥ6чI{ X݈.D H]պDЅ"TD*55iuo游iB7(:dz3a)_|*`P:>_(Tu|5]fzOMFcC+ckخ#V R]a  ^ƉƙVJOwZ7VTtG(ܪCET4*]=sX"`./pmlƭ) 5Ba 9ro?hU/bYA3hZVחXԧ>4Q"Gx" }e*+++߾3i`ƏaD$#H]# R+QZ^]%GyIs]Dobhlʇ&ZDH$$IDJ0F`&GdL۩mor2Je;A6u]vRJ-H$DVjxFFy5aIENDB`fc/cartridge/board/nes-cnrom.cpp000664 001750 001750 00000002207 12651764221 017741 0ustar00sergiosergio000000 000000 //NES-CNROM struct NES_CNROM : Board { struct Settings { bool mirror; //0 = horizontal, 1 = vertical } settings; uint2 chr_bank; uint8 prg_read(unsigned addr) { if(addr & 0x8000) return prgrom.read(addr & 0x7fff); return cpu.mdr(); } void prg_write(unsigned addr, uint8 data) { if(addr & 0x8000) chr_bank = data & 0x03; } uint8 chr_read(unsigned addr) { if(addr & 0x2000) { if(settings.mirror == 0) addr = ((addr & 0x0800) >> 1) | (addr & 0x03ff); return ppu.ciram_read(addr & 0x07ff); } addr = (chr_bank * 0x2000) + (addr & 0x1fff); return Board::chr_read(addr); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) { if(settings.mirror == 0) addr = ((addr & 0x0800) >> 1) | (addr & 0x03ff); return ppu.ciram_write(addr & 0x07ff, data); } addr = (chr_bank * 0x2000) + (addr & 0x1fff); Board::chr_write(addr, data); } void power() { } void reset() { chr_bank = 0; } void serialize(serializer& s) { Board::serialize(s); s.integer(chr_bank); } NES_CNROM(Markup::Node& document) : Board(document) { settings.mirror = document["cartridge"]["mirror"]["mode"].data == "vertical" ? 1 : 0; } }; phoenix/reference/action/check-item.cpp000664 001750 001750 00000000270 12651764221 021311 0ustar00sergiosergio000000 000000 namespace phoenix { void pCheckItem::setChecked(bool checked) { } void pCheckItem::setText(string text) { } void pCheckItem::constructor() { } void pCheckItem::destructor() { } } target-libretro/link.T000664 001750 001750 00000000046 12651764221 016100 0ustar00sergiosergio000000 000000 { global: retro_*; local: *; }; phoenix/reference/widget/vertical-slider.hpp000664 001750 001750 00000000515 12651764221 022406 0ustar00sergiosergio000000 000000 namespace phoenix { struct pVerticalSlider : public pWidget { VerticalSlider& verticalSlider; void setLength(unsigned length); void setPosition(unsigned position); pVerticalSlider(VerticalSlider& verticalSlider) : pWidget(verticalSlider), verticalSlider(verticalSlider) {} void constructor(); void destructor(); }; } nall/matrix.hpp000664 001750 001750 00000001456 12651764221 014661 0ustar00sergiosergio000000 000000 #ifndef NALL_MATRIX_HPP #define NALL_MATRIX_HPP namespace nall { namespace Matrix { template inline void Multiply(T* output, const T* xdata, unsigned xrows, unsigned xcols, const T* ydata, unsigned yrows, unsigned ycols) { if(xcols != yrows) return; for(unsigned y = 0; y < xrows; y++) { for(unsigned x = 0; x < ycols; x++) { T sum = 0; for(unsigned z = 0; z < xcols; z++) { sum += xdata[y * xcols + z] * ydata[z * ycols + x]; } *output++ = sum; } } } template inline vector Multiply(const T* xdata, unsigned xrows, unsigned xcols, const T* ydata, unsigned yrows, unsigned ycols) { vector output; output.resize(xrows * ycols); Multiply(output.data(), xdata, xrows, xcols, ydata, yrows, ycols); return output; } } } #endif obj/.gitignore000664 001750 001750 00000000004 12651764221 014444 0ustar00sergiosergio000000 000000 *.o target-ethos/tools/state-manager.cpp000664 001750 001750 00000010455 12651764221 020717 0ustar00sergiosergio000000 000000 StateManager* stateManager = nullptr; StateManager::StateManager() { stateList.setHeaderText({"Slot", "Description"}); stateList.setHeaderVisible(); for(unsigned n = 0; n < Slots; n++) stateList.append({format<2>(1 + n), "(empty)"}); stateList.autoSizeColumns(); descLabel.setText("Description:"); saveButton.setText("Save"); loadButton.setText("Load"); resetButton.setText("Reset"); eraseButton.setText("Erase"); append(stateList, {~0, ~0}, 5); append(descLayout, {~0, 0}, 5); descLayout.append(descLabel, {0, 0}, 5); descLayout.append(descEdit, {~0, 0}); append(controlLayout, {~0, 0}); controlLayout.append(saveButton, {80, 0}, 5); controlLayout.append(loadButton, {80, 0}, 5); controlLayout.append(spacer, {~0, 0}); controlLayout.append(resetButton, {80, 0}, 5); controlLayout.append(eraseButton, {80, 0}); stateList.onChange = {&StateManager::synchronize, this}; stateList.onActivate = {&StateManager::slotLoad, this}; descEdit.onChange = {&StateManager::slotSaveDescription, this}; saveButton.onActivate = {&StateManager::slotSave, this}; loadButton.onActivate = {&StateManager::slotLoad, this}; resetButton.onActivate = [&] { if(MessageWindow().setParent(*tools).setText("All states will be erased. Are you sure you want to do this?") .question() == MessageWindow::Response::Yes) reset(); }; eraseButton.onActivate = {&StateManager::slotErase, this}; stateList.setSelection(0); synchronize(); } void StateManager::synchronize() { setEnabled(program->active); descEdit.setText(""); descEdit.setEnabled(false); controlLayout.setEnabled(stateList.selected()); if(stateList.selected() == false) return; if(slot[stateList.selection()].capacity() > 0) { descEdit.setText(slotLoadDescription(stateList.selection())); descEdit.setEnabled(true); } } void StateManager::refresh() { for(unsigned n = 0; n < Slots; n++) { stateList.setText(n, {format<2>(1 + n), slotLoadDescription(n)}); } stateList.autoSizeColumns(); } void StateManager::reset() { for(auto& slot : this->slot) slot = serializer(); synchronize(); refresh(); } bool StateManager::load(string filename, unsigned revision) { for(auto& slot : this->slot) slot = serializer(); synchronize(); file fp; if(fp.open(filename, file::mode::read) == false) return false; if(fp.readl(4) == 0x31415342 /* 'BSA1' */ && fp.readl(4) == revision) { for(auto &slot : this->slot) { if(fp.read() == false) continue; //slot is empty unsigned size = fp.readl(4); uint8_t* data = new uint8_t[size]; fp.read(data, size); slot = serializer(data, size); delete[] data; } } refresh(); synchronize(); return true; } bool StateManager::save(string filename, unsigned revision) { bool hasSave = false; for(auto& slot : this->slot) hasSave |= slot.capacity() > 0; if(hasSave == false) { file::remove(filename); return true; } directory::create(dir(filename)); file fp; if(fp.open(filename, file::mode::write) == false) return false; fp.writel(0x31415342, 4); //'BSA1' fp.writel(revision, 4); for(auto& slot : this->slot) { fp.write(slot.capacity() > 0); if(slot.capacity()) { fp.writel(slot.capacity(), 4); fp.write(slot.data(), slot.capacity()); } } } void StateManager::slotLoad() { if(stateList.selected() == false) return; serializer s(slot[stateList.selection()].data(), slot[stateList.selection()].capacity()); system().unserialize(s); } void StateManager::slotSave() { if(stateList.selected()) { slot[stateList.selection()] = system().serialize(); } refresh(); synchronize(); descEdit.setFocused(); } void StateManager::slotErase() { if(stateList.selected()) { slot[stateList.selection()] = serializer(); } refresh(); synchronize(); } string StateManager::slotLoadDescription(unsigned id) { if(slot[id].capacity() == 0) return "(empty)"; char text[DescriptionLength]; strmcpy(text, (const char*)slot[id].data() + HeaderLength, DescriptionLength); return text; } void StateManager::slotSaveDescription() { if(stateList.selected() == false) return; string text = descEdit.text(); if(slot[stateList.selection()].capacity() > 0) { strmcpy((char*)slot[stateList.selection()].data() + HeaderLength, (const char*)text, DescriptionLength); } refresh(); } sfc/chip/superfx/core/core.hpp000664 001750 001750 00000000217 12651764221 017473 0ustar00sergiosergio000000 000000 void stop(); uint8 color(uint8 source); void plot(uint8 x, uint8 y); uint8 rpix(uint8 x, uint8 y); void pixelcache_flush(pixelcache_t& cache); ruby/video/xv.cpp000664 001750 001750 00000037611 12651764221 015150 0ustar00sergiosergio000000 000000 #include #include #include #include #include extern "C" XvImage* XvShmCreateImage(Display*, XvPortID, int, char*, int, int, XShmSegmentInfo*); namespace ruby { struct pVideoXv { uint32_t* buffer; uint8_t* ytable; uint8_t* utable; uint8_t* vtable; enum XvFormat { XvFormatRGB32, XvFormatRGB24, XvFormatRGB16, XvFormatRGB15, XvFormatYUY2, XvFormatUYVY, XvFormatUnknown }; struct { Display* display; GC gc; Window window; Colormap colormap; XShmSegmentInfo shminfo; int port; int depth; int visualid; XvImage* image; XvFormat format; uint32_t fourcc; unsigned width; unsigned height; } device; struct { Window handle; bool synchronize; unsigned width; unsigned height; } settings; bool cap(const string& name) { if(name == Video::Handle) return true; if(name == Video::Synchronize) { return XInternAtom(XOpenDisplay(0), "XV_SYNC_TO_VBLANK", true) != None; } return false; } any get(const string& name) { if(name == Video::Handle) return settings.handle; if(name == Video::Synchronize) return settings.synchronize; return false; } bool set(const string& name, const any& value) { if(name == Video::Handle) { settings.handle = any_cast(value); return true; } if(name == Video::Synchronize) { Display* display = XOpenDisplay(0); Atom atom = XInternAtom(display, "XV_SYNC_TO_VBLANK", true); if(atom != None && device.port >= 0) { settings.synchronize = any_cast(value); XvSetPortAttribute(display, device.port, atom, settings.synchronize); return true; } return false; } return false; } void resize(unsigned width, unsigned height) { if(device.width >= width && device.height >= height) return; device.width = max(width, device.width); device.height = max(height, device.height); XShmDetach(device.display, &device.shminfo); shmdt(device.shminfo.shmaddr); shmctl(device.shminfo.shmid, IPC_RMID, NULL); XFree(device.image); delete[] buffer; device.image = XvShmCreateImage(device.display, device.port, device.fourcc, 0, device.width, device.height, &device.shminfo); device.shminfo.shmid = shmget(IPC_PRIVATE, device.image->data_size, IPC_CREAT | 0777); device.shminfo.shmaddr = device.image->data = (char*)shmat(device.shminfo.shmid, 0, 0); device.shminfo.readOnly = false; XShmAttach(device.display, &device.shminfo); buffer = new uint32_t[device.width * device.height]; } bool lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) { if(width != settings.width || height != settings.height) { resize(settings.width = width, settings.height = height); } pitch = device.width * 4; return data = buffer; } void unlock() { } void clear() { memset(buffer, 0, device.width * device.height * sizeof(uint32_t)); //clear twice in case video is double buffered ... refresh(); refresh(); } void refresh() { unsigned width = settings.width; unsigned height = settings.height; XWindowAttributes target; XGetWindowAttributes(device.display, device.window, &target); //we must ensure that the child window is the same size as the parent window. //unfortunately, we cannot hook the parent window resize event notification, //as we did not create the parent window, nor have any knowledge of the toolkit used. //therefore, query each window size and resize as needed. XWindowAttributes parent; XGetWindowAttributes(device.display, settings.handle, &parent); if(target.width != parent.width || target.height != parent.height) { XResizeWindow(device.display, device.window, parent.width, parent.height); } //update target width and height attributes XGetWindowAttributes(device.display, device.window, &target); switch(device.format) { case XvFormatRGB32: render_rgb32(width, height); break; case XvFormatRGB24: render_rgb24(width, height); break; case XvFormatRGB16: render_rgb16(width, height); break; case XvFormatRGB15: render_rgb15(width, height); break; case XvFormatYUY2: render_yuy2 (width, height); break; case XvFormatUYVY: render_uyvy (width, height); break; } XvShmPutImage(device.display, device.port, device.window, device.gc, device.image, 0, 0, width, height, 0, 0, target.width, target.height, true); } bool init() { device.display = XOpenDisplay(0); if(!XShmQueryExtension(device.display)) { fprintf(stderr, "VideoXv: XShm extension not found.\n"); return false; } //find an appropriate Xv port device.port = -1; XvAdaptorInfo* adaptor_info; unsigned adaptor_count; XvQueryAdaptors(device.display, DefaultRootWindow(device.display), &adaptor_count, &adaptor_info); for(unsigned i = 0; i < adaptor_count; i++) { //find adaptor that supports both input (memory->drawable) and image (drawable->screen) masks if(adaptor_info[i].num_formats < 1) continue; if(!(adaptor_info[i].type & XvInputMask)) continue; if(!(adaptor_info[i].type & XvImageMask)) continue; device.port = adaptor_info[i].base_id; device.depth = adaptor_info[i].formats->depth; device.visualid = adaptor_info[i].formats->visual_id; break; } XvFreeAdaptorInfo(adaptor_info); if(device.port < 0) { fprintf(stderr, "VideoXv: failed to find valid XvPort.\n"); return false; } //create child window to attach to parent window. //this is so that even if parent window visual depth doesn't match Xv visual //(common with composited windows), Xv can still render to child window. XWindowAttributes window_attributes; XGetWindowAttributes(device.display, settings.handle, &window_attributes); XVisualInfo visualtemplate; visualtemplate.visualid = device.visualid; visualtemplate.screen = DefaultScreen(device.display); visualtemplate.depth = device.depth; visualtemplate.visual = 0; int visualmatches = 0; XVisualInfo *visualinfo = XGetVisualInfo(device.display, VisualIDMask | VisualScreenMask | VisualDepthMask, &visualtemplate, &visualmatches); if(visualmatches < 1 || !visualinfo->visual) { if(visualinfo) XFree(visualinfo); fprintf(stderr, "VideoXv: unable to find Xv-compatible visual.\n"); return false; } device.colormap = XCreateColormap(device.display, settings.handle, visualinfo->visual, AllocNone); XSetWindowAttributes attributes; attributes.colormap = device.colormap; attributes.border_pixel = 0; attributes.event_mask = StructureNotifyMask; device.window = XCreateWindow(device.display, /* parent = */ settings.handle, /* x = */ 0, /* y = */ 0, window_attributes.width, window_attributes.height, /* border_width = */ 0, device.depth, InputOutput, visualinfo->visual, CWColormap | CWBorderPixel | CWEventMask, &attributes); XFree(visualinfo); XSetWindowBackground(device.display, device.window, /* color = */ 0); XMapWindow(device.display, device.window); device.gc = XCreateGC(device.display, device.window, 0, 0); //set colorkey to auto paint, so that Xv video output is always visible Atom atom = XInternAtom(device.display, "XV_AUTOPAINT_COLORKEY", true); if(atom != None) XvSetPortAttribute(device.display, device.port, atom, 1); //find optimal rendering format device.format = XvFormatUnknown; signed format_count; XvImageFormatValues* format = XvListImageFormats(device.display, device.port, &format_count); if(device.format == XvFormatUnknown) for(signed i = 0; i < format_count; i++) { if(format[i].type == XvRGB && format[i].bits_per_pixel == 32) { device.format = XvFormatRGB32; device.fourcc = format[i].id; break; } } if(device.format == XvFormatUnknown) for(signed i = 0; i < format_count; i++) { if(format[i].type == XvRGB && format[i].bits_per_pixel == 24) { device.format = XvFormatRGB24; device.fourcc = format[i].id; break; } } if(device.format == XvFormatUnknown) for(signed i = 0; i < format_count; i++) { if(format[i].type == XvRGB && format[i].bits_per_pixel <= 16 && format[i].red_mask == 0xf800) { device.format = XvFormatRGB16; device.fourcc = format[i].id; break; } } if(device.format == XvFormatUnknown) for(signed i = 0; i < format_count; i++) { if(format[i].type == XvRGB && format[i].bits_per_pixel <= 16 && format[i].red_mask == 0x7c00) { device.format = XvFormatRGB15; device.fourcc = format[i].id; break; } } if(device.format == XvFormatUnknown) for(signed i = 0; i < format_count; i++) { if(format[i].type == XvYUV && format[i].bits_per_pixel == 16 && format[i].format == XvPacked) { if(format[i].component_order[0] == 'Y' && format[i].component_order[1] == 'U' && format[i].component_order[2] == 'Y' && format[i].component_order[3] == 'V' ) { device.format = XvFormatYUY2; device.fourcc = format[i].id; break; } } } if(device.format == XvFormatUnknown) for(signed i = 0; i < format_count; i++) { if(format[i].type == XvYUV && format[i].bits_per_pixel == 16 && format[i].format == XvPacked) { if(format[i].component_order[0] == 'U' && format[i].component_order[1] == 'Y' && format[i].component_order[2] == 'V' && format[i].component_order[3] == 'Y' ) { device.format = XvFormatUYVY; device.fourcc = format[i].id; break; } } } free(format); if(device.format == XvFormatUnknown) { fprintf(stderr, "VideoXv: unable to find a supported image format.\n"); return false; } device.width = 256; device.height = 256; device.image = XvShmCreateImage(device.display, device.port, device.fourcc, 0, device.width, device.height, &device.shminfo); if(!device.image) { fprintf(stderr, "VideoXv: XShmCreateImage failed.\n"); return false; } device.shminfo.shmid = shmget(IPC_PRIVATE, device.image->data_size, IPC_CREAT | 0777); device.shminfo.shmaddr = device.image->data = (char*)shmat(device.shminfo.shmid, 0, 0); device.shminfo.readOnly = false; if(!XShmAttach(device.display, &device.shminfo)) { fprintf(stderr, "VideoXv: XShmAttach failed.\n"); return false; } buffer = new uint32_t[device.width * device.height]; settings.width = 256; settings.height = 256; init_yuv_tables(); clear(); return true; } void term() { XShmDetach(device.display, &device.shminfo); shmdt(device.shminfo.shmaddr); shmctl(device.shminfo.shmid, IPC_RMID, NULL); XFree(device.image); if(device.window) { XUnmapWindow(device.display, device.window); device.window = 0; } if(device.colormap) { XFreeColormap(device.display, device.colormap); device.colormap = 0; } if(buffer) { delete[] buffer; buffer = 0; } if(ytable) { delete[] ytable; ytable = 0; } if(utable) { delete[] utable; utable = 0; } if(vtable) { delete[] vtable; vtable = 0; } } void render_rgb32(unsigned width, unsigned height) { uint32_t* input = (uint32_t*)buffer; uint32_t* output = (uint32_t*)device.image->data; for(unsigned y = 0; y < height; y++) { memcpy(output, input, width * 4); input += device.width; output += device.width; } } void render_rgb24(unsigned width, unsigned height) { uint32_t* input = (uint32_t*)buffer; uint8_t* output = (uint8_t*)device.image->data; for(unsigned y = 0; y < height; y++) { for(unsigned x = 0; x < width; x++) { uint32_t p = *input++; *output++ = p; *output++ = p >> 8; *output++ = p >> 16; } input += (device.width - width); output += (device.width - width) * 3; } } void render_rgb16(unsigned width, unsigned height) { uint32_t* input = (uint32_t*)buffer; uint16_t* output = (uint16_t*)device.image->data; for(unsigned y = 0; y < height; y++) { for(unsigned x = 0; x < width; x++) { uint32_t p = *input++; *output++ = ((p >> 8) & 0xf800) | ((p >> 5) & 0x07e0) | ((p >> 3) & 0x001f); //RGB32->RGB16 } input += device.width - width; output += device.width - width; } } void render_rgb15(unsigned width, unsigned height) { uint32_t* input = (uint32_t*)buffer; uint16_t* output = (uint16_t*)device.image->data; for(unsigned y = 0; y < height; y++) { for(unsigned x = 0; x < width; x++) { uint32_t p = *input++; *output++ = ((p >> 9) & 0x7c00) | ((p >> 6) & 0x03e0) | ((p >> 3) & 0x001f); //RGB32->RGB15 } input += device.width - width; output += device.width - width; } } void render_yuy2(unsigned width, unsigned height) { uint32_t* input = (uint32_t*)buffer; uint16_t* output = (uint16_t*)device.image->data; for(unsigned y = 0; y < height; y++) { for(unsigned x = 0; x < width >> 1; x++) { uint32_t p0 = *input++; uint32_t p1 = *input++; p0 = ((p0 >> 8) & 0xf800) + ((p0 >> 5) & 0x07e0) + ((p0 >> 3) & 0x001f); //RGB32->RGB16 p1 = ((p1 >> 8) & 0xf800) + ((p1 >> 5) & 0x07e0) + ((p1 >> 3) & 0x001f); //RGB32->RGB16 uint8_t u = (utable[p0] + utable[p1]) >> 1; uint8_t v = (vtable[p0] + vtable[p1]) >> 1; *output++ = (u << 8) | ytable[p0]; *output++ = (v << 8) | ytable[p1]; } input += device.width - width; output += device.width - width; } } void render_uyvy(unsigned width, unsigned height) { uint32_t* input = (uint32_t*)buffer; uint16_t* output = (uint16_t*)device.image->data; for(unsigned y = 0; y < height; y++) { for(unsigned x = 0; x < width >> 1; x++) { uint32_t p0 = *input++; uint32_t p1 = *input++; p0 = ((p0 >> 8) & 0xf800) + ((p0 >> 5) & 0x07e0) + ((p0 >> 3) & 0x001f); p1 = ((p1 >> 8) & 0xf800) + ((p1 >> 5) & 0x07e0) + ((p1 >> 3) & 0x001f); uint8_t u = (utable[p0] + utable[p1]) >> 1; uint8_t v = (vtable[p0] + vtable[p1]) >> 1; *output++ = (ytable[p0] << 8) | u; *output++ = (ytable[p1] << 8) | v; } input += device.width - width; output += device.width - width; } } void init_yuv_tables() { ytable = new uint8_t[65536]; utable = new uint8_t[65536]; vtable = new uint8_t[65536]; for(unsigned i = 0; i < 65536; i++) { //extract RGB565 color data from i uint8_t r = (i >> 11) & 31, g = (i >> 5) & 63, b = (i) & 31; r = (r << 3) | (r >> 2); //R5->R8 g = (g << 2) | (g >> 4); //G6->G8 b = (b << 3) | (b >> 2); //B5->B8 //ITU-R Recommendation BT.601 //double lr = 0.299, lg = 0.587, lb = 0.114; int y = int( +(double(r) * 0.257) + (double(g) * 0.504) + (double(b) * 0.098) + 16.0 ); int u = int( -(double(r) * 0.148) - (double(g) * 0.291) + (double(b) * 0.439) + 128.0 ); int v = int( +(double(r) * 0.439) - (double(g) * 0.368) - (double(b) * 0.071) + 128.0 ); //ITU-R Recommendation BT.709 //double lr = 0.2126, lg = 0.7152, lb = 0.0722; //int y = int( double(r) * lr + double(g) * lg + double(b) * lb ); //int u = int( (double(b) - y) / (2.0 - 2.0 * lb) + 128.0 ); //int v = int( (double(r) - y) / (2.0 - 2.0 * lr) + 128.0 ); ytable[i] = y < 0 ? 0 : y > 255 ? 255 : y; utable[i] = u < 0 ? 0 : u > 255 ? 255 : u; vtable[i] = v < 0 ? 0 : v > 255 ? 255 : v; } } pVideoXv() { device.window = 0; device.colormap = 0; device.port = -1; ytable = 0; utable = 0; vtable = 0; settings.handle = 0; settings.synchronize = false; } ~pVideoXv() { term(); } }; DeclareVideo(Xv) }; phoenix/qt/widget/line-edit.cpp000664 001750 001750 00000002110 12651764221 017641 0ustar00sergiosergio000000 000000 namespace phoenix { Size pLineEdit::minimumSize() { Size size = pFont::size(qtWidget->font(), lineEdit.state.text); return {size.width + 12, size.height + 12}; } void pLineEdit::setEditable(bool editable) { qtLineEdit->setReadOnly(!editable); } void pLineEdit::setText(string text) { qtLineEdit->setText(QString::fromUtf8(text)); } string pLineEdit::text() { return qtLineEdit->text().toUtf8().constData(); } void pLineEdit::constructor() { qtWidget = qtLineEdit = new QLineEdit; connect(qtLineEdit, SIGNAL(returnPressed()), SLOT(onActivate())); connect(qtLineEdit, SIGNAL(textEdited(const QString&)), SLOT(onChange())); pWidget::synchronizeState(); setEditable(lineEdit.state.editable); setText(lineEdit.state.text); } void pLineEdit::destructor() { delete qtLineEdit; qtWidget = qtLineEdit = nullptr; } void pLineEdit::orphan() { destructor(); constructor(); } void pLineEdit::onActivate() { if(lineEdit.onActivate) lineEdit.onActivate(); } void pLineEdit::onChange() { lineEdit.state.text = text(); if(lineEdit.onChange) lineEdit.onChange(); } } sfc/smp/000700 001750 001750 00000000000 12656700342 013245 5ustar00sergiosergio000000 000000 sfc/chip/dsp2/opcodes.cpp000664 001750 001750 00000011373 12651764221 016423 0ustar00sergiosergio000000 000000 #ifdef DSP2_CPP //convert bitmap to bitplane tile void DSP2::op01() { //op01 size is always 32 bytes input and output //the hardware does strange things if you vary the size unsigned char c0, c1, c2, c3; unsigned char *p1 = status.parameters; unsigned char *p2a = status.output; unsigned char *p2b = status.output + 16; //halfway //process 8 blocks of 4 bytes each for(int j = 0; j < 8; j++) { c0 = *p1++; c1 = *p1++; c2 = *p1++; c3 = *p1++; *p2a++ = (c0 & 0x10) << 3 | (c0 & 0x01) << 6 | (c1 & 0x10) << 1 | (c1 & 0x01) << 4 | (c2 & 0x10) >> 1 | (c2 & 0x01) << 2 | (c3 & 0x10) >> 3 | (c3 & 0x01); *p2a++ = (c0 & 0x20) << 2 | (c0 & 0x02) << 5 | (c1 & 0x20) | (c1 & 0x02) << 3 | (c2 & 0x20) >> 2 | (c2 & 0x02) << 1 | (c3 & 0x20) >> 4 | (c3 & 0x02) >> 1; *p2b++ = (c0 & 0x40) << 1 | (c0 & 0x04) << 4 | (c1 & 0x40) >> 1 | (c1 & 0x04) << 2 | (c2 & 0x40) >> 3 | (c2 & 0x04) | (c3 & 0x40) >> 5 | (c3 & 0x04) >> 2; *p2b++ = (c0 & 0x80) | (c0 & 0x08) << 3 | (c1 & 0x80) >> 2 | (c1 & 0x08) << 1 | (c2 & 0x80) >> 4 | (c2 & 0x08) >> 1 | (c3 & 0x80) >> 6 | (c3 & 0x08) >> 3; } } //set transparent color void DSP2::op03() { status.op05transparent = status.parameters[0]; } //replace bitmap using transparent color void DSP2::op05() { uint8 color; // Overlay bitmap with transparency. // Input: // // Bitmap 1: i[0] <=> i[size-1] // Bitmap 2: i[size] <=> i[2*size-1] // // Output: // // Bitmap 3: o[0] <=> o[size-1] // // Processing: // // Process all 4-bit pixels (nibbles) in the bitmap // // if ( BM2_pixel == transparent_color ) // pixelout = BM1_pixel // else // pixelout = BM2_pixel // The max size bitmap is limited to 255 because the size parameter is a byte // I think size=0 is an error. The behavior of the chip on size=0 is to // return the last value written to DR if you read DR on Op05 with // size = 0. I don't think it's worth implementing this quirk unless it's // proven necessary. unsigned char c1, c2; unsigned char *p1 = status.parameters; unsigned char *p2 = status.parameters + status.op05len; unsigned char *p3 = status.output; color = status.op05transparent & 0x0f; for(int n = 0; n < status.op05len; n++) { c1 = *p1++; c2 = *p2++; *p3++ = ( ((c2 >> 4) == color ) ? c1 & 0xf0 : c2 & 0xf0 ) | ( ((c2 & 0x0f) == color ) ? c1 & 0x0f : c2 & 0x0f ); } } //reverse bitmap void DSP2::op06() { // Input: // size // bitmap int i, j; for(i = 0, j = status.op06len - 1; i < status.op06len; i++, j--) { status.output[j] = (status.parameters[i] << 4) | (status.parameters[i] >> 4); } } //multiply void DSP2::op09() { status.out_count = 4; status.op09word1 = status.parameters[0] | (status.parameters[1] << 8); status.op09word2 = status.parameters[2] | (status.parameters[3] << 8); uint32 r; r = status.op09word1 * status.op09word2; status.output[0] = r; status.output[1] = r >> 8; status.output[2] = r >> 16; status.output[3] = r >> 24; } //scale bitmap void DSP2::op0d() { // Bit accurate hardware algorithm - uses fixed point math // This should match the DSP2 Op0D output exactly // I wouldn't recommend using this unless you're doing hardware debug. // In some situations it has small visual artifacts that // are not readily apparent on a TV screen but show up clearly // on a monitor. Use Overload's scaling instead. // This is for hardware verification testing. // // One note: the HW can do odd byte scaling but since we divide // by two to get the count of bytes this won't work well for // odd byte scaling (in any of the current algorithm implementations). // So far I haven't seen Dungeon Master use it. // If it does we can adjust the parameters and code to work with it uint32 multiplier; // Any size int >= 32-bits uint32 pixloc; // match size of multiplier int i, j; uint8 pixelarray[512]; if(status.op0dinlen <= status.op0doutlen) { multiplier = 0x10000; // In our self defined fixed point 0x10000 == 1 } else { multiplier = (status.op0dinlen << 17) / ((status.op0doutlen << 1) + 1); } pixloc = 0; for(i = 0; i < status.op0doutlen * 2; i++) { j = pixloc >> 16; if(j & 1) { pixelarray[i] = (status.parameters[j >> 1] & 0x0f); } else { pixelarray[i] = (status.parameters[j >> 1] & 0xf0) >> 4; } pixloc += multiplier; } for(i = 0; i < status.op0doutlen; i++) { status.output[i] = (pixelarray[i << 1] << 4) | pixelarray[(i << 1) + 1]; } } #endif phoenix/reference/widget/sizable.hpp000664 001750 001750 00000000230 12651764221 020740 0ustar00sergiosergio000000 000000 namespace phoenix { struct pSizable : public pObject { Sizable& sizable; pSizable(Sizable& sizable) : pObject(sizable), sizable(sizable) {} }; } phoenix/gtk/widget/line-edit.cpp000664 001750 001750 00000002313 12651764221 020007 0ustar00sergiosergio000000 000000 namespace phoenix { static void LineEdit_activate(LineEdit* self) { if(self->onActivate) self->onActivate(); } static void LineEdit_change(LineEdit* self) { self->state.text = self->text(); if(self->p.locked == false && self->onChange) self->onChange(); } Size pLineEdit::minimumSize() { Size size = pFont::size(widget.state.font, lineEdit.state.text); return {size.width + 10, size.height + 10}; } void pLineEdit::setEditable(bool editable) { gtk_editable_set_editable(GTK_EDITABLE(gtkWidget), editable); } void pLineEdit::setText(string text) { locked = true; gtk_entry_set_text(GTK_ENTRY(gtkWidget), text); locked = false; } string pLineEdit::text() { return gtk_entry_get_text(GTK_ENTRY(gtkWidget)); } void pLineEdit::constructor() { gtkWidget = gtk_entry_new(); g_signal_connect_swapped(G_OBJECT(gtkWidget), "activate", G_CALLBACK(LineEdit_activate), (gpointer)&lineEdit); g_signal_connect_swapped(G_OBJECT(gtkWidget), "changed", G_CALLBACK(LineEdit_change), (gpointer)&lineEdit); setEditable(lineEdit.state.editable); setText(lineEdit.state.text); } void pLineEdit::destructor() { gtk_widget_destroy(gtkWidget); } void pLineEdit::orphan() { destructor(); constructor(); } } phoenix/windows/widget/progress-bar.cpp000664 001750 001750 00000001323 12651764221 021450 0ustar00sergiosergio000000 000000 namespace phoenix { Size pProgressBar::minimumSize() { return {0, 23}; } void pProgressBar::setPosition(unsigned position) { SendMessage(hwnd, PBM_SETPOS, (WPARAM)position, 0); } void pProgressBar::constructor() { hwnd = CreateWindow(PROGRESS_CLASS, L"", WS_CHILD | PBS_SMOOTH, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&progressBar); SendMessage(hwnd, PBM_SETRANGE, 0, MAKELPARAM(0, 100)); SendMessage(hwnd, PBM_SETSTEP, MAKEWPARAM(1, 0), 0); setPosition(progressBar.state.position); synchronize(); } void pProgressBar::destructor() { DestroyWindow(hwnd); } void pProgressBar::orphan() { destructor(); constructor(); } } phoenix/qt/timer.cpp000664 001750 001750 00000000750 12651764221 015634 0ustar00sergiosergio000000 000000 namespace phoenix { void pTimer::setEnabled(bool enabled) { if(enabled) { qtTimer->start(); } else { qtTimer->stop(); } } void pTimer::setInterval(unsigned interval) { qtTimer->setInterval(interval); } void pTimer::constructor() { qtTimer = new QTimer; qtTimer->setInterval(0); connect(qtTimer, SIGNAL(timeout()), SLOT(onActivate())); } void pTimer::destructor() { delete qtTimer; } void pTimer::onActivate() { if(timer.onActivate) timer.onActivate(); } } gb/ppu/ppu.cpp000664 001750 001750 00000007660 12651764221 014425 0ustar00sergiosergio000000 000000 #include //LY = 0-153 //Raster = 0-143 //Vblank = 144-153 //LX = 0-455 #define PPU_CPP namespace GameBoy { #include "mmio.cpp" #include "dmg.cpp" #include "cgb.cpp" #include "serialization.cpp" PPU ppu; void PPU::Main() { ppu.main(); } void PPU::main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(status.display_enable && status.ly < 144) { if(status.interrupt_oam) cpu.interrupt_raise(CPU::Interrupt::Stat); add_clocks(92); for(unsigned n = 0; n < 160; n++) { system.cgb() ? cgb_run() : dmg_run(); add_clocks(1); } if(status.interrupt_hblank) cpu.interrupt_raise(CPU::Interrupt::Stat); cpu.hblank(); add_clocks(204); } else { add_clocks(456); } scanline(); } } void PPU::add_clocks(unsigned clocks) { status.lx += clocks; clock += clocks * cpu.frequency; if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) { co_switch(scheduler.active_thread = cpu.thread); } } void PPU::scanline() { status.lx = 0; if(++status.ly == 154) frame(); if(status.ly < 144) { interface->lcdScanline(); //Super Game Boy rendering notification system.cgb() ? cgb_scanline() : dmg_scanline(); } if(status.display_enable && status.interrupt_lyc == true) { if(status.ly == status.lyc) cpu.interrupt_raise(CPU::Interrupt::Stat); } if(status.display_enable && status.ly == 144) { cpu.interrupt_raise(CPU::Interrupt::Vblank); if(status.interrupt_vblank) cpu.interrupt_raise(CPU::Interrupt::Stat); } } void PPU::frame() { status.ly = 0; scheduler.exit(Scheduler::ExitReason::FrameEvent); } unsigned PPU::hflip(unsigned data) const { return ((data & 0x8080) >> 7) | ((data & 0x4040) >> 5) | ((data & 0x2020) >> 3) | ((data & 0x1010) >> 1) | ((data & 0x0808) << 1) | ((data & 0x0404) << 3) | ((data & 0x0202) << 5) | ((data & 0x0101) << 7); } void PPU::power() { create(Main, 4 * 1024 * 1024); for(unsigned n = 0x8000; n <= 0x9fff; n++) bus.mmio[n] = this; //VRAM for(unsigned n = 0xfe00; n <= 0xfe9f; n++) bus.mmio[n] = this; //OAM bus.mmio[0xff40] = this; //LCDC bus.mmio[0xff41] = this; //STAT bus.mmio[0xff42] = this; //SCY bus.mmio[0xff43] = this; //SCX bus.mmio[0xff44] = this; //LY bus.mmio[0xff45] = this; //LYC bus.mmio[0xff47] = this; //BGP bus.mmio[0xff48] = this; //OBP0 bus.mmio[0xff49] = this; //OBP1 bus.mmio[0xff4a] = this; //WY bus.mmio[0xff4b] = this; //WX if(system.cgb()) { bus.mmio[0xff4f] = this; //VBK bus.mmio[0xff68] = this; //BGPI bus.mmio[0xff69] = this; //BGPD bus.mmio[0xff6a] = this; //OBPI bus.mmio[0xff6b] = this; //OBPD } for(auto& n : vram) n = 0x00; for(auto& n : oam) n = 0x00; for(auto& n : bgp) n = 0x00; for(auto& n : obp[0]) n = 0x00; for(auto& n : obp[1]) n = 0x00; for(auto& n : bgpd) n = 0x0000; for(auto& n : obpd) n = 0x0000; status.lx = 0; status.display_enable = 0; status.window_tilemap_select = 0; status.window_display_enable = 0; status.bg_tiledata_select = 0; status.bg_tilemap_select = 0; status.ob_size = 0; status.ob_enable = 0; status.bg_enable = 0; status.interrupt_lyc = 0; status.interrupt_oam = 0; status.interrupt_vblank = 0; status.interrupt_hblank = 0; status.scy = 0; status.scx = 0; status.ly = 0; status.lyc = 0; status.wy = 0; status.wx = 0; status.vram_bank = 0; status.bgpi_increment = 0; status.bgpi = 0; status.obpi_increment = 0; status.obpi = 0; for(auto& n : screen) n = 0x0000; bg.color = 0; bg.palette = 0; bg.priority = 0; ob.color = 0; ob.palette = 0; ob.priority = 0; for(auto& s : sprite) { s.x = 0; s.y = 0; s.tile = 0; s.attr = 0; s.data = 0; } sprites = 0; background.attr = 0; background.data = 0; window.attr = 0; window.data = 0; } PPU::PPU() { } } fc/cartridge/board/nes-pxrom.cpp000664 001750 001750 00000004577 12651764221 020004 0ustar00sergiosergio000000 000000 //MMC2 struct NES_PxROM : Board { enum Revision : unsigned { PEEOROM, PNROM, } revision; uint4 prg_bank; uint5 chr_bank[2][2]; bool mirror; bool latch[2]; uint8 prg_read(unsigned addr) { if(addr < 0x6000) return cpu.mdr(); if(addr < 0x8000) return prgram.read(addr); unsigned bank = 0; switch((addr / 0x2000) & 3) { case 0: bank = prg_bank; break; case 1: bank = 0x0d; break; case 2: bank = 0x0e; break; case 3: bank = 0x0f; break; } return prgrom.read((bank * 0x2000) | (addr & 0x1fff)); } void prg_write(unsigned addr, uint8 data) { if(addr < 0x6000) return; if(addr < 0x8000) return prgram.write(addr, data); switch(addr & 0xf000) { case 0xa000: prg_bank = data & 0x0f; break; case 0xb000: chr_bank[0][0] = data & 0x1f; break; case 0xc000: chr_bank[0][1] = data & 0x1f; break; case 0xd000: chr_bank[1][0] = data & 0x1f; break; case 0xe000: chr_bank[1][1] = data & 0x1f; break; case 0xf000: mirror = data & 0x01; break; } } unsigned ciram_addr(unsigned addr) const { switch(mirror) { case 0: return ((addr & 0x0400) >> 0) | (addr & 0x03ff); //vertical mirroring case 1: return ((addr & 0x0800) >> 1) | (addr & 0x03ff); //horizontal mirroring } } uint8 chr_read(unsigned addr) { if(addr & 0x2000) return ppu.ciram_read(ciram_addr(addr)); bool region = addr & 0x1000; unsigned bank = chr_bank[region][latch[region]]; if((addr & 0x0ff8) == 0x0fd8) latch[region] = 0; if((addr & 0x0ff8) == 0x0fe8) latch[region] = 1; return Board::chr_read((bank * 0x1000) | (addr & 0x0fff)); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) return ppu.ciram_write(ciram_addr(addr), data); bool region = addr & 0x1000; unsigned bank = chr_bank[region][latch[region]]; if((addr & 0x0ff8) == 0x0fd8) latch[region] = 0; if((addr & 0x0ff8) == 0x0fe8) latch[region] = 1; return Board::chr_write((bank * 0x1000) | (addr & 0x0fff), data); } void power() { } void reset() { prg_bank = 0; chr_bank[0][0] = 0; chr_bank[0][1] = 0; chr_bank[1][0] = 0; chr_bank[1][1] = 0; mirror = 0; latch[0] = 0; latch[1] = 0; } void serialize(serializer& s) { Board::serialize(s); s.integer(prg_bank); s.integer(chr_bank[0][0]); s.integer(chr_bank[0][1]); s.integer(chr_bank[1][0]); s.integer(chr_bank[1][1]); s.integer(mirror); s.array(latch); } NES_PxROM(Markup::Node& document) : Board(document) { revision = Revision::PNROM; } }; phoenix/gtk/widget/label.cpp000664 001750 001750 00000001010 12651764221 017205 0ustar00sergiosergio000000 000000 namespace phoenix { Size pLabel::minimumSize() { Size size = pFont::size(widget.state.font, label.state.text); return {size.width, size.height}; } void pLabel::setText(string text) { gtk_label_set_text(GTK_LABEL(gtkWidget), text); } void pLabel::constructor() { gtkWidget = gtk_label_new(""); gtk_misc_set_alignment(GTK_MISC(gtkWidget), 0.0, 0.5); setText(label.state.text); } void pLabel::destructor() { gtk_widget_destroy(gtkWidget); } void pLabel::orphan() { destructor(); constructor(); } } phoenix/cocoa/action/item.cpp000664 001750 001750 00000001555 12651764221 017373 0ustar00sergiosergio000000 000000 @implementation CocoaItem : NSMenuItem -(id) initWith:(phoenix::Item&)itemReference { if(self = [super initWithTitle:@"" action:@selector(activate) keyEquivalent:@""]) { item = &itemReference; [self setTarget:self]; } return self; } -(void) activate { if(item->onActivate) item->onActivate(); } @end namespace phoenix { void pItem::setImage(const image& image) { @autoreleasepool { unsigned size = 15; //there is no API to retrieve the optimal size [cocoaAction setImage:NSMakeImage(image, size, size)]; } } void pItem::setText(string text) { @autoreleasepool { [cocoaAction setTitle:[NSString stringWithUTF8String:text]]; } } void pItem::constructor() { @autoreleasepool { cocoaAction = cocoaItem = [[CocoaItem alloc] initWith:item]; } } void pItem::destructor() { @autoreleasepool { [cocoaAction release]; } } } phoenix/qt/widget/label.cpp000664 001750 001750 00000000773 12651764221 017063 0ustar00sergiosergio000000 000000 namespace phoenix { Size pLabel::minimumSize() { Size size = pFont::size(qtWidget->font(), label.state.text); return {size.width, size.height}; } void pLabel::setText(string text) { qtLabel->setText(QString::fromUtf8(text)); } void pLabel::constructor() { qtWidget = qtLabel = new QLabel; pWidget::synchronizeState(); setText(label.state.text); } void pLabel::destructor() { delete qtLabel; qtWidget = qtLabel = nullptr; } void pLabel::orphan() { destructor(); constructor(); } } ruby/input/xlib.cpp000664 001750 001750 00000002622 12651764221 015474 0ustar00sergiosergio000000 000000 #include #include #include #include #include #include "keyboard/xlib.cpp" #include "mouse/xlib.cpp" namespace ruby { struct pInputXlib { InputKeyboardXlib xlibKeyboard; InputMouseXlib xlibMouse; struct Settings { uintptr_t handle = 0; } settings; bool cap(const string& name) { if(name == Input::KeyboardSupport) return true; if(name == Input::MouseSupport) return true; return false; } any get(const string& name) { if(name == Input::Handle) return (uintptr_t)settings.handle; return false; } bool set(const string& name, const any &value) { if(name == Input::Handle) { settings.handle = any_cast(value); return true; } return false; } bool acquire() { return xlibMouse.acquire(); } bool unacquire() { return xlibMouse.unacquire(); } bool acquired() { return xlibMouse.acquired(); } vector poll() { vector devices; xlibKeyboard.poll(devices); xlibMouse.poll(devices); return devices; } bool rumble(uint64_t id, bool enable) { return false; } bool init() { if(xlibKeyboard.init() == false) return false; if(xlibMouse.init(settings.handle) == false) return false; return true; } void term() { xlibKeyboard.term(); xlibMouse.term(); } }; DeclareInput(Xlib) } phoenix/reference/widget/button.cpp000664 001750 001750 00000000311 12651764221 020615 0ustar00sergiosergio000000 000000 namespace phoenix { void pButton::setImage(const image& image, Orientation orientation) { } void pButton::setText(string text) { } void pButton::constructor() { } void pButton::destructor() { } } sfc/chip/icd2/serialization.cpp000664 001750 001750 00000001365 12651764221 017615 0ustar00sergiosergio000000 000000 #ifdef ICD2_CPP void ICD2::serialize(serializer& s) { Thread::serialize(s); GameBoy::system.serialize_all(s); for(unsigned n = 0; n < 64; n++) s.array(packet[n].data); s.integer(packetsize); s.integer(joyp_id); s.integer(joyp15lock); s.integer(joyp14lock); s.integer(pulselock); s.integer(strobelock); s.integer(packetlock); s.array(joyp_packet.data); s.integer(packetoffset); s.integer(bitdata); s.integer(bitoffset); s.integer(r6000_ly); s.integer(r6000_row); s.integer(r6001); s.integer(r6003); s.integer(r6004); s.integer(r6005); s.integer(r6006); s.integer(r6007); s.array(r7000); s.integer(r7800); s.integer(mlt_req); s.array(lcd.buffer); s.array(lcd.output); s.integer(lcd.row); } #endif sfc/chip/event/event.cpp000664 001750 001750 00000011526 12651764221 016361 0ustar00sergiosergio000000 000000 #include #define EVENT_CPP namespace SuperFamicom { Event event; void Event::Enter() { event.enter(); } void Event::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(scoreActive && scoreSecondsRemaining) { if(--scoreSecondsRemaining == 0) { scoreActive = false; submitScore(); } } if(timerActive && timerSecondsRemaining) { if(--timerSecondsRemaining == 0) { timerActive = false; status |= 0x02; //time over scoreActive = true; scoreSecondsRemaining = 5; } } step(1); synchronize_cpu(); } } void Event::submitScore() { if(usedSaveState) return; string data; data.append("timer:", timer, "\n"); if(board == Board::CampusChallenge92) { unsigned mw = 0, fz = 0, pw = 0; for(unsigned n = 0x0408; n <= 0x040e; n++) mw = mw * 10 + ram.read(n); for(unsigned n = 0x0413; n >= 0x0410; n--) fz = fz * 10 + ram.read(n); for(unsigned n = 0x0418; n >= 0x0415; n--) pw = pw * 10 + ram.read(n); data.append("mw:", mw, "\n"); data.append("fz:", fz, "\n"); data.append("pw:", pw, "\n"); } if(board == Board::Powerfest94) { unsigned ml = 0, mk[2] = {0}, ba[2] = {0}; for(unsigned n = 0x0408; n <= 0x040e; n++) ml = ml * 10 + ram.read(n); for(unsigned n = 0x0413; n >= 0x0412; n--) mk[0] = mk[0] * 10 + ram.read(n); for(unsigned n = 0x0411; n >= 0x0410; n--) mk[1] = mk[1] * 10 + ram.read(n); for(unsigned n = 0x0418; n >= 0x0415; n--) ba[0] = ba[0] * 10 + ram.read(n); for(unsigned n = 0x041a; n >= 0x0419; n--) ba[1] = ba[1] * 10 + ram.read(n); data.append("ml:", ml, "\n"); data.append("mk:", mk[0], ",", mk[1], "\n"); data.append("ba:", ba[0], ",", ba[1], "\n"); } lstring side = interface->server().split<1>("@"); string username = side(0).split<1>(":")(0); string password = side(0).split<1>(":")(1); side(1).ltrim<1>("http://"); string hostname = side(1).split<1>("/")(0); string hostpath = side(1).split<1>("/")(1); side = hostname.split<1>(":"); hostname = side(0); string hostport = side(1); if(hostport.empty()) hostport = "80"; http server; if(server.connect(hostname, decimal(hostport))) { string content = { "username:", username, "\n", "password:", password, "\n", "emulator:bsnes\n", "sha256:", interface->sha256(), "\n", "\n", data }; string packet = { "POST /", hostpath, " HTTP/1.0\r\n", "Host: ", hostname, "\r\n", "Connection: close\r\n", "Content-Type: application/octet-stream\r\n", "Content-Length: ", content.length(), "\r\n", "\r\n", content }; server.send(packet); server.disconnect(); } } void Event::init() { } void Event::load() { } void Event::unload() { rom[0].reset(); rom[1].reset(); rom[2].reset(); rom[3].reset(); ram.reset(); } void Event::power() { usedSaveState = false; } void Event::reset() { create(Event::Enter, 1); for(unsigned n = 0; n < ram.size(); n++) ram.write(n, 0x00); status = 0x00; select = 0x00; timerActive = false; scoreActive = false; timerSecondsRemaining = 0; scoreSecondsRemaining = 0; usedSaveState = false; } uint8 Event::sr(unsigned) { return status; } void Event::dr(unsigned, uint8 data) { select = data; if(timer && data == 0x09) { timerActive = true; timerSecondsRemaining = timer; } } uint8 Event::rom_read(unsigned addr) { if(board == Board::CampusChallenge92) { unsigned id = 0; if(select == 0x09) id = 1; if(select == 0x05) id = 2; if(select == 0x03) id = 3; if((addr & 0x808000) == 0x808000) id = 0; if(addr & 0x008000) { addr = ((addr & 0x7f0000) >> 1) | (addr & 0x7fff); return rom[id].read(bus.mirror(addr, rom[id].size())); } } if(board == Board::Powerfest94) { unsigned id = 0; if(select == 0x09) id = 1; if(select == 0x0c) id = 2; if(select == 0x0a) id = 3; if((addr & 0x208000) == 0x208000) id = 0; if(addr & 0x400000) { addr &= 0x3fffff; return rom[id].read(bus.mirror(addr, rom[id].size())); } if(addr & 0x008000) { addr &= 0x1fffff; if(id != 2) addr = ((addr & 0x1f0000) >> 1) | (addr & 0x7fff); return rom[id].read(bus.mirror(addr, rom[id].size())); } } return cpu.regs.mdr; } uint8 Event::ram_read(unsigned addr) { return ram.read(bus.mirror(addr, ram.size())); } void Event::ram_write(unsigned addr, uint8 data) { return ram.write(bus.mirror(addr, ram.size()), data); } void Event::serialize(serializer& s) { Thread::serialize(s); s.array(ram.data(), ram.size()); s.integer(status); s.integer(select); s.integer(timerActive); s.integer(scoreActive); s.integer(timerSecondsRemaining); s.integer(scoreSecondsRemaining); usedSaveState = true; } } sfc/chip/sharprtc/serialization.cpp000664 001750 001750 00000000452 12651764221 020616 0ustar00sergiosergio000000 000000 #ifdef SHARPRTC_CPP void SharpRTC::serialize(serializer& s) { Thread::serialize(s); s.integer((unsigned&)rtc_state); s.integer(rtc_index); s.integer(second); s.integer(minute); s.integer(hour); s.integer(day); s.integer(month); s.integer(year); s.integer(weekday); } #endif sfc/chip/superfx/disassembler/disassembler.hpp000664 001750 001750 00000000273 12651764221 022747 0ustar00sergiosergio000000 000000 void disassemble_opcode(char* output); void disassemble_alt0(char* output); void disassemble_alt1(char* output); void disassemble_alt2(char* output); void disassemble_alt3(char* output); phoenix/core/layout/fixed-layout.cpp000664 001750 001750 00000003577 12651764221 020761 0ustar00sergiosergio000000 000000 void FixedLayout::append(Sizable& sizable, Geometry geometry) { children.append({&sizable, geometry}); synchronizeLayout(); if(window()) window()->synchronizeLayout(); } void FixedLayout::append(Sizable& sizable) { for(auto& child : children) if(child.sizable == &sizable) return; Layout::append(sizable); if(window()) window()->synchronizeLayout(); } Size FixedLayout::minimumSize() { unsigned width = Size::Minimum, height = Size::Minimum; for(auto& child : children) { width = max(width, child.sizable->minimumSize().width); height = max(height, child.sizable->minimumSize().height); } return {width, height}; } void FixedLayout::remove(Sizable& sizable) { for(unsigned n = 0; n < children.size(); n++) { if(children[n].sizable == &sizable) { children.remove(n); Layout::remove(sizable); if(window()) window()->synchronizeLayout(); break; } } } void FixedLayout::reset() { for(auto& child : children) { if(window() && dynamic_cast(child.sizable)) window()->remove((Widget&)*child.sizable); } } void FixedLayout::setEnabled(bool enabled) { Sizable::state.enabled = enabled; for(auto& child : children) { child.sizable->setEnabled(child.sizable->enabled()); } } void FixedLayout::setGeometry(Geometry geometry) { } void FixedLayout::setVisible(bool visible) { Sizable::state.visible = visible; for(auto& child : children) { child.sizable->setVisible(child.sizable->visible()); } } void FixedLayout::synchronizeLayout() { for(auto& child : children) { Layout::append(*child.sizable); Geometry childGeometry = child.geometry; if((signed)childGeometry.width < 1) childGeometry.width = 1; if((signed)childGeometry.height < 1) childGeometry.height = 1; child.sizable->setGeometry(childGeometry); } } FixedLayout::~FixedLayout() { while(children.size()) remove(*children[0].sizable); } ananke/database/000700 001750 001750 00000000000 12656700342 014674 5ustar00sergiosergio000000 000000 gba/apu/square.cpp000664 001750 001750 00000001463 12651764221 015236 0ustar00sergiosergio000000 000000 void APU::Square::run() { if(period && --period == 0) { period = 2 * (2048 - frequency); phase++; switch(duty) { case 0: signal = (phase == 6); break; //_____-_ case 1: signal = (phase >= 6); break; //______-- case 2: signal = (phase >= 4); break; //____---- case 3: signal = (phase <= 5); break; //------__ } } uint4 sample = volume; if(enable == false || signal == false) sample = 0; output = sample; } void APU::Square::clocklength() { if(enable && counter) { if(++length == 0) enable = false; } } void APU::Square::clockenvelope() { if(enable && envelope.frequency && --envelope.period == 0) { envelope.period = envelope.frequency; if(envelope.direction == 0 && volume > 0) volume--; if(envelope.direction == 1 && volume < 15) volume++; } } phoenix/cocoa/widget/canvas.cpp000664 001750 001750 00000013663 12651764221 017721 0ustar00sergiosergio000000 000000 @implementation CocoaCanvas : NSImageView -(id) initWith:(phoenix::Canvas&)canvasReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { canvas = &canvasReference; [self setEditable:NO]; //disable image drag-and-drop functionality NSTrackingArea* area = [[[NSTrackingArea alloc] initWithRect:[self frame] options:NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow | NSTrackingInVisibleRect owner:self userInfo:nil ] autorelease]; [self addTrackingArea:area]; } return self; } -(NSDragOperation) draggingEntered:(id)sender { return DropPathsOperation(sender); } -(BOOL) performDragOperation:(id)sender { lstring paths = DropPaths(sender); if(paths.empty()) return NO; if(canvas->onDrop) canvas->onDrop(paths); return YES; } -(void) mouseButton:(NSEvent*)event down:(BOOL)isDown { if(auto& callback = isDown ? canvas->onMousePress : canvas->onMouseRelease) { switch([event buttonNumber]) { case 0: return callback(phoenix::Mouse::Button::Left); case 1: return callback(phoenix::Mouse::Button::Right); case 2: return callback(phoenix::Mouse::Button::Middle); } } } -(void) mouseExited:(NSEvent*)event { if(canvas->onMouseLeave) canvas->onMouseLeave(); } -(void) mouseMove:(NSEvent*)event { if([event window] == nil) return; NSPoint location = [self convertPoint:[event locationInWindow] fromView:nil]; if(canvas->onMouseMove) canvas->onMouseMove({location.x, [self frame].size.height - 1 - location.y}); } -(void) mouseDown:(NSEvent*)event { [self mouseButton:event down:YES]; } -(void) mouseUp:(NSEvent*)event { [self mouseButton:event down:NO]; } -(void) mouseDragged:(NSEvent*)event { [self mouseMove:event]; } -(void) rightMouseDown:(NSEvent*)event { [self mouseButton:event down:YES]; } -(void) rightMouseUp:(NSEvent*)event { [self mouseButton:event down:NO]; } -(void) rightMouseDragged:(NSEvent*)event { [self mouseMove:event]; } -(void) otherMouseDown:(NSEvent*)event { [self mouseButton:event down:YES]; } -(void) otherMouseUp:(NSEvent*)event { [self mouseButton:event down:NO]; } -(void) otherMouseDragged:(NSEvent*)event { [self mouseMove:event]; } @end namespace phoenix { void pCanvas::setDroppable(bool droppable) { @autoreleasepool { if(droppable) { [cocoaCanvas registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]]; } else { [cocoaCanvas unregisterDraggedTypes]; } } } void pCanvas::setGeometry(Geometry geometry) { if(canvas.state.width == 0 || canvas.state.height == 0) rasterize(); unsigned width = canvas.state.width; unsigned height = canvas.state.height; if(width == 0) width = widget.state.geometry.width; if(height == 0) height = widget.state.geometry.height; if(width < geometry.width) { geometry.x += (geometry.width - width) / 2; geometry.width = width; } if(height < geometry.height) { geometry.y += (geometry.height - height) / 2; geometry.height = height; } pWidget::setGeometry(geometry); } void pCanvas::setMode(Canvas::Mode mode) { rasterize(), redraw(); } void pCanvas::setSize(Size size) { rasterize(), redraw(); } void pCanvas::constructor() { @autoreleasepool { cocoaView = cocoaCanvas = [[CocoaCanvas alloc] initWith:canvas]; } setSize(canvas.size()); } void pCanvas::destructor() { @autoreleasepool { [cocoaView release]; } } void pCanvas::rasterize() { @autoreleasepool { unsigned width = canvas.state.width; unsigned height = canvas.state.height; if(width == 0) width = widget.state.geometry.width; if(height == 0) height = widget.state.geometry.height; if(width != surfaceWidth || height != surfaceHeight) { NSImage* image = [[[NSImage alloc] initWithSize:NSMakeSize(width, height)] autorelease]; NSBitmapImageRep* bitmap = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil pixelsWide:width pixelsHigh:height bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bitmapFormat:NSAlphaNonpremultipliedBitmapFormat bytesPerRow:width * 4 bitsPerPixel:32 ] autorelease]; [image addRepresentation:bitmap]; [cocoaView setImage:image]; surfaceWidth = width; surfaceHeight = height; } if(NSBitmapImageRep* bitmap = [[[cocoaView image] representations] objectAtIndex:0]) { uint32_t* target = (uint32_t*)[bitmap bitmapData]; if(canvas.state.mode == Canvas::Mode::Color) { nall::image image; image.allocate(width, height); image.fill(canvas.state.color.argb()); memcpy(target, image.data, image.size); } if(canvas.state.mode == Canvas::Mode::Gradient) { nall::image image; image.allocate(width, height); image.gradient( canvas.state.gradient[0].argb(), canvas.state.gradient[1].argb(), canvas.state.gradient[2].argb(), canvas.state.gradient[3].argb() ); memcpy(target, image.data, image.size); } if(canvas.state.mode == Canvas::Mode::Image) { nall::image image = canvas.state.image; image.scale(width, height); image.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0); memcpy(target, image.data, image.size); } if(canvas.state.mode == Canvas::Mode::Data) { if(width == canvas.state.width && height == canvas.state.height) { memcpy(target, canvas.state.data, width * height * sizeof(uint32_t)); } else { memset(target, 0x00, width * height * sizeof(uint32_t)); } } //ARGB -> ABGR transformation for(unsigned n = 0; n < width * height; n++) { uint32_t color = *target; color = (color & 0xff00ff00) | ((color & 0xff0000) >> 16) | ((color & 0x0000ff) << 16); *target++ = color; } } } } void pCanvas::redraw() { @autoreleasepool { [cocoaView setNeedsDisplay:YES]; } } } processor/arm/algorithms.cpp000664 001750 001750 00000006470 12651764221 017372 0ustar00sergiosergio000000 000000 bool ARM::condition(uint4 condition) { switch(condition) { case 0: return cpsr().z == 1; //EQ (equal) case 1: return cpsr().z == 0; //NE (not equal) case 2: return cpsr().c == 1; //CS (carry set) case 3: return cpsr().c == 0; //CC (carry clear) case 4: return cpsr().n == 1; //MI (negative) case 5: return cpsr().n == 0; //PL (positive) case 6: return cpsr().v == 1; //VS (overflow) case 7: return cpsr().v == 0; //VC (no overflow) case 8: return cpsr().c == 1 && cpsr().z == 0; //HI (unsigned higher) case 9: return cpsr().c == 0 || cpsr().z == 1; //LS (unsigned lower or same) case 10: return cpsr().n == cpsr().v; //GE (signed greater than or equal) case 11: return cpsr().n != cpsr().v; //LT (signed less than) case 12: return cpsr().z == 0 && cpsr().n == cpsr().v; //GT (signed greater than) case 13: return cpsr().z == 1 || cpsr().n != cpsr().v; //LE (signed less than or equal) case 14: return true; //AL (always) case 15: return false; //NV (never) } // NOT REACHED return false; } uint32 ARM::bit(uint32 result) { if(cpsr().t || instruction() & (1 << 20)) { cpsr().n = result >> 31; cpsr().z = result == 0; cpsr().c = carryout(); } return result; } uint32 ARM::add(uint32 source, uint32 modify, bool carry) { uint32 result = source + modify + carry; if(cpsr().t || instruction() & (1 << 20)) { uint32 overflow = ~(source ^ modify) & (source ^ result); cpsr().n = result >> 31; cpsr().z = result == 0; cpsr().c = (1u << 31) & (overflow ^ source ^ modify ^ result); cpsr().v = (1u << 31) & (overflow); } return result; } uint32 ARM::sub(uint32 source, uint32 modify, bool carry) { return add(source, ~modify, carry); } uint32 ARM::mul(uint32 product, uint32 multiplicand, uint32 multiplier) { product += multiplicand * multiplier; if(cpsr().t || instruction() & (1 << 20)) { cpsr().n = product >> 31; cpsr().z = product == 0; } return product; } uint32 ARM::lsl(uint32 source, uint8 shift) { carryout() = cpsr().c; if(shift == 0) return source; carryout() = shift > 32 ? 0 : source & (1 << (32 - shift)); source = shift > 31 ? 0 : source << shift; return source; } uint32 ARM::lsr(uint32 source, uint8 shift) { carryout() = cpsr().c; if(shift == 0) return source; carryout() = shift > 32 ? 0 : source & (1 << (shift - 1)); source = shift > 31 ? 0 : source >> shift; return source; } uint32 ARM::asr(uint32 source, uint8 shift) { carryout() = cpsr().c; if(shift == 0) return source; carryout() = shift > 32 ? source & (1 << 31) : source & (1 << (shift - 1)); source = shift > 31 ? (int32)source >> 31 : (int32)source >> shift; return source; } uint32 ARM::ror(uint32 source, uint8 shift) { carryout() = cpsr().c; if(shift == 0) return source; if((shift &= 31)) source = source << (32 - shift) | source >> shift; carryout() = source & (1 << 31); return source; } uint32 ARM::rrx(uint32 source) { carryout() = source & 1; return (cpsr().c << 31) | (source >> 1); } nall/bit.hpp000664 001750 001750 00000004341 12651764221 014127 0ustar00sergiosergio000000 000000 #ifndef NALL_BIT_HPP #define NALL_BIT_HPP #include namespace nall { template inline uintmax_t uclamp(const uintmax_t x) { enum : uintmax_t { b = 1ull << (bits - 1), y = b * 2 - 1 }; return y + ((x - y) & -(x < y)); //min(x, y); } template inline uintmax_t uclip(const uintmax_t x) { enum : uintmax_t { b = 1ull << (bits - 1), m = b * 2 - 1 }; return (x & m); } template inline intmax_t sclamp(const intmax_t x) { enum : intmax_t { b = 1ull << (bits - 1), m = b - 1 }; return (x > m) ? m : (x < -b) ? -b : x; } template inline intmax_t sclip(const intmax_t x) { enum : uintmax_t { b = 1ull << (bits - 1), m = b * 2 - 1 }; return ((x & m) ^ b) - b; } namespace bit { constexpr inline uintmax_t mask(const char* s, uintmax_t sum = 0) { return ( *s == '0' || *s == '1' ? mask(s + 1, (sum << 1) | 1) : *s == ' ' || *s == '_' ? mask(s + 1, sum) : *s ? mask(s + 1, sum << 1) : sum ); } constexpr inline uintmax_t test(const char* s, uintmax_t sum = 0) { return ( *s == '0' || *s == '1' ? test(s + 1, (sum << 1) | (*s - '0')) : *s == ' ' || *s == '_' ? test(s + 1, sum) : *s ? test(s + 1, sum << 1) : sum ); } //lowest(0b1110) == 0b0010 constexpr inline uintmax_t lowest(const uintmax_t x) { return x & -x; } //clear_lowest(0b1110) == 0b1100 constexpr inline uintmax_t clear_lowest(const uintmax_t x) { return x & (x - 1); } //set_lowest(0b0101) == 0b0111 constexpr inline uintmax_t set_lowest(const uintmax_t x) { return x | (x + 1); } //count number of bits set in a byte inline unsigned count(uintmax_t x) { unsigned count = 0; do count += x & 1; while(x >>= 1); return count; } //return index of the first bit set (or zero of no bits are set) //first(0b1000) == 3 inline unsigned first(uintmax_t x) { unsigned first = 0; while(x) { if(x & 1) break; x >>= 1; first++; } return first; } //round up to next highest single bit: //round(15) == 16, round(16) == 16, round(17) == 32 inline uintmax_t round(uintmax_t x) { if((x & (x - 1)) == 0) return x; while(x & (x - 1)) x &= x - 1; return x << 1; } } } #endif nall/dsp/000700 001750 001750 00000000000 12656700342 013407 5ustar00sergiosergio000000 000000 phoenix/phoenix.hpp000664 001750 001750 00000000112 12651764221 015537 0ustar00sergiosergio000000 000000 #ifndef PHOENIX_HPP #define PHOENIX_HPP #include "core/core.hpp" #endif sfc/alt/ppu-performance/sprite/000700 001750 001750 00000000000 12656700342 017637 5ustar00sergiosergio000000 000000 phoenix/cocoa/monitor.hpp000664 001750 001750 00000000223 12651764221 016643 0ustar00sergiosergio000000 000000 namespace phoenix { struct pMonitor { static unsigned count(); static Geometry geometry(unsigned monitor); static unsigned primary(); }; } sfc/alt/smp/core.cpp000664 001750 001750 00000005307 12651764221 015503 0ustar00sergiosergio000000 000000 void SMP::tick() { timer0.tick(); timer1.tick(); timer2.tick(); clock += cycle_step_cpu; dsp.clock -= 24; synchronize_dsp(); } void SMP::op_io() { #if defined(CYCLE_ACCURATE) tick(); #endif } uint8 SMP::op_read(uint16 addr) { #if defined(CYCLE_ACCURATE) tick(); #endif if((addr & 0xfff0) == 0x00f0) return mmio_read(addr); if(addr >= 0xffc0 && status.iplrom_enable) return iplrom[addr & 0x3f]; return apuram[addr]; } void SMP::op_write(uint16 addr, uint8 data) { #if defined(CYCLE_ACCURATE) tick(); #endif if((addr & 0xfff0) == 0x00f0) mmio_write(addr, data); apuram[addr] = data; //all writes go to RAM, even MMIO writes } void SMP::op_step() { #define op_readpc() op_read(regs.pc++) #define op_readdp(addr) op_read((regs.p.p << 8) + addr) #define op_writedp(addr, data) op_write((regs.p.p << 8) + addr, data) #define op_readaddr(addr) op_read(addr) #define op_writeaddr(addr, data) op_write(addr, data) #define op_readstack() op_read(0x0100 | ++regs.sp) #define op_writestack(data) op_write(0x0100 | regs.sp--, data) #if defined(CYCLE_ACCURATE) if(opcode_cycle == 0) { opcode_number = op_readpc(); opcode_cycle++; } else switch(opcode_number) { #include "core/opcycle_misc.cpp" #include "core/opcycle_mov.cpp" #include "core/opcycle_pc.cpp" #include "core/opcycle_read.cpp" #include "core/opcycle_rmw.cpp" } #else unsigned opcode = op_readpc(); switch(opcode) { #include "core/op_misc.cpp" #include "core/op_mov.cpp" #include "core/op_pc.cpp" #include "core/op_read.cpp" #include "core/op_rmw.cpp" } //TODO: untaken branches should consume less cycles timer0.tick(cycle_count_table[opcode]); timer1.tick(cycle_count_table[opcode]); timer2.tick(cycle_count_table[opcode]); clock += cycle_table_cpu[opcode]; dsp.clock -= cycle_table_dsp[opcode]; synchronize_dsp(); #endif } const unsigned SMP::cycle_count_table[256] = { #define c 12 //0 1 2 3 4 5 6 7 8 9 A B C D E F 2,8,4,7, 3,4,3,6, 2,6,5,4, 5,4,6,8, //0 4,8,4,7, 4,5,5,6, 5,5,6,5, 2,2,4,6, //1 2,8,4,7, 3,4,3,6, 2,6,5,4, 5,4,7,4, //2 4,8,4,7, 4,5,5,6, 5,5,6,5, 2,2,3,8, //3 2,8,4,7, 3,4,3,6, 2,6,4,4, 5,4,6,6, //4 4,8,4,7, 4,5,5,6, 5,5,4,5, 2,2,4,3, //5 2,8,4,7, 3,4,3,6, 2,6,4,4, 5,4,7,5, //6 4,8,4,7, 4,5,5,6, 5,5,5,5, 2,2,3,6, //7 2,8,4,7, 3,4,3,6, 2,6,5,4, 5,2,4,5, //8 4,8,4,7, 4,5,5,6, 5,5,5,5, 2,2,c,5, //9 3,8,4,7, 3,4,3,6, 2,6,4,4, 5,2,4,4, //A 4,8,4,7, 4,5,5,6, 5,5,5,5, 2,2,3,4, //B 3,8,4,7, 4,5,4,7, 2,5,6,4, 5,2,4,9, //C 4,8,4,7, 5,6,6,7, 4,5,5,5, 2,2,8,3, //D 2,8,4,7, 3,4,3,6, 2,4,5,3, 4,3,4,1, //E 4,8,4,7, 4,5,5,6, 3,4,5,4, 2,2,6,1, //F #undef c }; phoenix/qt/platform.moc000664 001750 001750 00000144010 12651764221 016332 0ustar00sergiosergio000000 000000 /**************************************************************************** ** Meta object code from reading C++ file 'platform.moc.hpp' ** ** Created: Mon Jan 20 01:11:54 2014 ** by: The Qt Meta Object Compiler version 63 (Qt 4.8.2) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'platform.moc.hpp' doesn't include ." #elif Q_MOC_OUTPUT_REVISION != 63 #error "This file was generated using the moc from 4.8.2. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_phoenix__pTimer[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 17, 16, 16, 16, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pTimer[] = { "phoenix::pTimer\0\0onActivate()\0" }; void phoenix::pTimer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pTimer *_t = static_cast(_o); switch (_id) { case 0: _t->onActivate(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pTimer::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pTimer::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pTimer, qt_meta_data_phoenix__pTimer, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pTimer::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pTimer::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pTimer::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pTimer)) return static_cast(const_cast< pTimer*>(this)); if (!strcmp(_clname, "pObject")) return static_cast< pObject*>(const_cast< pTimer*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pTimer::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pWindow[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount 0 // eod }; static const char qt_meta_stringdata_phoenix__pWindow[] = { "phoenix::pWindow\0" }; void phoenix::pWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { Q_UNUSED(_o); Q_UNUSED(_id); Q_UNUSED(_c); Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pWindow::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pWindow::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pWindow, qt_meta_data_phoenix__pWindow, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pWindow::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pWindow::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pWindow::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pWindow)) return static_cast(const_cast< pWindow*>(this)); if (!strcmp(_clname, "pObject")) return static_cast< pObject*>(const_cast< pWindow*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; return _id; } static const uint qt_meta_data_phoenix__pItem[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 16, 15, 15, 15, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pItem[] = { "phoenix::pItem\0\0onActivate()\0" }; void phoenix::pItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pItem *_t = static_cast(_o); switch (_id) { case 0: _t->onActivate(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pItem::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pItem::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pItem, qt_meta_data_phoenix__pItem, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pItem::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pItem::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pItem::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pItem)) return static_cast(const_cast< pItem*>(this)); if (!strcmp(_clname, "pAction")) return static_cast< pAction*>(const_cast< pItem*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pCheckItem[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 21, 20, 20, 20, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pCheckItem[] = { "phoenix::pCheckItem\0\0onToggle()\0" }; void phoenix::pCheckItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pCheckItem *_t = static_cast(_o); switch (_id) { case 0: _t->onToggle(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pCheckItem::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pCheckItem::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pCheckItem, qt_meta_data_phoenix__pCheckItem, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pCheckItem::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pCheckItem::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pCheckItem::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pCheckItem)) return static_cast(const_cast< pCheckItem*>(this)); if (!strcmp(_clname, "pAction")) return static_cast< pAction*>(const_cast< pCheckItem*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pCheckItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pRadioItem[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 21, 20, 20, 20, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pRadioItem[] = { "phoenix::pRadioItem\0\0onActivate()\0" }; void phoenix::pRadioItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pRadioItem *_t = static_cast(_o); switch (_id) { case 0: _t->onActivate(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pRadioItem::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pRadioItem::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pRadioItem, qt_meta_data_phoenix__pRadioItem, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pRadioItem::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pRadioItem::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pRadioItem::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pRadioItem)) return static_cast(const_cast< pRadioItem*>(this)); if (!strcmp(_clname, "pAction")) return static_cast< pAction*>(const_cast< pRadioItem*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pRadioItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pButton[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 18, 17, 17, 17, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pButton[] = { "phoenix::pButton\0\0onActivate()\0" }; void phoenix::pButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pButton *_t = static_cast(_o); switch (_id) { case 0: _t->onActivate(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pButton::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pButton::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pButton, qt_meta_data_phoenix__pButton, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pButton::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pButton::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pButton::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pButton)) return static_cast(const_cast< pButton*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pButton*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pCanvas[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount 0 // eod }; static const char qt_meta_stringdata_phoenix__pCanvas[] = { "phoenix::pCanvas\0" }; void phoenix::pCanvas::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { Q_UNUSED(_o); Q_UNUSED(_id); Q_UNUSED(_c); Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pCanvas::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pCanvas::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pCanvas, qt_meta_data_phoenix__pCanvas, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pCanvas::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pCanvas::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pCanvas::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pCanvas)) return static_cast(const_cast< pCanvas*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pCanvas*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pCanvas::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; return _id; } static const uint qt_meta_data_phoenix__pCheckButton[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 31, 23, 22, 22, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pCheckButton[] = { "phoenix::pCheckButton\0\0checked\0" "onToggle(bool)\0" }; void phoenix::pCheckButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pCheckButton *_t = static_cast(_o); switch (_id) { case 0: _t->onToggle((*reinterpret_cast< bool(*)>(_a[1]))); break; default: ; } } } const QMetaObjectExtraData phoenix::pCheckButton::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pCheckButton::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pCheckButton, qt_meta_data_phoenix__pCheckButton, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pCheckButton::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pCheckButton::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pCheckButton::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pCheckButton)) return static_cast(const_cast< pCheckButton*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pCheckButton*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pCheckButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pCheckLabel[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 22, 21, 21, 21, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pCheckLabel[] = { "phoenix::pCheckLabel\0\0onToggle()\0" }; void phoenix::pCheckLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pCheckLabel *_t = static_cast(_o); switch (_id) { case 0: _t->onToggle(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pCheckLabel::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pCheckLabel::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pCheckLabel, qt_meta_data_phoenix__pCheckLabel, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pCheckLabel::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pCheckLabel::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pCheckLabel::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pCheckLabel)) return static_cast(const_cast< pCheckLabel*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pCheckLabel*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pCheckLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pComboButton[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 23, 22, 22, 22, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pComboButton[] = { "phoenix::pComboButton\0\0onChange()\0" }; void phoenix::pComboButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pComboButton *_t = static_cast(_o); switch (_id) { case 0: _t->onChange(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pComboButton::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pComboButton::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pComboButton, qt_meta_data_phoenix__pComboButton, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pComboButton::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pComboButton::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pComboButton::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pComboButton)) return static_cast(const_cast< pComboButton*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pComboButton*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pComboButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pConsole[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount 0 // eod }; static const char qt_meta_stringdata_phoenix__pConsole[] = { "phoenix::pConsole\0" }; void phoenix::pConsole::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { Q_UNUSED(_o); Q_UNUSED(_id); Q_UNUSED(_c); Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pConsole::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pConsole::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pConsole, qt_meta_data_phoenix__pConsole, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pConsole::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pConsole::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pConsole::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pConsole)) return static_cast(const_cast< pConsole*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pConsole*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pConsole::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; return _id; } static const uint qt_meta_data_phoenix__pFrame[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount 0 // eod }; static const char qt_meta_stringdata_phoenix__pFrame[] = { "phoenix::pFrame\0" }; void phoenix::pFrame::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { Q_UNUSED(_o); Q_UNUSED(_id); Q_UNUSED(_c); Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pFrame::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pFrame::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pFrame, qt_meta_data_phoenix__pFrame, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pFrame::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pFrame::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pFrame::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pFrame)) return static_cast(const_cast< pFrame*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pFrame*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pFrame::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; return _id; } static const uint qt_meta_data_phoenix__pHexEdit[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 19, 18, 18, 18, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pHexEdit[] = { "phoenix::pHexEdit\0\0onScroll()\0" }; void phoenix::pHexEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pHexEdit *_t = static_cast(_o); switch (_id) { case 0: _t->onScroll(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pHexEdit::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pHexEdit::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pHexEdit, qt_meta_data_phoenix__pHexEdit, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pHexEdit::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pHexEdit::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pHexEdit::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pHexEdit)) return static_cast(const_cast< pHexEdit*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pHexEdit*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pHexEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pHorizontalScroller[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 30, 29, 29, 29, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pHorizontalScroller[] = { "phoenix::pHorizontalScroller\0\0onChange()\0" }; void phoenix::pHorizontalScroller::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pHorizontalScroller *_t = static_cast(_o); switch (_id) { case 0: _t->onChange(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pHorizontalScroller::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pHorizontalScroller::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pHorizontalScroller, qt_meta_data_phoenix__pHorizontalScroller, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pHorizontalScroller::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pHorizontalScroller::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pHorizontalScroller::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pHorizontalScroller)) return static_cast(const_cast< pHorizontalScroller*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pHorizontalScroller*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pHorizontalScroller::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pHorizontalSlider[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 28, 27, 27, 27, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pHorizontalSlider[] = { "phoenix::pHorizontalSlider\0\0onChange()\0" }; void phoenix::pHorizontalSlider::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pHorizontalSlider *_t = static_cast(_o); switch (_id) { case 0: _t->onChange(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pHorizontalSlider::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pHorizontalSlider::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pHorizontalSlider, qt_meta_data_phoenix__pHorizontalSlider, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pHorizontalSlider::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pHorizontalSlider::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pHorizontalSlider::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pHorizontalSlider)) return static_cast(const_cast< pHorizontalSlider*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pHorizontalSlider*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pHorizontalSlider::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pLineEdit[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 2, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 20, 19, 19, 19, 0x0a, 33, 19, 19, 19, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pLineEdit[] = { "phoenix::pLineEdit\0\0onActivate()\0" "onChange()\0" }; void phoenix::pLineEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pLineEdit *_t = static_cast(_o); switch (_id) { case 0: _t->onActivate(); break; case 1: _t->onChange(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pLineEdit::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pLineEdit::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pLineEdit, qt_meta_data_phoenix__pLineEdit, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pLineEdit::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pLineEdit::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pLineEdit::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pLineEdit)) return static_cast(const_cast< pLineEdit*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pLineEdit*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pLineEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 2) qt_static_metacall(this, _c, _id, _a); _id -= 2; } return _id; } static const uint qt_meta_data_phoenix__pListView[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 3, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 20, 19, 19, 19, 0x0a, 38, 33, 19, 19, 0x0a, 65, 33, 19, 19, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pListView[] = { "phoenix::pListView\0\0onActivate()\0item\0" "onChange(QTreeWidgetItem*)\0" "onToggle(QTreeWidgetItem*)\0" }; void phoenix::pListView::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pListView *_t = static_cast(_o); switch (_id) { case 0: _t->onActivate(); break; case 1: _t->onChange((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break; case 2: _t->onToggle((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break; default: ; } } } const QMetaObjectExtraData phoenix::pListView::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pListView::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pListView, qt_meta_data_phoenix__pListView, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pListView::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pListView::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pListView::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pListView)) return static_cast(const_cast< pListView*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pListView*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pListView::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 3) qt_static_metacall(this, _c, _id, _a); _id -= 3; } return _id; } static const uint qt_meta_data_phoenix__pRadioLabel[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 22, 21, 21, 21, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pRadioLabel[] = { "phoenix::pRadioLabel\0\0onActivate()\0" }; void phoenix::pRadioLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pRadioLabel *_t = static_cast(_o); switch (_id) { case 0: _t->onActivate(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pRadioLabel::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pRadioLabel::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pRadioLabel, qt_meta_data_phoenix__pRadioLabel, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pRadioLabel::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pRadioLabel::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pRadioLabel::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pRadioLabel)) return static_cast(const_cast< pRadioLabel*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pRadioLabel*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pRadioLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pRadioButton[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 23, 22, 22, 22, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pRadioButton[] = { "phoenix::pRadioButton\0\0onActivate()\0" }; void phoenix::pRadioButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pRadioButton *_t = static_cast(_o); switch (_id) { case 0: _t->onActivate(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pRadioButton::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pRadioButton::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pRadioButton, qt_meta_data_phoenix__pRadioButton, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pRadioButton::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pRadioButton::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pRadioButton::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pRadioButton)) return static_cast(const_cast< pRadioButton*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pRadioButton*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pRadioButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pTabFrame[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 30, 20, 19, 19, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pTabFrame[] = { "phoenix::pTabFrame\0\0selection\0" "onChange(int)\0" }; void phoenix::pTabFrame::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pTabFrame *_t = static_cast(_o); switch (_id) { case 0: _t->onChange((*reinterpret_cast< int(*)>(_a[1]))); break; default: ; } } } const QMetaObjectExtraData phoenix::pTabFrame::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pTabFrame::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pTabFrame, qt_meta_data_phoenix__pTabFrame, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pTabFrame::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pTabFrame::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pTabFrame::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pTabFrame)) return static_cast(const_cast< pTabFrame*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pTabFrame*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pTabFrame::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pTextEdit[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 20, 19, 19, 19, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pTextEdit[] = { "phoenix::pTextEdit\0\0onChange()\0" }; void phoenix::pTextEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pTextEdit *_t = static_cast(_o); switch (_id) { case 0: _t->onChange(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pTextEdit::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pTextEdit::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pTextEdit, qt_meta_data_phoenix__pTextEdit, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pTextEdit::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pTextEdit::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pTextEdit::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pTextEdit)) return static_cast(const_cast< pTextEdit*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pTextEdit*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pTextEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pVerticalScroller[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 28, 27, 27, 27, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pVerticalScroller[] = { "phoenix::pVerticalScroller\0\0onChange()\0" }; void phoenix::pVerticalScroller::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pVerticalScroller *_t = static_cast(_o); switch (_id) { case 0: _t->onChange(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pVerticalScroller::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pVerticalScroller::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pVerticalScroller, qt_meta_data_phoenix__pVerticalScroller, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pVerticalScroller::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pVerticalScroller::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pVerticalScroller::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pVerticalScroller)) return static_cast(const_cast< pVerticalScroller*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pVerticalScroller*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pVerticalScroller::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } static const uint qt_meta_data_phoenix__pVerticalSlider[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 26, 25, 25, 25, 0x0a, 0 // eod }; static const char qt_meta_stringdata_phoenix__pVerticalSlider[] = { "phoenix::pVerticalSlider\0\0onChange()\0" }; void phoenix::pVerticalSlider::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); pVerticalSlider *_t = static_cast(_o); switch (_id) { case 0: _t->onChange(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData phoenix::pVerticalSlider::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject phoenix::pVerticalSlider::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_phoenix__pVerticalSlider, qt_meta_data_phoenix__pVerticalSlider, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &phoenix::pVerticalSlider::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *phoenix::pVerticalSlider::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *phoenix::pVerticalSlider::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_phoenix__pVerticalSlider)) return static_cast(const_cast< pVerticalSlider*>(this)); if (!strcmp(_clname, "pWidget")) return static_cast< pWidget*>(const_cast< pVerticalSlider*>(this)); return QObject::qt_metacast(_clname); } int phoenix::pVerticalSlider::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } QT_END_MOC_NAMESPACE gba/ppu/mosaic.cpp000664 001750 001750 00000001457 12651764221 015233 0ustar00sergiosergio000000 000000 void PPU::render_mosaic_background(unsigned id) { if(regs.mosaic.bghsize == 0) return; unsigned width = 1 + regs.mosaic.bghsize; auto& buffer = layer[id]; for(unsigned x = 0; x < 240;) { for(unsigned m = 1; m < width; m++) { if(x + m >= 240) break; buffer[x + m] = buffer[x]; } x += width; } } void PPU::render_mosaic_object() { if(regs.mosaic.objhsize == 0) return; unsigned width = 1 + regs.mosaic.objhsize; auto& buffer = layer[OBJ]; Pixel mosaicPixel; mosaicPixel.mosaic = false; unsigned counter = 0; for(unsigned x = 0; x < 240; x++) { if(counter == width || mosaicPixel.mosaic == false) { mosaicPixel = buffer[x]; if(counter == width) counter = 0; } else { if(buffer[x].mosaic) buffer[x] = mosaicPixel; } counter++; } } sfc/chip/sdd1/decomp.hpp000664 001750 001750 00000003451 12651764221 016224 0ustar00sergiosergio000000 000000 struct Decomp { struct IM { //input manager Decomp& self; void init(unsigned offset); uint8 get_codeword(uint8 code_length); IM(SDD1::Decomp& self) : self(self) {} private: unsigned offset; unsigned bit_count; }; struct GCD { //golomb-code decoder Decomp& self; static const uint8 run_count[256]; void get_run_count(uint8 code_number, uint8& mps_count, bool& lps_index); GCD(SDD1::Decomp& self) : self(self) {} }; struct BG { //bits generator Decomp& self; void init(); uint8 get_bit(bool& end_of_run); BG(SDD1::Decomp& self, uint8 code_number) : self(self), code_number(code_number) {} private: const uint8 code_number; uint8 mps_count; bool lps_index; }; struct PEM { //probability estimation module Decomp& self; void init(); uint8 get_bit(uint8 context); PEM(SDD1::Decomp& self) : self(self) {} private: struct State { uint8 code_number; uint8 next_if_mps; uint8 next_if_lps; }; static const State evolution_table[33]; struct ContextInfo { uint8 status; uint8 mps; } context_info[32]; }; struct CM { //context model Decomp& self; void init(unsigned offset); uint8 get_bit(); CM(SDD1::Decomp& self) : self(self) {} private: uint8 bitplanes_info; uint8 context_bits_info; uint8 bit_number; uint8 current_bitplane; uint16 previous_bitplane_bits[8]; }; struct OL { //output logic Decomp& self; void init(unsigned offset); uint8 decompress(); OL(SDD1::Decomp& self) : self(self) {} private: uint8 bitplanes_info; uint8 r0, r1, r2; }; void init(unsigned offset); uint8 read(); Decomp(); IM im; GCD gcd; BG bg0, bg1, bg2, bg3, bg4, bg5, bg6, bg7; PEM pem; CM cm; OL ol; }; phoenix/reference/widget/console.cpp000664 001750 001750 00000000235 12651764221 020751 0ustar00sergiosergio000000 000000 namespace phoenix { void pConsole::print(string text) { } void pConsole::reset() { } void pConsole::constructor() { } void pConsole::destructor() { } } shaders/Curvature.shader/manifest.bml000664 001750 001750 00000000101 12651764221 021060 0ustar00sergiosergio000000 000000 program filter: linear wrap: border fragment: curvature.fs fc/apu/pulse.cpp000664 001750 001750 00000001715 12651764221 014725 0ustar00sergiosergio000000 000000 void APU::Pulse::clock_length() { if(envelope.loop_mode == 0) { if(length_counter) length_counter--; } } uint8 APU::Pulse::clock() { if(sweep.check_period() == false) return 0; if(length_counter == 0) return 0; static const unsigned duty_table[] = {1, 2, 4, 6}; uint8 result = (duty_counter < duty_table[duty]) ? envelope.volume() : 0; if(sweep.pulse_period < 0x008) result = 0; if(--period_counter == 0) { period_counter = (sweep.pulse_period + 1) * 2; duty_counter++; } return result; } void APU::Pulse::power() { envelope.power(); sweep.power(); } void APU::Pulse::reset() { envelope.reset(); sweep.reset(); length_counter = 0; duty = 0; duty_counter = 0; period = 0; period_counter = 1; } void APU::Pulse::serialize(serializer& s) { s.integer(length_counter); envelope.serialize(s); sweep.serialize(s); s.integer(duty); s.integer(duty_counter); s.integer(period); s.integer(period_counter); } sfc/chip/sa1/memory/memory.cpp000664 001750 001750 00000020055 12651764221 017420 0ustar00sergiosergio000000 000000 #ifdef SA1_CPP uint8 SA1::bus_read(unsigned addr) { if((addr & 0x40fe00) == 0x002200) { //$00-3f|80-bf:2200-23ff return mmio_read(addr); } if((addr & 0x408000) == 0x008000) { //$00-3f|80-bf:8000-ffff return mmcrom_read(addr); } if((addr & 0xc00000) == 0xc00000) { //$c0-ff:0000-ffff return mmcrom_read(addr); } if((addr & 0x40e000) == 0x006000) { //$00-3f|80-bf:6000-7fff return mmc_sa1_read(addr); } if((addr & 0x40f800) == 0x000000) { //$00-3f|80-bf:0000-07ff synchronize_cpu(); return iram.read(addr & 2047); } if((addr & 0x40f800) == 0x003000) { //$00-3f|80-bf:3000-37ff synchronize_cpu(); return iram.read(addr & 2047); } if((addr & 0xf00000) == 0x400000) { //$40-4f:0000-ffff synchronize_cpu(); return bwram.read(addr & (bwram.size() - 1)); } if((addr & 0xf00000) == 0x600000) { //$60-6f:0000-ffff synchronize_cpu(); return bitmap_read(addr & 0x0fffff); } //unmapped region return regs.mdr; } void SA1::bus_write(unsigned addr, uint8 data) { if((addr & 0x40fe00) == 0x002200) { //$00-3f|80-bf:2200-23ff return mmio_write(addr, data); } if((addr & 0x40e000) == 0x006000) { //$00-3f|80-bf:6000-7fff return mmc_sa1_write(addr, data); } if((addr & 0x40f800) == 0x000000) { //$00-3f|80-bf:0000-07ff synchronize_cpu(); return iram.write(addr & 2047, data); } if((addr & 0x40f800) == 0x003000) { //$00-3f|80-bf:3000-37ff synchronize_cpu(); return iram.write(addr & 2047, data); } if((addr & 0xf00000) == 0x400000) { //$40-4f:0000-ffff synchronize_cpu(); return bwram.write(addr & (bwram.size() - 1), data); } if((addr & 0xf00000) == 0x600000) { //$60-6f:0000-ffff synchronize_cpu(); return bitmap_write(addr & 0x0fffff, data); } } //$230c (VDPL), $230d (VDPH) use this bus to read variable-length data. //this is used both to keep VBR-reads from accessing MMIO registers, and //to avoid syncing the S-CPU and SA-1*; as both chips are able to access //these ports. uint8 SA1::vbr_read(unsigned addr) { if((addr & 0x408000) == 0x008000) { //$00-3f|80-bf:8000-ffff return mmcrom_read(addr); } if((addr & 0xc00000) == 0xc00000) { //$c0-ff:0000-ffff return mmcrom_read(addr); } if((addr & 0x40e000) == 0x006000) { //$00-3f|80-bf:6000-7fff return bwram.read(addr & (bwram.size() - 1)); } if((addr & 0xf00000) == 0x400000) { //$40-4f:0000-ffff return bwram.read(addr & (bwram.size() - 1)); } if((addr & 0x40f800) == 0x000000) { //$00-3f|80-bf:0000-07ff return iram.read(addr & 2047); } if((addr & 0x40f800) == 0x003000) { //$00-3f|80-bf:3000-37ff return iram.read(addr & 2047); } // TODO: invalid address, what does real hardware do here? return 0; } //ROM, I-RAM and MMIO registers are accessed at ~10.74MHz (2 clock ticks) //BW-RAM is accessed at ~5.37MHz (4 clock ticks) //tick() == 2 clock ticks //note: bus conflict delays are not emulated at this time void SA1::op_io() { tick(); } uint8 SA1::op_read(unsigned addr) { tick(); if(((addr & 0x40e000) == 0x006000) || ((addr & 0xd00000) == 0x400000)) tick(); return bus_read(addr); } void SA1::op_write(unsigned addr, uint8 data) { tick(); if(((addr & 0x40e000) == 0x006000) || ((addr & 0xd00000) == 0x400000)) tick(); bus_write(addr, regs.mdr = data); } uint8 SA1::mmcrom_read(unsigned addr) { if((addr & 0xffffe0) == 0x00ffe0) { if(addr == 0xffea && sa1.mmio.cpu_nvsw) return sa1.mmio.snv >> 0; if(addr == 0xffeb && sa1.mmio.cpu_nvsw) return sa1.mmio.snv >> 8; if(addr == 0xffee && sa1.mmio.cpu_ivsw) return sa1.mmio.siv >> 0; if(addr == 0xffef && sa1.mmio.cpu_ivsw) return sa1.mmio.siv >> 8; } static auto read = [](unsigned addr) { return sa1.rom.read(bus.mirror(addr, sa1.rom.size())); }; if((addr & 0xe08000) == 0x008000) { //$00-1f:8000-ffff addr = ((addr & 0x1f0000) >> 1) | (addr & 0x007fff); if(mmio.cbmode == 0) return read(0x000000 | addr); return read((mmio.cb << 20) | addr); } if((addr & 0xe08000) == 0x208000) { //$20-3f:8000-ffff addr = ((addr & 0x1f0000) >> 1) | (addr & 0x007fff); if(mmio.dbmode == 0) return read(0x100000 | addr); return read((mmio.db << 20) | addr); } if((addr & 0xe08000) == 0x808000) { //$80-9f:8000-ffff addr = ((addr & 0x1f0000) >> 1) | (addr & 0x007fff); if(mmio.ebmode == 0) return read(0x200000 | addr); return read((mmio.eb << 20) | addr); } if((addr & 0xe08000) == 0xa08000) { //$a0-bf:8000-ffff addr = ((addr & 0x1f0000) >> 1) | (addr & 0x007fff); if(mmio.fbmode == 0) return read(0x300000 | addr); return read((mmio.fb << 20) | addr); } if((addr & 0xf00000) == 0xc00000) { //$c0-cf:0000-ffff return read((mmio.cb << 20) | (addr & 0x0fffff)); } if((addr & 0xf00000) == 0xd00000) { //$d0-df:0000-ffff return read((mmio.db << 20) | (addr & 0x0fffff)); } if((addr & 0xf00000) == 0xe00000) { //$e0-ef:0000-ffff return read((mmio.eb << 20) | (addr & 0x0fffff)); } if((addr & 0xf00000) == 0xf00000) { //$f0-ff:0000-ffff return read((mmio.fb << 20) | (addr & 0x0fffff)); } return 0x00; } void SA1::mmcrom_write(unsigned addr, uint8 data) { } uint8 SA1::mmcbwram_read(unsigned addr) { if((addr & 0x40e000) == 0x006000) { //$00-3f|80-bf:6000-7fff cpu.synchronize_coprocessors(); addr = bus.mirror(mmio.sbm * 0x2000 + (addr & 0x1fff), cpubwram.size()); return cpubwram.read(addr); } if((addr & 0xf00000) == 0x400000) { //$40-4f:0000-ffff return cpubwram.read(addr & 0x0fffff); } return cpu.regs.mdr; } void SA1::mmcbwram_write(unsigned addr, uint8 data) { if((addr & 0x40e000) == 0x006000) { //$00-3f|80-bf:6000-7fff cpu.synchronize_coprocessors(); addr = bus.mirror(mmio.sbm * 0x2000 + (addr & 0x1fff), cpubwram.size()); return cpubwram.write(addr, data); } if((addr & 0xf00000) == 0x400000) { //$40-4f:0000-ffff return cpubwram.write(addr & 0x0fffff, data); } } uint8 SA1::mmc_sa1_read(unsigned addr) { synchronize_cpu(); if(mmio.sw46 == 0) { //$40-43:0000-ffff x 32 projection addr = bus.mirror((mmio.cbm & 0x1f) * 0x2000 + (addr & 0x1fff), bwram.size()); return bwram.read(addr); } else { //$60-6f:0000-ffff x 128 projection addr = bus.mirror(mmio.cbm * 0x2000 + (addr & 0x1fff), 0x100000); return bitmap_read(addr); } } void SA1::mmc_sa1_write(unsigned addr, uint8 data) { synchronize_cpu(); if(mmio.sw46 == 0) { //$40-43:0000-ffff x 32 projection addr = bus.mirror((mmio.cbm & 0x1f) * 0x2000 + (addr & 0x1fff), bwram.size()); bwram.write(addr, data); } else { //$60-6f:0000-ffff x 128 projection addr = bus.mirror(mmio.cbm * 0x2000 + (addr & 0x1fff), 0x100000); bitmap_write(addr, data); } } uint8 SA1::bitmap_read(unsigned addr) { if(mmio.bbf == 0) { //4bpp unsigned shift = addr & 1; addr = (addr >> 1) & (bwram.size() - 1); switch(shift) { case 0: return (bwram.read(addr) >> 0) & 15; case 1: return (bwram.read(addr) >> 4) & 15; } } else { //2bpp unsigned shift = addr & 3; addr = (addr >> 2) & (bwram.size() - 1); switch(shift) { case 0: return (bwram.read(addr) >> 0) & 3; case 1: return (bwram.read(addr) >> 2) & 3; case 2: return (bwram.read(addr) >> 4) & 3; case 3: return (bwram.read(addr) >> 6) & 3; } } // NOT REACHED return 0; } void SA1::bitmap_write(unsigned addr, uint8 data) { if(mmio.bbf == 0) { //4bpp unsigned shift = addr & 1; addr = (addr >> 1) & (bwram.size() - 1); switch(shift) { case 0: data = (bwram.read(addr) & 0xf0) | ((data & 15) << 0); break; case 1: data = (bwram.read(addr) & 0x0f) | ((data & 15) << 4); break; } } else { //2bpp unsigned shift = addr & 3; addr = (addr >> 2) & (bwram.size() - 1); switch(shift) { case 0: data = (bwram.read(addr) & 0xfc) | ((data & 3) << 0); break; case 1: data = (bwram.read(addr) & 0xf3) | ((data & 3) << 2); break; case 2: data = (bwram.read(addr) & 0xcf) | ((data & 3) << 4); break; case 3: data = (bwram.read(addr) & 0x3f) | ((data & 3) << 6); break; } } bwram.write(addr, data); } #endif target-libretro/jni/Android.mk000664 001750 001750 00000007055 12651764221 017516 0ustar00sergiosergio000000 000000 LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) ifeq ($(TARGET_ARCH),arm) LOCAL_CFLAGS += -DANDROID_ARM LOCAL_ARM_MODE := arm endif ifeq ($(TARGET_ARCH),x86) LOCAL_CFLAGS += -DANDROID_X86 endif ifeq ($(TARGET_ARCH),mips) LOCAL_CFLAGS += -DANDROID_MIPS endif SRCDIR := $(LOCAL_PATH)/../.. ifeq ($(profile),) profile := performance endif ifeq ($(profile),performance) LOCAL_CFLAGS += -DPROFILE_PERFORMANCE LOCAL_SRC_FILES += $(SRCDIR)/sfc/alt/cpu/cpu.cpp \ $(SRCDIR)/sfc/alt/smp/smp.cpp \ $(SRCDIR)/sfc/alt/dsp/dsp.cpp \ $(SRCDIR)/sfc/alt/ppu-performance/ppu.cpp else ifeq ($(profile),balanced) LOCAL_CFLAGS += -DPROFILE_BALANCED LOCAL_SRC_FILES += $(SRCDIR)/sfc/cpu/cpu.cpp \ $(SRCDIR)/sfc/smp/smp.cpp \ $(SRCDIR)/sfc/alt/dsp/dsp.cpp \ $(SRCDIR)/sfc/alt/ppu-balanced/ppu.cpp else ifeq ($(profile),accuracy) # If you're batshit insane LOCAL_CFLAGS += -DPROFILE_ACCURACY LOCAL_SRC_FILES += $(SRCDIR)/sfc/cpu/cpu.cpp \ $(SRCDIR)/sfc/smp/smp.cpp \ $(SRCDIR)/sfc/dsp/dsp.cpp \ $(SRCDIR)/sfc/ppu/ppu.cpp endif LOCAL_MODULE := retro_bsnes_mercury_${profile} LOCAL_SRC_FILES += $(SRCDIR)/libco/libco.c \ $(SRCDIR)/processor/arm/arm.cpp \ $(SRCDIR)/processor/gsu/gsu.cpp \ $(SRCDIR)/processor/hg51b/hg51b.cpp \ $(SRCDIR)/processor/lr35902/lr35902.cpp \ $(SRCDIR)/processor/r65816/r65816.cpp \ $(SRCDIR)/processor/spc700/spc700.cpp \ $(SRCDIR)/processor/upd96050/upd96050.cpp \ $(SRCDIR)/sfc/interface/interface.cpp \ $(SRCDIR)/sfc/system/system.cpp \ $(SRCDIR)/sfc/controller/controller.cpp \ $(SRCDIR)/sfc/cartridge/cartridge.cpp \ $(SRCDIR)/sfc/cheat/cheat.cpp \ $(SRCDIR)/sfc/memory/memory.cpp \ $(SRCDIR)/sfc/chip/icd2/icd2.cpp \ $(SRCDIR)/sfc/chip/bsx/bsx.cpp \ $(SRCDIR)/sfc/slot/sufamiturbo/sufamiturbo.cpp \ $(SRCDIR)/sfc/base/satellaview/satellaview.cpp \ $(SRCDIR)/sfc/slot/satellaview/satellaview.cpp \ $(SRCDIR)/sfc/chip/nss/nss.cpp \ $(SRCDIR)/sfc/chip/event/event.cpp \ $(SRCDIR)/sfc/chip/sa1/sa1.cpp \ $(SRCDIR)/sfc/chip/superfx/superfx.cpp \ $(SRCDIR)/sfc/chip/armdsp/armdsp.cpp \ $(SRCDIR)/sfc/chip/hitachidsp/hitachidsp.cpp \ $(SRCDIR)/sfc/chip/necdsp/necdsp.cpp \ $(SRCDIR)/sfc/chip/epsonrtc/epsonrtc.cpp \ $(SRCDIR)/sfc/chip/sharprtc/sharprtc.cpp \ $(SRCDIR)/sfc/chip/spc7110/spc7110.cpp \ $(SRCDIR)/sfc/chip/dsp1/dsp1.cpp \ $(SRCDIR)/sfc/chip/dsp2/dsp2.cpp \ $(SRCDIR)/sfc/chip/dsp3/dsp3.cpp \ $(SRCDIR)/sfc/chip/dsp4/dsp4.cpp \ $(SRCDIR)/sfc/chip/cx4/cx4.cpp \ $(SRCDIR)/sfc/chip/st0010/st0010.cpp \ $(SRCDIR)/sfc/chip/sgb-external/sgb-external.cpp \ $(SRCDIR)/sfc/chip/sdd1/sdd1.cpp \ $(SRCDIR)/sfc/chip/obc1/obc1.cpp \ $(SRCDIR)/sfc/chip/hsu1/hsu1.cpp \ $(SRCDIR)/sfc/chip/msu1/msu1.cpp \ $(SRCDIR)/gb/interface/interface.cpp \ $(SRCDIR)/gb/system/system.cpp \ $(SRCDIR)/gb/scheduler/scheduler.cpp \ $(SRCDIR)/gb/memory/memory.cpp \ $(SRCDIR)/gb/cartridge/cartridge.cpp \ $(SRCDIR)/gb/cpu/cpu.cpp \ $(SRCDIR)/gb/ppu/ppu.cpp \ $(SRCDIR)/gb/apu/apu.cpp \ $(SRCDIR)/gb/cheat/cheat.cpp \ $(SRCDIR)/gb/video/video.cpp \ $(SRCDIR)/target-libretro/libretro.cpp LOCAL_CPPFLAGS += -std=gnu++11 -fexceptions -frtti -Wno-literal-suffix LOCAL_CFLAGS += -O3 -fomit-frame-pointer -ffast-math -D__LIBRETRO__ LOCAL_C_INCLUDES += $(LOCAL_PATH)/../.. include $(BUILD_SHARED_LIBRARY) fc/input/input.hpp000664 001750 001750 00000000547 12651764221 015315 0ustar00sergiosergio000000 000000 struct Input { enum class Device : unsigned { Joypad, None, }; void latch(bool data); bool data(bool port); void connect(bool port, Device device); void power(); void reset(); void serialize(serializer&); private: Device port1; Device port2; bool latchdata; unsigned counter1; unsigned counter2; }; extern Input input; fc/cartridge/chip/mmc5.cpp000664 001750 001750 00000030263 12651764221 016540 0ustar00sergiosergio000000 000000 struct MMC5 : Chip { enum class Revision : unsigned { MMC5, MMC5B, } revision; uint8 exram[1024]; //programmable registers uint2 prg_mode; //$5100 uint2 chr_mode; //$5101 uint2 prgram_write_protect[2]; //$5102,$5103 uint2 exram_mode; //$5104 uint2 nametable_mode[4]; //$5105 uint8 fillmode_tile; //$5106 uint8 fillmode_color; //$5107 bool ram_select; //$5113 uint2 ram_bank; //$5113 uint8 prg_bank[4]; //$5114-5117 uint10 chr_sprite_bank[8]; //$5120-5127 uint10 chr_bg_bank[4]; //$5128-512b uint2 chr_bank_hi; //$5130 bool vs_enable; //$5200 bool vs_side; //$5200 uint5 vs_tile; //$5200 uint8 vs_scroll; //$5201 uint8 vs_bank; //$5202 uint8 irq_line; //$5203 bool irq_enable; //$5204 uint8 multiplicand; //$5205 uint8 multiplier; //$5206 //status registers unsigned cpu_cycle_counter; unsigned irq_counter; bool irq_pending; bool in_frame; unsigned vcounter; unsigned hcounter; uint16 chr_access[4]; bool chr_active; bool sprite_8x16; uint8 exbank; uint8 exattr; bool vs_fetch; uint8 vs_vpos; uint8 vs_hpos; void main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } //scanline() resets this; if no scanlines detected, enter video blanking period if(++cpu_cycle_counter >= 200) blank(); //113-114 normal; ~2500 across Vblank period cpu.set_irq_line(irq_enable && irq_pending); tick(); } } void scanline(unsigned y) { //used for testing only, to verify MMC5 scanline detection is accurate: //if(y != vcounter && y <= 240) print(y, " vs ", vcounter, "\n"); } uint8 prg_access(bool write, unsigned addr, uint8 data = 0x00) { unsigned bank; if((addr & 0xe000) == 0x6000) { bank = (ram_select << 2) | ram_bank; addr &= 0x1fff; } else if(prg_mode == 0) { bank = prg_bank[3] & ~3; addr &= 0x7fff; } else if(prg_mode == 1) { if((addr & 0xc000) == 0x8000) bank = (prg_bank[1] & ~1); if((addr & 0xe000) == 0xc000) bank = (prg_bank[3] & ~1); addr &= 0x3fff; } else if(prg_mode == 2) { if((addr & 0xe000) == 0x8000) bank = (prg_bank[1] & ~1) | 0; if((addr & 0xe000) == 0xa000) bank = (prg_bank[1] & ~1) | 1; if((addr & 0xe000) == 0xc000) bank = (prg_bank[2]); if((addr & 0xe000) == 0xe000) bank = (prg_bank[3]); addr &= 0x1fff; } else if(prg_mode == 3) { if((addr & 0xe000) == 0x8000) bank = prg_bank[0]; if((addr & 0xe000) == 0xa000) bank = prg_bank[1]; if((addr & 0xe000) == 0xc000) bank = prg_bank[2]; if((addr & 0xe000) == 0xe000) bank = prg_bank[3]; addr &= 0x1fff; } bool rom = bank & 0x80; bank &= 0x7f; if(write == false) { if(rom) { return board.prgrom.read((bank << 13) | addr); } else { return board.prgram.read((bank << 13) | addr); } } else { if(rom) { board.prgrom.write((bank << 13) | addr, data); } else { if(prgram_write_protect[0] == 2 && prgram_write_protect[1] == 1) { board.prgram.write((bank << 13) | addr, data); } } return 0x00; } } uint8 prg_read(unsigned addr) { if((addr & 0xfc00) == 0x5c00) { if(exram_mode >= 2) return exram[addr & 0x03ff]; return cpu.mdr(); } if(addr >= 0x6000) { return prg_access(0, addr); } switch(addr) { case 0x5204: { uint8 result = (irq_pending << 7) | (in_frame << 6); irq_pending = false; return result; } case 0x5205: return (multiplier * multiplicand) >> 0; case 0x5206: return (multiplier * multiplicand) >> 8; } } void prg_write(unsigned addr, uint8 data) { if((addr & 0xfc00) == 0x5c00) { //writes 0x00 *during* Vblank (not during screen rendering ...) if(exram_mode == 0 || exram_mode == 1) exram[addr & 0x03ff] = in_frame ? data : 0x00; if(exram_mode == 2) exram[addr & 0x03ff] = data; return; } if(addr >= 0x6000) { prg_access(1, addr, data); return; } switch(addr) { case 0x2000: sprite_8x16 = data & 0x20; break; case 0x2001: //if BG+sprites are disabled; enter video blanking period if((data & 0x18) == 0) blank(); break; case 0x5100: prg_mode = data & 3; break; case 0x5101: chr_mode = data & 3; break; case 0x5102: prgram_write_protect[0] = data & 3; break; case 0x5103: prgram_write_protect[1] = data & 3; break; case 0x5104: exram_mode = data & 3; break; case 0x5105: nametable_mode[0] = (data & 0x03) >> 0; nametable_mode[1] = (data & 0x0c) >> 2; nametable_mode[2] = (data & 0x30) >> 4; nametable_mode[3] = (data & 0xc0) >> 6; break; case 0x5106: fillmode_tile = data; break; case 0x5107: fillmode_color = data & 3; fillmode_color |= fillmode_color << 2; fillmode_color |= fillmode_color << 4; break; case 0x5113: ram_select = data & 0x04; ram_bank = data & 0x03; break; case 0x5114: prg_bank[0] = data; break; case 0x5115: prg_bank[1] = data; break; case 0x5116: prg_bank[2] = data; break; case 0x5117: prg_bank[3] = data | 0x80; break; case 0x5120: chr_sprite_bank[0] = (chr_bank_hi << 8) | data; chr_active = 0; break; case 0x5121: chr_sprite_bank[1] = (chr_bank_hi << 8) | data; chr_active = 0; break; case 0x5122: chr_sprite_bank[2] = (chr_bank_hi << 8) | data; chr_active = 0; break; case 0x5123: chr_sprite_bank[3] = (chr_bank_hi << 8) | data; chr_active = 0; break; case 0x5124: chr_sprite_bank[4] = (chr_bank_hi << 8) | data; chr_active = 0; break; case 0x5125: chr_sprite_bank[5] = (chr_bank_hi << 8) | data; chr_active = 0; break; case 0x5126: chr_sprite_bank[6] = (chr_bank_hi << 8) | data; chr_active = 0; break; case 0x5127: chr_sprite_bank[7] = (chr_bank_hi << 8) | data; chr_active = 0; break; case 0x5128: chr_bg_bank[0] = (chr_bank_hi << 8) | data; chr_active = 1; break; case 0x5129: chr_bg_bank[1] = (chr_bank_hi << 8) | data; chr_active = 1; break; case 0x512a: chr_bg_bank[2] = (chr_bank_hi << 8) | data; chr_active = 1; break; case 0x512b: chr_bg_bank[3] = (chr_bank_hi << 8) | data; chr_active = 1; break; case 0x5130: chr_bank_hi = data & 3; break; case 0x5200: vs_enable = data & 0x80; vs_side = data & 0x40; vs_tile = data & 0x1f; break; case 0x5201: vs_scroll = data; break; case 0x5202: vs_bank = data; break; case 0x5203: irq_line = data; break; case 0x5204: irq_enable = data & 0x80; break; case 0x5205: multiplicand = data; break; case 0x5206: multiplier = data; break; } } unsigned chr_sprite_addr(unsigned addr) { if(chr_mode == 0) { auto bank = chr_sprite_bank[7]; return (bank * 0x2000) + (addr & 0x1fff); } if(chr_mode == 1) { auto bank = chr_sprite_bank[(addr / 0x1000) * 4 + 3]; return (bank * 0x1000) + (addr & 0x0fff); } if(chr_mode == 2) { auto bank = chr_sprite_bank[(addr / 0x0800) * 2 + 1]; return (bank * 0x0800) + (addr & 0x07ff); } if(chr_mode == 3) { auto bank = chr_sprite_bank[(addr / 0x0400)]; return (bank * 0x0400) + (addr & 0x03ff); } } unsigned chr_bg_addr(unsigned addr) { addr &= 0x0fff; if(chr_mode == 0) { auto bank = chr_bg_bank[3]; return (bank * 0x2000) + (addr & 0x0fff); } if(chr_mode == 1) { auto bank = chr_bg_bank[3]; return (bank * 0x1000) + (addr & 0x0fff); } if(chr_mode == 2) { auto bank = chr_bg_bank[(addr / 0x0800) * 2 + 1]; return (bank * 0x0800) + (addr & 0x07ff); } if(chr_mode == 3) { auto bank = chr_bg_bank[(addr / 0x0400)]; return (bank * 0x0400) + (addr & 0x03ff); } } unsigned chr_vs_addr(unsigned addr) { return (vs_bank * 0x1000) + (addr & 0x0ff8) + (vs_vpos & 7); } void blank() { in_frame = false; } void scanline() { hcounter = 0; if(in_frame == false) { in_frame = true; irq_pending = false; vcounter = 0; } else { if(vcounter == irq_line) irq_pending = true; vcounter++; } cpu_cycle_counter = 0; } uint8 ciram_read(unsigned addr) { if(vs_fetch && (hcounter & 2) == 0) return exram[vs_vpos / 8 * 32 + vs_hpos / 8]; if(vs_fetch && (hcounter & 2) != 0) return exram[vs_vpos / 32 * 8 + vs_hpos / 32 + 0x03c0]; switch(nametable_mode[(addr >> 10) & 3]) { case 0: return ppu.ciram_read(0x0000 | (addr & 0x03ff)); case 1: return ppu.ciram_read(0x0400 | (addr & 0x03ff)); case 2: return exram_mode < 2 ? exram[addr & 0x03ff] : 0x00; case 3: return (hcounter & 2) == 0 ? fillmode_tile : fillmode_color; } } uint8 chr_read(unsigned addr) { chr_access[0] = chr_access[1]; chr_access[1] = chr_access[2]; chr_access[2] = chr_access[3]; chr_access[3] = addr; //detect two unused nametable fetches at end of each scanline if((chr_access[0] & 0x2000) == 0 && (chr_access[1] & 0x2000) && (chr_access[2] & 0x2000) && (chr_access[3] & 0x2000)) scanline(); if(in_frame == false) { vs_fetch = false; if(addr & 0x2000) return ciram_read(addr); return board.chrrom.read(chr_active ? chr_bg_addr(addr) : chr_sprite_addr(addr)); } bool bg_fetch = (hcounter < 256 || hcounter >= 320); uint8 result = 0x00; if((hcounter & 7) == 0) { vs_hpos = hcounter >= 320 ? hcounter - 320 : hcounter + 16; vs_vpos = vcounter + vs_scroll; vs_fetch = vs_enable && bg_fetch && exram_mode < 2 && (vs_side ? vs_hpos / 8 >= vs_tile : vs_hpos / 8 < vs_tile); if(vs_vpos >= 240) vs_vpos -= 240; result = ciram_read(addr); exbank = (chr_bank_hi << 6) | (exram[addr & 0x03ff] & 0x3f); exattr = exram[addr & 0x03ff] >> 6; exattr |= exattr << 2; exattr |= exattr << 4; } else if((hcounter & 7) == 2) { result = ciram_read(addr); if(bg_fetch && exram_mode == 1) result = exattr; } else { if(vs_fetch) result = board.chrrom.read(chr_vs_addr(addr)); else if(sprite_8x16 ? bg_fetch : chr_active) result = board.chrrom.read(chr_bg_addr(addr)); else result = board.chrrom.read(chr_sprite_addr(addr)); if(bg_fetch && exram_mode == 1) result = board.chrrom.read(exbank * 0x1000 + (addr & 0x0fff)); } hcounter += 2; return result; } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) { switch(nametable_mode[(addr >> 10) & 3]) { case 0: return ppu.ciram_write(0x0000 | (addr & 0x03ff), data); case 1: return ppu.ciram_write(0x0400 | (addr & 0x03ff), data); case 2: exram[addr & 0x03ff] = data; break; } } } void power() { } void reset() { for(auto& n : exram) n = 0xff; prg_mode = 3; chr_mode = 0; for(auto& n : prgram_write_protect) n = 0; exram_mode = 0; for(auto& n : nametable_mode) n = 0; fillmode_tile = 0; fillmode_color = 0; ram_select = 0; ram_bank = 0; prg_bank[0] = 0x00; prg_bank[1] = 0x00; prg_bank[2] = 0x00; prg_bank[3] = 0xff; for(auto& n : chr_sprite_bank) n = 0; for(auto& n : chr_bg_bank) n = 0; chr_bank_hi = 0; vs_enable = 0; vs_side = 0; vs_tile = 0; vs_scroll = 0; vs_bank = 0; irq_line = 0; irq_enable = 0; multiplicand = 0; multiplier = 0; cpu_cycle_counter = 0; irq_counter = 0; irq_pending = 0; in_frame = 0; vcounter = 0; hcounter = 0; for(auto& n : chr_access) n = 0; chr_active = 0; sprite_8x16 = 0; exbank = 0; exattr = 0; vs_fetch = 0; vs_vpos = 0; vs_hpos = 0; } void serialize(serializer& s) { s.array(exram); s.integer(prg_mode); s.integer(chr_mode); for(auto& n : prgram_write_protect) s.integer(n); s.integer(exram_mode); for(auto& n : nametable_mode) s.integer(n); s.integer(fillmode_tile); s.integer(fillmode_color); s.integer(ram_select); s.integer(ram_bank); for(auto& n : prg_bank) s.integer(n); for(auto& n : chr_sprite_bank) s.integer(n); for(auto& n : chr_bg_bank) s.integer(n); s.integer(chr_bank_hi); s.integer(vs_enable); s.integer(vs_side); s.integer(vs_tile); s.integer(vs_scroll); s.integer(vs_bank); s.integer(irq_line); s.integer(irq_enable); s.integer(multiplicand); s.integer(multiplier); s.integer(cpu_cycle_counter); s.integer(irq_counter); s.integer(irq_pending); s.integer(in_frame); s.integer(vcounter); s.integer(hcounter); for(auto& n : chr_access) s.integer(n); s.integer(chr_active); s.integer(sprite_8x16); s.integer(exbank); s.integer(exattr); s.integer(vs_fetch); s.integer(vs_vpos); s.integer(vs_hpos); } MMC5(Board& board) : Chip(board) { revision = Revision::MMC5; } }; phoenix/reference/desktop.cpp000664 001750 001750 00000000176 12651764221 017501 0ustar00sergiosergio000000 000000 namespace phoenix { Size pDesktop::size() { return {0, 0}; } Geometry pDesktop::workspace() { return {0, 0, 0, 0}; } } ananke/game-boy-advance.cpp000664 001750 001750 00000004026 12651764221 016752 0ustar00sergiosergio000000 000000 void Ananke::copyGameBoyAdvanceSaves(const string &pathname) { if(!file::exists({pathname, "save.ram"})) { if(file::exists({information.path, nall::basename(information.name), ".sav"})) { file::copy({information.path, nall::basename(information.name), ".sav"}, {pathname, "save.ram"}); } } if(!file::exists({pathname, "rtc.ram"})) { if(file::exists({information.path, nall::basename(information.name), ".rtc"})) { file::copy({information.path, nall::basename(information.name), ".rtc"}, {pathname, "rtc.ram"}); } } } string Ananke::createGameBoyAdvanceHeuristic(vector &buffer) { string pathname = { libraryPath, "Game Boy Advance/", nall::basename(information.name), ".gba/" }; directory::create(pathname); GameBoyAdvanceCartridge info(buffer.data(), buffer.size()); string markup = {"unverified\n\n", info.markup}; markup.append("\ninformation\n title: ", nall::basename(information.name), "\n"); if(!information.manifest.empty()) markup = information.manifest; //override with embedded beat manifest, if one exists file::write({pathname, "manifest.bml"}, markup); file::write({pathname, "program.rom"}, buffer); copyGameBoyAdvanceSaves(pathname); return pathname; } string Ananke::openGameBoyAdvance(vector &buffer) { return createGameBoyAdvanceHeuristic(buffer); } string Ananke::syncGameBoyAdvance(const string &pathname) { auto buffer = file::read({pathname, "program.rom"}); if(buffer.size() == 0) return ""; auto save = file::read({pathname, "save.ram"}); if(save.size() == 0) save = file::read({pathname, "save.rwm"}); auto rtc = file::read({pathname, "rtc.ram"}); if(rtc.size() == 0) rtc = file::read({pathname, "rtc.rwm"}); directory::remove(pathname); information.path = pathname; information.name = notdir(string{pathname}.rtrim<1>("/")); string outputPath = openGameBoyAdvance(buffer); if(save.size()) file::write({outputPath, "save.ram"}, save); if(rtc.size()) file::write({outputPath, "rtc.ram"}, rtc); return outputPath; } ruby/ruby.hpp000664 001750 001750 00000003746 12651764221 014375 0ustar00sergiosergio000000 000000 /* ruby version: 0.11 (2013-12-19) license: public domain */ #ifndef RUBY_H #define RUBY_H #include namespace ruby { #include #include #include struct VideoInterface { void driver(const char* driver = ""); const char* optimalDriver(); const char* safestDriver(); const char* availableDrivers(); bool init(); void term(); bool cap(const nall::string& name); nall::any get(const nall::string& name); bool set(const nall::string& name, const nall::any& value); bool lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height); void unlock(); void clear(); void refresh(); VideoInterface(); ~VideoInterface(); private: Video* p = nullptr; }; struct AudioInterface { void driver(const char* driver = ""); const char* optimalDriver(); const char* safestDriver(); const char* availableDrivers(); bool init(); void term(); bool cap(const nall::string& name); nall::any get(const nall::string& name); bool set(const nall::string& name, const nall::any& value); void sample(uint16_t left, uint16_t right); void clear(); AudioInterface(); ~AudioInterface(); private: Audio* p = nullptr; }; struct InputInterface { nall::function onChange; void driver(const char* driver = ""); const char* optimalDriver(); const char* safestDriver(); const char* availableDrivers(); bool init(); void term(); bool cap(const nall::string& name); nall::any get(const nall::string& name); bool set(const nall::string& name, const nall::any& value); bool acquire(); bool unacquire(); bool acquired(); nall::vector poll(); bool rumble(uint64_t id, bool enable); InputInterface(); ~InputInterface(); private: Input* p = nullptr; }; extern VideoInterface video; extern AudioInterface audio; extern InputInterface input; }; #endif processor/r6502/memory.cpp000664 001750 001750 00000001152 12651764221 016520 0ustar00sergiosergio000000 000000 uint8 R6502::op_readpc() { return op_read(regs.pc); } uint8 R6502::op_readpci() { return op_read(regs.pc++); } uint8 R6502::op_readsp() { return op_read(0x0100 | ++regs.s); } uint8 R6502::op_readzp(uint8 addr) { return op_read(addr); } // void R6502::op_writesp(uint8 data) { op_write(0x0100 | regs.s--, data); } void R6502::op_writezp(uint8 addr, uint8 data) { op_write(addr, data); } // void R6502::op_page(uint16 x, uint16 y) { if((x & 0xff00) != (y & 0xff00)) op_read((x & 0xff00) | (y & 0x00ff)); } void R6502::op_page_always(uint16 x, uint16 y) { op_read((x & 0xff00) | (y & 0x00ff)); } gb/cartridge/mmm01/mmm01.hpp000664 001750 001750 00000000333 12651764221 016632 0ustar00sergiosergio000000 000000 struct MMM01 : MMIO { bool rom_mode; uint8 rom_base; bool ram_enable; uint8 rom_select; uint8 ram_select; uint8 mmio_read(uint16 addr); void mmio_write(uint16 addr, uint8 data); void power(); } mmm01; phoenix/windows/widget/check-button.cpp000664 001750 001750 00000005302 12651764221 021431 0ustar00sergiosergio000000 000000 namespace phoenix { Size pCheckButton::minimumSize() { Size size = pFont::size(hfont, checkButton.state.text); if(checkButton.state.orientation == Orientation::Horizontal) { size.width += checkButton.state.image.width; size.height = max(checkButton.state.image.height, size.height); } if(checkButton.state.orientation == Orientation::Vertical) { size.width = max(checkButton.state.image.width, size.width); size.height += checkButton.state.image.height; } return {size.width + 20, size.height + 10}; } void pCheckButton::setChecked(bool checked) { SendMessage(hwnd, BM_SETCHECK, (WPARAM)checked, 0); } void pCheckButton::setImage(const image& image, Orientation orientation) { nall::image nallImage = image; nallImage.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0); if(hbitmap) { DeleteObject(hbitmap); hbitmap = 0; } if(himagelist) { ImageList_Destroy(himagelist); himagelist = 0; } if(OsVersion() < WindowsVista) nallImage.alphaBlend(GetSysColor(COLOR_BTNFACE)); hbitmap = CreateBitmap(nallImage); himagelist = ImageList_Create(nallImage.width, nallImage.height, ILC_COLOR32, 1, 0); ImageList_Add(himagelist, hbitmap, NULL); BUTTON_IMAGELIST list; list.himl = himagelist; switch(orientation) { case Orientation::Horizontal: SetRect(&list.margin, 5, 0, 0, 0); list.uAlign = BUTTON_IMAGELIST_ALIGN_LEFT; break; case Orientation::Vertical: SetRect(&list.margin, 0, 5, 0, 0); list.uAlign = BUTTON_IMAGELIST_ALIGN_TOP; break; } Button_SetImageList(hwnd, &list); setText(checkButton.state.text); } void pCheckButton::setText(string text) { if(text.empty()) { SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | BS_BITMAP); } else { SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~BS_BITMAP); } SetWindowText(hwnd, utf16_t(text)); } void pCheckButton::constructor() { hwnd = CreateWindow(L"BUTTON", L"", WS_CHILD | WS_TABSTOP | BS_CHECKBOX | BS_PUSHLIKE, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&checkButton); setDefaultFont(); setChecked(checkButton.state.checked); setImage(checkButton.state.image, checkButton.state.orientation); //setText(checkButton.state.text); synchronize(); } void pCheckButton::destructor() { if(hbitmap) { DeleteObject(hbitmap); hbitmap = 0; } if(himagelist) { ImageList_Destroy(himagelist); himagelist = 0; } DestroyWindow(hwnd); } void pCheckButton::orphan() { destructor(); constructor(); } void pCheckButton::onToggle() { checkButton.state.checked = !checkButton.state.checked; setChecked(checkButton.state.checked); if(checkButton.onToggle) checkButton.onToggle(); } } fc/cartridge/cartridge.cpp000664 001750 001750 00000003131 12651764221 016712 0ustar00sergiosergio000000 000000 #include namespace Famicom { #include "chip/chip.cpp" #include "board/board.cpp" Cartridge cartridge; string Cartridge::title() { return information.title; } void Cartridge::Main() { cartridge.main(); } void Cartridge::main() { board->main(); } void Cartridge::load() { interface->loadRequest(ID::Manifest, "manifest.bml"); Board::load(information.markup); //this call will set Cartridge::board if successful if(board == nullptr) return; sha256_ctx sha; uint8 hash[32]; sha256_init(&sha); sha256_chunk(&sha, board->prgrom.data, board->prgrom.size); sha256_chunk(&sha, board->chrrom.data, board->chrrom.size); sha256_final(&sha); sha256_hash(&sha, hash); string result; for(auto& byte : hash) result.append(hex<2>(byte)); sha256 = result; system.load(); loaded = true; } void Cartridge::unload() { if(loaded == false) return; loaded = false; memory.reset(); } void Cartridge::power() { board->power(); } void Cartridge::reset() { create(Cartridge::Main, 21477272); board->reset(); } Cartridge::Cartridge() { loaded = false; } uint8 Cartridge::prg_read(unsigned addr) { return board->prg_read(addr); } void Cartridge::prg_write(unsigned addr, uint8 data) { return board->prg_write(addr, data); } uint8 Cartridge::chr_read(unsigned addr) { return board->chr_read(addr); } void Cartridge::chr_write(unsigned addr, uint8 data) { return board->chr_write(addr, data); } void Cartridge::scanline(unsigned y) { return board->scanline(y); } void Cartridge::serialize(serializer& s) { Thread::serialize(s); return board->serialize(s); } } phoenix/qt/desktop.cpp000664 001750 001750 00000000461 12651764221 016164 0ustar00sergiosergio000000 000000 namespace phoenix { Size pDesktop::size() { QRect rect = QApplication::desktop()->screenGeometry(); return {rect.width(), rect.height()}; } Geometry pDesktop::workspace() { QRect rect = QApplication::desktop()->availableGeometry(); return {rect.x(), rect.y(), rect.width(), rect.height()}; } } target-ethos/settings/audio.hpp000664 001750 001750 00000000704 12651764221 017771 0ustar00sergiosergio000000 000000 struct AudioSlider : HorizontalLayout { Label name; Label value; HorizontalSlider slider; AudioSlider(); }; struct AudioSettings : SettingsLayout { HorizontalLayout controlLayout; Label frequencyLabel; ComboButton frequency; Label latencyLabel; ComboButton latency; Label resamplerLabel; ComboButton resampler; AudioSlider volume; void synchronize(); AudioSettings(); }; extern AudioSettings* audioSettings; phoenix/reference/widget/layout.hpp000664 001750 001750 00000000221 12651764221 020624 0ustar00sergiosergio000000 000000 namespace phoenix { struct pLayout : public pSizable { Layout& layout; pLayout(Layout& layout) : pSizable(layout), layout(layout) {} }; } sfc/chip/sgb-external/sgb-external.cpp000664 001750 001750 00000004315 12651764221 021103 0ustar00sergiosergio000000 000000 #include #define SGBEXTERNAL_CPP namespace SuperFamicom { SGBExternal sgbExternal; #include "serialization.cpp" bool SGBExternal::load_library(const char * path) { if(open_absolute(path)) { void* symbol; #define SYM(x) symbol=sym(#x); if (!symbol) return false; x=symbol; SYM(sgb_rom); SYM(sgb_ram); SYM(sgb_rtc); SYM(sgb_init); SYM(sgb_term); SYM(sgb_power); SYM(sgb_reset); SYM(sgb_row); SYM(sgb_read); SYM(sgb_write); SYM(sgb_run); SYM(sgb_save); SYM(sgb_serialize); #undef SYM return true; } return false; } void SGBExternal::Enter() { sgbExternal.enter(); } void SGBExternal::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } unsigned samples = sgb_run(samplebuffer, 16); for(unsigned i = 0; i < samples; i++) { int16 left = samplebuffer[i] >> 0; int16 right = samplebuffer[i] >> 16; //SNES audio is notoriously quiet; lower Game Boy samples to match SGB sound effects audio.coprocessor_sample(left / 3, right / 3); } step(samples); synchronize_cpu(); } } void SGBExternal::init() { } void SGBExternal::load() { } void SGBExternal::unload() { sgb_term(); } void SGBExternal::power() { unsigned frequency = (revision == 1 ? system.cpu_frequency() / 10 : 2097152); create(SGBExternal::Enter, frequency); audio.coprocessor_enable(true); audio.coprocessor_frequency(revision == 1 ? 2147727.0 : 2097152.0); sgb_rom(GameBoy::cartridge.romdata, GameBoy::cartridge.romsize); sgb_ram(GameBoy::cartridge.ramdata, GameBoy::cartridge.ramsize); sgb_rtc(NULL, 0); bool version = (revision == 1) ? 0 : 1; if(sgb_init) sgb_init(version); if(sgb_power) sgb_power(); } void SGBExternal::reset() { sgb_reset(); } uint8 SGBExternal::read(unsigned addr) { if ((addr&0xFFFF)==0x7800) { static int x=319; static int y=11; x++; if (x==320) { x=0; sgb_row(y++); //printf("%.6x\n",(unsigned) cpu.status.wram_addr); if (y==18) y=0; } } return sgb_read(addr); } void SGBExternal::write(unsigned addr, uint8 data) { sgb_write(addr, data); } } ruby/input/keyboard/rawinput.cpp000664 001750 001750 00000012613 12651764221 020210 0ustar00sergiosergio000000 000000 #ifndef RUBY_INPUT_KEYBOARD_RAWINPUT #define RUBY_INPUT_KEYBOARD_RAWINPUT namespace ruby { struct InputKeyboardRawInput { struct Key { uint16_t code; uint16_t flag; string name; bool value; }; vector keys; struct Keyboard { HID::Keyboard hid; } kb; void update(RAWINPUT* input) { unsigned code = input->data.keyboard.MakeCode; unsigned flag = input->data.keyboard.Flags; for(auto& key : keys) { if(key.code != code) continue; key.value = (key.flag == flag); } } void assign(unsigned inputID, bool value) { auto& group = kb.hid.group[HID::Keyboard::GroupID::Button]; if(group.input[inputID].value == value) return; if(input.onChange) input.onChange(kb.hid, HID::Keyboard::GroupID::Button, inputID, group.input[inputID].value, value); group.input[inputID].value = value; } void poll(vector& devices) { for(unsigned n = 0; n < keys.size(); n++) assign(n, keys[n].value); devices.append(&kb.hid); } bool init() { rawinput.updateKeyboard = {&InputKeyboardRawInput::update, this}; //Pause sends 0x001d,4 + 0x0045,0; NumLock sends only 0x0045,0 //pressing Pause will falsely trigger NumLock //further, pause sends its key release even while button is held down //because of this, we cannot map either reliably keys.append({0x0001, 0, "Escape"}); keys.append({0x003b, 0, "F1"}); keys.append({0x003c, 0, "F2"}); keys.append({0x003d, 0, "F3"}); keys.append({0x003e, 0, "F4"}); keys.append({0x003f, 0, "F5"}); keys.append({0x0040, 0, "F6"}); keys.append({0x0041, 0, "F7"}); keys.append({0x0042, 0, "F8"}); keys.append({0x0043, 0, "F9"}); keys.append({0x0044, 0, "F10"}); keys.append({0x0057, 0, "F11"}); keys.append({0x0058, 0, "F12"}); keys.append({0x0037, 2, "PrintScreen"}); keys.append({0x0046, 0, "ScrollLock"}); //keys.append({0x001d, 4, "Pause"}); keys.append({0x0029, 0, "Tilde"}); keys.append({0x0002, 0, "Num1"}); keys.append({0x0003, 0, "Num2"}); keys.append({0x0004, 0, "Num3"}); keys.append({0x0005, 0, "Num4"}); keys.append({0x0006, 0, "Num5"}); keys.append({0x0007, 0, "Num6"}); keys.append({0x0008, 0, "Num7"}); keys.append({0x0009, 0, "Num8"}); keys.append({0x000a, 0, "Num9"}); keys.append({0x000b, 0, "Num0"}); keys.append({0x000c, 0, "Dash"}); keys.append({0x000d, 0, "Equal"}); keys.append({0x000e, 0, "Backspace"}); keys.append({0x0052, 2, "Insert"}); keys.append({0x0053, 2, "Delete"}); keys.append({0x0047, 2, "Home"}); keys.append({0x004f, 2, "End"}); keys.append({0x0049, 2, "PageUp"}); keys.append({0x0051, 2, "PageDown"}); keys.append({0x001e, 0, "A"}); keys.append({0x0030, 0, "B"}); keys.append({0x002e, 0, "C"}); keys.append({0x0020, 0, "D"}); keys.append({0x0012, 0, "E"}); keys.append({0x0021, 0, "F"}); keys.append({0x0022, 0, "G"}); keys.append({0x0023, 0, "H"}); keys.append({0x0017, 0, "I"}); keys.append({0x0024, 0, "J"}); keys.append({0x0025, 0, "K"}); keys.append({0x0026, 0, "L"}); keys.append({0x0032, 0, "M"}); keys.append({0x0031, 0, "N"}); keys.append({0x0018, 0, "O"}); keys.append({0x0019, 0, "P"}); keys.append({0x0010, 0, "Q"}); keys.append({0x0013, 0, "R"}); keys.append({0x001f, 0, "S"}); keys.append({0x0014, 0, "T"}); keys.append({0x0016, 0, "U"}); keys.append({0x002f, 0, "V"}); keys.append({0x0011, 0, "W"}); keys.append({0x002d, 0, "X"}); keys.append({0x0015, 0, "Y"}); keys.append({0x002c, 0, "Z"}); keys.append({0x001a, 0, "LeftBracket"}); keys.append({0x001b, 0, "RightBracket"}); keys.append({0x002b, 0, "Backslash"}); keys.append({0x0027, 0, "Semicolon"}); keys.append({0x0028, 0, "Apostrophe"}); keys.append({0x0033, 0, "Comma"}); keys.append({0x0034, 0, "Period"}); keys.append({0x0035, 0, "Slash"}); keys.append({0x004f, 0, "Keypad1"}); keys.append({0x0050, 0, "Keypad2"}); keys.append({0x0051, 0, "Keypad3"}); keys.append({0x004b, 0, "Keypad4"}); keys.append({0x004c, 0, "Keypad5"}); keys.append({0x004d, 0, "Keypad6"}); keys.append({0x0047, 0, "Keypad7"}); keys.append({0x0048, 0, "Keypad8"}); keys.append({0x0049, 0, "Keypad9"}); keys.append({0x0052, 0, "Keypad0"}); keys.append({0x0053, 0, "Point"}); keys.append({0x001c, 2, "Enter"}); keys.append({0x004e, 0, "Add"}); keys.append({0x004a, 0, "Subtract"}); keys.append({0x0037, 0, "Multiply"}); keys.append({0x0035, 2, "Divide"}); //keys.append({0x0045, 0, "NumLock"}); keys.append({0x003a, 0, "CapsLock"}); keys.append({0x0048, 2, "Up"}); keys.append({0x0050, 2, "Down"}); keys.append({0x004b, 2, "Left"}); keys.append({0x004d, 2, "Right"}); keys.append({0x000f, 0, "Tab"}); keys.append({0x001c, 0, "Return"}); keys.append({0x0039, 0, "Spacebar"}); keys.append({0x002a, 0, "LeftShift"}); keys.append({0x0036, 0, "RightShift"}); keys.append({0x001d, 0, "LeftControl"}); keys.append({0x001d, 2, "RightControl"}); keys.append({0x0038, 0, "LeftAlt"}); keys.append({0x0038, 2, "RightAlt"}); keys.append({0x005b, 2, "LeftSuper"}); keys.append({0x005c, 2, "RightSuper"}); keys.append({0x005d, 2, "Menu"}); kb.hid.id = 1; for(auto& key : keys) kb.hid.button().append({key.name}); return true; } void term() { } }; } #endif phoenix/windows/browser-window.cpp000664 001750 001750 00000006344 12651764221 020557 0ustar00sergiosergio000000 000000 namespace phoenix { static int CALLBACK BrowserWindowCallbackProc(HWND hwnd, UINT msg, LPARAM lparam, LPARAM lpdata) { if(msg == BFFM_INITIALIZED) { if(lpdata) { auto state = (BrowserWindow::State*)lpdata; utf16_t wpath(string{state->path}.transform("/", "\\")); if(state->title) SetWindowText(hwnd, utf16_t(state->title)); SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)(wchar_t*)wpath); } } return 0; } static string BrowserWindow_fileDialog(bool save, BrowserWindow::State& state) { string path = string{state.path}.replace("/", "\\"); string filters; for(auto& filter : state.filters) { lstring part = filter.split("("); if(part.size() != 2) continue; part[1].rtrim<1>(")"); part[1].replace(" ", ""); part[1].transform(",", ";"); filters.append(filter, "\t", part[1], "\t"); } utf16_t wfilters(filters); wchar_t wname[PATH_MAX + 1] = L""; utf16_t wpath(path); utf16_t wtitle(state.title); wchar_t* p = wfilters; while(*p != L'\0') { if(*p == L'\t') *p = L'\0'; p++; } if(path.empty() == false) { //clear COMDLG32 MRU (most recently used) file list //this is required in order for lpstrInitialDir to be honored in Windows 7 and above registry::remove("HKCU/Software/Microsoft/Windows/CurrentVersion/Explorer/ComDlg32/LastVisitedPidlMRU/"); registry::remove("HKCU/Software/Microsoft/Windows/CurrentVersion/Explorer/ComDlg32/OpenSavePidlMRU/"); } OPENFILENAME ofn; memset(&ofn, 0, sizeof(OPENFILENAME)); ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = state.parent ? state.parent->p.hwnd : 0; ofn.lpstrFilter = wfilters; ofn.lpstrInitialDir = wpath; ofn.lpstrFile = wname; ofn.lpstrTitle = wtitle; ofn.nMaxFile = PATH_MAX; ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; ofn.lpstrDefExt = L""; bool result = (save == false ? GetOpenFileName(&ofn) : GetSaveFileName(&ofn)); if(result == false) return ""; string name = (const char*)utf8_t(wname); name.transform("\\", "/"); return name; } string pBrowserWindow::directory(BrowserWindow::State& state) { wchar_t wname[PATH_MAX + 1] = L""; BROWSEINFO bi; bi.hwndOwner = state.parent ? state.parent->p.hwnd : 0; bi.pidlRoot = NULL; bi.pszDisplayName = wname; bi.lpszTitle = L"\nChoose a directory:"; bi.ulFlags = BIF_NEWDIALOGSTYLE | BIF_RETURNONLYFSDIRS; bi.lpfn = BrowserWindowCallbackProc; bi.lParam = (LPARAM)&state; bi.iImage = 0; bool result = false; LPITEMIDLIST pidl = SHBrowseForFolder(&bi); if(pidl) { if(SHGetPathFromIDList(pidl, wname)) { result = true; IMalloc *imalloc = 0; if(SUCCEEDED(SHGetMalloc(&imalloc))) { imalloc->Free(pidl); imalloc->Release(); } } } if(result == false) return ""; string name = (const char*)utf8_t(wname); if(!name) return ""; name.transform("\\", "/"); if(name.endsWith("/") == false) name.append("/"); return name; } string pBrowserWindow::open(BrowserWindow::State& state) { return BrowserWindow_fileDialog(0, state); } string pBrowserWindow::save(BrowserWindow::State& state) { return BrowserWindow_fileDialog(1, state); } } LICENSE000664 001750 001750 00000104460 12651764221 012722 0ustar00sergiosergio000000 000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. {one line to give the program's name and a brief idea of what it does.} Copyright (C) {year} {name of author} This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: {project} Copyright (C) {year} {fullname} This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read .sfc/sfc.hpp000664 001750 001750 00000003426 12651764221 013754 0ustar00sergiosergio000000 000000 #ifndef SFC_HPP #define SFC_HPP #include #include #include #include #include #include #include namespace SuperFamicom { namespace Info { static const char Name[] = "bsnes"; static const unsigned SerializerVersion = 27; } } /* bsnes - Super Famicom emulator author: byuu license: GPLv3 project started: 2004-10-14 */ #include #include namespace SuperFamicom { struct Thread { cothread_t thread; unsigned frequency; int64 clock; inline void create(void (*entrypoint)(), unsigned frequency) { if(thread) co_delete(thread); thread = co_create(65536 * sizeof(void*), entrypoint); this->frequency = frequency; clock = 0; } inline void serialize(serializer& s) { s.integer(frequency); s.integer(clock); } inline Thread() : thread(nullptr) { } inline ~Thread() { if(thread) co_delete(thread); } }; #include #include #if defined(PROFILE_ACCURACY) #include "profile-accuracy.hpp" #elif defined(PROFILE_BALANCED) #include "profile-balanced.hpp" #elif defined(PROFILE_PERFORMANCE) #include "profile-performance.hpp" #endif #include #include #include #include #include #include #include #include #include #include } #endif changes-libretro.diff000664 001750 001750 00000056232 12651764221 016002 0ustar00sergiosergio000000 000000 --- ../bsnes-libretro/target-libretro/libretro.cpp 2015-04-23 18:11:06.227925641 +0200 +++ target-libretro/libretro.cpp 2015-04-23 17:17:56.059865750 +0200 @@ -64,9 +64,21 @@ /*fffe*/ 0xc0, 0xff //reset vector location ($ffc0) }; +static void retro_log_default(enum retro_log_level level, const char *fmt, ...) +{ + fprintf(stderr, "[bsnes]: "); + va_list args; + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); +} +static retro_log_printf_t output; + +static const char * read_opt(const char * name, const char * defval); + struct Callbacks : Emulator::Interface::Bind { retro_video_refresh_t pvideo_refresh; - retro_audio_sample_batch_t paudio_sample; + retro_audio_sample_batch_t paudio; retro_input_poll_t pinput_poll; retro_input_state_t pinput_state; retro_environment_t penviron; @@ -129,7 +141,7 @@ uint16_t video_buffer_16[512 * 480]; }; - void videoRefresh(const uint32_t *palette, const uint32_t *data, unsigned pitch, unsigned width, unsigned height) { + void videoRefresh(const uint32_t* palette, const uint32_t* data, unsigned pitch, unsigned width, unsigned height) override { if (!overscan) { data += 8 * 1024; @@ -161,20 +173,26 @@ } } - void audioSample(int16_t left, int16_t right) - { - const int16_t samples[2] = { left, right }; - paudio_sample(samples, 1); + int16_t sampleBuf[128]; + unsigned int sampleBufPos; + + void audioSample(int16_t left, int16_t right) override { + sampleBuf[sampleBufPos++] = left; + sampleBuf[sampleBufPos++] = right; + if(sampleBufPos==128) { + paudio(sampleBuf, 64); + sampleBufPos = 0; + } } - int16_t inputPoll(unsigned port, unsigned device, unsigned id) { + int16_t inputPoll(unsigned port, unsigned device, unsigned id) override { if(id > 11) return 0; return pinput_state(port, snes_to_retro(device), 0, snes_to_retro(device, id)); } - void saveRequest(unsigned id, string p) { + void saveRequest(unsigned id, string p) override { if (manifest) { - fprintf(stderr, "[bsnes]: [Save]: ID %u, Request \"%s\".\n", id, (const char*)p); + output(RETRO_LOG_INFO, "[Save]: ID %u, Request \"%s\".\n", id, (const char*)p); string save_path = {path(0), p}; filestream stream(save_path, file::mode::write); iface->save(id, stream); @@ -196,11 +214,11 @@ mmapstream stream(load_path); iface->load(id, stream); } else { - fprintf(stderr, "[bsnes]: Cannot find requested file in system directory: \"%s\".\n", (const char*)load_path); + output(RETRO_LOG_ERROR, "Cannot find requested file in system directory: \"%s\".\n", (const char*)load_path); load_request_error = true; } } else { - fprintf(stderr, "[bsnes]: Cannot find requested file: \"%s\" in ROM directory nor system directory.\n", (const char*)p); + output(RETRO_LOG_ERROR, "Cannot find requested file: \"%s\" in ROM directory nor system directory.\n", (const char*)p); load_request_error = true; } } @@ -231,7 +249,7 @@ } void loadRequestManifest(unsigned id, const string& p) { - fprintf(stderr, "[bsnes]: [Manifest]: ID %u, Request \"%s\".\n", id, (const char*)p); + output(RETRO_LOG_INFO, "[Manifest]: ID %u, Request \"%s\".\n", id, (const char*)p); switch(id) { case SuperFamicom::ID::IPLROM: loadIPLROM(id); @@ -248,7 +266,7 @@ } void loadRequestMemory(unsigned id, const string& p) { - fprintf(stderr, "[bsnes]: [Memory]: ID %u, Request \"%s\".\n", id, (const char*)p); + output(RETRO_LOG_INFO, "[Memory]: ID %u, Request \"%s\".\n", id, (const char*)p); switch(id) { case SuperFamicom::ID::Manifest: loadManifest(id); @@ -264,7 +282,7 @@ case SuperFamicom::ID::SDD1ROM: case SuperFamicom::ID::HitachiDSPROM: case SuperFamicom::ID::SPC7110PROM: - fprintf(stderr, "[bsnes]: Load ROM.\n"); + output(RETRO_LOG_INFO, "Load ROM.\n"); loadROM(id); break; @@ -319,37 +337,37 @@ break; default: - fprintf(stderr, "[bsnes]: Load BIOS.\n"); + output(RETRO_LOG_INFO, "Load BIOS.\n"); loadFile(id, p); break; } } - void loadRequest(unsigned id, string p) { + void loadRequest(unsigned id, string p) override { if (manifest) loadRequestManifest(id, p); else loadRequestMemory(id, p); - fprintf(stderr, "[bsnes]: Complete load request.\n"); + output(RETRO_LOG_INFO, "Complete load request.\n"); } - void loadRequest(unsigned id, string p, string manifest) { + void loadRequest(unsigned id, string p, string manifest) override { switch (id) { case SuperFamicom::ID::SuperGameBoy: - fprintf(stderr, "[bsnes]: Loading GB ROM.\n"); + output(RETRO_LOG_INFO, "Loading GB ROM.\n"); loadSGBROMManifest(id); break; default: - fprintf(stderr, "[bsnes]: Didn't do anything with loadRequest (3 arg).\n"); + output(RETRO_LOG_INFO, "Didn't do anything with loadRequest (3 arg).\n"); } } - string path(unsigned) { + string path(unsigned) override { return string(basename); } - uint32_t videoColor(unsigned, uint16_t, uint16_t r, uint16_t g, uint16_t b) { + uint32_t videoColor(unsigned, uint16_t, uint16_t r, uint16_t g, uint16_t b) override { r >>= 8; g >>= 8; b >>= 8; @@ -357,10 +375,43 @@ if (video_fmt == video_fmt_16) return (r>>3 << 11) | (g>>2 << 5) | (b>>3 << 0); if (video_fmt == video_fmt_15) return (r>>3 << 10) | (g>>3 << 5) | (b>>3 << 0); } + + void notify(string text) { + output(RETRO_LOG_ERROR, "%s\n", (const char*)text); + } + + unsigned altImplementation(unsigned item) override { + if (item==SuperFamicom::Alt::ForDSP) + { + if (!strcmp(read_opt("bsnes_chip_hle", "LLE"), "HLE")) return SuperFamicom::Alt::DSP::HLE; + else return SuperFamicom::Alt::DSP::LLE; + } +#ifdef EXPERIMENTAL_FEATURES + if (item==SuperFamicom::Alt::ForSuperGameBoy) + { + if (!strcmp(read_opt("bsnes_sgb_core", "Internal"), "Gambatte")) return SuperFamicom::Alt::SuperGameBoy::External; + else return SuperFamicom::Alt::SuperGameBoy::Internal; + } +#endif + return 0; + } }; static Callbacks core_bind; +static const char * read_opt(const char * name, const char * defval) +{ + struct retro_variable allowvar = { "bsnes_violate_accuracy", "No" }; + core_bind.penviron(RETRO_ENVIRONMENT_GET_VARIABLE, (void*)&allowvar); + if (!strcmp(allowvar.value, "Yes")) + { + struct retro_variable var = {name, defval}; + core_bind.penviron(RETRO_ENVIRONMENT_GET_VARIABLE, (void*)&var); + return var.value; + } + else return defval; +} + struct Interface : public SuperFamicom::Interface { SuperFamicomCartridge::Mode mode; @@ -426,10 +477,28 @@ return RETRO_API_VERSION; } +static unsigned superfx_freq_orig; + void retro_set_environment(retro_environment_t environ_cb) { core_bind.penviron = environ_cb; + static const struct retro_variable vars[] = { + { "bsnes_violate_accuracy", "Respect accuracy-impacting settings; No|Yes" }, + { "bsnes_chip_hle", "Special chip accuracy; LLE|HLE" }, + { "bsnes_superfx_overclock", "SuperFX speed; 100%|150%|200%|300%|400%|500%|1000%" }, + //Any integer is usable here, but there is no such thing as "any integer" in core options. +#ifdef EXPERIMENTAL_FEATURES + { "bsnes_sgb_core", "Super Game Boy core; Internal|Gambatte" }, +#endif + { NULL, NULL }, + }; + core_bind.penviron(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)vars); + + static struct retro_log_callback log={retro_log_default}; + core_bind.penviron(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, (void*)&log); + output=log.log; + static const retro_subsystem_memory_info sgb_memory[] = { { "srm", RETRO_MEMORY_SNES_GAME_BOY_RAM }, { "rtc", RETRO_MEMORY_SNES_GAME_BOY_RTC }, @@ -498,11 +567,19 @@ environ_cb(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports); } -void retro_set_video_refresh(retro_video_refresh_t video_refresh) { core_bind.pvideo_refresh = video_refresh; } -void retro_set_audio_sample(retro_audio_sample_t) { } -void retro_set_audio_sample_batch(retro_audio_sample_batch_t audio_sample) { core_bind.paudio_sample = audio_sample; } -void retro_set_input_poll(retro_input_poll_t input_poll) { core_bind.pinput_poll = input_poll; } -void retro_set_input_state(retro_input_state_t input_state) { core_bind.pinput_state = input_state; } +static void update_variables(void) { + if (SuperFamicom::cartridge.has_superfx()) { + const char * speed=read_opt("bsnes_superfx_overclock", "100%"); + unsigned percent=strtoul(speed, NULL, 10);//we can assume that the input is one of our advertised options + SuperFamicom::superfx.frequency=(uint64)superfx_freq_orig*percent/100; + } +} + +void retro_set_video_refresh(retro_video_refresh_t cb) { core_bind.pvideo_refresh = cb; } +void retro_set_audio_sample(retro_audio_sample_t) { } +void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb) { core_bind.paudio = cb; } +void retro_set_input_poll(retro_input_poll_t cb) { core_bind.pinput_poll = cb; } +void retro_set_input_state(retro_input_state_t cb) { core_bind.pinput_state = cb; } void retro_set_controller_port_device(unsigned port, unsigned device) { if (port < 2) @@ -515,6 +592,8 @@ core_interface.init(); core_gb_interface.init(); + + core_bind.sampleBufPos = 0; SuperFamicom::system.init(); SuperFamicom::input.connect(SuperFamicom::Controller::Port1, SuperFamicom::Input::Device::Joypad); @@ -530,7 +609,14 @@ } void retro_run(void) { + bool updated = false; + if (core_bind.penviron(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated) + update_variables(); SuperFamicom::system.run(); + if(core_bind.sampleBufPos) { + core_bind.paudio(core_bind.sampleBuf, core_bind.sampleBufPos/2); + core_bind.sampleBufPos = 0; + } } size_t retro_serialize_size(void) { @@ -550,6 +636,7 @@ return SuperFamicom::system.unserialize(s); } +#if 0 struct CheatList { bool enable; string code; @@ -557,27 +644,33 @@ }; static vector cheatList; +#endif void retro_cheat_reset(void) { +#if 0 cheatList.reset(); core_interface.setCheats(); +#endif } void retro_cheat_set(unsigned index, bool enable, const char *code) { +#if 0 + cheatList.reserve(index+1); cheatList[index].enable = enable; cheatList[index].code = code; lstring list; - + for(unsigned n = 0; n < cheatList.size(); n++) { if(cheatList[n].enable) list.append(cheatList[n].code); } - + core_interface.setCheats(list); +#endif } void retro_get_system_info(struct retro_system_info *info) { static string version("v", Emulator::Version, " (", Emulator::Profile, ")"); - info->library_name = "bsnes"; + info->library_name = "bsnes-mercury"; info->library_version = version; info->valid_extensions = "sfc|smc|bml"; info->need_fullpath = false; @@ -615,6 +708,19 @@ } } +static void output_multiline(enum retro_log_level level, char * data) +{ + while (true) + { + char* data_linebreak=strchr(data, '\n'); + if (data_linebreak) *data_linebreak='\0'; + if (*data) output(level, "%s\n", data); + if (!data_linebreak) break; + *data_linebreak='\n'; + data=data_linebreak+1; + } +} + static bool snes_load_cartridge_normal( const char *rom_xml, const uint8_t *rom_data, unsigned rom_size ) { @@ -623,7 +729,8 @@ core_bind.rom_data = rom_data; core_bind.rom_size = rom_size; core_bind.xmlrom = xmlrom; - fprintf(stderr, "[bsnes]: XML map:\n%s\n", (const char*)xmlrom); + output(RETRO_LOG_INFO, "BML map:\n"); + output_multiline(RETRO_LOG_INFO, xmlrom.data()); core_bind.iface->load(SuperFamicom::ID::SuperFamicom); SuperFamicom::system.power(); return !core_bind.load_request_error; @@ -689,8 +796,10 @@ ) { string xmlrom_sgb = (rom_xml && *rom_xml) ? string(rom_xml) : SuperFamicomCartridge(rom_data, rom_size).markup; string xmlrom_gb = (dmg_xml && *dmg_xml) ? string(dmg_xml) : GameBoyCartridge((uint8_t*)dmg_data, dmg_size).markup; - fprintf(stderr, "[bsnes]: Markup SGB: %s\n", (const char*)xmlrom_sgb); - fprintf(stderr, "[bsnes]: Markup GB: %s\n", (const char*)xmlrom_gb); + output(RETRO_LOG_INFO, "Markup SGB:\n"); + output_multiline(RETRO_LOG_INFO, xmlrom_sgb.data()); + output(RETRO_LOG_INFO, "Markup GB:\n"); + output_multiline(RETRO_LOG_INFO, xmlrom_gb.data()); core_bind.rom_data = rom_data; core_bind.rom_size = rom_size; @@ -708,70 +817,70 @@ static void init_descriptors(void) { struct retro_input_descriptor desc[] = { - { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, - { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, - { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, - { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, - { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, - { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, - { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, - { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, - { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, - { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, - { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, - { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, - - { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, - { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, - { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, - { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, - { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, - { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, - { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, - { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, - { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, - { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, - { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, - { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, - - { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, - { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, - { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, - { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, - { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, - { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, - { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, - { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, - { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, - { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, - { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, - { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, - - { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, - { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, - { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, - { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, - { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, - { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, - { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, - { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, - { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, - { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, - { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, - { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, - - { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, - { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, - { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, - { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, - { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, - { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, - { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, - { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, - { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, - { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, - { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, - { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, + { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, + { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, + { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, + { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, + { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, + { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, + { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, + { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, + { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, + { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, + { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, + { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, + + { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, + { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, + { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, + { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, + { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, + { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, + { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, + { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, + { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, + { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, + { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, + { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, + + { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, + { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, + { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, + { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, + { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, + { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, + { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, + { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, + { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, + { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, + { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, + { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, + + { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, + { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, + { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, + { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, + { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, + { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, + { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, + { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, + { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, + { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, + { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, + { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, + + { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, + { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, + { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, + { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, + { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, + { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, + { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, + { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, + { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, + { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, + { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, + { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, { 0 }, }; @@ -811,9 +920,19 @@ std::string manifest; if (core_bind.manifest) manifest = std::string((const char*)info->data, info->size); // Might not be 0 terminated. - return snes_load_cartridge_normal(core_bind.manifest ? manifest.data() : info->meta, data, size); + + bool ret=snes_load_cartridge_normal(core_bind.manifest ? manifest.data() : info->meta, data, size); + SuperFamicom::bus.libretro_mem_map.reverse(); + retro_memory_map map={SuperFamicom::bus.libretro_mem_map.data(), SuperFamicom::bus.libretro_mem_map.size()}; + core_bind.penviron(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, (void*)&map); + + if (SuperFamicom::cartridge.has_superfx()) + superfx_freq_orig=SuperFamicom::superfx.frequency; + + return ret; } + bool retro_load_game_special(unsigned game_type, const struct retro_game_info *info, size_t num_info) { core_bind.manifest = false; @@ -898,7 +1017,7 @@ } unsigned retro_get_region(void) { - return SuperFamicom::system.region() == SuperFamicom::System::Region::NTSC ? 0 : 1; + return SuperFamicom::system.region() == SuperFamicom::System::Region::NTSC ? RETRO_REGION_NTSC : RETRO_REGION_PAL; } void* retro_get_memory_data(unsigned id) { @@ -942,7 +1061,7 @@ switch(id) { case RETRO_MEMORY_SAVE_RAM: size = core_bind.sram_size; - fprintf(stderr, "[bsnes]: SRAM memory size: %u.\n", (unsigned)size); + output(RETRO_LOG_INFO, "SRAM memory size: %u.\n", (unsigned)size); break; case RETRO_MEMORY_RTC: size = 0; processor/r65816/disassembler.cpp000664 001750 001750 00000062517 12651764221 017776 0ustar00sergiosergio000000 000000 uint8 R65816::dreadb(uint32 addr) { if((addr & 0x40ffff) >= 0x2000 && (addr & 0x40ffff) <= 0x5fff) { //$[00-3f|80-bf]:[2000-5fff] //do not read MMIO registers within debugger return 0x00; } return disassembler_read(addr); } uint16 R65816::dreadw(uint32 addr) { uint16 r; r = dreadb((addr + 0) & 0xffffff) << 0; r |= dreadb((addr + 1) & 0xffffff) << 8; return r; } uint32 R65816::dreadl(uint32 addr) { uint32 r; r = dreadb((addr + 0) & 0xffffff) << 0; r |= dreadb((addr + 1) & 0xffffff) << 8; r |= dreadb((addr + 2) & 0xffffff) << 16; return r; } uint32 R65816::decode(uint8 offset_type, uint32 addr) { uint32 r = 0; switch(offset_type) { case OPTYPE_DP: r = (regs.d + (addr & 0xffff)) & 0xffff; break; case OPTYPE_DPX: r = (regs.d + regs.x + (addr & 0xffff)) & 0xffff; break; case OPTYPE_DPY: r = (regs.d + regs.y + (addr & 0xffff)) & 0xffff; break; case OPTYPE_IDP: addr = (regs.d + (addr & 0xffff)) & 0xffff; r = (regs.db << 16) + dreadw(addr); break; case OPTYPE_IDPX: addr = (regs.d + regs.x + (addr & 0xffff)) & 0xffff; r = (regs.db << 16) + dreadw(addr); break; case OPTYPE_IDPY: addr = (regs.d + (addr & 0xffff)) & 0xffff; r = (regs.db << 16) + dreadw(addr) + regs.y; break; case OPTYPE_ILDP: addr = (regs.d + (addr & 0xffff)) & 0xffff; r = dreadl(addr); break; case OPTYPE_ILDPY: addr = (regs.d + (addr & 0xffff)) & 0xffff; r = dreadl(addr) + regs.y; break; case OPTYPE_ADDR: r = (regs.db << 16) + (addr & 0xffff); break; case OPTYPE_ADDR_PC: r = (regs.pc.b << 16) + (addr & 0xffff); break; case OPTYPE_ADDRX: r = (regs.db << 16) + (addr & 0xffff) + regs.x; break; case OPTYPE_ADDRY: r = (regs.db << 16) + (addr & 0xffff) + regs.y; break; case OPTYPE_IADDR_PC: r = (regs.pc.b << 16) + (addr & 0xffff); break; case OPTYPE_IADDRX: r = (regs.pc.b << 16) + ((addr + regs.x) & 0xffff); break; case OPTYPE_ILADDR: r = addr; break; case OPTYPE_LONG: r = addr; break; case OPTYPE_LONGX: r = (addr + regs.x); break; case OPTYPE_SR: r = (regs.s + (addr & 0xff)) & 0xffff; break; case OPTYPE_ISRY: addr = (regs.s + (addr & 0xff)) & 0xffff; r = (regs.db << 16) + dreadw(addr) + regs.y; break; case OPTYPE_RELB: r = (regs.pc.b << 16) + ((regs.pc.w + 2) & 0xffff); r += int8(addr); break; case OPTYPE_RELW: r = (regs.pc.b << 16) + ((regs.pc.w + 3) & 0xffff); r += int16(addr); break; } return(r & 0xffffff); } void R65816::disassemble_opcode(char* output, uint32 addr) { static reg24_t pc; char t[256]; char* s = output; if(false /* in_opcode() == true */) { strcpy(s, "?????? "); return; } pc.d = addr; sprintf(s, "%.6x ", (uint32)pc.d); uint8 op = dreadb(pc.d); pc.w++; uint8 op0 = dreadb(pc.d); pc.w++; uint8 op1 = dreadb(pc.d); pc.w++; uint8 op2 = dreadb(pc.d); #define op8 ((op0)) #define op16 ((op0) | (op1 << 8)) #define op24 ((op0) | (op1 << 8) | (op2 << 16)) #define a8 (regs.e || regs.p.m) #define x8 (regs.e || regs.p.x) switch(op) { case 0x00: sprintf(t, "brk #$%.2x ", op8); break; case 0x01: sprintf(t, "ora ($%.2x,x) [%.6x]", op8, decode(OPTYPE_IDPX, op8)); break; case 0x02: sprintf(t, "cop #$%.2x ", op8); break; case 0x03: sprintf(t, "ora $%.2x,s [%.6x]", op8, decode(OPTYPE_SR, op8)); break; case 0x04: sprintf(t, "tsb $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x05: sprintf(t, "ora $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x06: sprintf(t, "asl $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x07: sprintf(t, "ora [$%.2x] [%.6x]", op8, decode(OPTYPE_ILDP, op8)); break; case 0x08: sprintf(t, "php "); break; case 0x09: if(a8)sprintf(t, "ora #$%.2x ", op8); else sprintf(t, "ora #$%.4x ", op16); break; case 0x0a: sprintf(t, "asl a "); break; case 0x0b: sprintf(t, "phd "); break; case 0x0c: sprintf(t, "tsb $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x0d: sprintf(t, "ora $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x0e: sprintf(t, "asl $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x0f: sprintf(t, "ora $%.6x [%.6x]", op24, decode(OPTYPE_LONG, op24)); break; case 0x10: sprintf(t, "bpl $%.4x [%.6x]", uint16(decode(OPTYPE_RELB, op8)), decode(OPTYPE_RELB, op8)); break; case 0x11: sprintf(t, "ora ($%.2x),y [%.6x]", op8, decode(OPTYPE_IDPY, op8)); break; case 0x12: sprintf(t, "ora ($%.2x) [%.6x]", op8, decode(OPTYPE_IDP, op8)); break; case 0x13: sprintf(t, "ora ($%.2x,s),y [%.6x]", op8, decode(OPTYPE_ISRY, op8)); break; case 0x14: sprintf(t, "trb $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x15: sprintf(t, "ora $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0x16: sprintf(t, "asl $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0x17: sprintf(t, "ora [$%.2x],y [%.6x]", op8, decode(OPTYPE_ILDPY, op8)); break; case 0x18: sprintf(t, "clc "); break; case 0x19: sprintf(t, "ora $%.4x,y [%.6x]", op16, decode(OPTYPE_ADDRY, op16)); break; case 0x1a: sprintf(t, "inc "); break; case 0x1b: sprintf(t, "tcs "); break; case 0x1c: sprintf(t, "trb $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x1d: sprintf(t, "ora $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0x1e: sprintf(t, "asl $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0x1f: sprintf(t, "ora $%.6x,x [%.6x]", op24, decode(OPTYPE_LONGX, op24)); break; case 0x20: sprintf(t, "jsr $%.4x [%.6x]", op16, decode(OPTYPE_ADDR_PC, op16)); break; case 0x21: sprintf(t, "and ($%.2x,x) [%.6x]", op8, decode(OPTYPE_IDPX, op8)); break; case 0x22: sprintf(t, "jsl $%.6x [%.6x]", op24, decode(OPTYPE_LONG, op24)); break; case 0x23: sprintf(t, "and $%.2x,s [%.6x]", op8, decode(OPTYPE_SR, op8)); break; case 0x24: sprintf(t, "bit $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x25: sprintf(t, "and $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x26: sprintf(t, "rol $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x27: sprintf(t, "and [$%.2x] [%.6x]", op8, decode(OPTYPE_ILDP, op8)); break; case 0x28: sprintf(t, "plp "); break; case 0x29: if(a8)sprintf(t, "and #$%.2x ", op8); else sprintf(t, "and #$%.4x ", op16); break; case 0x2a: sprintf(t, "rol a "); break; case 0x2b: sprintf(t, "pld "); break; case 0x2c: sprintf(t, "bit $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x2d: sprintf(t, "and $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x2e: sprintf(t, "rol $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x2f: sprintf(t, "and $%.6x [%.6x]", op24, decode(OPTYPE_LONG, op24)); break; case 0x30: sprintf(t, "bmi $%.4x [%.6x]", uint16(decode(OPTYPE_RELB, op8)), decode(OPTYPE_RELB, op8)); break; case 0x31: sprintf(t, "and ($%.2x),y [%.6x]", op8, decode(OPTYPE_IDPY, op8)); break; case 0x32: sprintf(t, "and ($%.2x) [%.6x]", op8, decode(OPTYPE_IDP, op8)); break; case 0x33: sprintf(t, "and ($%.2x,s),y [%.6x]", op8, decode(OPTYPE_ISRY, op8)); break; case 0x34: sprintf(t, "bit $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0x35: sprintf(t, "and $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0x36: sprintf(t, "rol $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0x37: sprintf(t, "and [$%.2x],y [%.6x]", op8, decode(OPTYPE_ILDPY, op8)); break; case 0x38: sprintf(t, "sec "); break; case 0x39: sprintf(t, "and $%.4x,y [%.6x]", op16, decode(OPTYPE_ADDRY, op16)); break; case 0x3a: sprintf(t, "dec "); break; case 0x3b: sprintf(t, "tsc "); break; case 0x3c: sprintf(t, "bit $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0x3d: sprintf(t, "and $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0x3e: sprintf(t, "rol $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0x3f: sprintf(t, "and $%.6x,x [%.6x]", op24, decode(OPTYPE_LONGX, op24)); break; case 0x40: sprintf(t, "rti "); break; case 0x41: sprintf(t, "eor ($%.2x,x) [%.6x]", op8, decode(OPTYPE_IDPX, op8)); break; case 0x42: sprintf(t, "wdm "); break; case 0x43: sprintf(t, "eor $%.2x,s [%.6x]", op8, decode(OPTYPE_SR, op8)); break; case 0x44: sprintf(t, "mvp $%.2x,$%.2x ", op1, op8); break; case 0x45: sprintf(t, "eor $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x46: sprintf(t, "lsr $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x47: sprintf(t, "eor [$%.2x] [%.6x]", op8, decode(OPTYPE_ILDP, op8)); break; case 0x48: sprintf(t, "pha "); break; case 0x49: if(a8)sprintf(t, "eor #$%.2x ", op8); else sprintf(t, "eor #$%.4x ", op16); break; case 0x4a: sprintf(t, "lsr a "); break; case 0x4b: sprintf(t, "phk "); break; case 0x4c: sprintf(t, "jmp $%.4x [%.6x]", op16, decode(OPTYPE_ADDR_PC, op16)); break; case 0x4d: sprintf(t, "eor $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x4e: sprintf(t, "lsr $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x4f: sprintf(t, "eor $%.6x [%.6x]", op24, decode(OPTYPE_LONG, op24)); break; case 0x50: sprintf(t, "bvc $%.4x [%.6x]", uint16(decode(OPTYPE_RELB, op8)), decode(OPTYPE_RELB, op8)); break; case 0x51: sprintf(t, "eor ($%.2x),y [%.6x]", op8, decode(OPTYPE_IDPY, op8)); break; case 0x52: sprintf(t, "eor ($%.2x) [%.6x]", op8, decode(OPTYPE_IDP, op8)); break; case 0x53: sprintf(t, "eor ($%.2x,s),y [%.6x]", op8, decode(OPTYPE_ISRY, op8)); break; case 0x54: sprintf(t, "mvn $%.2x,$%.2x ", op1, op8); break; case 0x55: sprintf(t, "eor $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0x56: sprintf(t, "lsr $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0x57: sprintf(t, "eor [$%.2x],y [%.6x]", op8, decode(OPTYPE_ILDPY, op8)); break; case 0x58: sprintf(t, "cli "); break; case 0x59: sprintf(t, "eor $%.4x,y [%.6x]", op16, decode(OPTYPE_ADDRY, op16)); break; case 0x5a: sprintf(t, "phy "); break; case 0x5b: sprintf(t, "tcd "); break; case 0x5c: sprintf(t, "jml $%.6x [%.6x]", op24, decode(OPTYPE_LONG, op24)); break; case 0x5d: sprintf(t, "eor $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0x5e: sprintf(t, "lsr $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0x5f: sprintf(t, "eor $%.6x,x [%.6x]", op24, decode(OPTYPE_LONGX, op24)); break; case 0x60: sprintf(t, "rts "); break; case 0x61: sprintf(t, "adc ($%.2x,x) [%.6x]", op8, decode(OPTYPE_IDPX, op8)); break; case 0x62: sprintf(t, "per $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x63: sprintf(t, "adc $%.2x,s [%.6x]", op8, decode(OPTYPE_SR, op8)); break; case 0x64: sprintf(t, "stz $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x65: sprintf(t, "adc $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x66: sprintf(t, "ror $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x67: sprintf(t, "adc [$%.2x] [%.6x]", op8, decode(OPTYPE_ILDP, op8)); break; case 0x68: sprintf(t, "pla "); break; case 0x69: if(a8)sprintf(t, "adc #$%.2x ", op8); else sprintf(t, "adc #$%.4x ", op16); break; case 0x6a: sprintf(t, "ror a "); break; case 0x6b: sprintf(t, "rtl "); break; case 0x6c: sprintf(t, "jmp ($%.4x) [%.6x]", op16, decode(OPTYPE_IADDR_PC, op16)); break; case 0x6d: sprintf(t, "adc $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x6e: sprintf(t, "ror $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x6f: sprintf(t, "adc $%.6x [%.6x]", op24, decode(OPTYPE_LONG, op24)); break; case 0x70: sprintf(t, "bvs $%.4x [%.6x]", uint16(decode(OPTYPE_RELB, op8)), decode(OPTYPE_RELB, op8)); break; case 0x71: sprintf(t, "adc ($%.2x),y [%.6x]", op8, decode(OPTYPE_IDPY, op8)); break; case 0x72: sprintf(t, "adc ($%.2x) [%.6x]", op8, decode(OPTYPE_IDP, op8)); break; case 0x73: sprintf(t, "adc ($%.2x,s),y [%.6x]", op8, decode(OPTYPE_ISRY, op8)); break; case 0x74: sprintf(t, "stz $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0x75: sprintf(t, "adc $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0x76: sprintf(t, "ror $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0x77: sprintf(t, "adc [$%.2x],y [%.6x]", op8, decode(OPTYPE_ILDPY, op8)); break; case 0x78: sprintf(t, "sei "); break; case 0x79: sprintf(t, "adc $%.4x,y [%.6x]", op16, decode(OPTYPE_ADDRY, op16)); break; case 0x7a: sprintf(t, "ply "); break; case 0x7b: sprintf(t, "tdc "); break; case 0x7c: sprintf(t, "jmp ($%.4x,x) [%.6x]", op16, decode(OPTYPE_IADDRX, op16)); break; case 0x7d: sprintf(t, "adc $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0x7e: sprintf(t, "ror $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0x7f: sprintf(t, "adc $%.6x,x [%.6x]", op24, decode(OPTYPE_LONGX, op24)); break; case 0x80: sprintf(t, "bra $%.4x [%.6x]", uint16(decode(OPTYPE_RELB, op8)), decode(OPTYPE_RELB, op8)); break; case 0x81: sprintf(t, "sta ($%.2x,x) [%.6x]", op8, decode(OPTYPE_IDPX, op8)); break; case 0x82: sprintf(t, "brl $%.4x [%.6x]", uint16(decode(OPTYPE_RELW, op16)), decode(OPTYPE_RELW, op16)); break; case 0x83: sprintf(t, "sta $%.2x,s [%.6x]", op8, decode(OPTYPE_SR, op8)); break; case 0x84: sprintf(t, "sty $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x85: sprintf(t, "sta $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x86: sprintf(t, "stx $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0x87: sprintf(t, "sta [$%.2x] [%.6x]", op8, decode(OPTYPE_ILDP, op8)); break; case 0x88: sprintf(t, "dey "); break; case 0x89: if(a8)sprintf(t, "bit #$%.2x ", op8); else sprintf(t, "bit #$%.4x ", op16); break; case 0x8a: sprintf(t, "txa "); break; case 0x8b: sprintf(t, "phb "); break; case 0x8c: sprintf(t, "sty $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x8d: sprintf(t, "sta $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x8e: sprintf(t, "stx $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x8f: sprintf(t, "sta $%.6x [%.6x]", op24, decode(OPTYPE_LONG, op24)); break; case 0x90: sprintf(t, "bcc $%.4x [%.6x]", uint16(decode(OPTYPE_RELB, op8)), decode(OPTYPE_RELB, op8)); break; case 0x91: sprintf(t, "sta ($%.2x),y [%.6x]", op8, decode(OPTYPE_IDPY, op8)); break; case 0x92: sprintf(t, "sta ($%.2x) [%.6x]", op8, decode(OPTYPE_IDP, op8)); break; case 0x93: sprintf(t, "sta ($%.2x,s),y [%.6x]", op8, decode(OPTYPE_ISRY, op8)); break; case 0x94: sprintf(t, "sty $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0x95: sprintf(t, "sta $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0x96: sprintf(t, "stx $%.2x,y [%.6x]", op8, decode(OPTYPE_DPY, op8)); break; case 0x97: sprintf(t, "sta [$%.2x],y [%.6x]", op8, decode(OPTYPE_ILDPY, op8)); break; case 0x98: sprintf(t, "tya "); break; case 0x99: sprintf(t, "sta $%.4x,y [%.6x]", op16, decode(OPTYPE_ADDRY, op16)); break; case 0x9a: sprintf(t, "txs "); break; case 0x9b: sprintf(t, "txy "); break; case 0x9c: sprintf(t, "stz $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0x9d: sprintf(t, "sta $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0x9e: sprintf(t, "stz $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0x9f: sprintf(t, "sta $%.6x,x [%.6x]", op24, decode(OPTYPE_LONGX, op24)); break; case 0xa0: if(x8)sprintf(t, "ldy #$%.2x ", op8); else sprintf(t, "ldy #$%.4x ", op16); break; case 0xa1: sprintf(t, "lda ($%.2x,x) [%.6x]", op8, decode(OPTYPE_IDPX, op8)); break; case 0xa2: if(x8)sprintf(t, "ldx #$%.2x ", op8); else sprintf(t, "ldx #$%.4x ", op16); break; case 0xa3: sprintf(t, "lda $%.2x,s [%.6x]", op8, decode(OPTYPE_SR, op8)); break; case 0xa4: sprintf(t, "ldy $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0xa5: sprintf(t, "lda $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0xa6: sprintf(t, "ldx $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0xa7: sprintf(t, "lda [$%.2x] [%.6x]", op8, decode(OPTYPE_ILDP, op8)); break; case 0xa8: sprintf(t, "tay "); break; case 0xa9: if(a8)sprintf(t, "lda #$%.2x ", op8); else sprintf(t, "lda #$%.4x ", op16); break; case 0xaa: sprintf(t, "tax "); break; case 0xab: sprintf(t, "plb "); break; case 0xac: sprintf(t, "ldy $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0xad: sprintf(t, "lda $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0xae: sprintf(t, "ldx $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0xaf: sprintf(t, "lda $%.6x [%.6x]", op24, decode(OPTYPE_LONG, op24)); break; case 0xb0: sprintf(t, "bcs $%.4x [%.6x]", uint16(decode(OPTYPE_RELB, op8)), decode(OPTYPE_RELB, op8)); break; case 0xb1: sprintf(t, "lda ($%.2x),y [%.6x]", op8, decode(OPTYPE_IDPY, op8)); break; case 0xb2: sprintf(t, "lda ($%.2x) [%.6x]", op8, decode(OPTYPE_IDP, op8)); break; case 0xb3: sprintf(t, "lda ($%.2x,s),y [%.6x]", op8, decode(OPTYPE_ISRY, op8)); break; case 0xb4: sprintf(t, "ldy $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0xb5: sprintf(t, "lda $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0xb6: sprintf(t, "ldx $%.2x,y [%.6x]", op8, decode(OPTYPE_DPY, op8)); break; case 0xb7: sprintf(t, "lda [$%.2x],y [%.6x]", op8, decode(OPTYPE_ILDPY, op8)); break; case 0xb8: sprintf(t, "clv "); break; case 0xb9: sprintf(t, "lda $%.4x,y [%.6x]", op16, decode(OPTYPE_ADDRY, op16)); break; case 0xba: sprintf(t, "tsx "); break; case 0xbb: sprintf(t, "tyx "); break; case 0xbc: sprintf(t, "ldy $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0xbd: sprintf(t, "lda $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0xbe: sprintf(t, "ldx $%.4x,y [%.6x]", op16, decode(OPTYPE_ADDRY, op16)); break; case 0xbf: sprintf(t, "lda $%.6x,x [%.6x]", op24, decode(OPTYPE_LONGX, op24)); break; case 0xc0: if(x8)sprintf(t, "cpy #$%.2x ", op8); else sprintf(t, "cpy #$%.4x ", op16); break; case 0xc1: sprintf(t, "cmp ($%.2x,x) [%.6x]", op8, decode(OPTYPE_IDPX, op8)); break; case 0xc2: sprintf(t, "rep #$%.2x ", op8); break; case 0xc3: sprintf(t, "cmp $%.2x,s [%.6x]", op8, decode(OPTYPE_SR, op8)); break; case 0xc4: sprintf(t, "cpy $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0xc5: sprintf(t, "cmp $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0xc6: sprintf(t, "dec $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0xc7: sprintf(t, "cmp [$%.2x] [%.6x]", op8, decode(OPTYPE_ILDP, op8)); break; case 0xc8: sprintf(t, "iny "); break; case 0xc9: if(a8)sprintf(t, "cmp #$%.2x ", op8); else sprintf(t, "cmp #$%.4x ", op16); break; case 0xca: sprintf(t, "dex "); break; case 0xcb: sprintf(t, "wai "); break; case 0xcc: sprintf(t, "cpy $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0xcd: sprintf(t, "cmp $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0xce: sprintf(t, "dec $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0xcf: sprintf(t, "cmp $%.6x [%.6x]", op24, decode(OPTYPE_LONG, op24)); break; case 0xd0: sprintf(t, "bne $%.4x [%.6x]", uint16(decode(OPTYPE_RELB, op8)), decode(OPTYPE_RELB, op8)); break; case 0xd1: sprintf(t, "cmp ($%.2x),y [%.6x]", op8, decode(OPTYPE_IDPY, op8)); break; case 0xd2: sprintf(t, "cmp ($%.2x) [%.6x]", op8, decode(OPTYPE_IDP, op8)); break; case 0xd3: sprintf(t, "cmp ($%.2x,s),y [%.6x]", op8, decode(OPTYPE_ISRY, op8)); break; case 0xd4: sprintf(t, "pei ($%.2x) [%.6x]", op8, decode(OPTYPE_IDP, op8)); break; case 0xd5: sprintf(t, "cmp $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0xd6: sprintf(t, "dec $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0xd7: sprintf(t, "cmp [$%.2x],y [%.6x]", op8, decode(OPTYPE_ILDPY, op8)); break; case 0xd8: sprintf(t, "cld "); break; case 0xd9: sprintf(t, "cmp $%.4x,y [%.6x]", op16, decode(OPTYPE_ADDRY, op16)); break; case 0xda: sprintf(t, "phx "); break; case 0xdb: sprintf(t, "stp "); break; case 0xdc: sprintf(t, "jmp [$%.4x] [%.6x]", op16, decode(OPTYPE_ILADDR, op16)); break; case 0xdd: sprintf(t, "cmp $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0xde: sprintf(t, "dec $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0xdf: sprintf(t, "cmp $%.6x,x [%.6x]", op24, decode(OPTYPE_LONGX, op24)); break; case 0xe0: if(x8)sprintf(t, "cpx #$%.2x ", op8); else sprintf(t, "cpx #$%.4x ", op16); break; case 0xe1: sprintf(t, "sbc ($%.2x,x) [%.6x]", op8, decode(OPTYPE_IDPX, op8)); break; case 0xe2: sprintf(t, "sep #$%.2x ", op8); break; case 0xe3: sprintf(t, "sbc $%.2x,s [%.6x]", op8, decode(OPTYPE_SR, op8)); break; case 0xe4: sprintf(t, "cpx $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0xe5: sprintf(t, "sbc $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0xe6: sprintf(t, "inc $%.2x [%.6x]", op8, decode(OPTYPE_DP, op8)); break; case 0xe7: sprintf(t, "sbc [$%.2x] [%.6x]", op8, decode(OPTYPE_ILDP, op8)); break; case 0xe8: sprintf(t, "inx "); break; case 0xe9: if(a8)sprintf(t, "sbc #$%.2x ", op8); else sprintf(t, "sbc #$%.4x ", op16); break; case 0xea: sprintf(t, "nop "); break; case 0xeb: sprintf(t, "xba "); break; case 0xec: sprintf(t, "cpx $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0xed: sprintf(t, "sbc $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0xee: sprintf(t, "inc $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0xef: sprintf(t, "sbc $%.6x [%.6x]", op24, decode(OPTYPE_LONG, op24)); break; case 0xf0: sprintf(t, "beq $%.4x [%.6x]", uint16(decode(OPTYPE_RELB, op8)), decode(OPTYPE_RELB, op8)); break; case 0xf1: sprintf(t, "sbc ($%.2x),y [%.6x]", op8, decode(OPTYPE_IDPY, op8)); break; case 0xf2: sprintf(t, "sbc ($%.2x) [%.6x]", op8, decode(OPTYPE_IDP, op8)); break; case 0xf3: sprintf(t, "sbc ($%.2x,s),y [%.6x]", op8, decode(OPTYPE_ISRY, op8)); break; case 0xf4: sprintf(t, "pea $%.4x [%.6x]", op16, decode(OPTYPE_ADDR, op16)); break; case 0xf5: sprintf(t, "sbc $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0xf6: sprintf(t, "inc $%.2x,x [%.6x]", op8, decode(OPTYPE_DPX, op8)); break; case 0xf7: sprintf(t, "sbc [$%.2x],y [%.6x]", op8, decode(OPTYPE_ILDPY, op8)); break; case 0xf8: sprintf(t, "sed "); break; case 0xf9: sprintf(t, "sbc $%.4x,y [%.6x]", op16, decode(OPTYPE_ADDRY, op16)); break; case 0xfa: sprintf(t, "plx "); break; case 0xfb: sprintf(t, "xce "); break; case 0xfc: sprintf(t, "jsr ($%.4x,x) [%.6x]", op16, decode(OPTYPE_IADDRX, op16)); break; case 0xfd: sprintf(t, "sbc $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0xfe: sprintf(t, "inc $%.4x,x [%.6x]", op16, decode(OPTYPE_ADDRX, op16)); break; case 0xff: sprintf(t, "sbc $%.6x,x [%.6x]", op24, decode(OPTYPE_LONGX, op24)); break; } #undef op8 #undef op16 #undef op24 #undef a8 #undef x8 strcat(s, t); strcat(s, " "); sprintf(t, "A:%.4x X:%.4x Y:%.4x S:%.4x D:%.4x DB:%.2x ", regs.a.w, regs.x.w, regs.y.w, regs.s.w, regs.d.w, regs.db); strcat(s, t); if(regs.e) { sprintf(t, "%c%c%c%c%c%c%c%c", regs.p.n ? 'N' : 'n', regs.p.v ? 'V' : 'v', regs.p.m ? '1' : '0', regs.p.x ? 'B' : 'b', regs.p.d ? 'D' : 'd', regs.p.i ? 'I' : 'i', regs.p.z ? 'Z' : 'z', regs.p.c ? 'C' : 'c'); } else { sprintf(t, "%c%c%c%c%c%c%c%c", regs.p.n ? 'N' : 'n', regs.p.v ? 'V' : 'v', regs.p.m ? 'M' : 'm', regs.p.x ? 'X' : 'x', regs.p.d ? 'D' : 'd', regs.p.i ? 'I' : 'i', regs.p.z ? 'Z' : 'z', regs.p.c ? 'C' : 'c'); } strcat(s, t); } gba/cartridge/eeprom.cpp000664 001750 001750 00000003756 12651764221 016413 0ustar00sergiosergio000000 000000 bool Cartridge::EEPROM::read(unsigned addr) { return data[addr >> 3] & 0x80 >> (addr & 7); } void Cartridge::EEPROM::write(unsigned addr, bool bit) { if(bit == 0) data[addr >> 3] &=~ (0x80 >> (addr & 7)); if(bit == 1) data[addr >> 3] |= (0x80 >> (addr & 7)); } bool Cartridge::EEPROM::read() { bool bit = 1; //EEPROM size auto-detection if(bits == 0 && mode == Mode::ReadAddress) { print("EEPROM address bits: ", --addressbits, "\n"); bits = addressbits == 6 ? 6 : 14; size = 8192; mode = Mode::ReadData; offset = 0; //fallthrough } if(mode == Mode::ReadData) { if(offset >= 4) bit = read(address * 64 + (offset - 4)); if(++offset == 68) mode = Mode::Wait; } return bit; } void Cartridge::EEPROM::write(bool bit) { if(mode == Mode::Wait) { if(bit == 1) mode = Mode::Command; } else if(mode == Mode::Command) { if(bit == 0) mode = Mode::WriteAddress; if(bit == 1) mode = Mode::ReadAddress; offset = 0; address = 0; addressbits = 0; } else if(mode == Mode::ReadAddress) { address = (address << 1) | bit; addressbits++; if(++offset == bits) { mode = Mode::ReadValidate; offset = 0; } } else if(mode == Mode::ReadValidate) { if(bit == 1); //invalid mode = Mode::ReadData; } else if(mode == Mode::WriteAddress) { address = (address << 1) | bit; if(++offset == bits) { mode = Mode::WriteData; offset = 0; } } else if(mode == Mode::WriteData) { write(address * 64 + offset, bit); if(++offset == 64) { mode = Mode::WriteValidate; } } else if(mode == Mode::WriteValidate) { if(bit == 1); //invalid mode = Mode::Wait; } } void Cartridge::EEPROM::power() { mode = Mode::Wait; offset = 0; address = 0; } void Cartridge::EEPROM::serialize(serializer& s) { s.array(data, size); s.integer(size); s.integer(mask); s.integer(test); s.integer(bits); s.integer((unsigned&)mode); s.integer(offset); s.integer(address); } phoenix/windows/mouse.cpp000664 001750 001750 00000000714 12651764221 016712 0ustar00sergiosergio000000 000000 namespace phoenix { Position pMouse::position() { POINT point = {0}; GetCursorPos(&point); return {point.x, point.y}; } bool pMouse::pressed(Mouse::Button button) { switch(button) { case Mouse::Button::Left: return GetAsyncKeyState(VK_LBUTTON) & 0x8000; case Mouse::Button::Middle: return GetAsyncKeyState(VK_MBUTTON) & 0x8000; case Mouse::Button::Right: return GetAsyncKeyState(VK_RBUTTON) & 0x8000; } return false; } } target-ethos/settings/settings.cpp000664 001750 001750 00000002574 12651764221 020532 0ustar00sergiosergio000000 000000 #include "../ethos.hpp" #include "video.cpp" #include "audio.cpp" #include "input.cpp" #include "hotkey.cpp" #include "timing.cpp" #include "server.cpp" #include "advanced.cpp" Settings* settings = nullptr; SettingsLayout::SettingsLayout() { setMargin(5); } Settings::Settings() { setGeometry({128, 128, 640, 360}); windowManager->append(this, "Settings"); setTitle("Configuration Settings"); setStatusVisible(); layout.setMargin(5); panels.append("Video", {resource::video, sizeof resource::video}); panels.append("Audio", {resource::audio, sizeof resource::audio}); panels.append("Input", {resource::input, sizeof resource::input}); panels.append("Hotkeys", {resource::hotkeys, sizeof resource::hotkeys}); panels.append("Timing", {resource::timing, sizeof resource::timing}); panels.append("Server", {resource::server, sizeof resource::server}); panels.append("Advanced", {resource::advanced, sizeof resource::advanced}); panels.setLayout(0, *videoSettings); panels.setLayout(1, *audioSettings); panels.setLayout(2, *inputSettings); panels.setLayout(3, *hotkeySettings); panels.setLayout(4, *timingSettings); panels.setLayout(5, *serverSettings); panels.setLayout(6, *advancedSettings); panels.setSelection(2); append(layout); layout.append(panels, {~0, ~0}); onClose = [&] { timingSettings->analysis.stop = true; setVisible(false); }; } sfc/memory/000700 001750 001750 00000000000 12656700342 013756 5ustar00sergiosergio000000 000000 sfc/alt/smp/core/opcycle_mov.cpp000664 001750 001750 00000026775 12651764221 020036 0ustar00sergiosergio000000 000000 case 0x7d: { switch(opcode_cycle++) { case 1: op_io(); regs.a = regs.x; regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0xdd: { switch(opcode_cycle++) { case 1: op_io(); regs.a = regs.y; regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0x5d: { switch(opcode_cycle++) { case 1: op_io(); regs.x = regs.a; regs.p.n = !!(regs.x & 0x80); regs.p.z = (regs.x == 0); opcode_cycle = 0; break; } break; } case 0xfd: { switch(opcode_cycle++) { case 1: op_io(); regs.y = regs.a; regs.p.n = !!(regs.y & 0x80); regs.p.z = (regs.y == 0); opcode_cycle = 0; break; } break; } case 0x9d: { switch(opcode_cycle++) { case 1: op_io(); regs.x = regs.sp; regs.p.n = !!(regs.x & 0x80); regs.p.z = (regs.x == 0); opcode_cycle = 0; break; } break; } case 0xbd: { switch(opcode_cycle++) { case 1: op_io(); regs.sp = regs.x; opcode_cycle = 0; break; } break; } case 0xe8: { switch(opcode_cycle++) { case 1: regs.a = op_readpc(); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0xcd: { switch(opcode_cycle++) { case 1: regs.x = op_readpc(); regs.p.n = !!(regs.x & 0x80); regs.p.z = (regs.x == 0); opcode_cycle = 0; break; } break; } case 0x8d: { switch(opcode_cycle++) { case 1: regs.y = op_readpc(); regs.p.n = !!(regs.y & 0x80); regs.p.z = (regs.y == 0); opcode_cycle = 0; break; } break; } case 0xe6: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: regs.a = op_readdp(regs.x); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0xbf: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: regs.a = op_readdp(regs.x++); break; case 3: op_io(); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0xe4: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: regs.a = op_readdp(sp); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0xf8: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: regs.x = op_readdp(sp); regs.p.n = !!(regs.x & 0x80); regs.p.z = (regs.x == 0); opcode_cycle = 0; break; } break; } case 0xeb: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: regs.y = op_readdp(sp); regs.p.n = !!(regs.y & 0x80); regs.p.z = (regs.y == 0); opcode_cycle = 0; break; } break; } case 0xf4: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: op_io(); break; case 3: regs.a = op_readdp(sp + regs.x); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0xf9: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: op_io(); break; case 3: regs.x = op_readdp(sp + regs.y); regs.p.n = !!(regs.x & 0x80); regs.p.z = (regs.x == 0); opcode_cycle = 0; break; } break; } case 0xfb: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: op_io(); break; case 3: regs.y = op_readdp(sp + regs.x); regs.p.n = !!(regs.y & 0x80); regs.p.z = (regs.y == 0); opcode_cycle = 0; break; } break; } case 0xe5: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: sp |= op_readpc() << 8; break; case 3: regs.a = op_readaddr(sp); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0xe9: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: sp |= op_readpc() << 8; break; case 3: regs.x = op_readaddr(sp); regs.p.n = !!(regs.x & 0x80); regs.p.z = (regs.x == 0); opcode_cycle = 0; break; } break; } case 0xec: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: sp |= op_readpc() << 8; break; case 3: regs.y = op_readaddr(sp); regs.p.n = !!(regs.y & 0x80); regs.p.z = (regs.y == 0); opcode_cycle = 0; break; } break; } case 0xf5: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: sp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: regs.a = op_readaddr(sp + regs.x); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0xf6: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: sp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: regs.a = op_readaddr(sp + regs.y); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0xe7: { switch(opcode_cycle++) { case 1: dp = op_readpc() + regs.x; break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: regs.a = op_readaddr(sp); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0xf7: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: regs.a = op_readaddr(sp + regs.y); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0xfa: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: rd = op_readdp(sp); break; case 3: dp = op_readpc(); break; case 4: op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x8f: { switch(opcode_cycle++) { case 1: rd = op_readpc(); break; case 2: dp = op_readpc(); break; case 3: op_readdp(dp); break; case 4: op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0xc6: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_readdp(regs.x); break; case 3: op_writedp(regs.x, regs.a); opcode_cycle = 0; break; } break; } case 0xaf: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); break; case 3: op_writedp(regs.x++, regs.a); opcode_cycle = 0; break; } break; } case 0xc4: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_readdp(dp); break; case 3: op_writedp(dp, regs.a); opcode_cycle = 0; break; } break; } case 0xd8: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_readdp(dp); break; case 3: op_writedp(dp, regs.x); opcode_cycle = 0; break; } break; } case 0xcb: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_readdp(dp); break; case 3: op_writedp(dp, regs.y); opcode_cycle = 0; break; } break; } case 0xd4: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); dp += regs.x; break; case 3: op_readdp(dp); break; case 4: op_writedp(dp, regs.a); opcode_cycle = 0; break; } break; } case 0xd9: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); dp += regs.y; break; case 3: op_readdp(dp); break; case 4: op_writedp(dp, regs.x); opcode_cycle = 0; break; } break; } case 0xdb: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); dp += regs.x; break; case 3: op_readdp(dp); break; case 4: op_writedp(dp, regs.y); opcode_cycle = 0; break; } break; } case 0xc5: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_readaddr(dp); break; case 4: op_writeaddr(dp, regs.a); opcode_cycle = 0; break; } break; } case 0xc9: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_readaddr(dp); break; case 4: op_writeaddr(dp, regs.x); opcode_cycle = 0; break; } break; } case 0xcc: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_readaddr(dp); break; case 4: op_writeaddr(dp, regs.y); opcode_cycle = 0; break; } break; } case 0xd5: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); dp += regs.x; break; case 4: op_readaddr(dp); break; case 5: op_writeaddr(dp, regs.a); opcode_cycle = 0; break; } break; } case 0xd6: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); dp += regs.y; break; case 4: op_readaddr(dp); break; case 5: op_writeaddr(dp, regs.a); opcode_cycle = 0; break; } break; } case 0xc7: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: op_io(); sp += regs.x; break; case 3: dp = op_readdp(sp); break; case 4: dp |= op_readdp(sp + 1) << 8; break; case 5: op_readaddr(dp); break; case 6: op_writeaddr(dp, regs.a); opcode_cycle = 0; break; } break; } case 0xd7: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: dp = op_readdp(sp); break; case 3: dp |= op_readdp(sp + 1) << 8; break; case 4: op_io(); dp += regs.y; break; case 5: op_readaddr(dp); break; case 6: op_writeaddr(dp, regs.a); opcode_cycle = 0; break; } break; } case 0xba: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: regs.a = op_readdp(sp); break; case 3: op_io(); break; case 4: regs.y = op_readdp(sp + 1); regs.p.n = !!(regs.ya & 0x8000); regs.p.z = (regs.ya == 0); opcode_cycle = 0; break; } break; } case 0xda: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_readdp(dp); break; case 3: op_writedp(dp, regs.a); break; case 4: op_writedp(dp + 1, regs.y); opcode_cycle = 0; break; } break; } case 0xaa: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: sp |= op_readpc() << 8; break; case 3: bit = sp >> 13; sp &= 0x1fff; rd = op_readaddr(sp); regs.p.c = !!(rd & (1 << bit)); opcode_cycle = 0; break; } break; } case 0xca: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); if(regs.p.c)rd |= (1 << bit); else rd &= ~(1 << bit); break; case 4: op_io(); break; case 5: op_writeaddr(dp, rd); opcode_cycle = 0; break; } break; } gb/apu/serialization.cpp000664 001750 001750 00000000433 12651764221 016446 0ustar00sergiosergio000000 000000 #ifdef APU_CPP void APU::serialize(serializer& s) { Thread::serialize(s); s.array(mmio_data); s.integer(sequencer_base); s.integer(sequencer_step); square1.serialize(s); square2.serialize(s); wave.serialize(s); noise.serialize(s); master.serialize(s); } #endif sfc/ppu/sprite/sprite.cpp000664 001750 001750 00000013505 12651764221 016613 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP #include "list.cpp" void PPU::Sprite::address_reset() { self.regs.oam_addr = self.regs.oam_baseaddr; set_first_sprite(); } void PPU::Sprite::set_first_sprite() { regs.first_sprite = (self.regs.oam_priority == false ? 0 : (self.regs.oam_addr >> 2) & 127); } void PPU::Sprite::frame() { regs.time_over = false; regs.range_over = false; } void PPU::Sprite::scanline() { t.x = 0; t.y = self.vcounter(); t.item_count = 0; t.tile_count = 0; t.active = !t.active; auto oam_item = t.item[t.active]; auto oam_tile = t.tile[t.active]; if(t.y == (!self.regs.overscan ? 225 : 240) && self.regs.display_disable == false) address_reset(); if(t.y >= (!self.regs.overscan ? 224 : 239)) return; memset(oam_item, 0xff, 32); //default to invalid for(unsigned i = 0; i < 34; i++) oam_tile[i].x = 0xffff; //default to invalid for(unsigned i = 0; i < 128; i++) { unsigned sprite = (regs.first_sprite + i) & 127; if(on_scanline(list[sprite]) == false) continue; if(t.item_count++ >= 32) break; oam_item[t.item_count - 1] = sprite; } if(t.item_count > 0 && oam_item[t.item_count - 1] != 0xff) { ppu.regs.oam_iaddr = 0x0200 + (oam_item[t.item_count - 1] >> 2); } } bool PPU::Sprite::on_scanline(SpriteItem& sprite) { if(sprite.x > 256 && (sprite.x + sprite.width() - 1) < 512) return false; signed height = (regs.interlace == false ? sprite.height() : (sprite.height() >> 1)); if(t.y >= sprite.y && t.y < (sprite.y + height)) return true; if((sprite.y + height) >= 256 && t.y < ((sprite.y + height) & 255)) return true; return false; } void PPU::Sprite::run() { output.main.priority = 0; output.sub.priority = 0; auto oam_tile = t.tile[!t.active]; unsigned priority_table[] = { regs.priority0, regs.priority1, regs.priority2, regs.priority3 }; unsigned x = t.x++; for(unsigned n = 0; n < 34; n++) { auto tile = oam_tile[n]; if(tile.x == 0xffff) break; int px = x - sclip<9>(tile.x); if(px & ~7) continue; unsigned mask = 0x80 >> (tile.hflip == false ? px : 7 - px); unsigned color; color = ((bool)(tile.d0 & mask)) << 0; color |= ((bool)(tile.d1 & mask)) << 1; color |= ((bool)(tile.d2 & mask)) << 2; color |= ((bool)(tile.d3 & mask)) << 3; if(color) { if(regs.main_enable) { output.main.palette = tile.palette + color; output.main.priority = priority_table[tile.priority]; } if(regs.sub_enable) { output.sub.palette = tile.palette + color; output.sub.priority = priority_table[tile.priority]; } } } } void PPU::Sprite::tilefetch() { auto oam_item = t.item[t.active]; auto oam_tile = t.tile[t.active]; for(signed i = 31; i >= 0; i--) { if(oam_item[i] == 0xff) continue; auto sprite = list[oam_item[i]]; unsigned tile_width = sprite.width() >> 3; signed x = sprite.x; signed y = (t.y - sprite.y) & 0xff; if(regs.interlace) y <<= 1; if(sprite.vflip) { if(sprite.width() == sprite.height()) { y = (sprite.height() - 1) - y; } else if(y < sprite.width()) { y = (sprite.width() - 1) - y; } else { y = sprite.width() + ((sprite.width() - 1) - (y - sprite.width())); } } if(regs.interlace) { y = (sprite.vflip == false ? y + self.field() : y - self.field()); } x &= 511; y &= 255; uint16 tiledata_addr = regs.tiledata_addr; uint16 chrx = (sprite.character >> 0) & 15; uint16 chry = (sprite.character >> 4) & 15; if(sprite.nameselect) { tiledata_addr += (256 * 32) + (regs.nameselect << 13); } chry += (y >> 3); chry &= 15; chry <<= 4; for(unsigned tx = 0; tx < tile_width; tx++) { unsigned sx = (x + (tx << 3)) & 511; if(x != 256 && sx >= 256 && (sx + 7) < 512) continue; if(t.tile_count++ >= 34) break; unsigned n = t.tile_count - 1; oam_tile[n].x = sx; oam_tile[n].priority = sprite.priority; oam_tile[n].palette = 128 + (sprite.palette << 4); oam_tile[n].hflip = sprite.hflip; unsigned mx = (sprite.hflip == false) ? tx : ((tile_width - 1) - tx); unsigned pos = tiledata_addr + ((chry + ((chrx + mx) & 15)) << 5); uint16 addr = (pos & 0xffe0) + ((y & 7) * 2); oam_tile[n].d0 = ppu.vram[addr + 0]; oam_tile[n].d1 = ppu.vram[addr + 1]; self.add_clocks(2); oam_tile[n].d2 = ppu.vram[addr + 16]; oam_tile[n].d3 = ppu.vram[addr + 17]; self.add_clocks(2); } } if(t.tile_count < 34) self.add_clocks((34 - t.tile_count) * 4); regs.time_over |= (t.tile_count > 34); regs.range_over |= (t.item_count > 32); } void PPU::Sprite::reset() { for(unsigned i = 0; i < 128; i++) { list[i].x = 0; list[i].y = 0; list[i].character = 0; list[i].nameselect = 0; list[i].vflip = 0; list[i].hflip = 0; list[i].priority = 0; list[i].palette = 0; list[i].size = 0; } synchronize(); t.x = 0; t.y = 0; t.item_count = 0; t.tile_count = 0; t.active = 0; for(unsigned n = 0; n < 2; n++) { memset(t.item[n], 0, 32); for(unsigned i = 0; i < 34; i++) { t.tile[n][i].x = 0; t.tile[n][i].priority = 0; t.tile[n][i].palette = 0; t.tile[n][i].hflip = 0; t.tile[n][i].d0 = 0; t.tile[n][i].d1 = 0; t.tile[n][i].d2 = 0; t.tile[n][i].d3 = 0; } } regs.main_enable = random(false); regs.sub_enable = random(false); regs.interlace = random(false); regs.base_size = random(0); regs.nameselect = random(0); regs.tiledata_addr = (random(0x0000) & 3) << 14; regs.first_sprite = 0; regs.priority0 = 0; regs.priority1 = 0; regs.priority2 = 0; regs.priority3 = 0; regs.time_over = false; regs.range_over = false; output.main.palette = 0; output.main.priority = 0; output.sub.palette = 0; output.sub.priority = 0; } PPU::Sprite::Sprite(PPU& self) : self(self) { } #endif target-ethos/utility/utility.cpp000664 001750 001750 00000023655 12651764221 020243 0ustar00sergiosergio000000 000000 #include "../ethos.hpp" Utility* utility = nullptr; void Utility::setInterface(Emulator::Interface* emulator) { program->active = emulator; presentation->synchronize(); } //load from command-line, etc void Utility::loadMedia(string pathname) { pathname.transform("\\", "/"); if(pathname.endsWith("/")) pathname.rtrim("/"); if(!directory::exists(pathname)) return; string type = extension(pathname); //determine type by comparing extension against all emulation cores for(auto& emulator : program->emulator) { for(auto& media : emulator->media) { if(media.bootable == false) continue; if(type != media.type) continue; loadMedia(emulator, media, {pathname, "/"}); libraryManager->setVisible(false); return; } } MessageWindow().setText("Unable to determine media type.").warning(); } //load base cartridge void Utility::loadMedia(Emulator::Interface* emulator, Emulator::Interface::Media& media, string pathname) { unload(); setInterface(emulator); path(0) = program->path({media.name, ".sys/"}); path(media.id) = pathname; this->pathname.append(pathname); system().load(media.id); system().power(); presentation->setSystemName(media.name); presentation->setVisible(); load(); } //request from emulation core to load non-volatile media folder void Utility::loadRequest(unsigned id, string name, string type) { string pathname = libraryManager->load(type); if(pathname.empty()) return; path(id) = pathname; this->pathname.append(pathname); system().load(id); } //request from emulation core to load non-volatile media file void Utility::loadRequest(unsigned id, string path) { string pathname = {this->path(system().group(id)), path}; if(file::exists(pathname) == false) return; mmapstream stream(pathname); return system().load(id, stream); } //request from emulation core to save non-volatile media file void Utility::saveRequest(unsigned id, string path) { string pathname = {this->path(system().group(id)), path}; filestream stream(pathname, file::mode::write); return system().save(id, stream); } void Utility::connect(unsigned port, unsigned device) { if(program->active == nullptr) return; system().connect(port, device); } void Utility::power() { if(program->active == nullptr) return; system().power(); } void Utility::reset() { if(program->active == nullptr) return; system().reset(); } void Utility::load() { presentation->setTitle(system().title()); cheatEditor->load({pathname[0], "cheats.bml"}); stateManager->load({pathname[0], "bsnes/states.bsa"}, 1); synchronizeDSP(); resize(); updateShader(); cheatEditor->synchronize(); cheatEditor->refresh(); } void Utility::unload() { if(program->active == nullptr) return; if(tracerEnable) tracerToggle(); cheatEditor->save({pathname[0], "cheats.bml"}); stateManager->save({pathname[0], "bsnes/states.bsa"}, 1); system().unload(); path.reset(); pathname.reset(); cheatEditor->reset(); stateManager->reset(); setInterface(nullptr); video.clear(); audio.clear(); presentation->setTitle({Emulator::Name, " v", Emulator::Version}); cheatDatabase->setVisible(false); cheatEditor->setVisible(false); stateManager->setVisible(false); } void Utility::saveState(unsigned slot) { if(program->active == nullptr) return; serializer s = system().serialize(); if(s.size() == 0) return; directory::create({pathname[0], "bsnes/"}); if(file::write({pathname[0], "bsnes/state-", slot, ".bsa"}, s.data(), s.size()) == false); showMessage({"Saved to slot ", slot}); } void Utility::loadState(unsigned slot) { if(program->active == nullptr) return; auto memory = file::read({pathname[0], "bsnes/state-", slot, ".bsa"}); if(memory.size() == 0) return showMessage({"Unable to locate slot ", slot, " state"}); serializer s(memory.data(), memory.size()); if(system().unserialize(s) == false) return showMessage({"Slot ", slot, " state incompatible"}); showMessage({"Loaded from slot ", slot}); } void Utility::tracerToggle() { if(program->active == nullptr) return; tracerEnable = !tracerEnable; bool result = system().tracerEnable(tracerEnable); if( tracerEnable && result) return utility->showMessage("Tracer activated"); if( tracerEnable && !result) return tracerEnable = false, utility->showMessage("Unable to activate tracer"); if(!tracerEnable && result) return utility->showMessage("Tracer deactivated"); if(!tracerEnable && !result) return utility->showMessage("Unable to deactivate tracer"); } void Utility::synchronizeDSP() { if(program->active == nullptr) return; if(config->video.synchronize == false) { return dspaudio.setFrequency(system().audioFrequency()); } double inputRatio = system().audioFrequency() / system().videoFrequency(); double outputRatio = config->timing.audio / config->timing.video; double frequency = inputRatio / outputRatio * config->audio.frequency; dspaudio.setFrequency(frequency); } void Utility::synchronizeRuby() { video.set(Video::Synchronize, config->video.synchronize); audio.set(Audio::Synchronize, config->audio.synchronize); audio.set(Audio::Frequency, config->audio.frequency); audio.set(Audio::Latency, config->audio.latency); switch(config->audio.resampler) { case 0: dspaudio.setResampler(DSP::ResampleEngine::Linear); break; case 1: dspaudio.setResampler(DSP::ResampleEngine::Hermite); break; case 2: dspaudio.setResampler(DSP::ResampleEngine::Sinc); break; } dspaudio.setResamplerFrequency(config->audio.frequency); dspaudio.setVolume(config->audio.mute ? 0.0 : config->audio.volume * 0.01); synchronizeDSP(); } void Utility::updatePalette() { if(program->active == nullptr) return; if(config->video.shader == "Display Emulation" && config->video.driver == "OpenGL") { system().paletteUpdate(Emulator::Interface::PaletteMode::Channel); } else if(config->video.colorEmulation) { system().paletteUpdate(Emulator::Interface::PaletteMode::Emulation); } else { system().paletteUpdate(Emulator::Interface::PaletteMode::Standard); } } void Utility::updateShader() { if(config->video.shader == "None") { video.set(Video::Shader, (const char*)""); video.set(Video::Filter, Video::FilterNearest); } else if(config->video.shader == "Blur") { video.set(Video::Shader, (const char*)""); video.set(Video::Filter, Video::FilterLinear); } else if(config->video.shader == "Display Emulation" && config->video.driver != "OpenGL") { video.set(Video::Shader, (const char*)""); video.set(Video::Filter, Video::FilterLinear); } else if(config->video.shader == "Display Emulation") { if(program->active) { string pathname = program->path("Video Shaders/"); pathname.append("Display Emulation/"); pathname.append(presentation->systemName, ".shader/"); if(directory::exists(pathname)) { video.set(Video::Shader, (const char*)pathname); } else { video.set(Video::Shader, (const char*)""); video.set(Video::Filter, Video::FilterLinear); } } else { video.set(Video::Shader, (const char*)""); video.set(Video::Filter, Video::FilterLinear); } } else { video.set(Video::Shader, (const char*)config->video.shader); } updatePalette(); } void Utility::resize(bool resizeWindow) { if(program->active == nullptr) { auto geometry = presentation->geometry(); presentation->viewport.setGeometry({0, 0, geometry.width, geometry.height}); return; } Geometry geometry = presentation->geometry(); unsigned width = system().information.width; unsigned height = system().information.height; unsigned scaledWidth = geometry.width / width; unsigned scaledHeight = geometry.height / height; unsigned multiplier = max(1u, min(scaledWidth, scaledHeight)); if(config->video.aspectCorrection) { width *= system().information.aspectRatio; } width *= multiplier; height *= multiplier; unsigned scaleMode = 0; if(config->video.scaleMode == 1) { width = (double)width * ((double)geometry.height / height); height = geometry.height; } if(config->video.scaleMode == 2) { width = geometry.width; height = geometry.height; } if(resizeWindow == false) { if(geometry.width < width ) width = geometry.width; if(geometry.height < height) height = geometry.height; presentation->viewport.setGeometry({ (geometry.width - width) / 2, (geometry.height - height) / 2, width, height }); } else { presentation->setGeometry({geometry.x, geometry.y, width, height}); presentation->viewport.setGeometry({0, 0, width, height}); } presentation->synchronize(); } void Utility::toggleFullScreen() { static Geometry geometry; if(presentation->fullScreen() == false) { geometry = presentation->geometry(); presentation->setMenuVisible(false); presentation->setStatusVisible(false); presentation->setFullScreen(true); input.acquire(); } else { input.unacquire(); presentation->setMenuVisible(true); presentation->setStatusVisible(true); presentation->setFullScreen(false); presentation->setGeometry(geometry); } resize(); } void Utility::updateStatus() { time_t currentTime = time(0); string text; if((currentTime - statusTime) <= 2) { text = statusMessage; } else if(program->active == nullptr) { text = "No cartridge loaded"; } else if(program->pause || program->autopause) { text = "Paused"; } else { text = statusText; } if(text != presentation->statusText()) { presentation->setStatusText(text); } } void Utility::setStatusText(string text) { statusText = text; } void Utility::showMessage(string message) { statusTime = time(0); statusMessage = message; } string Utility::libraryPath() { string path = string::read({configpath(), "higan/library.bml"}).strip().ltrim<1>("Path: ").transform("\\", "/"); if(path.empty()) path = {userpath(), "Emulation/"}; if(path.endsWith("/") == false) path.append("/"); return path; } Utility::Utility() { tracerEnable = false; statusTime = 0; } sfc/chip/cx4/opcodes.cpp000664 001750 001750 00000011303 12651764221 016242 0ustar00sergiosergio000000 000000 #ifdef CX4_CPP //Sprite Functions void Cx4::op00() { switch(reg[0x4d]) { case 0x00: op00_00(); break; case 0x03: op00_03(); break; case 0x05: op00_05(); break; case 0x07: op00_07(); break; case 0x08: op00_08(); break; case 0x0b: op00_0b(); break; case 0x0c: op00_0c(); break; } } //Draw Wireframe void Cx4::op01() { memset(ram + 0x300, 0, 2304); C4DrawWireFrame(); } //Propulsion void Cx4::op05() { int32 temp = 0x10000; if(readw(0x1f83)) { temp = sar((temp / readw(0x1f83)) * readw(0x1f81), 8); } writew(0x1f80, temp); } //Set Vector length void Cx4::op0d() { C41FXVal = readw(0x1f80); C41FYVal = readw(0x1f83); C41FDistVal = readw(0x1f86); double tanval = sqrt(((double)C41FYVal) * ((double)C41FYVal) + ((double)C41FXVal) * ((double)C41FXVal)); tanval = (double)C41FDistVal / tanval; C41FYVal = (int16)(((double)C41FYVal * tanval) * 0.99); C41FXVal = (int16)(((double)C41FXVal * tanval) * 0.98); writew(0x1f89, C41FXVal); writew(0x1f8c, C41FYVal); } //Triangle void Cx4::op10() { r0 = ldr(0); r1 = ldr(1); r4 = r0 & 0x1ff; if(r1 & 0x8000)r1 |= ~0x7fff; else r1 &= 0x7fff; mul(cos(r4), r1, r5, r2); r5 = (r5 >> 16) & 0xff; r2 = (r2 << 8) + r5; mul(sin(r4), r1, r5, r3); r5 = (r5 >> 16) & 0xff; r3 = (r3 << 8) + r5; str(0, r0); str(1, r1); str(2, r2); str(3, r3); str(4, r4); str(5, r5); } //Triangle void Cx4::op13() { r0 = ldr(0); r1 = ldr(1); r4 = r0 & 0x1ff; mul(cos(r4), r1, r5, r2); r5 = (r5 >> 8) & 0xffff; r2 = (r2 << 16) + r5; mul(sin(r4), r1, r5, r3); r5 = (r5 >> 8) & 0xffff; r3 = (r3 << 16) + r5; str(0, r0); str(1, r1); str(2, r2); str(3, r3); str(4, r4); str(5, r5); } //Pythagorean void Cx4::op15() { C41FXVal = readw(0x1f80); C41FYVal = readw(0x1f83); C41FDist = (int16)sqrt((double)C41FXVal * (double)C41FXVal + (double)C41FYVal * (double)C41FYVal); writew(0x1f80, C41FDist); } //Calculate distance void Cx4::op1f() { C41FXVal = readw(0x1f80); C41FYVal = readw(0x1f83); if(!C41FXVal) { C41FAngleRes = (C41FYVal > 0) ? 0x080 : 0x180; } else { double tanval = ((double)C41FYVal) / ((double)C41FXVal); C41FAngleRes = (short)(atan(tanval) / (PI * 2) * 512); if(C41FXVal < 0) { C41FAngleRes += 0x100; } C41FAngleRes &= 0x1ff; } writew(0x1f86, C41FAngleRes); } //Trapezoid void Cx4::op22() { int16 angle1 = readw(0x1f8c) & 0x1ff; int16 angle2 = readw(0x1f8f) & 0x1ff; int32 tan1 = Tan(angle1); int32 tan2 = Tan(angle2); int16 y = readw(0x1f83) - readw(0x1f89); int16 left, right; for(int32 j = 0; j < 225; j++, y++) { if(y >= 0) { left = sar((int32)tan1 * y, 16) - readw(0x1f80) + readw(0x1f86); right = sar((int32)tan2 * y, 16) - readw(0x1f80) + readw(0x1f86) + readw(0x1f93); if(left < 0 && right < 0) { left = 1; right = 0; } else if(left < 0) { left = 0; } else if(right < 0) { right = 0; } if(left > 255 && right > 255) { left = 255; right = 254; } else if(left > 255) { left = 255; } else if(right > 255) { right = 255; } } else { left = 1; right = 0; } ram[j + 0x800] = (uint8)left; ram[j + 0x900] = (uint8)right; } } //Multiply void Cx4::op25() { r0 = ldr(0); r1 = ldr(1); mul(r0, r1, r0, r1); str(0, r0); str(1, r1); } //Transform Coords void Cx4::op2d() { C4WFXVal = readw(0x1f81); C4WFYVal = readw(0x1f84); C4WFZVal = readw(0x1f87); C4WFX2Val = read (0x1f89); C4WFY2Val = read (0x1f8a); C4WFDist = read (0x1f8b); C4WFScale = readw(0x1f90); C4TransfWireFrame2(); writew(0x1f80, C4WFXVal); writew(0x1f83, C4WFYVal); } //Sum void Cx4::op40() { r0 = 0; for(uint32 i=0;i<0x800;i++) { r0 += ram[i]; } str(0, r0); } //Square void Cx4::op54() { r0 = ldr(0); mul(r0, r0, r1, r2); str(1, r1); str(2, r2); } //Immediate Register void Cx4::op5c() { str(0, 0x000000); immediate_reg(0); } //Immediate Register (Multiple) void Cx4::op5e() { immediate_reg( 0); } void Cx4::op60() { immediate_reg( 3); } void Cx4::op62() { immediate_reg( 6); } void Cx4::op64() { immediate_reg( 9); } void Cx4::op66() { immediate_reg(12); } void Cx4::op68() { immediate_reg(15); } void Cx4::op6a() { immediate_reg(18); } void Cx4::op6c() { immediate_reg(21); } void Cx4::op6e() { immediate_reg(24); } void Cx4::op70() { immediate_reg(27); } void Cx4::op72() { immediate_reg(30); } void Cx4::op74() { immediate_reg(33); } void Cx4::op76() { immediate_reg(36); } void Cx4::op78() { immediate_reg(39); } void Cx4::op7a() { immediate_reg(42); } void Cx4::op7c() { immediate_reg(45); } //Immediate ROM void Cx4::op89() { str(0, 0x054336); str(1, 0xffffff); } #endif nall/string/char/compare.hpp000664 001750 001750 00000003774 12651764221 017233 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { char chrlower(char c) { return (c >= 'A' && c <= 'Z') ? c + ('a' - 'A') : c; } char chrupper(char c) { return (c >= 'a' && c <= 'z') ? c - ('a' - 'A') : c; } int imemcmp(const char* str1, const char* str2, unsigned size) { while(size--) { if(chrlower(*str1) != chrlower(*str2)) break; str1++, str2++; } return (int)chrlower(*str1) - (int)chrlower(*str2); } int istrcmp(const char* str1, const char* str2) { while(*str1) { if(chrlower(*str1) != chrlower(*str2)) break; str1++, str2++; } return (int)chrlower(*str1) - (int)chrlower(*str2); } bool strbegin(const char* str, const char* key) { if(!str || !key) return false; int i, ssl = strlen(str), ksl = strlen(key); if(ksl > ssl) return false; return (!memcmp(str, key, ksl)); } bool istrbegin(const char* str, const char* key) { if(!str || !key) return false; int ssl = strlen(str), ksl = strlen(key); if(ksl > ssl) return false; for(int i = 0; i < ksl; i++) { if(str[i] >= 'A' && str[i] <= 'Z') { if(str[i] != key[i] && str[i]+0x20 != key[i])return false; } else if(str[i] >= 'a' && str[i] <= 'z') { if(str[i] != key[i] && str[i]-0x20 != key[i])return false; } else { if(str[i] != key[i])return false; } } return true; } bool strend(const char* str, const char* key) { if(!str || !key) return false; int ssl = strlen(str), ksl = strlen(key); if(ksl > ssl) return false; return (!memcmp(str + ssl - ksl, key, ksl)); } bool istrend(const char* str, const char* key) { if(!str || !key) return false; int ssl = strlen(str), ksl = strlen(key); if(ksl > ssl) return false; for(int i = ssl - ksl, z = 0; i < ssl; i++, z++) { if(str[i] >= 'A' && str[i] <= 'Z') { if(str[i] != key[z] && str[i]+0x20 != key[z])return false; } else if(str[i] >= 'a' && str[i] <= 'z') { if(str[i] != key[z] && str[i]-0x20 != key[z])return false; } else { if(str[i] != key[z])return false; } } return true; } } #endif sfc/chip/sa1/sa1.cpp000664 001750 001750 00000014216 12651764221 015266 0ustar00sergiosergio000000 000000 #include #define SA1_CPP namespace SuperFamicom { SA1 sa1; #include "serialization.cpp" #include "bus/bus.cpp" #include "dma/dma.cpp" #include "memory/memory.cpp" #include "mmio/mmio.cpp" void SA1::Enter() { sa1.enter(); } void SA1::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(mmio.sa1_rdyb || mmio.sa1_resb) { //SA-1 co-processor is asleep tick(); synchronize_cpu(); continue; } if(status.interrupt_pending) { status.interrupt_pending = false; op_irq(); continue; } (this->*opcode_table[op_readpc()])(); } } void SA1::op_irq() { op_read(regs.pc.d); op_io(); if(!regs.e) op_writestack(regs.pc.b); op_writestack(regs.pc.h); op_writestack(regs.pc.l); op_writestack(regs.e ? (regs.p & ~0x10) : regs.p); regs.pc.w = regs.vector; regs.pc.b = 0x00; regs.p.i = 1; regs.p.d = 0; } void SA1::last_cycle() { if(mmio.sa1_nmi && !mmio.sa1_nmicl) { status.interrupt_pending = true; regs.vector = mmio.cnv; mmio.sa1_nmifl = true; mmio.sa1_nmicl = 1; regs.wai = false; } else if(!regs.p.i) { if(mmio.timer_irqen && !mmio.timer_irqcl) { status.interrupt_pending = true; regs.vector = mmio.civ; mmio.timer_irqfl = true; regs.wai = false; } else if(mmio.dma_irqen && !mmio.dma_irqcl) { status.interrupt_pending = true; regs.vector = mmio.civ; mmio.dma_irqfl = true; regs.wai = false; } else if(mmio.sa1_irq && !mmio.sa1_irqcl) { status.interrupt_pending = true; regs.vector = mmio.civ; mmio.sa1_irqfl = true; regs.wai = false; } } } bool SA1::interrupt_pending() { return status.interrupt_pending; } void SA1::tick() { step(2); if(++status.tick_counter == 0) synchronize_cpu(); //adjust counters: //note that internally, status counters are in clocks; //whereas MMIO register counters are in dots (4 clocks = 1 dot) if(mmio.hvselb == 0) { //HV timer status.hcounter += 2; if(status.hcounter >= 1364) { status.hcounter = 0; if(++status.vcounter >= status.scanlines) status.vcounter = 0; } } else { //linear timer status.hcounter += 2; status.vcounter += (status.hcounter >> 11); status.hcounter &= 0x07ff; status.vcounter &= 0x01ff; } //test counters for timer IRQ switch((mmio.ven << 1) + (mmio.hen << 0)) { case 0: break; case 1: if(status.hcounter == (mmio.hcnt << 2)) trigger_irq(); break; case 2: if(status.vcounter == mmio.vcnt && status.hcounter == 0) trigger_irq(); break; case 3: if(status.vcounter == mmio.hcnt && status.hcounter == (mmio.hcnt << 2)) trigger_irq(); break; } } void SA1::trigger_irq() { mmio.timer_irqfl = true; if(mmio.timer_irqen) mmio.timer_irqcl = 0; } void SA1::init() { } void SA1::load() { } void SA1::unload() { rom.reset(); iram.reset(); bwram.reset(); } void SA1::power() { regs.a = regs.x = regs.y = 0x0000; regs.s = 0x01ff; } void SA1::reset() { create(SA1::Enter, system.cpu_frequency()); cpubwram.dma = false; for(unsigned addr = 0; addr < iram.size(); addr++) { iram.write(addr, 0x00); } regs.pc.d = 0x000000; regs.x.h = 0x00; regs.y.h = 0x00; regs.s.h = 0x01; regs.d = 0x0000; regs.db = 0x00; regs.p = 0x34; regs.e = 1; regs.mdr = 0x00; regs.wai = false; regs.vector = 0x0000; R65816::update_table(); status.tick_counter = 0; status.interrupt_pending = false; status.scanlines = (system.region() == System::Region::NTSC ? 262 : 312); status.vcounter = 0; status.hcounter = 0; dma.line = 0; //$2200 CCNT mmio.sa1_irq = false; mmio.sa1_rdyb = false; mmio.sa1_resb = true; mmio.sa1_nmi = false; mmio.smeg = 0; //$2201 SIE mmio.cpu_irqen = false; mmio.chdma_irqen = false; //$2202 SIC mmio.cpu_irqcl = false; mmio.chdma_irqcl = false; //$2203,$2204 CRV mmio.crv = 0x0000; //$2205,$2206 CNV mmio.cnv = 0x0000; //$2207,$2208 CIV mmio.civ = 0x0000; //$2209 SCNT mmio.cpu_irq = false; mmio.cpu_ivsw = false; mmio.cpu_nvsw = false; mmio.cmeg = 0; //$220a CIE mmio.sa1_irqen = false; mmio.timer_irqen = false; mmio.dma_irqen = false; mmio.sa1_nmien = false; //$220b CIC mmio.sa1_irqcl = false; mmio.timer_irqcl = false; mmio.dma_irqcl = false; mmio.sa1_nmicl = false; //$220c,$220d SNV mmio.snv = 0x0000; //$220e,$220f SIV mmio.siv = 0x0000; //$2210 mmio.hvselb = false; mmio.ven = false; mmio.hen = false; //$2212,$2213 HCNT mmio.hcnt = 0x0000; //$2214,$2215 VCNT mmio.vcnt = 0x0000; //$2220-2223 CXB, DXB, EXB, FXB mmio.cbmode = 0; mmio.dbmode = 0; mmio.ebmode = 0; mmio.fbmode = 0; mmio.cb = 0x00; mmio.db = 0x01; mmio.eb = 0x02; mmio.fb = 0x03; //$2224 BMAPS mmio.sbm = 0x00; //$2225 BMAP mmio.sw46 = false; mmio.cbm = 0x00; //$2226 SWBE mmio.swen = false; //$2227 CWBE mmio.cwen = false; //$2228 BWPA mmio.bwp = 0x0f; //$2229 SIWP mmio.siwp = 0x00; //$222a CIWP mmio.ciwp = 0x00; //$2230 DCNT mmio.dmaen = false; mmio.dprio = false; mmio.cden = false; mmio.cdsel = false; mmio.dd = 0; mmio.sd = 0; //$2231 CDMA mmio.chdend = false; mmio.dmasize = 0; mmio.dmacb = 0; //$2232-$2234 SDA mmio.dsa = 0x000000; //$2235-$2237 DDA mmio.dda = 0x000000; //$2238,$2239 DTC mmio.dtc = 0x0000; //$223f BBF mmio.bbf = 0; //$2240-$224f BRF for(unsigned i = 0; i < 16; i++) { mmio.brf[i] = 0x00; } //$2250 MCNT mmio.acm = 0; mmio.md = 0; //$2251,$2252 MA mmio.ma = 0x0000; //$2253,$2254 MB mmio.mb = 0x0000; //$2258 VBD mmio.hl = false; mmio.vb = 16; //$2259-$225b mmio.va = 0x000000; mmio.vbit = 0; //$2300 SFR mmio.cpu_irqfl = false; mmio.chdma_irqfl = false; //$2301 CFR mmio.sa1_irqfl = false; mmio.timer_irqfl = false; mmio.dma_irqfl = false; mmio.sa1_nmifl = false; //$2302,$2303 HCR mmio.hcr = 0x0000; //$2304,$2305 VCR mmio.vcr = 0x0000; //$2306-$230a MR mmio.mr = 0; //$230b mmio.overflow = false; } } fc/apu/sweep.hpp000664 001750 001750 00000000401 12651764221 014714 0ustar00sergiosergio000000 000000 struct Sweep { uint8 shift; bool decrement; uint3 period; uint8 counter; bool enable; bool reload; uint11 pulse_period; bool check_period(); void clock(unsigned channel); void power(); void reset(); void serialize(serializer&); }; phoenix/windows/widget/viewport.cpp000664 001750 001750 00000004420 12651764221 020722 0ustar00sergiosergio000000 000000 namespace phoenix { static LRESULT CALLBACK Viewport_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { Object* object = (Object*)GetWindowLongPtr(hwnd, GWLP_USERDATA); if(object == nullptr) return DefWindowProc(hwnd, msg, wparam, lparam); if(!dynamic_cast(object)) return DefWindowProc(hwnd, msg, wparam, lparam); Viewport& viewport = (Viewport&)*object; if(msg == WM_DROPFILES) { lstring paths = DropPaths(wparam); if(paths.empty() == false) { if(viewport.onDrop) viewport.onDrop(paths); } return FALSE; } if(msg == WM_GETDLGCODE) { return DLGC_STATIC | DLGC_WANTCHARS; } if(msg == WM_MOUSEMOVE) { TRACKMOUSEEVENT tracker = {sizeof(TRACKMOUSEEVENT), TME_LEAVE, hwnd}; TrackMouseEvent(&tracker); if(viewport.onMouseMove) viewport.onMouseMove({(int16_t)LOWORD(lparam), (int16_t)HIWORD(lparam)}); } if(msg == WM_MOUSELEAVE) { if(viewport.onMouseLeave) viewport.onMouseLeave(); } if(msg == WM_LBUTTONDOWN || msg == WM_MBUTTONDOWN || msg == WM_RBUTTONDOWN) { if(viewport.onMousePress) switch(msg) { case WM_LBUTTONDOWN: viewport.onMousePress(Mouse::Button::Left); break; case WM_MBUTTONDOWN: viewport.onMousePress(Mouse::Button::Middle); break; case WM_RBUTTONDOWN: viewport.onMousePress(Mouse::Button::Right); break; } } if(msg == WM_LBUTTONUP || msg == WM_MBUTTONUP || msg == WM_RBUTTONUP) { if(viewport.onMouseRelease) switch(msg) { case WM_LBUTTONUP: viewport.onMouseRelease(Mouse::Button::Left); break; case WM_MBUTTONUP: viewport.onMouseRelease(Mouse::Button::Middle); break; case WM_RBUTTONUP: viewport.onMouseRelease(Mouse::Button::Right); break; } } return DefWindowProc(hwnd, msg, wparam, lparam); } uintptr_t pViewport::handle() { return (uintptr_t)hwnd; } void pViewport::setDroppable(bool droppable) { DragAcceptFiles(hwnd, droppable); } void pViewport::constructor() { hwnd = CreateWindow(L"phoenix_viewport", L"", WS_CHILD | WS_DISABLED, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&viewport); setDroppable(viewport.state.droppable); synchronize(); } void pViewport::destructor() { DestroyWindow(hwnd); } void pViewport::orphan() { destructor(); constructor(); } } gba/ppu/object.cpp000664 001750 001750 00000005261 12651764221 015223 0ustar00sergiosergio000000 000000 void PPU::render_objects() { if(regs.control.enable[OBJ] == false) return; for(unsigned n = 0; n < 128; n++) render_object(object[n]); } //px,py = pixel coordinates within sprite [0,0 - width,height) //fx,fy = affine pixel coordinates //pa,pb,pc,pd = affine pixel adjustments //x,y = adjusted coordinates within sprite (linear = vflip/hflip, affine = rotation/zoom) void PPU::render_object(Object& obj) { uint8 py = regs.vcounter - obj.y; if(obj.affine == 0 && obj.affinesize == 1) return; //hidden if(py >= obj.height << obj.affinesize) return; //offscreen auto& output = layer[OBJ]; unsigned rowsize = regs.control.objmapping == 0 ? 32 >> obj.colors : obj.width / 8; unsigned baseaddr = obj.character * 32; if(obj.mosaic && regs.mosaic.objvsize) { signed mosaicy = (regs.vcounter / (1 + regs.mosaic.objvsize)) * (1 + regs.mosaic.objvsize); py = obj.y >= 160 || mosaicy - obj.y >= 0 ? mosaicy - obj.y : 0; } int16 pa = objectparam[obj.affineparam].pa; int16 pb = objectparam[obj.affineparam].pb; int16 pc = objectparam[obj.affineparam].pc; int16 pd = objectparam[obj.affineparam].pd; //center-of-sprite coordinates int16 centerx = obj.width / 2; int16 centery = obj.height / 2; //origin coordinates (top-left of sprite) int28 originx = -(centerx << obj.affinesize); int28 originy = -(centery << obj.affinesize) + py; //fractional pixel coordinates int28 fx = originx * pa + originy * pb; int28 fy = originx * pc + originy * pd; for(unsigned px = 0; px < (obj.width << obj.affinesize); px++) { unsigned x, y; if(obj.affine == 0) { x = px; y = py; if(obj.hflip) x ^= obj.width - 1; if(obj.vflip) y ^= obj.height - 1; } else { x = (fx >> 8) + centerx; y = (fy >> 8) + centery; } uint9 ox = obj.x + px; if(ox < 240 && x < obj.width && y < obj.height) { unsigned offset = (y / 8) * rowsize + (x / 8); offset = offset * 64 + (y & 7) * 8 + (x & 7); uint8 color = object_vram_read(baseaddr + (offset >> !obj.colors)); if(obj.colors == 0) color = (x & 1) ? color >> 4 : color & 15; if(color) { if(obj.mode & 2) { windowmask[Obj][ox] = true; } else if(output[ox].enable == false || obj.priority < output[ox].priority) { if(obj.colors == 0) color = obj.palette * 16 + color; output[ox].write(true, obj.priority, pram[256 + color], obj.mode == 1, obj.mosaic); } } } fx += pa; fy += pc; } } uint8 PPU::object_vram_read(unsigned addr) const { if(regs.control.bgmode == 3 || regs.control.bgmode == 4 || regs.control.bgmode == 5) { if(addr <= 0x3fff) return 0u; } return vram[0x10000 + (addr & 0x7fff)]; } target-libretro/000700 001750 001750 00000000000 12656700342 015001 5ustar00sergiosergio000000 000000 phoenix/reference/window.cpp000664 001750 001750 00000002431 12651764221 017333 0ustar00sergiosergio000000 000000 namespace phoenix { Window& pWindow::none() { static Window* window = nullptr; if(window == nullptr) window = new Window; return *window; } void pWindow::append(Layout& layout) { } void pWindow::append(Menu& menu) { } void pWindow::append(Widget& widget) { } bool pWindow::focused() { return false; } Geometry pWindow::frameMargin() { return {0, 0, 0, 0}; } Geometry pWindow::geometry() { return {0, 0, 0, 0}; } void pWindow::remove(Layout& layout) { } void pWindow::remove(Menu& menu) { } void pWindow::remove(Widget& widget) { } void pWindow::setBackgroundColor(Color color) { } void pWindow::setDroppable(bool droppable) { } void pWindow::setFocused() { } void pWindow::setFullScreen(bool fullScreen) { } void pWindow::setGeometry(Geometry geometry) { } void pWindow::setMenuFont(string font) { } void pWindow::setMenuVisible(bool visible) { } void pWindow::setModal(bool modal) { } void pWindow::setResizable(bool resizable) { } void pWindow::setStatusFont(string font) { } void pWindow::setStatusText(string text) { } void pWindow::setStatusVisible(bool visible) { } void pWindow::setTitle(string text) { } void pWindow::setVisible(bool visible) { } void pWindow::setWidgetFont(string font) { } void pWindow::constructor() { } void pWindow::destructor() { } } sfc/alt/smp/algorithms.cpp000664 001750 001750 00000004204 12651764221 016717 0ustar00sergiosergio000000 000000 uint8 SMP::op_adc(uint8 x, uint8 y) { int r = x + y + regs.p.c; regs.p.n = r & 0x80; regs.p.v = ~(x ^ y) & (x ^ r) & 0x80; regs.p.h = (x ^ y ^ r) & 0x10; regs.p.z = (uint8)r == 0; regs.p.c = r > 0xff; return r; } uint16 SMP::op_addw(uint16 x, uint16 y) { uint16 r; regs.p.c = 0; r = op_adc(x, y); r |= op_adc(x >> 8, y >> 8) << 8; regs.p.z = r == 0; return r; } uint8 SMP::op_and(uint8 x, uint8 y) { x &= y; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SMP::op_cmp(uint8 x, uint8 y) { int r = x - y; regs.p.n = r & 0x80; regs.p.z = (uint8)r == 0; regs.p.c = r >= 0; return x; } uint16 SMP::op_cmpw(uint16 x, uint16 y) { int r = x - y; regs.p.n = r & 0x8000; regs.p.z = (uint16)r == 0; regs.p.c = r >= 0; return x; } uint8 SMP::op_eor(uint8 x, uint8 y) { x ^= y; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SMP::op_or(uint8 x, uint8 y) { x |= y; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SMP::op_sbc(uint8 x, uint8 y) { int r = x - y - !regs.p.c; regs.p.n = r & 0x80; regs.p.v = (x ^ y) & (x ^ r) & 0x80; regs.p.h = !((x ^ y ^ r) & 0x10); regs.p.z = (uint8)r == 0; regs.p.c = r >= 0; return r; } uint16 SMP::op_subw(uint16 x, uint16 y) { uint16 r; regs.p.c = 1; r = op_sbc(x, y); r |= op_sbc(x >> 8, y >> 8) << 8; regs.p.z = r == 0; return r; } uint8 SMP::op_inc(uint8 x) { x++; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SMP::op_dec(uint8 x) { x--; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SMP::op_asl(uint8 x) { regs.p.c = x & 0x80; x <<= 1; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SMP::op_lsr(uint8 x) { regs.p.c = x & 0x01; x >>= 1; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SMP::op_rol(uint8 x) { unsigned carry = (unsigned)regs.p.c; regs.p.c = x & 0x80; x = (x << 1) | carry; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SMP::op_ror(uint8 x) { unsigned carry = (unsigned)regs.p.c << 7; regs.p.c = x & 0x01; x = carry | (x >> 1); regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } sfc/dsp/echo.cpp000664 001750 001750 00000006300 12651764221 014672 0ustar00sergiosergio000000 000000 #ifdef DSP_CPP int DSP::calc_fir(int i, bool channel) { int s = state.echo_hist[channel][state.echo_hist_pos + i + 1]; return (s * (int8)REG(fir + i * 0x10)) >> 6; } int DSP::echo_output(bool channel) { int output = (int16)((state.t_main_out[channel] * (int8)REG(mvoll + channel * 0x10)) >> 7) + (int16)((state.t_echo_in [channel] * (int8)REG(evoll + channel * 0x10)) >> 7); return sclamp<16>(output); } void DSP::echo_read(bool channel) { unsigned addr = state.t_echo_ptr + channel * 2; uint8 lo = smp.apuram[(uint16)(addr + 0)]; uint8 hi = smp.apuram[(uint16)(addr + 1)]; int s = (int16)((hi << 8) + lo); state.echo_hist[channel].write(state.echo_hist_pos, s >> 1); } void DSP::echo_write(bool channel) { if(!(state.t_echo_disabled & 0x20)) { unsigned addr = state.t_echo_ptr + channel * 2; int s = state.t_echo_out[channel]; smp.apuram[(uint16)(addr + 0)] = s; smp.apuram[(uint16)(addr + 1)] = s >> 8; } state.t_echo_out[channel] = 0; } void DSP::echo_22() { //history state.echo_hist_pos++; if(state.echo_hist_pos >= echo_hist_size) state.echo_hist_pos = 0; state.t_echo_ptr = (uint16)((state.t_esa << 8) + state.echo_offset); echo_read(0); //FIR int l = calc_fir(0, 0); int r = calc_fir(0, 1); state.t_echo_in[0] = l; state.t_echo_in[1] = r; } void DSP::echo_23() { int l = calc_fir(1, 0) + calc_fir(2, 0); int r = calc_fir(1, 1) + calc_fir(2, 1); state.t_echo_in[0] += l; state.t_echo_in[1] += r; echo_read(1); } void DSP::echo_24() { int l = calc_fir(3, 0) + calc_fir(4, 0) + calc_fir(5, 0); int r = calc_fir(3, 1) + calc_fir(4, 1) + calc_fir(5, 1); state.t_echo_in[0] += l; state.t_echo_in[1] += r; } void DSP::echo_25() { int l = state.t_echo_in[0] + calc_fir(6, 0); int r = state.t_echo_in[1] + calc_fir(6, 1); l = (int16)l; r = (int16)r; l += (int16)calc_fir(7, 0); r += (int16)calc_fir(7, 1); state.t_echo_in[0] = sclamp<16>(l) & ~1; state.t_echo_in[1] = sclamp<16>(r) & ~1; } void DSP::echo_26() { //left output volumes //(save sample for next clock so we can output both together) state.t_main_out[0] = echo_output(0); //echo feedback int l = state.t_echo_out[0] + (int16)((state.t_echo_in[0] * (int8)REG(efb)) >> 7); int r = state.t_echo_out[1] + (int16)((state.t_echo_in[1] * (int8)REG(efb)) >> 7); state.t_echo_out[0] = sclamp<16>(l) & ~1; state.t_echo_out[1] = sclamp<16>(r) & ~1; } void DSP::echo_27() { //output int outl = state.t_main_out[0]; int outr = echo_output(1); state.t_main_out[0] = 0; state.t_main_out[1] = 0; //TODO: global muting isn't this simple //(turns DAC on and off or something, causing small ~37-sample pulse when first muted) if(REG(flg) & 0x40) { outl = 0; outr = 0; } //output sample to DAC audio.sample(outl, outr); } void DSP::echo_28() { state.t_echo_disabled = REG(flg); } void DSP::echo_29() { state.t_esa = REG(esa); if(!state.echo_offset) state.echo_length = (REG(edl) & 0x0f) << 11; state.echo_offset += 4; if(state.echo_offset >= state.echo_length) state.echo_offset = 0; //write left echo echo_write(0); state.t_echo_disabled = REG(flg); } void DSP::echo_30() { //write right echo echo_write(1); } #endif phoenix/reference/widget/line-edit.hpp000664 001750 001750 00000000436 12651764221 021171 0ustar00sergiosergio000000 000000 namespace phoenix { struct pLineEdit : public pWidget { LineEdit& lineEdit; void setEditable(bool editable); void setText(string text); string text(); pLineEdit(LineEdit& lineEdit) : pWidget(lineEdit), lineEdit(lineEdit) {} void constructor(); void destructor(); }; } phoenix/gtk/action/menu.cpp000664 001750 001750 00000002645 12651764221 017103 0ustar00sergiosergio000000 000000 namespace phoenix { void pMenu::append(Action& action) { action.state.window = this->action.state.window; gtk_menu_shell_append(GTK_MENU_SHELL(gtkMenu), action.p.widget); if(action.state.window && action.state.window->state.menuFont != "") { action.p.setFont(action.state.window->state.menuFont); } gtk_widget_show(action.p.widget); } void pMenu::remove(Action& action) { action.p.orphan(); action.state.window = nullptr; } void pMenu::setImage(const image& image) { if(image.empty() == false) { GtkImage* gtkImage = CreateImage(image, true); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(widget), (GtkWidget*)gtkImage); } else { gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(widget), nullptr); } } void pMenu::setText(string text) { gtk_menu_item_set_label(GTK_MENU_ITEM(widget), mnemonic(text)); } void pMenu::constructor() { gtkMenu = gtk_menu_new(); widget = gtk_image_menu_item_new_with_mnemonic(""); gtk_menu_item_set_submenu(GTK_MENU_ITEM(widget), gtkMenu); setText(menu.state.text); } void pMenu::destructor() { gtk_widget_destroy(gtkMenu); gtk_widget_destroy(widget); } void pMenu::orphan() { for(auto& action : menu.state.action) action.p.orphan(); destructor(); constructor(); for(auto& action : menu.state.action) append(action); } void pMenu::setFont(string font) { pAction::setFont(font); for(auto& item : menu.state.action) item.p.setFont(font); } } processor/spc700/spc700.cpp000664 001750 001750 00000027767 12651764221 016506 0ustar00sergiosergio000000 000000 #include #include "spc700.hpp" namespace Processor { #include "algorithms.cpp" #include "instructions.cpp" #include "disassembler.cpp" #include "serialization.cpp" void SPC700::op_step() { switch(opcode = op_readpc()) { case 0x00: return op_nop(); case 0x01: return op_jst(); case 0x02: return op_set_bit(); case 0x03: return op_branch_bit(); case 0x04: return op_read_dp<&SPC700::op_or>(regs.a); case 0x05: return op_read_addr<&SPC700::op_or>(regs.a); case 0x06: return op_read_ix<&SPC700::op_or>(); case 0x07: return op_read_idpx<&SPC700::op_or>(); case 0x08: return op_read_const<&SPC700::op_or>(regs.a); case 0x09: return op_write_dp_dp<&SPC700::op_or>(); case 0x0a: return op_set_addr_bit(); case 0x0b: return op_adjust_dp<&SPC700::op_asl>(); case 0x0c: return op_adjust_addr<&SPC700::op_asl>(); case 0x0d: return op_push(regs.p); case 0x0e: return op_test_addr(1); case 0x0f: return op_brk(); case 0x10: return op_branch(regs.p.n == 0); case 0x11: return op_jst(); case 0x12: return op_set_bit(); case 0x13: return op_branch_bit(); case 0x14: return op_read_dpi<&SPC700::op_or>(regs.a, regs.x); case 0x15: return op_read_addri<&SPC700::op_or>(regs.x); case 0x16: return op_read_addri<&SPC700::op_or>(regs.y); case 0x17: return op_read_idpy<&SPC700::op_or>(); case 0x18: return op_write_dp_const<&SPC700::op_or>(); case 0x19: return op_write_ix_iy<&SPC700::op_or>(); case 0x1a: return op_adjust_dpw(-1); case 0x1b: return op_adjust_dpx<&SPC700::op_asl>(); case 0x1c: return op_adjust<&SPC700::op_asl>(regs.a); case 0x1d: return op_adjust<&SPC700::op_dec>(regs.x); case 0x1e: return op_read_addr<&SPC700::op_cmp>(regs.x); case 0x1f: return op_jmp_iaddrx(); case 0x20: return op_set_flag(regs.p.p, 0); case 0x21: return op_jst(); case 0x22: return op_set_bit(); case 0x23: return op_branch_bit(); case 0x24: return op_read_dp<&SPC700::op_and>(regs.a); case 0x25: return op_read_addr<&SPC700::op_and>(regs.a); case 0x26: return op_read_ix<&SPC700::op_and>(); case 0x27: return op_read_idpx<&SPC700::op_and>(); case 0x28: return op_read_const<&SPC700::op_and>(regs.a); case 0x29: return op_write_dp_dp<&SPC700::op_and>(); case 0x2a: return op_set_addr_bit(); case 0x2b: return op_adjust_dp<&SPC700::op_rol>(); case 0x2c: return op_adjust_addr<&SPC700::op_rol>(); case 0x2d: return op_push(regs.a); case 0x2e: return op_bne_dp(); case 0x2f: return op_branch(true); case 0x30: return op_branch(regs.p.n == 1); case 0x31: return op_jst(); case 0x32: return op_set_bit(); case 0x33: return op_branch_bit(); case 0x34: return op_read_dpi<&SPC700::op_and>(regs.a, regs.x); case 0x35: return op_read_addri<&SPC700::op_and>(regs.x); case 0x36: return op_read_addri<&SPC700::op_and>(regs.y); case 0x37: return op_read_idpy<&SPC700::op_and>(); case 0x38: return op_write_dp_const<&SPC700::op_and>(); case 0x39: return op_write_ix_iy<&SPC700::op_and>(); case 0x3a: return op_adjust_dpw(+1); case 0x3b: return op_adjust_dpx<&SPC700::op_rol>(); case 0x3c: return op_adjust<&SPC700::op_rol>(regs.a); case 0x3d: return op_adjust<&SPC700::op_inc>(regs.x); case 0x3e: return op_read_dp<&SPC700::op_cmp>(regs.x); case 0x3f: return op_jsr_addr(); case 0x40: return op_set_flag(regs.p.p, 1); case 0x41: return op_jst(); case 0x42: return op_set_bit(); case 0x43: return op_branch_bit(); case 0x44: return op_read_dp<&SPC700::op_eor>(regs.a); case 0x45: return op_read_addr<&SPC700::op_eor>(regs.a); case 0x46: return op_read_ix<&SPC700::op_eor>(); case 0x47: return op_read_idpx<&SPC700::op_eor>(); case 0x48: return op_read_const<&SPC700::op_eor>(regs.a); case 0x49: return op_write_dp_dp<&SPC700::op_eor>(); case 0x4a: return op_set_addr_bit(); case 0x4b: return op_adjust_dp<&SPC700::op_lsr>(); case 0x4c: return op_adjust_addr<&SPC700::op_lsr>(); case 0x4d: return op_push(regs.x); case 0x4e: return op_test_addr(0); case 0x4f: return op_jsp_dp(); case 0x50: return op_branch(regs.p.v == 0); case 0x51: return op_jst(); case 0x52: return op_set_bit(); case 0x53: return op_branch_bit(); case 0x54: return op_read_dpi<&SPC700::op_eor>(regs.a, regs.x); case 0x55: return op_read_addri<&SPC700::op_eor>(regs.x); case 0x56: return op_read_addri<&SPC700::op_eor>(regs.y); case 0x57: return op_read_idpy<&SPC700::op_eor>(); case 0x58: return op_write_dp_const<&SPC700::op_eor>(); case 0x59: return op_write_ix_iy<&SPC700::op_eor>(); case 0x5a: return op_read_dpw<&SPC700::op_cpw>(); case 0x5b: return op_adjust_dpx<&SPC700::op_lsr>(); case 0x5c: return op_adjust<&SPC700::op_lsr>(regs.a); case 0x5d: return op_transfer(regs.a, regs.x); case 0x5e: return op_read_addr<&SPC700::op_cmp>(regs.y); case 0x5f: return op_jmp_addr(); case 0x60: return op_set_flag(regs.p.c, 0); case 0x61: return op_jst(); case 0x62: return op_set_bit(); case 0x63: return op_branch_bit(); case 0x64: return op_read_dp<&SPC700::op_cmp>(regs.a); case 0x65: return op_read_addr<&SPC700::op_cmp>(regs.a); case 0x66: return op_read_ix<&SPC700::op_cmp>(); case 0x67: return op_read_idpx<&SPC700::op_cmp>(); case 0x68: return op_read_const<&SPC700::op_cmp>(regs.a); case 0x69: return op_write_dp_dp<&SPC700::op_cmp>(); case 0x6a: return op_set_addr_bit(); case 0x6b: return op_adjust_dp<&SPC700::op_ror>(); case 0x6c: return op_adjust_addr<&SPC700::op_ror>(); case 0x6d: return op_push(regs.y); case 0x6e: return op_bne_dpdec(); case 0x6f: return op_rts(); case 0x70: return op_branch(regs.p.v == 1); case 0x71: return op_jst(); case 0x72: return op_set_bit(); case 0x73: return op_branch_bit(); case 0x74: return op_read_dpi<&SPC700::op_cmp>(regs.a, regs.x); case 0x75: return op_read_addri<&SPC700::op_cmp>(regs.x); case 0x76: return op_read_addri<&SPC700::op_cmp>(regs.y); case 0x77: return op_read_idpy<&SPC700::op_cmp>(); case 0x78: return op_write_dp_const<&SPC700::op_cmp>(); case 0x79: return op_write_ix_iy<&SPC700::op_cmp>(); case 0x7a: return op_read_dpw<&SPC700::op_adw>(); case 0x7b: return op_adjust_dpx<&SPC700::op_ror>(); case 0x7c: return op_adjust<&SPC700::op_ror>(regs.a); case 0x7d: return op_transfer(regs.x, regs.a); case 0x7e: return op_read_dp<&SPC700::op_cmp>(regs.y); case 0x7f: return op_rti(); case 0x80: return op_set_flag(regs.p.c, 1); case 0x81: return op_jst(); case 0x82: return op_set_bit(); case 0x83: return op_branch_bit(); case 0x84: return op_read_dp<&SPC700::op_adc>(regs.a); case 0x85: return op_read_addr<&SPC700::op_adc>(regs.a); case 0x86: return op_read_ix<&SPC700::op_adc>(); case 0x87: return op_read_idpx<&SPC700::op_adc>(); case 0x88: return op_read_const<&SPC700::op_adc>(regs.a); case 0x89: return op_write_dp_dp<&SPC700::op_adc>(); case 0x8a: return op_set_addr_bit(); case 0x8b: return op_adjust_dp<&SPC700::op_dec>(); case 0x8c: return op_adjust_addr<&SPC700::op_dec>(); case 0x8d: return op_read_const<&SPC700::op_ld>(regs.y); case 0x8e: return op_plp(); case 0x8f: return op_write_dp_const<&SPC700::op_st>(); case 0x90: return op_branch(regs.p.c == 0); case 0x91: return op_jst(); case 0x92: return op_set_bit(); case 0x93: return op_branch_bit(); case 0x94: return op_read_dpi<&SPC700::op_adc>(regs.a, regs.x); case 0x95: return op_read_addri<&SPC700::op_adc>(regs.x); case 0x96: return op_read_addri<&SPC700::op_adc>(regs.y); case 0x97: return op_read_idpy<&SPC700::op_adc>(); case 0x98: return op_write_dp_const<&SPC700::op_adc>(); case 0x99: return op_write_ix_iy<&SPC700::op_adc>(); case 0x9a: return op_read_dpw<&SPC700::op_sbw>(); case 0x9b: return op_adjust_dpx<&SPC700::op_dec>(); case 0x9c: return op_adjust<&SPC700::op_dec>(regs.a); case 0x9d: return op_transfer(regs.s, regs.x); case 0x9e: return op_div_ya_x(); case 0x9f: return op_xcn(); case 0xa0: return op_set_flag(regs.p.i, 1); case 0xa1: return op_jst(); case 0xa2: return op_set_bit(); case 0xa3: return op_branch_bit(); case 0xa4: return op_read_dp<&SPC700::op_sbc>(regs.a); case 0xa5: return op_read_addr<&SPC700::op_sbc>(regs.a); case 0xa6: return op_read_ix<&SPC700::op_sbc>(); case 0xa7: return op_read_idpx<&SPC700::op_sbc>(); case 0xa8: return op_read_const<&SPC700::op_sbc>(regs.a); case 0xa9: return op_write_dp_dp<&SPC700::op_sbc>(); case 0xaa: return op_set_addr_bit(); case 0xab: return op_adjust_dp<&SPC700::op_inc>(); case 0xac: return op_adjust_addr<&SPC700::op_inc>(); case 0xad: return op_read_const<&SPC700::op_cmp>(regs.y); case 0xae: return op_pull(regs.a); case 0xaf: return op_sta_ixinc(); case 0xb0: return op_branch(regs.p.c == 1); case 0xb1: return op_jst(); case 0xb2: return op_set_bit(); case 0xb3: return op_branch_bit(); case 0xb4: return op_read_dpi<&SPC700::op_sbc>(regs.a, regs.x); case 0xb5: return op_read_addri<&SPC700::op_sbc>(regs.x); case 0xb6: return op_read_addri<&SPC700::op_sbc>(regs.y); case 0xb7: return op_read_idpy<&SPC700::op_sbc>(); case 0xb8: return op_write_dp_const<&SPC700::op_sbc>(); case 0xb9: return op_write_ix_iy<&SPC700::op_sbc>(); case 0xba: return op_read_dpw<&SPC700::op_ldw>(); case 0xbb: return op_adjust_dpx<&SPC700::op_inc>(); case 0xbc: return op_adjust<&SPC700::op_inc>(regs.a); case 0xbd: return op_transfer(regs.x, regs.s); case 0xbe: return op_das(); case 0xbf: return op_lda_ixinc(); case 0xc0: return op_set_flag(regs.p.i, 0); case 0xc1: return op_jst(); case 0xc2: return op_set_bit(); case 0xc3: return op_branch_bit(); case 0xc4: return op_write_dp(regs.a); case 0xc5: return op_write_addr(regs.a); case 0xc6: return op_sta_ix(); case 0xc7: return op_sta_idpx(); case 0xc8: return op_read_const<&SPC700::op_cmp>(regs.x); case 0xc9: return op_write_addr(regs.x); case 0xca: return op_set_addr_bit(); case 0xcb: return op_write_dp(regs.y); case 0xcc: return op_write_addr(regs.y); case 0xcd: return op_read_const<&SPC700::op_ld>(regs.x); case 0xce: return op_pull(regs.x); case 0xcf: return op_mul_ya(); case 0xd0: return op_branch(regs.p.z == 0); case 0xd1: return op_jst(); case 0xd2: return op_set_bit(); case 0xd3: return op_branch_bit(); case 0xd4: return op_write_dpi(regs.a, regs.x); case 0xd5: return op_write_addri(regs.x); case 0xd6: return op_write_addri(regs.y); case 0xd7: return op_sta_idpy(); case 0xd8: return op_write_dp(regs.x); case 0xd9: return op_write_dpi(regs.x, regs.y); case 0xda: return op_stw_dp(); case 0xdb: return op_write_dpi(regs.y, regs.x); case 0xdc: return op_adjust<&SPC700::op_dec>(regs.y); case 0xdd: return op_transfer(regs.y, regs.a); case 0xde: return op_bne_dpx(); case 0xdf: return op_daa(); case 0xe0: return op_clv(); case 0xe1: return op_jst(); case 0xe2: return op_set_bit(); case 0xe3: return op_branch_bit(); case 0xe4: return op_read_dp<&SPC700::op_ld>(regs.a); case 0xe5: return op_read_addr<&SPC700::op_ld>(regs.a); case 0xe6: return op_read_ix<&SPC700::op_ld>(); case 0xe7: return op_read_idpx<&SPC700::op_ld>(); case 0xe8: return op_read_const<&SPC700::op_ld>(regs.a); case 0xe9: return op_read_addr<&SPC700::op_ld>(regs.x); case 0xea: return op_set_addr_bit(); case 0xeb: return op_read_dp<&SPC700::op_ld>(regs.y); case 0xec: return op_read_addr<&SPC700::op_ld>(regs.y); case 0xed: return op_cmc(); case 0xee: return op_pull(regs.y); case 0xef: return op_wait(); case 0xf0: return op_branch(regs.p.z == 1); case 0xf1: return op_jst(); case 0xf2: return op_set_bit(); case 0xf3: return op_branch_bit(); case 0xf4: return op_read_dpi<&SPC700::op_ld>(regs.a, regs.x); case 0xf5: return op_read_addri<&SPC700::op_ld>(regs.x); case 0xf6: return op_read_addri<&SPC700::op_ld>(regs.y); case 0xf7: return op_read_idpy<&SPC700::op_ld>(); case 0xf8: return op_read_dp<&SPC700::op_ld>(regs.x); case 0xf9: return op_read_dpi<&SPC700::op_ld>(regs.x, regs.y); case 0xfa: return op_write_dp_dp<&SPC700::op_st>(); case 0xfb: return op_read_dpi<&SPC700::op_ld>(regs.y, regs.x); case 0xfc: return op_adjust<&SPC700::op_inc>(regs.y); case 0xfd: return op_transfer(regs.a, regs.y); case 0xfe: return op_bne_ydec(); case 0xff: return op_wait(); } } } sfc/alt/smp/memory.cpp000664 001750 001750 00000004334 12651764221 016062 0ustar00sergiosergio000000 000000 unsigned SMP::port_read(unsigned addr) { return apuram[0xf4 + (addr & 3)]; } void SMP::port_write(unsigned addr, unsigned data) { apuram[0xf4 + (addr & 3)] = data; } unsigned SMP::mmio_read(unsigned addr) { switch(addr) { case 0xf2: return status.dsp_addr; case 0xf3: return dsp.read(status.dsp_addr & 0x7f); case 0xf4: case 0xf5: case 0xf6: case 0xf7: synchronize_cpu(); return cpu.port_read(addr); case 0xf8: return status.ram00f8; case 0xf9: return status.ram00f9; case 0xfd: { unsigned result = timer0.stage3_ticks & 15; timer0.stage3_ticks = 0; return result; } case 0xfe: { unsigned result = timer1.stage3_ticks & 15; timer1.stage3_ticks = 0; return result; } case 0xff: { unsigned result = timer2.stage3_ticks & 15; timer2.stage3_ticks = 0; return result; } } return 0x00; } void SMP::mmio_write(unsigned addr, unsigned data) { switch(addr) { case 0xf1: status.iplrom_enable = data & 0x80; if(data & 0x30) { synchronize_cpu(); if(data & 0x20) { cpu.port_write(3, 0x00); cpu.port_write(2, 0x00); } if(data & 0x10) { cpu.port_write(1, 0x00); cpu.port_write(0, 0x00); } } if(timer2.enable == false && (data & 0x04)) { timer2.stage2_ticks = 0; timer2.stage3_ticks = 0; } timer2.enable = data & 0x04; if(timer1.enable == false && (data & 0x02)) { timer1.stage2_ticks = 0; timer1.stage3_ticks = 0; } timer1.enable = data & 0x02; if(timer0.enable == false && (data & 0x01)) { timer0.stage2_ticks = 0; timer0.stage3_ticks = 0; } timer0.enable = data & 0x01; break; case 0xf2: status.dsp_addr = data; break; case 0xf3: if(status.dsp_addr & 0x80) break; dsp.write(status.dsp_addr, data); break; case 0xf4: case 0xf5: case 0xf6: case 0xf7: synchronize_cpu(); port_write(addr, data); break; case 0xf8: status.ram00f8 = data; break; case 0xf9: status.ram00f9 = data; break; case 0xfa: timer0.target = data; break; case 0xfb: timer1.target = data; break; case 0xfc: timer2.target = data; break; } } sfc/controller/justifier/000700 001750 001750 00000000000 12656700342 016635 5ustar00sergiosergio000000 000000 sfc/chip/000700 001750 001750 00000000000 12656700342 013371 5ustar00sergiosergio000000 000000 sfc/chip/spc7110/alu.cpp000664 001750 001750 00000003611 12651764221 015772 0ustar00sergiosergio000000 000000 #ifdef SPC7110_CPP void SPC7110::alu_multiply() { add_clocks(30); if(r482e & 1) { //signed 16-bit x 16-bit multiplication int16 r0 = (int16)(r4824 | r4825 << 8); int16 r1 = (int16)(r4820 | r4821 << 8); signed result = r0 * r1; r4828 = result; r4829 = result >> 8; r482a = result >> 16; r482b = result >> 24; } else { //unsigned 16-bit x 16-bit multiplication uint16 r0 = (uint16)(r4824 | r4825 << 8); uint16 r1 = (uint16)(r4820 | r4821 << 8); unsigned result = r0 * r1; r4828 = result; r4829 = result >> 8; r482a = result >> 16; r482b = result >> 24; } r482f &= 0x7f; } void SPC7110::alu_divide() { add_clocks(40); if(r482e & 1) { //signed 32-bit x 16-bit division int32 dividend = (int32)(r4820 | r4821 << 8 | r4822 << 16 | r4823 << 24); int16 divisor = (int16)(r4826 | r4827 << 8); int32 quotient; int16 remainder; if(divisor) { quotient = (int32)(dividend / divisor); remainder = (int32)(dividend % divisor); } else { //illegal division by zero quotient = 0; remainder = dividend; } r4828 = quotient; r4829 = quotient >> 8; r482a = quotient >> 16; r482b = quotient >> 24; r482c = remainder; r482d = remainder >> 8; } else { //unsigned 32-bit x 16-bit division uint32 dividend = (uint32)(r4820 | r4821 << 8 | r4822 << 16 | r4823 << 24); uint16 divisor = (uint16)(r4826 | r4827 << 8); uint32 quotient; uint16 remainder; if(divisor) { quotient = (uint32)(dividend / divisor); remainder = (uint16)(dividend % divisor); } else { //illegal division by zero quotient = 0; remainder = dividend; } r4828 = quotient; r4829 = quotient >> 8; r482a = quotient >> 16; r482b = quotient >> 24; r482c = remainder; r482d = remainder >> 8; } r482f &= 0x7f; } #endif sfc/controller/gamepad/gamepad.hpp000664 001750 001750 00000000334 12651764221 020353 0ustar00sergiosergio000000 000000 struct Gamepad : Controller { uint2 data(); void latch(bool data); Gamepad(bool port); private: bool latched; unsigned counter; bool b, y, select, start; bool up, down, left, right; bool a, x, l, r; }; nall/sha256.hpp000664 001750 001750 00000007613 12651764221 014366 0ustar00sergiosergio000000 000000 #ifndef NALL_SHA256_HPP #define NALL_SHA256_HPP //author: vladitx #include namespace nall { #define PTR(t, a) ((t*)(a)) #define SWAP32(x) ((uint32_t)( \ (((uint32_t)(x) & 0x000000ff) << 24) | \ (((uint32_t)(x) & 0x0000ff00) << 8) | \ (((uint32_t)(x) & 0x00ff0000) >> 8) | \ (((uint32_t)(x) & 0xff000000) >> 24) \ )) #define ST32(a, d) *PTR(uint32_t, a) = (d) #define ST32BE(a, d) ST32(a, SWAP32(d)) #define LD32(a) *PTR(uint32_t, a) #define LD32BE(a) SWAP32(LD32(a)) #define LSL32(x, n) ((uint32_t)(x) << (n)) #define LSR32(x, n) ((uint32_t)(x) >> (n)) #define ROR32(x, n) (LSR32(x, n) | LSL32(x, 32 - (n))) //first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19 static const uint32_t T_H[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, }; //first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311 static const uint32_t T_K[64] = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2, }; struct sha256_ctx { uint8_t in[64]; unsigned inlen; uint32_t w[64]; uint32_t h[8]; uint64_t len; }; inline void sha256_init(sha256_ctx* p) { memset(p, 0, sizeof(sha256_ctx)); memcpy(p->h, T_H, sizeof(T_H)); } static void sha256_block(sha256_ctx* p) { unsigned i; uint32_t s0, s1; uint32_t a, b, c, d, e, f, g, h; uint32_t t1, t2, maj, ch; for(i = 0; i < 16; i++) p->w[i] = LD32BE(p->in + i * 4); for(i = 16; i < 64; i++) { s0 = ROR32(p->w[i - 15], 7) ^ ROR32(p->w[i - 15], 18) ^ LSR32(p->w[i - 15], 3); s1 = ROR32(p->w[i - 2], 17) ^ ROR32(p->w[i - 2], 19) ^ LSR32(p->w[i - 2], 10); p->w[i] = p->w[i - 16] + s0 + p->w[i - 7] + s1; } a = p->h[0]; b = p->h[1]; c = p->h[2]; d = p->h[3]; e = p->h[4]; f = p->h[5]; g = p->h[6]; h = p->h[7]; for(i = 0; i < 64; i++) { s0 = ROR32(a, 2) ^ ROR32(a, 13) ^ ROR32(a, 22); maj = (a & b) ^ (a & c) ^ (b & c); t2 = s0 + maj; s1 = ROR32(e, 6) ^ ROR32(e, 11) ^ ROR32(e, 25); ch = (e & f) ^ (~e & g); t1 = h + s1 + ch + T_K[i] + p->w[i]; h = g; g = f; f = e; e = d + t1; d = c; c = b; b = a; a = t1 + t2; } p->h[0] += a; p->h[1] += b; p->h[2] += c; p->h[3] += d; p->h[4] += e; p->h[5] += f; p->h[6] += g; p->h[7] += h; //next block p->inlen = 0; } inline void sha256_chunk(sha256_ctx* p, const uint8_t* s, unsigned len) { unsigned l; p->len += len; while(len) { l = 64 - p->inlen; l = (len < l) ? len : l; memcpy(p->in + p->inlen, s, l); s += l; p->inlen += l; len -= l; if(p->inlen == 64) sha256_block(p); } } inline void sha256_final(sha256_ctx* p) { uint64_t len; p->in[p->inlen++] = 0x80; if(p->inlen > 56) { memset(p->in + p->inlen, 0, 64 - p->inlen); sha256_block(p); } memset(p->in + p->inlen, 0, 56 - p->inlen); len = p->len << 3; ST32BE(p->in + 56, len >> 32); ST32BE(p->in + 60, len); sha256_block(p); } inline void sha256_hash(sha256_ctx* p, uint8_t* s) { uint32_t *t = (uint32_t*)s; for(unsigned i = 0; i < 8; i++) ST32BE(t++, p->h[i]); } #undef PTR #undef SWAP32 #undef ST32 #undef ST32BE #undef LD32 #undef LD32BE #undef LSL32 #undef LSR32 #undef ROR32 } #endif gb/apu/square2/square2.hpp000664 001750 001750 00000000720 12651764221 016541 0ustar00sergiosergio000000 000000 struct Square2 { bool enable; uint2 duty; uint6 length; uint4 envelope_volume; bool envelope_direction; uint3 envelope_frequency; uint11 frequency; bool counter; int16 output; bool duty_output; uint3 phase; unsigned period; uint3 envelope_period; uint4 volume; bool dac_enable(); void run(); void clock_length(); void clock_envelope(); void write(unsigned r, uint8 data); void power(); void serialize(serializer&); }; fc/cartridge/board/konami-vrc3.cpp000664 001750 001750 00000002357 12651764221 020177 0ustar00sergiosergio000000 000000 struct KonamiVRC3 : Board { struct Settings { bool mirror; //0 = horizontal, 1 = vertical } settings; VRC3 vrc3; void main() { vrc3.main(); } uint8 prg_read(unsigned addr) { if((addr & 0xe000) == 0x6000) return prgram.read(addr & 0x1fff); if(addr & 0x8000) return prgrom.read(vrc3.prg_addr(addr)); return cpu.mdr(); } void prg_write(unsigned addr, uint8 data) { if((addr & 0xe000) == 0x6000) return prgram.write(addr & 0x1fff, data); if(addr & 0x8000) return vrc3.reg_write(addr, data); } uint8 chr_read(unsigned addr) { if(addr & 0x2000) { if(settings.mirror == 0) addr = ((addr & 0x0800) >> 1) | (addr & 0x03ff); return ppu.ciram_read(addr & 0x07ff); } return chrram.read(addr); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) { if(settings.mirror == 0) addr = ((addr & 0x0800) >> 1) | (addr & 0x03ff); return ppu.ciram_write(addr & 0x07ff, data); } return chrram.write(addr, data); } void power() { vrc3.power(); } void reset() { vrc3.reset(); } void serialize(serializer& s) { Board::serialize(s); vrc3.serialize(s); } KonamiVRC3(Markup::Node& document) : Board(document), vrc3(*this) { settings.mirror = document["cartridge"]["mirror"]["mode"].data == "vertical" ? 1 : 0; } }; fc/cpu/serialization.cpp000664 001750 001750 00000001060 12651764221 016445 0ustar00sergiosergio000000 000000 void CPU::serialize(serializer& s) { R6502::serialize(s); Thread::serialize(s); s.array(ram); s.integer(status.interrupt_pending); s.integer(status.nmi_pending); s.integer(status.nmi_line); s.integer(status.irq_line); s.integer(status.irq_apu_line); s.integer(status.rdy_line); s.integer(status.rdy_addr_valid); s.integer(status.rdy_addr_value); s.integer(status.oam_dma_pending); s.integer(status.oam_dma_page); s.integer(status.controller_latch); s.integer(status.controller_port0); s.integer(status.controller_port1); } sfc/chip/icd2/interface/000700 001750 001750 00000000000 12656700342 016152 5ustar00sergiosergio000000 000000 sfc/chip/obc1/obc1.cpp000664 001750 001750 00000003767 12651764221 015577 0ustar00sergiosergio000000 000000 #include #define OBC1_CPP namespace SuperFamicom { #include "serialization.cpp" OBC1 obc1; void OBC1::init() { } void OBC1::load() { } void OBC1::unload() { ram.reset(); } void OBC1::power() { } void OBC1::reset() { status.baseptr = (ram_read(0x1ff5) & 1) ? 0x1800 : 0x1c00; status.address = (ram_read(0x1ff6) & 0x7f); status.shift = (ram_read(0x1ff6) & 3) << 1; } uint8 OBC1::read(unsigned addr) { addr &= 0x1fff; switch(addr) { case 0x1ff0: return ram_read(status.baseptr + (status.address << 2) + 0); case 0x1ff1: return ram_read(status.baseptr + (status.address << 2) + 1); case 0x1ff2: return ram_read(status.baseptr + (status.address << 2) + 2); case 0x1ff3: return ram_read(status.baseptr + (status.address << 2) + 3); case 0x1ff4: return ram_read(status.baseptr + (status.address >> 2) + 0x200); } return ram_read(addr); } void OBC1::write(unsigned addr, uint8 data) { addr &= 0x1fff; switch(addr) { case 0x1ff0: ram_write(status.baseptr + (status.address << 2) + 0, data); return; case 0x1ff1: ram_write(status.baseptr + (status.address << 2) + 1, data); return; case 0x1ff2: ram_write(status.baseptr + (status.address << 2) + 2, data); return; case 0x1ff3: ram_write(status.baseptr + (status.address << 2) + 3, data); return; case 0x1ff4: { uint8 temp = ram_read(status.baseptr + (status.address >> 2) + 0x200); temp = (temp & ~(3 << status.shift)) | ((data & 3) << status.shift); ram_write(status.baseptr + (status.address >> 2) + 0x200, temp); } return; case 0x1ff5: status.baseptr = (data & 1) ? 0x1800 : 0x1c00; ram_write(addr, data); return; case 0x1ff6: status.address = (data & 0x7f); status.shift = (data & 3) << 1; ram_write(addr, data); return; case 0x1ff7: ram_write(addr, data); return; } return ram_write(addr, data); } uint8 OBC1::ram_read(unsigned addr) { return ram.read(addr & 0x1fff); } void OBC1::ram_write(unsigned addr, uint8 data) { ram.write(addr & 0x1fff, data); } } gb/cartridge/cartridge.hpp000664 001750 001750 00000002532 12651764221 016723 0ustar00sergiosergio000000 000000 struct Cartridge : MMIO, property { #include "mbc0/mbc0.hpp" #include "mbc1/mbc1.hpp" #include "mbc2/mbc2.hpp" #include "mbc3/mbc3.hpp" #include "mbc5/mbc5.hpp" #include "mmm01/mmm01.hpp" #include "huc1/huc1.hpp" #include "huc3/huc3.hpp" enum Mapper : unsigned { MBC0, MBC1, MBC2, MBC3, MBC5, MMM01, HuC1, HuC3, Unknown, }; struct Information { string markup; string title; Mapper mapper; bool ram; bool battery; bool rtc; bool rumble; unsigned romsize; unsigned ramsize; } information; string title(); struct Memory { unsigned id; string name; }; vector memory; readonly loaded; readonly sha256; uint8_t* romdata = nullptr; unsigned romsize = 0; uint8_t* ramdata = nullptr; unsigned ramsize = 0; MMIO* mapper = nullptr; bool bootrom_enable = true; void load_empty(System::Revision revision); void load(System::Revision revision); void unload(); uint8 rom_read(unsigned addr); void rom_write(unsigned addr, uint8 data); uint8 ram_read(unsigned addr); void ram_write(unsigned addr, uint8 data); uint8 mmio_read(uint16 addr); void mmio_write(uint16 addr, uint8 data); void power(); void serialize(serializer&); Cartridge(); ~Cartridge(); }; extern Cartridge cartridge; processor/arm/000700 001750 001750 00000000000 12656700342 014471 5ustar00sergiosergio000000 000000 sfc/cpu/mmio/000700 001750 001750 00000000000 12656700342 014176 5ustar00sergiosergio000000 000000 target-ethos/settings/000700 001750 001750 00000000000 12656700342 016141 5ustar00sergiosergio000000 000000 gb/ppu/cgb.cpp000664 001750 001750 00000010426 12651764221 014346 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP //BG attributes: //0x80: 0 = OAM priority, 1 = BG priority //0x40: vertical flip //0x20: horizontal flip //0x08: VRAM bank# //0x07: palette# //OB attributes: //0x80: 0 = OBJ above BG, 1 = BG above OBJ //0x40: vertical flip //0x20: horizontal flip //0x08: VRAM bank# //0x07: palette# void PPU::cgb_read_tile(bool select, unsigned x, unsigned y, unsigned& attr, unsigned& data) { unsigned tmaddr = 0x1800 + (select << 10); tmaddr += (((y >> 3) << 5) + (x >> 3)) & 0x03ff; unsigned tile = vram[0x0000 + tmaddr]; attr = vram[0x2000 + tmaddr]; unsigned tdaddr = attr & 0x08 ? 0x2000 : 0x0000; if(status.bg_tiledata_select == 0) { tdaddr += 0x1000 + ((int8)tile << 4); } else { tdaddr += 0x0000 + (tile << 4); } y &= 7; if(attr & 0x40) y ^= 7; tdaddr += y << 1; data = vram[tdaddr++] << 0; data |= vram[tdaddr++] << 8; if(attr & 0x20) data = hflip(data); } void PPU::cgb_scanline() { px = 0; const unsigned Height = (status.ob_size == 0 ? 8 : 16); sprites = 0; //find first ten sprites on this scanline for(unsigned n = 0; n < 40 * 4; n += 4) { Sprite& s = sprite[sprites]; s.y = oam[n + 0] - 16; s.x = oam[n + 1] - 8; s.tile = oam[n + 2] & ~status.ob_size; s.attr = oam[n + 3]; s.y = status.ly - s.y; if(s.y >= Height) continue; if(s.attr & 0x40) s.y ^= (Height - 1); unsigned tdaddr = (s.attr & 0x08 ? 0x2000 : 0x0000) + (s.tile << 4) + (s.y << 1); s.data = vram[tdaddr + 0] << 0; s.data |= vram[tdaddr + 1] << 8; if(s.attr & 0x20) s.data = hflip(s.data); if(++sprites == 10) break; } } void PPU::cgb_run() { ob.color = 0; ob.palette = 0; ob.priority = 0; unsigned color = 0x7fff; if(status.display_enable) { cgb_run_bg(); if(status.window_display_enable) cgb_run_window(); if(status.ob_enable) cgb_run_ob(); if(ob.palette == 0) { color = bg.color; } else if(bg.palette == 0) { color = ob.color; } else if(status.bg_enable == 0) { color = ob.color; } else if(bg.priority) { color = bg.color; } else if(ob.priority) { color = ob.color; } else { color = bg.color; } } uint32* output = screen + status.ly * 160 + px++; *output = color; } void PPU::cgb_run_bg() { unsigned scrolly = (status.ly + status.scy) & 255; unsigned scrollx = (px + status.scx) & 255; unsigned tx = scrollx & 7; if(tx == 0 || px == 0) cgb_read_tile(status.bg_tilemap_select, scrollx, scrolly, background.attr, background.data); unsigned index = 0; index |= (background.data & (0x0080 >> tx)) ? 1 : 0; index |= (background.data & (0x8000 >> tx)) ? 2 : 0; unsigned palette = ((background.attr & 0x07) << 2) + index; unsigned color = 0; color |= bgpd[(palette << 1) + 0] << 0; color |= bgpd[(palette << 1) + 1] << 8; color &= 0x7fff; bg.color = color; bg.palette = index; bg.priority = background.attr & 0x80; } void PPU::cgb_run_window() { unsigned scrolly = status.ly - status.wy; unsigned scrollx = px + 7 - status.wx; if(scrolly >= 144u) return; //also matches underflow (scrolly < 0) if(scrollx >= 160u) return; //also matches underflow (scrollx < 0) unsigned tx = scrollx & 7; if(tx == 0 || px == 0) cgb_read_tile(status.window_tilemap_select, scrollx, scrolly, window.attr, window.data); unsigned index = 0; index |= (window.data & (0x0080 >> tx)) ? 1 : 0; index |= (window.data & (0x8000 >> tx)) ? 2 : 0; unsigned palette = ((window.attr & 0x07) << 2) + index; unsigned color = 0; color |= bgpd[(palette << 1) + 0] << 0; color |= bgpd[(palette << 1) + 1] << 8; color &= 0x7fff; bg.color = color; bg.palette = index; bg.priority = window.attr & 0x80; } void PPU::cgb_run_ob() { //render backwards, so that first sprite has priority for(signed n = sprites - 1; n >= 0; n--) { Sprite& s = sprite[n]; signed tx = px - s.x; if(tx < 0 || tx > 7) continue; unsigned index = 0; index |= (s.data & (0x0080 >> tx)) ? 1 : 0; index |= (s.data & (0x8000 >> tx)) ? 2 : 0; if(index == 0) continue; unsigned palette = ((s.attr & 0x07) << 2) + index; unsigned color = 0; color |= obpd[(palette << 1) + 0] << 0; color |= obpd[(palette << 1) + 1] << 8; color &= 0x7fff; ob.color = color; ob.palette = index; ob.priority = !(s.attr & 0x80); } } #endif sfc/chip/superfx/mmio/000700 001750 001750 00000000000 12656700342 016026 5ustar00sergiosergio000000 000000 nall/beat/patch.hpp000664 001750 001750 00000013341 12651764221 015363 0ustar00sergiosergio000000 000000 #ifndef NALL_BEAT_PATCH_HPP #define NALL_BEAT_PATCH_HPP #include #include #include #include #include namespace nall { struct bpspatch { inline bool modify(const uint8_t* data, unsigned size); inline void source(const uint8_t* data, unsigned size); inline void target(uint8_t* data, unsigned size); inline bool modify(const string& filename); inline bool source(const string& filename); inline bool target(const string& filename); inline string metadata() const; inline unsigned size() const; enum result : unsigned { unknown, success, patch_too_small, patch_invalid_header, source_too_small, target_too_small, source_checksum_invalid, target_checksum_invalid, patch_checksum_invalid, }; inline result apply(); protected: enum : unsigned { SourceRead, TargetRead, SourceCopy, TargetCopy }; filemap modifyFile; const uint8_t* modifyData; unsigned modifySize; filemap sourceFile; const uint8_t* sourceData; unsigned sourceSize; filemap targetFile; uint8_t* targetData; unsigned targetSize; unsigned modifySourceSize; unsigned modifyTargetSize; unsigned modifyMarkupSize; string metadataString; }; bool bpspatch::modify(const uint8_t* data, unsigned size) { if(size < 19) return false; modifyData = data; modifySize = size; unsigned offset = 4; auto decode = [&]() -> uint64_t { uint64_t data = 0, shift = 1; while(true) { uint8_t x = modifyData[offset++]; data += (x & 0x7f) * shift; if(x & 0x80) break; shift <<= 7; data += shift; } return data; }; modifySourceSize = decode(); modifyTargetSize = decode(); modifyMarkupSize = decode(); char buffer[modifyMarkupSize + 1]; for(unsigned n = 0; n < modifyMarkupSize; n++) buffer[n] = modifyData[offset++]; buffer[modifyMarkupSize] = 0; metadataString = (const char*)buffer; return true; } void bpspatch::source(const uint8_t* data, unsigned size) { sourceData = data; sourceSize = size; } void bpspatch::target(uint8_t* data, unsigned size) { targetData = data; targetSize = size; } bool bpspatch::modify(const string& filename) { if(modifyFile.open(filename, filemap::mode::read) == false) return false; return modify(modifyFile.data(), modifyFile.size()); } bool bpspatch::source(const string& filename) { if(sourceFile.open(filename, filemap::mode::read) == false) return false; source(sourceFile.data(), sourceFile.size()); return true; } bool bpspatch::target(const string& filename) { file fp; if(fp.open(filename, file::mode::write) == false) return false; fp.truncate(modifyTargetSize); fp.close(); if(targetFile.open(filename, filemap::mode::readwrite) == false) return false; target(targetFile.data(), targetFile.size()); return true; } string bpspatch::metadata() const { return metadataString; } unsigned bpspatch::size() const { return modifyTargetSize; } bpspatch::result bpspatch::apply() { if(modifySize < 19) return result::patch_too_small; uint32_t modifyChecksum = ~0, targetChecksum = ~0; unsigned modifyOffset = 0, sourceRelativeOffset = 0, targetRelativeOffset = 0, outputOffset = 0; auto read = [&]() -> uint8_t { uint8_t data = modifyData[modifyOffset++]; modifyChecksum = crc32_adjust(modifyChecksum, data); return data; }; auto decode = [&]() -> uint64_t { uint64_t data = 0, shift = 1; while(true) { uint8_t x = read(); data += (x & 0x7f) * shift; if(x & 0x80) break; shift <<= 7; data += shift; } return data; }; auto write = [&](uint8_t data) { targetData[outputOffset++] = data; targetChecksum = crc32_adjust(targetChecksum, data); }; if(read() != 'B') return result::patch_invalid_header; if(read() != 'P') return result::patch_invalid_header; if(read() != 'S') return result::patch_invalid_header; if(read() != '1') return result::patch_invalid_header; modifySourceSize = decode(); modifyTargetSize = decode(); modifyMarkupSize = decode(); for(unsigned n = 0; n < modifyMarkupSize; n++) read(); if(modifySourceSize > sourceSize) return result::source_too_small; if(modifyTargetSize > targetSize) return result::target_too_small; while(modifyOffset < modifySize - 12) { unsigned length = decode(); unsigned mode = length & 3; length = (length >> 2) + 1; switch(mode) { case SourceRead: while(length--) write(sourceData[outputOffset]); break; case TargetRead: while(length--) write(read()); break; case SourceCopy: case TargetCopy: signed offset = decode(); bool negative = offset & 1; offset >>= 1; if(negative) offset = -offset; if(mode == SourceCopy) { sourceRelativeOffset += offset; while(length--) write(sourceData[sourceRelativeOffset++]); } else { targetRelativeOffset += offset; while(length--) write(targetData[targetRelativeOffset++]); } break; } } uint32_t modifySourceChecksum = 0, modifyTargetChecksum = 0, modifyModifyChecksum = 0; for(unsigned n = 0; n < 32; n += 8) modifySourceChecksum |= read() << n; for(unsigned n = 0; n < 32; n += 8) modifyTargetChecksum |= read() << n; uint32_t checksum = ~modifyChecksum; for(unsigned n = 0; n < 32; n += 8) modifyModifyChecksum |= read() << n; uint32_t sourceChecksum = crc32_calculate(sourceData, modifySourceSize); targetChecksum = ~targetChecksum; if(sourceChecksum != modifySourceChecksum) return result::source_checksum_invalid; if(targetChecksum != modifyTargetChecksum) return result::target_checksum_invalid; if(checksum != modifyModifyChecksum) return result::patch_checksum_invalid; return result::success; } } #endif sfc/chip/superfx/timing/000700 001750 001750 00000000000 12656700342 016354 5ustar00sergiosergio000000 000000 sfc/alt/cpu/cpu.hpp000664 001750 001750 00000005612 12651764221 015336 0ustar00sergiosergio000000 000000 struct CPU : Processor::R65816, Thread, public PPUcounter { uint8 wram[128 * 1024]; enum : bool { Threaded = true }; vector coprocessors; alwaysinline void step(unsigned clocks); alwaysinline void synchronize_smp(); void synchronize_ppu(); void synchronize_coprocessors(); void synchronize_controllers(); uint8 pio(); bool joylatch(); bool interrupt_pending(); uint8 port_read(uint8 port); void port_write(uint8 port, uint8 data); uint8 mmio_read(unsigned addr); void mmio_write(unsigned addr, uint8 data); void op_io(); uint8 op_read(unsigned addr); void op_write(unsigned addr, uint8 data); void enter(); void enable(); void power(); void reset(); void serialize(serializer&); CPU(); ~CPU(); private: //cpu static void Enter(); void op_step(); //timing struct QueueEvent { enum : unsigned { DramRefresh, HdmaRun, }; }; nall::priority_queue queue; void queue_event(unsigned id); void last_cycle(); void add_clocks(unsigned clocks); void scanline(); void run_auto_joypad_poll(); //memory unsigned speed(unsigned addr) const; //dma bool dma_transfer_valid(uint8 bbus, unsigned abus); bool dma_addr_valid(unsigned abus); uint8 dma_read(unsigned abus); void dma_write(bool valid, unsigned addr, uint8 data); void dma_transfer(bool direction, uint8 bbus, unsigned abus); uint8 dma_bbus(unsigned i, unsigned index); unsigned dma_addr(unsigned i); unsigned hdma_addr(unsigned i); unsigned hdma_iaddr(unsigned i); void dma_run(); bool hdma_active_after(unsigned i); void hdma_update(unsigned i); void hdma_run(); void hdma_init(); void dma_reset(); //registers uint8 port_data[4]; struct Channel { bool dma_enabled; bool hdma_enabled; bool direction; bool indirect; bool unused; bool reverse_transfer; bool fixed_transfer; uint8 transfer_mode; uint8 dest_addr; uint16 source_addr; uint8 source_bank; union { uint16 transfer_size; uint16 indirect_addr; }; uint8 indirect_bank; uint16 hdma_addr; uint8 line_counter; uint8 unknown; bool hdma_completed; bool hdma_do_transfer; } channel[8]; struct Status { bool nmi_valid; bool nmi_line; bool nmi_transition; bool nmi_pending; bool irq_valid; bool irq_line; bool irq_transition; bool irq_pending; bool irq_lock; bool hdma_pending; unsigned wram_addr; bool joypad_strobe_latch; bool nmi_enabled; bool virq_enabled; bool hirq_enabled; bool auto_joypad_poll_enabled; uint8 pio; uint8 wrmpya; uint8 wrmpyb; uint16 wrdiva; uint8 wrdivb; uint16 htime; uint16 vtime; unsigned rom_speed; uint16 rddiv; uint16 rdmpy; uint8 joy1l, joy1h; uint8 joy2l, joy2h; uint8 joy3l, joy3h; uint8 joy4l, joy4h; } status; }; extern CPU cpu; sfc/dsp/gaussian.cpp000664 001750 001750 00000007422 12651764221 015574 0ustar00sergiosergio000000 000000 #ifdef DSP_CPP const int16 DSP::gaussian_table[512] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 21, 22, 23, 23, 24, 24, 25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 64, 65, 66, 67, 69, 70, 71, 73, 74, 76, 77, 78, 80, 81, 83, 84, 86, 87, 89, 90, 92, 94, 95, 97, 99, 100, 102, 104, 106, 107, 109, 111, 113, 115, 117, 118, 120, 122, 124, 126, 128, 130, 132, 134, 137, 139, 141, 143, 145, 147, 150, 152, 154, 156, 159, 161, 163, 166, 168, 171, 173, 175, 178, 180, 183, 186, 188, 191, 193, 196, 199, 201, 204, 207, 210, 212, 215, 218, 221, 224, 227, 230, 233, 236, 239, 242, 245, 248, 251, 254, 257, 260, 263, 267, 270, 273, 276, 280, 283, 286, 290, 293, 297, 300, 304, 307, 311, 314, 318, 321, 325, 328, 332, 336, 339, 343, 347, 351, 354, 358, 362, 366, 370, 374, 378, 381, 385, 389, 393, 397, 401, 405, 410, 414, 418, 422, 426, 430, 434, 439, 443, 447, 451, 456, 460, 464, 469, 473, 477, 482, 486, 491, 495, 499, 504, 508, 513, 517, 522, 527, 531, 536, 540, 545, 550, 554, 559, 563, 568, 573, 577, 582, 587, 592, 596, 601, 606, 611, 615, 620, 625, 630, 635, 640, 644, 649, 654, 659, 664, 669, 674, 678, 683, 688, 693, 698, 703, 708, 713, 718, 723, 728, 732, 737, 742, 747, 752, 757, 762, 767, 772, 777, 782, 787, 792, 797, 802, 806, 811, 816, 821, 826, 831, 836, 841, 846, 851, 855, 860, 865, 870, 875, 880, 884, 889, 894, 899, 904, 908, 913, 918, 923, 927, 932, 937, 941, 946, 951, 955, 960, 965, 969, 974, 978, 983, 988, 992, 997, 1001, 1005, 1010, 1014, 1019, 1023, 1027, 1032, 1036, 1040, 1045, 1049, 1053, 1057, 1061, 1066, 1070, 1074, 1078, 1082, 1086, 1090, 1094, 1098, 1102, 1106, 1109, 1113, 1117, 1121, 1125, 1128, 1132, 1136, 1139, 1143, 1146, 1150, 1153, 1157, 1160, 1164, 1167, 1170, 1174, 1177, 1180, 1183, 1186, 1190, 1193, 1196, 1199, 1202, 1205, 1207, 1210, 1213, 1216, 1219, 1221, 1224, 1227, 1229, 1232, 1234, 1237, 1239, 1241, 1244, 1246, 1248, 1251, 1253, 1255, 1257, 1259, 1261, 1263, 1265, 1267, 1269, 1270, 1272, 1274, 1275, 1277, 1279, 1280, 1282, 1283, 1284, 1286, 1287, 1288, 1290, 1291, 1292, 1293, 1294, 1295, 1296, 1297, 1297, 1298, 1299, 1300, 1300, 1301, 1302, 1302, 1303, 1303, 1303, 1304, 1304, 1304, 1304, 1304, 1305, 1305, }; int DSP::gaussian_interpolate(const voice_t& v) { //make pointers into gaussian table based on fractional position between samples int offset = (v.interp_pos >> 4) & 0xff; const int16* fwd = gaussian_table + 255 - offset; const int16* rev = gaussian_table + offset; //mirror left half of gaussian table offset = v.buf_pos + (v.interp_pos >> 12); int output; output = (fwd[ 0] * v.buffer[offset + 0]) >> 11; output += (fwd[256] * v.buffer[offset + 1]) >> 11; output += (rev[256] * v.buffer[offset + 2]) >> 11; output = (int16)output; output += (rev[ 0] * v.buffer[offset + 3]) >> 11; return sclamp<16>(output) & ~1; } #endif data/cheats.bml000664 001750 001750 00010264673 12651764221 014607 0ustar00sergiosergio000000 000000 database revision=2014-01-20 cartridge sha256:8e844d77da01f86ace52823f1f974c9230f09e6a6cbf33a07abfe9beeff00292 name:10-Yard Fight (USA, Europe) cheat description:Your team runs faster code:a18d/05/0a cartridge sha256:e868400409c70876b98dad2cca87b8e9ee31877b0cccbbd8405be5c54922722a name:1942 (Japan, USA) cheat description:Don't die when touched code:f828/b9 cheat description:Most enemies die instantly code:dc02/ff/01 cheat description:Infinite lives - 1P game code:b824/ce/ad cheat description:Infinite rolls code:d309/ce/ad cheat description:Hit anywhere code:b44e/b0/30+b4b5/9d/ad+b404/9d/ad+b44b/20/ad cheat description:Rapid fire code:d2bc/10/00 cheat description:After continue P1 has 6 lives - 2P game code:b84b/02/05 cheat description:After continue P1 has 9 lives - 2P game code:b84b/02/08 cheat description:P2 has 6 lives - 2P game code:b859/02/05 cheat description:P2 has 9 lives - 2P game code:b859/02/08 cheat description:Start with 9 rolls - both players code:d851/03/09 cheat description:Start with 6 lives - 1P game code:b7de/02/05 cheat description:Start with 9 lives - 1P game code:b7de/02/08 cheat description:Invincibility code:048e/88 cheat description:Infinite rolls (alt) code:0436/03 cheat description:Infinite lives code:0432/02 cartridge sha256:9f54aafa367247b99c344ba9a0c58ad8fa8aceeeae1c304b8fefc9985c3c118c name:1943 - The Battle of Midway (USA) cheat description:Infinite energy code:b2f0/04/b1 cheat description:Infinite energy (alt) code:b2e2/8d/ad+b29b/ce/ee cheat description:Infinite power-ups code:a7ec/bd cheat description:Infinite weapon upgrade time code:b31a/ce/cd cheat description:Don't instantly die from touching boss planes code:dbc0/04/d7 cheat description:Always shoot power shots code:9b82/00/0b cheat description:Hit anywhere code:dbfc/10/00+dc08/b0/24+c859/99/bd+db97/99/ad+c8a6/99/ad+ea45/99/ad+ce65/99/ad cheat description:10 power points code:f3db/03/0a cheat description:20 power points code:f3db/03/14 cheat description:30 power points code:f3db/03/1e cheat description:Start on mission 5 code:f3e2/00/08 cheat description:Start on mission 10 code:f3e2/00/12 cheat description:Start on mission 15 code:f3e2/00/1c cheat description:Start on mission 20 code:f3e2/00/26 cheat description:Invincibility code:040e/60 cheat description:Infinite power points code:0347/01 cheat description:Infinite energy (alt 2) code:0410/09 cartridge sha256:cd8d9859f334901aca717e08be03dab077766927c87a2becda22982b9234d532 name:1945 [p1] cheat description:Invincibility code:9298/20/ad+94e9/20/ad cheat description:Infinite Bombs code:83b7/20/ad cartridge sha256:c457644ccfb93f8978326e728931800283821e531edc409fca9c0167495319c4 name:3-D WorldRunner (USA) cheat description:Invincibility code:a41d/60 cheat description:Infinite lives code:96bb/01/00 cheat description:Infinite time code:94b2/c6/a5 cheat description:Slow down timer code:94af/c0/ff cheat description:Speed up timer code:94af/c0/60 cheat description:Start with and keep laser missiles code:9dbe/04/00 cheat description:Autofire code:9dbf/a5/a9 cheat description:Start with 1 life code:96b1/03/01+966b/33/31 cheat description:Start with 6 lives code:96b1/03/06+966b/33/36 cheat description:Start with 9 lives code:96b1/03/09+966b/33/39 cheat description:Start on world 2 code:8903/a9/a2+8904/00/01+8905/85/86 cheat description:Start on world 3 code:8903/a9/a2+8904/00/02+8905/85/86 cheat description:Start on world 4 code:8903/a9/a2+8904/00/03+8905/85/86 cheat description:Start on world 5 code:8903/a9/a2+8904/00/04+8905/85/86 cheat description:Start on world 6 code:8903/a9/a2+8904/00/05+8905/85/86 cheat description:Start on world 7 code:8903/a9/a2+8904/00/06+8905/85/86 cheat description:No enemies or pitfalls code:003a/05 cartridge sha256:df696ce2af90b18ca2b57468bdc525afce371bb1868152eb2cbbe1d62252f617 name:720 Degrees (USA) cheat description:Infinite continues code:f530/ce/ad cheat description:9 continues code:c2ab/03/09 cheat description:6 continues code:c2ab/03/06 cheat description:No continues instead of 2 code:c2ab/03/01 cheat description:Start with all equipment code:c2cf/00/04 cheat description:Start with half equipment code:c2cf/00/02 cheat description:Start on level 2 code:c2a4/ad/ea+c2a5/0e/a9+c2a6/02/02 cheat description:Start on level 3 code:c2a4/ad/ea+c2a5/0e/a9+c2a6/02/03 cheat description:Start on level 4 code:c2a4/ad/ea+c2a5/0e/a9+c2a6/02/04 cheat description:Infinite time code:0572/19 cheat description:Infinite time (one's digit) in half-pipe code:0573/09 cheat description:Infinite time (ten's digit) in half-pipe code:0574/09 cartridge sha256:3493f7621d964af7a56c407718ef1d056c6c46d4e4c6b3c48364d58a1b97a06a name:8 Eyes (USA) cheat description:Invincibility - Orin code:bb3d/f0/d0 cheat description:Invincibility - Cutrus code:c976/f0/d0 cheat description:Infinite health - Orin code:bb9d/8d/ad cheat description:Infinite health - Cutrus code:c9f7/8d/ad cheat description:Most attacks won't damage Orin code:bb9d/8d/2c cheat description:Most attacks won't damage Cutrus code:c9f7/8d/2c cheat description:Start with more health - Orin code:a26c/2f/40 cheat description:Start with more health - Cutrus code:a26d/2f/40 cheat description:Infinite ammo code:bed4/8d/ad cheat description:Start with all weapons code:ee1b/86/85 cheat description:Start with max ammo code:a26e/2f/4f cheat description:Start with some item power code:a26e/00/2f cheat description:Never lose item power once gained code:bed4/8d/2c cheat description:Start with Dagger code:ee1f/86/e6 cheat description:Invincibility - Orin (blinking) code:030e/10 cheat description:Invincibility - Cutrus (blinking) code:032e/10 cheat description:Infinite health - Orin (alt) code:0594/4f cheat description:Infinite health - Cutrus (alt) code:0595/4f cheat description:Infinite item power code:0596/4f cheat description:Bosses have no invulnerability time code:034e/00 cheat description:Bosses defeated instantly code:034f/00 cheat description:Doors never close once opened code:009d/fa cheat description:Have Boomerang code:007f/02 cheat description:Have Ice Ball code:007f/04 cheat description:Have Power Ball code:007f/08 cheat description:Have Dagger, Boomerang, Molotov Cocktail, Hand Gun code:007f/33 cartridge sha256:c4d4ff0bd283656c63d9a30dfc7dc6d2956744730a3641ba2c8f9f8e7204d9a1 name:Abadox - The Deadly Inner War (USA) cheat description:Invincible against touching enemies code:efe2/a5/60 cheat description:Invincible against walls code:dd35/a9/d0+dd36/02/71 cheat description:Infinite lives (lives never decrease) code:c7d1/09 cheat description:Infinite lives (lives increase when you die) code:c7d0/e6 cheat description:Hit anywhere code:f1d5/90/d0+f1fa/d0/b0+f1b1/90/b0+f210/30/24 cheat description:Invincibility (distorts sound) code:0086/00+008a/00 cheat description:One hit kills - bosses code:03de/00 cheat description:Weapon shoots clones code:008c/ff cheat description:Speed up level 1 code:008b/01 cheat description:Speed up level 2 code:008b/02 cheat description:Speed up level 3 code:008b/03 cheat description:Start at level 2 code:cc74/01/02 cheat description:Start at level 3 code:cc74/01/03 cheat description:Start at level 4 code:cc74/01/05 cheat description:Start at level 6 code:cc74/01/06 cartridge sha256:6da6c8ac123df0f51e6f1b2ba79cb067d3352262532604ab08cf5dd587e84006 name:Action in New York (Europe) cheat description:Invincibility code:dcde/60 cheat description:One hit kills code:ed4e/f0/d0 cheat description:No enemies code:d5b2/50/24 cartridge sha256:005c48a5984e3b75e069ef78d736266b12f7f6b102d88d90172ba9ae480b378b name:Addams Family, The (USA) cheat description:Invincibility code:8496/ad cheat description:Infinite life code:c5ca/ce/2c cheat description:Infinite lives code:e3d8/ce/2c cheat description:Infinite Things code:e68b/ce/2c cheat description:No Piranah Plant enemies code:ac01/90/b0 cheat description:Get items from anywhere - from above code:a684/90/24 cheat description:Get items from anywhere - from the right code:a695/90/24 cheat description:Get items from anywhere - from the left code:a69f/90/24 cheat description:Get items from anywhere - from below code:a68b/b0/24 cheat description:Walk through walls code:877c/d0/50+8787/d0/50 cheat description:Start with 1 life - 1st game only code:c0e4/03/01 cheat description:Start with 6 lives - 1st game only code:c0e4/03/06 cheat description:Start with 9 lives - 1st game only code:c0e4/03/09 cheat description:Start in the tree code:c0c6/00/01 cheat description:Start in the crypt code:c0c6/00/02 cheat description:Start in the hallway code:c0c6/00/03 cheat description:Start in Fester's room code:c0c6/00/08 cheat description:Start in Pugsly's room code:c0c6/00/09 cheat description:Start in the toy room code:c0c6/00/0a cheat description:Start in Wednesday's room code:c0c6/00/0b cheat description:Start in the attic code:c0c6/00/0c cheat description:Start in a secret room code:c0c6/00/0f cheat description:Start in a secret room code:c0c6/00/10 cheat description:Start in a secret room code:c0c6/00/11 cheat description:Start in the bone room code:c0c6/00/1d cheat description:Start in the freezer code:c0c6/00/21 cheat description:Start in the furnace code:c0c6/00/22 cheat description:Start in Gomez's room code:c0c6/00/20 cartridge sha256:b3e09c94e33e0293672c1405c60fc69b2ab1564c8a4ee988e3ab6ada51484eea name:Addams Family, The - Pugsley's Scavenger Hunt (USA) cheat description:Invincibility code:c448/60 cheat description:Invincibility status effect code:e9b4/f0/24 cheat description:Infinite health code:c448/ad cheat description:Infinite health (alt) code:c447/01/00 cheat description:Infinite lives code:c4b2/ce/ad cheat description:Infinite lives (alt) code:c4b2/bd cheat description:Always able to fly code:ec5b/35/00 cheat description:Always able to fly (alt) code:e799/f0/24 cheat description:No enemies code:9d49/30/10 cheat description:Enemies can't move horizontally code:9cef/f0/d0 cheat description:Enemies can't move vertically code:9d08/f0/d0 cheat description:Mega-jump code:eee0/10/18 cheat description:Sweets count as extra lives code:c40f/f0/d0 cheat description:Start with 1 life code:c6ea/05/01 cheat description:Start with 9 lives code:c6ea/05/09 cheat description:Start with 1 heart code:c6fa/02/01 cheat description:Start with 4 hearts code:c6fa/02/04 cheat description:Infinite health (alt 2) code:0435/02 cheat description:Infinite lives (alt 2) code:0438/09 cartridge sha256:22e92af92aed2d8d7bddb60732963642788b3ea9341592ce2c66a542a3d7ce7d name:Advanced Dungeons & Dragons - DragonStrike (USA) cheat description:Invincibility code:cf47/60 cheat description:Infinite health code:cf47/ad cheat description:Infinite health (alt) code:cf45/e5/e9 cheat description:Weapon power doesn't weaken with health code:cf4f/8d/2c cheat description:Gold dragon has excellent armor class code:c025/63/66 cheat description:Gold dragon flies faster code:c028/41/47 cheat description:Silver dragon flies faster code:c027/64/68 cheat description:Bronze dragon flies faster code:c026/53/57 cheat description:Start wtih less health - bronze dragon code:a044/28/14 cheat description:Start wtih more health - bronze dragon code:a044/28/50 cheat description:Start wtih less health - silver dragon code:a045/3c/1e cheat description:Start wtih more health - silver dragon code:a045/3c/50 cheat description:Start wtih less health - gold dragon code:a046/50/2a cheat description:Start wtih more health - gold dragon code:a046/50/65 cartridge sha256:df2609c80e818bb95983b30a3ac1435ea2332ac83e29fde469f397e1d5a2db93 name:Advanced Dungeons & Dragons - Heroes of the Lance (USA) cheat description:Infinite HP for party in most battles code:8492/95/b5 cartridge sha256:60061c0042741f7c1e53ad8f738c27ffd9057310ff5d556662b3667e5700e751 name:Advanced Dungeons & Dragons - Hillsfar (USA) cheat description:Infinite Knock Rings code:b5ce/ce/ad+b5cd/58/00 cheat description:Faster timer when lock-picking code:b3b5/20/10 cheat description:Slower timer when lock-picking code:b3b5/20/50 cheat description:Very slow timer when lock-picking code:b3b5/20/f0 cheat description:Start with 50% less gold on a character that you create code:8ce7/0a/05 cheat description:Start with 50% more gold on a character that you create code:8ce7/0a/0f cheat description:Start with 100% more gold on a character that you create code:8ce7/0a/14 cartridge sha256:38e5253131d264395a302d0910316f94bec00f60db616caa7a53806f08c5b5f9 name:Advanced Dungeons & Dragons - Pool of Radiance (USA) cheat description:Create super characters code:8fb3/9d cheat description:Girdle Of Giant strength (must be used to be effective) code:8f33/ca+8933/44 cheat description:Extra EXP points code:8b42/36 cheat description:One hit ends battle with no gold or EXP code:87b3/28 cartridge sha256:5ee479ef04d80366a75dd144cbeb47d0347ee82025d1b65dd358e1f6498c9a39 name:Adventure Island II (USA) cheat description:Invincibility code:deb9/d0/f0 cheat description:Invincibility (alt) code:dede/a9/60 cheat description:Infinite health code:d034/ce/ee cheat description:Infinite health (alt) code:d034/ce/ad cheat description:Infinite health against hitting objects code:df48/02/00 cheat description:Infinite Axes code:aa6b/51 cheat description:Infinite Axes plus get an extra Red Camptosaurus code:bab0/bf cheat description:Infinite lives code:bcf1/ce/ad cheat description:Hit anywhere code:ddc0/b0/d0+de04/99/b9+de21/99/b9+de85/99/b9+ddbd/20/ad+ddbf/ff/06+ddbe/c3/02 cheat description:Never lose Dinosaur code:bca0/85/a5+df08/85/a5+df6e/85/a5 cheat description:Get fruits from anywhere code:a74d/4d/00 cheat description:Multi-jump (hold jump to float) code:b19a/5f/9c+b1a1/5f/a3 cheat description:Hold jump to float code:b2ad/02/fe cheat description:Reversible skateboard code:a1f6/20/00 cheat description:Faster running code:a048/20/30 cheat description:Higher jump code:b1d8/bd/ad+b4ab/01/04 cheat description:Start with 2 lives code:e0a8/03/01 cheat description:Start with 7 lives code:e0a8/03/06 cheat description:Start with 10 lives code:e0a8/03/09 cartridge sha256:e8dc8c0441c54d09a1cfe0c112a3137bb6d709989b23e6528f8e30360e1ad910 name:Adventure Island 3 (USA) cheat description:Invincibility code:acec/01/00 cheat description:Infinite health code:fd91/ce/ad cheat description:Infinite vitality code:fd91/ce/cd cheat description:Infinite lives code:b5f5/8d/ad cheat description:Hit anywhere code:ab04/03/00+addc/b9/60+ad8f/99/b9+ae8d/99/b9 cheat description:Hold jump to float code:a05a/d0/f0 cheat description:Don't die when hitting spikes code:aeb7/01/00 cheat description:Don't lose pet when hitting spikes code:af45/e6/85 cheat description:Mega-jumping Master Higgins code:aa80/7b/bd cheat description:Gain 99 lives after gaining 100 fruit code:a64c/02/00 cheat description:Keep items after dying - after 1st stage code:b1bc/9d/2c cheat description:Start a new game to view the ending code:a507/04/00+a503/0a/03 cheat description:Start with 2 lives code:a0d0/03/01 cheat description:Start with 7 lives code:a0d0/03/06 cheat description:Start with 9 lives code:a0d0/03/09 cheat description:Start with 2 Red Taylors code:a062/8d/ee cheat description:Start with 2 Blue Taylors code:a065/8d/ee cheat description:Start with 2 Classies code:a068/8d/ee cheat description:Start with 2 Don-Dons code:a06b/8d/ee cheat description:Start with 2 Poleys code:a06e/8d/ee cheat description:Start with 2 Boomerangs code:a071/8d/ee cheat description:Start with 2 Axes code:a074/8d/ee cheat description:Start with 2 invincibility crystals code:a077/8d/ee cartridge sha256:185e4adb2cbcb71ebf0fd3f6af767f2215f93916cd2ccf932ce5864d3953239a name:Adventures in the Magic Kingdom (USA) cheat description:Invincibility code:f51e/60 cheat description:Infinite health code:f9aa/c6/60 cheat description:Infinite time code:fa24/b0/60 cheat description:Infinite candles code:e654/ce/ad cheat description:Infinite lives code:f9c3/ce/ad cheat description:Almost infinite health in attractions code:f9aa/c6/a5 cheat description:All items for free code:b283/fd/2c+b228/7c/00 cheat description:Mega-jump code:ec4f/fa/f8 cheat description:'Life' costs less code:b44e/06/03 cheat description:'Life' costs more code:b44e/06/0c cheat description:'Freeze' costs less code:b44f/08/04 cheat description:'Freeze' costs more code:b44f/08/0f cheat description:'Invincible' costs less code:b450/0a/05 cheat description:'Invincible' costs more code:b450/0a/14 cheat description:'Life Up' costs less code:b451/0c/06 cheat description:'Life Up' costs more code:b451/0c/18 cheat description:Never lose a life in 'attractions' code:f9c3/ce/ad cheat description:More 'Freeze' time code:b24b/b4/ff cheat description:Less 'Freeze' time code:b24b/b4/40 cheat description:More 'Invincible' time code:b25f/3c/c0 cheat description:Start with less health in attractions code:8162/03/01 cheat description:Start with more health in attractions code:8162/03/05 cheat description:Start with even more health in attractions code:8162/03/09 cheat description:Start with 1 life code:80ed/03/01 cheat description:Start with 6 lives code:80ed/03/06 cheat description:Start with 9 lives code:80ed/03/09 cartridge sha256:0e862077f390348b8e109caa8189ff5ecdf3fac53eefc204369fae880e077d19 name:Adventures of Bayou Billy, The (USA) cheat description:Infinite health code:e2cd/07/01+9c9b/ce/ad cheat description:Infinite lives code:e31b/c6/24 cheat description:Always have pistol code:8476/ac/a0+8478/07/ea+8477/c1/01 cheat description:Always have knife code:8476/ac/a0+8478/07/ea+8477/c1/02 cheat description:Always have ugly stick code:8476/ac/a0+8478/07/ea+8477/c1/03 cheat description:Always have whip code:8476/ac/a0+8478/07/ea+8477/c1/05 cheat description:Start a new game to view the ending (game A or B) code:e798/04/05 cheat description:Start with 1 life code:e400/02/00 cheat description:Start with 6 lives code:e400/02/05 cheat description:Start with 9 lives code:e400/02/08 cheat description:Start on level 2 code:e40a/00/01+e40c/39/fb+e408/04/00 cheat description:Start on level 3 code:e40a/00/02+e40c/39/fb+e408/04/00 cheat description:Start on level 4 code:e40a/00/03+e40c/39/fb+e408/04/00 cheat description:Start on level 5 code:e40a/00/04+e40c/39/fb+e408/04/00 cheat description:Start on level 6 code:e40a/00/05+e40c/39/fb+e408/04/00 cheat description:Start on level 7 code:e40a/00/06+e40c/39/fb+e408/04/00 cheat description:Start on level 8 code:e40a/00/07+e40c/39/fb+e408/04/00 cheat description:Infinite health (alt) code:07c5/07 cheat description:One hit kills code:0510/00+0511/00+0512/00+0513/00+0514/00 cheat description:Have the Gun code:07c1/01 cheat description:have the Knife code:07c1/02 cheat description:Have the Ugly Stick code:07c1/03 cheat description:Have the Whip code:07c1/05 cheat description:Infinite bullets code:07c0/99 cartridge sha256:58d0f0e504b8450e7d2dfbe11948a244143bfe3065f7e78524633cce8ac73103 name:Adventures of Dino Riki (USA) cheat description:Invincibility code:8a30/60 cheat description:Don't fall into the pits (you'll still lose any special ability you currently have) code:89c1/02/00 cheat description:Hit anywhere code:99ff/bd/4c+9a01/03/9a+9a00/64/4f cheat description:Once Macho, stay Macho code:89e5/45/05 cheat description:Start and stay as Macho-Riki code:8581/85/c6 cheat description:Start as Macho-Riki code:8581/85/e6 cheat description:Start with infinite lives code:860e/c6/a5 cheat description:Start with 1 life code:84d9/02/00 cheat description:Start with 6 lives code:84d9/02/05 cheat description:Start with 9 lives code:84d9/02/08 cheat description:Start with infinite life hearts code:8a3f/c6/a5 cheat description:Start with 4 life hearts code:84dd/02/04 cheat description:Start with 8 life hearts code:84dd/02/08 cheat description:Start on stage 2-1 code:84d0/85/46+84cd/00/02 cheat description:Start on stage 3-1 code:84d0/85/46+84cd/00/04 cheat description:Start on stage 4-1 code:84d0/85/46+84cd/00/06 cheat description:Start on stage 4-2 code:84d0/85/46+84cd/00/08 cheat description:Start on stage 4-3 code:84d0/85/46+84cd/00/0a cheat description:Start on stage 4-4 code:84d0/85/46+84cd/00/0c cartridge sha256:bb5859ced6b028934edddc734e3599f8dd7857b92838baf6a7d46df5dd151f6b name:Adventures of Dr. Franken, The (USA) (Proto) cheat description:Infinite health code:e6ef/c6/a5 cartridge sha256:a0bc241936acf1993a300ab21c197a2647b6c072cfbb8e3f83424a9ab6655cc7 name:Adventures of Gilligan's Island, The (USA) cheat description:Infinite time code:f20b/c6/a5 cheat description:Infinite rope code:b358/ce/ad cheat description:Infinite supply of food code:b32d/ce/ad cheat description:Start with 9 units of food code:dd23/02/09 cheat description:Start with 1 unit of food code:dd23/02/01 cheat description:More time for Episode 1 code:f27b/09/0b cheat description:More time for Episode 2 code:f27c/0b/0d cheat description:More time for Episode 3 code:f27d/13/14 cheat description:Start with 9 ropes code:dd28/02/09 cheat description:Start with 1 rope code:dd28/02/01 cheat description:Start on Episode 2 code:dc6a/00/01+dc6b/85/24 cheat description:Start on Episode 3 code:dc6a/00/02+dc6b/85/24 cartridge sha256:c5e47c0479f500b86995fc8d09e132f5ba3f54cfd9a2a601ea3848bb60871a20 name:Adventures of Lolo (USA) cheat description:Invincibility code:c819/e6/60+b2a9/e6/60 cheat description:Infinite lives code:9995/c6/a5 cheat description:Always have shot ability code:b055/fb/06 cheat description:1 life for Lolo code:98c1/05/01 cheat description:9 lives for Lolo code:98c1/05/09 cartridge sha256:12d3119e25f7b40a7ccc546f5d92edaad86fb0083facf6dd61db512bac45f99d name:Adventures of Lolo 2 (USA) cheat description:Invincibility code:abba/e6/60 cheat description:Infinite lives code:9b26/c6/24 cheat description:Always have shot ability code:a8f8/fb/04 cheat description:Never lose magic shots code:a8fb/c6/24 cheat description:Start with 1 life code:99d2/05/01 cheat description:Start with 10 lives code:99d2/05/0a cheat description:Start with 15 lives code:99d2/05/0f cheat description:Start with 2 magic shots code:9a05/00/02 cheat description:Start with 4 magic shots code:9a05/00/04 cheat description:Start on world 5 code:99b4/00/04 cheat description:Start on world 10 code:99b4/00/09 cheat description:Start on world 15 code:99b4/00/0e cheat description:Start on world 20 code:99b4/00/13 cheat description:Start on world 25 code:99b4/00/18 cheat description:Start on world 30 code:99b4/00/1d cartridge sha256:24f7bb802a0ddce0648ea9f156db42b3eaf4cc6598ce852ffac9f849bf92abee name:Adventures of Lolo 3 (USA) cheat description:Invincibility code:96f6/e6/60+8d26/e6/60 cheat description:Always have shot ability code:8a94/fb/02 cheat description:Infinite shots for each room on pick-up code:8a95/c6/a5 cartridge sha256:322d6be47ed539c3dd3c1c92398e9842c3922d7c13914b9c72752ddec377145c name:Adventures of Rad Gravity, The (USA) cheat description:Infinite health code:ebe2/bd cartridge sha256:03db3d003eaa91e1434093ea259a82b9f2d5ed5b02404f9feba05819f69f81c4 name:Adventures of Rocky and Bullwinkle and Friends, The (USA) cheat description:Infinite health code:8c9d/8d/ad cheat description:Infinite lives code:8c7b/ce/ad cheat description:Infinite Bombs code:86c1/ce/cd cheat description:Get bombs from anywhere code:8b41/98/00+8b60/9b/00 cheat description:Rocky loses no health when flying when you have full health code:846f/07/06 cheat description:Rocky loses more health when flying when you have full health code:8468/02/06 cheat description:Bullwinkle loses no health when headbutting code:8475/01/00 cheat description:Bullwinkle loses more health when headbutting code:8471/04/08 cheat description:Start with no Bombs code:801f/0a/00+d284/0a/00 cheat description:Start with 2 lives code:801a/04/01 cheat description:Start with 30 Bombs code:801f/0a/1e cartridge sha256:227e8a900206d0f8c67b7cb09eaee25f181085623b42bd9694dc30986d955f27 name:Adventures of Tom Sawyer (USA) cheat description:Infinite lives code:c114/c6/a6 cheat description:Hit anywhere code:b88e/35/00+e379/b0/50+bcc0/b0/50+c3ef/b0/50 cheat description:Only 5 T's lost from skulls code:c526/0a/05 cheat description:Start with 1 Tom - P1 code:a0b5/03/01 cheat description:Start with 1 Tom - P2 code:a37b/03/01 cheat description:Start with 6 Toms - P1 code:a0b5/03/06 cheat description:Start with 6 Toms - P2 code:a37b/03/06 cheat description:Start with 9 Toms - P1 code:a0b5/03/09 cheat description:Start with 9 Toms - P2 code:a37b/03/09 cheat description:Start at the river - P1 code:a552/be/c9 cheat description:Start in the forest - P1 code:a552/be/d4 cheat description:Start in the house - P1 code:a552/be/df cheat description:Start in the sky - P1 code:a552/be/ea cheat description:Start in the cave - P1 code:a552/be/f5 cheat description:Start at the river - P2 code:a380/01/02+a38a/03/08 cheat description:Start in the forest - P2 code:a380/01/03+a38a/03/0d cheat description:Start in the house - P2 code:a380/01/04+a38a/03/12 cheat description:Start in the sky - P2 code:a380/01/05+a38a/03/17 cheat description:Start in the cave - P2 code:a380/01/06+a38a/03/1c cartridge sha256:69300586af39342fccc249134f6f44ebbd0fce7c1e5b93151cff63bb35072add name:After Burner (USA) (Unl) cheat description:Invincibility code:924b/85/a5 cheat description:Infinite lives code:e2a9/c6/c5 cheat description:Infinite missiles code:8af2/c6/c5 cartridge sha256:4fb12ad1c791c7ee8d5ec824eff871d71b43b92c4e93b45ed0b60f022459b917 name:After Burner (Japan) cheat description:Infinite lives code:e1f1/c6/a5 cartridge sha256:1b5857f9fd57d6f50d8d1e57db67203155fb2974ae426deac3398efef1dbf042 name:Aigina no Yogen - Balubalouk no Densetsu Yori (Japan) cheat description:Invincibility code:95d1/ad cheat description:Infinite lives code:9439/bd cartridge sha256:e10ff4cfeaf0c16a71d7fffbf79ad3260c119431db6fad603d07ec971746849a name:Airball (Unknown) (Proto1) cheat description:Can use float at any difficulty level code:c580/10/00 cartridge sha256:6d0215929f2dfeeecdeee4dd50b8aec07f279a8ab8df1dc4e877bbcad3db0d37 name:Air Fortress (USA) cheat description:Invincibility code:a7d8/f0/d0+a7dd/d0/f0 cheat description:Infinite energy code:cdcf/8d/ad+ce01/8d/ad cheat description:Don't take damage inside fortress code:cdcd/e5/24+cdff/e5/24 cheat description:Infinite lives code:9c34/c6/c5 cheat description:Infinite lives outside fortress code:9c34/c6/a5 cheat description:Infinite Beam Bullets code:9e45/01/00 cheat description:Hit anywhere - inside fortress code:9c5a/bc/4c+9c5c/64/9c+9c5b/a4/a1+9cfd/95/a5 cheat description:Hit anywhere - outside fortress code:ab17/3b/00+ab27/fd/4c+ab28/4c/5c+ab65/95/a5+ab29/65/ab cheat description:Double Bombs on pick-up code:ac47/05/10 cheat description:Extra energy on pick-up code:aa7b/64/7f+aa80/64/7f cheat description:Start with 1 life code:9a64/03/01 cheat description:Start with 6 lives code:9a64/03/06 cheat description:Start with 9 lives code:9a64/03/09 cheat description:Start on level 2 code:9a5a/29/a2+9a5b/07/01+9a5c/85/86 cheat description:Start on level 3 code:9a5a/29/a2+9a5b/07/02+9a5c/85/86 cheat description:Start on level 4 code:9a5a/29/a2+9a5b/07/03+9a5c/85/86 cheat description:Start on level 5 code:9a5a/29/a2+9a5b/07/04+9a5c/85/86 cheat description:Start on level 6 code:9a5a/29/a2+9a5b/07/05+9a5c/85/86 cheat description:Start on level 7 code:9a5a/29/a2+9a5b/07/06+9a5c/85/86 cartridge sha256:b82c1234165cd725d8e7f3e51926bceb834744eb49ad915bd3ea8b76fa465eb1 name:Airwolf (USA) cheat description:Infinite health code:af6d/bd cheat description:Infinite lives code:82e1/bd cheat description:Start with 1 life code:cd36/03/01 cheat description:Start with 6 lives code:cd36/03/06 cheat description:Start with 9 lives code:cd36/03/09 cheat description:Start at last mission reached code:ccac/5b/61 cheat description:Start with 30 missiles code:8261/0f/1e cheat description:Start with 45 missiles code:8261/0f/2d cheat description:Start with infinite missiles code:a1d0/c6/24 cheat description:Sets missiles to 5 when you refuel code:85e5/0f/05 cheat description:Sets missiles to 30 when you refuel code:85e5/0f/1e cheat description:Infinite health (alt) code:00b9/00 cheat description:Infinite lives (alt) code:036c/02 cartridge sha256:60b1aebdc0a19afc5d3e7dc4f09d8a968580e007197461a8a142656702c27f0d name:Akumajou Dracula (Japan) cheat description:Infinite health code:e7c0/85/ad cheat description:Infinite lives code:c312/c6/a9 cheat description:Infinite time code:a0b4/20/ad cheat description:Clock doesn't use hearts code:daaa/84/a4 cheat description:Weapons don't use hearts code:dae5/84/a4 cheat description:Can't add hearts code:e7e9/85/a4 cheat description:Keep weapon after losing a life code:c33b/8d/2c cheat description:Start with rapid-fire shots code:b680/01/00 cheat description:Start with 80 hearts code:c983/05/50 cheat description:Start with 99 hearts code:c983/05/63 cartridge sha256:c70f0f5d4054ce7c4850259879c9823add73ccc234ddcf96d95681bb78bd2c58 name:Akumajou Densetsu (Japan) cheat description:Infinite life code:8c27/a5/85 cheat description:Infinite hearts code:8b7c/01/00 cheat description:Infinite time code:899d/03/05 cheat description:Infinite lives code:897c/85/ad cheat description:Multi-jump code:8bd7/10/60+97dc/56/58+93dc/56/58+9859/c9/28+9863/65/d8+985b/b0/90+9868/08/05+9861/0c/05+9866/26/05+9860/d0/a9+985d/ad/8d+9862/ad/8d+9838/85/a5+9858/04/a5+985a/08/0a cheat description:Invincibility (blinking) code:007d/01 cheat description:Trevor Belmont - Have fully powered whip code:008b/02 cheat description:Have no special weapon code:0082/00 cheat description:Have Axe code:0082/01 cheat description:Have Clock code:0082/0b cheat description:Have Cross code:0082/02 cheat description:Have Dagger code:0082/03 cheat description:Have Holy Water code:0082/04 cartridge sha256:ff5b96853cf67171918aad5157661dc223e0002e0373e2580cee2e207bb0a682 name:Akumajou Special - Boku Dracula-kun (Japan) cheat description:Invincibility code:dd88/60 cheat description:Infinite health code:dd88/c6/a5 cheat description:Infinite lives code:dcae/c6/a5 cartridge sha256:4c95afeda9a92842933c174983fee954cf40d1301d32f6169f6653f1e5cdc10f name:Al Unser Jr. Turbo Racing (USA) cheat description:Can't be slowed down by signs and grass, prevents suspension from being shot code:d7f8/29/00+d851/85/a5+d801/c6/a5 cartridge sha256:722096b8929442310bc268f9cfea10b26cff8a7e900197b54c73b4a8603b5d96 name:Aladdin (Europe) cheat description:Invincibility code:ccff/f0/d0+f983/f0/d0 cheat description:Infinite energy code:ba0d/85/a5 cheat description:Infinite lives code:c2c7/8d/ad cheat description:Infinite Apples code:c88c/8d/ad cartridge sha256:4b088e1e78981308da68883cf8292337ff8d899bf82a78d17e7a7af2745846e7 name:Alfred Chicken (USA) cheat description:Invincibility code:f4ad/a5 cheat description:Infinite time (alt) code:b8c2/60 cheat description:Infinite lives code:f8cc/01/e0 cheat description:Infinite lives (alt) code:f8ca/ad cheat description:Infinite time code:b8b0/ad/60 cheat description:255 points for each present collected code:f9a4/32/ff cheat description:108 points for each present collected code:f9a4/32/64 cheat description:Only need 1 diamond for an extra life code:b146/06/01 cheat description:3 balloons needed to complete a level code:ca2a/b1/a9+ca2b/51/03 cheat description:2 balloons needed to complete a level code:ca2a/b1/a9+ca2b/51/02 cheat description:1 balloon needed to complete a level code:ca2a/b1/a9+ca2b/51/01 cheat description:Start with 1 life code:c655/02/00 cheat description:Start with 2 lives code:c655/02/01 cheat description:Always spring-jump code:dd68/90 cartridge sha256:d73a9a1fae7396754c19eecd6aa9e44d02c230df8efed0bafd86aa1cb0dd2a23 name:Alien 3 (USA) cheat description:Invincibility code:9c97/ce/ad+e9cb/64/0f+d5d4/64/0f cheat description:Infinite health code:fab3/8d/ad cheat description:Infinite time code:b28e/9d/bd cheat description:Infinite lives code:e24a/ce/ad cheat description:Infinite gun heat code:dc9f/ee/a5 cheat description:Invincible against long falls code:cf54/0f/00 cheat description:Infinite Radar code:aa6e/ce/ad cheat description:Infinite ammo for Machine gun code:dcaf/ce/ad cheat description:Infinite ammo for Grenade Launcher code:dc6d/ce/ad cheat description:Infinite ammo for Grenade Launcher 2 code:bd46/ce/ad cheat description:Infinite ammo for Flame Thrower code:d903/ce/ad cheat description:Hit anywhere code:b697/0d/00+f542/e5/60 cheat description:Super-jump code:a036/03/15+a039/03/15 cheat description:Level skip (pause and press any key (except left) code:b3ef/42/36 cheat description:Always have Radar code:e9cf/00/ff cheat description:Invincibility (alt) code:03c8/4a cheat description:Infinite health (alt) code:074a/12 cheat description:Infinite time (alt) code:0742/09+0743/09+0744/09 cheat description:Infinite weapon 1 code:074b/3f cheat description:Infinite weapon 2 code:074c/20 cheat description:Infinite weapon 3 code:074e/1c cheat description:Infinite weapon 4 code:074d/32 cheat description:Rescue all now code:0747/00 cartridge sha256:cd1a9bc6c9e2181668fea96db14bc67fbbf9bf1572eef2bb074e5912a0dd54c9 name:Alien Syndrome (Japan) cheat description:Infinite lives code:cefc/b1 cheat description:Infinite time code:f789/bd cheat description:Don't lose life when touched code:8928/b1 cartridge sha256:d676ef6f7aa3b042ae5a0c95a7f07fabb4c3a5fccb3767ae1950713e51189a47 name:Alien Syndrome (USA) (Unl) cheat description:Infinite time code:f23f/ce/ad cheat description:Don't lose life when shot or touched code:c98a/ff/00 cheat description:Don't lose life from falling down holes code:ca76/ff/00 cheat description:Set timer to 440 code:f199/33/34 cheat description:1 life after continue code:c3a4/04/01 cheat description:8 lives after continue code:c3a4/04/08 cheat description:Start with 1 life - both players code:c511/04/01 cheat description:Start with 8 lives - both players code:c511/04/08 cheat description:Start with Flame Thrower code:c56c/00/01 cheat description:Start with Fireball code:c56c/00/02 cheat description:Start with Laser code:c56c/00/03 cheat description:Start on round 2 code:fbf8/10/01+fbfa/00/b4+fbfb/20/03 cheat description:Start on round 3 code:fbf8/10/02+fbfa/00/b4+fbfb/20/03 cheat description:Start on round 4 code:fbf8/10/03+fbfa/00/b4+fbfb/20/03 cheat description:Start on round 5 code:fbf8/10/04+fbfa/00/b4+fbfb/20/03 cheat description:Start on round 6 code:fbf8/10/05+fbfa/00/b4+fbfb/20/03 cheat description:Start on round 7 code:fbf8/10/06+fbfa/00/b4+fbfb/20/03 cartridge sha256:a762d0a90d16c84b5f2b014816b37675cf5115320be7e815effbb64d91b2014d name:All Night Nippon Super Mario Brothers (Japan) (Promotion Card) cheat description:All blocks are starmen code:89c9/cd cheat description:Invisible 1-up blocks are visible and all mushroom blocks are 1-ups code:89f9/c1 cheat description:Start on level 8-4 code:c4b2/00/07+c4bc/00/03 cartridge sha256:3addebdec132929ecad2a8612a4ba54ccc39b9ada2295692f836c6b48d015054 name:Alpha Mission (USA) cheat description:Invincibility code:c1aa/91/b1 cheat description:Infinite lives code:92d7/c6/a5 cheat description:Keep power up after death code:8375/85/24 cheat description:Keep energy after death code:8377/85/24 cheat description:Thunder uses 25% normal energy code:980b/08/04 cheat description:Triple energy gained on 'E' pick-up code:b6a1/02/06 cheat description:Less energy lost on 'Bad E' pick-ups code:b6b4/04/02 cheat description:Shield doesn't use energy code:c004/85/a5 cheat description:You can re-use weapon after selecting code:8c70/85/25 cheat description:Start with all weapons available code:8347/03/ff cheat description:Start with 1 life code:8356/03/01 cheat description:Start with double lives code:8356/03/06 cheat description:Start with triple lives code:8356/03/09 cartridge sha256:a978de5d5f343eacb0a6f12427327ecbe9b2e9cf881569aec7b838bd44237d84 name:Amagon (USA) cheat description:Invincibility code:d3f2/f0/d0 cheat description:Invincible against enemies code:a19c/a9/60 cheat description:Invincible against bullets code:a121/a9/60 cheat description:Invincible against area boss code:a1f0/a9/60 cheat description:Infinite mega-power code:a255/95/24 cheat description:Infinite ammo code:f663/01/00 cheat description:Infinite ammo (alt) code:f664/95/b5 cheat description:Hit anywhere code:f6bf/62/00 cheat description:One hit kills code:f6d2/4e/00 cheat description:Multi-jump code:ce7c/06/00+ce8e/04/00+ce87/06/08 cheat description:Gain 10 bullets on pick-up code:cd6b/02/01 cheat description:Gain 30 bullets on pick-up code:cd6b/02/03 cheat description:Start with no bullets code:e299/04/01 cheat description:Start with 600 bullets code:e299/04/07 cheat description:Start with infinite lives code:cf27/01/00 cheat description:Start with 1 life code:e29d/04/01 cheat description:Start with 8 lives code:e29d/04/08 cartridge sha256:be12cff13a06e0b5de2dad4d431f7cf9a6aa73be45cdbd952dfd03a9d23571b6 name:American Gladiators (USA) cheat description:Less joust time code:943a/63/3c cheat description:Stop joust timer code:a32b/ce/2c cheat description:Less cannonball time code:801c/63/3c cheat description:Stop cannonball time code:9104/ce/2c cheat description:Less wall time code:aa4a/63/3c cheat description:Stop wall timer code:aa98/de/2c cheat description:More assault time code:8726/3d/63 cheat description:Less assault time code:8726/3d/29 cheat description:Stop assault timer code:8755/ce/2c cheat description:More power ball time - level 1 code:915a/3d/63 cheat description:More power ball time - level 2 code:915b/38/63 cheat description:More power ball time - level 3 code:915c/33/63 cheat description:More power ball time - level 4 code:915d/2e/63 cheat description:Start with 1 life - P1 code:86a3/05/01 cheat description:Start with 8 lives - P1 code:86a3/05/08 cheat description:Start with 10 lives - P1 code:86a3/05/0a cheat description:Start with 20 lives - P1 code:86a3/05/14 cheat description:Start with 1 life - P2 code:86e3/05/01 cheat description:Start with 8 lives - P2 code:86e3/05/08 cheat description:Start with 10 lives - P2 code:86e3/05/0a cheat description:Start with 20 lives - P2 code:86e3/05/14 cheat description:Start on level 2 - P1 code:86a1/00/01 cheat description:Start on level 3 - P1 code:86a1/00/02 cheat description:Start on level 4 - P1 code:86a1/00/03 cheat description:Start on level 2 - P2 code:86e1/00/01 cheat description:Start on level 3 - P2 code:86e1/00/02 cheat description:Start on level 4 - P2 code:86e1/00/03 cartridge sha256:427876021e6c077479a1a1171e013f84ae951197005a317b099df3b6c2862603 name:Anticipation (USA) cheat description:More time to answer questions code:97b7/19/32 cheat description:Less time to answer questions code:97b7/19/0f cheat description:Infinite chances code:a670/c0/00 cartridge sha256:bb834eb82f0ac53114035e6f353434a934d4aa47742644740de5fa8b2b033b5b name:Arch Rivals - A Basketbrawl! (USA) cheat description:Never miss a shot - both players code:9a61/d0/24 cheat description:More time for a quarter code:ba27/34/38+b171/34/38 cheat description:Less time for a quarter code:ba27/34/32+b171/34/32 cheat description:Run faster without ball code:90f3/20/60+9160/20/60 cheat description:Super speed code:90e9/04/25+9154/04/25 cartridge sha256:751d3bf4722ce117d8ab7ff78059f42206ead5299716d91d5ff27d3900d555ad name:Archon (USA) cheat description:Unrestricted ground movement code:d05d/eb/00 cheat description:Unrestricted flying movement code:d044/04/00 cartridge sha256:7768ef85519c94dc40d09bc598121825d103fcf1d4927be59f597b0a3509d15f name:Argus (Japan) cheat description:Invincibility code:980c/85/a5 cheat description:Infinite lives code:812f/c6/c5 cartridge sha256:a3763e702f8ae0818480cf0a8b2395d3f928c539f75e230ed43fa6b904fe6365 name:Arkanoid (USA) cheat description:Infinite lives - both players code:8678/c6/a9 cheat description:Infinite lives code:8678/c6/a5 cheat description:Paddle hits ball anywhere code:a8df/33/00+a8e7/90/50 cheat description:No lasers code:80e6/20/ad cheat description:Square ball code:a1a1/e6 cheat description:Start with 1 life - P1 code:9c13/03/01 cheat description:Start with 6 lives - P1 code:9c13/03/06 cheat description:Start with 9 lives - P1 code:9c13/03/09 cheat description:Start on boss level code:9c1f/01/24 cheat description:Start on level 0 code:9c1f/01/00 cheat description:Start on level 1 code:9c1f/01/01 cheat description:Start on level 2 code:9c1f/01/02 cheat description:Start on level 3 code:9c1f/01/03 cheat description:Start on level 4 code:9c1f/01/04 cheat description:Start on level 5 code:9c1f/01/05 cheat description:Start on level 6 code:9c1f/01/06 cheat description:Start on level 7 code:9c1f/01/07 cheat description:Start on level 8 code:9c1f/01/08 cheat description:Start on level 9 code:9c1f/01/09 cheat description:Start on level 10 code:9c1f/01/0a cheat description:Start on level 11 code:9c1f/01/0b cheat description:Start on level 12 code:9c1f/01/0c cheat description:Start on level 13 code:9c1f/01/0d cheat description:Start on level 14 code:9c1f/01/0e cheat description:Start on level 15 code:9c1f/01/0f cheat description:Start on level 16 code:9c1f/01/10 cheat description:Start on level 17 code:9c1f/01/11 cheat description:Start on level 18 code:9c1f/01/12 cheat description:Start on level 19 code:9c1f/01/13 cheat description:Start on level 20 code:9c1f/01/14 cheat description:Start on level 21 code:9c1f/01/15 cheat description:Start on level 22 code:9c1f/01/17 cheat description:Start on level 23 code:9c1f/01/17 cheat description:Start on level 24 code:9c1f/01/18 cheat description:Start on level 25 code:9c1f/01/19 cheat description:Start on level 26 code:9c1f/01/1a cheat description:Start on level 27 code:9c1f/01/1b cheat description:Start on level 28 code:9c1f/01/1c cheat description:Start on level 29 code:9c1f/01/1d cheat description:Start on level 30 code:9c1f/01/1e cheat description:Start on level 31 code:9c1f/01/1f cheat description:Start on level 32 code:9c1f/01/20 cheat description:Start on level 33 code:9c1f/01/21 cheat description:Start on level 34 code:9c1f/01/22 cheat description:Start on level 35 code:9c1f/01/23 cheat description:Start on level 36 code:9c1f/01/24 cartridge sha256:8593b6ae7b19b2e767ad2c207c5a83dea90030414f45eef4c0dec3c3a5530364 name:Arkanoid II (Japan) cheat description:Infinite lives code:c8d2/c6/c5 cartridge sha256:381fcbe2b714c38fdeb4045d93f0867fe80f4a219077c3dc5a683a05a8b8e78a name:Arkista's Ring (USA) cheat description:Infinite health code:9516/e5/24 cheat description:Less damage from powerful monsters code:9507/0f/03 cheat description:Infinite lives code:bc32/ce/ad cheat description:Hit anywhere code:ae2a/c0/00 cheat description:Walk through walls code:9742/18/00+9717/0f/00+978a/9c/00+96dc/16/00 cheat description:Start with fewer hearts code:8546/05/02 cheat description:Start with more hearts code:8546/05/09 cheat description:Start with 20 continues code:8534/0b/15 cheat description:Start with 5 continues code:8534/0b/06 cheat description:Start with 1 life code:854e/03/01 cheat description:Start with 6 lives code:854e/03/06 cheat description:Start with 9 lives code:854e/03/09 cheat description:Infinite health (alt) code:03d6/05 cheat description:Have Ring, Necklace, Mirror code:03dc/ff cheat description:Have all armor code:03d5/0a+03d6/0a cheat description:Have Ultimate Bow status code:03d3/07 cheat description:Have Ultimate Arrow status code:03d4/07 cheat description:Max item slots code:03d7/03 cheat description:Unlock doors (enable only when at a door otherwise you'll move very slowly) code:0001/ff cheat description:Have Fire Ball code:0022/40 cheat description:Start on stage 02 code:03d0/01 cheat description:Start on stage 03 code:03d0/02 cheat description:Start on stage 04 code:03d0/03 cheat description:Start on stage 05 code:03d0/04 cheat description:Start on stage 06 code:03d0/05 cheat description:Start on stage 07 code:03d0/06 cheat description:Start on stage 08 code:03d0/07 cheat description:Start on stage 09 code:03d0/08 cheat description:Start on stage 10 code:03d0/09 cheat description:Start on stage 11 code:03d0/0a cheat description:Start on stage 12 code:03d0/0b cheat description:Start on stage 13 code:03d0/0c cheat description:Start on stage 14 code:03d0/0d cheat description:Start on stage 15 code:03d0/0e cheat description:Start on stage 16 code:03d0/0f cheat description:Start on stage 17 code:03d0/10 cheat description:Start on stage 18 code:03d0/11 cheat description:Start on stage 19 code:03d0/12 cheat description:Start on stage 20 code:03d0/13 cheat description:Start on stage 21 code:03d0/14 cheat description:Start on stage 22 code:03d0/15 cheat description:Start on stage 23 code:03d0/16 cheat description:Start on stage 24 code:03d0/17 cheat description:Start on stage 25 code:03d0/18 cheat description:Start on stage 26 code:03d0/19 cheat description:Start on stage 27 code:03d0/1a cheat description:Start on stage 28 code:03d0/1b cheat description:Start on stage 29 code:03d0/1c cheat description:Start on stage 30 code:03d0/1d cheat description:Start on stage 31 code:03d0/1e cartridge sha256:54526dc9444c0eb4b0e5814f98b5e522bcb9881a6f2c0644fc7a21ca8c03502b name:Armadillo (Japan) cheat description:Invincibility code:b4a8/c9/a9+b4a9/03/00 cartridge sha256:20aaf9705d2cc17bac10468544afb250019f43983677b904ca88328f67aa9439 name:Astro Fang - Super Machine (Japan) cheat description:Infinite fuel code:d98a/85/a5 cheat description:Infinite Missiles code:b278/85/a5 cartridge sha256:a08e6b53f1fa593e001719d87e2f203deb24ee1d389a8f3f339d75e9fb7c02f4 name:Astyanax (USA) cheat description:Invincibility code:8174/d0/f0 cheat description:Infinite health code:c536/85/a5 cheat description:Infinite SP (spell) code:c38c/18/30 cheat description:Hit anywhere code:d9cc/b0/24+d9b5/30/24 cheat description:Multi-jump code:828d/77/80+828f/10/80+8291/35/32 cheat description:Double health and SP code:8a46/14/28 cheat description:Keep weapons after death code:cb30/ce/ad cheat description:Start with Blast Spell code:8a4c/00/01 cheat description:Start with Bind Spell code:8a4c/00/02 cheat description:Start with extra weapon power code:8a42/04/14 cheat description:Start with 1 life code:8cbb/02/00+8a52/02/00 cheat description:Start with double lives code:8cbb/02/05+8a52/02/05 cheat description:Start with triple lives code:8cbb/02/08+8a52/02/08 cheat description:Invincibility (alt) code:007d/03 cheat description:Infinie lives code:0096/03 cartridge sha256:2137d1621d29df50100f4d0fba3bafa0be56ccd0c832e44cd29dd7f0d75b374e name:Athena (USA) cheat description:Infinite health (after first 2 units) code:a533/85/24 cheat description:Infinite time code:b733/01/00 cheat description:Collect items from anywhere code:89c9/b0/10 cheat description:Start with energy boost code:f1cf/0c/20 cheat description:Start with extra time code:e758/05/07 cheat description:Start with less time code:e758/05/04 cheat description:Start with 1 life code:f1cb/02/00 cheat description:Start with 6 lives code:f1cb/02/05 cheat description:Start with 9 lives code:f1cb/02/08 cheat description:Infinite health code:0095/0f cheat description:Infinite lives code:009b/09 cheat description:Infinite time (alt) code:0092/59 cartridge sha256:3b687bf0a8ccd23736bb7ed2e6e75f9d150318d79da22bbf7ff1dd97ab980957 name:Attack of the Killer Tomatoes (USA) cheat description:Invincibility code:f1e6/60 cheat description:Infinite health code:f1f6/ad cheat description:Infinite lives code:f4f4/cd cheat description:Invincibility (alt) code:07f4/32 cheat description:Infinite health (alt) code:0722/3c cheat description:Infinite lives (alt) code:0718/03 cartridge sha256:f3601248633f47a0ef10723e42a1072c76dd487d7ddf943e618611bb7cfec737 name:Atlantis no Nazo (Japan) cheat description:Infinite lives code:81e8/ce/bd cheat description:Partial invincibility code:b79f/20/ad+b279/20/ad+b411/20/ad+81b0/20/ad cartridge sha256:f91113b6a4bcd39d86ad5bbeaeb0f103461ada2cae513d1648a77ee575caf69b name:Auto-Upturn (Asia) (PAL) (Unl) cheat description:Infinite health (blinking) code:a3f6/c6/a5+a42b/c6/a5 cheat description:Infinite lives code:a416/c6/a5 cheat description:Infinite time code:95c6/c6/a5 cartridge sha256:fb20d9562088cfa620ad0221e6e6f6c6d1f08e5a9cee2a97c0ef4fc39f050c6c name:Baby Boomer (USA) (Unl) cheat description:Infinite lives code:e242/ce/cd cartridge sha256:2bd744ff0d76653b9e218f6cea37f86bbdc6bc9b7a816c5fa236594ed1eb496a name:Back to the Future (USA) cheat description:Invincibility - Street stages code:8afa/05/00+8aff/37/10+8b3c/f0/10 cheat description:Disable all timers code:9aeb/a5/60 cheat description:Never lose a life in Hill Valley game code:814c/ce/ad cheat description:Never lose a life in Cafe game code:819b/ce/ad cheat description:Never lose a life in School game code:81c3/ce/ad cheat description:Never lose a life in Dancing Hall game code:81eb/ce/ad cheat description:Start with 1 life code:80ac/04/01 cheat description:Start with 8 lives code:80ac/04/08 cartridge sha256:b265adba4a6f751f4da7b157672f324264f11fed3ca0b1e4ca703eb0b8a5ab77 name:Back to the Future Part II & III (USA) cheat description:Infinite lives code:81ab/ce/ad cheat description:Infinite fuel code:8209/e5/24+821a/e5/24 cheat description:Keep shots code:8c44/85/24 cheat description:Quicker shots code:88c5/19/09 cheat description:Start with 20 nuclear fuel units code:c22f/01/02 cheat description:Start with 30 nuclear fuel units code:c22f/01/03 cheat description:Start with 20 lives code:c22a/01/02 cheat description:Start with 30 lives code:c22a/01/03 cartridge sha256:56382fac9104b26797de262a7c70ddd5850451d81a5008f3943d7bc492cbeb41 name:Bad Dudes (USA) cheat description:Invincibility code:8102/10/50+91df/ad/60+8101/0a/b8 cheat description:Infinite health code:810e/f0/10 cheat description:Infinite health (alt) code:8118/8d/ad cheat description:Infinite lives code:c578/ce/ad cheat description:Infinite continues code:c598/ce/2c cheat description:Infinite time code:fb61/ce/cd cheat description:Hit anywhere code:9135/5c/00 cheat description:One hit kills code:dcbf/f0/10 cheat description:Start with 1 life and 1 continue code:a2ff/03/01 cheat description:Start with double lives and continues code:a2ff/03/06 cheat description:Start with triple lives and continues code:a2ff/03/09 cheat description:Gain double usual energy from drinks code:87d5/05/09 cheat description:Have the Nunchaku code:02a2/01 cheat description:Have the Knife code:02a2/02 cheat description:One hit kills on bosses code:032f/00+0344/00 cartridge sha256:467a2e53c7af4c60809db9c2670850a6e21a98ea37c1d920dc4fcb6afcb5a104 name:Bad News Baseball (USA) cheat description:Balls are considered strikes code:9410/e8/ea cheat description:Play as girls team code:c102/13/71+c100/90/01 cheat description:Have 0 outs code:050d/00 cheat description:Have 2 outs code:050d/02 cheat description:Team 1 score is 0 code:0305/00 cheat description:Team 2 score is 0 code:0306/00 cartridge sha256:98658d5c8e530994730be6f4f7f76fe09142dee90e0afca613f5d6baaf208f52 name:Bad Street Brawler (USA) cheat description:Infinite health code:c9f2/9d/bd cheat description:Infinite time code:d723/d6/d5 cheat description:Don't die at time out code:d716/ce/ad cheat description:Infinite lives code:d117/c6/a9 cheat description:Infinite lives (alt) code:d20c/c6/c5 cheat description:Start with 1 life code:d026/03/01 cheat description:Start with 6 lives code:d026/03/06 cheat description:Start with 9 lives code:d026/03/09 cheat description:Start on level 5 code:a7b2/00/04 cheat description:Start on level 10 code:a7b2/00/09 cheat description:Start on level 15 code:a7b2/00/0e cheat description:Infinite health (alt) code:05f1/14 cartridge sha256:7328b2eb1c9fe06b98e0cba5c9058bf026e06a94900d490f79436d714eb48d6b name:Balloon Fight (USA) cheat description:Infinite lives code:f2fd/d6/b5 cheat description:Start with only one balloon code:f3b6/02/01 cheat description:Balloons are unburstable code:efa7/84/60 cheat description:Enemies can't burst balloons code:ea60/0b cheat description:Start with 1 life code:f1f1/02/00 cheat description:Start with 6 lives code:f1f1/02/05 cheat description:Start with 9 lives code:f1f1/02/08 cheat description:Start on level 5 - 2P only code:f1fd/00/04 cheat description:Start on level 10 - 2P only code:f1fd/00/09 cheat description:Start on level 15 - 2P only code:f1fd/00/0e cheat description:Infinite lives - P1 code:0041/02 cheat description:Infinite lives - P2 code:0042/02 cartridge sha256:d718f10d4ab57f7ed3891a84bdc496472a242b9c8496a3c0a0de77b45ae2fd58 name:Banana Prince (Germany) cheat description:Invincibility code:a03e/24/04 cheat description:Invincible to enemies code:aa24/40/00 cheat description:Invincible to shots code:a9d1/40/00 cheat description:Invincible to lava code:baf5/30/50 cheat description:Infinite energy code:a92a/ce/cd cheat description:Infinite lives code:d3ab/ce/cd cheat description:Infinite time code:d42f/ce/cd cheat description:Infinite errors in quizes code:af55/ce/ad cheat description:Max health when you die instead of 00 code:b4ab/00/0c cheat description:Each Ring worth 10 code:cd71/90/70 cheat description:Disable invincibility flickering code:da1c/10/50 cheat description:Dice always at 9 in bonus island code:e6b5/00/09 cheat description:Don't loose health when you touch lava code:bb06/ce/ad cheat description:Start with 9 lives code:de61/03/09 cheat description:Start with max health code:de79/06/0c cartridge sha256:bb30e4f4b1f6d8ccfdbd538b6f20347ed732cd37e8ac0a8305a277cf298b3dc8 name:Barbie (USA) cheat description:Invincibility (blinks) code:d5b8/f0/d0 cheat description:Infinite Z's on Dream Meter code:dfcc/ce/ad cheat description:Can re-enter Barbie's dream an infinite number of times code:8660/ce/ad cheat description:Cannot re-enter Barbie's dream code:808f/02/00 cheat description:Start with 9 Z's (1st credit only) code:aa80/05/09 cheat description:Start with 1 Z (1st credit only) code:aa80/05/01 cartridge sha256:f22944452be3259aac853258759f469e7d2e2447c6178f26cc7bd0e89945bc04 name:Baseball (USA, Europe) cheat description:Balls are considered strikes code:d752/a5/a9 cartridge sha256:8bb20791eb3f4fd2455c33f0eead4538af3372205fba70fd4c3e0867b2c34c9a name:Baseball Simulator 1.000 (USA) cheat description:Balls are considered strikes code:9e44/02/01 cheat description:Strike outs aren't allowed code:a6e5/e6/a9 cheat description:Balls aren't counted code:8670/e6/a5 cheat description:1 strike and you're out code:86d9/03/01 cheat description:2 strikes and you're out code:86d9/03/02 cheat description:5 strikes and you're out code:86d9/03/05 cheat description:Strikes aren't counted code:8667/e6/a5 cheat description:1 ball and you walk code:86d3/04/01 cheat description:2 balls and you walk code:86d3/04/02 cheat description:3 balls and you walk code:86d3/04/03 cheat description:9 balls and you walk code:86d3/04/09 cartridge sha256:b035ec9e2a7fc408c19bb2ffd22dceb0483a73e5f5bf232132628c9d8657b1e8 name:Baseball Stars (USA) cheat description:Balls are considered strikes code:d4e9/03/00 cartridge sha256:5f8807999205f3800e445d6265b66fa6edff0070fc38905f7284f0ad437f9f53 name:Baseball Stars II (USA) cheat description:Balls are considered strikes code:d4c3/f0/a9 cheat description:Strikes do not count code:d55a/ee/ad cheat description:Balls do not count code:d4d6/ee/ad cheat description:One strike for an out code:d561/03/01 cheat description:Two strikes for an out code:d561/03/02 cheat description:Four strikes for an out code:d561/03/04 cheat description:Five strikes for an out (only 3 show on screen) code:d561/03/05 cheat description:One ball for a walk code:d4dd/04/01 cheat description:Two balls for a walk code:d4dd/04/02 cheat description:Three balls for a walk code:d4dd/04/03 cheat description:Five balls for a walk (only 3 show on screen) code:d4dd/04/05 cheat description:Six balls for a walk (only 3 show on screen) code:d4dd/04/06 cheat description:One out per side instead of 3 (against human players) code:d673/03/01 cheat description:Two outs per side (against human players) code:d673/03/02 cheat description:Four outs per side (against human players) code:d673/03/04 cheat description:One out per side instead of 3 (against computer) code:8315/03/01 cheat description:Two outs per side (against computer) code:8315/03/02 cheat description:Four outs per side (against computer) code:8315/03/04 cheat description:Game ends after 1 inning code:9ca6/23/01 cheat description:Game ends after 2 innings code:9ca6/23/03 cheat description:Game ends after 3 innings code:9ca6/23/06 cheat description:Game ends after 4 innings code:9ca6/23/08 cheat description:Game ends after 5 innings code:9ca6/23/0a cheat description:Game ends after 6 innings code:9ca6/23/0c cheat description:Game ends after 7 innings code:9ca6/23/0e cheat description:Game ends after 8 innings code:9ca6/23/10 cartridge sha256:b9af9efdf490e14895e7980097a86d2f69d6396383773c221e77c6183a4ab9c8 name:Bases Loaded II - Second Season (USA) cheat description:Balls are considered strikes code:c6cd/4c/ad cheat description:1 strike and you're out - most of the time code:c891/03/01 cheat description:2 strikes and you're out - most of the time code:c891/03/02 cheat description:Outs aren't counted code:8a1e/ee/ad cheat description:Only 2 outs allowed code:8a1b/02/01 cheat description:Only 1 out allowed code:8a1b/02/00 cheat description:Strikes aren't counted code:89f2/ee/ad+ccd3/ee/ad cheat description:Balls aren't counted code:8a0a/ee/ad+8a0d/ee/ad cartridge sha256:5d84d61e7e4c2b7d72a2b4599bd8cc415b71c90d1e332a83f95d96c75bc48efd name:Bases Loaded 3 (USA) cheat description:Computer can't score code:f754/ee/ad+f75e/fe/ad cheat description:Balls are counted as strikes code:9861/0e/ff+9863/f9/0e cheat description:Some strikes aren't counted code:9895/ee/ad cheat description:Balls aren't counted code:98ca/ee/ad cheat description:Strike outs aren't counted code:8395/ee/ad cheat description:1 strike and you're out code:9892/02/00 cheat description:2 strikes and you're out code:9892/02/01 cheat description:Each strike out counts as 3 outs code:839c/03/01 cheat description:Each strike out counts as 2 outs code:839c/03/02 cheat description:5 strike outs allowed code:839c/03/05 cheat description:9 strike outs allowed code:839c/03/01 cartridge sha256:e4aa19e0fd2800b58655eac814e1d9a9aa16d83eabd641789f8a6625591063a3 name:Bases Loaded 4 (USA) cheat description:Balls are considered strikes code:a34a/0c/ff+a34c/f9/0e cheat description:Balls do not count code:a37c/ee/ad cheat description:Strikes do not count code:a39f/ee/ad cheat description:2 strikes and you're out code:a39c/02/01 cheat description:4 strikes and you're out code:a39c/02/03 cheat description:1 ball and you walk code:a374/03/00 cheat description:2 balls and you walk code:a374/03/01 cheat description:3 balls and you walk code:a374/03/02 cheat description:Some batters start with count of 1 and 1 - 2P mode code:9e73/00/01+849e/00/01 cheat description:Some batters start with count of 2 and 2 - 2P mode code:9e73/00/02+849e/00/02 cartridge sha256:a37c97557fc4a8853057c1d193ba9144e560152a2723338a0490ee4fcac5227a name:Bashi Bazook - Morphoid Masher (USA) (Proto) cheat description:Invincibility code:948f/29/a9 cheat description:Everything is Free code:8201/17/00+8202/8d/ad cheat description:One Hit Kills code:b168/90/d0 cartridge sha256:f28821df0114eb6cff1d7b4eadcee87713591709da1dd8b3525cf250156111f1 name:Batman - The Video Game (USA) cheat description:Infinite health code:9a10/c6/11 cheat description:Infinite health (alt) code:c6c6/c5 cheat description:Regenerates health meter (except Joker's gun) code:c6c4/c5 cheat description:Infinite lives code:c634/c6/a5 cheat description:Infinite weapons code:9c81/85/a5 cheat description:Infinite bullets on pick-up code:9c7b/e5/24 cheat description:Hit anywhere + one hit kills code:9b47/4c/ad cheat description:Extra health on heart pick-up code:9e81/01/04 cheat description:Double usual bullets on pick-up code:9e52/0a/14 cheat description:Half usual bullets on pick-up code:9e52/0a/05 cheat description:Multi-jump code:94b5/dc/f5 cheat description:Start with 1 life code:dc8c/02/00 cheat description:Start with 6 lives code:dc8c/02/05 cheat description:Start with 9 lives code:dc8c/02/08 cheat description:Invincibility code:00cc/a4 cheat description:Infinite health (alt 2) code:00b7/08 cheat description:Infinite weapons (alt) code:00b8/63 cheat description:Super gun (cannot change weapons) code:00a6/ff cartridge sha256:183ede1115b428b046ae223f27e2db366a5b62c43f52b6fced5f22a57d39e663 name:Batman - Return of the Joker (USA) cheat description:Invincibility code:b192/8d/ad+aa54/8d/ad+af21/8d/ad cheat description:Invincible to bosses code:b06d/85/ad cheat description:Invincibility lasts until next stage code:9549/02/00 cheat description:Protection from enemy bullets code:af21/8d/ad cheat description:Protection from collisions code:aa54/8d/ad cheat description:Protection from electric grids code:82d6/8d/ad cheat description:Infinite health code:c603/8d/ad cheat description:Infinite weapons code:c4dc/ce/cd cheat description:Infinite lives code:d52a/ce/ad cheat description:Each Backpack Energy Capsule counts as two code:ab6e/02/04 cheat description:Each Backpack Energy Capsule counts as four code:ab6e/02/08 cheat description:Don't get stunned when hit code:b18d/8d/2c cheat description:Stand your ground code:b1b8/04/00+b1c0/8c/2c cheat description:Intense knock-back when hit (may get stuck if you knock back into a wall) code:b1b6/ff/fe+b1bc/00/01 cheat description:Continue game with 3 life increments instead of 8 code:915e/0e/04 cheat description:Start with 7 Backpack Energy Capsules instead of none code:d499/fe/0c cheat description:Start with 3 life increments instead of 8 code:d49e/0e/04 cheat description:Start with 1 life code:d4a3/02/00 cheat description:Start with 100 lives code:d4a3/02/64 cheat description:Invincibility after first hit code:0479/00 cheat description:Infinite health code:0478/08 cheat description:Infinite Baterangs code:0141/0a cheat description:Bosses lose health quickly code:00aa/00 cheat description:Start on stage 1-2 code:0400/02 cheat description:Start on stage 1-3 code:0400/04 cheat description:Start on stage 2-1 code:0400/06 cheat description:Start on stage 2-2 code:0400/08 cheat description:Start on stage 3-1 code:0400/0a cheat description:Start on stage 3-2 code:0400/0c cheat description:Start on stage 3-3 code:0400/0e cheat description:Start on stage 4-1 code:0400/10 cheat description:Start on stage 4-2 code:0400/12 cheat description:Start on stage 4-3 code:0400/14 cheat description:Start on stage 5-1 code:0400/16 cheat description:Start on stage 5-2 code:0400/18 cheat description:Start on stage 6-1 code:0400/1a cheat description:Start on stage 6-2 code:0400/1c cheat description:Start on stage 6-3 code:0400/1e cheat description:Start on stage 7-1 code:0400/20 cheat description:Start on stage 7-2 code:0400/22 cartridge sha256:8b7363e037883aaa36d2c643c36a6f09ce49bd515f166154bd2a48e0a6468b9d name:Batman Returns (USA) cheat description:Infinite Batarangs code:c4dc/ce/ad cheat description:Don't lose health from spin attack code:8a65/02/00 cheat description:Almost infinite lives and health code:c603/8d/2c cheat description:Small hearts give more health code:81d1/10/30 cheat description:Hit anywhere code:a1bd/90/d0+a1b2/90/d0 cheat description:One hit kills code:a215/b0/24 cheat description:Power punch code:a546/02/0f cheat description:Power slide attack code:a54b/05/0f cheat description:Power jump kick code:a54a/05/1a cheat description:Walk faster horizontally code:8dd4/01/04+8dee/01/04 cheat description:Start with 9 Batarangs code:802b/05/09 cheat description:Start with full health code:8013/28/3f cheat description:Start with less health code:8013/28/10 cheat description:Invincibility (blinking) code:04c8/15 cheat description:Infinite health code:0140/41 cheat description:Infinite Batarangs (alt) code:0141/09 cheat description:0 health - Enemy 1 code:0145/00 cheat description:0 health - Enemy 2 code:0146/00 cheat description:0 health - Enemy 3 code:0147/00 cartridge sha256:64832bef6533d98f49e807c000537c8cb26ef94e6c3f871b8b6b35c5a11e427b name:BattleCity (Japan) cheat description:Infinite freeze time once you obtain a clock code:dc00/ce/ad cheat description:256 seconds of freeze time once you obtain a clock code:e9f6/0a/ff cartridge sha256:a50c0b6d93f7e20ecfd8a95abd5b7bccd4cf290901376fcf9e4053b3f964fca1 name:Battle Formula (Japan) cheat description:Infinite life code:9ad8/85/a5 cartridge sha256:d095eab5376c2b7c4f1c09018c9591598831c557e0b691c01ca2480e49e60c0a name:Battle of Olympus, The (USA) cheat description:Invincibility code:8491/d0/f0 cheat description:Infinite health code:d8df/85/a5 cheat description:Hit anywhere code:846d/d0/18+846e/ee/60 cheat description:Get items from anywhere (press down) code:8ded/e9/00+8de7/b0/24 cheat description:Start with less stamina code:c031/10/08 cheat description:Start with more stamina code:c031/10/20 cheat description:Start with Sandals of Hermes code:ca01/02/00 cheat description:Start with Staff of Fennel code:c037/00/01+c03c/85/24+c03e/85/24 cheat description:Start with Sword code:c037/00/02+c03c/85/24+c03e/85/24 cheat description:Start with Divine Sword code:c037/00/03+c03c/85/24+c03e/85/24 cartridge sha256:c49a5d7f565646d76bdc307ccb0202197f579b77c5bf5ea409b5cb29f72edf3a name:Battleship (USA) cheat description:1 round per level code:8cb3/05/01 cheat description:3 rounds per level code:8cb3/05/03 cheat description:Each ship can take only one hit code:8d31/b9/ad cheat description:You only have RIM-66 missiles code:8d21/95/85 cheat description:Start on level 2 code:8c54/00/01+8c59/85/86+8c55/85/86 cheat description:Start on level 3 code:8c54/00/02+8c59/85/86+8c55/85/86 cheat description:Start on level 4 code:8c54/00/03+8c59/85/86+8c55/85/86 cheat description:Start on level 5 code:8c54/00/04+8c59/85/86+8c55/85/86 cheat description:Start on level 6 code:8c54/00/05+8c59/85/86+8c55/85/86 cheat description:Start on level 7 code:8c54/00/06+8c59/85/86+8c55/85/86 cheat description:Start on level 8 code:8c54/00/07+8c59/85/86+8c55/85/86 cartridge sha256:56d25e05dde2048c3a9b4e36ab5325091310ce2b65171615b5596fc542db66fa name:Battletoads (USA) cheat description:Infinite lives code:a3a2/d6/24 cheat description:One hit kills code:d383/b9 cheat description:Enemies easier to kill code:d383/9d/2c cheat description:Mega-jumping code:8e53/d8/f0 cheat description:Double health from flies code:cfba/08/10 cheat description:Maximum health from flies code:cfba/08/2f cheat description:Super fast punching code:a6b5/01/00 cheat description:Force 2-player mode code:e5f0/31/00 cheat description:Start with 0 lives code:e5fa/03/00 cheat description:Start with 1 life code:e5fa/03/01 cheat description:Start with 6 lives code:e5fa/03/06 cheat description:Start with 9 lives code:e5fa/03/09 cheat description:Start on level 2 - Wookie Hole code:8320/00/02 cheat description:Start on level 3 - Turbo Tunnel code:8320/00/03 cheat description:Start on level 4 - Arctic Cavern code:8320/00/04 cheat description:Start on level 5 - Surf City code:8320/00/05 cheat description:Start on level 6 - Karnath's Lair code:8320/00/06 cheat description:Start on level 7 - Volkmire's Inferno code:8320/00/07 cheat description:Start on level 8 - Intruder Excluder code:8320/00/08 cheat description:Start on level 9 - Terra Tubes code:8320/00/09 cheat description:Start on level 10 - Rat Race code:8320/00/0a cheat description:Start on level 11 - Clinger Winger code:8320/00/0b cheat description:Start on level 12 - The Revolution code:8320/00/0c cheat description:Invincibility code:0574/02 cheat description:Infinite lives (alt) code:0011/05 cartridge sha256:4f67a81cc978e5aaf8aa03046c27ddc954f835e2110e346bc28d35f6b4ac61ca name:Battletoads-Double Dragon (USA) cheat description:Infinite lives (except stage 4) code:b0a0/d6/24 cheat description:Infinite lives on stage 4 code:995a/d6/24 cheat description:Bonus score now gives invincibility (instead of invincibility pod) code:f44d/2c/7d cheat description:Longer invincibility code:f451/05/1f cheat description:Even longer invincibility code:f451/05/35 cheat description:Double Dragon super punch code:88de/02/10 cheat description:Battletoads super punch code:88bb/04/10 cheat description:Stronger enemies code:d1b1/0f/20 cheat description:Start with 10 continues code:82eb/02/09 cheat description:Start with full lives code:9889/03/05 cheat description:Start with 1 life code:9889/03/00 cheat description:Infinite lives - P1 code:0011/05 cheat description:Infinite lives - P2 code:0012/05 cheat description:0 hits to SMASH! enemies code:051c/00+051d/00+051e/00+051f/00+0520/00+0521/00 cartridge sha256:3b3865e6e44f8ef749e8a9509651a6fad688b8d744fab22974a6f4cb9e7f2b0b name:Beauty and the Beast (Europe) cheat description:Infinite hits code:cf7c/c6/bd cheat description:Infinite lives code:d48a/c6/bd cheat description:Infinite time code:d2a8/e6/bd cartridge sha256:b9434d2f359f6e464da36fbcf6d9eb794b7edff03b89467d1609158f13bfef52 name:Beetlejuice (USA) cheat description:Invincibility code:dc05/f0/d0 cheat description:Invincibility (blinking) code:d71f/8d/ad cheat description:Infinite hits code:d716/01/00 cheat description:Infinite lives code:d417/ce/ad cheat description:Take fewer hits to die code:8095/02/01+d3ff/02/01 cheat description:Start with 1 life code:8090/03/01 cheat description:Start with 6 lives code:8090/03/06 cheat description:Start with 9 lives code:8090/03/09 cartridge sha256:f93163a51f4a671c5f4da390d4d286d6d8440d87dfe24285c40ed73dc422bf7d name:Bee 52 (USA) (Unl) cheat description:Invincibility code:e375/f0/d0 cheat description:Invincibility (alt) code:e1f3/85/a5 cheat description:Infinite lives code:cdd1/ce/ad cheat description:Hit anywhere - sting attack code:e321/d0/50+e322/3b/18 cheat description:Keep pick-ups code:fe2a/20/ad cheat description:Don't get stunned code:d65e/d0/24 cheat description:Fly quicker code:ceff/30/24+cf1b/10/24 cheat description:Start with 1 life code:fc24/03/01 cheat description:Start with 6 lives code:fc24/03/06 cheat description:Start with 9 lives code:fc24/03/09 cartridge sha256:2366af9fc0512d39bfa6e908b4caa12be3d21225af49274ffe2ff51cf0b9c1e6 name:Best of the Best - Championship Karate (USA) cheat description:Infinite time (round never ends) code:d2e8/c6/a5 cheat description:Each round is 0:10 instead of 1:00 code:d774/01/00+d771/85/e6 cheat description:Each round is 0:20 code:d774/01/00+d76f/85/a9+d770/5e/02 cheat description:Each round is 0:30 code:d774/01/00+d76f/85/a9+d770/5e/03 cheat description:Each round is 0:40 code:d774/01/00+d76f/85/a9+d770/5e/04 cheat description:Each round is 0:50 code:d774/01/00+d76f/85/a9+d770/5e/05 cheat description:Each round is 2:00 code:d774/01/02 cheat description:Each round is 3:00 code:d774/01/03 cheat description:Each round is 4:00 code:d774/01/04 cheat description:Each round is 5:00 code:d774/01/05 cheat description:Each round is 6:00 code:d774/01/06 cheat description:Each round is 7:00 code:d774/01/07 cheat description:Each round is 8:00 code:d774/01/08 cheat description:Each round is 9:00 code:d774/01/09 cheat description:Each match is 1 round instead of 5 code:da1b/05/01 cheat description:Each match is 2 rounds code:da1b/05/02 cheat description:Each match is 3 rounds code:da1b/05/03 cheat description:Each match is 4 rounds code:da1b/05/04 cheat description:Each match is 6 rounds code:da1b/05/06 cheat description:Gain more strength and reflex points in training code:e80e/04/08+e981/02/00 cheat description:Gain more resistance points in training code:e80e/04/10+e981/02/00 cheat description:All physical types are 30 (causes graphic errors near top of screen) code:d5fc/b1/a9+d5fd/02/1e cheat description:All physical types are 50 (causes graphic errors near top of screen) code:d5fc/b1/a9+d5fd/02/32 cheat description:Start with 50 resistance points code:8002/1e/32 cheat description:Start with 50 strength points code:8001/28/32 cheat description:Start with 50 reflex points code:8003/14/32 cheat description:Start with 70 resistance points code:8002/1e/46 cheat description:Start with 70 strength points code:8001/28/46 cheat description:Start with 70 reflex points code:8003/14/46 cartridge sha256:18c134f8cc7effc0b90dcca86a27c305cbd7dadfb159689c89790c7fe4ff9b77 name:Bible Adventures (USA) (v1.4) (Unl) cheat description:Infinite health code:dae4/9d/bd cartridge sha256:b56f867ad6b067f9ca7e46afb8e7a953fa281404232e2497c88e43448a2c3a57 name:Bible Adventures (USA) (v1.3) (Unl) cheat description:Infinite health code:dae8/9d/bd cartridge sha256:981b39b22c9b17055c90a612b9c8ea6711541ff5196018043f3516ed238f3ce9 name:Bible Adventures (USA) (v1.2) (Unl) cheat description:Infinite health code:dafe/9d/bd cartridge sha256:88ee64119746de659f70f3d459c62dd2af3b21f29f5064ea14f0fb03904cbcfe name:Bible Adventures (USA) (v1.1) (Unl) cheat description:Infinite health code:daa3/9d/bd cartridge sha256:2807c405f072a1e828cbdd4812822ec301979472fd9b8c6225aa4d1dca89613c name:Bible Adventures (USA) (Unl) cheat description:Infinite health code:d61c/9d/bd cartridge sha256:32fa00d52f39b053c30061d6789944fc61c0c88c885bd8248ff5771fd2f78ae6 name:Bigfoot (USA) cheat description:Infinite nitros code:abce/de/bd cheat description:Longer nitro boost code:abca/64/ff cheat description:Shorter nitro boost code:abca/64/20 cheat description:Engines are half price code:8cc1/08/04 cheat description:Engines cost more code:8cc1/08/09 cheat description:Tires are half price code:8cc2/06/03 cheat description:Tires cost more code:8cc2/06/09 cheat description:Transmission work is half price code:8cc3/04/02 cheat description:Transmission work is double price code:8cc3/04/08 cheat description:Suspension is half price code:8cc4/02/01 cheat description:Suspension is triple price code:8cc4/02/06 cheat description:P1 gets P2's nitros code:b16f/fe/ee+b168/8d/ad cartridge sha256:b183c0952994cadc1c8d6dd290730f43ecacb051d3dfe53784578635a1049455 name:Bill & Ted's Excellent Video Game Adventure (USA) cheat description:Infinite skeleton keys code:b249/ce/ad cheat description:Infinite coins for locals code:c90b/8d/ad cheat description:Infinite Good Stuff code:989b/99/b9 cheat description:Phone call segments cost only 1 coin code:e196/8d/ad cheat description:Ted starts with 99 coins instead of 15 code:cecb/15/99 cheat description:Bill starts with 99 coins code:e1d8/15/99 cheat description:Ted starts with 5 coins code:cecb/15/05 cheat description:Bill starts with 5 coins code:e1d8/15/05 cartridge sha256:ddf58f90fa5966137e71a0f30a162bf03b3e8b1b99f4f1d16cac26d5e2cf5b35 name:Bill Elliott's NASCAR Challenge (USA) cheat description:Accelerate faster code:c38e/90/b0 cheat description:Infinite 'free time' in the pits code:843e/ce/ad cheat description:Freeze timer while crew works on car in pits code:8692/ce/ad cartridge sha256:4f59f3ef6045be753ed5f7988e4b302b7f71216354a644f760f4a0aa43af7d22 name:Bio Force Ape (Japan) (En) (Proto) cheat description:Infinite health code:ba5f/8d/ad cheat description:Walk through walls code:9600/38/60+96b0/38/60 cheat description:Start on level 2 code:8427/00/01 cheat description:Start on level 3 code:8427/00/02 cartridge sha256:92c481350b63c57385834dfa0ab02aeb527df7e80cec14a3e1a1a77118cd38d1 name:Bio Miracle Bokutte Upa (Japan) cheat description:Hit anywhere - normal enemies code:e642/45/00+bc96/26/00 cartridge sha256:aeb61fd5cf5a5ed73344c46a43f8a8d539f601ff57e8f56c49bc1caea4ab3d9e name:Bionic Commando (USA) cheat description:Invincibility code:e7d7/ce/60 cheat description:Infinite lives in main game code:b77d/c6/a5 cheat description:Infinite lives in sub-game code:81ba/c6/a5 cheat description:Don't take damage from bullets and collisions code:e7d7/ce/ad cheat description:Don't take damage from spikes code:ae72/ce/ee cheat description:Don't take damange from bullets and collisions in sub-game code:9138/ce/ad cheat description:Hit anywhere code:ec1b/20/60+90c9/98/60+ecfb/38/60+8eaf/bd/60+eb46/99/ad cheat description:Autofire - main game code:b92b/f8/fa cheat description:Longer grapple line - sidescrolling levels code:9276/30/50+928c/40/56+9260/3a/5f cheat description:Longest grapple line - sidescrolling levels code:9277/90/d0+9261/90/d0+928d/90/d0 cheat description:Longer range for normal 3-way gun - sidescrolling levels code:bde8/09/17 cheat description:Longer range for fireball 3-way gun - sidescrolling levels code:be44/0c/15 cheat description:Use with BIO Code 11 for improved autofire with normal gun code:b949/0a/00 cheat description:Have all items (using the hidden gun will crash the game) code:b042/f0/b0+b126/f0/d0 cheat description:Start with 3 life energy capsules code:ca39/00/03+ca3b/be/ea cheat description:Start with 1 life code:ca35/02/00 cheat description:Start with double lives code:ca35/02/05 cheat description:Start with triple lives code:ca35/02/08 cheat description:Start with 3-way gun code:ca4f/cb/ce cartridge sha256:99806081ba58c0a108bcc61468972d4b2319de74d7dca1bba932f1a3bd2fe1cc name:Black Bass, The (USA) cheat description:Always have fish checking out your lure code:03c7/ff cheat description:Fish on screen will always bite your lure code:03f7/00 cheat description:Rank 1st place code:0445/01 cartridge sha256:abde6fc87b2d90e0b40cd3420d4b7381e1f23285efbbdc62fd27b59c591ad2cc name:Blades of Steel (USA) cheat description:Invincible in minigame code:a77d/d0/50 cheat description:Faster timer code:c6b6/07/04 cheat description:Slower timer code:c6b6/07/14 cheat description:Player with puck don't slow down code:d81d/20/00 cheat description:Players can take only one punch code:a423/05/01 cheat description:Players 2/CPU don't throw punches code:a6ce/49/a9+a5d2/bd/ad cheat description:Start a new game to view the ending code:c655/03/07 cartridge sha256:7a26c62a9b1605cbedf7cd5b2672aa0fc15b688b227a6cb57dbf74aa71a05f1c name:Blaster Master (USA) cheat description:Infinite car health code:89b4/ea cheat description:Enemies are killed instantly code:d70b/07 cheat description:Infinite lives code:c537/c6/a5 cheat description:Infinite Hover code:9328/c6/a5 cheat description:Infinite Homing Missiles code:9858/ce/2c cheat description:Infinite Thunderbreaks code:99c0/ce/2c cheat description:Infinite Multi-Warheads code:9ade/ce/2c cheat description:Start with all abilities code:c2cc/00/ff cheat description:Start with 5 of each weapon code:c309/00/05 cheat description:Start with 10 of each weapon code:c309/00/0a cheat description:Start with 15 of each weapon code:c309/00/0f cheat description:Start with 99 of each weapon code:c309/00/63 cheat description:Start with 99 of each weapon and max Hover code:c309/00/ff cheat description:Start with 1 life code:c302/02/00 cheat description:Start with 6 lives code:c302/02/05 cheat description:Start with 9 lives code:c302/02/08 cheat description:Start on world 2 code:c2fe/08/09 cheat description:Start on world 3 code:c2fe/08/0a cheat description:Start on world 4 code:c2fe/08/0b cheat description:Start on world 5 code:c2fe/08/0c cheat description:Start on world 6 code:c2fe/08/0d cheat description:Start on world 7 code:c2fe/08/0e cheat description:Start on world 8 code:c2fe/08/0f cheat description:Start at the boss of world 1 code:c2fd/09/a9+c2fe/08/00 cheat description:Start at the boss of world 2 code:c2fd/09/a9+c2fe/08/01 cheat description:Start at the boss of world 3 code:c2fd/09/a9+c2fe/08/02 cheat description:Start at the boss of world 4 code:c2fd/09/a9+c2fe/08/03 cheat description:Start at the boss of world 5 code:c2fd/09/a9+c2fe/08/04 cheat description:Start at the boss of world 6 code:c2fd/09/a9+c2fe/08/05 cheat description:Start at the boss of world 7 code:c2fd/09/a9+c2fe/08/06 cheat description:Start at the boss of world 8 code:c2fd/09/a9+c2fe/08/07 cheat description:Die to see ending code:c53a/16/42 cheat description:Invincibility code:007e/00 cheat description:Infinite health (alt) code:040d/ff cheat description:Infinite Hover (alt) code:0092/ff cheat description:Infinite lives (alt) code:00dd/03 cheat description:Infinite Homing Missiles (alt) code:06f0/63 cheat description:Infinite Thunderbreaks (alt) code:06f1/63 cheat description:Infinite Multi-Warheads (alt) code:06f2/63 cheat description:Full Gun Power - Jason code:00c3/ff cheat description:Most end bosses die instantly code:047d/00 cartridge sha256:e311f33f98a4461f9ca79e2df863323d42572234bc59321bb9fb39ca1b18d0cf name:Blue Marlin, The (USA) cheat description:Line is a 1000 yards long code:edf3/02/04 cheat description:Catch fish right after they bite - most of the time code:ead9/c8/00 cheat description:When fish bite they are close to the boat code:ead9/c8/09 cheat description:Line is set to 153 feet code:ead9/c8/99 cheat description:Pull fish in quicker code:edda/00/01 cheat description:Vitality always at max code:ec5c/69/a9+ec5d/01/0f cartridge sha256:46fb05f80167bd185bd6eef40e1f86a0dcdd36e250ef8e2b29a575550d75473a name:Blues Brothers, The (USA) cheat description:Invincibility code:ed66/f0/d0+e420/f0/d0 cheat description:Infinite health code:e098/de/bd cheat description:Infinite lives code:e0bf/de/bd cheat description:Multi-jump code:f1d0/00/01 cheat description:Invincibility (alt) (blinking) code:03c2/02 cheat description:Infinite energy (alt) code:042a/03 cheat description:Infinite lives (alt) code:0428/02 cartridge sha256:7e59dcd2576d2e83f6f628a7bb8d5f1e54fa300f7ecb9aa5e1e0f6d967be8371 name:Bo Jackson Baseball (USA) cheat description:Balls are considered strikes code:c487/18/00 cartridge sha256:2967746c2a434c97a074b14d894ea132fab8e443899f6ca870718eeee1669039 name:Bomberman (USA) cheat description:Immune to explosions code:c6e5/a5/a9 cheat description:Infinite time code:c650/a5 cheat description:Infinite lives code:c498/a5 cheat description:Hit anywhere (all enemies killed with one bomb) code:c716/37/00+c71d/30/00 cheat description:Remove all breakable blocks code:ca6a/02/00 cheat description:Never lose Detonator once obtained code:c48b/85/24 cheat description:Increase Bomb detonation time code:cd2b/a0/ff cheat description:Reduce Bomb detonation time code:cd2b/a0/70 cheat description:Use up to 10 Bombs code:cd07/a6/a2+cd08/74/09 cheat description:Walk through walls code:cf7f/49/a9+cf80/01/00 cheat description:Decrease time code:c44c/96 cheat description:Increase timer code:c44c/fe cheat description:Start with double power Bomb blasts code:c3c8/10/20 cheat description:Start with triple power Bomb blasts code:c3c8/10/30 cheat description:Start with maximum power Bomb blasts code:c3c8/10/80 cheat description:Start with Detonator, max Bomb power and use up to 10 Bombs code:c3dc/2d/00 cheat description:Start with and keep Detonator code:c98e/a5/a9+ccdf/0e/00 cheat description:Start with 1 life code:c3ab/00 cheat description:Start with 10 lives code:c3ab/09 cheat description:Start on stage 10 code:c3b7/0a cheat description:Start on stage 20 code:c3b7/14 cheat description:Start on stage 30 code:c3b7/1e cheat description:Start on stage 40 code:c3b7/28 cheat description:Start on stage 50 code:c3b7/32 cheat description:Invincibility code:005c/00 cheat description:Immune to explosions (alt) code:0079/01 cheat description:Infinite time (alt) code:0093/ee cheat description:Infinite lives (alt) code:0068/09 cheat description:Max Bomb power code:0073/80 cheat description:Use up to 10 Bombs (alt) code:0074/0a cheat description:Walk through walls (alt) code:0076/01 cheat description:Have Detonator code:0077/01 cheat description:Start on stage 50 (alt) code:0058/32 cartridge sha256:83cb47fda376900e8c1d8eef5c413229fb6cacaff43201afd421c71610c20368 name:Bomberman II (USA) cheat description:Infinite lives code:cac4/ce/2c cheat description:Infinite time code:98af/ce/2c cheat description:Super start code:ce2d/00/04+ce5c/00/04 cheat description:Immune to explosions code:87a1/a5/a9+87a2/ae/01 cheat description:Walk through walls code:879c/a5/a9+879d/ad/01 cheat description:Always have Detonator code:87c2/03/00 cheat description:Hit anywhere (kill all enemies with one bomb) code:8327/2f/1b+8328/29/61+8326/b1/ad+8329/80/ea cheat description:Remove all breakable bricks code:b946/20/00+b94f/20/ad cheat description:Slower timer code:98ab/3b/63 cheat description:Faster timer code:98ab/3b/1e cheat description:Bomb has a longer fuse code:928b/4b/7f cheat description:Bomb has a shorter fuse code:928b/4b/20 cheat description:Stop Bombs from exploding code:ba95/de/2c cheat description:Dollar sign acts as flame face code:9056/c7/80 cheat description:Dollar sign acts as Bomb code:9056/c7/74 cheat description:Dollar sign acts as heart with Bomb code:9056/c7/8c cheat description:Dollar sign acts as skate code:9056/c7/91 cheat description:Dollar sign acts as vest for a short time code:9056/c7/a9 cheat description:Start with 1 life code:c980/02/00 cheat description:Start with 6 lives code:c980/02/05 cheat description:Start with 9 lives code:c980/02/08 cheat description:Invincibility (except in normal game) - P1 code:0069/05 cheat description:Invincibility (except in normal game) - P2 code:006a/05 cheat description:Invincibility (except in normal game) - P3 code:006b/05 cheat description:Infinite time (hundred's digit) code:0559/09 cheat description:Infinite time (ten's digit) code:055a/09 cheat description:Infinite time (one's digit) code:055b/09 cheat description:Infinite lives - P1 code:04e5/09 cheat description:Max Bomb power - P1 code:0093/0c cheat description:Max Bomb power - P2 code:0094/0c cheat description:Max Bomb power - P3 code:0095/0c cheat description:Max Bomb quantity - P1 code:0090/0c cheat description:Max Bomb quantity - P2 code:0091/0c cheat description:Max Bomb quantity - P3 code:0092/0c cartridge sha256:b3d82e2818aea6caa69dcfe7d56197a7a51afe87819527880cf08876d1a988de name:Bonk's Adventure (USA) cheat description:Infinite lives code:a765/ce/ad cheat description:Hit anywhere code:a52a/03/00+a27e/27/53 cheat description:Super-jump when normal code:808f/0c/24 cheat description:Keep speed up after powered down code:94e5/8d/2c cheat description:Gain energy from picking up smiles code:a756/00/04 cheat description:Start with less initial energy (but more maximum energy) code:80b0/0c/04 cheat description:Start with more energy code:80b0/0c/18 cheat description:Start with 1 life code:80c0/02/00 cheat description:Start with 6 lives code:80c0/02/05 cheat description:Start with 9 lives code:80c0/02/08 cheat description:Start on stage 2-1 code:80ab/00/07 cheat description:Start on stage 3-1 code:80ab/00/0d cheat description:Start on stage 4-1 code:80ab/00/12 cheat description:Start on Stage 5-1 code:80ab/00/17 cheat description:Start on stage 6-1 code:80ab/00/21 cartridge sha256:0e58f270e7b116782e0822f52058eff66465df49527c6f8c6f0eca994d8cae7a name:Boulder Dash (USA) cheat description:Invincibility code:c603/01/00+c3c9/a5/60+c18f/2f/4d cheat description:Infinite lives code:ae02/d6/b5 cheat description:Infinite time code:cfd5/20/ad cheat description:One Diamond needed to open exit code:ccb6/25/00 cheat description:Speed up timer code:cfd2/3f/1f cheat description:Slow down timer code:cfd2/3f/ff cheat description:1 life after continue code:af98/03/01 cheat description:6 lives after continue code:af98/03/06 cheat description:9 lives after continue code:af98/03/09 cheat description:Start with 1 life code:db40/03/01 cheat description:Start with 6 lives code:db40/03/06 cheat description:Start with 9 lives code:db40/03/09 cartridge sha256:a8b6829d8d1e17cc23c8815e0b0add09e26fc5a2a27ad6bba260cef926535af2 name:Bram Stoker's Dracula (USA) cheat description:Invincibility code:d1e0/d0/50 cheat description:Invincibility after getting hit code:ba46/20/ad cheat description:Infinite health (except falling off cliffs) code:b5a5/de/bd cheat description:Infinite health code:b5a5/de/ad cheat description:Infinite lives code:e3f2/bc/bf cheat description:Infinite lives (alt) code:e3f1/ce/ad cheat description:Infinite time code:c1e1/01/00 cheat description:Infinite time (alt) code:c1fc/8d/ad+c1f7/8d/ad cheat description:Infinite ammo code:ed7e/ce/ad cheat description:Infinite weapons (except scene 1 daytime) code:ed80/02/bb cheat description:Faster timer code:c1e1/01/02 cheat description:Always have 63 ammo code:c277/05/00 cheat description:Disable axe code:f1dc/02/ff cartridge sha256:e1487d23800aa2c29cb9da6f2bf538aa10044930ef566d087f7acf1aa649fb9e name:BreakThru (USA) cheat description:Infinite lives - both players code:c13f/c6/24 cheat description:Infinite weapon time code:d24b/c6/24 cheat description:Start each life with 3-way firing and 99 seconds code:c33e/00/63 cheat description:Start with 1 life - P1 code:c2b9/03/01 cheat description:Start with 6 lives - P1 code:c2b9/03/06 cheat description:Start with 9 lives - P1 code:c2b9/03/09 cheat description:Start with 1 life - P2 code:c2c4/03/01 cheat description:Start with 6 lives - P2 code:c2c4/03/06 cheat description:Start with 9 lives - P2 code:c2c4/03/09 cheat description:Start on level 2 code:c27b/01/02 cheat description:Start on level 3 code:c27b/01/03 cheat description:Start on level 4 code:c27b/01/04 cheat description:Start on level 5 code:c27b/01/05 cartridge sha256:fde81fc5af055819700842db8650077d64b853f95b3542bf12f039a6df48115d name:Break Time - The National Pool Tour (USA) cheat description:Start in Milwaukee code:836d/85/86+836c/00/01 cheat description:Start in Atlanta code:836d/85/86+836c/00/02 cheat description:Start in Los Angeles code:836d/85/86+836c/00/03 cheat description:Start in Las Vegas code:836d/85/86+836c/00/04 cartridge sha256:3bcce1ff03b55c20eeaefa44f35f19b3f06b3ff88a86ed51968bad9bd44d9144 name:Bubble Bath Babes (USA) (Unl) cheat description:Infinite credits code:930b/c6/a5 cheat description:View slideshow code:8045/01/08+892a/85/e6+892b/64/88+8935/0b/0c cartridge sha256:31523322db8f94e7244f6e2d958692a412c1395fc744601d83d1e5111eff9042 name:Bubble Bobble (USA) cheat description:Skip only 2 levels code:cb11/04/02 cheat description:Skip 10 levels code:cb11/04/0a cheat description:Lots of bubble power code:d533/19/00 cheat description:Monsters move faster code:8478/01/02+8488/fe/ff cheat description:Monsters move super fast code:8478/01/03+8488/fd/ff cheat description:Angry monsters move faster code:847d/02/03+848d/fe/fd cheat description:Always wear turbo shoes code:d47d/06/00+d4d1/06/00 cheat description:Start with 1 life - both players code:ca38/03/01 cheat description:Start with 6 lives - both players code:ca38/03/06 cheat description:Start with 9 lives - both players code:ca38/03/09 cheat description:Start on level 10 code:ca30/01/0a cheat description:Start on level 25 code:ca30/01/19 cheat description:Start on level 50 code:ca30/01/32 cheat description:Start on level 75 code:ca30/01/4b cheat description:Invincibility - P1 code:003f/2f cheat description:Invincibility - P2 code:0053/2f cheat description:Infinite lives - P1 code:002e/09 cheat description:Infinite lives - P2 code:0042/09 cheat description:Float code:0032/0a cheat description:Have Long Shot code:0030/02 cheat description:Have Rapid Shot code:0030/04 cheat description:Have Long and Rapid Shot code:0030/06 cheat description:Have Lightning Shot code:0030/45 cartridge sha256:d02b24e4ee8e639bf77af6746d6b3a92e996c0d2298861071851e2beec0ef812 name:Bucky O'Hare (USA) cheat description:Infinite lives code:ce69/c6/a5 cheat description:Hit anywhere code:869a/b0/24+867f/b0/24+8684/69/a9+869f/69/a9 cheat description:One hit kills code:db4e/9d/bd cheat description:Multi-jump code:8fb9/b0/00+8fa3/10/00 cheat description:Double Bucky's special health code:bf06/8c/98 cheat description:Triple Bucky's special health code:bf06/8c/a4 cheat description:All characters always selectable code:8cce/10/f0 cheat description:All characters start with normal special health code:bf0a/0c/8c cheat description:All characters start with 2x special health code:bf0a/0c/98 cheat description:All characters start with 3x special health code:bf0a/0c/a4 cheat description:1 life after continue code:cfa6/02/00 cheat description:6 lives after continue code:cfa6/02/05 cheat description:10 lives after continue code:cfa6/02/09 cheat description:Press Start to complete the level code:c3d5/01/08+c3d8/01/00+c3d7/09/1c+c3d4/49/a9 cheat description:Start a new game to see ending code:cdb8/02/09 cheat description:Start with 1/2 health code:bf14/14/06 cheat description:Start with 1 life code:bf02/02/00 cheat description:Start with 6 lives code:bf02/02/05 cheat description:Start with 10 lives code:bf02/02/09 cheat description:Infinite health - all characters code:05a0/14 cheat description:Infinite lives - all characters code:004c/09 cheat description:Play as Jenny code:0034/01 cheat description:Play as Dead Eye code:0034/02 cheat description:Play as Blinky code:0034/03 cheat description:Play as Willy DuWitt code:0034/04 cartridge sha256:f01fe9436ca7b50953dbe5b8dd3574612df0e5df1fa9ae50d3f3b5faac818ab2 name:Bugs Bunny Birthday Blowout, The (USA) cheat description:Invincibility code:a371/60 cheat description:Infinite health code:a384/8d/ad cheat description:Infinite lives code:d464/ce/ad cheat description:Mega-jumping Bugs code:8a17/06/0b cheat description:Two hearts of energy gained on pick-up code:a299/04/08 cheat description:Less energy gained on pick-up code:a299/04/01 cheat description:Stunned for longer code:a370/30/60 cheat description:Stunned for less time code:a370/30/15 cheat description:Use hammer when stunned code:8954/3e/00 cartridge sha256:7882e99e08deb1c22a3c38b17e12bd6373af503fd76e97b31699f3d19bef5aad name:Bugs Bunny Crazy Castle, The (USA) cheat description:Invincibility code:e282/d0/24 cheat description:Baddies go as fast as Bugs Bunny code:c2c2/f0/24 cheat description:Make platforms invisible code:c050/01/04 cheat description:Start with super rabbit punches code:e4a4/f0/29+e4a0/10/29 cheat description:Start with infinite lives code:c11c/c6/a5 cheat description:Start with 1 life code:c031/05/01 cheat description:Start with 10 lives code:c031/05/0a cheat description:Start on level 10 code:c01c/20/ad+ffa6/00/09 cheat description:Start on level 20 code:c01c/20/ad+ffa6/00/13 cheat description:Start on level 30 code:c01c/20/ad+ffa6/00/1d cheat description:Start on level 40 code:c01c/20/ad+ffa6/00/27 cartridge sha256:6f37316bbfec539809a946f7020e7a411fe5dbe204157522f01b9c616e918247 name:Bugs Bunny Fun House (USA) (Beta) cheat description:Infinite turns code:ccfd/ce/ad cheat description:Slower timer code:962b/3c/80 cheat description:Faster timer code:962b/3c/1f cheat description:Quicker turning code:acde/04/02 cheat description:More time from Large Glop Clocks code:98eb/0f/1e cheat description:Less time from Large Glop Clocks code:98eb/0f/07 cheat description:1 turn after continuing code:cd25/03/01 cheat description:9 turns after continuing code:cd25/03/09 cheat description:Start with 1 turn code:c892/03/01 cheat description:Start with 9 turns code:c892/03/09 cheat description:Start on Floor 2 code:c88d/01/07 cheat description:Start on Floor 4 code:c88d/01/13 cheat description:Start on Floor 6 code:c88d/01/1f cheat description:Start on Floor 8 code:c88d/01/2b cartridge sha256:ba8c9990f378b941ea362858509182b2b009e5b463e9732dc0071392b6253c2b name:Bump'n'Jump (USA) cheat description:Jump OK, even with no power code:9b67/14/00 cheat description:Gain double power on every pick-up code:a530/01/02 cheat description:Jump OK at any speed code:9b6f/00/40 cheat description:Set jump OK speed to 190 code:9b77/05/09 cheat description:Set jump OK speed to 130 code:9b77/05/03 cheat description:Start on scene 2 code:8494/00/01 cheat description:Start on scene 3 code:8494/00/02 cheat description:Start On scene 4 code:8494/00/03 cheat description:Start on scene 5 code:8494/00/04 cheat description:Start on scene 6 code:8494/00/05 cheat description:Start on scene 7 code:8494/00/06 cheat description:Start on scene 8 code:8494/00/07 cheat description:Start on scene 9 code:8494/00/08 cheat description:Start on scene 10 code:8494/00/09 cheat description:Start on scene 11 code:8494/00/0a cheat description:Start on scene 12 code:8494/00/0b cheat description:Start on scene 13 code:8494/00/0c cheat description:Start on scene 14 code:8494/00/0d cheat description:Start on scene 15 code:8494/00/0e cartridge sha256:abbddcb7c85a9956f94e6185aa1f30c34c45ad0db2f7f9db40066d749ffa7920 name:Burai Fighter (USA) cheat description:Infinite lives code:ef90/ce/fe cheat description:Extra lives for Eagle level code:b690/05/09 cheat description:Extra lives for Albatross level code:b691/04/08 cheat description:Extra lives for Ace level code:b692/03/06 cheat description:More power for weapons code:e126/01/03 cheat description:Maximum power for weapons code:e126/01/0a cheat description:Increase cobalt power picked up code:e15e/02/09 cheat description:Never lose weapon power code:f2e8/99/b9 cheat description:Never lose speed up code:f2f3/85/a4 cheat description:Never lose weapons code:f2ef/85/a4 cheat description:Never lose rotating pod code:f2f1/85/a4 cheat description:Never lose anything code:f2eb/a9/60 cheat description:Start with laser code:f16d/85/e6 cheat description:Start with rotating pod code:f171/85/e6 cartridge sha256:8f349b0ed7d31a07ccdf26958de8219165eff7c9ad43801a82c5dcf831fd82c2 name:BurgerTime (USA) cheat description:Anti-gravity shoes code:d260/d0/24 cheat description:Peter Pepper gets super speed code:db09/1c/1f cheat description:Fast play for experts code:fd4f/20/ad cheat description:Monsters always move slowly code:daed/bd/ad cheat description:Monsters move at double speed code:daed/bd/ad+daee/18/1c cheat description:Monsters move at quadruple speed code:daed/bd/ad+daee/18/1f cheat description:Start with infinite lives code:e856/d6/a5 cheat description:Start with 8 lives code:cb54/04/08 cheat description:Start with infinite peppers code:d742/d6/b5 cheat description:Start with double peppers code:cb65/05/10 cartridge sha256:2b4ac20082e2f45a8f8fd4922a0e995829719a523e118a9eec891c3206adf25b name:B-Wings (Japan) cheat description:Invincibility code:a53c/a5/85 cheat description:Infinite lives code:ad73/ce/bd cheat description:Enable unlimited morphs code:b38a/f0/50 cheat description:Enable secret weapons morph code:b397/0b/0e cheat description:Can always morph code:b38a/50/24 cheat description:Start with secret weapon 1 code:b0fc/01/0b cheat description:Start with secret weapon 2 code:b0fc/01/0d cartridge sha256:47dfae941b3c660be476bc28f199474b6c418431e3d493da4384a6aef3cc5016 name:Cabal (USA) cheat description:Invincibility code:94fb/d0/f0 cheat description:Infinite lives code:928a/d6/24 cheat description:Infinite lives (alt) code:928a/d6/d5 cheat description:Infinite grenades code:adbd/01/00 cheat description:Shorter immunity code:9293/c0/40 cheat description:Longer immunity code:9393/c0/ff cheat description:12 Grenades on pick-up code:ac6f/04/0c cheat description:2 Grenades on pick-up code:ac6f/04/02 cheat description:Start with 20 grenades code:8a69/f3/f4 cheat description:Start with 50 grenades code:8a69/f3/f7 cheat description:Start with 9 lives - both players code:96be/f7/fb cheat description:Start with 1 life - both players code:96be/f7/f3 cheat description:Invincibility - P1 code:009f/02 cheat description:Invincibility - P2 code:00a0/01 cheat description:Infinite Grenades - P1 code:00d7/09 cheat description:Infinite Grenades - P2 code:00d8/fb+00d9/fb cartridge sha256:85da8656317bb939de111a036132ccf358259bab29cf2e4fc694bbef4e55fff0 name:California Raisins - The Grape Escape (USA) (Proto1) cheat description:Infinite health code:d924/c6/a5 cheat description:Infinite health (alt) code:0048/04 cheat description:Infinite lives code:0049/02 cartridge sha256:9ea5bedef90810b89afb70db90c6e0338aa2a6976603058dafe08838009651f0 name:California Raisins - The Grape Escape (USA) (Proto2) cheat description:Invincibility code:d12e/f0/d0 cheat description:Infinite lives code:ce89/c6/c5 cheat description:Invincibility (blinking) code:004d/ff cheat description:Infinite health code:004a/04 cheat description:Infinite lives (alt) code:004b/03 cartridge sha256:4ec881462687e08433605516d28624c5d9a7f33a243c64989c957adff8e0432a name:Capcom's Gold Medal Challenge '92 (USA) cheat description:Massive run power code:f6d2/f9/a9+f6d3/f0/50+f6d4/f6/ea cartridge sha256:6d694349435603c0dcd7645081b0761e109f3994b30f9d822586c991d93510d8 name:Captain America and the Avengers (USA) cheat description:Infinite life - Captain America and Hawkeye, 1P mode code:b87f/99/b9 cheat description:Infinite continues code:b75b/c6/a5 cheat description:Large power stones worth 20 points code:a37d/0a/14 cheat description:Large power stones worth 30 points code:a37d/0a/1e cheat description:Large power stones worth 50 points code:a37d/0a/32 cheat description:Small power stones worth 10 points code:a335/01/0a cheat description:Hawkeye shoots arrows faster code:98b3/1b/5b cheat description:Faster Captain America and Hawkeye - one direction only code:a27e/ff/fe+a280/01/02 cheat description:Even faster Captain America and Hawkeye - one direction only code:a27e/ff/fd+a280/01/03 cheat description:Ininite life - Captain America, 1P mode code:03d9/0f cheat description:Infinite life - Hawkeye, 1P mode code:03da/0f cheat description:Have 99 Red Gems - Captain America, 1P mode code:03dd/63 cheat description:Have 99 Red Gems - Hawkeye, 1P mode code:03de/63 cartridge sha256:935aa637ca8fb0ec4e0f3f09881c46c134b9a5821707e35899d8a7eedb17c6c3 name:Captain Comic - The Adventure (USA) (Unl) cheat description:Invincibility code:ec00/ad cheat description:Infinite energy code:ec06/bd cheat description:Infinite lives code:e702/ad cheat description:Max blast level code:0316/09 cheat description:Infinite blast meter code:0318/80 cheat description:Have Door Key code:05aa/01 cheat description:Have Corkscrew code:05ab/01 cheat description:Have Power Boots code:05ac/01 cheat description:Have Teleport Wand code:05b3/01 cheat description:Have Lantern code:05b4/01 cheat description:Have Mystical Gems of Lascorbanos code:05b5/01 cheat description:Have Coins of Tenure code:05b6/01 cheat description:Have Crown of the Ages code:05b7/01 cartridge sha256:41dd396fbd9b0883b4222b6fbdae09d0e3894eb015e965a0d228f21edd98ad8c name:Captain Planet and the Planeteers (USA) cheat description:Invincibility code:cb7f/8d/ad cheat description:Infinite lives (alt) code:b6f7/ce/cd cheat description:Infinite lives, outside levels code:b6f7/ce/ad cheat description:Infinite lives, inside levels code:b65c/ce/ad cheat description:Infinite power, outside levels code:a27c/ce/ad+a469/ce/ad cheat description:Infinite power, inside levels code:aba8/ce/ad+b40c/ce/ad cheat description:Start with 2 lives instead of 5, outside levels code:e4fd/04/01 cheat description:Start with 10 lives, outside levels code:e4fd/04/09 cheat description:Start with 10 lives, inside levels code:e605/04/09 cheat description:Start with 2 lives, inside levels code:e605/04/01 cheat description:Start inside level 1 instead of outside. code:e078/2c/00 cartridge sha256:da7886920245b1342185ed5fb963798dc38f96e8c5186b9c23446ef68c58a248 name:Captain Skyhawk (USA) (Rev A) cheat description:Infinite lives code:8445/c6/a9 cheat description:Infinite lives (alt) code:8445/c6/c5 cheat description:Infinite Maverick missiles code:9a23/c6/a9 cheat description:Infinite Hawk Bombs code:9cc6/c6/a9 cheat description:Double cost of Hawk Bombs code:acfc/02/04 cheat description:Double cost of Phoenix missiles code:ad24/02/04 cheat description:Double cost of Maverick missiles code:ad10/05/0a cheat description:Start with half Hawk Bombs code:d5d6/06/03 cheat description:Start with 20 Hawk Bombs code:d5d6/06/14 cheat description:Start with 8 Phoenix and Maverick missiles code:d5da/02/08 cheat description:Start with 1 life code:d5b6/05/01 cheat description:Start with 10 lives code:d5b6/05/0a cartridge sha256:141cda262aad72971c00dd9a9655f32cee03e259d371bd8937a864e3300e9e58 name:Captain Skyhawk (USA) cheat description:Invincibility (PRG0) code:9d9e/f0/d0 cheat description:Infinite lives code:8445/c6/a9 cheat description:Infinite lives (alt) code:8445/c6/c5 cheat description:Infinite Maverick missiles code:9a23/c6/a9 cheat description:Infinite Hawk Bombs code:9cc6/c6/a9 cheat description:Double cost of Hawk Bombs code:acfc/02/04 cheat description:Double cost of Phoenix missiles code:ad24/02/04 cheat description:Double cost of Maverick missiles code:ad10/05/0a cheat description:Start with half Hawk Bombs code:d5d6/06/03 cheat description:Start with 20 Hawk Bombs code:d5d6/06/14 cheat description:Start with 8 Phoenix and Maverick missiles code:d5da/02/08 cheat description:Start with 1 life code:d5b6/05/01 cheat description:Start with 10 lives code:d5b6/05/0a cartridge sha256:f76f1779454a8a98168c2c26bc79058161cbaefb3006c8e6aa8c63d301a66f4f name:Casino Kid (USA) cheat description:Always win hand in Blackjack code:86c9/d0/a9 cheat description:Always win hand in Poker code:9c1b/4c/ad cheat description:Can always bet all money in Blackjack code:859d/90/a9 cheat description:Can always bet all money in Poker code:8a64/68/86 cartridge sha256:87e479b14421fc4b56553937dc817789ebfb2987b0724c6790705f0361a955a7 name:Casino Kid II (USA) cheat description:Can't double down in blackjack (game will say you do not have enough money) code:8c15/05/09 cheat description:Can't split in blackjack (game will say you do not have enough money) code:8d46/05/09 cheat description:Start new game with $82 instead of $200 code:c14f/4e/20 cheat description:Start new game with $512 code:c14f/4e/c8 cheat description:Start new game with $21,171 code:c154/00/20 cheat description:Start new game with $131,272 code:c154/00/c8 cheat description:Start new game with $1,342,377 code:c159/00/08 cheat description:Start new game with $5,368,909 code:c159/00/20 cartridge sha256:98ba2353111a0b2cf557b03d8b8c4f5c15d7be56e47182536d710913d62582fa name:Castelian (USA) cheat description:Invincibility code:edc0/85/a5 cheat description:Infinite lives code:c31a/d6/b5 cheat description:Infinite lives (alt) code:c31a/d6/d5 cheat description:Infinite time code:a07f/c6/a5 cheat description:Start with 1 life code:c1e7/03/01 cheat description:Start with 6 lives code:c1e7/03/06 cheat description:Start with 9 lives code:c1e7/03/09 cheat description:Start with 5 continues code:c216/02/05 cheat description:Start with 8 continues code:c216/02/08 cartridge sha256:3668454e1904ada7f80ec2f94c4c2d45272d8a8c9e8d3b78ceebae5f890eb164 name:Castle of Deceit (USA) (Unl) cheat description:Infinite energy code:dbf1/ce/ad cheat description:Infinite lives code:d51f/ce/ad cartridge sha256:6887230077d8eefa311d313672c31e7497211e21c5df78aa8d2030ea72471108 name:Castle of Dragon (USA) cheat description:Infinite health code:bf95/00/7f cheat description:Super health code:c02b/04/ff cheat description:No harm from most enemy attacks code:bf6d/ce/ad cheat description:Stop Skeletons from fighting code:9be3/10/01 cheat description:Faster fighting code:c297/01/04 cheat description:Super strong enemies code:bf51/1b/12 cheat description:Start with Knives code:c023/00/02 cheat description:Start with Knives and Mace code:c023/00/03 cheat description:Start with Armor code:c023/00/80 cheat description:Start with Armor, Knives and Mace code:c023/00/83 cartridge sha256:9abebd837287a38ab64153ff662b3bd79ebc8e55b07c2fc2fef8c15244517576 name:Castlequest (USA) cheat description:Invincibility code:8dba/8d/ad cheat description:Infinite lives code:8dc6/c6/a5 cheat description:Infinite keys code:a658/f0/60 cheat description:75 lives instead of 50 code:a2b6/32/4b cheat description:25 lives instead of 50 code:a2b6/32/19 cheat description:Don't lose life from 'reset' or 'back' options code:fbcc/c6/a5 cheat description:Use sword (press 'B') as long as you like code:831d/ce/ad cheat description:Now you can move while using sword code:8492/07/a2 cheat description:Must use with the last code for permanent sword-wielding ability code:8308/17/05 cheat description:Supercharged speed-up code:852c/02/04+853c/02/04 cheat description:Turbo fuel-injected 16-valve speed-up code:852c/02/08+853c/02/08 cartridge sha256:7eba1637cd2fdbc4f0732eb5249e32d827dbdadbd7e165f961440af4310880dc name:Castlevania (USA) (Rev A) cheat description:Invincibility code:e6d2/a5/c5 cheat description:Invincibility after one hit code:e8fa/c6/a6 cheat description:Infinite health code:e75b/85/ad cheat description:Infinite lives code:c2f3/c6/a9 cheat description:Infinite time code:a0af/20/ad cheat description:Infinite hearts code:da58/84/a4+da8b/84/a4 cheat description:Keep weapons after dying code:c317/8d/2c cheat description:Gain triple shot on weapon pick-up code:e7b0/00/02 cheat description:Don't get knocked back when hit code:971b/8f cheat description:Jump 3x as high code:9b90/c5 cheat description:Jump 2x as high code:9b90/e0 cheat description:Multi-jump code:941d/8d/a9+941e/43/01+941f/01/8d+9420/ee/6c+9421/6c/04+9422/04/4a+94ca/ad/20+94cb/14/01+94cc/05/94+9792/90/60+948c/e5/8e+948d/a1/94 cheat description:Start with 40 hearts code:c991/05/28 cheat description:Start with 80 hearts code:c991/05/50 cheat description:Start with 1 life code:c97a/04/01+c875/04/01 cheat description:Start with 8 lives code:c97a/04/08+c875/04/08 cheat description:Start on last level code:b990/8e/ae+b988/03/09+b98d/00/12 cheat description:Invincibility (blinking) code:005b/02 cheat description:Infinite health (alt) code:0045/40 cheat description:Infinite lives (alt) code:002a/63 cheat description:Infinite hearts (alt) (disable at end of stage) code:0071/63 cheat description:Bosses have no health code:01a9/00 cheat description:Have the Axe code:015b/0d cheat description:Have the Cross code:015b/09 cheat description:Have the Holy Water code:015b/0b cheat description:Have the Knife code:015b/08 cheat description:Have the Stopwatch code:015b/0f cheat description:Have the best whip code:0070/02 cartridge sha256:a35e846379ff252594ace83da2a1a1cb0692717b931055d1f6603812f18ad5cd name:Castlevania (USA) cheat description:Infinite time code:a0af/20/ad cheat description:Hit anywhere (Whip) code:e51b/ce/00+e52b/be/00 cheat description:Jump 3x as high code:9b90/c5 cheat description:Jump 2x as high code:9b90/e0 cheat description:Multi-jump code:941d/8d/a9+941e/43/01+941f/01/8d+9420/ee/6c+9421/6c/04+9422/04/4a+94ca/ad/20+94cb/14/01+94cc/05/94+9792/90/60+948c/e5/8e+948d/a1/94 cheat description:Keep sub-weapon after dying code:c2c8/8d/ad cheat description:Walk through walls code:9f49/4d cheat description:Start on last level code:b990/8e/ae+b988/03/09+b98d/00/12 cheat description:Invincibility (blinking) code:005b/02 cheat description:Infinite health code:0045/40 cheat description:Infinite lives code:002a/63 cheat description:Infinite hearts code:0071/63 cheat description:Bosses have no health code:01a9/00 cheat description:Have the Axe code:015b/0d cheat description:Have the Cross code:015b/09 cheat description:Have the Holy Water code:015b/0b cheat description:Have the Knife code:015b/08 cheat description:Have the Stopwatch code:015b/0f cheat description:Have the best whip code:0070/02 cartridge sha256:9575ec31c1c658fd6b77ae1d69e4861ecada8570e4eebf51409941486e4b4ef4 name:Castlevania II - Simon's Quest (USA) cheat description:Invincibility code:864b/f0/d0 cheat description:Invincibility (enemies die on contact) code:8735/de/23+8736/87/89 cheat description:Invincibility against water code:80bb/e7/e0+fee3/ff/4c+fee5/ff/c4+fee4/ff/f4+fee2/ff/01+fee1/ff/8b+80bc/c0/fe+fee0/ff/ce cheat description:Invincibility against poisonous swamps and spikes code:8045/d0/50 cheat description:Infinite health code:d35f/85/a5 cheat description:Infinite lives code:c294/c6/24 cheat description:Infinite Laurels code:d921/c6/05 cheat description:Infinite Laurel time code:8199/ce/ad cheat description:Infinite Garlic code:d935/c6/a5 cheat description:Stops time (always daytime) code:d79b/85/a5 cheat description:One hit kills code:8926/40/00 cheat description:Hit anywhere - whip code:8917/47/00+891c/54/00+88fd/61/00 cheat description:Hit anywhere - sub-weapons code:8a09/30/b0+8a27/30/b0 cheat description:Small hearts worth 100 code:8762/84 cheat description:Enemies always drop large Hearts code:82a9/d0/b0+82ae/bd/ad+82b0/04/fa cheat description:Can use sub-weapons regardless of Heart count code:d876/b0/f0 cheat description:Multi-jump code:89d9/10/80+89da/13/d0+89db/a0/0c+89dd/20/4c+89df/86/89+89d8/03/29+89d7/6c/f5+89d6/ad/a5+89e9/00/fb+89de/ed/ee+89dc/f0/ea cheat description:Jump higher (4 1/3 blocks) code:89ef/38/20 cheat description:Buy a White Crystal and receive the Red Crystal and all of Dracula's Relics code:ee29/20/ff cheat description:Buy Thorn Whip and receive the Flame Whip (do not buy any other whips) code:edf3/07/04 cheat description:Whip much faster code:dc11/f0/d0 cheat description:Diamond can destroy any block code:da12/18/a7+da13/c1/da+d691/8e/ea cheat description:Whip can destroy any block code:d639/00+d628/00+d65d/10+d691/ea cheat description:Whip destroys all enemies/townspeople on screen code:88d8/75 cheat description:Towns never sleep (can enter doors) code:87af/11/00+814f/d0/f0 cheat description:Ponds open instantly without needing a Crystal code:cd70/d0/f0 cheat description:Faster dialog text code:ee98/f0/d0 cheat description:Walk faster code:8770/ff/fe+8910/ff/fe+891b/01/02+8756/01/02 cheat description:Always get the best ending code:a17e/a5/85 cheat description:Start with 100 Experience (E) code:f12c/09 cheat description:Start with more health code:c55e/30/50 cheat description:Start with 25 hearts code:c55a/50/25 cheat description:Start with 75 hearts code:c55a/50/75 cheat description:Start with 1 life code:c553/03/01 cheat description:Start with 6 lives code:c553/03/06 cheat description:Start with 9 lives code:c553/03/09 cheat description:Invincibility (alt 2) code:04f8/02 cheat description:Infinite health (alt) code:0080/50 cheat description:Infinite lives (alt) code:0031/03 cheat description:Infinite hearts code:0048/f0 cheat description:Infinite Laurels (alt) code:004c/99 cheat description:Infinite Garlic on pick-up code:004d/08 cheat description:Stops time (time set to 12:02) code:0085/02 cheat description:Have all Daggers, Holy Water, Diamond, Flame and Oak Stake code:004a/7f cheat description:Have White Crystal code:0091/20 cheat description:Have all Dracula's parts and White Crystal code:0091/3f cheat description:Have Blue Crystal code:0091/40 cheat description:Have all Dracula's parts and Blue Crystal code:0091/5f cheat description:Have Red Crystal code:0091/60 cheat description:Have all Dracula's parts and Red Crystal code:0091/7f cheat description:Have Garlic, Laurels, Silk Bag and Magic Cross code:0092/0f cheat description:Have Fire Whip code:0434/04 cartridge sha256:6e8d289635ac39479ff1d36733aa3f8b9650593ab972cedb8e2cdbfc03aaa739 name:Castlevania III - Dracula's Curse (USA) cheat description:Invincibility (disable if you cannot enter a door) code:8112/f0/d0 cheat description:Invincibility (disable if you cannot enter a door) (alt) code:b241/85/a5 cheat description:Infinite health code:828a/85/a9 cheat description:Infinite lives code:8993/85/a9 cheat description:Infinite hearts code:ba03/90/91 cheat description:Hit anywhere (Whip) code:b287/18/00 cheat description:High jump code:9633/09/03 cheat description:Multi-jump code:8be0/10/60+985c/65/d8+9854/b0/90+985f/26/05+985a/0c/05+9861/08/05+9859/d0/a9+97d5/4f/51+93e7/4f/51+985b/ad/8d+9856/ad/8d+9851/04/a5+9831/85/a5+9852/c9/26+9853/08/0a cheat description:No knock-back when hurt code:823c/8d/60 cheat description:Walk twice as fast to the left code:9728/ff/fe cheat description:Walk twice as fast to the right code:96ec/01/02 cheat description:Start with 9500 seconds code:b33f/01 cheat description:Start each stage with 99 hearts code:90c1/05/99 cheat description:Invincibility (blinking) (disable if you cannot enter a door) code:0080/02 cheat description:Remove invincibility blinking code:001a/00 cheat description:Infinite health (alt) code:003c/40 cheat description:Infinite lives (alt) code:0035/99 cheat description:Infinite hearts (alt) code:0084/99 cheat description:Alucard has best attack code:008f/02 cheat description:Trevor Belmont has best Whip code:008e/02 cheat description:Enable Sypha code:003a/01 cheat description:Enable Grant code:003a/02 cheat description:Enable Alucard code:003a/03 cheat description:Have Triple Shot (III) code:0087/02 cheat description:Trevor Belmont's sub-weapon - Axe code:0085/01 cheat description:Trevor Belmont's sub-weapon - Clock code:0085/0b cheat description:Trevor Belmont's sub-weapon - Cross code:0085/02 cheat description:Trevor Belmont's sub-weapon - Dagger code:0085/03 cheat description:Trevor Belmont's sub-weapon - Holy Water code:0085/04 cheat description:Sypha Belnades' sub-weapon - Fire Spell code:0086/05 cheat description:Sypha Belnades' sub-weapon - Ice Spell code:0086/06 cheat description:Sypha Belnades' sub-weapon - Lightning Spell code:0086/07 cheat description:Grant Danasty's sub-weapon - Dagger code:0086/08 cheat description:Grant Danasty's sub-weapon - Axe code:0086/09 cheat description:Grant Danasty's sub-weapon - Clock code:0086/0b cheat description:Start on stage 2 (glitchy if you die) code:0032/01 cheat description:Start on stage 3 (glitchy if you die) code:0032/02 cheat description:Start on stage 4 (glitchy if you die) code:0032/03 cheat description:Start on stage 5 (glitchy if you die) code:0032/04 cheat description:Start on stage 6 (glitchy if you die) code:0032/05 cheat description:Start on stage 7 (glitchy if you die) code:0032/06 cheat description:Start on stage 8 (glitchy if you die) code:0032/07 cheat description:Start on stage 9 (glitchy if you die) code:0032/08 cheat description:Start on stage 10 (glitchy if you die) code:0032/09 cheat description:Start on stage 11 (glitchy if you die) code:0032/0a cheat description:Start on stage 12 (glitchy if you die) code:0032/0b cheat description:Start on stage 13 (glitchy if you die) code:0032/0c cheat description:Start on stage 14 (glitchy if you die) code:0032/0d cheat description:Start on stage 15 (glitchy if you die) code:0032/0e cartridge sha256:52451a89296cfcb006beb6363ddc8486fcc88154338cbec778a846056c522f50 name:Cat Ninden Teyandee (Japan) cheat description:Infinite health code:003f/0b cheat description:Infinite magic energy code:0040/ff cartridge sha256:c20a8cc1b2dacb8a45e706b5763ac6c82c17b4ee4fb547ba4a853e4aabd6e35c name:Challenge of the Dragon (USA) (Unl) cheat description:Infinite health code:e252/9d/ad cheat description:Infinite lives code:e49a/99/b9 cheat description:Always have Bombs code:eca6/d0/50 cartridge sha256:7f4b9307e228c737b5f6e4ef3efb40438aa2024b95b29f9aabf18a15af6ed185 name:Challenge of the Dragon (Asia) (PAL) (Unl) cheat description:Invincibility code:a079/f0/60 cheat description:Infinite health code:a120/c6/a5 cheat description:Infinite lives code:8f1a/c6/a9 cartridge sha256:d5b039637a2315458f71ec57a287f93b3532e6243b712b55767f07dc83c5a3c9 name:Championship Pool (USA) cheat description:1 foul loses the game (instead of 3) - only in 10-ball in party mode code:b01f/03/01 cheat description:2 fouls in a row loses the game - only on 9 and 10-ball in party mode code:b01f/03/02 cheat description:Fouls don't count - only on 9 and 10-ball and rotation in party mode code:ba7c/9d/bd cheat description:Number of fouls is not cleared after a good shot (3 fouls don't have to be in a row to lose) - only on 10-ball in party mode code:ba92/9d/bd cheat description:Always break in 9 or 10-ball - P1 code:806e/a5/a9+806f/ed/00 cheat description:Always break in 9 or 10-ball - P2 code:806e/a5/a9+806f/ed/01 cartridge sha256:a8f18eb52126cdf3d004877f8c4c315ddf15f823f13f42b0154da17db21ecddd name:Championship Rally (Europe) cheat description:Drive a short distance to finish lap code:cb5d/20/00 cartridge sha256:ebdd748cd488c4acdc5d2c7321de692c1ab0b37044cf0c6ea043457176dbd306 name:Cheetahmen II (USA) (Unl) cheat description:Infinite health - level 1 and 2 code:a3bc/ce/ad cheat description:Infinite health - level 3 code:a3dc/ce/ad cheat description:Infinite health - level 4 code:a384/ce/ad cheat description:Infinite lives - level 1 and 2 code:b378/ce/ad cheat description:Infinite lives - level 3 code:b30f/ce/ad cheat description:Infinite lives - level 4 code:b2ad/ce/ad cartridge sha256:b705f866955c7d19292b55a9b0f3ec0e970e3f2509c3da15708b7afd879d98ed name:Chessmaster, The (USA) cheat description:Move pieces anywhere code:cb6f/56/00+cb73/85/a5+cb78/85/a5 cartridge sha256:e84d90fefb92f2b6ab70e35bfb990978c7e384e357ec6b995c3880bff4c5b460 name:Chip 'n Dale - Rescue Rangers (USA) cheat description:Infinite health code:d086/f8/18 cheat description:Multi-jump code:cc45/01/00+c9a8/0a/a5 cheat description:Freeze mechanical bulldog code:8f38/bd/60 cheat description:Freeze mechanical mice code:8fc6/bd/60 cheat description:Freeze buzzer code:9096/bd/60 cheat description:Freeze buzz bomb code:94fb/bd/60 cheat description:Freeze racket-rod code:95e2/bd/60 cheat description:Freeze ditz code:945f/bd/60 cheat description:Freeze hawk bomber code:9750/bd/60 cheat description:Freeze bouncing boxes code:9be9/bd/60 cheat description:Mega-jump code:c9af/06/0a cheat description:Never get stunned code:d005/de/04 cheat description:Press Start to finish the level code:c78d/98/6d cartridge sha256:afa359b53e90781ed3810642c09f7cb22f0ba21c40142649771bfb21a897b4d3 name:Chip 'n Dale - Rescue Rangers 2 (USA) cheat description:Invincibility (glitchy) code:aa20/f0/d0 cheat description:Infinite health code:b0a3/de/dd cheat description:Infinite health - both players code:b0a3/de/b9 cheat description:Infinite lives - both players code:aec4/d6/a7 cheat description:Almost infinite lives - both players code:aec4/d6/24 cheat description:Infinite credits code:f5bc/c6/a9 cheat description:Never get stunned code:acaa/d6/ea cheat description:Start with 1 life - both players code:f5b5/03/01 cheat description:Start with 2 lives - both players code:f5b5/03/02 cheat description:Start with 4 lives - both players code:f5b5/03/04 cheat description:Start with 5 lives - both players code:f5b5/03/05 cheat description:Start with 1 heart - both players code:f592/03/01 cheat description:Start with 2 hearts - both players code:f592/03/02 cheat description:Start with 4 hearts - both players code:f592/03/04 cheat description:Start with 5 hearts - both players code:f592/03/05 cheat description:Start with 1 credit code:f578/03/01 cheat description:Start with 2 credits code:f578/03/02 cheat description:Start with 6 credits code:f578/03/06 cheat description:Start with 9 credits code:f578/03/09 cheat description:Start with 255 credits (ignore the counter) code:f578/03/ff cartridge sha256:21a7f7a5a043ddc2017cd97b4088156b0d728271455966ab6748a79eddd3410e name:Chubby Cherub (USA) cheat description:Infinite lives code:8207/c6/a5 cheat description:Infinite power code:a70d/85/a5 cheat description:Half regular power gained from food code:8ee4/08/04 cheat description:Slow down power loss on the ground code:a6f8/02/01 cheat description:Slow down power loss in the air code:a6fe/09/03 cheat description:Infinite Gau (shots) code:8d7e/eb/02 cheat description:Double Gau (shots) on candy pick-up code:a859/04/08 cheat description:Start with 1 life code:8290/02/00 cheat description:Start with double lives code:8290/02/05 cheat description:Start with triple lives code:8290/02/08 cheat description:Start on Stage 5 code:8293/01/05+8291/00/04 cheat description:Start on Stage 10 code:8293/01/0a+8291/00/09 cartridge sha256:fa701601d39819ef26821d05350ccb793cc606191e03c06203a4274b434dfaeb name:Circus Caper (USA) cheat description:Invincibility in normal levels code:f479/03/f5+f478/52/0e+f477/ad/20 cheat description:Infinite power (health) code:f501/8d/2c cheat description:Infinite power (health) (alt) code:f501/8d/ad cheat description:Full energy from food code:e85f/02/00 cheat description:Start with lots of weapons code:eb97/00/ff cheat description:Start on stage 2 (starts on stage 1 after continuing) code:c0e4/01/02 cheat description:Start on stage 3 (starts on stage 1 after continuing) code:c0e4/01/03 cheat description:Start on stage 4 (starts on stage 1 after continuing) code:c0e4/01/04 cheat description:Start on stage 5 (starts on stage 1 after continuing) code:c0e4/01/05 cheat description:Start on stage 6 (starts on stage 1 after continuing) code:c0e4/01/06 cheat description:Infinite power (health) (alt 2) code:0392/7a cartridge sha256:590535e8cda84cb4054425539bc320c16307f141d688b57f258a162dedc8888f name:City Connection (USA) cheat description:Infinite lives code:d17e/c6/a5 cheat description:Infinite Oil code:94c2/c6/a5 cheat description:Start with double lives code:85cf/02/05 cheat description:Start with triple lives code:85cf/02/08 cheat description:Start with extra Oil code:85d1/05/20 cheat description:Start on level 1 code:85cd/00/01 cheat description:Start on level 2 code:85cd/00/02 cheat description:Start on level 3 code:85cd/00/03 cheat description:Start on level 4 code:85cd/00/04 cheat description:Start on level 5 code:85cd/00/05 cheat description:Infinite lives - both players code:00a2/09 cheat description:Infinite Oil - both players code:00a4/63 cheat description:MI is very high code:00a5/ff cartridge sha256:cf226f0d9486103bbaa19ee124b673d47aa2b3766334b6b7587d704c03e6649e name:Clash at Demonhead (USA) cheat description:Invincibility code:9293/d0/f0+90d1/f0/d0 cheat description:Infinite health code:c502/85/a5 cheat description:Infinite barrier hits code:adf4/ce/ad cheat description:Infinite supply of all items bought code:a5c4/de/ad cheat description:Don't die when power hits zero code:b15b/ee/ae cheat description:All items in shop are free code:c4b0/e5/60 cheat description:Start with 1 of each item code:cbf7/9d/fe cheat description:Start with extra cash code:cc34/f4/06+cc36/9a/9b cheat description:Start with 50% power code:cc0e/10/08+a9e7/10/08+cc12/04/02 cheat description:Start with 150% power code:cc0e/10/18+cc12/04/06+a9e7/10/18 cheat description:Start with 200% power code:cc0e/10/20+cc12/04/08+a9e7/10/20 cheat description:Infinite health (alt) code:009f/10 cartridge sha256:79969ab6741823e5560794489d5b20a677a1207c06265855e5d7b633e6fef29a name:Cliffhanger (USA) cheat description:Protection from most hits code:9c61/ce/ad cheat description:Infinite lives code:cd8c/ce/ad cheat description:Infinite continues code:ef15/76/bb cheat description:Don't burn money at campfire code:9af2/9d/bd cheat description:Some bags contain mega-money, some contain no money code:cafc/18/17 cheat description:Start with 2 lives code:cc56/03/01 cheat description:Start with 6 lives code:cc56/03/05 cheat description:Start with 8 lives code:cc56/03/07 cheat description:Start with 10 lives code:cc56/03/09 cheat description:Start with 1 continue code:cc43/03/01 cheat description:Start with 5 continues code:cc43/03/05 cheat description:Start with 7 continues code:cc43/03/07 cheat description:Start with 9 continues code:cc43/03/09 cheat description:Start with 2x health (does not show on meter) code:cc9f/10/20 cheat description:Start with 1/2 health code:cc9f/10/08 cheat description:Start with $100 code:cc6e/8d/ee cheat description:Start with $10,000 code:cc6b/8d/ee cheat description:Start with $650,000 (displays $xx0000 until you pick up first money bag) code:cc6b/8d/ce cheat description:Infinite health code:0405/10 cheat description:Infinite lives (alt) code:0406/03 cartridge sha256:ed0a1a5ca7cf404116d0073e8ccd213a082d2ac50132f54f3c8621f3dbcdb248 name:Clu Clu Land (World) cheat description:Infinite lives - both players code:d3b3/24 cheat description:Infinite time code:cb15/24 cheat description:Increase extra time code:d3f4/06 cheat description:Shoot more rays code:dae5/02/05 cheat description:Shoot shorter rays code:dae9/20/10 cheat description:Shoot longer rays code:dae9/20/50 cheat description:Enemy can go thru gold bars code:d750/04/00 cheat description:Start with 1 life - both players code:c34c/01 cheat description:Start with 10 lives - both players code:c34c/10 cheat description:Start with 1 life - P2 code:c359/85/e6 cartridge sha256:711eee6690af76a59321f49c8dbfec39eef702775e6cc2a1e63553b40fa3aa5f name:Cobra Command (USA) cheat description:Immune to weapon damage code:dc5f/e5/24 cheat description:Start with infinite lives code:81b0/ce/ad cheat description:Start with 1 life code:e23c/04/00 cheat description:Start with 9 lives code:e23c/04/08 cheat description:Start with Infinite lives (alt) code:05bb/09 cheat description:Start with Dual Gun code:05a5/01 cheat description:Start with ATG code:05a5/02 cheat description:Start with Rapid Fire code:05a5/03 cheat description:Start with 3-Way Gun code:05a5/04 cheat description:Start with Twin Missiles code:05a6/01 cheat description:Start with Homing Missiles code:05a6/02 cheat description:Start with Homing Missiles 1 code:05a6/03 cheat description:Start with Homing Missiles 2 code:05a6/04 cheat description:Start with Firebomb code:05a6/05 cheat description:Start with Mines code:05a6/06 cheat description:Start with Armor code:05a7/01 cheat description:Start with Super Armor code:05a7/02 cheat description:Start with Hyper Armor code:05a7/03 cheat description:Start with Turbo Engine code:05a8/01 cheat description:Start with Super Engine code:05a8/02 cheat description:Start with Hyper Engine code:05a8/03 cheat description:Start with Rope code:05a9/00 cheat description:Start with Ladder code:05a9/01 cartridge sha256:db26936868427b5b01b7823a781ec09ed15bb5dd06945bba0147ffb12215234b name:Cobra Triangle (USA) cheat description:Invincibility code:ab6c/d0/60 cheat description:Infinite continue options code:a63a/ce/ad cheat description:Don't lose life after dying from damage code:e90f/ce/ad cheat description:Don't lose life after dying from time running out code:e965/ce/ad cheat description:Never lose your power-ups code:e6a1/8d/f0+e6a2/28/0b cheat description:Hit anywhere code:b421/b0/d0+acc2/b0/d0+b432/97/9c+ad49/99/b9+b422/12/0e+acc3/1a/17 cheat description:Gain an extra minute code:83a8/8d/ee+83a9/15/13 cheat description:Invincibility (blinking) code:00b9/1a cheat description:Infinite health code:05f5/0c cheat description:Infinite lives code:0738/09 cheat description:Infinite time (disable before finishing a level) code:0714/05 cheat description:Boss HP will be at minimum code:05ff/00 cheat description:Max Missile power code:072c/03 cheat description:Max Speed code:072b/03 cheat description:One 1 mine needed for mine removing stages code:00a3/00 cheat description:Start on stage 2 (disable after stage begins) code:0702/02+0737/01 cheat description:Start on stage 3 (disable after stage begins) code:0702/03+0737/02 cheat description:Start on stage 4 (disable after stage begins) code:0702/04+0737/03 cheat description:Start on stage 5 (disable after stage begins) code:0702/05+0737/04 cheat description:Start on stage 6 (disable after stage begins) code:0702/06+0737/05 cheat description:Start on stage 7 (disable after stage begins) code:0702/07+0737/06 cheat description:Start on stage 8 (disable after stage begins) code:0702/08+0737/07 cheat description:Start on stage 9 (disable after stage begins) code:0702/09+0737/08 cheat description:Start on stage 10 (disable after stage begins) code:0702/0a+0737/09 cheat description:Start on stage 11 (disable after stage begins) code:0702/0b+0737/0a cheat description:Start on stage 12 (disable after stage begins) code:0702/0c+0737/0b cheat description:Start on stage 13 (disable after stage begins) code:0702/0d+0737/0c cheat description:Start on stage 14 (disable after stage begins) code:0702/0e+0737/0d cheat description:Start on stage 15 (disable after stage begins) code:0702/0f+0737/0e cheat description:Start on stage 16 (disable after stage begins) code:0702/10+0737/0f cheat description:Start on stage 17 (disable after stage begins) code:0702/11+0737/10 cheat description:Start on stage 18 (disable after stage begins) code:0702/12+0737/11 cheat description:Start on stage 19 (disable after stage begins) code:0702/13+0737/12 cheat description:Start on stage 20 (disable after stage begins) code:0702/14+0737/13 cheat description:Start on stage 21 (disable after stage begins) code:0702/15+0737/14 cheat description:Start on stage 22 (disable after stage begins) code:0702/16+0737/15 cheat description:Start on stage 23 (disable after stage begins) code:0702/17+0737/16 cheat description:Start on stage 24 (disable after stage begins) code:0702/18+0737/17 cheat description:Start on stage 25 (disable after stage begins) code:0702/19+0737/18 cartridge sha256:2be0bd6e64cf2cb47c7b4a2d6bdb5fd4ff9ed1cd5eb6eadb4d56c410c659bdc5 name:Code Name - Viper (USA) cheat description:Invincibility code:d55c/20/ad cheat description:Infinite health code:9966/f9/ed+9a5e/01/00 cheat description:Infinite health (alt) code:996d/8d/ad cheat description:Infinite lives code:ef1c/ce/ad cheat description:Infinite Gun code:a1fa/01/00 cheat description:Infinite Machine Gun code:a21b/01/00 cheat description:Hit anywhere code:d856/38/00+9c1d/03/10+9c20/13/34+9c1c/bd/ad cheat description:Double usual bullets on new life code:ef18/32/64 cheat description:Half bullets on new life code:ef18/32/19 cheat description:Machine Gun with 256 bullets on new life code:ef11/8d/ee cheat description:Upper level jump code:8fce/b9/ad+908f/fa/f9 cheat description:Keep Machine Gun after dying code:ef11/8d/2c+ef0e/8d/2c cheat description:Have Bomb (can exit level without the Bomb) code:d58d/04/00 cheat description:Start with 1 life code:e4f0/03/01 cheat description:Start with 6 lives code:e4f0/03/06 cheat description:Start with 9 lives code:e4f0/03/09 cheat description:Start with Machine Gun and 256 bullets code:e4fc/8d/ee cheat description:Start with double usual bullets code:e503/32/64 cheat description:Start with half usual bullets code:e503/32/19 cheat description:Infinite health (alt) code:06f8/04 cheat description:Infinite lives code:06e8/0a cheat description:Infinite Gun (alt) code:06e0/3f cheat description:Infinite Machine Gun (alt) code:06e2/3f cheat description:Have all children rescued code:06ea/09 cheat description:Have all adults rescued code:06ec/09 cheat description:Have all adults and children rescued code:0757/ff cartridge sha256:47ebed8be6679468d0627065153520a539b292244b51c54263c027e106b6ef65 name:Colorful Dragon (Asia) (PAL) (Unl) cheat description:Invincibility code:9a02/f0/d0 cheat description:Infinite lives code:99bc/d6/b5 cheat description:Start on level 2 code:8037/01/02 cheat description:Start on level 5 code:8037/01/05 cheat description:Start on level 10 code:8037/01/0a cheat description:Start on level 15 code:8037/01/0f cheat description:Start on level 20 code:8037/01/14 cartridge sha256:0512b4aa2220f74e40fe8652b758893fa87efb6c3407808f7dda0e1901017432 name:Commando (USA) cheat description:Invincibility code:d176/85/60 cheat description:Infinite Grenades code:b5b0/ca/ea cheat description:Infinite lives code:c907/ce/a0 cheat description:Infinite lives (alt) code:c907/ce/ad cheat description:Start with 1 life - both players code:c5cd/03/00 cheat description:Start with 6 lives - both players code:c5cd/03/06 cheat description:Start with 9 lives - both players code:c5cd/03/09 cheat description:Start with double rations of grenades code:c5d5/05/10 cheat description:Have all power-ups - both players code:04ab/e9 cheat description:Have rapid fire - both players code:0074/00 cartridge sha256:8ae9b624c08b86f6af41b5d58c328188c6df9c35868ae0763d75a22fbfb6c712 name:Conan (USA) cheat description:Invincibility code:87bf/20/ad+8461/20/ad cheat description:Infinite lives code:dec5/c6/a5+db6b/c6/a5 cheat description:Infinite health code:e9d1/8d/ad cartridge sha256:a5b8e24589539b0b84a6ad98aee9c91eb86eff795162be38b020dc42c3e3eca7 name:Conquest of the Crystal Palace (USA) cheat description:Invincibility code:d1e7/f0/d0+d1e5/a5/85 cheat description:Invincibility (alt) code:e59b/20/ad cheat description:Infinite lives code:e160/20/2c cheat description:Infinite lives (alt) code:e163/85/a5 cheat description:Infinite energy (will display wrong info) code:d1ca/bd/ee cheat description:Infinite energy for Farron code:e5a0/20/ad cheat description:Infinite fire power code:d393/bd cheat description:Maximum energy without Life Crystal code:fa03/0e/14 cheat description:Don't use up money when buying things code:e129/20/2c+e132/20/2c cheat description:Super-jump without Flight Crystal code:d664/02/00+d666/03/01 cheat description:Increase super-jump to mega-jump code:d6bb/0e/15 cheat description:Increase super-jump to super-mega-jump code:d6bb/0e/45 cartridge sha256:62c9d4e0578cb1e615ce9bb2c8ebc15b1e8de4c928c5c07ba9a85c11aa36ae4d name:Contra (Japan) cheat description:Invincibility code:e1fa/20/ad cheat description:Infinite lives code:d939/d6/a5 cartridge sha256:d41e28b1a33b3b6768e7c39c9fdfb1fda4b49940542d14085911fabd399e1ca9 name:Contra (USA) cheat description:Invincibility code:e2c9/20/ad cheat description:Invincibility (blinking) code:d467/b5 cheat description:Invincibility (blinking) (alt) code:d466/05/00 cheat description:Hit anywhere code:e388/90/d0+e3a1/b0/24+e37f/b0/24+e3c7/20/ad cheat description:Multi-jump - both players code:d476/b5/20+d477/b0/9f+d478/f0/d6+d479/08/ea+d480/d6/b5+d9e9/95/b5+d54a/a9/60 cheat description:Jump higher code:d6ef/fc/fb+d6e9/fb/fa cheat description:Run 2x as fast code:d761/ff/fe+d75d/01/02 cheat description:Run 4x as fast code:d75d/01/04+d761/ff/fc cheat description:Keep weapons after losing life code:dad3/2c cheat description:Press Select to change weapons - P1 code:f61a/ff/20+f618/ff/d0+f62f/ff/d0+f623/ff/d0+f61b/ff/f0+f614/ff/f0+f622/ff/04+d042/a4/4c+f616/ff/4c+f62d/ff/4c+f613/ff/25+f612/ff/a4+f615/ff/03+f617/ff/53+f621/ff/c9+f625/ff/a9+f628/ff/01+f627/ff/69+f619/ff/29+f61f/ff/29+f629/ff/85+f62b/ff/a5+f62c/ff/f5+f61d/ff/a5+f61c/ff/0e+f62e/ff/46+d044/d0/f6+f61e/ff/aa+f62a/ff/aa+f620/ff/07+f624/ff/02+d043/25/12 cheat description:Press Start to complete the level code:d04d/25/3b cheat description:Start with infinite lives code:da03/b5 cheat description:Start new life with Machine Gun code:dad2/01 cheat description:Start new life with Fireball code:dad2/02 cheat description:Start new life with Spread Gun code:dad2/03 cheat description:Start new life with Laser code:dad2/04 cheat description:Start on level 2 code:c479/3f/30+c475/00/01 cheat description:Start on level 3 code:c479/3f/30+c475/00/02 cheat description:Start on level 4 code:c479/3f/30+c475/00/03 cheat description:Start on level 5 code:c479/3f/30+c475/00/04 cheat description:Start on level 6 code:c479/3f/30+c475/00/05 cheat description:Start on level 7 code:c479/3f/30+c475/00/06 cheat description:Start on level 8 code:c479/3f/30+c475/00/07 cheat description:Invincibility (star effect) - P1 code:00b0/fe cheat description:Invincibility (star effect) - P2 code:00b1/fe cheat description:Invincibility (blinking) (alt 2) code:00ae/41 cheat description:Have 99 lives code:0032/99 cheat description:Have Machine Gun - P1 code:00aa/01 cheat description:Have Fireball - P1 code:00aa/02 cheat description:Have Spread Gun - P1 code:00aa/03 cheat description:Have Laser - P1 code:00aa/04 cheat description:Have Clone Attack (glitch weapon) - P1 code:00aa/18 cheat description:Have Machine Gun - P2 code:00ab/01 cheat description:Have Fireball - P2 code:00ab/02 cheat description:Have Spread Gun - P2 code:00ab/03 cheat description:Have Laser - P2 code:00ab/04 cheat description:Have Clone Attack (glitch weapon) - P2 code:00ab/18 cartridge sha256:0c190a8a7bfb57d7887e70183560db46fb5336abf569f6a38f5452fa32f1339f name:Contra Force (USA) cheat description:Invincibility code:a5ca/20/ad+a5b1/20/ad cheat description:Infinite lives (alt) code:ac9e/99/b9 cheat description:Infinite lives - all characters code:e07d/01/00 cheat description:Keep weapons after death code:ac8f/99/b9 cheat description:Start with 9 lives - all characters code:f636/03/09 cheat description:Start with 6 lives - all characters code:f636/03/06 cheat description:Start with 1 life - all characters code:f636/03/01 cartridge sha256:22ea833fd9466795bd2b05df96a47081ca45a26f545af1242f4c89b2d6688bdd name:Cool World (USA) cheat description:Infinite lives code:e4be/ce/2c cheat description:Infinite Bombs code:eed1/c6/a5 cheat description:Infinite Erasers code:eeec/c6/a5 cheat description:Lots of Erasers code:af70/00/28 cheat description:Start with 3 Bombs code:b2e4/01/03 cheat description:Start with 6 Bombs code:b2e4/01/06 cheat description:Start with 9 Bombs code:b2e4/01/09 cheat description:Start with 2 lives code:c0c7/02/01+af44/02/01 cheat description:Start with 7 lives code:c0c7/02/06+af44/02/06 cheat description:Start with 10 lives code:c0c7/02/09+af44/02/09 cheat description:Start with 3 Erasers code:c0cc/01/03+af6a/01/03 cheat description:Start with 6 Erasers code:c0cc/01/06+af6a/01/06 cheat description:Start with 9 Erasers code:c0cc/01/09+af6a/01/09 cheat description:Infinite energy code:04e8/00 cartridge sha256:528d501320ed0276bbc542f03c7c05fb59f9eeb540cd0d39e7286b1542aa153a name:Cowboy Kid (USA) cheat description:Infinite lives code:cbf8/99/b9 cheat description:Hit anywhere code:93a0/5e/7c+939d/c9/a9 cheat description:Infinite health code:0698/08 cartridge sha256:23b16928a7615ec599536b17dd2026370e2e1a13835f61276ea383d6b4d3f8c0 name:Crackout (USA) (Proto) cheat description:Infinite lives code:b87a/c6/a5 cartridge sha256:fda4fd839497634df5e77b1842f88c05ffa0ac13a894c9ea288aedcd168489c3 name:Crash 'n' the Boys - Street Challenge (USA) cheat description:Start with 99 Gold code:b5e8/05/99 cheat description:Start with 50 Gold code:b5e8/05/50 cartridge sha256:b504d0ebff8aa6439f1f9606526d8739f5007c1fdac31f9550caa7ca26edce16 name:Crisis Force (Japan) cheat description:Infinite lives code:86fd/d6/b5 cheat description:Infinite Bombs code:861c/de/bd cheat description:Start on stage 2 code:cb14/00/01 cheat description:Start on stage 3 code:cb14/00/02 cheat description:Start on stage 4 code:cb14/00/03 cheat description:Start on stage 5 code:cb14/00/04 cheat description:Start on stage 6 code:cb14/00/05 cheat description:Start on stage 7 code:cb14/00/06 cartridge sha256:7eca4ce264363ab8cc2c9aeb52f2e5be43a72a8223bac977492c7f8d78a49fb4 name:Cross Fire (USA) (Proto) cheat description:Invincibility code:93e8/d0/f0+93e3/f0/d0 cheat description:Infinite energy code:8779/d0/a9+877b/ad/8d cheat description:Infinite lives code:81bf/ce/ad cheat description:Protection from enemies code:fafb/8d/ad+a00b/ce/ad cartridge sha256:5ad644d368f70b61700b74a1d04778888efcbbf98d5435d79f9fcefd23ac39c2 name:Crystalis (USA) cheat description:Always fire charged shot code:9c79/4a/a9+9c7a/4a/01 cheat description:Always fire bracelet charged shot code:9c79/4a/a9+9c7a/4a/03 cheat description:Faster sword charge code:9e10/03/00 cheat description:Allow sword charge while moving code:9e00/4c/ad cheat description:First pupil gives you more gold code:d269/64/ff cheat description:Magic doesn't use up MP code:9afe/8d/ad cheat description:Immune to poison code:ef5e/0f/00 cheat description:Immune to paralysis code:efc5/0f/00 cheat description:Stronger poison code:ef96/04/06 cheat description:Weaker poison code:ef96/04/02 cheat description:Walk through walls code:99cb/06/00 cheat description:Don't get charged for boarding at Inn code:963d/8d/ad+9643/8d/ad cheat description:Don't get charged for items in shops code:99e3/8d/ad+99e9/8d/ad cheat description:Start with some gold code:c993/8d/ee cartridge sha256:e239709320fca149b40a1f04625741dc2b6d3b9cc933d4062882ad762fa67ca7 name:Cyberball (USA) cheat description:Infinite level time code:f4b0/ce/ad cheat description:Start with level time at 1 minute code:93ff/03/01 cheat description:Start with level time at 2 minutes code:93ff/03/02 cheat description:Start with level time at 5 minutes code:93ff/03/05 cheat description:Start with level time at 9 minutes code:93ff/03/09 cheat description:Goals worth 0 points code:802a/02/00 cheat description:Goals worth 1 points code:802a/02/01 cheat description:Goals worth 5 points code:802a/02/05 cheat description:Goals worth 9 points code:802a/02/09 cheat description:Goals worth mega points code:802a/02/63 cartridge sha256:ad1e14d08657d99c8b70f779931f62524b4beb529090b82b368925d8b642e40c name:Cybernoid - The Fighting Machine (USA) cheat description:Infinite Bombs code:9976/ce/ad cheat description:Infinite Genocides code:bd8d/ce/ad cheat description:Infinite Shields code:9d93/ce/ad cheat description:Infinite Seekers code:977b/ce/ad cheat description:20 Genocides on new life code:a192/02/14 cheat description:Keep rear laser after death code:a142/8d/2c cheat description:Keep mace after death code:a148/8d/2c+a145/8d/2c cheat description:Start with rear laser code:8199/00/ff cheat description:Start with infinite lives code:a164/ce/ad cheat description:Start new life with 20 shields code:823e/01/14+a197/01/14 cheat description:Start with 20 seekers and bouncers code:8242/05/14+a19c/05/14 cheat description:Start with double Bombs code:8233/14/28+a18d/14/28 cheat description:Start with 1 life code:8206/ff/f7 cheat description:Start with 5 lives code:8206/ff/fb cheat description:Start with 18 lives code:8206/ff/08 cheat description:Invincibility code:06d4/00 cheat description:Infinite lives code:06d5/ff cartridge sha256:9d832956a533292e740be553e0eb46d3a3d449578bcbaa9c7556a31d2b6a594d name:D.J. Boy (Unl) cheat description:Infinite health code:8662/9d/ad cheat description:Infinite time code:8d1f/85/a5 cheat description:Infinite lives code:f788/c6/a5 cartridge sha256:4cbf1c1d0be227127513065ccbc8ecf5e5ee61a7a58b6dea79ff01f0eb9f26af name:Danny Sullivan's Indy Heat (USA) cheat description:Infinite turbos code:b905/de/ad cheat description:Infinite fuel code:8ee5/9d/ad cheat description:Everything costs how much you have code:b1c6/9d/ed cheat description:Don't take damage in the front code:a2e0/99/b9 cheat description:Start with $255,000 code:933a/64/ff cartridge sha256:9b6d967f493a565e25b51aee044354f857c5cefc41f476d4f259e7368b1fdd70 name:Darkman (USA) cheat description:Infinite health code:cdc3/8d/ad cheat description:Infinite health (alt) code:0496/37+04b5/37 cheat description:Infinite lives code:0497/04 cheat description:Multi-jump code:8746/1d/00+8736/5e/00 cheat description:Hit anywhere - side-scrolling levels code:9c8e/d0/24+9c86/f0/24+9c6c/f0/24 cheat description:Never lose balance code:cb5d/90/60 cartridge sha256:f97f05a4f8747d81dc8adaf07df70d1f87366632ae3e93103d387043ef5ec508 name:Darkwing Duck (USA) cheat description:Invincibility code:813d/d0/f0 cheat description:Infinite health code:f9ed/c9/60 cheat description:Infinite lives code:cb15/ce/2c cheat description:Infinite lives (alt) code:cb15/ce/cd cheat description:Infinite gas (if you avoid the "Go" missions) code:89bb/ad/60 cheat description:More gas on pick-up code:8904/70/75 cheat description:Start with infinite health code:f9f3/8d/ad cheat description:Start with 2 lives code:c95a/73/71 cheat description:Start with 6 lives code:c95a/73/75 cheat description:Start with 9 lives code:c95a/73/78 cartridge sha256:227e789fef94eabcf24a5ec9a3944de58b183bbc7d96140269d1c908f162b853 name:Dash Galaxy in the Alien Asylum (USA) cheat description:Invincibility code:c7b3/ad/ea cheat description:No damage from shots and collisions code:9502/01/00 cheat description:Infinite Oxygen code:9515/ce/ad cheat description:Infinite Bombs in elevator shaft code:da78/ad/ee cheat description:Infinite Bombs in rooms code:daea/ad/ee cheat description:Infinite Detonators in shafts code:da9d/ad/ee cheat description:Infinite Detonators in rooms code:db0f/ad/ee cheat description:Infinite Keys in shafts code:a405/ad/ee cheat description:Infinite Keys in rooms code:a19e/ad/ee cheat description:Can't lose lives in rooms code:9166/ce/ad cheat description:Can't lose lives in elevator shaft code:9133/ce/ad cheat description:Oxygen used up more slowly in shaft code:a158/78/ff cheat description:Oxygen used up more quickly in rooms code:af2d/ff/70 cheat description:Start with 1 life code:90f5/03/01 cheat description:Start with 6 lives code:90f5/03/06 cheat description:Start with 9 lives code:90f5/03/09 cheat description:Start with 99 lives code:90f5/03/63 cheat description:Start on level 5 code:9d01/85/a9+9d02/de/05 cheat description:Start on level 10 code:9d01/85/a9+9d02/de/0a cheat description:Start on level 15 code:9d01/85/a9+9d02/de/0f cheat description:Start on level 20 code:9d01/85/a9+9d02/de/14 cartridge sha256:911fb75ec1f900a5c258635fae79e56520eeb4aec35b40737c44b735eeccdc56 name:David Crane's A Boy and His Blob - Trouble on Blobolonia (USA) cheat description:Invincible (restart if you die underwater and get stuck by being unable to call your Blob) code:c090/a9/60 cheat description:Never take damage from enemies code:9c96/d0/60 cheat description:Infinite lives code:89a9/c6/24 cheat description:Infinite Jellybeans code:c16d/01/00 cheat description:1 life only code:bc37/05/00 cheat description:Double lives code:bc37/05/0a cheat description:Fast play code:808a/20/ad cheat description:Gives 10 Orange Jellybeans code:bd0b/00/10 cheat description:10 Lime Jellybeans code:bcfd/00/10 cheat description:99 Licorice Jellybeans code:bcf1/72/99 cheat description:Double Strawberry Jellybeans code:bcf3/15/30 cheat description:Double Cola Jellybeans code:bcf7/18/36 cheat description:Double Cinnamon Jellybeans code:bcf9/24/48 cheat description:Double Apple Jellybeans code:bcfb/12/24 cheat description:Double Vanilla Jellybeans code:bcff/30/60 cheat description:Double Ketchup Jellybeans code:bd07/06/12 cheat description:Triple Coconut Jellybeans code:bcf5/06/18 cheat description:Triple Rootbeer Jellybeans code:bd03/06/18 cheat description:10 Vitamin A for Vita-Blaster code:bd0d/00/10 cheat description:10 Vitamin B for Vita-Blaster code:bd0f/00/10 cheat description:10 Vitamin C for Vita-Blaster code:bd11/00/10 cheat description:Start with 101 of all starting Jellybeans code:bc22/bd/ad+bc23/f0/77 cartridge sha256:41f949cfedf7167985f779c0782ee17ee83d82e35111c5f22ee5037f54313a06 name:Day Dreamin' Davey (USA) cheat description:Infinite health code:94d2/85/a5 cheat description:Hit anywhere code:b472/4a/00 cheat description:Infinite health (alt) code:0067/ff cheat description:Infinite Small Spears code:0411/99 cheat description:Infinite Long Spears code:0412/99 cheat description:Infinite One Rock code:0413/99 cheat description:Infinite Three Rock code:0414/99 cheat description:Infinite Four Rock code:0415/99 cheat description:Infinite Potions code:041f/99 cheat description:Infinite Red Potions code:0420/99 cheat description:Have Key code:0420/01 cheat description:Have Ring code:0422/01 cheat description:Have Pendant code:0423/01 cheat description:Have Sword code:040e/01 cheat description:Have Long Lance code:040f/01 cheat description:Have Long Sword code:0410/01 cheat description:Walk through walls code:ce42/00+ced9/00+cf64/00+cfe0/00 cartridge sha256:9371fab4f58fa6d6e5211950fdaff2810cccff512fc301e88af9c5b1bf586257 name:Days of Thunder (USA) cheat description:Faster acceleration code:f381/bd/ad cheat description:Tires don't burst code:9a68/ff/00 cheat description:Better left-hand cornering code:9cad/f8/f5 cheat description:Maximum acceleration code:f3bb/03/05+f381/bd/ad cheat description:Start with more fuel code:f34d/9f/ff cheat description:Start with less fuel code:f34d/9f/5f cheat description:Infinite fuel code:021f/ff cheat description:Always 1st place code:0464/01 cheat description:Always excellent condition - front left tire code:046c/00 cheat description:Always excellent condition - front right tire code:046d/00 cheat description:Always excellent conditon - rear left tire code:046e/00 cheat description:Always excellent condition - rear right tire code:046f/00 cheat description:Always excellent condition - engine code:0471/00 cheat description:Max speed code:0473/15 cheat description:Lap 02 code:0463/02 cheat description:Lap 03 code:0463/03 cheat description:Lap 04 code:0463/04 cheat description:Lap 05 code:0463/05 cheat description:Lap 06 code:0463/06 cheat description:Lap 07 code:0463/07 cheat description:Lap 08 code:0463/08 cheat description:Lap 09 code:0463/09 cheat description:Lap 10 code:0463/0a cartridge sha256:0115356b0791cc8ddcb7d3163d6ef7aa664f3ff4e68dba561ffffb79eefcbca9 name:Deadly Towers (USA) cheat description:Invincibility code:99aa/29/a9 cheat description:Infinite HP code:99df/e5/24 cheat description:1 Ludder gives 10 on pick-up code:9fb4/01/0a cheat description:5 Ludder gives 20 on pick-up code:9fb3/05/14 cheat description:Shopkeeper forgets to charge you code:c6b3/f9/2c cheat description:Start with 127 Ludder code:812b/32/7f cheat description:Start with 75 Ludder code:812b/32/4b cheat description:Always max Ludder code:009b/fa cheat description:Max HP code:01b3/ff cheat description:All belts burned (door on the right in the beginning of the game is now open) code:01b4/07 cheat description:Slot 1 - Splendor (game's best sword) code:0176/10 cheat description:Slot 2 - Hyper Helm code:0177/04 cheat description:Slot 3 - Shield Of Kings code:0178/08 cheat description:Slot 4 - Hyper Armor code:0179/0c cheat description:Slot 5 - Hyper Boots code:017a/14 cheat description:Slot 6 - Parallel Shot code:017b/1a cartridge sha256:32aeef6bae170d2628d9c678f0b198a61e787a498a995eb374518635f0b55199 name:Deathbots (USA) (Rev 1) (Unl) cheat description:Infinite energy code:aa71/9d/bd cheat description:Infinite lives code:a0a5/ce/ad cheat description:Infinite shots code:ae30/99/b9 cartridge sha256:5dac8da44ac4e28bebf3d33c8e00e1fdffcc7baee3ff98bec5a10415d1226791 name:Deathbots (USA) (Unl) cheat description:Infinite energy code:aa71/9d/bd cheat description:Infinite lives code:a0a5/ce/ad cheat description:Infinite shots code:ae30/99/b9 cartridge sha256:bf58512dc3bc427d14a6d851445801967cd14f3d02ae236eabceeb7928a55462 name:Defender II (USA) cheat description:Invincibility code:dee1/85/a5 cheat description:Infinite lives code:cfe0/24 cheat description:Infinite Smart Bombs code:d5fc/24 cheat description:Super speed code:e429/07+e3ed/07 cheat description:Start with 1 life code:cfb7/01 cheat description:Start with 6 lives code:cfb7/06 cheat description:Start with 9 lives code:cfb7/09 cartridge sha256:9e31d3d918a352c0c5a81c52efc364253f3fb75cc84151ee904ad078be62d8e1 name:Defender of the Crown (USA) cheat description:Only 10 soldiers in your Garrison code:e368/14/0a cheat description:40 soldiers in your Garrison code:e368/14/28 cheat description:Soldiers for free code:990b/01/00 cheat description:Triple the cost of soldiers code:990b/01/03 cheat description:Halve the cost of knights code:990c/08/04 cheat description:Double the cost of knights code:990c/08/10 cheat description:Halve the cost of catapults code:990d/0f/07 cheat description:Halve the cost of castles code:990e/14/0a cartridge sha256:c408dd19ca49e55173ff2c491868f437d8100671f7b9646ee20e3204e0ba216f name:Demon Sword - Release the Power (USA) cheat description:Invincibility code:8a3b/20/ad cheat description:Infinite health (life) code:c646/85/a5 cheat description:Infinite powers and lives code:e6db/01/00 cheat description:Infinite lives code:d0d7/85/a5 cheat description:Phoenix always rescues you code:e060/ad/ee cheat description:Infinite Fire, Lightning, Power Beams on pick-up code:f778/9d/bd cheat description:Hit anywhere code:c720/b5/38+c721/98/60+c6f9/4c/ad cheat description:Extra dart strength code:a178/8d/ee cheat description:Start with 44 Red Spheres code:a174/85/a2+a187/8d/8e cheat description:Start with 44 Black Spheres code:a174/85/a2+a18a/8d/8e cheat description:Start with 44 Fire Spheres code:a174/85/a2+a17b/8d/8e cheat description:Start with 44 Lightning Bolts code:a174/85/a2+a17e/8d/8e cheat description:Start with 44 Power Beams code:a174/85/a2+a181/8d/8e cheat description:Start with 1 life code:ddeb/02/00 cheat description:Start with 6 lives code:ddeb/02/05 cheat description:Start with 9 lives code:ddeb/02/08 cheat description:Start on level 2 code:a178/8d/60+a173/00/01 cheat description:Start on level 3 code:a178/8d/60+a173/00/02 cheat description:Start on level 4 code:a178/8d/60+a173/00/03 cheat description:Start on level 5 code:a178/8d/60+a173/00/04 cheat description:Start on level 6 code:a178/8d/60+a173/00/05 cheat description:Infinite health (life) (alt) code:007e/08 cheat description:Infinite Power code:007c/0f cheat description:Infinite lives (alt) code:007d/99 cheat description:Infinite Keys code:0207/99 cheat description:Infinite Red Spheres code:0208/99 cheat description:Infinite Black Spheres code:0209/99 cheat description:Infinite Phoenix code:020a/99 cartridge sha256:4b13643e53f2f7b43075233eebe65489d1d0a4ce3cf71a4f934178c3091930cf name:Dengeki - Big Bang! (Japan) cheat description:Invincibility (blinking) code:90d9/03/90+90d1/f0/24+90d8/d0/a9 cartridge sha256:281ad7bdb4f94e2303d95c6078c20295e240b80370fdceda27950966b0e09198 name:Desert Commander (USA) cheat description:Start with 99 Tank units code:0084/63 cheat description:Start with 99 Tank #2 units code:0085/63 cheat description:Start with 99 Truck units code:0086/63 cheat description:Start with 99 Troop units code:0087/63 cheat description:Start with 99 Grenade units code:0088/63 cheat description:Start with 99 Stationary Artillery units code:0089/63 cheat description:Start with 99 Transport Truck units code:008a/63 cheat description:Start with 99 Heavy Airplane units code:008b/63 cheat description:Start with 99 Light Airplane units code:008c/63 cartridge sha256:44cd6b2aa05286c37e78bd04d15793018bb0656b24260e5c76fc5cfad39f699b name:Destination Earthstar (USA) cheat description:Infinite lives code:ddee/c6/a5 cheat description:Less energy code:8bfb/99/55 cheat description:More energy code:8bfb/99/ff cheat description:Don't lose special weapon in sub-game code:ef7d/ca/ea cheat description:Start with 1 life code:ec62/03/01 cheat description:Infinite energy (ten-thousand's digit) code:05a8/99 cheat description:Infinite energy (hundred's digit) code:05a9/75 cheat description:Infinite energy (ten's and one's digit) code:05aa/76 cheat description:Infinite Ruby Laser code:05ad/ff cheat description:Infinite Torpedos code:05af/ff cartridge sha256:6d082c801942ce6787b471428ab4c8a6acb3e21f3f38fa197f2aeb698d9a2d7e name:Destiny of an Emperor (USA) cheat description:No random battles code:f47a/c5/a9+f4d7/39/ad cheat description:Buy 300 provisions for no money code:92c2/64/00 cheat description:Buy 30,000 provisions for no money code:92c5/27/00+92c6/10/00 cheat description:Dagger costs nothing code:bbf3/32/00 cheat description:Bandana costs nothing code:bce4/32/00 cheat description:Flail costs nothing code:bbfc/64/00 cheat description:Robe costs nothing code:bca2/64/00 cheat description:Elixir A costs nothing code:bbba/14/00 cheat description:Resurrect costs nothing code:bbae/64/00 cheat description:Steed costs nothing code:bba6/c8/00 cheat description:Gullwing costs nothing code:bb8c/c8/00 cheat description:Leather costs nothing code:bca9/2c/00+bcaa/01/00 cheat description:Walk anywhere code:f336/4c/ad cartridge sha256:163479e2b1571538cf2f0f147bcbdebaab8ed8b0251f87dabd9bc4c80d786ea1 name:Dick Tracy (USA) cheat description:Infinite health code:97ed/ed/2c cheat description:Infinite hand gun bullets code:a920/ce/ad cheat description:Infinite machine gun bullets code:a0ea/ce/ad cheat description:Infinite super punches code:a245/ce/ad cheat description:Infinite tear gas code:a20d/ce/ad cheat description:More super punches on pick-up code:9185/0a/14 cheat description:Mega-jump code:a060/f7/f4 cheat description:Take more damage code:97ec/38/18 cheat description:Infinite health (alt) code:0663/09 cheat description:Infinite hand gun bullets (alt) code:0761/31 cartridge sha256:e060fd43ef58d6e022f1fcab853a388142fd68d4bbd00dedc095992152e27976 name:Die Hard (USA) cheat description:Infinite health against Pistol ammo code:a786/85/a5 cheat description:Infinite health against Submachine Gun ammo code:a795/85/a5 cheat description:Infinite health against punches code:a7a3/85/a5 cheat description:Infinite Pistol ammo code:8273/ce/60 cheat description:Infinite Submachine Gun ammo code:827d/ce/60 cheat description:Infinite ammo on all guns code:826d/a5/60 cheat description:Infinite time code:f1bc/a5/60 cheat description:Lose foot health very slowly code:f397/8d/ad cheat description:Time runs at 1/4 normal speed code:f1b1/3c/f0 cheat description:Time runs at 1/3 normal speed code:f1b1/3c/b4 cheat description:Time runs at 1/2 normal speed code:f1b1/3c/78 cheat description:Time runs at 2x normal speed code:f1b1/3c/1e cheat description:Time runs at 3x normal speed code:f1b1/3c/14 cheat description:Time runs at 4x normal speed code:f1b1/3c/0f cheat description:Start with no Pistol shots instead of 15 code:c1a1/0f/00 cheat description:Start with 5 Pistol ammo code:c1a1/0f/05 cheat description:Start with 10 Pistol ammo code:c1a1/0f/0a cheat description:Start with 20 Pistol ammo code:c1a1/0f/14 cheat description:Start with 25 Pistol ammo code:c1a1/0f/19 cheat description:Start with 1 life point instead of 16 code:c19d/10/01 cheat description:Start with 2 life points code:c19d/10/02 cheat description:Start with 4 life points code:c19d/10/04 cheat description:Start with 8 life point code:c19d/10/08 cheat description:Start with 12 life points code:c19d/10/0c cheat description:Start with 20 life points code:c19d/10/14 cheat description:Invincibility code:00a5/05 cheat description:Infinite health (alt) code:00ac/10 cheat description:Infinite feet health code:0798/00 cheat description:Infinite time (alt) code:00af/60 cheat description:Immune to flashes code:00a8/00 cheat description:0 crooks left code:00ab/00 cheat description:Have all items code:0779/ff cheat description:Infinite pistol ammo (alt) code:077a/14 cheat description:Infinite Submachine Gun ammo (alt) code:077b/64 cheat description:Infinite Submachine Gun cartridges code:077c/07 cheat description:Infinite C4 code:077d/05 cheat description:Infinite flashes code:077e/07 cartridge sha256:721c464598519132fbb62f74c39a5b0ef67d1b74ebc571e77d33b5b2b4fae8c4 name:Digger - The Legend of the Lost City (USA) cheat description:Infinite health code:f9d1/c6/a5 cheat description:Infinite lives code:86e7/c6/a5 cheat description:Less rocks on pick-up code:c332/09/05 cheat description:Infinite rocks on pick-up code:f606/ce/ad cheat description:Infinite rope on pick-up code:b38d/ce/ad cheat description:Infinite dynamite on pick-up code:a08e/ce/ad cheat description:Start with weapons code:fc19/00/09 cheat description:Infinite time (disable before exiting stage) code:0187/09 cartridge sha256:7c8b6add50b20e4612e3043df0671e701cd2aa163e4af864913e3940feee27f2 name:Dig Dug (Japan) cheat description:Infinite lives - both players code:0060/03 cheat description:Start on stage 25 (disable after loading stage) code:006e/18 cheat description:Start on stage 50 (disable after loading stage) code:006e/31 cheat description:Start on stage 75 (disable after loading stage) code:006e/4a cheat description:Start on stage 99 (disable after loading stage) code:006e/63 cartridge sha256:1bf92138500e24a4e48da6d1f2eecbaeb3f36d28a425f06179fe9283381640e6 name:Dig Dug II - Trouble in Paradise (USA) cheat description:Instant inflate and explode code:e205/d0/24 cheat description:Never lose lives from touching water code:be25/ce/ad cheat description:Never lose lives from Fygar's flame code:c6eb/ce/ad cheat description:Never lose lives from hitting enemies code:d0f1/ce/ad cheat description:Turbo speed code:f371/29/a9+f372/03/02 cheat description:Start with 1 life - both players code:e981/03/01 cheat description:Start with 8 lives - both players code:e981/03/08 cartridge sha256:5aaa8382ec79c170472840dfd8e9d93512bdf2be09ecd6b3709a9d27658888cd name:Dirty Harry (USA) cheat description:Infinite health code:cca2/e5/24 cheat description:Infinite lives code:ccb9/ce/ad cheat description:Maximum health from Chili Dogs code:b1e5/02/00 cheat description:Only 10 Magnum Bullets allowed code:d5de/19/0a+d5e2/19/0a cheat description:50 Magnum Bullets allowed code:d5de/19/32+d5e2/19/32 cheat description:Start with 1 life code:d57c/05/01 cheat description:Start with 10 lives code:d57c/05/0a cheat description:Infinite Time Bombs code:06d3/63 cheat description:Infinite Hot Dogs code:06d4/63 cheat description:Infinite Spear Gun code:06d5/63 cheat description:Infinite Bazooka code:06d6/63 cheat description:Infinite Rope code:06d7/63 cheat description:Infinite Armor Vest code:06d8/63 cheat description:Infinite Mask code:06d9/63 cheat description:Infinite Flashlight code:06da/63 cheat description:Infinite Prybars code:06db/63 cartridge sha256:65295da1f14578b659b6613be80d0516c2a4932dc6bc33bad2cc71a3154672e7 name:Doki! Doki! Yuuenchi (Japan) cheat description:Invincibility code:9101/30/10 cheat description:Infinite hits code:afe8/ce/ad cheat description:Infinite lives code:dfdc/ce/ad cartridge sha256:aa408f5a6b97c0d738e7e8b489a5617ad4a9ecdee2b05c4ee504210ce31b2825 name:Donkey Kong (World) (Rev A) cheat description:Invincible against barrels code:ecac/85/a5 cheat description:Invincible against fireballs code:edb2/85/a5 cheat description:Infinite lives code:caf1/c6/a5 cheat description:Hammer lasts 3.4 times longer code:d636/4b/ff cheat description:Start with 1 life code:c9ff/03/01 cheat description:Start with 9 lives code:c9ff/03/09 cartridge sha256:b15b298dc37692d0bed2cbf922727ea48ed38bbd6cf3acdd28be6d2b9be344d3 name:Donkey Kong 3 (World) cheat description:Invincibility code:cbe0/f0/60 cheat description:Reduce the time for pros code:c7cc/80/0a cheat description:Normal spray more powerful code:d01a/01/02 cheat description:Normal spray longer code:d01b/00/32 cheat description:Spray cuts through baddies code:d15f/01/00 cheat description:Normal bees explode code:e04a/33/00 cheat description:Speeding Stanley code:ccae/03/06 cheat description:Start with infinite lives code:c979/d6/a5 cheat description:Start with 1 life code:c685/03/01 cheat description:Start with 9 lives code:c685/03/09 cartridge sha256:950ebe68e7f74219b9e5e104200b03165d59c24264f02e32c12be967fd311ac2 name:Donkey Kong Jr. (World) (Rev A) cheat description:Cannot die from falling from a high platform code:da30/05/01 cartridge sha256:07dd16464d769429c651bd203ac2e74c7aa5852824482ca8877959d643bc8689 name:Donkey Kong Jr. Math (USA, Europe) cheat description:Always get the correct answer code:d543/0a/00+d533/1a/00 cartridge sha256:234c2f62cbc3c72eb7519425a1893229e19a3fd1b1630fb75f3e951960a300e5 name:Donkey Kong Classics (USA, Europe) cheat description:Donkey Kong - Infinite lives code:89f1/a5 cheat description:Donkey Kong - Start with 1 life code:88e7/01 cheat description:Donkey Kong - Start with 6 lives code:88e7/06 cheat description:Donkey Kong - Start with 9 lives code:88e7/09 cheat description:Donkey Kong - Controllable jump code:8de6/0d/00 cheat description:Donkey Kong - Keep hammer longer code:954b/4b/80 cheat description:Donkey Kong Jr - Infinite lives code:c126/a5 cheat description:Donkey Kong Jr - Start with 1 life code:be65/01 cheat description:Donkey Kong Jr - Start with 6 lives code:be65/06 cheat description:Donkey Kong Jr - Start with 9 lives code:be65/09 cheat description:Donkey Kong Jr - Controllable jump code:c3c0/0d/00 cheat description:Donkey Kong Jr - Faster single vine climbing code:cd66/40/80 cheat description:Donkey Kong Jr - Can fall onto platforms code:d021/05/01 cheat description:Donkey Kong Jr - Speed up code:ccdd/f0/a0+ccbf/f0/a0 cartridge sha256:56cb5897c539b6874e311a314767df85186184690f10d9982b02cb90ff606537 name:Double Dare (USA) cheat description:Infinite time to answer questions code:8ba7/ce/ad cartridge sha256:8f2f9ba926280edd3652745e1d04a30ecce64089fbf3f022a35b4039a2dd7b66 name:Double Dragon (USA) cheat description:Infinite lives code:e2b3/02/88 cheat description:Infinite time code:f33f/01/00 cheat description:Gain hearts quickly code:fbc2/e6/c6 cheat description:Gain a heart every time you hit an enemy code:fbdf/c0 cheat description:More health - P1 code:f841/4a/ea cheat description:More health - P2 or computer code:f84a/4a/ea cheat description:No enemies code:9959/5d cheat description:Enemies will not fight back code:8959/5d cheat description:Slow motion code:cce9/9c cheat description:Timer will count down faster code:f332/30/20 cheat description:Timer will count down super-fast code:f332/30/10 cheat description:Disable level 4 wall trap code:d32d/ff cheat description:Start with 1 life code:e2b3/02/00 cheat description:Start with 6 lives code:e2b3/02/05 cheat description:Start with 9 lives code:e2b3/02/08 cheat description:Infinite health code:03b4/64 cheat description:Start with all hearts code:0040/07 cheat description:Start on stage 2 (disable after stage begins) code:003d/01 cheat description:Start on stage 3 (disable after stage begins) code:003d/02 cheat description:Start on stage 4 (disable after stage begins) code:003d/03 cartridge sha256:c564704993cf79c94db5c2954792e99e86100586d0ef1d4bf1aefc6d008d4c0f name:Double Dragon II - The Revenge (USA) (Rev A) cheat description:Invincibility (blinking) - both players code:807b/28/00 cheat description:No enemies code:9021/72 cheat description:Never lose lives from falling code:8427/de/ad cheat description:Never lose lives from low energy code:8a97/de/ad cheat description:Never lose lives from water code:8b6d/de/ad cheat description:Uppercut after only two punches code:bb68/02/01 cheat description:Slow down gameplay code:ed89/00/ff cheat description:Start with 259 lives - P1 code:ee58/04/ff cheat description:Start with 8 lives - P1 code:ee58/04/08 cheat description:Start with 8 lives - P2 code:ee6d/04/08 cheat description:Start with 1 life - P1 code:ee58/04/01 cheat description:Start with 1 life - P2 code:ee6d/04/01 cheat description:Start on mission 2 code:ee32/00/01 cheat description:Start on mission 3 code:ee32/00/02 cheat description:Start on mission 4 code:ee32/00/03 cheat description:Start on mission 5 code:ee32/00/05 cheat description:Start on mission 6 code:ee32/00/06 cheat description:Start on mission 7 code:ee32/00/09 cheat description:Start on mission 8 code:ee32/00/0c cheat description:Start at final boss code:ee32/00/0e cheat description:Start at final boss (alt) code:ee32/0e cheat description:Invincibility code:03cc/f0 cheat description:Enemies die after one knockdown (disable at final boss) code:0420/00+0421/00 cartridge sha256:f329de1e2653499221dc4d14d0e8b1040fee87bda4daccf6098b316a1a024fe2 name:Double Dragon II - The Revenge (USA) cheat description:Invincibility (blinking) - both players code:807b/28/00 cheat description:No enemies code:9021/72 cheat description:Never lose lives from falling code:8427/de/ad cheat description:Never lose lives from low energy code:8a97/de/ad cheat description:Never lose lives from water code:8b6d/de/ad cheat description:Uppercut after only two punches code:bb68/02/01 cheat description:Slow down gameplay code:ed89/00/ff cheat description:Start with 259 lives - P1 code:ee58/04/ff cheat description:Start with 8 lives - P1 code:ee58/04/08 cheat description:Start with 8 lives - P2 code:ee6d/04/08 cheat description:Start with 1 life - P1 code:ee58/04/01 cheat description:Start with 1 life - P2 code:ee6d/04/01 cheat description:Start on mission 2 code:ee32/00/01 cheat description:Start on mission 3 code:ee32/00/02 cheat description:Start on mission 4 code:ee32/00/03 cheat description:Start on mission 5 code:ee32/00/05 cheat description:Start on mission 6 code:ee32/00/06 cheat description:Start on mission 7 code:ee32/00/09 cheat description:Start on mission 8 code:ee32/00/0c cheat description:Start at final boss code:ee32/00/0e cheat description:Start at final boss (alt) code:ee32/0e cheat description:Invincibility code:03cc/f0 cheat description:Enemies die after one knockdown (disable at final boss) code:0420/00+0421/00 cartridge sha256:9f5891d333ea410c9a20f952ed21ec8b35c1b4f2a6fc2408fb2510921b64660f name:Double Dragon III - The Sacred Stones (USA) cheat description:Infinite health - Bill, Jimmy and Chin code:b039/20/ad cheat description:Infinite special weapons - everyone code:b405/01/00+b329/de/2c cheat description:More powerful punch, weapon and high kick code:b064/a5/a9 cheat description:More health - Billy and Jimmy code:9c82/54/64 cheat description:More health - Ranzou code:9c8a/4a/64 cheat description:Less health - Billy and Jimmy code:9c82/54/2a cheat description:Less health - Ranzou code:9c8a/4a/25 cheat description:Less health - Chin code:9c8f/64/32 cheat description:Start with Chin enabled code:bcb3/0f/00 cheat description:Start with Ranzou enabled code:bcc6/08/00 cheat description:Start with Jimmy enabled code:f1c9/05/00 cheat description:Start with 255 health - Billy and Jimmy code:9c82/54/ff cheat description:Start with 255 health - Chin code:9c8f/64/ff cheat description:Start with 255 health - Ranzou code:9c8a/4a/ff cheat description:Start with 99 weapon use - Billy, Jimmy and Chin code:9c94/05/63 cheat description:Infinite health - P1 code:045d/40 cheat description:Infinite health - P2 code:045e/40 cartridge sha256:eb0e5f318e84e931a9bd663764c43fefa1a78565fa1328c1544b41bc8155ccb1 name:Double Dribble (USA) (Rev A) cheat description:CPU scores add to your score code:c489/f8/f4 cheat description:CPU never scores code:c489/f8/fc cheat description:50 points - team 1 code:07f4/50 cheat description:50 points - team 2 code:07f8/50 cartridge sha256:f5517606d81d4e993d7fb86f11cae24c7b5029fd7184c7247771d6d7791e54ab name:Double Dribble (USA) cheat description:CPU scores add to your score code:c489/f8/f4 cheat description:CPU never scores code:c489/f8/fc cheat description:50 points - team 1 code:07f4/50 cheat description:50 points - team 2 code:07f8/50 cartridge sha256:ddc08430b83061814fec929872aa6df3abc1a624888a8e3eb3fa96abb8d32e36 name:Double Moon Densetsu (Japan) cheat description:Play as girl code:b6dc/f0/d0 cartridge sha256:aa3b652591a7310e6e2cc025deabd9accf49506bd2313265fee67f2c5e83036a name:Drac's Night Out (USA) (Proto) cheat description:Infinite Blood code:c650/8d/ad cheat description:Infinite time code:c5fe/ee/ed cartridge sha256:af505b8530b3303ebe0bf727730733cdbcd83ce1a19781d9487cd7cb202933c1 name:Dragon Fighter (USA) cheat description:Invincibility code:e508/d0/f0 cheat description:Invincibility (alt) code:004d/4f cheat description:Invincible to spikes code:d3dd/01/00 cheat description:Infinite health code:e55c/85/a5 cheat description:Max Dragon energy code:dc30/a5/84 cheat description:Always shoot special code:d22f/00/7f cheat description:Infinite health (alt) code:0050/08 cheat description:Max Dragon energy (alt) code:0053/18 cheat description:Have green shots code:004f/00 cheat description:Have red shots code:004f/01 cheat description:Have blue shots code:004f/02 cheat description:Hard mode code:007b/01 cartridge sha256:038f2241fd6e58600ce234623be752cca47875ef7295fe92c30c328c81ffe7ec name:Dragon Power (USA) cheat description:Infinite health (POW) code:9a6d/c6/a5 cheat description:Start with 128 health (POW) code:8325/64/80 cheat description:Start with 24 Wind Waves (turtle shells) (hold B then press A) code:831e/85/84 cheat description:Infinite health (POW) (alt) code:002e/63 cheat description:Infinite Wind Waves (turtle shells) (hold B then press A) code:012f/09 cheat description:Infinite Red Power Pole time (spin attack) code:0036/0f cartridge sha256:901b7a9b3e8c0256bd091f845f48b0e7bd903f7456ce3dcea386cc1871fe70c1 name:Dragon Spirit - The New Legend (USA) cheat description:Invincibility and three heads after one hit (blinking) code:ab88/a8 cheat description:Infinite health code:aa61/c6/a1 cheat description:Hit anywhere code:bdf0/d0/a9+bda1/d0/a9 cheat description:Always gold dragon code:d894/84/86 cheat description:Always blue dragon code:d894/84/a4 cheat description:Invincibility code:0588/00 cartridge sha256:5564e54943deddc6d290b256638c774aa379a0d33dcea3b0a4f0c4b9fc2034e3 name:Dragon's Lair (USA) cheat description:Infinite E (health) code:d0ac/fc/00 cheat description:Infinite Candle energy code:f9c3/ce/ad+f9e2/ce/ad cheat description:Infinite lives code:d626/ff/00 cheat description:Less energy gained on pick-up code:f769/10/05 cheat description:More energy gained on pick-up code:f769/10/27 cheat description:Start with Axe code:d5b4/00/01 cheat description:Start with Fireball code:d5b4/00/02 cheat description:Start with 1 extra life code:d5ac/fb/f7 cheat description:Start with 6 extra lives code:d5ac/fb/fc cheat description:Start with 9 extra lives code:d5ac/fb/ff cheat description:Start on level 2 code:d57a/00/01 cheat description:Start on level 3 code:d57a/00/02 cheat description:Start on level 4 code:d57a/00/03 cheat description:Infinite E (health) (alt) code:0330/1f cheat description:Infinite Gold (hundred's digit) code:05ea/ff cheat description:Infinite Gold (ten's digit) code:05eb/ff cheat description:Infinite Gold (one's digit) code:05ec/ff cartridge sha256:abc5bcb459316a7d245065149ea72b5a8317f62fa6ed578569e15b670d3c0022 name:Dragon Warrior (USA) cheat description:Infinite Magic Power code:db96/85/a5 cheat description:Take no damage in swamp code:cde3/02/00 cheat description:Start with 256 gold coins code:f697/85/e6 cheat description:All spells use only one magic point code:db96/85/c6 cheat description:Barriers cause half usual damage code:ce48/0f/07 cartridge sha256:c15ab051ff066f018cf4b0159780c58026114bb47a6376ef81c1571a39a8fe9b name:Dragon Warrior II (USA) cheat description:One hit kills code:a6b7/90/50 cheat description:Prince of Midenhall starts with 50 HP code:bdc3/1c/32 cheat description:Prince of Midenhall starts with 99 HP code:bdc3/1c/63 cheat description:Prince of Midenhall starts with 40 strength points code:bdc1/05/28 cheat description:Prince of Midenhall starts with 80 strength points code:bdc1/05/50 cheat description:Prince of Midenhall starts with 40 agility points code:bdc2/04/28 cheat description:Prince of Midenhall starts with 80 agility points code:bdc2/04/50 cheat description:Prince of Cannock starts with 50 HP code:bdc7/1f/32 cheat description:Prince of Cannock starts with 99 HP code:bdc7/1f/63 cheat description:Prince of Cannock starts with 40 strength points code:bdc5/04/28 cheat description:Prince of Cannock starts with 60 strength points code:bdc5/04/3c cheat description:Prince of Cannock starts with 30 agility points code:bdc6/04/1e cheat description:Prince of Cannock starts with 60 agility points code:bdc6/04/3c cheat description:Prince of Cannock starts with 40 magic points code:bdc8/06/28 cheat description:Prince of Cannock starts with 60 magic points code:bdc8/06/3c cheat description:Princess of Moonbrooke starts with 50 HP code:bdcb/20/32 cheat description:Princess of Moonbrooke starts with 99 HP code:bdcb/20/63 cheat description:Princess of Moonbrooke starts with 25 strength points code:bdc9/02/19 cheat description:Princess of Moonbrooke starts with 50 strength points code:bdc9/02/32 cheat description:Princess of Moonbrooke starts with 40 agility points code:bdca/16/28 cheat description:Princess of Moonbrooke starts with 40 magic points code:bdcc/1c/28 cartridge sha256:f91a8bfc25bd267f5ae77bafa7fc650f77f8e50067869e99682b32d5b410644e name:Dragon Warrior III (USA) cheat description:King gives 255 gold code:913f/32/ff cheat description:King gives mega-gold code:9152/00/01 cheat description:Player starts with increased strength and/or attack power code:b26c/07/6f cheat description:Player starts with greatly increased strength and/or attack power code:b26c/07/fe cheat description:Player starts with increased agility and/or defense code:b271/05/63 cheat description:Player starts with greatly increased agility and/or defense code:b271/05/ff cheat description:Player starts with increased vitality and/or HP code:b276/07/63 cheat description:Player starts with greatly increased vitality and/or HP code:b276/07/ff cheat description:Player starts with increased magic, maximum magic points and/or intelligence code:b27b/06/63 cheat description:Player starts with greatly increased magic, maximum magic points and/or intelligence code:b27b/06/ff cheat description:Player starts with increased luck code:b280/04/62 cheat description:Player starts with greatly increased luck code:b280/04/fe cheat description:Wizard starts with increased strength and/or attack power code:b26d/01/63 cheat description:Wizard starts with greatly increased strength and/or attack power code:b26d/01/fe cheat description:Wizard starts with increased agility and/or defense code:b272/04/62 cheat description:Wizard starts with greatly increased agility and/or defense code:b272/04/ff cheat description:Wizard starts with increased vitality and/or maximum HP code:b277/02/62 cheat description:Wizard starts with greatly increased vitality and/or maximum HP code:b277/02/99 cheat description:Wizard starts with increased magic, intelligence and/or maximum magic code:b27c/09/63 cheat description:Wizard starts with increased luck code:b281/02/63 cheat description:Wizard starts with greatly increased luck code:b281/02/fe cheat description:Pilgrim starts with increased strength and/or attack power code:b26e/03/62 cheat description:Pilgrim starts with greatly increased strength and/or attack power code:b26e/03/fe cheat description:Pilgrim starts with increased agility and/or defense code:b273/04/62 cheat description:Pilgrim starts with increased vitality and/or maximum HP code:b278/03/63 cheat description:Pilgrim starts with greatly increased vitality and/or maximum HP code:b278/03/fe cheat description:Pilgrim starts with increased magic and/or intelligence code:b27d/08/63 cheat description:Pilgrim starts with greatly increased magic and/or intelligence code:b27d/08/fe cheat description:Pilgrim starts with increased luck code:b282/03/62 cheat description:Pilgrim starts with greatly increased luck code:b282/03/fe cheat description:Soldier starts with increased strength and/or attack power code:b270/09/63 cheat description:Soldier starts with greatly increased strength and/or attack power code:b270/09/fe cheat description:Soldier starts with increased agility and/or defense code:b275/02/62 cheat description:Soldier starts with increased vitality and/or maximum HP code:b27a/07/63 cheat description:Start with 6 battle-axes code:af10/ff/05 cheat description:Start with 6 broadswords code:af10/ff/06 cheat description:Start with 6 wizard's wands code:af10/ff/07 cheat description:Start with 6 demon's axes code:af10/ff/0f cheat description:Start with 6 multi-edge swords code:af10/ff/14 cheat description:Start with 6 staffs of force code:af10/ff/15 cheat description:Start with 6 swords of illusion code:af10/ff/16 cheat description:Start with 6 falcon swords code:af10/ff/18 cheat description:Start with 6 armor of radiance code:af10/ff/28 cartridge sha256:e49cb745370065a40aff078ae52b5de1c0db137fedcbe93b78ab18d76479deed name:Dragon Warrior IV (USA) cheat description:No damage and lose no MP - all members (don't combine with the "start with items" codes) code:8466/b5/60 cheat description:Start Chapter 1 with 25 gold code:91d8/32/19 cheat description:Start Chapter 1 with 100 gold code:91d8/32/64 cheat description:Start Chapter 1 with 255 gold code:91d8/32/ff cheat description:Start Chapter 1 with lots 'o gold code:902a/57/58 cheat description:Start Chapter 1 with 15 HP code:a28f/1b/0f cheat description:Start Chapter 1 with 100 HP code:a28f/1b/64 cheat description:Start Chapter 1 with 255 HP code:a28f/1b/ff cheat description:Start Chapter 1 with final key code:91c3/ff/73 cheat description:Start Chapter 1 with metal babble sword code:91c3/ff/0e cheat description:Start Chapter 1 with multi-edge sword code:91c3/ff/13 cheat description:Start Chapter 1 with thorn whip code:91c3/ff/09 cheat description:Start Chapter 1 with shield of strength code:91c3/ff/40 cheat description:Start Chapter 1 with dragon shield code:91c3/ff/43 cheat description:Start Chapter 1 with final key and chain sickle code:91c3/ff/73+91c4/ff/04 cheat description:Start Chapter 1 with metal babble sword and boomerang code:91c3/ff/0e+91c4/ff/0b cheat description:Start Chapter 1 with multi-edge sword and wizard's ring code:91c3/ff/13+91c4/ff/59 cheat description:Start Chapter 1 with thorn whip and demon hammer code:91c3/ff/09+91c4/ff/12 cheat description:Start Chapter 1 with shield of strength and meteorite armband code:91c3/ff/40+91c4/ff/50 cheat description:Start Chapter 1 with dragon shield and iron fan code:91c3/ff/43+91c4/ff/0d cheat description:Start Chapter 2 with 50 gold code:91d9/64/32 cheat description:Start Chapter 2 with 255 gold code:91d9/64/ff cheat description:Start Chapter 2 with lots of gold code:902a/57/58 cheat description:Start Alena with 100 HP code:a290/10/64 cheat description:Start Alena with 255 HP code:a290/10/ff cheat description:Start Alena with final key code:91ca/ff/73 cheat description:Start Alena with fire claw code:91ca/ff/1a cheat description:Start Alena with multi-edge sword code:91ca/ff/13 cheat description:Start Alena with thorn whip code:91ca/ff/09 cheat description:Start Alena with boomerang code:91cb/ff/0b cheat description:Start Alena with final key and fire claw code:91ca/ff/73+91cb/ff/1a cheat description:Start Alena with multi-edge sword and wizard's ring code:91ca/ff/13+91cb/ff/59 cheat description:Start Alena with thorn whip and demon hammer code:91ca/ff/09+91cb/ff/12 cheat description:Start Alena with shield of strength and meteorite arm band code:91ca/ff/40+91cb/ff/50 cheat description:Start Alena with dragon shield and iron fan code:91ca/ff/43+91cb/ff/0d cheat description:Start Brey with final key code:91b3/ff/73 cheat description:Start Brey with magma staff code:91b3/ff/1e cheat description:Start Brey with multi-edge sword code:91b3/ff/13 cheat description:Start Brey with thorn whip code:91b3/ff/09 cheat description:Start Brey with shield of strength code:91b3/ff/40 cheat description:Start Brey with dragon shield code:91b3/ff/43 cheat description:Start Brey with boomerang code:91b4/ff/0b cheat description:Start Brey with final key and magma staff code:91b3/ff/73+91b4/ff/1e cheat description:Start Brey with multi-edge sword and wizard's ring code:91b3/ff/13+91b4/ff/59 cheat description:Start Brey with thorn whip and demon hammer code:91b3/ff/09+91b4/ff/12 cheat description:Start Brey with shield of strength and meteorite arm band code:91b3/ff/40+91b4/ff/50 cheat description:Start Brey with dragon shield and iron fan code:91b3/ff/43+91b4/ff/0d cheat description:Start Cristo with final key code:919b/ff/73 cheat description:Start Cristo with metal babble sword code:919b/ff/0e cheat description:Start Cristo with multi-edge sword code:919b/ff/13 cheat description:Start Cristo with thorn whip code:919b/ff/09 cheat description:Start Cristo with shield of strength code:919b/ff/40 cheat description:Start Cristo with dragon shield code:919b/ff/43 cheat description:Start Cristo with final key and chain sickle code:919b/ff/73+919c/ff/04 cheat description:Start Cristo with metal babble sword and boomerang code:919b/ff/0e+919c/ff/0b cheat description:Start Cristo with multi-edge sword and wizard's ring code:919b/ff/13+919c/ff/59 cheat description:Start Cristo with thorn whip and demon hammer code:919b/ff/09+919c/ff/12 cheat description:Start Cristo with shield of strength and meteorite arm band code:919b/ff/40+919c/ff/50 cheat description:Start Cristo with dragon shield and iron fan code:919b/ff/43+919c/ff/0d cheat description:Start Chapter 3 with 16 HP code:a28e/14/10 cheat description:Start Chapter 3 with 100 HP code:a28e/14/64 cheat description:Start Chapter 3 with 255 HP code:a28e/14/ff cheat description:Start Chapter 3 with 100 gold code:91da/00/64 cheat description:Start Chapter 3 with 255 gold code:91da/00/ff cheat description:Start Chapter 3 with final key code:91bb/ff/f3 cheat description:Start Chapter 3 with metal babble sword code:91bb/ff/0b cheat description:Start Chapter 3 with multi-edge sword code:91bb/ff/16 cheat description:Start Chapter 3 with thorn whip code:91bb/ff/0b cheat description:Start Chapter 3 with shield of strength code:91bb/ff/41 cheat description:Start Chapter 3 with dragon shield code:91bb/ff/40 cheat description:Start Chapter 3 with final key and chain sickle code:91bb/ff/73+91bc/ff/04 cheat description:Start Chapter 3 with metal babble sword and boomerang code:91bb/ff/0e+91bc/ff/0b cheat description:Start Chapter 3 with multi-edge sword and wizard's ring code:91bb/ff/13+91bc/ff/59 cheat description:Start Chapter 3 with thorn whip and demon hammer code:91bb/ff/09+91bc/ff/12 cheat description:Start Chapter 3 with shield of strength and meteorite arm band code:91bb/ff/40+91bc/ff/50 cheat description:Start Chapter 3 with dragon shield and iron fan code:91bb/ff/43+91bc/ff/0d cheat description:Start Nara with 100 HP code:a28b/12/64 cheat description:Start Nara with 255 HP code:a28b/12/ff cheat description:Start Nara with final key code:91a3/ff/73 cheat description:Start Nara with metal babble sword code:91a3/ff/0e cheat description:Start Nara with multi-edge sword code:91a3/ff/13 cheat description:Start Nara with thorn whip code:91a3/ff/09 cheat description:Start Nara with shield of strength code:91a3/ff/40 cheat description:Start Nara with dragon shield code:91a3/ff/43 cheat description:Start Nara with final key and chain sickle code:91a3/ff/73+91a4/ff/04 cheat description:Start Nara with metal babble sword and boomerang code:91a3/ff/0e+91a4/ff/0b cheat description:Start Nara with multi-edge sword and wizard's ring code:91a3/ff/13+91a4/ff/59 cheat description:Start Nara with thorn whip and demon hammer code:91a3/ff/09+91a4/ff/12 cheat description:Start Nara with shield of strength and meteorite arm band code:91a3/ff/40+91a4/ff/50 cheat description:Start Nara with dragon shield and iron fan code:91a3/ff/43+91a4/ff/0d cheat description:Start Mara with 100 HP code:a28c/10/64 cheat description:Start Mara with 255 HP code:a28c/10/ff cheat description:Start Mara with final key code:91a9/ff/73 cheat description:Start Mara with magma staff code:91a9/ff/1e cheat description:Start Mara with multi-edge sword code:91a9/ff/13 cheat description:Start Mara with thorn whip code:91a9/ff/09 cheat description:Start Mara with shield of strength code:91a9/ff/40 cheat description:Start Mara with dragon shield code:91a9/ff/43 cheat description:Start Mara with final key and chain sickle code:91a9/ff/73+91aa/ff/04 cheat description:Start Mara with metal babble sword and boomerang code:91a9/ff/0e+91aa/ff/0b cheat description:Start Mara with multi-edge sword and wizard's ring code:91a9/ff/13+91aa/ff/59 cheat description:Start Mara with thorn whip and demon hammer code:91a9/ff/09+91aa/ff/12 cheat description:Start Mara with shield of strength and meteorite arm band code:91a9/ff/40+91aa/ff/50 cheat description:Start Mara with dragon shield and iron fan code:91a9/ff/43+91aa/ff/0d cheat description:Start Chapter 5 with final key code:9195/ff/73 cheat description:Start Chapter 5 with zenithian sword code:9195/ff/21 cheat description:Start Chapter 5 with zenithian shield code:9195/ff/44 cheat description:Start Chapter 5 with zenithian armor code:9195/ff/37 cheat description:Start Chapter 5 with zenithian helmet code:9195/ff/4b cartridge sha256:a0b2ec9b44033fc4d2356259ad99a4f2dcdf5396da53efdfcb17a54c0e7fcdbe name:Dr. Chaos (USA) cheat description:Infinite life code:ddc4/e5/24 cheat description:Take minimal damage code:ddc4/e5/e9+ddc5/74/01 cheat description:Infinite Gun ammo on pick-up code:f800/ce/2c cheat description:More invincibility time code:dddc/14/40 cheat description:Less invincibility time code:dddc/14/04 cheat description:Take more damage and Shield Suit has no effect code:dd9d/46/66+dd9c/07/00 cheat description:Mega-jump code:ca83/03/08 cheat description:Start with Shield Suit code:c95d/00/01+c95f/43/52 cheat description:Start with 99 life code:c94e/32/63 cheat description:Start with less health code:c94e/32/19 cheat description:Invincibility (blinking) code:0073/03 cheat description:Infinite life (alt) code:0744/ff cheat description:Infinite Gun ammo code:0746/63 cheat description:Infinite Machine Gun ammo code:0747/63 cheat description:Infinite Grenades code:0748/63 cartridge sha256:5860e217030f9da957d487b3ca59000d5f4d79bf23486bad08205c5aa4d992ea name:Dr. Jekyll and Mr. Hyde (USA) cheat description:Infinite life code:e42e/ce/2c+e526/ce/2c cheat description:Multi-jump code:cff6/c3/cf+cff8/c9/29+cff9/04/01+cffa/d0/f0+cffd/00/01+cfff/c3/b9 cheat description:Keep coins from previous games code:bef4/8d/2c cheat description:Instant game restart code:d0fa/99/af cheat description:Start with 16 coins code:bef4/8d/8c cartridge sha256:01d303a8c0ed6f374586d3a2562065b77f627e8dbf071bd919877e3b48dbdb57 name:Dr. Mario (Japan, USA) cheat description:Vitamin capsules don't fall (press down) code:8d7e/e6/24 cheat description:5 in a row needed to complete a vertical line instead of 4 code:94a7/03/04 cheat description:6 in a row needed to complete a vertical line instead of 4 code:94a7/03/05 cheat description:7 in a row needed to complete a vertical line instead of 4 code:94a7/03/06 cheat description:5 in a row needed to complete a horizontal line instead of 4 code:9241/03/04 cheat description:6 in a row needed to complete a horizontal line instead of 4 code:9241/03/05 cheat description:7 in a row needed to complete a horizontal line instead of 4 code:9241/03/06 cheat description:More pieces sent across to other player when two or more rows or columns are eliminated at once in a 2P game code:9bef/18/38 cheat description:No pieces sent across to other player when two or more rows or columns are eliminated at once in a 2P game code:94aa/e6/24+9244/e6/24 cartridge sha256:7026334a7e8742b61b450f4b3b182922c6a69fc723d7cd19c83db365f15e45ba name:Duck Hunt (World) cheat description:Infinite ammo code:d171/c6/a5 cheat description:Hit anywhere code:d22c/f5/00 cheat description:Always get the perfect bonus code:d350/0a/00+d351/d0/30 cheat description:Ducks never fly away - Game A code:ca6c/c6/05 cheat description:Enable game "D" (hit select three times) code:c19e/03/04 cheat description:Infinite ammo (alt) code:00ba/03 cartridge sha256:262c1fcacd30a7f3018bd33ea6cf3fb86f8d9a77273d4f822268bff2c7deeb9a name:Duck Maze (Australia) (Unl) cheat description:Invincibility code:bbbe/20/ad cheat description:No breaking eggs from falling code:bb88/2a/00 cartridge sha256:8ba8baed01a9fbaf1e9ff29e0c9825db1963ac2aff211d6f1f3bcfd3839e2013 name:DuckTales (USA) cheat description:Invincibility code:e35a/f0/d0+800c/f0/d0 cheat description:Infinite health code:eb6a/a0/60 cheat description:Infinite health (alt) code:eb7d/01/00 cheat description:Infinite lives code:dcb0/ce/ad cheat description:Infinite time code:e2b8/e5/e9 cheat description:Lose half normal health (in easy game) code:eb67/01/03 cheat description:Double usual time code:db2c/05/0a+dcf3/b9/ad+d875/bd/ad cheat description:Multi-jump code:e397/3b/b8+e3a8/e6/e3+e3bd/f0/10+e403/3b/87+e691/f0/24 cheat description:Walk 2x faster code:e49f/01/02 cheat description:Walk 4x faster code:e49f/01/04 cheat description:Start with 1 life code:db0b/02/00 cheat description:Start with 6 lives code:db0b/02/05 cheat description:Start with 9 lives code:db0b/02/08 cheat description:Invincibility (star effect) code:0075/01 cheat description:Invincibility (blinking) code:007d/fa cheat description:Infinite health (alt) code:0342/00+0346/00+034a/00 cheat description:Infinite time (one's digit) code:0159/09 cheat description:Infinite time (ten's digit) code:0155/09 cheat description:Infinite time (hundred's digit) code:0151/09 cheat description:All levels cleared except the Amazon code:00a0/1e cheat description:Have the Skeleton Key, Mine Key and Remote Control code:00a1/01+00a3/ff cheat description:Have $9,000,000 code:0324/09 cartridge sha256:54c70628739c9cfab40b8d79555e9076adae34127ef369988ca91635b4a688bf name:DuckTales 2 (USA) cheat description:Invincibility code:e896/f0/d0 cheat description:Infinite health code:f21e/85/a5 cheat description:Infinite lives code:c422/c6/24 cheat description:Infinite lives (alt) code:c422/c6/c5 cheat description:Multi-jump code:e1ed/97/f0+e1e9/9e/21+e1ee/e2/92+e1ec/4c/4a cheat description:Take more damage code:f219/08/10 cheat description:Take less damage code:f219/08/04 cheat description:Take very little damage code:f219/08/02 cheat description:Have lots of money code:d229/00/01 cheat description:$5,000 cash from small diamonds code:d3c9/01/05 cheat description:$9,000 cash from small diamonds code:d3c9/01/09 cheat description:Start with full energy code:c0f9/30/50 cheat description:Start with a lot less energy code:c0f9/30/10 cheat description:Start with 1 life code:c108/02/00 cheat description:Start with 6 lives code:c108/02/05 cheat description:Start with 9 lives code:c108/02/08 cartridge sha256:12c92261dfae9c01ce0172cd1e7d70192105ceb350b37c3f1cb2c72f9a10a6b9 name:Dudes with Attitude (USA) (Rev 1) (Unl) cheat description:Infinite energy code:dd3d/d6/b5 cheat description:Infinite time code:d73d/c6/a5 cartridge sha256:99bba29bd92942f64d8a0beda7df3d8bff1ddcebcd3172eec16009fcb4a8bd3e name:Dudes with Attitude (USA) (Unl) cheat description:Infinite energy code:dd3d/d6/b5 cheat description:Infinite time code:d73d/c6/a5 cartridge sha256:c613c10e32b93dbc402356273d698efa14814a51b0339d6d7aacdfb639a7acd7 name:Dungeon Magic - Sword of the Elements (USA) cheat description:Take no damage except from scorpions code:b3e6/85/a5 cheat description:Take less damage code:b3e4/e5/e9+b3e5/3f/02 cheat description:Stay at the Inn for free code:e2d3/41/21+e2d7/40/20 cheat description:Items at Grocer's shop are free code:eeba/41/21+eebe/40/20 cheat description:Items at Armory are free code:f389/41/21+f38d/40/20 cheat description:Start with 100 gold pieces code:d645/00/64 cheat description:Start with 512 gold pieces code:d645/00/02+d64c/40/41 cartridge sha256:690ec2de233486d9fdb1e096ca4aa07aa6e764b0d6d6417454d0a770c875078d name:Dynowarz - Destruction of Spondylus (USA) cheat description:Mostly invincible code:d078/29/09+d076/c6/24 cheat description:Infinite shield code:ecf7/8a/60 cheat description:No harm from spikes code:dc51/a5/60 cheat description:No harm from any dinosaur code:f96e/03/00 cheat description:Mega-jump power code:d3a7/03/07 cheat description:Speed up left and right code:d27d/01/03 cheat description:Start on level 2 code:c123/01/06 cheat description:Start on level 3 code:c123/01/0a cheat description:Start on level 4 code:c123/01/0e cheat description:Start on level 5 code:c123/01/12 cartridge sha256:7951287af48ef9f2e2b375934acff99fe1543aea39d2729d2863b38ab498e231 name:Egypt (Japan) cheat description:Infinite power-ups code:9f82/99/b9 cheat description:No steps code:8be3/e6/a5+8be7/e6/a5 cheat description:No rotates code:8c07/e6/a5+8c03/e6/a5 cartridge sha256:e2824a71c74106326013915d9f8a67be22c367599feefd8da6538f62d5e6f5b0 name:Elevator Action (USA) cheat description:Infinite lives - P1 code:bb89/ce/2c cheat description:Can only shoot one bullet code:e153/06/04 cheat description:Slower man code:d7d0/03/01+d7ba/fd/ff cheat description:Faster man code:d7d0/03/05+d7ba/fd/fa cheat description:Faster bullets code:e163/08/0a+e167/f8/f6 cheat description:Slower bullets code:e163/08/04+e167/f8/fc cheat description:Faster enemy code:f19c/02/04+f1ac/fe/fa cheat description:Slower enemy code:f19c/02/01+f1ac/fe/ff cheat description:Start with 1 life - P1 code:bb37/02/00 cheat description:Start with 6 lives - P1 code:bb37/02/05 cheat description:Start with 9 lives - P1 code:bb37/02/08 cheat description:Start with 6 lives - P2 code:bbeb/02/05 cheat description:Start with 9 lives - P2 code:bbeb/02/08 cartridge sha256:9d0396286f2c027367422b8347216a309200a21b019939f08a7c457c7c4c918d name:Eliminator Boat Duel (USA) cheat description:Almost infinite nitros - no on buoy stage code:df6e/de/ad cheat description:Boat starts with full turbo, steering, hull, max engine power code:81ff/01/05 cheat description:Have full hull strength code:c8b1/de/ad cheat description:Computer boat goes crazy code:da05/84 cheat description:Start with 0 nitros code:820a/04/00 cheat description:Start with 36 nitros code:820a/04/25 cartridge sha256:761df2c2e04f9ffec5eec59afd821bd74af3b155546519d649876aad37160c06 name:Esper Dream 2 - Aratanaru Tatakai (Japan) cheat description:Infinite HP code:d475/85/a5 cheat description:Infinite ESP code:e930/85/a5 cheat description:Quick level up code:d6a7/09/08 cheat description:Chests worth lots of gold code:9ead/01/00 cartridge sha256:e9f4c9d1b7c66c6af83f2db5d4f704cf5f4b3c86e26a49c05539237807d8875e name:Excitebike (Japan, USA) cheat description:Never crash code:de1c/95/a5 cheat description:Never crash when holding forward code:e05d/95/60+e063/95/60+dc6b/95/60 cheat description:Never lose speed (even if you crash) code:ce7d/d6/b5 cheat description:Never overheat code:e3a7/ee/ad cheat description:Recover fast after crashes code:d9a4/0f/07 cheat description:Reduced enemy bikes in game B code:daa0/03/01 cheat description:Timer runs at half speed code:df38/10/08 cheat description:Timer runs at quarter speed code:df38/10/04 cheat description:Turbo speed on button A code:c0bc/18/f0+c0d1/03/04 cheat description:Mega turbo speed on button A code:c0bc/18/e0+c0d1/03/06 cheat description:Infinite obstacles in design mode code:f805/01/00 cheat description:Start racing before gate opens code:ea0a/38/00+cd22/1d/00+da29/3f/00+de39/d0/10 cheat description:Press Start to complete current race (uses your race position for the verdict) code:ca59/03/00+ca58/b1/52 cartridge sha256:9e3c5574e31cbf74146808df930a70856d7196ec581e40cae3061743504bfba2 name:Exodus - Journey to the Promised Land (USA) (v4.0) (Unl) cheat description:Infinite lives code:a834/d6/a5 cheat description:Infinite time code:ddfc/c6/a5 cartridge sha256:e9aab85fd91822b9dc7a89997eda3415e45a07fe21580c0df4765ce392e63824 name:F-1 Race (Japan) cheat description:Invincibility code:e411/e6/60 cheat description:Infinite time code:d13e/c6/85 cheat description:Don't lose speed when driving over grass/dirt code:d2a5/85/a5+d2ab/85/a5 cheat description:Don't lose speed when skidding in the road code:c38f/85/a5 cartridge sha256:3fd39ba2cdd6e220b07050d752a2c67d4a0f16a72ea9e519adf7390721cd9bdd name:F15 City War (USA) (v1.1) (Unl) cheat description:Infinite lives code:00e4/09 cartridge sha256:0e3db714b82795111afa386f32534ece968d0f8ccb63dc70189d2010dc77a2a7 name:F15 City War (USA) (v1.0) (Unl) cheat description:Infinite lives code:00e4/09 cartridge sha256:bf4b9f8706814e9164971a3c32535bb2ec718232cf05decda785770fa949d396 name:F-15 Strike Eagle (USA) cheat description:Infinite type 1 missiles code:004a/09 cheat description:Infinite type 2 missiles code:004b/09 cheat description:Infinite type 3 missiles code:004c/09 cheat description:Billions of points code:0171/09 cartridge sha256:69bc9f0a2f0cd50d624fafced0051056fd91816f0593719678a42c8637622426 name:F-117A - Stealth Fighter (USA) cheat description:Invincibility code:96a8/85/a5 cheat description:Invincibility (alt) code:0026/00 cheat description:Infinite AAM Missiles code:001f/63 cheat description:Infinite AGM Missiles code:0020/63 cheat description:Infinite Flares code:0021/63 cheat description:Infinite Chaff code:0022/63 cheat description:Have 5 million+ points code:0175/ff cartridge sha256:0de5af54fd433bc6678cd8c62b5e6f0a0987c26d64b2081764e66263cf0c658c name:Family Feud (USA) cheat description:Infinite time to answer a question code:cdc8/ce/ad cheat description:10 strikes allowed code:90dc/03/0a cartridge sha256:e0b124ddd8ac7be9e0f0b14679a089c475646fe97425fea36674d75a0f481461 name:Fantastic Adventures of Dizzy, The (USA) (Unl) cheat description:Infinite lives code:d0e0/c6/a5 cheat description:Spiders, bats, ants and rats do no damage code:f261/08/00 cheat description:Play bubble sub-game only code:a531/0e/7f cheat description:Play river sub-game only code:a531/0e/7e cheat description:Play mine sub-game only code:a531/0e/7d cheat description:Play puzzle sub-game ony code:a531/0e/7a cheat description:Start with 10 stars instead of 100 code:fac6/64/0a cheat description:Start with 10 lives code:8012/02/09 cartridge sha256:ad14301747e0ae0f9b941c6002102d69916ca5e87b355156ab79311ce8dd7236 name:Fantasy Zone (USA) (Unl) cheat description:Infinite lives code:e60f/c6/a9 cheat description:Keep bought weapon for a life code:e881/c6/a9 cheat description:Keep bought weapon until next shop visit code:e881/c6/a9+e618/85/c9 cheat description:Autofire on all weapons code:ee1c/01/00 cheat description:Start with 1 life code:e929/03/01 cheat description:Start with 6 lives code:e929/03/06 cheat description:Start with 9 lives code:e929/03/09 cheat description:Start on level 2 code:e75f/00/01 cheat description:Start on level 3 code:e75f/00/02 cheat description:Start on level 4 code:e75f/00/03 cheat description:Start on level 5 code:e75f/00/04 cheat description:Start on level 6 code:e75f/00/05 cheat description:Start on level 7 code:e75f/00/06 cartridge sha256:6f23f245b9edc5af0c07fab9e12f5c0571ea0f52413e4ce6ad36e2f57ddf4097 name:Faria - A World of Mystery & Danger! (USA) cheat description:Infinite HP code:811c/e5/85+b8b8/e5/85 cheat description:Infinite batteries code:c725/ce/ad cheat description:Infinite Bombs code:b197/ce/ad cheat description:Infinite Sede magic code:85d0/ce/2c cheat description:Infinite Saba magic code:85fa/ce/2c cheat description:Get 250 arrows when buying any amount of arrows code:a965/02/00 cheat description:Don't get charged in shops for items you can afford code:a32a/8d/2c+a32f/8d/2c+a334/8d/2c cartridge sha256:58f2ba801354a8e5b32e7d1cbcc740b8dc838e7d48c3d2f3eedea36b49b1a518 name:Faxanadu (USA) (Rev A) cheat description:Infinite P (health) code:c092/ed/2c+c09b/ed/2c cheat description:Infinite M (magic) code:fa88/02/00 cheat description:Infinite Gold code:f9ab/8d/ad+f9b3/8d/ad+f9bb/8d/ad cheat description:Jump in direction you are facing code:e1ac/a5/60 cheat description:Slow mode code:e030/f9/00+e041/f4/00+e032/01/00 cheat description:Start with double P (health) code:deaf/10/20 cheat description:Start with triple P (health) code:deaf/10/30 cheat description:Start with half normal amount of Gold code:8559/0a/05 cheat description:Start with double normal amount of Gold code:8559/0a/14 cheat description:Invincibility code:00ad/48 cheat description:Infinite P (health) (alt) code:0431/55 cheat description:Infinite M (magic) (alt) code:039a/50 cheat description:Infinite Gold (alt) code:0394/ff cheat description:Have Wing Boots ability (hold up and A) code:0429/0a cheat description:Walk faster code:00aa/02 cartridge sha256:52f7e7309f1f53f632912182f3a65f574c949392ab92f55c2494a7e648ef5ccb name:Faxanadu (USA) cheat description:Infinite P (health) code:c092/ed/2c+c09b/ed/2c cheat description:Infinite M (magic) code:fa88/02/00 cheat description:Infinite Gold code:f9ab/8d/ad+f9b3/8d/ad+f9bb/8d/ad cheat description:Jump in direction you are facing code:e1ac/a5/60 cheat description:Slow mode code:e030/f9/00+e041/f4/00+e032/01/00 cheat description:Start with double P (health) code:deaf/10/20 cheat description:Start with triple P (health) code:deaf/10/30 cheat description:Start with half normal amount of Gold code:8559/0a/05 cheat description:Start with double normal amount of Gold code:8559/0a/14 cheat description:Invincibility code:00ad/48 cheat description:Infinite P (health) (alt) code:0431/55 cheat description:Infinite M (magic) (alt) code:039a/50 cheat description:Infinite Gold (alt) code:0394/ff cheat description:Have Wing Boots ability (hold up and A) code:0429/0a cheat description:Walk faster code:00aa/02 cartridge sha256:884b46ad4eb5160a94c19e8954846d644be36803efc53c977e99b1342886cc6b name:Felix the Cat (USA) cheat description:Infinite time code:f7fc/9d/bd cheat description:Infinite lives code:f9b4/01/00 cheat description:Weapon has longer reach code:8efa/30/10 cheat description:Hearts can't be replenished from bottles code:880f/02/00 cheat description:Bottles replenish more hearts code:880f/02/04 cheat description:Bottles replenish even more hearts code:880f/02/08 cheat description:1 Felix icon gives 2 code:da19/01/02+da79/19/18 cheat description:No sound effects code:8608/90/b0 cheat description:Walk through walls code:d111/d0/70+d12a/d0/70 cheat description:Start with 9 lives code:c430/12/18 cheat description:Start with 6 lives code:c430/12/15 cheat description:Start with 1 life code:c430/12/10 cheat description:Invincibility (blinking) code:03cd/03 cheat description:Infinite lives (alt) code:03a6/19 cheat description:Infinite special code:03c0/0a cheat description:Have 99 Felix icons code:03a7/19+03a8/19 cheat description:Play as Magic/Balloon Felix code:03c6/01 cheat description:Play as Buggy/Plane Felix code:03c6/02 cheat description:Play as Tank Felix code:03c6/03 cartridge sha256:c0c98471130cd09c82af6ead5e706c9299cc2cb4584016a5e5eb0c8897380172 name:Fester's Quest (USA) cheat description:Invincibility code:9c51/70 cheat description:Infinite health code:9c83/ce/ea cheat description:Infinite Invisible Potions on pick-up code:d107/ce/ad cheat description:Infinite Missiles on pick-up code:eb6a/ce/ad cheat description:Infinite Money code:d13f/8d/ad cheat description:Infinite Nooses on pick-up code:d0b6/ce/ad cheat description:Infinite Potions on pick-up code:d0eb/ce/ad cheat description:Infinite T.N.T on pick-up code:d177/ce/ad cheat description:Infinite Vice Grips on pick-up code:d0d6/ce/ad cheat description:Invincibility (alt) code:04f8/c0 cheat description:Infinite health (alt) code:04e5/03+04e9/03 cheat description:Max health code:04ea/04 cheat description:Have level 8 Gun code:04e7/08 cheat description:Have level 4 Whip code:04e8/04 cheat description:Infinite Bulbs code:015c/64 cheat description:Infinite Invisible Potions code:0161/64 cheat description:Infinite Keys code:015d/64 cheat description:Infinite Money (alt) code:0162/64 cheat description:Infinite Missiles code:0163/64 cheat description:Infinite Nooses code:015e/64 cheat description:Infinite Potions code:0160/64 cheat description:Infinite T.N.T code:0164/64 cheat description:Infinite Vice Grips code:015f/64 cartridge sha256:179bd9c16fc5b85168fecac685045ed58f6bec5a51363babb7aaaaceb6fa0932 name:Fighting Road (Japan) cheat description:Infinite health code:d68b/85/a5 cartridge sha256:2ae778c5a59fac650fa97e93d883381dbf96c5a0ad2c1db94fd822663904f7e5 name:Final Combat (Asia) (PAL) (Unl) cheat description:Infinite health code:a6d0/8d/ad+c794/8d/ad cheat description:Infinite lives code:bb61/d6/a5 cheat description:Infinite time code:9d79/ce/ad cartridge sha256:fa456d852372173ea31b192459ba1a2026f779df67793327ba6e132476c1d034 name:Final Fantasy (USA) cheat description:Almost infinite Gold code:a4d1/ed/2c+a4da/ed/2c cheat description:999999+ Gold code:b01e/00/ff cheat description:Gain 65535 EXP from every battle code:9ed9/01 cheat description:Enemies don't attack code:b323/80 cheat description:Non-magic users can use level 1 magic code:ab0e/f0/b0+c7d0/0c/00+c7d4/08/00 cheat description:LIFE spell never uses up Magic Points code:b035/de/ad cheat description:LIF2 spell never uses up Magic Points code:b06b/de/ad cheat description:Magic users start with 6 Magic Points code:c7d6/02/06 cheat description:Magic users start with 9 Magic Points code:c7d6/02/09 cheat description:No random battles (enable at start of game) code:99e6/91 cheat description:Double Fighter's Hit Points (enable at start of game) code:b041/23/46 cheat description:Double Fighter's Hit (enable at start of game) code:b048/0a/14 cheat description:Double Fighter's Evade (enable at start of game) code:b049/35/6a cheat description:Double Fighter's Luck (enable at start of game) code:b046/05/0a cheat description:Double Thief's Hit Points (enable at start of game) code:b051/1e/3c cheat description:Triple Thief's Damage (enable at start of game) code:b057/02/06 cheat description:Double Thief's Hit (enable at start of game) code:b058/05/0a cheat description:Double Thief's Evade (enable at start of game) code:b059/3a/74 cheat description:Double Thief's Luck (enable at start of game) code:b056/0f/1e cheat description:Double Black Belt's Hit Points (enable at start of game) code:b061/21/42 cheat description:Triple Black Belt's Damage (enable at start of game) code:b067/02/06 cheat description:Double Black Belt's Hit (enable at start of game) code:b068/05/0a cheat description:Double Black Belt's Evade (enable at start of game) code:b069/35/6a cheat description:Double Black Belt's Luck (enable at start of game) code:b066/05/0a cheat description:Double Red Mage's Hit Points (enable at start of game) code:b071/1e/3c cheat description:Double Red Mage's Damage (enable at start of game) code:b077/05/0a cheat description:Double Red Mage's Hit (enable at start of game) code:b078/07/0e cheat description:Double Red Mage's Evade (enable at start of game) code:b079/3a/74 cheat description:Double Red Mage's Luck (enable at start of game) code:b076/05/0a cheat description:Double White Mage's Hit Points (enable at start of game) code:b081/1c/38 cheat description:Triple White Mage's Damage (enable at start of game) code:b087/02/06 cheat description:Double White Mage's Hit (enable at start of game) code:b088/05/0a cheat description:Double White Mage's Evade (enable at start of game) code:b089/35/6a cheat description:Double White Mage's Luck (enable at start of game) code:b086/05/0a cheat description:Double Black Mage's Hit Points (enable at start of game) code:b091/19/32 cheat description:Triple Black Mage's Damage (enable at start of game) code:b097/01/03 cheat description:Double Black Mage's Hit (enable at start of game) code:b098/05/0a cheat description:Double Black Mage's Evade (enable at start of game) code:b099/3a/74 cheat description:Double Black Mage's Luck (enable at start of game) code:b096/0a/14 cheat description:Start with 800 Gold code:b01c/90/20+b01d/01/03 cheat description:More enemies, more difficult code:6d8d/99 cheat description:No random battles (alt) code:00f5/ff cheat description:Have Adamant code:6027/01 cheat description:Have Bottle code:602f/01 cheat description:Have Canoe code:6031/01 cheat description:Have Chime code:602c/01 cheat description:Have Crown code:6022/01 cheat description:Have Crystal code:6023/01 cheat description:Have Cube code:602e/01 cheat description:Have Floater code:602b/01 cheat description:Have Herb code:6024/01 cheat description:Have Key code:6025/01 cheat description:Have Lute code:6021/01 cheat description:Have Oxyale code:6030/01 cheat description:Have Rod code:602a/01 cheat description:Have Ruby code:6029/01 cheat description:Have Slab code:6028/01 cheat description:Have Tail code:602d/01 cheat description:Have TNT code:6026/01 cheat description:Have first Crystal lit code:6032/01 cheat description:Have second Crystal lit code:6033/01 cheat description:Have third Crystal lit code:6034/01 cheat description:Have last Crystal lit code:6035/01 cheat description:Character 1 - 255 HP code:610a/ff cheat description:Character 1 - 99 STR code:6110/63 cheat description:Character 1 - 99 AGL code:6111/63 cheat description:Character 1 - 99 INT code:6112/63 cheat description:Character 1 - 99 VIT code:6113/63 cheat description:Character 1 - 99 Luck code:6114/63 cheat description:Character 1 - 255 Damage code:6120/ff cheat description:Character 1 - 255 Hit % code:6121/ff cheat description:Character 1 - 255 Absorb code:6122/ff cheat description:Character 1 - 255 Evade % code:6123/ff cheat description:Character 1 - Infinite level 1 magic use code:6320/08+6328/08 cheat description:Character 1 - Infinite level 2 magic use code:6321/08+6329/08 cheat description:Character 1 - Infinite level 3 magic use code:6322/08+632a/08 cheat description:Character 1 - Infinite level 4 magic use code:6323/08+632b/08 cheat description:Character 1 - Infinite level 5 magic use code:6324/08+632c/08 cheat description:Character 1 - Infinite level 6 magic use code:6325/08+632d/08 cheat description:Character 1 - Infinite level 7 magic use code:6326/08+632e/08 cheat description:Character 1 - Infinite level 8 magic use code:6327/08+632f/08 cheat description:Character 2 - 255 HP code:614a/ff cheat description:Character 2 - 99 STR code:6150/63 cheat description:Character 2 - 99 AGL code:6151/63 cheat description:Character 2 - 99 INT code:6152/63 cheat description:Character 2 - 99 VIT code:6153/63 cheat description:Character 2 - 99 Luck code:6154/63 cheat description:Character 2 - 255 Damage code:6160/ff cheat description:Character 2 - 255 Hit % code:6161/ff cheat description:Character 2 - 255 Absorb code:6162/ff cheat description:Character 2 - 255 Evade % code:6163/ff cheat description:Character 3 - 255 HP code:618a/ff cheat description:Character 3 - 99 STR code:6190/63 cheat description:Character 3 - 99 AGL code:6191/63 cheat description:Character 3 - 99 INT code:6192/63 cheat description:Character 3 - 99 VIT code:6193/63 cheat description:Character 3 - 99 Luck code:6194/63 cheat description:Character 3 - 255 Damage code:61a0/ff cheat description:Character 3 - 255 Hit % code:61a1/ff cheat description:Character 3 - 255 Absorb code:61a2/ff cheat description:Character 3 - 255 Evade % code:61a3/ff cheat description:Character 4 - 255 HP code:61ca/ff cheat description:Character 4 - 99 STR code:61d0/63 cheat description:Character 4 - 99 AGL code:61d1/63 cheat description:Character 4 - 99 INT code:61d2/63 cheat description:Character 4 - 99 VIT code:61d3/63 cheat description:Character 4 - 99 Luck code:61d4/63 cheat description:Character 4 - 255 Damage code:61e0/ff cheat description:Character 4 - 255 Hit % code:61e1/ff cheat description:Character 4 - 255 Absorb code:61e2/ff cheat description:Character 4 - 255 Evade % code:61e3/ff cartridge sha256:7ff89b50156b6f5b3d78d3d2eeec8a9221d9f7b18f8350abf89b7867a205f710 name:Final Fantasy III (Japan) cheat description:Infinite capacity points. You still have to have enough points to make the job change, but no points will be subtracted from your total code:ab9b/8d/ad cheat description:All items in shops are free. You must have enough to cover the item, but will not be charged code:b0b0/e5/ea cheat description:Knife casts a FIRE spell when used as a item in battle code:94f4/7f/31 cheat description:Knife casts a FIRE3 spell when used as a item in battle code:94f4/7f/0e cheat description:Knife casts a BOLT3 spell when used as a item in battle code:94f4/7f/15 cheat description:Knife casts a ICE3 spell when used as a item in battle code:94f4/7f/1d cheat description:Knife casts a DEATH spell when used as a item in battle code:94f4/7f/01 cheat description:Knife casts a METEO spell when used as a item in battle code:94f4/7f/02 cheat description:Knife casts a HEAL spell when used as a item in battle code:94f4/7f/0b cheat description:Knife casts a CURE4 spell when used as a item in battle code:94f4/7f/0a cheat description:Dagger casts a FIRE3 spell when used as a item in battle code:94fc/7f/0e cheat description:Dagger casts a BOLT3 spell when used as a item in battle code:94fc/7f/15 cheat description:Dagger casts a ICE3 spell when used as a item in battle code:94fc/7f/1d cheat description:Dagger casts a DEATH spell when used as a item in battle code:94fc/7f/01 cheat description:Dagger casts a METEO spell when used as a item in battle code:94fc/7f/02 cheat description:Dagger casts a HEAL spell when used as a item in battle code:94fc/7f/0b cheat description:Dagger casts a CURE4 spell when used as a item in battle code:94fc/7f/0a cheat description:Long Sword casts a FIRE3 spell when used as a item in battle code:9524/7f/0e cheat description:Long Sword casts a BOLT3 spell when used as a item in battle code:9524/7f/15 cheat description:Long Sword casts a ICE3 spell when used as a item in battle code:9524/7f/1d cheat description:Long Sword casts a DEATH spell when used as a item in battle code:9524/7f/01 cheat description:Long Sword casts a METEO spell when used as a item in battle code:9524/7f/02 cheat description:Long Sword casts a HEAL spell when used as a item in battle code:9524/7f/0b cheat description:Long Sword casts a CURE4 spell when used as a item in battle code:9524/7f/0a cartridge sha256:5f21fadd084947d11224d1f37218a504bd75f7c6f17212f638a6917ba8a96f99 name:Fire Bam (FDS) cheat description:All fire items worth 65,535 code:9a02/00/ff cheat description:Start with 65,534 Fire code:dfc4/81/fe+dfc5/09/ff cartridge sha256:9a0cc935c7d8452eff5b90f591bb6390d04362545ecd66b4be67a875ad63dc73 name:Fire Dragon (Asia) (Unl) cheat description:One fireball needed to finish the level code:034f/04 cheat description:Start on stage 50 code:034d/32 cartridge sha256:3f5ed8b5207ff10ef490e7533bdd8419e5266101d4049d7689c01b5b352a4547 name:Fire Hawk (USA) (Unl) cheat description:Invincibility code:ae19/d0/a9 cheat description:Start with 1 life code:8019/03/01 cheat description:Start with 6 lives code:8019/03/06 cheat description:Start with 9 lives code:8019/03/09 cheat description:Infinite Missiles code:04da/1f cheat description:Infinite ammo code:04dc/1f cheat description:Infinite fuel code:04f4/26 cartridge sha256:db16f0a5cb05dfa9344e0ae459f6c44fac7c28d4a8ecd47d3418053ab16c8a62 name:Fire 'n Ice (USA) cheat description:Automatically finish levels code:f48f/08/00 cartridge sha256:04264565cf33f4bd1b23a3f7a1be1487a548c7f6b85323c68af754b0927b0a56 name:Fist of the North Star (USA) cheat description:Invincibility code:c5a0/20/ad cheat description:Infinite health code:cc53/85/a5 cheat description:Infinite time code:e65c/c6/a5 cheat description:Infinite lives code:c1cf/c6/a5 cheat description:One hit kills you code:cc51/e5/e9 cheat description:Sweep kick damages enemies more code:b186/01/06 cheat description:Straight kick damages enemies more code:b194/03/08 cheat description:Can't be knocked back by big thugs code:cc3e/04/00 cheat description:Pogo stick code:c953/f0/d0 cheat description:Take minimum damage from all enemies code:cc51/e5/e9+cc52/d9/01 cheat description:Any attack mega-damages enemies code:b19a/e5/e9+b19b/d9/0a cheat description:Start with 1 life code:c0cc/03/01 cheat description:Start with 6 lives code:c0cc/03/06 cheat description:Start with 9 lives code:c0cc/03/09 cheat description:Invincibility (blinking) code:0066/01 cheat description:Infinite health (alt) code:0073/38 cheat description:Infinite time (alt) code:0065/09 cheat description:Infinite power code:006c/07 cheat description:Infinite Bomb code:0063/07 cartridge sha256:6e5bdfe7ee4cc4d949ea80016dbfb2b4322bbe193b5f28483ce7009e506efe40 name:Flight of the Intruder (USA) cheat description:Infinite radar-guided missiles - bombing/strafing screen code:973a/c6/24 cheat description:Start with 9 radar-guided missiles - bombing/strafing screen code:8213/06/09 cheat description:Infinite missiles - cockpit screen code:943b/ce/2c cheat description:Start each mission with 6 missiles code:a246/c9/a9+a24c/01/00 cheat description:Start on mission 3 code:cc44/00/04 cheat description:Start on mission 6 code:cc44/00/0a cheat description:Start on mission 9 code:cc44/00/10 cheat description:Start on mission 12 code:cc44/00/16 cartridge sha256:3036a59bb7bf16a3b80c94750bccaa35be9ab5cd94f99d68d3979ec53cd42c03 name:Flintstones, The - The Rescue of Dino & Hoppy (USA) cheat description:Invincibility code:9192/ce/60 cheat description:Infinite lives code:8090/ce/ad cheat description:Infinite energy (hearts) code:e472/ce/ad+9192/ce/ad cheat description:15 coins on pick-up code:e2d2/05/0f cheat description:2 coins on pick-up code:e2d2/05/02 cheat description:Slingshot doesn't use up coins code:8e32/03/00 cheat description:Axe doesn't use up coins code:8e33/03/00 cheat description:Bomb doesn't use up coins code:8e34/0a/00 cheat description:Infinite Firepower code:8dec/00 cheat description:Max power charge code:99c8/01/13+a103/01/13+9183/01/13+923b/01/13 cheat description:Start with Slingshot code:8180/00/01 cheat description:Start with Axe code:8180/00/02 cheat description:Start with Bomb code:8180/00/04 cheat description:Start with 1 life code:8167/02/00 cheat description:Start with 6 lives code:8167/02/05 cheat description:Start with 9 lives code:8167/02/08 cheat description:Start with 99 coins code:817b/0a/63 cheat description:Infinite energy (hearts) (alt) code:0308/03 cheat description:Infinite lives code:0305/09 cheat description:Infinite Coins code:030b/ff cheat description:Max power charge (alt) code:0312/0c cheat description:One hit kills on most bosses code:03d7/00 cartridge sha256:8da82a28be164453d1f8aa293fc8b02aaede397b52622a14ead331e475e5ca2f name:Flintstones, The - The Surprise at Dinosaur Peak! (USA) cheat description:Invincibility code:9984/8d/60 cheat description:Infinite lives code:808e/ce/ad cheat description:Infinite energy code:997f/01/00 cheat description:Infinite energy (alt) code:9984/8d/ad cheat description:Infinite stone hammers on pick-up code:9eab/8d/ad cheat description:Enemies do more damage (3 hearts) code:997f/01/03 cheat description:Get bowling ball instead of stone hammer code:8f8b/01/02 cheat description:Get mystery item instead of stone hammer code:8f8b/01/03 cheat description:Continue on Level 2 code:8946/00/01 cheat description:Continue on Level 3 code:8946/00/02 cheat description:Continue on Level 4 code:8946/00/03 cheat description:Continue on Level 5 code:8946/00/04 cheat description:Continue on Level 6 code:8946/00/05 cheat description:Continue on Level 7 code:8946/00/06 cheat description:Continue on Level 8 code:8946/00/07 cheat description:Continue on Level 9 code:8946/00/08 cheat description:Continue on Level 10 code:8946/00/09 cheat description:Start with max power code:8186/0c/14 cheat description:Start with 1 heart code:817b/03/01 cheat description:Start with 2 hearts code:817b/03/02 cheat description:Start with 6 hearts code:817b/03/06 cheat description:Start with 9 hearts code:817b/03/09 cheat description:Start with 1 life instead of 3 code:8153/02/00 cheat description:Start with 5 lives code:8153/02/04 cheat description:Start with 9 lives code:8153/02/08 cheat description:Start on level 2 code:897a/8d/ee cartridge sha256:fd7523b5ec5769e4d782a9699a2253bd15d0036111b8ed26195238b35b74257d name:Flying Dragon - The Secret Scroll (USA) cheat description:Start with infinite lives code:b0c6/a4/86 cheat description:Start with infinite time code:8988/c6/24 cheat description:Start with double KO power code:ab1b/03/06 cheat description:Start with 1 life code:8076/03/01 cheat description:Start with 6 lives code:8076/03/06 cheat description:Start with 9 lives code:8076/03/09 cartridge sha256:5e2db0db6b1d3d7fe1630a6bab38a66081e3266070a4dfac9c3ace9edf39375e name:Flying Hero (Japan) cheat description:Finish levels automatically code:03a9/00 cheat description:Infinite lives code:0400/03 cheat description:Max Bounce code:04b0/03 cheat description:One hit kills on Fires code:0510/80 cartridge sha256:1568e77e6533087eee26f952b0f58373fc5e56c4b2139023dbfdadc0828249c8 name:Flying Warriors (USA) cheat description:Infinite life code:c4fd/8d/ad cheat description:Infinite lives code:c964/ce/ad cheat description:Infinite KO's code:a491/8d/ad+c25b/8d/ad cheat description:Infnite credits code:822a/c6/a5 cartridge sha256:eedcf3fae4fe66102a1bf1338a1ea3276f5aadb3c3bc5770dd1d260e2fc44bac name:Formation Z (Japan) cheat description:Invincibility code:a059/8d/ad+a458/8d/ad+abae/8d/ad+9f82/8d/ad+976e/8d/ad+aa9d/8d/ad+afb1/8d/ad+adfc/8d/ad+9629/8d/ad+961e/8d/ad cheat description:Infinite fuel code:96de/c6/25 cartridge sha256:758ea7bee928136abf612ba564fab4dd4f3caa951cb685bc8e1d4533c7b0680e name:Formula One - Built to Win (USA) cheat description:Infinite nitro code:d8b2/ce/ad cheat description:Better nitro code:d84a/20/60 cheat description:Psycho speed code:d869/02/00 cheat description:Items cost nothing code:bb7e/ad/60 cheat description:Items for free code:bb7e/ad/60+bb6c/e5/60 cartridge sha256:e9fe69c87a9ab1183ce8492843bacf868e1f8df2fd4e1441403091d13025a619 name:Fox's Peter Pan & the Pirates - The Revenge of Captain Hook (USA) cheat description:Infinite lives code:c31f/c6/a5 cheat description:Infinite flight meter code:da6a/ce/ad cheat description:Slower flight meter code:da5f/04/0c cheat description:Faster flight meter code:da5f/04/02 cheat description:Faster flying left and right code:da33/01/02+d816/01/02 cheat description:Start with 30 units of health code:c4f2/0a/1e+c32f/0a/1e cheat description:Start with 5 units of health code:c4f2/0a/05+c32f/0a/05 cheat description:Start with 1 life code:c4fb/03/01 cheat description:Start with 6 lives code:c4fb/03/06 cheat description:Start with 9 lives code:c4fb/03/09 cheat description:Infinite health code:0051/ff cheat description:Infinite lives (alt) code:0050/09 cheat description:Infinite Flight meter (alt) code:0640/ff cartridge sha256:682a0629d25275a95975e3822ded9fc6cfe5ce8dfb4650aeda0981bfe6a6afc0 name:Frankenstein - The Monster Returns (USA) cheat description:Invincibility code:c4eb/00/02 cheat description:Invincible after you die once (may get stuck in boss stages) code:8049/85/a5+c001/85/a5 cheat description:Infinite health code:83cb/85/a5+907f/85/a5+8bc9/85/a5+90ba/85/a5+90bc/85/a5 cheat description:Can't collect extra energy code:8b0b/85/a5 cheat description:Die after one hit code:83c7/b0/80 cheat description:Start with 0 continue code:c197/03/01 cheat description:Infinite health (alt) code:007d/08 cartridge sha256:995b57f7d2c68a5689549fc53645dcc44f871c8d172e15deafd7389bc3f6ee0a name:Freedom Force (USA) cheat description:Infinite health code:8367/85/24 cheat description:Infinite ammo code:e7b3/22/00 cheat description:Infinite errors allowed code:e797/c9/a9 cheat description:Fewer errors allowed code:e798/06/03 cheat description:Start with half health code:e64f/18/0c cheat description:Start with half ammo code:e697/24/12 cheat description:Start at level 2 code:e633/01/02 cheat description:Start at level 3 code:e633/01/03 cheat description:Start at level 4 code:e633/01/04 cheat description:Start at level 5 code:e633/01/05 cheat description:Infinite health - P1 code:0516/18 cheat description:Infinite health - P2 code:0526/18 cheat description:Infinite ammo - P1 code:0515/24 cheat description:Infinite ammo - P2 code:0525/24 cheat description:Infinite errors allowed - P1 code:0517/00 cheat description:Infinite errors allowed - P2 code:0527/00 cheat description:Infinite time in bonus stages (disable to continue) code:0089/09 cheat description:Automatically finish stage code:00c2/3c cartridge sha256:ea054316b0e2ab99c2dcbcccacb4f28bae6809f183d29a4cb797a07f55ad8ff8 name:Free Fall (USA) (Proto) cheat description:Infinite hands code:ce7d/99/b9 cheat description:Freeze time (disable at end of level so counter can decrease) code:d040/95/b5 cheat description:One saved to beat level code:d46a/a5/a9+d46d/d8/75+d46e/04/01 cheat description:No score decrease with loss of men code:ce13/62/08+ce12/a5/30 cheat description:Each dead man, one to score instead of five code:ce13/62/63 cartridge sha256:7e94b4fe8c33439779bb653d007ba4678dd589636ffbc87d1535629578a64d5e name:Friday the 13th (USA) cheat description:Invincibility code:af0d/20/ad cheat description:Infinite health code:dd0c/8d/ad cheat description:Infinite health for active counselor code:dd06/e5/e9 cheat description:Infinite child save time code:b77c/20/ad cheat description:Infinite children code:b853/ce/ad+b845/78/75 cheat description:Hit anywhere code:dc43/d0/50 cheat description:One hit kills code:dc99/12/00 cheat description:Enemies die automatically code:cad2/22/00 cheat description:No enemies code:cbc4/02/00+daa5/fe/ad cheat description:Vitamins heal active counselor better code:b418/06/2a cheat description:Vitamins heal others better code:eb0a/04/28 cheat description:Autofire code:b2f5/74/75 cheat description:Everyone can jump high code:b50a/00/0c cheat description:Turbo running code:b264/b9/ad+b265/68/1f cheat description:Throw rocks straight code:c285/a5/07 cheat description:Start with 55 children code:8ee7/01/05+8efd/0f/37 cheat description:Invincibility (alt) code:0488/03 cheat description:Infinite health (alt) code:0505/ff cheat description:Infinite Medicine code:0519/09 cheat description:Infinite Children code:0504/05 cheat description:Infinite child save time (alt) code:058d/09 cheat description:Have the Torch code:0506/00 cheat description:Have the Knife code:0506/01 cheat description:Have the Axe code:0506/02 cheat description:Have the Stone code:0506/03 cheat description:Have the Cleaver code:0506/04 cheat description:Have the Pitchfork code:0506/05 cheat description:Have the Lighter Torch code:0517/01 cheat description:Have the Flashlight code:0518/01 cheat description:Have the Key code:051a/01 cheat description:Jason has no health code:051c/00 cheat description:Play as George code:0507/00 cheat description:Play as Mark code:0507/01 cheat description:Play as Paul code:0507/02 cheat description:Play as Laura code:0507/03 cheat description:Play as Debbie code:0507/04 cheat description:Play as Crissy code:0507/05 cheat description:Set time - day code:0508/00 cheat description:Set time - dusk code:0508/01 cheat description:Set time - night code:0508/02 cartridge sha256:d077b282b751a246549e334885d83ee587d9e6178b170afcf57553ec62015c52 name:G.I. Joe - A Real American Hero (USA) cheat description:Invincibility code:94ec/f0/d0+94f0/38/ea cheat description:Infinite health code:e477/99/b9 cheat description:Infinite ammo code:aee9/8d/ad cheat description:Infinte time code:83fe/8d/ad cheat description:Infinite time (alt) code:83f6/01/00 cheat description:More health - Duke code:edb4/0d/14 cheat description:More health - Blizzard code:edb5/0c/14 cheat description:More health - Snake Eyes code:edb6/0a/14 cheat description:More health - Capt. Grid-Iron code:edb7/0b/14 cheat description:More health - Rock and Roll code:edb8/09/14 cheat description:Less health - Duke code:edb4/0d/06 cheat description:Less health - Blizzard code:edb5/0c/06 cheat description:Less health - Snake Eyes code:edb6/0a/05 cheat description:Less health - Capt. Grid-Iron code:edb7/0b/05 cheat description:Less health - Rock and Roll code:edb8/09/04 cheat description:Shorter immunity code:e47d/78/30 cheat description:Longer immunity code:e47d/78/ff cheat description:Max health on pick-up code:8139/03/00 cheat description:Mega-jump - Duke code:edfc/17/20 cheat description:Mega-jump - Blizzard code:edfd/12/20 cheat description:Mega-jump - Snake Eyes code:edfe/1c/20 cheat description:Mega-jump - Capt. Grid-Iron code:edff/14/20 cheat description:Mega-jump - Rock and Roll code:ee00/10/20 cartridge sha256:9e65e4d55123612c5eb05b332e48fd975a187d706a3fd44b62125e1ae48af028 name:G.I. Joe - The Atlantis Factor (USA) cheat description:Invincibility code:9a53/f0/d0+9a57/38/ea cheat description:Infinite health code:e5d3/99/b9 cheat description:Infinite time code:855a/01/00 cheat description:Infinite Mines code:9b90/de/bd cheat description:Infinite stamina code:e5d3/99/a5+8595/9d/bd cheat description:Infinite bullets after obtaining a power up shell code:b6da/8d/2c+b6e6/8d/2c cheat description:Don't flash after getting hit code:e5d9/78/00 cheat description:Flash about half as long after getting hit code:e5d9/78/39 cheat description:Each Pow worth increases player level by one code:9721/01/04 cheat description:Infinite ammo code:b6da/8d/ad+b6e6/8d/ad+b6d5/ce/ad+b6e9/8d/ad cheat description:Start with all characters code:83ce/01/3f cheat description:Start with 500 bullets code:840b/01/05 cheat description:Start with 1 life code:effd/05/01 cartridge sha256:023ff157d96a8efc847c7d7cbe89574091fe099996e6283c63e3fb58918f3502 name:Gaiapolis (Asia) (Unl) cheat description:Invincibility code:8e47/f0/d0 cheat description:Infinite time code:c93e/c6/a5 cheat description:Infinite credits code:cea5/ce/ad cheat description:Hit anywhere code:9a34/b0/50+9a35/24/18+9988/b0/50+a486/74/b8+a485/d9/4c+a487/05/a4+9989/58/32 cheat description:Get items from anywhere code:9a72/b0/50+9a73/29/1f cartridge sha256:a636a947acf1ef0b50e66d31699b64aa4f3b4865e2f2031385780974fb6d8c91 name:Galactic Crusader (USA) (Unl) cheat description:Invincibility code:f13e/f0/d0 cheat description:Infinite lives code:debb/c6/a6 cartridge sha256:df49cc788fff36881fcf1d1cb22281d305260d4d8fbbe07ca2c4d699fe54843a name:Galaga - Demons of Death (USA) cheat description:Invincibility code:e87d/a6/60 cheat description:Infinite lives code:cb9e/ca/ea cheat description:Play challenge stages only code:ce99/d0/24 cheat description:Can't be caught by tractor beam code:e1d2/a5/a9+e1d3/79/07 cheat description:Press Start for next wave code:d271/80/94+d272/05/04+d26d/01/00 cheat description:Press Start for extra life code:d26c/a9/4c+d26d/01/a8+d26e/85/cb cheat description:Start with twin shots code:e089/d0/24 cheat description:Start with 1 life code:cd4c/03/01 cheat description:Start with 6 lives code:cd4c/03/06 cheat description:Infinite lives (alt) code:0485/05+0487/05 cartridge sha256:e6fe68b9f12578e74ba016ca146aaf8232b20475fb675c7d32e0ea4e47eb1cc8 name:Galaga (Japan) cheat description:Invincibility code:e904/a9/60 cheat description:Infinite lives code:cb9e/ca/ea cheat description:Keep double ship after being destroyed code:e8f4/a9/60 cheat description:Only one part to collect code:81dc/64/01 cheat description:Always get a perfect bonus code:d0e5/c9/29+d0e6/28/00 cheat description:Start with double shot code:c3e5/80/d5+cd47/95/29 cheat description:Infinite lives (alt) code:0485/05+0487/05 cartridge sha256:50178a2856f8ed3574b4e7fd45b9d1ec44c660d51fe9783d0012a19df5892cce name:Galaxian (Japan) cheat description:Infinite lives code:0042/05 cartridge sha256:c019750cc439810de6cbf1c3a895099674df3f397744ad3149ba1b25dd55d0ab name:Galaxy 5000 (USA) cheat description:Infinite time code:9040/de/bd cheat description:Reduce damage free of charge code:aefd/fd/2c cheat description:No damage from falling code:a9c0/20/ad cheat description:Take less damage code:f9fe/a5/a9+f9ff/1a/01 cheat description:More damage from falling code:a9bd/bd/ad+bf6e/23/30 cheat description:More damage from shots code:948a/e6/0e+948b/fe/bf cheat description:Always in 1st place - P1 code:00ab/00 cheat description:Always in 1st place - P2 code:00ac/00 cheat description:Always in 1st place - P3 code:00ad/00 cheat description:Always in 1st place - P4 code:00ae/00 cheat description:Infinite time (one's digit) code:069a/09 cheat description:Infinite time (ten's digit) code:069b/09 cheat description:Infinite time (hundred's digit) code:069c/09 cartridge sha256:055fb73baaed0f3c4a31902402e7fe581d2d2cb948d3a2f5c3552050f316e6df name:Gargoyle's Quest II (USA) cheat description:Invincibility (except Doppelganger when it mimics you) code:88d4/05/89 cheat description:Invincible against spikes code:e3ff/05/e4 cheat description:Infinite fight code:81db/a5/a9 cheat description:Walk through walls code:831c/90/10 cartridge sha256:a2039efb5b5b8d4941c31ae0977dacccec5aaa72fe307ae36af2a454d30d9e26 name:Garry Kitchen's BattleTank (USA) cheat description:Infinite energy code:9090/e6/c5 cheat description:Infinite hits code:9090/e6/a5+b9d7/85/a5 cheat description:Infinite fuel code:87b0/8d/cd cheat description:Infinite weapons code:e820/de/dd+e74d/ce/cd cheat description:Infinite ammo code:e820/de/bd cheat description:Start with half 150mm ammo code:a0e5/32/16 cheat description:Start with double 150mm ammo code:a0e5/32/63 cheat description:Start with more wire guided shells code:a0ee/01/32 cheat description:Start with max wire guided shells code:a0ee/01/63 cheat description:Start with more smoke shells code:a0f8/01/32 cheat description:Start with max smoke shells code:a0f8/01/63 cheat description:Start with less 50mm shells code:a101/96/4b cheat description:Start with max 50mm shells code:a101/96/ff cheat description:Start with less 50mm ammo after mission 5 code:a105/c8/64 cheat description:Start with max 50mm ammo after mission 5 code:a105/c8/ff cartridge sha256:fbc976422ca910d9391060898c8b58694f19b6e53a68bd33c457fb38dac1e5c6 name:Gauntlet (USA) (Unl) cheat description:Infinite health code:8f70/95/b5+9861/95/b5 cheat description:Infinite keys code:ab1e/00/09+ab21/a5/85 cheat description:Infinite time in puzzle and treasure rooms code:989f/c6/ea cheat description:Infinite time in puzzle and treasure rooms (alt) code:00c0/1e cheat description:Have all power-ups - P1 code:00ac/3f cheat description:Have all power-ups - P2 code:00ad/3f cheat description:Have Invisibility - P1 code:00aa/01 cheat description:Have Invisibility - P2 code:00ac/01 cheat description:Have Invulnerability - P1 code:00aa/20 cheat description:Have Invulnerability - P2 code:00ac/20 cheat description:Have Reflective shot - P1 code:00aa/04 cheat description:Have Reflective Shot - P2 code:00ac/04 cheat description:Have Repulsiveness - P1 code:00aa/02 cheat description:Have Repulsiveness - P2 code:00ac/02 cheat description:Have Super Shot - P1 code:00aa/10 cheat description:Have Super Shot - P2 code:00ac/10 cartridge sha256:fd2a8520314fb183e15fd62f48df97f92eb9c81140da4e6ab9ff0386e4797071 name:Gauntlet (USA) cheat description:Infinite health code:8f70/95/b5+9861/95/b5 cheat description:Infinite keys code:ab1e/00/09+ab21/a5/85 cheat description:Infinite time in puzzle and treasure rooms code:989f/c6/ea cheat description:Infinite time in puzzle and treasure rooms (alt) code:00c0/1e cheat description:Have all power-ups - P1 code:00ac/3f cheat description:Have all power-ups - P2 code:00ad/3f cheat description:Have Invisibility - P1 code:00aa/01 cheat description:Have Invisibility - P2 code:00ac/01 cheat description:Have Invulnerability - P1 code:00aa/20 cheat description:Have Invulnerability - P2 code:00ac/20 cheat description:Have Reflective shot - P1 code:00aa/04 cheat description:Have Reflective Shot - P2 code:00ac/04 cheat description:Have Repulsiveness - P1 code:00aa/02 cheat description:Have Repulsiveness - P2 code:00ac/02 cheat description:Have Super Shot - P1 code:00aa/10 cheat description:Have Super Shot - P2 code:00ac/10 cartridge sha256:ffa61d9f7bfb1d60662ddf246b21a8756d518292e8fdc0f58ac1c9b3fbad672d name:Gauntlet II (USA) cheat description:Infinite health code:df2f/9d/bd+e207/9d/bd cheat description:Take less damage code:df2d/e5/e9+df2e/00/02 cheat description:Infinite keys (new game) code:e01f/00/01+eb60/de/ad cheat description:Infinite time in treasure rooms code:e294/bd/ea cheat description:Walk through walls code:e53e/90/10+e55c/90/b0 cheat description:Weaker poison code:ed6e/64/32 cheat description:Stronger poison code:ed6e/64/c8 cheat description:5 super shots on pick-up code:eb30/0a/05 cheat description:20 super shots on pick-up code:eb30/0a/14 cheat description:Invincibility lasts longer code:eb06/3c/78 cheat description:Invincibility doesn't last as long code:eb06/3c/1b cheat description:Repulsiveness lasts longer code:eaf3/3c/78 cheat description:Repulsiveness doesn't last as long code:eaf3/3c/1b cheat description:Invisibility lasts longer code:eb14/3c/78 cheat description:Invisibility doesn't last as long code:eb14/3c/1b cheat description:Infinite health - P1 code:0739/ff cheat description:Infinite health - P2 code:073a/ff cheat description:Infinite health - P3 code:073b/ff cheat description:Infinite health - P4 code:073c/ff cheat description:Infinite Keys - P1 code:0743/04 cheat description:Infinite Keys - P2 code:0744/04 cheat description:Infinite Keys - P3 code:0745/04 cheat description:Infinite Keys - P4 code:0746/09 cheat description:Infinite Potions - P1 code:0748/03 cheat description:Infinite Potions - P2 code:0749/03 cheat description:Infinite Potions - P3 code:074a/03 cheat description:Infinite Potions - P4 code:074b/03 cheat description:Have Invulnerability - P1 code:0707/ff cheat description:Have Invulnerability - P2 code:0708/ff cheat description:Have Invulnerability - P3 code:0709/ff cheat description:Have Invulnerability - P4 code:070a/ff cheat description:Have Reflective Shot - P1 code:0716/ff cheat description:Have Reflective Shot - P2 code:0717/ff cheat description:Have Reflective Shot - P3 code:0718/ff cheat description:Have Reflective Shot - P4 code:0719/ff cheat description:Have Repulsiveness - P1 code:0711/ff cheat description:Have Repulsiveness - P2 code:0712/ff cheat description:Have Repulsiveness - P3 code:0713/ff cheat description:Have Repulsiveness - P4 code:0714/ff cheat description:Have Super Shot - P1 code:071b/0a cheat description:Have Super Shot - P2 code:071c/0a cheat description:Have Super Shot - P3 code:071d/0a cheat description:Have Super Shot - P4 code:071e/0a cheat description:Have Transportability - P1 code:0720/ff cheat description:Have Transportability - P2 code:0721/ff cheat description:Have Transportability - P3 code:0722/ff cheat description:Have Transportability - P4 code:0723/ff cartridge sha256:cf517940496d6085563bdbbe74f4a06d2c4eca48da8eb2b35d5cfe463df35ce4 name:George Foreman's KO Boxing (USA) cheat description:Invincibility code:fa9c/f0/10+faf5/49/a9 cheat description:Infinite health code:036e/43 cheat description:Can always use super punches code:e766/08/00 cheat description:Knock opponent down with 1 super punch code:f8ed/b1/a9+f8ee/ae/41 cheat description:Knock opponent down with 1 punch code:036f/01 cartridge sha256:43221ae8a386e8ddf68251d5870d6fe3d696be14a5e41d9a44c36227894044d8 name:Ghostbusters (USA) cheat description:Infinite fuel code:a2c0/c6/a5 cheat description:Infinite energy during Gozer fight code:f360/8d/ad cheat description:Immune to ghosts on Zuul stairway code:a99c/c6/a9 cheat description:Permanent ghost alarm code:8c0a/29/09 cheat description:Permanent ghost vacuum code:9153/29/09 cheat description:Self-emptying traps code:8cdd/a5/a9 cheat description:Super sprinting up Zuul stairway code:a881/01/00 cheat description:Stay Puft does not climb building during Gozer fight code:f926/ee/ad cheat description:Gozer dies in one hit code:f332/f0/d0 cheat description:No walk up Zuul stairway code:a629/17/00 cheat description:Start with $1,000,000 code:87ee/5e/60 cartridge sha256:1ea36ebd81692d3a3c1db217e0df832f060c1566c69a74fac299aaeb0d8eb82f name:Ghostbusters II (USA) cheat description:Invincibility code:9f71/f0/d0+9dec/f0/d0 cheat description:Infinite lives code:f3c0/de/bd cheat description:Infinite continues code:9a25/ce/ad cheat description:Triple continues code:c006/02/06 cheat description:Rapid-firing proton rifle code:9a89/1f/0a cheat description:All Ghostbusters can mega-jump code:9a5c/fe/fc cheat description:Shield lasts longer - car scenes code:a1a8/50/ff cheat description:Infinite shield - car scenes code:a71b/ce/ad cheat description:Start with 1 life code:e42c/03/00 cheat description:Start with 6 lives code:e42c/03/05 cheat description:Start with 9 lives code:e42c/03/08 cartridge sha256:eea66f7bcc90d1145454da487791be5926473bee4014313af12dfa0f7453ea81 name:Ghosts'n Goblins (USA) cheat description:Invincibility code:f5ec/01/00 cheat description:Infinite armor code:e3d6/c5 cheat description:Infinite lives - both players code:c907/ce/ad cheat description:Infinite time code:d396/ce/ad cheat description:Hit anywhere code:f607/90/38+f608/01/60+f5c1/99/b9+b6be/99/b9 cheat description:Enable stage select (disable after loading stage) code:d062/0f/00 cheat description:Speed up game code:d243/03/02 cheat description:Slow down game code:d243/03/04 cheat description:Start with Axe code:c5ff/40/36 cheat description:Start with Dagger code:c5ff/40/42 cheat description:Start with Fireball code:c5ff/40/44 cheat description:Start with Cross code:c5ff/40/4f cheat description:Start with Blue Sphere code:c5ff/40/ac cheat description:Start with 1 life - both players code:c609/03/01 cheat description:Start with 6 lives - both players code:c609/03/06 cheat description:Start with 9 lives - both players code:c609/03/09 cheat description:Start with 4 lives - P1 code:c60a/8d/8e cheat description:Enable stage select (disable after loading stage) code:00a7/0f cheat description:Automatically complete level code:00bf/01 cheat description:Game difficulty - normal code:00aa/00 cheat description:Game difficulty - hard code:00aa/01 cheat description:Game difficulty - harder code:00aa/02 cheat description:Game difficulty - hardest code:00aa/03 cheat description:Game difficulty - expert code:00aa/04 cartridge sha256:48aaef58dee3ad370546db569306e40aeecd27b88b7faef3ccd9b8b818c9ea71 name:Ghoul School (USA) cheat description:Invincibility code:aa41/20/ad cheat description:Infinite health code:abdd/8d/ad cheat description:Infinite lives code:c68f/ce/ad cheat description:Infinite health (alt) code:060a/ff cheat description:Infinitel lives (alt) code:0467/09 cheat description:One hit kills on most enemies code:060d/00+060e/00+060f/00+0610/00+0611/00+0612/00+0613/00 cartridge sha256:bf22e6aff97bb44210987f5631c1667d4fa75ef79522e8c46dbb3b0f4877896b name:Goal! (USA) cheat description:CPU score adds to your score code:c71b/f0/c9+c71f/f0/c9 cartridge sha256:7911375ab98da4ac5c628ba4dfffcba8ba4fc13a341901aed120ab967be5e26c name:Goal! Two (USA) cheat description:Infinite time - Italy, P2 code:f100/c6/a5 cheat description:P2 or computer can't score - Italy, P2 code:87fb/8d/ad cheat description:Start with more KP - Italy, P2 code:d740/09/20 cheat description:Start with a lot of KP - Italy, P2 code:d740/09/50 cheat description:Start with mega KP - Italy, P2 code:d740/09/99 cheat description:Start with more TP - Italy, P2 code:d741/07/20 cheat description:Start with a lot of TP - Italy, P2 code:d741/07/50 cheat description:Start with mega TP - Italy, P2 code:d741/07/99 cartridge sha256:c2383e5cd8670c7107d59887026b9001f30045aa5f07be4b687b7a6bc290db1f name:Godzilla - Monster of Monsters! (USA) cheat description:Infinite life (health) code:018c/30 cheat description:Infinite power code:0178/30 cartridge sha256:c41555b61617e52cae950e0a94d4d655646eed4e4ce4c1d26740ddee0a9ae090 name:Golf (USA) cheat description:Ball goes in from anywhere code:c265/03/00+d367/f0/10+d368/41/3d cartridge sha256:af24262bc78865b81b1a42d2842e222553fca27fb841a4eb8fbe26da7eba6163 name:Golf Grand Slam (USA) cheat description:Strokes aren't recorded code:a784/85/a5 cheat description:Some shots can be done more accurately code:eea0/05/01 cheat description:Wind always at 9 code:d411/25/a9+d412/28/09+a7d2/85/a5 cartridge sha256:9f559f83b9b5179137069bae0ca4b8eacf84378892b598044b88ef50681b58bb name:Golgo 13 - Top Secret Episode (USA) cheat description:Infinite health code:841e/85/a5+e8ca/c6/a9+f9cf/85/a5 cheat description:Health does not gradually decrease code:e8ca/c6/a5 cheat description:Infinite bullets in horizontal mode code:eeba/85/24 cheat description:Infinite damage in horizontal mode code:f9cf/85/24 cheat description:Infinite damage in pan/zoom mode code:841c/e5/24 cheat description:Infinite damage in maze code:b442/e5/24 cheat description:Have a health and bullets boost code:c06d/00/02 cartridge sha256:16c7de15b7dc72c567f58172bbf0cd1328d11625f6707814da030df15f95dc92 name:Goonies II, The (USA) cheat description:Invincibility code:80da/ad/8d cheat description:Infinite health code:be5f/85/a5 cheat description:Infinite time code:9a9b/d6/d5 cheat description:Infinite lives code:cf33/c6/a5 cheat description:Infinite Bombs on pick-up code:8db5/ce/ad cheat description:Infinite Molotov Bombs on pick-up code:8d60/ce/ad cheat description:Infinite Sling Shots on pick-up code:8e78/ce/ad cheat description:Super-jump code:89b1/02/07 cheat description:Mega-jump code:89b1/02/03 cheat description:Better Jumping Boots on pick-up code:89bc/04/05 cheat description:Super-speed code:80d1/01/02 cheat description:Walk through walls code:86d7/c9/10+8752/f0/10+8770/8d/ad cheat description:Start with all items code:d460/01/1f cheat description:Start with Boomerang code:d460/01/05 cheat description:Start with 4 health cells code:d432/02/04+d437/20/40 cheat description:Start with 8 health cells code:d432/02/08+d437/20/80 cheat description:Start with 1 life code:d42a/03/01 cheat description:Start with 6 lives code:d42a/03/06 cheat description:Start with 9 lives code:d42a/03/09 cheat description:Invincibility (alt) code:0516/41 cheat description:Infinite health (alt) code:0503/20 cheat description:Infinite lives (alt) code:0022/09 cheat description:Have all weapons code:050b/ff+050c/ff cheat description:Have all Implements code:050a/ff cheat description:Infinite Keys code:0500/08 cheat description:View ending (enable then disable) code:0000/08+0001/00 cartridge sha256:15685dee8bc1c588dfa2649b7b5f715aa7b4136454ba09c046d1b17209749d76 name:Gotcha! - The Sport! (USA) cheat description:Infinite time code:b55e/01/00 cheat description:Increase timer to 59 seconds code:9801/04/05+9806/05/09 cheat description:Decrease timer to 25 seconds code:9801/04/02+9806/05/05 cheat description:Start with double rations of ammo code:980c/01/02 cheat description:Enemies never shoot at you code:05f1/63 cheat description:Infinite ammo code:061a/09+061b/09 cheat description:Infinite time (alt) code:061e/09+061f/09 cartridge sha256:6918d7cbb81bfcd20d95bb08bcf137c7ea80ae9f0c12b92bfdcc90a6cf9752a0 name:Gradius (USA) cheat description:Infinite lives - both players code:979f/d6/a5 cheat description:Keep power capsules code:97ab/95/94 cheat description:Increase force field protection code:899c/05/ff cheat description:Never lose weapons code:9b3f/5a/4f+9b43/3d/47 cheat description:Hit anywhere code:c01f/10/00+c02c/03/00 cheat description:Start with 1 life - both players code:82fb/03/00 cheat description:Start with 6 lives - both players code:82fb/03/05 cheat description:Start with 9 lives - both players code:82fb/03/08 cartridge sha256:2974ad16b994cfdc9418310ced6c7f4ed64433063d12439a7b37a816f797dd0e name:Gradius II (Japan) cheat description:Invincibility code:f50c/20/60 cartridge sha256:fe3d2f94dadd3b2437e45ed9a38276b8b32af9e25d484de79c3cc7bf60eef386 name:Grand Master (Japan) cheat description:Invincibility code:0420/01 cheat description:Infinite HP code:044f/20 cheat description:Infinite MP code:0450/20 cheat description:Hit anywhere code:83ba/1a/00+83cb/b0/a9 cheat description:Have Armor code:0439/01 cheat description:Have Axe code:0431/01 cheat description:Have Boots code:0435/01 cheat description:Have Cross code:043b/01 cheat description:Have Diamond code:0437/01 cheat description:Have Exit Key code:0436/01 cheat description:Have Harp code:0434/01 cheat description:Have Hourglass code:043c/01 cheat description:Have Mirror code:043e/01 cheat description:Have Morning Star code:0433/01 cheat description:Have Necklace code:043d/01 cheat description:Have Potion code:0438/01 cheat description:Have Red Sword code:0430/01 cheat description:Have Rod code:0432/01 cheat description:Have Shield code:043a/01 cartridge sha256:60a7d102deac7491e08b7ed5a7b96e66e09758b8411f682a4df1a7e8b49e55c5 name:Great Waldo Search, The (USA) cheat description:Only need to find Waldo to complete the level code:de82/80/c0 cheat description:Only need to find the magic scroll code:deaf/40/c0 cheat description:Faster timer code:cec9/01/02 cheat description:Much faster timer code:cec9/01/04 cheat description:Play the Super Waldo Challenge code:d850/e9/a9+d851/03/04 cheat description:Extra clocks last forever code:ced4/c6/a5 cheat description:Extra clocks worth nothing code:df27/e6/a5 cartridge sha256:2b77da430b08e6a91a3453fde8ea82692415d44c3e953fdf281aa39352d5289d name:Gremlins 2 - The New Batch (USA) cheat description:Invincibility code:dd0b/d0/f0 cheat description:Infinite health code:81ca/c6/a5 cheat description:Infinite lives code:807e/ce/ad cheat description:Infinite balloons code:8a2b/ce/ad cheat description:Start with 5 lives code:c800/00/04 cheat description:Start with 10 lives code:c800/00/09 cheat description:Start with 3 balloons code:c805/01/03 cheat description:Start with 6 balloons code:c805/01/06 cheat description:Start with only 1 heart code:c80a/06/02+808b/06/02 cheat description:Start with 4 hearts code:c80a/06/08+808b/06/08 cheat description:Invincibility after one hit code:00a9/09 cheat description:Infinite health (alt) code:00ad/06 cheat description:Infinite lives (alt) code:057c/03 cheat description:Infinite Balloons (alt) code:050c/05 cheat description:Infinite Crystals code:056c/ff cheat description:One hit kills on bosses code:0360/00 cartridge sha256:d18ad8b76f9d067858dc8012ee84119c90524cdc3f4d555dd5a752a6f469fe6b name:Guardian Legend, The (USA) cheat description:Invincibility code:d2cb/a5/60 cheat description:Infinite health code:e325/ff/00 cheat description:Hit anywhere code:d357/6f/00+d356/25/c0+d358/f0/d0+d359/05/09 cheat description:Use up minimum shots code:8b94/e5/e9+8b95/10/01 cheat description:Never use up shots (To finish the game, save before opening the entrance to corridor 6. Restart with no codes and go through the enterance. Save again, then restart.) code:8b94/e5/24 cheat description:Start with less health code:80e5/40/20 cheat description:Start with more health code:80e5/40/80 cheat description:Start on area 1 code:eb48/00/01 cheat description:Start on area 3 code:eb48/00/03 cheat description:Start on area 5 code:eb48/00/05 cheat description:Start on area 7 code:eb48/00/07 cheat description:Start on area 9 code:eb48/00/09 cheat description:Fighter shape (Adventure and Space mode) code:0030/50 cheat description:Fighter shape in TGL mode (Adventure and Space mode) code:0030/52 cheat description:Max consecutive firing code:003a/01 cheat description:Have 2-way shot code:003a/01 cheat description:Have 3-way shot code:003a/02 cheat description:Have 4-way shot code:003a/03 cheat description:Max weapon power - Blue code:003d/01 cheat description:Max weapon power - Green code:003d/02 cheat description:Max weapon power - Red code:003d/03 cheat description:Start on area 10 code:0050/0a cheat description:Start on Corridor 01 code:0051/01 cheat description:Start on Corridor 02 code:0051/02 cheat description:Start on Corridor 03 code:0051/03 cheat description:Start on Corridor 04 code:0051/04 cheat description:Start on Corridor 05 code:0051/05 cheat description:Start on Corridor 06 code:0051/06 cheat description:Start on Corridor 07 code:0051/07 cheat description:Start on Corridor 08 code:0051/08 cheat description:Start on Corridor 09 code:0051/09 cheat description:Start on Corridor 10 code:0051/0a cheat description:Start on Corridor 11 code:0051/0b cheat description:Start on Corridor 12 code:0051/0c cheat description:Start on Corridor 13 code:0051/0d cheat description:Start on Corridor 14 code:0051/0e cheat description:Start on Corridor 15 code:0051/0f cheat description:Start on Corridor 16 code:0051/10 cheat description:Start on Corridor 17 code:0051/11 cheat description:Start on Corridor 18 code:0051/12 cheat description:Start on Corridor 19 code:0051/13 cheat description:Start on Corridor 20 code:0051/14 cheat description:Start on Corridor 21 code:0051/15 cheat description:Start on Corridor 22 code:0051/16 cartridge sha256:a2033c3b3d9f54b37fad8083604d37e2b2cb4ff77e0e183021141f55dfa9c4cd name:Guerrilla War (USA) cheat description:Invincibility code:e454/d0/f0+ec03/f0/d0 cheat description:Infinite lives - both players code:ce69/bd cheat description:Infinite lives - both players (alt) code:ce69/de/ad cheat description:Keep weapon after death code:ebb0/9d/ad cheat description:Press Start to complete the level code:c75f/11/0b cheat description:Start a new game to view the ending code:a0a8/08/09 cheat description:Start with 1 life - both players code:c9b6/00 cheat description:Start with 6 lives - both players code:c9b6/05 cheat description:Start with 9 lives - both players code:c9b6/09 cheat description:Invincibility - P1 code:0680/02 cheat description:Invincibility - P2 code:0681/02 cheat description:Infinite lives - P1 code:0028/05 cheat description:Infinite lives - P2 code:0029/04 cheat description:Infinite time for tank code:04c2/fa cheat description:Start on stage 2 (disable after loading stage) code:0039/01 cheat description:Start on stage 3 (disable after loading stage) code:0039/02 cheat description:Start on stage 4 (disable after loading stage) code:0039/03 cheat description:Start on stage 5 (disable after loading stage) code:0039/04 cheat description:Start on stage 6 (disable after loading stage) code:0039/05 cheat description:Start on stage 7 (disable after loading stage) code:0039/06 cheat description:Start on stage 8 (disable after loading stage) code:0039/07 cheat description:Start on stage 9 (disable after loading stage) code:0039/08 cheat description:Start on stage 10 (disable after loading stage) code:0039/09 cartridge sha256:4628f32db9b826d19fe5dd8e2c45a9f70e1041f15b7b44b06dee2f01731566e8 name:Gumshoe (USA, Europe) cheat description:Gain 1 bullet on pick-up code:8853/03/01 cheat description:Gain 6 bullets on pick-up code:8853/03/06 cheat description:Timer set to 04:00 code:874c/06/03 cheat description:Timer set to 10:00 code:874c/06/09 cheat description:Different attack waves code:8846/8c/8d cheat description:Start with 1 life code:883f/03/01 cheat description:Start with 6 lives code:883f/03/06 cheat description:Start with 9 lives code:883f/03/09 cheat description:Start with 25 bullets code:8858/50/25 cheat description:Start with 150 bullets code:885c/00/01 cheat description:Start with 250 bullets code:885c/00/02 cartridge sha256:d22a0c390dfc47c99226226c98158bf0ca3b4cd07dbd3d46cc50c2f1b9303c22 name:Gun Nac (USA) cheat description:Invincibility code:a001/50/40+a13c/50/40 cheat description:Infinite lives code:a397/8d/ad cheat description:Infinite special weapons code:a2e6/8d/ad cheat description:One hit kills code:d707/90/d0 cheat description:Enemies die automatically code:a133/18/00+d7d8/18/38+a136/ce/8d cheat description:Get items from anywhere code:d7ed/bc/38+d7ee/18/60 cheat description:Invincibility (alt) code:0400/02 cheat description:Infinite lives (alt) code:018d/03 cheat description:Infinite Bombs code:018f/04 cheat description:Weapon level 1 code:0033/00 cheat description:Weapon level 2 code:0033/01 cheat description:Weapon level 3 code:0033/02 cheat description:Weapon level 4 code:0033/03 cheat description:Weapon level 5 code:0033/04 cheat description:Weapon level 6 code:0033/05 cheat description:Weapon level 7 code:0033/06 cheat description:Weapon level 8 code:0033/07 cheat description:Weapon type 1 code:0034/00 cheat description:Weapon type 2 code:0034/01 cheat description:Weapon type 3 code:0034/02 cheat description:Weapon type 4 code:0034/03 cheat description:Weapon type 5 code:0034/04 cheat description:Bomb power level 2 code:003b/01 cheat description:Bomb power level 3 code:003b/02 cheat description:Bomb power level 4 code:003b/03 cheat description:Turbo power level 2 code:003c/01 cheat description:Turbo power level 3 code:003c/02 cheat description:Turbo power level 4 code:003c/03 cheat description:Turbo power level 5 code:003c/04 cheat description:Start on level 2 code:0180/02 cheat description:Start on level 3 code:0180/03 cheat description:Start on level 4 code:0180/04 cheat description:Start on level 5 code:0180/05 cheat description:Start on level 6 code:0180/06 cheat description:Start on level 7 code:0180/07 cheat description:Start on level 8 code:0180/08 cartridge sha256:f39421a126f3b93caa37d6c3ed899840ddfd51b0587446ca459f72564aca1433 name:Gun.Smoke (USA) cheat description:Infinite lives code:f3b6/c6/a5 cheat description:Keep weapons after death code:f3a8/00/01 cheat description:Start with all weapons and lots of ammo code:e736/00/01 cheat description:Start with all weapons, lots of ammo, all 4 boots and all 4 rifle icons code:e736/00/04 cheat description:Start with 9 lives code:e72e/03/09 cheat description:Start with 25 lives code:e72e/03/19 cartridge sha256:0d895a031dd38f2661ba2af4a1b3c7b9753632b1530ea28eec936cf3fda8bf54 name:Gyromite (World) cheat description:Invincible against enemies code:ae34/20/ad cheat description:Invincible against upward crushing code:a91a/a9/60 cheat description:Infinite lives code:85a0/b5 cheat description:Climb up through flooring code:aad6/03/00 cheat description:Climb down through flooring code:aa90/03/00 cheat description:Slow down timer code:8d83/0a cheat description:Start with 1 life code:83b4/05/01 cheat description:Start with 10 lives code:83b4/05/0a cheat description:Start with 20 lives code:83b4/05/14 cartridge sha256:c6e275929764f7950ee85806ef5fdab9dda36e27f9f29935101bfc0916bf90a6 name:Gyruss (USA) cheat description:Invincibility code:a0de/a5/a9 cheat description:Infinite lives code:908d/0a/00 cheat description:Never lose twin shots code:9085/02/04+9087/01/81 cheat description:Gain 2 phasers when you die with none code:9087/01/02 cheat description:Gain 4 phasers when you die with none code:9087/01/04 cheat description:Start with 1 ship code:832c/04/01 cheat description:Start with 10 ships code:832c/04/0a cheat description:Start with 4 phasers code:8648/01/04 cheat description:Start with 8 phasers code:8648/01/08 cheat description:Start with twin shots + 1 phaser code:8648/01/81 cheat description:Start with twin shots + 4 phasers code:8648/01/84 cheat description:Start with twin shots + 8 phasers code:8648/01/88 cartridge sha256:bd5c7925e616da879ee63ac4ac2004af26e20ae36a494247e704d41440ac971a name:Hammerin' Harry (Europe) cheat description:Infinite energy (except spikes) code:bcb3/8d/ad cheat description:Infinite lives code:a944/ce/ad cheat description:Invincibility code:f6d9/f0/d0+f6d6/ad/8d cartridge sha256:6e2b0e222eb8dba29c0ca363f1d7d59ed1fa307bafc150b5c8e1dd13638555a6 name:Happy Pairs (Asia) (PAL) (Unl) cheat description:Infinite tries code:b04a/c6/a5 cheat description:Infinite time code:beaf/c6/a5 cheat description:Infinite autos code:b175/c6/a5 cartridge sha256:07bfd5bf6d3e5cea26d0a521e7d599d67a4b794c5efa66e4189877c1361aad47 name:Harlem Globetrotters (USA) cheat description:Slower timer code:c935/2d/55 cheat description:Faster timer code:c935/2d/1c cheat description:Slower shot clock code:c964/2d/55 cheat description:Faster shot clock code:c964/2d/1c cartridge sha256:fd3c19b0339bf2b326d8a0526216b5143f035f68dabb3b3392689c92d6c140d9 name:Heavy Barrel (USA) cheat description:Invincibility code:bbe8/09/60 cheat description:Invincibility and invisibility on second life code:e81e/ca/ea cheat description:Infinite lives code:ee12/c6/a5 cheat description:Infinite Bombs code:ebee/d6/a5 cheat description:Infinite Keys code:b5ca/95/b5 cheat description:Infinite Mace code:b7fe/69/a9 cheat description:Infinite hand weapons on pick-up - both players code:ebec/d0/f0 cheat description:Infinite hand weapons and firearms on pick-up - both players code:ebee/d6/a9 cheat description:Hand weapons last 4x longer code:ebca/55/00 cheat description:Only 1 hand weapon code:e918/00/02 cheat description:Autofire - P1 code:e6d1/fd/f8 cheat description:Autofire - P2 code:e77d/fd/f8 cheat description:Enemies don't fire handguns code:a8c6/ca/ea cartridge sha256:0a23312c8e07b9af753b25c1307f07f8061d6ac4f8427f4660382d925e7a84e2 name:Heavy Shreddin' (USA) cheat description:Infinite penalties code:95df/c6/a5+9391/c6/a5+93ba/c6/a5 cheat description:Select any level code:83bf/00/ff cheat description:Slow timer code:ae8f/18/38 cheat description:Faster left and right movement code:8bdc/01/02+8bec/01/02 cheat description:1 penalty code:83c1/04/01 cheat description:8 penalties code:83c1/04/08 cheat description:16 penalties code:83c1/04/10 cartridge sha256:429c833eb61c0728b0d9335c61f4bd8d3fb19c3bf8a18564917bf75526f104af name:Heisei Tensai Bakabon (Japan) cheat description:Invincibility code:c5c3/f0/d0 cheat description:Infinite health code:c117/c6/c5 cheat description:Infinite time code:8ac9/85/a5 cartridge sha256:1c8e9b6c4c57850d4ab1dea011e0226970034a46fa29fab1d370c01fac90538d name:Hell Fighter (Asia) (PAL) (Unl) cheat description:Infinite lives code:ad5f/ce/ad+ad62/ce/ad cartridge sha256:680a56e038176c7b8deca9fb910b26b097cadd58fa553ea29f3c9836c9a4e11b name:Hello Kitty no Ohanabatake (Japan) cheat description:Invincibility code:d7db/8d/ad cheat description:Infinite lives code:fc1f/9d/bd cartridge sha256:72fa562dfb319bfe982a68053128126e2ed5d579ff1a36f7345bd3fe624e8e92 name:Heracles no Eikou - Toujin Makyou Den (Japan) cheat description:No random battles code:e2de/20/60 cartridge sha256:8e4a04076b6a728a7e65a09737776dcb9defed7922bf0437d9a89bbe8c724b55 name:Hogan's Alley (World) cheat description:Hit anywhere - Game B code:d01d/f5/00+d429/80/00 cheat description:5 misses allowed - Game A code:cd09/10/05 cheat description:20 misses allowed - Game A code:cd09/10/20 cheat description:Infinite misses allowed - all games code:ce10/01/00 cheat description:Each miss counts as 2 - all games code:ce10/01/02 cheat description:Infinite misses allowed - all games (alt) code:00b3/00 cartridge sha256:1c1ad2992f728c7fb6a8f3980b1a0f8e01e5b24a0c43c713300846d87be5987a name:Holy Diver (Japan) cheat description:Invincibility code:f8f7/8d/60 cheat description:Infinite health code:f8f7/8d/ad cheat description:Infinite lives code:e1ce/ce/ad cartridge sha256:3f761f529d40cf42aed60fabc0e60ecfecf528f4165948e6157b552e3bbb4f89 name:Home Alone 2 - Lost in New York (USA) cheat description:Infinite power units/life points code:fd75/ce/ad cheat description:Become almost invincible after losing 1 life point (against most enemies, vacuum cleaner can still kill you) code:e65b/ce/ad cheat description:Infinite lives code:fe04/ce/ad cheat description:Infinite slides on pick-up code:841b/ce/ad cheat description:Infinite darts on pick-up code:846e/ce/ad cheat description:Infinite flying fists on pick-up code:8450/ce/ad cheat description:Every 4 cookies count as 8 code:fcf6/04/08 cheat description:Every 4 cookies count as 12 code:fcf6/04/0c cheat description:Every 4 cookies count as 16 code:fcf6/04/10 cheat description:Every 4 cookies count as 20 (extra life point) code:fcf6/04/14 cheat description:Extra life with 5 pizza slices instead of 6 code:ec1b/06/05 cheat description:Extra life with 4 pizza slices code:ec1b/06/04 cheat description:Extra life with 3 pizza slices code:ec1b/06/03 cheat description:Extra life with 2 pizza slices code:ec1b/06/02 cheat description:Extra life with every pizza slice code:ec1b/06/01 cheat description:Start with 1 life instead of 3 code:9385/03/01 cheat description:Start with 5 lives code:9385/03/05 cheat description:Start with 7 lives code:9385/03/07 cheat description:Start with 9 lives code:9385/03/09 cheat description:Start with 25 lives code:9385/03/19 cheat description:Start with 50 lives code:9385/03/32 cheat description:Start with 75 lives code:9385/03/4b cheat description:Start with 99 lives code:9385/03/63 cartridge sha256:f3ff0c50c05aa5d461c293e306e553152e63564cd09e80ae0b6dcfa97b07d073 name:Hook (USA) cheat description:Infinite health - P1 code:dd64/e5/24 cheat description:Infinite health - P2 code:dd7f/e5/24 cheat description:Infinite lives - P1 code:f01d/ce/ad cheat description:Max health from food - P1 code:ddf1/05/00 cheat description:Max health from food - P2 code:de07/05/00 cheat description:No health from food code:dde2/2c/60 cheat description:Start with 1 life code:eeaf/02/00 cheat description:Start with 6 lives code:eeaf/02/05 cheat description:Start with 9 lives code:eeaf/02/08 cheat description:Infinite health - P1 (alt) code:0365/6f cheat description:Infinite lives - P1 (alt) code:0367/09 cheat description:Max Green Balls code:0363/63 cheat description:Infinite Cakes code:0487/63 cheat description:Max Green Thimbles code:0364/63 cartridge sha256:3991a761116131dc412fd7cfe8e70bf414d11fa4778e9dfb049ffcc9a8586cac name:Hudson Hawk (USA) cheat description:Infinite health code:e784/85/a5 cheat description:Infinite lives code:c75f/c3/a9+c762/f0/a9 cheat description:Infinite continues code:c848/30/a9+c846/c6/a9 cheat description:Start with very little health - first life only code:c6ea/ff/01 cheat description:Start with 1/4 health - first life only code:c6ea/ff/40 cheat description:Start with 1/2 health - first life only code:c6ea/ff/70 cheat description:Start with 3/4 health - first life only code:c6ea/ff/b0 cheat description:Start with 1 continue code:c6d9/03/01 cheat description:Start with 5 continues code:c6d9/03/05 cheat description:Start with 9 continues code:c6d9/03/09 cheat description:Start with 1 life code:c6e6/05/01 cheat description:Start with 3 lives code:c6e6/05/03 cheat description:Start with 9 lives code:c6e6/05/09 cartridge sha256:53bfc94fce46a25188f84f102810406f686a7fb13fb5e4ae8f13760106acb969 name:Hudson's Adventure Island (USA) cheat description:Invincibility code:c05a/a4/60 cheat description:Infinite health code:c0cd/c6/a5 cheat description:Immune to rocks code:c0f3/84/24 cheat description:Keep weapons code:8128/85/24 cheat description:Hit anywhere code:c146/dc/00+c14f/07/00+c152/99/b9 cheat description:Multi-jump code:84e4/d0/24+84e9/d0/24 cheat description:Get fruits from anywhere code:8b39/b0/d0 cheat description:Collectable items never disappear code:8b40/de/60 cheat description:Can mega-jump while at rest code:850d/c0/95 cheat description:Can mega-jump while running code:850e/a9/95 cheat description:Multi-mega-maxi-moon jumps code:8507/01/00+84ea/21/00 cheat description:Skateboard doesn't automatically move forward code:8555/d0/30 cheat description:Hudson can moonwalk code:85c1/01/00+858a/00/01 cheat description:Start with infinite lives code:811c/c6/a5 cheat description:Start with 1 life code:8089/03/01 cheat description:Start with 6 lives code:8089/03/06 cheat description:Start with 9 lives code:8089/03/09 cartridge sha256:bafe68d5e6bbebb0d71432d09bed0a482215d4534778a76d471150a3bdd01b08 name:Hunt for Red October, The (USA) (Rev A) cheat description:Infinite lives code:aa82/c6/a5 cheat description:Infinite time code:b389/ce/ad cheat description:Infinite horizontal torpedoes code:a5bf/ce/ad cheat description:Infinite vertical torpedoes code:a631/ce/ad cheat description:Maximum power horizontal torpedoes on pick-up code:bc08/c9/a9+bc0e/01/00 cheat description:Maximum power vertical torpedoes on pick-up code:bc57/c9/a9+bc5d/01/00 cheat description:Start with 10 horizontal torpedoes code:bc76/19/0a cheat description:Start with 50 horizontal torpedoes code:bc76/19/32 cheat description:Start with 99 horizontal torpedoes code:bc76/19/63 cheat description:Start with 5 vertical torpedoes code:bc7b/0f/05 cheat description:Start with 50 vertical torpedoes code:bc7b/0f/32 cheat description:Start with 99 vertical torpedoes code:bc7b/0f/63 cheat description:Start with 5 caterpillars code:bc85/0a/05 cheat description:Start with 50 caterpillars code:bc85/0a/32 cheat description:Start with 99 caterpillars code:bc85/0a/63 cheat description:Start with 5 ECM's code:bc8a/0a/05 cheat description:Start with 50 ECM's code:bc8a/0a/32 cheat description:Start with 99 ECM's code:bc8a/0a/63 cheat description:Start with 1 life code:b0e7/05/01 cheat description:Start with 10 lives code:b0e7/05/0a cartridge sha256:770abf58074764db12aade941ab1a389a818b8ff94d95f4b4b4913912b1f40b5 name:Hydlide (USA) cheat description:Boost strength, life, magic code:8640/0a/28 cheat description:Super boost strength, life, magic code:8640/0a/64 cheat description:Don't take damage from most enemies code:c7d7/85/a5 cheat description:Rapid healing code:8ebc/0d/00 cheat description:Rapid magic healing code:9a7e/02/00 cheat description:Infinite life code:0038/64 cheat description:Max STR code:0039/64 cheat description:Max EXP code:003a/64 cheat description:Max Magic code:003b/64 cheat description:Have the Sword code:0059/ff cheat description:Have the Shield code:005a/ff cheat description:Have the Lamp code:005b/ff cheat description:Have the Cross code:005c/ff cheat description:Have the Pot code:005d/ff cheat description:Have the Medicine code:005e/ff cheat description:Have the Key code:005f/ff cheat description:Have the Ruby code:0060/ff cheat description:Have the Ring code:0061/ff cheat description:Have the Jewel code:0062/ff cheat description:Have 3 Fairies code:0063/ff+0064/ff+0065/ff cartridge sha256:002bb62441c1625051555109bce93ff2e2a2badb534a350b6d17ad0d7e7ef023 name:Ice Climber (USA, Europe) cheat description:Invincibility code:d348/20/60 cheat description:Infinite lives code:d481/d6/c9 cheat description:Super-jump code:c839/22/1c cheat description:Enemies bump you instead of killing you code:d346/f0/b0 cheat description:Double speed code:cbda/ff/fe+cbdb/01/02 cheat description:Triple speed code:cbda/ff/fd+cbdb/01/03 cheat description:Start with 1 life code:c4ae/03/00 cheat description:Start with 6 lives code:c4ae/03/05 cheat description:Start with 9 lives code:c4ae/03/08 cartridge sha256:3775c1184419c0786841c5b4f2694b2a15e181678f92e75fb9b71bfb5668c7b3 name:Ikari Warriors (USA) (Rev A) cheat description:Invincibility code:f3e0/4c/ad cheat description:Invincibility (except against bombs) code:b7e2/f0/d0 cheat description:Invincibility (blinking) code:e023/80/84 cheat description:Infinite lives code:f6da/d6/a5 cheat description:Infinite Missiles for Tank code:fbae/de/ad cheat description:Infinite Bullets code:f51a/de/ad cheat description:Infinite Grenades code:f582/de/ad cheat description:Enemies die automatically code:b740/73/00+9117/1c/00+b9bd/b0/50+8698/90/24 cheat description:Hit anywhere (except tanks and helicopters) code:b9a9/01/00+b9ab/13/3b+b9a8/29/c9 cheat description:Start with 1 life code:f631/03/01 cheat description:Start with 6 lives code:f631/03/06 cheat description:Start with 9 lives code:f631/03/09 cheat description:Start with 50 Bullets code:f2fb/63/32 cheat description:Start with 99 Grenades code:f300/32/63 cheat description:Start with 25 Grenades code:f300/32/19 cheat description:Infinite lives - P1 code:00e4/09 cheat description:Infinite lives - P2 code:00e5/09 cheat description:Infinite Bullets - P1 code:067f/63 cheat description:Infinite Bullets - P2 code:0682/63 cheat description:Infinite Grenades - P2 code:0680/63 cheat description:Infinite Grenades - P1 code:0681/63 cheat description:Infinite Fuel for tank - P1 code:0683/ff cheat description:Infinite Fuel for tank - P2 code:0684/ff cheat description:Have 3-Way Shot, B Grenades, Super Speed, Knife - P1 code:0674/df cheat description:Have F Shot, Long Range, Rapid Fire, B Grenades, Super Speed, Knife - P1 code:0674/ef cheat description:Have 3-Way Shot, B Grenades, Super Speed, Knife - P2 code:0675/df cheat description:Have F Shot, Long Range, Rapid Fire, B Grenades, Super Speed, Knife - P2 code:0675/ef cartridge sha256:294f70829b72f3d1b6c81be92b542e96fec1a243d16dfd338a4226b97ad09732 name:Ikari Warriors (USA) cheat description:Invincibility code:f3e0/4c/ad cheat description:Invincibility (except against bombs) code:b7e2/f0/d0 cheat description:Invincibility (blinking) code:e023/80/84 cheat description:Infinite lives code:f6da/d6/a5 cheat description:Infinite Missiles for Tank code:fbae/de/ad cheat description:Infinite Bullets code:f51a/de/ad cheat description:Infinite Grenades code:f582/de/ad cheat description:Enemies die automatically code:b740/73/00+9117/1c/00+b9bd/b0/50+8698/90/24 cheat description:Hit anywhere (except tanks and helicopters) code:b9a9/01/00+b9ab/13/3b+b9a8/29/c9 cheat description:Start with 1 life code:f631/03/01 cheat description:Start with 6 lives code:f631/03/06 cheat description:Start with 9 lives code:f631/03/09 cheat description:Start with 50 Bullets code:f2fb/63/32 cheat description:Start with 99 Grenades code:f300/32/63 cheat description:Start with 25 Grenades code:f300/32/19 cheat description:Infinite lives - P1 code:00e4/09 cheat description:Infinite lives - P2 code:00e5/09 cheat description:Infinite Bullets - P1 code:067f/63 cheat description:Infinite Bullets - P2 code:0682/63 cheat description:Infinite Grenades - P2 code:0680/63 cheat description:Infinite Grenades - P1 code:0681/63 cheat description:Infinite Fuel for tank - P1 code:0683/ff cheat description:Infinite Fuel for tank - P2 code:0684/ff cheat description:Have 3-Way Shot, B Grenades, Super Speed, Knife - P1 code:0674/df cheat description:Have F Shot, Long Range, Rapid Fire, B Grenades, Super Speed, Knife - P1 code:0674/ef cheat description:Have 3-Way Shot, B Grenades, Super Speed, Knife - P2 code:0675/df cheat description:Have F Shot, Long Range, Rapid Fire, B Grenades, Super Speed, Knife - P2 code:0675/ef cartridge sha256:119f865684be58f37101b431975c827b2ad9340c0f2d3d9fc3153ee1213ee55e name:Ikari Warriors II - Victory Road (USA) cheat description:Infinite health code:b39d/99/b9 cheat description:Don't take damage from most enemies code:b397/e5/24 cheat description:Start with half normal health code:f7f5/60/30 cheat description:Maximum weapon power on pick-up code:a83e/69/a9+a83f/01/04 cheat description:Infinite health (alt) code:06d1/32 cheat description:Infinite hearts code:00f8/80 cheat description:Have Machine Gun code:06c3/04 cheat description:Start with and keep Arrow code:00f2/01 cheat description:Start with and keep Bazooka code:06c5/04 cheat description:Start with and keep Boomerang code:06c7/04 cheat description:Start with and keep Earthquake code:00ec/01 cheat description:Start with and keep Elixir code:00f6/01 cheat description:Start with and keep Grenades code:06cb/04 cheat description:Start with and keep Land Mines code:06cd/04 cheat description:Start with and keep Lightning code:00ea/01 cheat description:Start with and keep Shield code:00f0/01 cheat description:Start with and keep Sword code:06c9/04 cheat description:Start with and keep Time Stopper code:00f4/01 cheat description:Start with and keep Wings code:00ee/01 cartridge sha256:181163b590a581b6d04baaedb815429a2342ded27b3fb7f2514661d1fd47c1cc name:Ikari III - The Rescue (USA) cheat description:Invincibility code:ba43/20/ad cheat description:Infinite health code:b85f/9d/bd cheat description:Infinite lives code:cfb7/01/00 cheat description:Infinite lives (alt) code:cfbc/9d/bd cheat description:Immune to most kicks and punches code:b859/e5/24 cheat description:3-way firing, instead of punching code:ccde/01/07 cheat description:Always throw grenades instead of punches code:ccde/01/09 cheat description:1 life after continue code:c3aa/03/01 cheat description:6 lives after continue code:c3aa/03/06 cheat description:9 lives after continue code:c3aa/03/09 cheat description:Start with 1 life code:c89b/03/01 cheat description:Start with 6 lives code:c89b/03/06 cheat description:Start with 9 lives code:c89b/03/09 cartridge sha256:7032a94d140339f9d6603accc9fed2846f5bbb781659cdff869d4b5f137d4e4a name:Image Fight (USA) cheat description:Invincibility code:a4cf/d0/f0+9193/d0/f0 cheat description:Infinite lives - both players code:a1d6/c6/a5 cheat description:Never lose Pods code:b456/a9/60 cheat description:Start with V Cannon code:b404/00/01 cheat description:Start with Reflecting Ball code:b404/00/02 cheat description:Start with Drilling Laser code:b404/00/03 cheat description:Start with Seeking Missile code:b404/00/04 cheat description:Start with Seeking Laser code:b404/00/05 cheat description:Start with 1 life - both players code:a16b/03/01 cheat description:Start with 6 lives - both players code:a16b/03/06 cheat description:Start with 9 lives - both players code:a16b/03/09 cheat description:Start at Combat Simulation Stage 2 code:a163/00/01 cheat description:Start at Combat Simulation Stage 3 code:a163/00/02 cheat description:Start at Combat Simulation Stage 4 code:a163/00/03 cheat description:Start at Combat Simulation Stage 5 code:a163/00/04 cheat description:Start at Real Combat - 1st Target code:a163/00/05 cheat description:Start at Real Combat - 2nd Target code:a163/00/06 cartridge sha256:8bc6a252778c2909a97b3fff185c5ff2a1786afe5e8237098f15fe3eaf23adab name:Immortal, The (USA) cheat description:Enemy's fatigue level doesn't go down code:b215/ce/2c cheat description:Your fatigue level doesn't go down code:b21d/ce/2c cheat description:Your fatigue level goes down faster code:b20d/7f/3f cheat description:Your fatigue level goes down slower code:b20d/7f/ff cheat description:Don't lose energy from fighting code:b256/ce/ad cheat description:Your fatigue level never rises code:b271/ee/ad cheat description:More damage from fireballs code:d74d/01/02 cheat description:Instant kills on enemies code:0362/00 cheat description:Infinite health in battle sequences code:0363/0f cheat description:Infinite Gold code:042c/ff cartridge sha256:c42fc592821b474b486ae32d1d63e8938f1735a6d45db026f7b78b2ec51427ac name:Incredible Crash Dummies, The (USA) cheat description:Invincibility code:a73f/f0/d0 cheat description:Infinite health code:c764/8c/ac cheat description:Infinite lives code:c778/8c/ac cheat description:Invincibility (blinking) code:053c/01 cartridge sha256:79c03fec3f459ac6e762c27d8f08debe6589b01df21919ef69645870a16723b3 name:Indiana Jones and the Last Crusade (USA) (UBI Soft) cheat description:Infinite health (you can get trapped in certain areas) code:fa1c/04/fe cheat description:Infinite time code:968f/01/00 cheat description:Infinite credits code:a0ad/ce/ad cheat description:Infinite lives code:ec50/04/fc cheat description:Infinite lives on bike section code:8d38/c6/a5 cheat description:More lives on ship section code:8764/05/09 cheat description:Fewer lives on ship section code:8764/05/01 cheat description:More lives on tank section code:9505/06/09 cheat description:Fewer lives on tank section code:9505/06/01 cheat description:More lives on castle section code:90a6/03/09 cheat description:Fewer lives on castle section code:90a6/03/01 cheat description:Heart does nothing (may goof up energy bar) code:9bc2/01/00 cheat description:Super-jump code:e864/01/05 cheat description:Mega-jump code:e864/01/09 cheat description:Continue with 1 life code:a0b1/03/01 cheat description:Continue with 5 lives code:a0b1/03/05 cheat description:Continue with 7 lives code:a0b1/03/07 cheat description:Continue with 9 lives code:a0b1/03/09 cheat description:Start with 1 life code:c06c/03/01 cheat description:Start with 5 lives code:c06c/03/05 cheat description:Start with 7 lives code:c06c/03/07 cheat description:Start with 9 lives code:c06c/03/09 cheat description:Start on level 2 (after completing the level you'll go back to level 1) code:c071/00/01 cheat description:Start on level 3 (after completing the level you'll go back to level 1) code:c071/00/02 cheat description:Start on level 4 (after completing the level you'll go back to level 1) code:c071/00/03 cheat description:Start on level 5 (after completing the level you'll go back to level 1) code:c071/00/04 cheat description:Start on level 6 (after completing the level you'll go back to level 1) code:c071/00/05 cartridge sha256:5348f7f88695867de428b38eb6a7f724f5f97110c383567d7e4d1f5a2d8b612f name:Indiana Jones and the Last Crusade (USA) (Taito) cheat description:Infinite health code:911b/0d/8d cartridge sha256:884765e5df86042211191f7e7e4653255425e3da70a9dec6f4a9336c07b5f258 name:Indiana Jones and the Temple of Doom (USA) (Rev A) cheat description:Infinite lives code:ac09/ce/ad cheat description:Infinite time code:a020/ce/ad cheat description:Always keep Sword code:a354/ce/ad cheat description:Always keep Gun code:a63a/ce/ad cheat description:Start with less time code:bc4a/63/3c+ab8b/3c/63+ac1e/3c/63 cheat description:Start with 1 life code:bbc3/04/00 cheat description:Start with 10 lives code:bbc3/04/09 cheat description:Start with 15 lives code:bbc3/04/0e cheat description:Start on level 2 code:bc40/0f/11 cheat description:Start on level 4 code:bc40/0f/15 cheat description:Start on level 6 code:bc40/0f/19 cheat description:Start on level 8 code:bc40/0f/1d cheat description:0 Maps left code:012f/00 cheat description:Have all 3 Keys code:011d/b0 cartridge sha256:8125d69b66dd7784246156bb669542924f1c2b7f53b8d325ffcbaa74746d14ff name:Indiana Jones and the Temple of Doom (USA) cheat description:Infinite lives code:ac09/ce/ad cheat description:Infinite time code:a020/ce/ad cheat description:Always keep Sword code:a354/ce/ad cheat description:Always keep Gun code:a63a/ce/ad cheat description:Start with less time code:bc4a/63/3c+ab8b/3c/63+ac1e/3c/63 cheat description:Start with 1 life code:bbc3/04/00 cheat description:Start with 10 lives code:bbc3/04/09 cheat description:Start with 15 lives code:bbc3/04/0e cheat description:Start on level 2 code:bc40/0f/11 cheat description:Start on level 4 code:bc40/0f/15 cheat description:Start on level 6 code:bc40/0f/19 cheat description:Start on level 8 code:bc40/0f/1d cheat description:0 Maps left code:012f/00 cheat description:Have all 3 Keys code:011d/b0 cartridge sha256:0bb401bbd0cae2758b2bd355cd3cac3cc26a01950859c830b3b122bd379f2463 name:Infiltrator (USA) cheat description:Infinite time code:b445/ce/ad cheat description:Never lose Grenades outside buildings code:adca/c6/a5 cheat description:Never lose Grenades inside buildings code:c568/c6/a5 cheat description:Never lose Spray outside buildings code:adbc/c6/a5 cheat description:Never lose Spray inside buildings code:c53f/c6/a5 cheat description:Start with less time code:b21b/39/35 cheat description:Start with more Grenades code:b251/0a/12 cheat description:Start with fewer Grenades code:b251/0a/05 cheat description:Start with no Grenades code:b251/0a/00 cheat description:Start with less Spray code:b24d/26/13 cheat description:Start with no Spray code:b24d/26/00 cartridge sha256:0f406a7c853b919ed880868420808b945855146db9817ebc3102f08da13fa703 name:Insector X (Japan) cheat description:Invincibility code:00ca/00 cheat description:Infinite lives code:00d8/03 cheat description:Max shot power-up code:00cc/06 cartridge sha256:6fac8ea87f7eea5e9bf7b838ff92c2fa3369908c866631340ec489beacdcbf3b name:Iron Tank - The Invasion of Normandy (USA) cheat description:Infinite health code:e83c/9d/bd cheat description:Infinite lives code:c515/01/d1+c4be/ce/ad cheat description:Start with 1 life code:c515/01/d1+c43c/02/00 cheat description:Start with 6 lives code:c515/01/d1+c43c/02/05 cheat description:Start with 9 lives code:c515/01/d1+c43c/02/08 cheat description:Infinite health (alt) code:0306/ff cheat description:Infinite lives (alt) code:01d1/09 cartridge sha256:aab5e0ecc46e575b1b396bd63d8fa4f3bd740061f3157a1d4afdf9f7f2dabd88 name:IronSword - Wizards & Warriors II (USA) cheat description:Infinite lives code:88a7/c6/a9 cheat description:Infinite continues code:8932/c6/a9 cheat description:Infinite spells code:dcaf/de/2c cheat description:Infinite money code:dc98/00/02 cheat description:Infinite keys once one is obtained code:959e/a5/85 cheat description:Super-jump code:d334/e5/e9+d335/86/09 cheat description:Food gives full health code:9888/02/00 cheat description:Drink gives full health code:9917/02/00 cheat description:Fleet foot jumping code:d157/03/00 cheat description:Fleet foot running code:d3cf/29/a9 cheat description:Start with Axe and Helmet code:8aea/00/03 cheat description:Start with Shield code:8ae6/ff/02 cheat description:Start with Ironsword code:8314/0c/00 cheat description:Start on wind level code:8289/00/0b cheat description:Start on tree level code:8289/00/14 cheat description:Start on water level code:8289/00/16 cheat description:Start on outer fire level code:8289/00/15 cheat description:Start on lower earth level code:8289/00/33 cheat description:Start on lower icefire mountain code:8289/00/31 cheat description:Start a new game with full magic code:8b06/00/ff cheat description:Start with 1 life code:8af0/03/01+89da/03/01 cheat description:Start with 6 lives code:8af0/03/06+89da/03/06 cheat description:Infinite health (disable at end of stage) code:006a/ff cheat description:Infinite magic once obtained (disable at end of stage) code:006b/ff cheat description:Infinite Keys code:006c/08 cheat description:Infinite money (alt) code:0096/0a+008b/64 cheat description:Have the Sindarin Treasures code:00f7/0f cheat description:Have the Dagger code:0067/00 cheat description:Have the Sword code:0067/01 cheat description:Have the Long Sword code:0067/02 cheat description:Have the Axe code:0067/03 cheat description:Have the Large Sword code:0067/04 cheat description:Have the Ironsword code:0067/05 cheat description:Have the Diamond Sword code:0067/06 cheat description:Have the Helmet code:0068/01 cheat description:Have the Horned Helmet code:0068/02 cheat description:Have the Diamond Helmet code:0068/03 cheat description:Have the Large Shield code:0069/01 cheat description:Have the Diamond Shield code:0069/02 cartridge sha256:81311ff2507c6522172b203534f91f99749f465c8b765ac584f0e851a8bf96b2 name:Isolated Warrior (USA) cheat description:Invincibility code:9a94/30/a9+9a96/a5/85+e7c0/a2/e3 cheat description:Infinite health code:d46c/26/ea cheat description:Infinite lives code:e039/c6/a5 cheat description:Infinite Bombs code:9d2a/ce/ad cheat description:More health restored on pick-up code:8790/02/06 cheat description:Less health restored on pick-up code:8790/02/01 cheat description:Start with maximum health and Bombs code:e25e/09/00 cheat description:Start with 1 life code:e225/03/01 cheat description:Start with 6 lives code:e225/03/06 cheat description:Start with 9 lives code:e225/03/09 cheat description:Start on Scene 2 code:807c/00/01+807f/8d/8e+8082/8d/8e cheat description:Start on Scene 3 code:807c/00/02+807f/8d/8e+8082/8d/8e cheat description:Start on Scene 4 code:807c/00/03+807f/8d/8e+8082/8d/8e cheat description:Start on Scene 5 code:807c/00/04+807f/8d/8e+8082/8d/8e cheat description:Start on Scene 6 code:807c/00/05+807f/8d/8e+8082/8d/8e cheat description:Invincibility (alt) code:00e3/00 cheat description:Full Power Gun #1 code:00a4/0c cheat description:Full Power Gun #2 code:00a5/0c cheat description:Full Power Bombs code:06a8/04 cheat description:Full speed code:00da/04 cartridge sha256:acc3b89bcbe3ccc2ee29d0b2eb3fb9cec143236f48d88680b462c3dfab0784bf name:Ivan 'Ironman' Stewart's Super Off Road (USA) cheat description:Infinite money code:e434/b1/4c+e435/60/4c+e436/38/e4 cheat description:Infinite nitro boosts code:d9c5/01/00 cheat description:Lots of money and full equipment code:e4c7/00/06 cheat description:Computer starts with no nitro boosts code:803d/19/00 cheat description:Computer starts with double nitro boosts code:803d/19/32 cheat description:Start with double nitro boosts code:e50a/19/32 cheat description:Start with 1 life code:e4f7/03/01 cheat description:Infinite lives - P1 code:075d/03 cheat description:Infinite money - P1 code:0305/09+0306/09+0307/09+0308/09 cheat description:Infinite nitro boosts - P1 code:0310/63 cartridge sha256:6928e8c589d6d9cc199a7b0841877531ef53dce479e36f90ec1d9cdcbf54372d name:Jackal (USA) cheat description:Invincibility - both players code:e5ba/d0/50 cheat description:Infinite lives - both players code:ed15/a5 cheat description:Keep weapons after death code:eca5/24 cheat description:Full weapons after death code:eca4/03 cheat description:Start with 1 life - both players code:ca1a/01 cheat description:Start with 9 lives - both players code:ca1a/09 cheat description:Invincibility - P1 code:0053/01 cheat description:Invincibility - P2 code:0531/01 cheat description:Infinite lives code:0031/09 cheat description:Max Score code:07e4/99+07e5/99+07e6/99 cheat description:Start on level 2 code:0030/01 cheat description:Start on level 3 code:0030/02 cheat description:Start on level 4 code:0030/03 cheat description:Start on level 5 code:0030/04 cheat description:Start on level 6 code:0030/05 cartridge sha256:628d6696c7ac84c3ae5ab86d04b28b2fd1742076ca9478fdd5708e3bbb9f13c1 name:Jackie Chan's Action Kung Fu (USA) cheat description:Invincibility code:dbd7/f0/d0 cheat description:Infinite health code:ca82/8d/ae cheat description:Infinite special attacks code:cad8/ce/ad cheat description:Take less damage code:dc78/69 cheat description:Hit anywhere code:82c8/c5/4c+82c9/09/e1+82ca/90/82 cheat description:Multi-jump code:e596/04/00 cheat description:9 Tornado Attacks on pick-up code:dfd4/07/09 cheat description:9 360o Spin Kicks on pick-up code:dfd6/07/09 cheat description:9 Sky Attacks on pick-up code:dfd7/07/09 cheat description:0 Tornado Attacks on pick-up code:dfd4/07/00 cheat description:0 180o Spin Kicks on pick-up code:dfd5/09/00 cheat description:0 360o Spin Kicks on pick-up code:dfd6/07/00 cheat description:0 Sky Attacks on pick-up code:dfd7/07/00 cheat description:Max health from Energy Bowl code:ca62/02/06 cheat description:Less health from Energy Bowl code:ca62/02/01 cheat description:Infinite health (alt) code:0702/07 cheat description:Infinite first special move code:0703/05 cheat description:Infinite second special move code:0705/09 cheat description:One hit kills on bosses code:0039/00 cartridge sha256:e0d4463066d9985d51f80f8a51b1b9c5945e481ef19df48056d7648337d59095 name:James Bond Jr (USA) cheat description:Invincibility code:b177/f0/d0+b17f/d0/f0 cheat description:Infinite health code:f570/9d/ad cheat description:Infinite weapons (Bombs, Flares, Nukes, Bullets) code:fb7d/01/00 cheat description:Immune to most damage code:f561/e5/24 cheat description:Infinite lives code:c98d/ce/ad cheat description:Slow down rate of air loss (scuba mode) code:9fd8/1f/3f cheat description:Speed up rate of air loss code:9fd8/1f/0f cheat description:Shield doesn't take damage from bullets code:f532/e5/24 cheat description:Start with some weapons code:e090/8a/ea cheat description:Start with 2 lives code:e076/06/01 cheat description:Start with 15 lives code:e076/06/0e cheat description:Infinite Pistol ammo code:040f/63 cheat description:Infinite lives code:042c/09 cheat description:Infinite time (minute ten's digit) code:01f9/09 cheat description:Infinite time (minute one's digit) code:01fa/09 cheat description:Infinite time (second ten's digit) code:01fb/09 cheat description:Infinite time (second one's digit) code:01fc/09 cartridge sha256:8db2cb94dc9caec681b13b66f26590e88229245fa592e5292d097e8599ee79e0 name:Jaws (USA) cheat description:Infinite lives code:8556/ce/ad cheat description:Infinite shells code:876f/8d/ad cheat description:Jaws has no health code:85c9/14/00+82dc/14/00+854d/8d/ad cheat description:Hit anywhere code:9918/15/00 cheat description:Hit anywhere - bonus stages code:d3a3/90/50+d3c6/b0/24+d3c2/d0/24 cheat description:Don't lose shells on dying code:855b/4e/ad cheat description:Don't lose power on dying code:855e/ce/ad cheat description:Collect Crabs from anywhere code:a5fb/1e/00 cheat description:Collect Shells from anywhere code:a671/26/00 cheat description:Collect Stars from anywhere code:a6e6/2a/00 cheat description:99 Shells on pick-up code:a685/05/00 cheat description:Start with 1 life code:8294/03/01 cheat description:Start with double lives code:8294/03/06 cheat description:Invincibility (disable to collect items) code:9966/07 cheat description:Infinite lives (alt) code:0387/09 cheat description:Infinite Strobes code:0393/09 cheat description:Exit stage when hit instead of dying code:8515/3a cheat description:Jaws has very little health code:0389/00 cheat description:Jaws is attacked without actually shooting him code:993d/10 cartridge sha256:c9a3c9873a859fcbb5b7442b3decfdcab3a1457e028ae444b050a377fc92afa2 name:Jetsons, The - Cogswell's Caper (USA) cheat description:Infinite lives code:be52/ce/ad cheat description:Infinite hearts code:830b/ce/ad cheat description:Better start (more lives and hearts) code:9581/03/05 cheat description:Don't lose extra hearts on dying code:bee0/ce/2c cheat description:2 power packs on pick-up code:83ea/01/02 cheat description:5 power packs on pick-up code:83ea/01/05 cheat description:Small hearts gives full health code:8445/06/00 cheat description:Defenses don't use up powerpacks code:88bf/8d/2c cheat description:Shield uses fewer powerpacks code:8834/20/05 cheat description:Flashlight uses fewer powerpacks code:87fd/10/02 cheat description:Start with 30 powerpacks code:958c/10/30 cheat description:Start with 50 powerpacks code:958c/10/50 cheat description:Invincibility code:0126/00 cheat description:Invincibility (blinking) code:0127/02 cheat description:Infinite health code:0141/03 cheat description:Infinite lives code:0142/0a cartridge sha256:69cf1773c23606cdbd8b5e556f39c7c317100914779115a8c5c8b5dbf3fe0fcc name:Jimmy Connors Tennis (USA) cheat description:Only need 15 points to win game code:e1e5/03/00 cheat description:Only need 30 points to win game code:e1e5/03/01 cheat description:Only need 40 points to win game code:e1e5/03/02 cheat description:Only need 1 game to win set instead of 6 code:e288/06/00 cheat description:Only need 2 games to win set code:e288/06/01 cheat description:Only need 3 games to win set code:e288/06/02 cheat description:Only need 4 games to win set code:e288/06/04 cheat description:Only need 5 games to win set code:e288/06/05 cheat description:Must get 2 points after 40 to win and no deuces (always shows advantage after 40) code:e1ed/d0/80 cheat description:Don't need to win by 2 to win tiebreaker code:e1cc/02/01 cheat description:2 points needed to win tiebreaker instead of 7 code:e1bd/07/02 cheat description:3 points needed to win tiebreaker code:e1bd/07/03 cheat description:4 points needed to win tiebreaker code:e1bd/07/04 cheat description:5 points needed to win tiebreaker code:e1bd/07/05 cheat description:6 points needed to win tiebreaker code:e1bd/07/06 cheat description:10 points needed to win tiebreaker code:e1bd/07/0a cartridge sha256:509f04b745d11b8d83afb42f084179a6f2ebc87f647927432a647f0e7ee51bb5 name:Joe & Mac (USA) cheat description:Invincibility code:d6a2/f0/d0+d6ac/d0/f0 cheat description:Infinite health code:ec49/ce/ad cheat description:Infinite lives - both players code:a07e/ce/ad cheat description:Protection from most enemy hits code:ec49/ce/ad cheat description:Protection from water code:e6bf/ce/ad cheat description:Stone axe and flint do more damage to bosses code:b848/01/08 cheat description:Stone axe and flint do a lot more damage to bosses code:b848/01/0f cheat description:Stone wheel and boomerang do more damage to bosses code:b851/02/08 cheat description:Stone wheel and boomerang do a lot more damage to bosses code:b851/02/10 cheat description:Fire does more damage to bosses code:b856/04/10 cheat description:Fire does a lot more damage to bosses code:b856/04/20 cheat description:Apple and hamburger worth nothing code:eb64/8d/ad cheat description:Apple and hamburger restore health to 1/2 code:eb63/10/08 cheat description:Start with 1/2 health (die when bar is 1/2 empty) code:a3a4/10/08 cheat description:Start with stone wheel instead of stone axe - P1 code:a0ba/e0/e1 cheat description:Start with flint instead of stone axe - P1 code:a0ba/e0/e2 cheat description:Start with fire instead of stone axe - P1 code:a0ba/e0/e3 cheat description:Start with boomerang instead of stone axe - P1 code:a0ba/e0/e4 cheat description:Start with 1 life instead of 3 - P1 code:a0bf/03/01 cheat description:Start with 5 lives - P1 code:a0bf/03/05 cheat description:Start with 7 lives - P1 code:a0bf/03/07 cheat description:Start with 9 lives - P1 code:a0bf/03/09 cheat description:Start somewhere in level 2 code:a0c4/00/02 cheat description:Infinite health (alt) code:0499/0f cheat description:One hit kills on bosses code:064d/00 cartridge sha256:ec54ed32302aaeb2fa6e0d7e2ca3ea2d8df888e77859e158298ecb2fa322178e name:Joshua & the Battle of Jericho (USA) (v6.0) (Unl) cheat description:Exit always open code:075f/05+003f/ff cheat description:Infinite Bombs code:003e/01 cheat description:Immune to explosions (disable at end of level) code:004b/c2 cartridge sha256:5b7afe0ff1fcf538fec60d085aa759522a2ab1cce511a6f210b672a256a87a8a name:Joshua & the Battle of Jericho (USA) (v5.0) (Unl) cheat description:Exit always open code:075f/05+003f/ff cheat description:Infinite Bombs code:003e/01 cheat description:Immune to explosions (disable at end of level) code:004b/c2 cartridge sha256:0417d7caec593852823b94f5520caea3745a28c9dac68e30d2c5e6f5545a9757 name:Journey to Silius (USA) cheat description:Invincibility code:e825/20/ad+e8b4/20/ad cheat description:Invincibility after first hit (blinking) code:8011/c6/a5 cheat description:Infinite health code:ea3b/85/a5 cheat description:Infinite weapon power code:8e33/85/a5 cheat description:Infinite lives code:c3f7/c6/a5 cheat description:Protection against most aliens code:ea39/e5/e9 cheat description:Hit anywhere code:ad58/b0/a9+e761/b0/a9+e782/9d/ad+ad70/9d/ad cheat description:Multi-jump code:818d/04/00+81c9/cc/ac cheat description:Some aliens are tougher code:e824/02/08 cheat description:Some aliens are weaker code:e824/02/01 cheat description:Mega-jump code:819e/0b/16 cheat description:Speed jump code:8163/01/20+80ff/ff/e0 cheat description:Super speed code:815f/04/13+80fb/fc/ec cheat description:1 life after continue code:dbe3/03/01 cheat description:6 lives after continue code:dbe3/03/06 cheat description:9 lives after continue code:dbe3/03/09 cheat description:Start with all six weapons code:dcc9/02/1f cheat description:Start with Machine Gun code:dcc9/02/01 cheat description:Start with Laser Gun code:dcc9/02/04 cheat description:Start with Homing Missiles code:dcc9/02/08 cheat description:Start with Grenade Launcher code:dcc9/02/10 cheat description:Start with Machine Gun and Laser Gun code:dcc9/02/05 cheat description:Start with 1 life code:de19/03/01 cheat description:Start with 6 lives code:de19/03/06 cheat description:Start with 9 lives code:de19/03/09 cheat description:Infinite health (alt) code:00b0/0f cheat description:Infinite lives (alt) code:0053/09 cheat description:Infinite weapon power (alt) code:00b1/3f cheat description:Have Machine Gun code:00b8/01 cheat description:Have Shot Gun code:00b8/02 cheat description:Have Laser Gun code:00b8/03 cheat description:Have Homing Missile code:00b8/04 cheat description:Have Grenade Launcher code:00b8/05 cheat description:One hit kills on bosses code:040f/00+04ff/00 cheat description:Start on stage 2 code:0170/01 cheat description:Start on stage 3 code:0170/02 cheat description:Start on stage 4 code:0170/03 cheat description:Start on stage 5 (final stage) code:0170/04 cartridge sha256:4b00fa0ae20030af3406e95eb08f42ec473ec03d9063798ccd6c249648409af3 name:Journey to the West (Asia) (Unl) cheat description:Hit anywhere code:b445/4c/00+b42c/65/00 cheat description:Climb anywhere (except in boss fights) code:a55c/29/a9+a552/60/ea cartridge sha256:8471a6b7c7c7d6c7be0ee278778e2d25dc91462db22643395787eaaeb6e320c1 name:Joust (USA) cheat description:Infinite lives code:caac/d6/a5 cheat description:Turbo flying code:cc54/00/01 cheat description:Heavens above? code:cae9/95/24 cheat description:Start with 1 life code:c093/05/01 cheat description:Start with 9 lives code:c093/05/0a cheat description:Start on last level reached code:c0de/85/24+c0dc/85/24+c0e4/85/24 cartridge sha256:8d36c0923103f370eb9fab5caeb2a8307cd1c7a30030db69bd5bc4f5ca46b1d2 name:Jovial Race (Asia) (PAL) (Unl) cheat description:Infinite lives code:9c7b/ce/ad cheat description:Start with 5 lives code:836a/03/05 cheat description:Start with 10 lives code:836a/03/0a cheat description:Sart with 100 lives code:836a/03/64 cartridge sha256:a7bf6adcd838f055405963741dd3368730b0f9dc125ae7071832a9305a4c7292 name:Jovial Race (Unknown) (Unl) cheat description:Infinite lives code:9c7b/ce/ad cheat description:Start with 5 lives code:836a/03/05 cheat description:Start with 10 lives code:836a/03/0a cheat description:Sart with 100 lives code:836a/03/64 cartridge sha256:e5bcb8838f567f485c6f872e9695d2e3ef676f4bcda1c32d51d56008efb96e7a name:Jungle Book, The (USA) cheat description:Infinite lives code:8d69/8d/2c cheat description:Infinite time code:8f68/01/00 cheat description:Infinite weapons code:8df8/00/01 cheat description:Need 2 gems to finish levels 1, 3, 4, 7, 9 code:cbcb/10/02+f4ab/b9/ad cheat description:Need 4 gems to finish levels 1, 3, 4, 7, 9 code:cbcb/10/04+f4ab/b9/ad cheat description:Need 8 gems to finish levels 1, 3, 4, 7, 9 code:cbcb/10/08+f4ab/b9/ad cheat description:Start practice level with 1 life code:cc06/06/01 cheat description:Start practice level with 3 lives code:cc06/06/03 cheat description:Start practice level with 9 lives code:cc06/06/09 cheat description:Start normal level with 1 life code:cc07/05/01 cheat description:Start normal level with 3 lives code:cc07/05/03 cheat description:Start normal level with 9 lives code:cc07/05/09 cheat description:Start with 5 of each weapon code:f362/00/05 cheat description:Start with 10 of each weapon code:f362/00/10 cheat description:Start with 20 of each weapon code:f362/00/20 cheat description:Start with 30 of each weapon code:f362/00/30 cheat description:Start with 90 of each weapon code:f362/00/90 cartridge sha256:49fe0c49cd0a2841ae9c8ae5aa19f710d187ee6931a1e531d3bff19772ca4af0 name:Jurassic Park (USA) cheat description:Invincibility code:a833/f0/d0 cheat description:Infinite health code:c162/8d/ad cheat description:Immune to most attacks code:c162/8d/60 cheat description:Infinite lives (first two levels only) code:b10b/ce/2c cheat description:Infinite ammo on pick-up code:ac3a/de/2c cheat description:More bullets picked up from small dinosaurs code:9460/02/09 cheat description:Fewer bullets picked up from small dinosaurs code:9460/02/01 cheat description:3-ball bolas picked up (from small dinosaurs instead of normal bullets) code:88a5/85/86+88b2/85/86 cheat description:Explosive multi-shots (from small dinosaurs instead of normal bullets) code:88a5/85/87+88b2/85/87 cartridge sha256:f40341cf7e76480465ba8ab2d09e44644c3e3af7d647dc04c8b38357b26e014a name:Just Breed (Japan) cheat description:No health - all enemies code:69da/00+69db/00+69dc/00+69dd/00+69de/00+69df/00+69e0/00+69e1/00+69e2/00+69e3/00+69e4/00+69e5/00+69e6/00 cheat description:Lots of EXP after battle code:6f6e/ff cheat description:Max EXP after battle code:6f6e/ff+6f6f/ff cheat description:Max gold after battle code:6f6c/ff+6f6d/ff cheat description:Max Health (Swordsman/Archer, Etc. 1) code:69c4/ff cheat description:Max Magic (Swordsman/Archer, Etc. 1) code:6a04/ff cheat description:Max Health (Swordsman/Archer, Etc. 2) code:69c6/ff cheat description:Max Magic (Swordsman/Archer, Etc. 2) code:6a06/ff cheat description:Max Health (Swordsman/Archer, Etc. 3) code:69c5/ff cheat description:Max Magic (Swordsman/Archer, Etc. 3) code:6a05/ff cheat description:Max Health (Swordsman/Archer, Etc. 4) code:69c3/ff cheat description:Max Magic (Swordsman/Archer, Etc. 4) code:6a03/ff cartridge sha256:2ae0a99b457a6d00ff0b241aa08f98d40c5c5ed45e634a7ed934b386bbd17a12 name:Kabuki - Quantum Fighter (USA) cheat description:Invincibility code:b1ba/a5/60+a0b4/f0/d0 cheat description:Infinite health code:cf77/8d/ae cheat description:Infinite chip power code:b088/bd/ad cheat description:Infinite lives code:cf65/8d/ad cheat description:Don't lose a life from health loss code:cf64/01/00 cheat description:Don't lose a life from timer code:d058/01/00 cheat description:1 continue code:bbfa/02/01 cheat description:6 continues code:bbfa/02/05 cheat description:9 continues code:bbfa/02/08 cheat description:Slower timer code:d022/3f/ff cheat description:Faster timer code:d022/3f/2f cheat description:Special weapons use minimum chip power code:b088/bd/ad+b089/0f/10 cheat description:Start with maximum health code:bbff/0a/0f+b3a3/0a/0f cheat description:Start with less health code:bbff/0a/05+b3a3/0a/05 cheat description:Start with 1 life code:bbf5/02/00 cheat description:Start with 6 lives code:bbf5/02/05 cheat description:Start with 9 lives code:bbf5/02/08 cheat description:Invincibility (blinking) code:0089/03 cheat description:Infinite health (alt) code:068c/0a cheat description:Infinite lives (alt) code:06c0/09 cheat description:Infinite time code:0691/09 cartridge sha256:67123fe28cf5fbadeafc77400a0812f0135ab36706ec7d1267f84931d044e71d name:Kai no Bouken - The Quest of Ki (Japan) cheat description:Exit always open code:0053/01 cartridge sha256:204b5eb443dc8f599d54e242352ba299c05015e5571f74307d78748af3d5f960 name:Kame no Ongaeshi - Urashima Densetsu (Japan) cheat description:Invincibility code:c3f7/f0/a9+c3f9/ce/8d cartridge sha256:d67817e44f3a421a78ce4217a0660ee375ea162f1465a28da77659dfa46f8f7c name:Karate Champ (USA) (Rev A) cheat description:One hit wins round code:0069/20 cheat description:One hit wins stage code:005d/02 cartridge sha256:54c366ec62c0faec3d5619f62bad73092996a26e674f58819e9b76433cc04e15 name:Karate Champ (USA) cheat description:One hit wins round code:0069/20 cheat description:One hit wins stage code:005d/02 cartridge sha256:8aa5c70100080adf0f6d8945ea10382f3986b99d41e010c356991dfe061eaa8d name:Karate Kid, The (USA) cheat description:Infinite health code:b25f/85/a5 cheat description:Infinite chances (lives) code:881c/c6/a5 cheat description:Infinite Crane Kicks code:a78b/c6/a5 cheat description:Infinite Drum Punches on pick-up code:a778/c6/a5 cheat description:Hit anywhere code:98ec/b0/50+98ed/03/24 cheat description:Prevent girl from moving in final stage code:ac39/01/00 cheat description:Start with 1 chance code:86fa/03/01 cheat description:Start with 6 chances code:86fa/03/06 cheat description:Start with 9 chances code:86fa/03/09 cheat description:Start with 8 Crane Kicks - 1P game code:ec4b/04/08 cheat description:Start with 8 Crane Kicks - 2P game code:ec4c/04/08 cheat description:Start with 5 Crane Kicks - P1, one on one game code:ec4d/00/05 cheat description:Start on stage 2 - 1P game code:ec4e/01/02 cheat description:Start on stage 2 - 2P game code:ec4f/01/02 cheat description:Start on stage 3 - 1P game code:ec4e/01/03 cheat description:Start on stage 3 - 2P game code:ec4f/01/03 cheat description:Start on stage 4 - 1P game code:ec4e/01/04 cheat description:Start on stage 4 - 2P game code:ec4f/01/04 cheat description:Infinite health (alt) code:0085/0f cheat description:Infinite Drum Punches (alt) code:0089/63 cheat description:Infinite Crane Kicks (alt) code:008a/63 cheat description:Enemy has no health code:008b/00 cartridge sha256:4ece74fde0b86ecef96d1909c517f55f2da71fd00e29102b8f2780606606e777 name:Karnov (USA) cheat description:Invincibility after one hit code:f28f/d0/50 cheat description:Invincibility code:cb6f/85/a5+cb82/85/a5+cb73/85/a5 cheat description:Infinite lives code:dac5/ce/ad cheat description:Infinite time code:ad67/c6/24 cheat description:Hit anywhere code:ccdb/09/00+ccd1/b0/a9+cd4f/95/a5 cheat description:Jump higher code:f5be/2a cheat description:Gain 3 of most items code:cf81/01/03 cheat description:Gain 97 of most items code:cf81/01/97 cheat description:Never lose most items code:cf9d/01/00 cheat description:Start with 1 life code:d01d/02/00+ded6/02/00 cheat description:Start with 6 lives code:d01d/02/05+ded6/02/05 cheat description:Start with 9 lives code:d01d/02/08+ded6/02/08 cheat description:Start on stage 2 code:d038/00/01 cheat description:Start on stage 3 code:d038/00/02 cheat description:Start on stage 4 code:d038/00/03 cheat description:Start on stage 5 code:d038/00/04 cheat description:Start on stage 6 code:d038/00/05 cheat description:Start on stage 7 code:d038/00/06 cheat description:Start on stage 8 code:d038/00/07 cheat description:Start on stage 9 code:d038/00/08 cheat description:Invincibility after one hit (blinking) (alt) code:0069/fa cheat description:Infinite lives (alt) code:040b/09 cheat description:Infinite time (alt) code:0094/a7 cheat description:Have 99 Ks code:00ba/99 cheat description:Have Double Flame Shot code:0065/01 cheat description:Have Triple Flame Shot code:0065/02 cartridge sha256:7a406a58cf781b9ceb87f4266dca812a271bfe1f42aa392864e8bc404b2575e1 name:Kekkyoku Nankyoku Daibouken (Japan) cheat description:Infinite time code:f348/e6/a5 cartridge sha256:07e1b14777f8f04d4bd7c85c74a6f9e0f5c43b8c31aa7b3214e53a659fd5a2d9 name:Kero Kero Keroppi no Daibouken 2 - Donuts Ike wa Oosawagi! (Japan) cheat description:Multi-jump code:8899/3b/00 cartridge sha256:23bf669afb3125d72f352848628e201607b4cece974cce86f2558a1812056ece name:Kick Master (USA) cheat description:Invincibility code:de1a/85/10+de11/8d/ad+de1b/d2/06 cheat description:Invincibility after one hit code:ab61/f0/a9 cheat description:Infinite health code:de11/8d/ad cheat description:Infinite magic points code:bd81/95/b5 cheat description:Infinite lives code:b3b7/ce/ad+d3ba/f0/a9 cheat description:Hit anywhere code:a1bf/90/d0 cheat description:Quick level up code:a6e7/03/00 cheat description:Don't flash at all after getting hit code:de19/3c/00 cheat description:Barely flash at all after getting hit code:de19/3c/05 cheat description:Don't flash as long after getting hit code:de19/3c/15 cheat description:Start with more EXP and magic points code:d33b/60/65 cheat description:Start with twice as much health code:fde0/40/80 cheat description:Start with half health code:fde0/40/20 cheat description:Start with very little health code:fde0/40/03 cheat description:Start with 1 life code:d32c/03/01 cheat description:Start with 5 lives code:d32c/03/05 cheat description:Start with 9 lives code:d32c/03/09 cartridge sha256:4a9544bb41869e88ec0610a799b5ce9c7d89bf9a48198923ea7ba22f385ea349 name:Kickle Cubicle (USA) cheat description:Invincibility code:a089/b1/85+a178/b1/85 cheat description:Infinite lives code:8680/c6/a5 cheat description:Infinite time code:cef5/ce/ad cheat description:Infinite time (alt) code:ceee/70 cheat description:Faster timer code:cefa/0a/07 cheat description:Slower timer code:cefa/0a/0f cheat description:Win level now code:83d6/f0/d0 cheat description:Start on land 2 code:8246/8d/2c+d935/8d/2c+d931/00/01 cheat description:Start on land 3 code:8246/8d/2c+d935/8d/2c+d931/00/02 cheat description:Start on land 4 code:8246/8d/2c+d935/8d/2c+d931/00/03 cartridge sha256:56f1fe3a7881b2e9d69cd33a0971b2f26247e964c3c7dd4a6019715425ff2256 name:Kid Icarus (USA, Europe) cheat description:Invincibility code:db2e/f1/e9 cheat description:No ordinary damage code:db34/85/a5 cheat description:No damage from floor hazards code:cfa3/c6/c5 cheat description:No damage from Medusa code:b150/85/a5 cheat description:Lava restores health code:cfa3/c6/e6 cheat description:Immune to becoming an eggplant code:883e/01/00 cheat description:Hit anywhere code:d971/11/00+d980/02/18+d97f/b0/ea cheat description:99 Hammers on pick-up code:ead0/a9/90+ead1/01/f4 cheat description:Small hearts worth 2 code:de4a/01/02 cheat description:Small hearts worth 5 code:de4a/01/05 cheat description:Small hearts worth 135 code:de4a/01/87 cheat description:Big hearts worth 20 code:de4d/0a/14 cheat description:Big hearts worth 255 code:de4d/0a/f7 cheat description:Get best ending with 8uuuuu uuuuuu uuuuuu uuuuuu code code:818a/00/01 cartridge sha256:a11eec5762a029c95a5d496c0671b73e663225be50a5b1e89f16f380637b6665 name:Kid Klown in Night Mayor World (USA) cheat description:Invincibility code:af76/d0/f0 cheat description:Infinite health code:8849/8d/ad cheat description:Infinite lives code:8873/01/00 cheat description:Full health from hearts code:8c03/03/00 cheat description:Less health from hearts code:8bf7/05/02 cheat description:More health from hearts code:8bf7/05/0a cheat description:Mega-jump (don't hold jump down too long or you might get stuck) code:a687/ee/2c cheat description:Infinite chances in sub-game (press Start to re-enter the main game) code:875d/c6/24 cheat description:Infinite health (alt) code:043f/19 cheat description:Infinite Chips code:0117/63 cheat description:Infinite lives (alt) code:043e/09 cartridge sha256:f85a689b4ff7a5e51703e5fabc73ca1af43e6519754c4a59c11a960baa323b47 name:Kid Kool and the Quest for the Seven Wonder Herbs (USA) cheat description:Invincibility code:d1e3/a5/85 cheat description:Infinite time code:8c19/e6/a6 cheat description:Infinite lives code:cd4a/c6/a5 cheat description:Press Start to complete the level code:c8a3/33/0c+c8a5/33/0b+c8a2/45/a9 cheat description:Hit anywhere - throwing code:c82c/ad/b0+c82d/07/56 cheat description:Multi-jump when falling code:92a2/f0/d0+92a3/d4/9c+929f/a1/c9+92a1/cd/01+92a0/d0/29 cheat description:One life after continue code:cd59/03/01 cheat description:Start with one life code:c065/03/01 cheat description:Start with double lives code:c065/03/06 cheat description:Start with triple lives code:c065/03/09 cheat description:Invincibility (alt) code:0031/09 cheat description:Infinite lives (alt) code:0015/09 cartridge sha256:81a77623adf819f10548052075555998c1ec1ef5f4dc4bf6ff6b6c3fa3541c1b name:Kid Niki - Radical Ninja (USA) (Rev A) cheat description:Invincibility (glitchy) code:8e0d/85/a5+8deb/85/a5 cheat description:Infinite lives code:9ddc/c6/24 cheat description:Infinite time code:bcd8/01/00 cheat description:Hit anywhere code:8db0/8a/18+c21e/fd/60+8db1/48/60 cheat description:Higher jump code:893a/e8/ff cheat description:Multi-jump code:9a7e/10/00+9a84/0a/00+9a9b/2d/00+ff02/ff/10+ff0b/ff/60+ff08/ff/20+ff03/ff/04+ff00/ff/24+ff09/ff/2d+ff05/ff/ec+9a9c/89/ff+ff0a/ff/89+ff04/ff/a9+ff07/ff/19+ff06/ff/85+ff01/ff/57 cheat description:Less time code:823b/06/04+9e81/06/04 cheat description:Start with 1 life code:8216/03/01 cheat description:Start with 6 lives code:8216/03/06 cheat description:Start on round 2 code:81e7/00/01+81be/00/01 cheat description:Start on round 3 code:81e7/00/02+81be/00/02 cheat description:Start on round 4 code:81e7/00/03+81be/00/03 cheat description:Start on round 5 code:81e7/00/04+81be/00/04 cheat description:Start on round 6 code:81e7/00/05+81be/00/05 cheat description:Invincibility (glitchy) (alt) code:0088/00+00f4/00 cheat description:Infinite lives code:00cc/03 cheat description:Infinite time code:0621/3b cartridge sha256:81e527e9c282f5078a3d08470ad3c032fea9a72f1559ee9d2702ea6b07fab45c name:Kid Niki - Radical Ninja (USA) cheat description:Invincibility code:81c9/00/80 cheat description:Hit anywhere code:8d9f/8a/18+c23b/fd/60+8da0/48/60 cheat description:Multi-jump code:9a72/1b/00+ff02/ff/10+ff0b/ff/60+ff08/ff/20+ff03/ff/04+ff00/ff/24+9a5a/f0/24+9a54/f0/24+ff05/ff/ec+ff09/ff/1b+9a73/89/ff+ff0a/ff/89+ff04/ff/a9+ff07/ff/19+ff06/ff/85+ff01/ff/57 cheat description:Invincibility (glitchy) code:0088/00+00f4/00 cheat description:Infinite lives code:00cc/03 cheat description:Infinite time code:0621/3b cartridge sha256:a8f2987d83253adb573aa760c1bb926e951f2c2d72daff4e2d2e125ec1a181c4 name:King Kong 2 - Ikari no Megaton Punch (Japan) cheat description:Infinite health and lives code:f156/95/b5 cheat description:Infinite Rocks code:8569/8d/ad cheat description:Start with max health code:e0d8/01/09+e0d7/00/99 cheat description:Start with 9 lives code:e929/02/09 cartridge sha256:6cc3a973288a4c3c96a967bdf1be74eee909d3f5eb16ce0b405f20ce565c66cc name:King Neptune's Adventure (USA) (Unl) cheat description:Infinite health code:d6ae/ce/ad+d4b3/ce/ad+d675/8d/ad cheat description:Infinite lives code:ce5e/ce/ad cheat description:Infinite Bubble Bombs code:f9a5/c6/a5 cheat description:Start with all treasures (removes all items from level) code:c4b3/f8/00 cheat description:Start with 99 Bubble Bombs and Money code:c4bc/00/63 cheat description:Start with 99 Seahorses and Keys code:cd3d/00/63 cartridge sha256:3249d267ca17098077bb94eee437f354066971bc03c0d06eada05efd92b0fa52 name:King of Kings, The (USA) (v5.0) (Unl) cheat description:Infinite health code:0512/06 cartridge sha256:dc6859332ca69a8361bb3eb8ba1ff638f4bbbc7837a3a9f8a474e05f6bc379ea name:King of Kings, The (USA) (v1.3) (Unl) cheat description:Infinite health code:0512/06 cartridge sha256:9ae715b6f2400d21f5d1ec426ecf310aa68ca46f3b37b37d5ae115f34049676b name:King of Kings, The (USA) (v1.2) (Unl) cheat description:Infinite health code:0512/06 cartridge sha256:d1002d407b544d70b4ddf4515665f6e18ac9c8ee2efd4be184e5240119fd6f70 name:King of Kings, The (USA) (v1.1) (Unl) cheat description:Infinite health code:0512/06 cartridge sha256:be97bca71e1bf099ef0f6ff91aed506df7b0506433c76e5deccea7b130e3a20f name:King's Knight (USA) cheat description:Infinite health code:a16e/85/24 cheat description:Only lose 1 HP when hit code:a168/e5/e9+a169/10/01 cheat description:Start with double usual health code:b1d8/0c/18 cheat description:Start with half usual health code:b1d8/0c/06 cheat description:Start with a better character code:b1de/00/01 cheat description:Start with the best character normally possible code:b1de/00/02 cheat description:Start with a super character, better than normally Possible code:b1de/00/05 cheat description:Infinite health (alt) code:009a/0c cartridge sha256:1250a80faf865aa5ee5585ad7639e5ef2b3fa541554effda5fad2cc5dc2acef5 name:Kirby's Adventure (USA) (Rev A) cheat description:Invincibility code:847b/f0/d0 cheat description:Infinite health code:9e05/8d/ad cheat description:Infinite lives code:e4c1/ce/a5 cheat description:Hit anywhere (spitting) code:819d/e9/18+819e/07/18+807a/60/80+8078/fd/4c+81cd/b0/24+8079/74/c6 cheat description:Inhale from anywhere code:825b/42/00+827f/90/50+827c/ed/ad cheat description:Less health from 'pep drinks' code:b243/08/02 cheat description:More health from 'pep drinks' code:b243/08/10 cheat description:Full health from 'pep drinks' code:b243/08/2f cheat description:Start with less health code:a7f2/2f/1f cheat description:Start with more health code:a7f2/2f/4f cheat description:Start with 2 lives code:a7ed/04/01 cheat description:Start with 9 lives code:a7ed/04/08 cheat description:Start with 17 lives code:a7ed/04/10 cheat description:Invincibility (alt) code:05f9/02 cheat description:Infinite health (alt) code:0597/2f cheat description:Infinite lives (alt) code:0599/09 cartridge sha256:a6b81fec11c24a33fd763db5c28005e760a1614e70c1bb5ccde0bd4242431000 name:Kirby's Adventure (USA) cheat description:Invincibility code:847b/f0/d0 cheat description:Infinite health code:9e05/8d/ad cheat description:Infinite lives code:e4c1/ce/a5 cheat description:Hit anywhere (spitting) code:80c5/0d/00+81a5/36/00+8094/e9/18+8095/07/18+81cd/b0/24 cheat description:Inhale from anywhere code:825b/42/00+8284/b0/24 cheat description:Less health from 'pep drinks' code:b243/08/02 cheat description:More health from 'pep drinks' code:b243/08/10 cheat description:Full health from 'pep drinks' code:b243/08/2f cheat description:Start with less health code:a7f2/2f/1f cheat description:Start with more health code:a7f2/2f/4f cheat description:Start with 2 lives code:a7ed/04/01 cheat description:Start with 9 lives code:a7ed/04/08 cheat description:Start with 17 lives code:a7ed/04/10 cheat description:Invincibility (alt) code:05f9/02 cheat description:Infinite health (alt) code:0597/2f cheat description:Infinite lives (alt) code:0599/09 cartridge sha256:9caa01a2b81ce1f98b17520aee09d415da7192382c1e47316998b6c1be6168eb name:Kiwi Kraze - A Bird-Brained Adventure! (USA) cheat description:Invincibility code:c53c/f0/d0 cheat description:Super-jump code:e545/fc/fa cheat description:Infinite lives code:c7db/d6/b5 cheat description:Infinite continues code:c90a/d6/2c cheat description:1 life after continue code:c907/02/00 cheat description:6 lives after continue code:c907/02/05 cheat description:9 lives after continue code:c907/02/08 cheat description:Start with 1 life (and 1 continue) code:c373/02/00 cheat description:Start with 6 lives (and 6 continues) code:c373/02/05 cheat description:Start with 9 lives (and 9 continues) code:c373/02/08 cheat description:Start on level 2 code:c368/8d/2c+c367/00/04 cheat description:Start on level 3 code:c368/8d/2c+c367/00/08 cheat description:Start on level 4 code:c368/8d/2c+c367/00/0c cheat description:Start on level 5 code:c368/8d/2c+c367/00/11 cartridge sha256:ef63df6bcbc7e13dace53f106a247485a09409799b99c8415e934ba532cdaa53 name:KlashBall (USA) cheat description:Very little team stamina - select the middle team code:b939/28/05 cheat description:More team stamina - select the middle team code:b939/28/40 cheat description:Mega team stamina - select the middle team code:b939/28/99 cheat description:Power is doubled for the whole team - select the middle team code:b93c/02/04 cheat description:Power is tripled for the whole team - select the middle team code:b93c/02/06 cheat description:Mega power for the whole team - select the middle team code:b93c/02/09 cheat description:Never lose stamina - select the middle team code:a680/9d/2c cheat description:Computer can't score - select the middle team code:845a/e6/a5 cheat description:Everyone including computer has 255 skill - select the middle team code:a05e/38/2c+a05e/fd/2c cartridge sha256:28b3f1dde1488dd83422da47300d2e31ffce811bf2be37bf6d510019c2289f40 name:Klax (USA) (Unl) cheat description:Infinite drops code:bca3/e6/a5 cheat description:When starting on level 6, 0 drops allowed code:8c7f/04/01 cheat description:When starting on level 6, 5 drops allowed code:8c7f/04/05 cheat description:When starting on level 11, 0 drops allowed code:8c92/05/01 cheat description:When starting on level 11, 3 drops allowed code:8c92/05/03 cheat description:Start with 0 drops allowed code:8c6d/03/01 cheat description:Start with 5 drops allowed code:8c6d/03/05 cheat description:Level select code:0000/00 cartridge sha256:b66538543d3c4c74448e896130081c39112b14898beffbe95137a410394e5dc9 name:Knight Rider (USA) cheat description:Infinite shield code:d62f/85/a5 cheat description:Infinite missiles code:af0b/ce/ad cheat description:Infinite laser code:aea5/ce/2c cheat description:Infinite lives code:80ac/ce/ad+80cd/ce/ad cheat description:Start with 1 life after continue code:80e3/02/00 cheat description:Start with 6 lives after continue code:80e3/02/05 cheat description:Start with 9 lives after continue code:80e3/02/08 cheat description:Start with 1 life code:c879/02/00+c87d/8d/ee cheat description:Start with 6 lives code:c879/02/05+c87d/8d/ee cheat description:Start with 99 missiles code:a147/bd/ad+a148/6e/73 cheat description:Start with 99 lasers code:a153/bd/ad+a154/74/79 cheat description:Start with full gasoline code:a130/bd/ad+a131/66/68 cheat description:Start with full shield code:a13c/bd/ad+a13d/6a/6d cartridge sha256:e5673075301b0c84137d24aff0ffbfa0565d33c960968d9843d7bc57f1107417 name:Krion Conquest, The (USA) cheat description:Infinite health code:dbf6/85/a5 cheat description:Infinite lives code:bde1/c6/a5 cheat description:Float spell code:c69f/16/00 cheat description:Quicker supershot code:cde1/04/01 cheat description:Less energy used for fire spell code:f0a3/08/04+f096/09/05 cheat description:Start with 1 life code:8140/02/00 cheat description:Start with 6 lives code:8140/02/05 cheat description:Start with 9 lives code:8140/02/08 cheat description:Start on stage 2 code:812a/00/01+8129/a9/a0+812d/85/84 cheat description:Start on stage 3 code:812a/00/02+8129/a9/a0+812d/85/84 cheat description:Start on stage 4 code:812a/00/03+8129/a9/a0+812d/85/84 cheat description:Invincibility code:03de/02+03e0/3a cheat description:Infinite health (alt) code:004c/28 cheat description:Infinite lives (alt) code:0043/02 cheat description:Infinite oxygen in underwater stage code:0318/05 cheat description:Moon-jump (disable in underwater stage) code:0057/1f cartridge sha256:5f981ab1988614a96fd029c6fe3f103465dbf3219265bd8274bf8cd537adee34 name:Krusty's Fun House (USA) cheat description:Infinite health code:a038/0a/00 cheat description:Infinite pies - first life only code:a4c1/ce/2c cheat description:Pick-up Super Balls instead of Custard Pies code:ab9d/01/00 cheat description:Start with 1 life code:8046/03/01 cheat description:Start with 6 lives code:8046/03/06 cheat description:Start with 9 lives code:8046/03/09 cheat description:Start with 6 pies code:804b/09/06 cheat description:Start with 18 pies code:804b/09/12 cartridge sha256:0ba5e69962f6576d3729aa967092a7e8c98d00213cd98026dee343bff67b4177 name:Kung Fu (Japan, USA) cheat description:Infinite health code:ace0/06/30+ace1/ad/8e cheat description:Infinite health and one hit kills code:c466/14+c47e/eb cheat description:Infinite time code:8831/20/ad cheat description:Infinite lives - both players code:8882/b5 cheat description:Invincibility against knives code:bfd6/d0/24 cheat description:Don't die when time runs out code:c76d/85/24+c76f/4c/60 cheat description:Hit anywhere code:c257/c9/00 cheat description:Enemies die when trying to grab you code:a5c6/d0/24+a5c9/4d/ec+a5ca/a6/a5+a793/4c/60 cheat description:Enemies easier to shrug off code:a5eb/69/00 cheat description:Enemies harder to shrug off code:a5e9/04/0a cheat description:Give P2 an advantage code:84ac/85 cheat description:Knife thrower harder to beat code:ab38/4a/fa cheat description:Normal enemies do more damage code:af8d/01/03 cheat description:Walk 2X faster code:9b7f/ff/fe+9b7e/01/02 cheat description:Walk 4X faster code:9b7e/01/04+9b7f/ff/fc cheat description:Start at last level reached - P1 code:8436/24 cheat description:Start at last level reached - P2 code:8439/24 cheat description:Start with 1 life - both players code:84ab/01 cheat description:Start with 9 lives - both players code:84ab/09 cheat description:Infinite health (disable at end of level) code:04a6/1e cheat description:Infinite lives (alt) code:005c/09 cheat description:Knife Thrower doesn't throw knives code:03e8/00+03e9/00+03ea/00+03eb/00 cheat description:Max score code:0536/09+0535/09+0534/09+0533/09+0532/09+0531/09 cheat description:Start on floor 2 code:005f/01 cheat description:Start on floor 3 code:005f/02 cheat description:Start on floor 4 code:005f/03 cheat description:Start on floor 5 code:005f/04 cartridge sha256:323d330cb50e0a4cd7855a3eedb0e97a08b31d9f7c638e4fa53ab58c1263154e name:Kung-Fu Heroes (USA) cheat description:Invincibility code:c127/0a/00+d6b9/bd/60 cheat description:Infinite lives code:b3d2/01/00 cheat description:Infinite Miracle Kicks code:d0e9/01/00 cheat description:Hit anywhere (most enemies) code:d3f0/20/ad cheat description:2 E-balls for an extra life code:bc28/05/02 cheat description:Use with warp to start with 1 life code:a957/03/01 cheat description:Use with warp to start with 6 lives code:a957/03/06 cheat description:Use with warp to start with 9 lives code:a957/03/09 cheat description:Mega-jumps left and right code:cc19/01/04+cc21/ff/fc cheat description:Start with 20 Miracle Kicks code:a962/00/14 cheat description:Start with 1 life code:a95d/05/01 cheat description:Start with 9 lives code:a95d/05/09 cheat description:Start on Castle 2 code:a952/a5/a9+a953/cd/04 cheat description:Start on Castle 3 code:a952/a5/a9+a953/cd/08 cheat description:Start on Castle 4 code:a952/a5/a9+a953/cd/0c cheat description:Start on Castle 5 code:a952/a5/a9+a953/cd/10 cheat description:Start on Castle 6 code:a952/a5/a9+a953/cd/14 cheat description:Start on Castle 7 code:a952/a5/a9+a953/cd/18 cheat description:Start on Castle 8 code:a952/a5/a9+a953/cd/1c cartridge sha256:f4b7d8d31c5bbfee69c117332fa3878d04dc3b6e693d1a343d3ef2f20b10a85e name:Last Action Hero (USA) cheat description:Infinite health code:bc95/46/a5 cheat description:One hit kills on bosses code:a0a3/f0/d0 cheat description:Infinite lives code:bca1/c6/a5 cheat description:Infinite continues code:e50a/c6/a5 cheat description:Red hearts worth nothing code:8f50/e6/a6 cheat description:Continue with 1 life code:e550/03/00 cheat description:Continue with 2 lives code:e550/03/01 cheat description:Continue with 3 lives code:e550/03/02 cheat description:Start with 1 life code:ee3d/03/00 cheat description:Start with 7 lives code:ee3d/03/06 cheat description:Start with 10 lives code:ee3d/03/09 cheat description:Start with 0 continues code:ee41/02/00 cheat description:Start with 5 continues code:ee41/02/05 cheat description:Start with 9 continues code:ee41/02/09 cheat description:Start on stage 2 - Hamlet code:e0f0/00/02 cheat description:Start on stage 3 - The House code:e0f0/00/04 cheat description:Start on stage 4 - The Freeway code:e0f0/00/05 cheat description:Start on stage 5 - The Office block code:e0f0/00/06 cheat description:Start on stage 6 - The Helicopter code:e0f0/00/07 cheat description:Start on stage 7 - The Film Premiere code:e0f0/00/08 cheat description:Start on Stage 8 - The Cinema code:e0f0/00/09 cheat description:Start on the end-of-level bad guy code:e0f0/00/0a cheat description:Invincibility (blinking) code:008c/19 cheat description:Infinite health (alt) code:002e/2f cheat description:Infinite lives (alt) code:0092/09 cartridge sha256:f15382be46e474c596566c5a726ae39dadfa18289722bac2da44b6493bbabfec name:Last Ninja, The (USA) cheat description:Infinite health code:8ad8/85/a5 cheat description:Press Select on controller 2 to skip to next level, A for next screen, B for previous screen code:e507/d0/f0 cheat description:Infinite lives code:007d/09 cheat description:Infinite time (seconds) code:0369/00 cartridge sha256:54dd62754f48e39af39c3e8d645897af25aaba31523267bc41d4c95f2b0348d5 name:Last Starfighter, The (USA) cheat description:Infinite lives - both players code:9660/c6/a5 cheat description:Stop irritating shake code:94b3/85/24 cheat description:Start with 1 life - both players code:8b7f/05/01 cheat description:Start with 6 lives - both players code:8b7f/05/06 cheat description:Start with 9 lives - both players code:8b7f/05/09 cheat description:Start with 1 life - P2 code:8b86/85/84 cheat description:Start on level 5 - P1 code:8b6c/00/04+8b6f/85/24+8b71/85/24 cheat description:Start on level 10 - P1 code:8b6c/00/09+8b6f/85/24+8b71/85/24 cheat description:Start on level 14 - P1 code:8b6c/00/0d+8b6f/85/24+8b71/85/24 cartridge sha256:53923dcb59afac40fbfed4aa2298be156b5b9763ec43956757ec44092ba799c5 name:Layla (Japan) cheat description:Infinite energy code:e1d6/c6/a5 cheat description:Infinite Machine Gun ammo code:d4e1/c6/a5 cheat description:Infinite Dynamite Sticks code:d5e9/c6/a5 cheat description:Infinite Grenades code:d51f/c6/a5 cartridge sha256:203dc9486ba58e65f9a4289da476dc15ff34d6fd39d355b438ae4db2d182746d name:Legacy of the Wizard (USA) cheat description:Infinitel ife code:e7e2/85/24 cheat description:Infinite magic code:e7f7/c6/24 cheat description:Never lose items code:e4db/d6/24 cheat description:Shopkeeper forgets to charge code:e84b/85/24 cheat description:No enemies code:e99f/91/b1 cheat description:Walk through walls code:dd99/4c cheat description:Lyll's strength tripled code:ffb4/01/03 cheat description:Lyll's jumping improved code:ffb3/1a/30 cheat description:Roas' strength tripled code:ffb0/01/03 cheat description:Roas' jumping improved code:ffaf/14/2a cheat description:Xemn's strength tripled code:ffa8/03/09 cheat description:Xemn's jumping improved code:ffa7/12/20 cheat description:Menya's strength tripled code:ffac/02/06 cheat description:Menya's jumping improved code:ffab/14/20 cartridge sha256:d2a585ff6febf59447f9bd9fbb387ae4985385d6f6f61a70e145a5ee69523018 name:Legendary Wings (USA) cheat description:Almost infinite health code:830c/01/00+8586/01/00 cheat description:Hit anywhere code:8b88/f2/00+8358/ef/00+843a/ec/00+8b98/e2/00+8b90/ea/00+8382/99/ad+839a/99/ad cheat description:Gain double powers on pick-up code:8275/01/02+85e1/01/02 cheat description:Gain triple powers on pick-up code:8275/01/03+82e1/01/02 cheat description:Start with 1 life - P1 code:8783/03/01 cheat description:Start with 6 lives - P1 code:8783/03/06 cheat description:Start with 9 lives - P1 code:8783/03/09 cheat description:Start with 1 life - both players code:8778/03/01 cheat description:Start with 6 lives - both players code:8778/03/06 cheat description:Start with 9 lives - both players code:8778/03/09 cheat description:Infinite health - P1 code:0520/63 cheat description:Infinite lives - P1 code:0058/09 cheat description:Have Double shot code:007a/01 cheat description:Have Rapid Fire shot code:007a/02 cheat description:Have Crazy Ball shot code:007a/03 cheat description:Have Firebird ability code:007a/04 cheat description:One hit kills on bosses code:04b0/00 cartridge sha256:3b5627bc1ebaa7a84953d7337c7684a93beaf973f4a8b3a42b513dc1e0ab0a09 name:Legends of the Diamond - The Baseball Championship Game (USA) cheat description:Balls are considered strikes code:b53a/29/a9 cheat description:1 ball and you walk code:b5c0/04/01 cheat description:2 balls and you walk code:b5c0/04/02 cheat description:6 balls to walk code:b5c0/04/06 cheat description:1 strike and you're out (fouls don't count as strikes) code:b55c/03/01 cheat description:2 strikes and you're out (fouls don't count as strikes) code:b55c/03/02 cheat description:5 strikes and you're out (fouls don't count as strikes) code:b55c/03/05 cartridge sha256:9d83796d8feba9713fa5a1354fd9253cda5cb33ab5bc6f1c6f97d5eb90aef6c3 name:Legend of Kage, The (USA) cheat description:Invincibility code:9b76/85/a5 cheat description:Infinite lives - both players code:82e3/c6/a5 cheat description:Hit anywhere with Shurikens code:acdf/0a/00+acd3/16/00+acaf/6b/00 cheat description:Hit anywhere with Sword code:ad06/14/00+ad12/08/00+acaf/6b/00 cheat description:Kill the white boss (you do not need to kill the butterfly) code:acaf/6b/00 cheat description:Super-ninja-power running ability code:8b51/02/04 cheat description:Super-ninja-power jumping ability code:a14f/04/0f+a150/04/0f+a151/04/0f cheat description:Start with 28 lives - both players code:8096/86/84 cheat description:Infinite lives - P1 code:002b/63 cartridge sha256:1849bb687d038a43971651b13392481768ea0bc15f3d04b6898f052bbfa356e5 name:Legend of the Ghost Lion (USA) cheat description:Infinite Courage points code:9f37/8d/ad cheat description:Infinite Dream points code:c5ae/8d/ad cheat description:Buy items for free in most shops (must have enough rubies to purchase item) code:c4db/8d/ad cheat description:Infinite health - main character code:04a1/ff cheat description:Max Dream - main character code:04a3/ff+04a4/ff cheat description:Max Dream total - main character code:04a5/ff cheat description:Max Hope - main character code:04a0/ff cheat description:Max Rubies code:041a/ff cheat description:Have #2 Whip code:0562/2a cheat description:Have F-Sword code:0562/2b cartridge sha256:ec0d4ebf6d2fcecd1d95fef7329954efe79676959bc281ea908b226459bc6dc2 name:Legend of Zelda, The (USA) (Rev A) cheat description:Invincibility (blinking) code:ec7d/b9 cheat description:Infinite life code:b3e0/ad/60 cheat description:Have the Pink Ring (infinite life) code:9e55/15/62 cheat description:Have Blue Ring effect code:b3cd/06/d0 cheat description:Have Red Ring effect code:b3cd/06/d1 cheat description:All items are free code:a568/ce/ad+88ee/43/00 cheat description:Fewer enemies code:8897/c0/00 cheat description:No dark rooms code:b68f/f0/10 cheat description:No Zolas code:86e6/08/00 cheat description:Reset counter to zero code:a532/01 cheat description:Speed writing code:8818/91 cheat description:Walk faster code:b387/a5/a9+b388/00/b0 cheat description:Walk through walls in dungeons code:91a9/85/a5+914b/f0/60 cheat description:Create character with 8 life hearts code:9f41/22/77 cheat description:Create character with 16 life hearts code:9f41/22/ff cheat description:Invincibility code:7b3a/60 cheat description:Invincibility (blinking) (alt) code:04f0/09 cheat description:Infinite life (alt) code:0670/ff cheat description:Hit anywhere code:7bf2/24+7c28/ad cheat description:Get items from anywhere code:7353/24+735f/24 cheat description:Infinite Keys code:066e/03 cheat description:Infinite Rupies code:066d/ff cheat description:Enemies don't shoot anything code:034c/ff cheat description:Turbo Sword code:03dd/01 cheat description:Have all Tri-Force pieces code:0671/ff cheat description:Have Maps for Dungeons 1-8 and Compass for Dungeon 9 code:0668/ff+0669/ff cheat description:Have Map for Dungeon 9 code:066a/ff cheat description:Have Arrows code:0659/01 cheat description:Have Blue Candle code:065b/01 cheat description:Have Bombs code:0658/10 cheat description:Have Bow code:065a/01 cheat description:Have Enemy Bait code:065d/01 cheat description:Have Flute code:065c/01 cheat description:Have Ladder code:0663/01 cheat description:Have Magic Book code:0661/01 cheat description:Have Magic Boomerang code:0675/01 cheat description:Have Magic Wand code:065f/01 cheat description:Have Magical Key code:0664/01 cheat description:Have Magical Shield code:0676/01 cheat description:Have Magical Sword code:0657/03 cheat description:Have Power Bracelet code:0665/01 cheat description:Have Raft code:0660/01 cheat description:Have Red Candle code:065b/02 cheat description:Have Silver Arrows code:0659/02 cheat description:Have White Sword code:0657/02 cheat description:Have Wooden Sword code:0657/01 cartridge sha256:085e5397a3487357c263dfa159fb0fe20a5f3ea8ef82d7af6a7e848d3b9364e8 name:Legend of Zelda, The (USA) cheat description:Invincibility (blinking) code:ec7d/b9 cheat description:Infinite life code:b3e0/ad/60 cheat description:Have the Pink Ring (infinite life) code:9e59/15/62 cheat description:All items are free code:a568/ce/ad+88ee/43/00 cheat description:Almost no enemies in Overworld code:9325/04/00+9326/05/00+9327/06/00 cheat description:Fewer enemies code:8897/c0/00 cheat description:No dark rooms code:b68f/f0/10 cheat description:No Zolas code:86e6/08/00 cheat description:Reset counter to zero code:a532/01 cheat description:Speed writing code:8818/91 cheat description:Walk faster code:b387/a5/a9+b388/00/b0 cheat description:Walk through walls in dungeons code:919f/85/a5+9141/f0/60 cheat description:Create character with 8 life hearts code:9f41/22/77 cheat description:Create character with 16 life hearts code:9f41/22/ff cheat description:Invincibility code:7b3a/60 cheat description:Invincibility (blinking) (alt) code:04f0/09 cheat description:Infinite life (alt) code:0670/ff cheat description:Hit anywhere code:7bf2/24+7c28/ad cheat description:Get items from anywhere code:7353/24+735f/24 cheat description:Infinite Keys code:066e/03 cheat description:Infinite Rupies code:066d/ff cheat description:Enemies don't shoot anything code:034c/ff cheat description:Turbo Sword code:03dd/01 cheat description:Have all Tri-Force pieces code:0671/ff cheat description:Have Maps for Dungeons 1-8 and Compass for Dungeon 9 code:0668/ff+0669/ff cheat description:Have Map for Dungeon 9 code:066a/ff cheat description:Have Arrows code:0659/01 cheat description:Have Blue Candle code:065b/01 cheat description:Have Bombs code:0658/10 cheat description:Have Bow code:065a/01 cheat description:Have Enemy Bait code:065d/01 cheat description:Have Flute code:065c/01 cheat description:Have Ladder code:0663/01 cheat description:Have Magic Book code:0661/01 cheat description:Have Magic Boomerang code:0675/01 cheat description:Have Magic Wand code:065f/01 cheat description:Have Magical Key code:0664/01 cheat description:Have Magical Shield code:0676/01 cheat description:Have Magical Sword code:0657/03 cheat description:Have Power Bracelet code:0665/01 cheat description:Have Raft code:0660/01 cheat description:Have Red Candle code:065b/02 cheat description:Have Silver Arrows code:0659/02 cheat description:Have White Sword code:0657/02 cheat description:Have Wooden Sword code:0657/01 cartridge sha256:494aa7d49d3f4d66f01cac0f31a9bc7bc9626faa575a635f43e7caf19a832a48 name:Lemmings (USA) cheat description:Infinite time code:e0b3/c6/a5 cheat description:Infinite climbers code:e16e/c6/a5 cheat description:Infinite floaters code:e198/c6/a5 cheat description:Infinite bombers code:e1c7/c6/a5 cheat description:Infinite blockers code:e211/c6/a5 cheat description:Infinite builders code:e261/c6/a5 cheat description:Infinite bashers code:e2ab/c6/a5 cheat description:Infinite miners code:e304/c6/a5 cheat description:Infinite diggers code:e357/c6/a5 cartridge sha256:97c67809c952bc25060a01dca224eedc5ed76cc770bac44452c92cd3a1d4a418 name:Lethal Weapon (USA) cheat description:Infinite ammo when shooting on the ground code:d55c/99/b9 cheat description:Infinite ammo when shooting in the air code:d5dd/99/b9+d5a1/99/b9 cheat description:E restores health completely code:d8e2/10/40 cheat description:E worth nothing code:d8e2/10/00 cheat description:Extra ammo restores ammo completely code:d8c8/10/40 cheat description:Extra ammo worth nothing (if you run out of ammo you can't use gun till next stage) code:d8c8/10/00 cheat description:No health lost when falling off screen code:f8b2/20/00 cheat description:Falling off screen is fatal code:f8b2/20/40 cheat description:Bullet proof vest lasts longer code:d8f5/30/ff cheat description:Bullet proof vest lasts until end of stage, except when you die from punches or falling off screen code:c9b9/ca/ea cheat description:Bullet proof vest does not last as long code:d8f5/30/0a+d8f5/30/10 cheat description:Start on Level 2 code:c236/ca/ea cheat description:Start on Level 3 code:c233/be/a2+c234/97/03+c235/c0/ea cheat description:Invincibility (blinking) - P1 code:05ed/09 cheat description:Infinite health code:05c0/3f cheat description:Infinite ammo code:003f/3a cheat description:One hit kills on bosses code:05c4/00 cartridge sha256:dbd530e6ca07cc4b255b1b885cd5b6b2e23b8d3cac4733c3e4d96acd7d751c28 name:Life Force (USA) cheat description:Infinite lives code:c345/d6/24 cheat description:Keep pods after death code:c653/95/24 cheat description:Hit anywhere code:d231/1e/00+d23e/0d/00+d273/a9/60+d24a/90/d0 cheat description:One hit kills most enemies code:d299/e9/a9 cheat description:Press Start to finish the level code:fd96/24/4e+fd94/01/02 cheat description:Start with Speed code:c6c1/00/01 cheat description:Start with Missile code:c6c1/00/02 cheat description:Start with Ripple code:c6c1/00/03 cheat description:Start with Laser code:c6c1/00/04 cheat description:Start with Option code:c6c1/00/05 cheat description:Start with Force Field code:c6c1/00/06 cheat description:Start at the volcanic stage code:eeb5/00/01 cheat description:Start at the prominence stage code:eeb5/00/02 cheat description:Start at cell stage 2 code:eeb5/00/03 cheat description:Start at the temple stage code:eeb5/00/04 cheat description:Start at the mechanical city stage code:eeb5/00/05 cheat description:Start with 1 life code:eecf/03/01 cheat description:Start with 6 lives code:eecf/03/06 cheat description:Invincibility - P1 code:0084/c0 cheat description:Invincibility - P2 code:0085/c0 cheat description:Infinite lives (alt) code:0034/63 cheat description:Complete the level code:004e/02 cheat description:Progress through the level faster code:003a/02 cheat description:Have 30 lives option code:07ef/01 cheat description:Have upgraded Laser code:0076/03 cheat description:Have double Speed code:0080/02 cheat description:Have triple Speed code:0080/03 cheat description:Have Shield code:0082/09 cheat description:Have double Missile code:0086/02 cheat description:Have Option code:0091/01 cartridge sha256:36769f543b6cfb08c5ef8673a11a7b27264bdd60323a62e9083b3da47eb33a8c name:Lightgun Game 2 in 1 - Cosmocop + Cyber Monster (Asia) (Unl) cheat description:Cosmo Cop - Infinite lives code:cbaf/ce/ad cheat description:Cosmo Cop - Infinite ammo code:cb22/8d/ad cheat description:Cosmo Cop - Infinite energy code:cb68/ce/ad+cb6b/ce/ad cheat description:Cyber Monster - Infinite misses code:9550/ce/60 cartridge sha256:745164dee8e4af6a7150d21e9ef082f56a51b01c5c32f28cdf4cd211bed3714d name:Lightgun Game 2 in 1 - Tough Cop + Super Tough Cop (Asia) (Unl) cheat description:Infinite health code:037a/06 cartridge sha256:cecc797ffc82c5764e89038262c00b325f44afc0d9fc4b5bef295ea227e1dd22 name:Lion King, The (Europe) cheat description:Invincibility code:837d/f0/d0+b467/f0/d0 cheat description:Infinite lives code:84f8/ce/ad cartridge sha256:475c35c18b5e958122473bcca52d54438e1734b1b74dc295492eba6d29927193 name:Little League Baseball - Championship Series (USA) cheat description:Balls are considered strikes code:d336/f0/a9 cheat description:Always hit a homerun (press B while the ball is in play) code:b311/df/40+b30f/c1/93 cartridge sha256:68e98b1b8dc5da610321f92718b4b4c2b2b71b6c752ff25ca6926e26cd91c57f name:Little Mermaid, The (USA) cheat description:Invincibility code:c9d5/f0/d0+818b/f0/d0 cheat description:Invincibility after one hit code:c9d7/c6/a5 cheat description:Infinite lives code:d359/c6/a5 cheat description:Keep red pearls after dying code:d353/85/24 cheat description:Keep green pearls after dying code:d355/85/24 cheat description:Get all pearls after dying code:d352/00/03 cheat description:Start with all red pearls code:c64c/00/03+c64e/e9/3d cheat description:Start with all green pearls code:c64c/00/03+c64e/e9/3e cheat description:Start with 1 heart code:c654/03/01+c720/03/01 cheat description:Start with 5 hearts code:c654/03/05+c720/03/05 cheat description:Start with 1 life code:c650/02/00 cheat description:Start with 6 lives code:c650/02/05 cheat description:Start with 9 lives code:c650/02/08 cheat description:Start on Ursula stage code:c64c/00/05 cheat description:Start on stage 2 code:c64c/00/01 cheat description:Start on stage 3 code:c64c/00/02 cheat description:Start on stage 4 code:c64c/00/03 cheat description:Start on stage 5 code:c64c/00/04 cartridge sha256:e95d3557fa60bacabe7a0b65277cdf2f084b6f58b55784d3d631ab030def0a91 name:Little Nemo - The Dream Master (USA) cheat description:Infinite life code:e0c4/ce/ad cheat description:Infinite lives code:cb1d/c6/a5 cheat description:Mega-jump code:afc4/0a/16 cheat description:Speed jumps code:b1d7/01/04+b13d/fe/fb cheat description:Super speed code:b1a3/01/02+b109/fe/fd cheat description:Start with 1 life code:cacd/03/01 cheat description:Start with 6 lives code:cacd/03/06 cheat description:Start with 9 lives code:cacd/03/09 cheat description:Start on stage 2 code:cab9/00/01 cheat description:Start on stage 3 code:cab9/00/02 cheat description:Start on stage 4 code:cab9/00/03 cheat description:Start on stage 5 code:cab9/00/04 cheat description:Start on stage 6 code:cab9/00/05 cheat description:Start on stage 7 code:cab9/00/06 cheat description:Start on stage 8 code:cab9/00/07 cheat description:Invincibility (blinking) code:0630/03 cheat description:Infinite life (alt) code:05d0/05 cheat description:Infinite lives (alt) code:008e/09 cheat description:Infinite Keys code:008c/09 cheat description:Fly code:0540/ff cartridge sha256:50badb618accf0ca28966c05ca4ff159aa9afa2fccd7f0354b8eff6af105a8f0 name:Little Ninja Brothers (USA) cheat description:Invincibility code:b132/d0/50 cheat description:Invincibility to water code:afd2/5e/ad cheat description:Infinite Life code:b148/99/b9 cheat description:Infinite Dragon Kicks code:b4bf/0d/00 cheat description:Infinite money code:d9d1/ad/60 cheat description:Mighty Ball always available code:9a8c/01/00 cheat description:T-Star always available code:9b3d/ad/60 cheat description:All T-Stars code:9b2f/29/a9 cheat description:Max money after fights code:d99c/02/00 cheat description:Quick level up code:d926/1a/00 cheat description:Start with 255 Life code:da3c/0a/ff cheat description:Start with 50 Attack code:da3d/01/32 cheat description:Have Batteries code:0449/02 cheat description:Have Marks code:042a/06 cheat description:Have Meat Bun code:044d/01 cheat description:Have Medicine code:044b/01 cheat description:Have Prism Claw code:0439/08 cheat description:Have Prism Sword code:043b/05 cheat description:Have Prism Shield code:043c/04 cheat description:Have Sacred Robe code:043d/04 cheat description:Have Sweet Buns code:044c/08 cheat description:Have T-Stars code:042b/08 cheat description:Have Whirly Birds code:044a/01 cartridge sha256:a5165565263eaf8bdc45a8e6a615704f9bf271cd6d547d22c098c80cbaffd879 name:Little Samson (USA) cheat description:Invincibility against enemies code:825b/d0/10 cheat description:Infinite health code:8269/fd/2c cheat description:Infinite lives code:e498/c6/24 cheat description:Hit anywhere code:8435/b0/30 cheat description:Collectable items never disappear code:aacd/de/60 cheat description:Increase Samson's health gauge code:e5c1/08/18 cheat description:Increase Kikira's health gauge code:e5c2/08/18 cheat description:Increase Gamm's health gauge code:e5c3/10/20 cheat description:Increase K.O.'s health gauge code:e5c4/04/10 cheat description:Increase Samson's health code:e5c5/08/18 cheat description:Increase Kikira's health code:e5c6/08/18 cheat description:Increase Gamm's health code:e5c7/10/20 cheat description:Increase K.O.'s health code:e5c8/04/10 cheat description:Crystal ball adds 4 units to health gauge code:aa30/04/08 cheat description:Small hearts give 4 health units code:a9de/02/08 cheat description:Infinite health - Little Samson code:0097/08 cheat description:Infinite health - Dragon code:0098/08 cheat description:Infinite health - Golem code:0099/0f cheat description:Infinite health - Mouse code:009a/04 cartridge sha256:33c362ea3dbce2ac449e0d877d85904c26fcaf4b197e27b23efe9cbe67f20e15 name:Locksmith (Asia) (PAL) (Unl) cheat description:Infinite health code:0573/23 cheat description:Infinite time code:056a/01 cheat description:Instantly beat puzzle code:0043/ff cartridge sha256:6c17c7bf2f7466eb43718305a0d74bd75f31b65429bc1fe406c34565e792310c name:Lode Runner (USA) cheat description:Invincibility code:c49d/f0/24+c496/f0/24+c473/f0/24 cheat description:Infinite lives code:c577/c6/24 cheat description:Moonwalk code:d114/30/10 cheat description:Heavy gravity code:cc36/07/04+cc40/04/00 cheat description:Start with 1 life code:c65b/05/01 cheat description:Start with 10 lives code:c65b/05/0a cartridge sha256:622ef597b328a204fafcef55c9aef0de08489a43898a6c9adaa9d39971e06f69 name:Lone Ranger, The (USA) cheat description:Infinite health - side views only code:c14f/85/24 cheat description:Infinite regular and silver bullets code:a85b/01/00 cheat description:Items are free code:a50f/e5/60 cheat description:Cheaper silver bullets code:a7b6/0a/05 cheat description:Cheaper standard bullets code:a7b5/05/02 cheat description:Don't lose money when shooting bystanders code:a857/46/24+a859/66/24 cheat description:Walk anywhere - Overworld code:a9d4/85/a5 cheat description:Start with 255 dollars code:f5ce/64/ff cheat description:Start with 10 silver bullet rounds code:f5d6/05/0a cheat description:Start with 15 silver bullet rounds code:f5d6/05/0f cheat description:Start with 15 standard bullet rounds code:f5d2/0a/0f cheat description:Start with 30 standard bullet rounds code:f5d2/0a/1e cheat description:Infinite health code:005f/0c cheat description:Infinite money code:0050/ff+df30/ff cheat description:Infinite regular and silver bullets (alt) code:0052/06 cheat description:Infinite T.N.T. code:0055/63 cartridge sha256:fbf9426155adf3b8a57b9123760c88f2c61f33fb2f6c5b21c894d5d83dd19138 name:Loopz (USA) cheat description:Infinite time to place blocks code:0090/ff cheat description:Level modifier code:0086/00 cartridge sha256:4fb6c5c8359dcbabcb4d05cf36192c790e68a509ef8666c20ebdb81541df3243 name:Low G Man - The Low Gravity Man (USA) cheat description:Invincibility code:a11e/f0/60+a45e/2a/27 cheat description:Infinite life (blinking) code:880f/8d/ad cheat description:Infinite ammo - secondary weapon code:8bbc/de/ad cheat description:Infinite vehicle fuel code:d96c/ce/ad cheat description:Infinite time code:d947/ce/2c cheat description:Infinite lives code:d870/ce/ad cheat description:Hit anywhere code:a0aa/1b/00+a0e3/20/ad cheat description:Get items from anywhere code:a19b/0a/00 cheat description:Full life gained from capsules code:a600/02/08 cheat description:Less life gained from capsules code:a600/02/01 cheat description:Full EMDP on a new life code:d86c/01/03 cheat description:Full AGM on a new life code:d864/00/02 cheat description:10 Boomerangs on pick-up code:a692/03/0a cheat description:10 Fireballs on pick-up code:a66c/03/0a cheat description:10 Bombs on pick-up code:a6b8/03/0a cheat description:10 Waves on pick-up code:a6de/03/0a cheat description:1 life after continue code:d89c/03/01 cheat description:6 lives after continue code:d89c/03/06 cheat description:9 lives after continue code:d89c/03/09 cheat description:Start with 1 life code:d6a2/03/01 cheat description:Start with 6 lives code:d6a2/03/06 cheat description:Start with 9 lives code:d6a2/03/09 cheat description:Infinite life code:0639/08 cheat description:Infinite lives (alt) code:06d6/09 cheat description:Infinite time (alt) code:0738/ff cheat description:Enemies die instantly code:050a/00+050e/00 cheat description:Jump higher code:0647/35 cheat description:Rank is 03/03 code:0651/03 cheat description:Rank left is 99/99 code:0656/63+0657/63 cartridge sha256:9cdcac614a14e0aefe34d6333bc23ef3e08986144d2dacd322835aad8ec62add name:Lunar Pool (USA) cheat description:Infinite Balls code:01c3/63 cartridge sha256:52812b55986f96fa77eb24a76e795dc8d79977eec7488c7b5b84ac3b47d60366 name:M.C. Kids (USA) cheat description:Infinite lives code:d9cb/8d/2c cheat description:Infinite hearts code:e607/05/c0 cheat description:Don't lose Golden Arches when hit code:e5ff/05/c0 cheat description:Multi-jump code:812d/c0/3c+812c/ad/a9+812e/04/ea cheat description:Super-jump code:86ec/04/18+86e9/03/00 cheat description:1 heart per life code:d748/02/00+d9cf/02/00 cheat description:8 hearts per life code:d748/02/07+d9cf/02/07 cheat description:Always find all cards in level code:f66d/0c/00+f669/ad/a9+f66a/19/01+f66b/04/ea cheat description:Access any level on the map code:84a3/01/00 cheat description:Start with 2 lives code:d743/03/01 cheat description:Start with 7 lives code:d743/03/06 cheat description:Start with 10 lives code:d743/03/09 cartridge sha256:345fe1e466b3e8d7a8b7f01f545808793b120ad17ed8497ddc306e205b2589a3 name:M.U.L.E. (USA) cheat description:4 'months' for beginner game code:86c3/06/04 cheat description:9 'months' for beginner game code:86c3/06/09 cheat description:6 'months' for standard game code:86a5/0c/06 cheat description:20 'months' for standard game code:86a5/0c/14 cheat description:Humanoids start with $400 code:8719/58/90+871e/02/01 cheat description:Humanoids start with $800 code:8719/58/20+871e/02/03 cheat description:Flappers start with $1300 code:8730/40/14+8735/06/05 cheat description:Flappers start with $2000 code:8730/40/d0+8735/06/07 cartridge sha256:d10e4280b6ca868142061ab731aeb378c983334b89a1727a524c57c241812d13 name:M.U.S.C.L.E. - Tag Team Match (USA) cheat description:Invincibility - P1 team code:8239/a5/a9+823a/4f/63 cheat description:Set bout length timer to 20 code:81db/03/02 cheat description:Set bout length timer to 60 code:81db/03/06 cheat description:Set bout length timer to 90 code:81db/03/09 cheat description:Computer controlled players jump faster code:99bb/01/02 cheat description:Computer controlled players speed up code:a058/01/02 cartridge sha256:944105c6dcc57314968d53a2e0dcdfc0e2b60678a53839ba25925416a7ac0e8c name:Mach Rider (Japan, USA) (Rev A) cheat description:Infinite energy code:ac87/c4+bfea/83 cheat description:Infinite lives code:d35a/a6 cheat description:Infinite time - solo and endurance courses code:ac65/a5 cheat description:Infinite Shots code:ca64/b6 cheat description:Bike Never Explode code:bfc2/e4 cheat description:Never lose bike abilities (color) code:bfc8/65 cheat description:Super Speed code:83ad/a5+83b3/a5 cheat description:No winter code:c677/ad cartridge sha256:ef238662a27934d6dbe1692e822786a74a9a2c8bc58c38aa0fd5cfb3e2f1abce name:Mach Rider (Japan, USA) cheat description:Infinite energy code:ac87/c4+bfea/83 cheat description:Infinite lives code:d35a/a6 cheat description:Infinite time - solo and endurance courses code:ac65/a5 cheat description:Infinite Shots code:ca64/b6 cheat description:Bike Never Explode code:bfc2/e4 cheat description:Never lose bike abilities (color) code:bfc8/65 cheat description:Super Speed code:83ad/a5+83b3/a5 cheat description:No winter code:c677/ad cartridge sha256:80757aa85fe4001123cb839db0fc72fc7e06020ecba5c89abb049b8490fd3d0b name:Mad Max (USA) cheat description:Infinite ammo code:8ee0/ce/ad cheat description:No damage done to car code:87f9/10/00 cheat description:Less damage done to car code:87f9/10/04 cheat description:More damage done to car code:87f9/10/20 cheat description:No damage done to you code:8833/08/00 cheat description:Less damage done to you code:8833/08/04 cheat description:More damage done to you code:8833/08/10 cheat description:A better tune-up code:e1cb/20/60 cheat description:Dynamite is free code:8279/01/00 cheat description:Ammo is free code:826c/01/00 cheat description:Cheaper arena pass code:8286/07/04+824b/37/34 cheat description:Start with full food and water code:ff06/20/ff cheat description:Start with less ammo code:ff13/80/40 cartridge sha256:ab0a43bc7c33f0cdd8acf15c4da967ba2af56431de1a598b9767bd10e78cc8fa name:Mafat Conspiracy, The (USA) cheat description:Infinite bullets code:c292/c6/24 cheat description:Infinite time code:da76/ca/ea cheat description:Immune to physical damage code:ce71/f1/24 cheat description:Immune to weapon damage code:cd1d/f9/2c cheat description:Immune to damage in maze code:c1f1/fd/2c cheat description:Fewer bullets on pick-up code:cd53/0a/05 cheat description:More bullets on pick-up code:cd53/0a/14 cheat description:Faster timer code:da70/3c/20 cheat description:Slower timer code:da70/3c/70+da65/3c/70 cartridge sha256:2eee5b14a90458088ac18c36352ab605ae4fe452a59f2675937acee0d15e94b6 name:Magic Carpet 1001 (Unl) cheat description:Invincibility code:8487/38/60 cartridge sha256:9a5d7367891f4d929fe5e3be5fe2988e3e6c0b0d70b7cd401976f16b3b5f0a9d name:Magic Jewelry (Asia) (Unl) cheat description:Bypass checksum check code:e7b0/d0/24+e7a8/d0/24 cheat description:Speed never increases code:ec87/6d/00+ec86/a6/a2 cheat description:Disable Game Over code:e7bf/90/24 cartridge sha256:caae56599689d4297c3be1afdc77d5bfc510d47d6e668244c308b9732eb41dea name:Magician (USA) cheat description:Start on area 2 - Wilderness code:0051/01 cheat description:Start on area 3 - Lake code:0051/02 cheat description:Start on area 4 - Forest code:0051/03 cheat description:Start on area 5 - Caverns code:0051/04 cheat description:Start on area 6 - Dungeons code:0051/05 cheat description:Start on area 7 - Castle code:0051/06 cheat description:Start on area 8 - Tower code:0051/07 cheat description:Start on the Tower Top boss code:0051/08 cartridge sha256:527faba646cd9e959a4df5d015cd14ac3fae461b06655be99d47c1a754384097 name:Magic of Scheherazade, The (USA) cheat description:Invincibility code:f4b2/29/a9 cheat description:Infinite HP code:a45b/e5/e9 cheat description:Infinite lives code:e389/c6/a5 cheat description:Hit anywhere code:f487/03/00+f47d/90/30+f47b/c5/a5+f47e/09/26+f47c/09/cb cheat description:Never lose Mashroobs code:8c00/ce/ad cheat description:Get coins from anywhere code:8ba2/03/06 cheat description:Less energy gained from Bread code:8ac1/32/19 cheat description:Less magic gained from Mashroobs code:8c0a/05/02 cheat description:Start with only 20 Gold Coins code:e230/05/02 cheat description:Start with 1 life code:e240/03/01 cheat description:Start with 6 lives code:e240/03/06 cheat description:Start with 9 lives code:e240/03/09 cheat description:Infinite HP (alt) code:0081/ff cheat description:Infinite MP code:008d/18 cheat description:Infinite Bread code:0306/25 cheat description:Infinite Carpets code:0311/10 cheat description:Infinite Mashroob code:0307/25 cheat description:Infinite R. Seeds code:0310/05 cheat description:Infinite Troopers code:03d7/08 cheat description:Gain 65280 EXP for each kill code:0086/ff cartridge sha256:daa1c7263a804920b2ebeb5b2041da0a207a49b5bcddbfdf51f02ba7e3d89092 name:Magmax (USA) cheat description:Infinite lives - 1P game code:e66f/c6/a5 cheat description:Infinite lives - 2P game code:e68d/01/00 cheat description:Start with 1 life - both players code:cbc4/02/00 cheat description:Start with 6 lives - both players code:cbc4/02/05 cheat description:Start with 9 lives - both players code:cbc4/02/08 cheat description:Infinite lives - P1 code:0058/02 cheat description:Infinite lives - P2 code:0059/05 cheat description:Max upgrades - P1 code:008b/05 cheat description:Max upgrades - P2 code:008c/05 cartridge sha256:84f5377980d2fd44d71faec42f858b1e83540c2f55aba9236c3279d6dde8592a name:Maniac Mansion (USA) cheat description:All codes start out as 0000 code:c8a4/a5/85 cartridge sha256:6bc8f71a1d19cab1a1364c7e2988eaec25b2694aa29670360cab6c513f1c47ac name:Mappy (Japan) cheat description:Invincibility code:dada/d0/50+da81/f0/24 cheat description:Disable Hurry! timer code:f30a/e6/24 cheat description:Infinite time - Bonus stages code:ca0b/c6/24 cheat description:Press Start to complete stage code:c22d/05/60+c228/45/a9+c22c/f0/01+c22a/85/8d+c22b/23/3e+c229/23/86 cheat description:Ropes don't change color when jumping on them code:dc1f/de/ad+e21a/de/ad cheat description:Disable trap floors code:f0c6/99/ad cheat description:Collect items from anywhere - normal stages code:f1ce/d0/24+f1d9/b0/24 cheat description:Collect Red Balloons from anywhere - Bonus stages code:f1ce/d0/24+f1d9/b0/24 cartridge sha256:7d07d335a873205964299b2735c14fe06170329523341a651f275cdf3ed96f18 name:Mappy-Land (USA) cheat description:Infinite lives code:a64d/c6/a5 cheat description:Start with 1 toy code:a3d8/03/01 cheat description:Start with coins, not toys code:a3d0/00/03 cheat description:Start with fish, not toys code:a3d0/00/01 cheat description:Start with pots, not toys code:a3d0/00/02 cheat description:Start with 1 life code:a0ae/02/00 cheat description:Start with 6 lives code:a0ae/02/05 cheat description:Start with 6 toys code:a3d8/03/06 cartridge sha256:d77ed527cf081019dc8e1cad72872ef3bd640114221b89f030e0c03229c54ddc name:Marble Madness (USA) cheat description:Infinite time code:a2eb/d6/a9 cheat description:Don't break from falling code:c370/d0/f0 cheat description:Cannot fall into bottomless pits code:c147/a9+880b/a5+c201/a9/ad cheat description:Extra 20 seconds to complete beginner race code:a391/00/14 cheat description:Extra 40 seconds to complete beginner race code:a391/00/28 cheat description:Bonus time not added code:a38e/b0/24 cheat description:Infinite time (alt) code:0044/3c cheat description:Max score - P1 code:004a/63+004b/63+004c/63 cartridge sha256:0cc334007d3eae698cdcd034d12ec9bab2b5266e85bc703cf24ccb4e2d63b654 name:Mario Bros. (World) cheat description:Invincibility code:dce0/d6/60 cheat description:Infinite time - bonus rounds code:e371/ce/ad cheat description:Infinite power blocks code:d2f5/c6/a5 cheat description:Infinite lives code:dce0/a5 cheat description:Stops green fireball from appearing code:e795/ad/60 cheat description:Stops red fireball from appearing code:ea82/01/00 cheat description:Move faster code:c8f5/00/01 cheat description:Move much faster code:c8f5/00/02 cheat description:Enemies move faster code:c908/a4/a0+c909/c7/02 cheat description:Enemies move much faster code:c908/a4/a0+c909/c7/03 cheat description:Mega-jump code:f350/fc/f6+f351/fc/f6 cheat description:Coins kill you code:dcb3/40/00 cheat description:Start with 1 life code:d359/00 cheat description:Start with 6 lives code:d359/05 cheat description:Start with 9 lives code:d359/08 cheat description:Infinite lives - P1 code:0048/04 cheat description:Infinite lives - P2 code:004c/04 cartridge sha256:c9348c4e30ef0bc62c4fd119b5e38d85af493a1eb436c6c229b7a6a52af42681 name:Mario's Time Machine (USA) cheat description:Get an item after killing one Koopa code:b7bc/00/02 cartridge sha256:a385f0bed8d9afd110e649b73084191d80f41728139494f8fcb92d4815cd5197 name:Master Chu and the Drunkard Hu (USA) (Unl) cheat description:Invinicibility code:90ed/fe/bd cheat description:Infinite health code:9730/de/bd cheat description:Infinite lives code:972e/d6/b5 cheat description:Start on round 2 code:8103/01/02 cheat description:Start on round 3 code:8103/01/03 cheat description:Start on round 4 code:8103/01/04 cheat description:Start on round 5 code:8103/01/05 cheat description:Start on round 6 code:8103/01/06 cheat description:Start on round 7 code:8103/01/07 cartridge sha256:c8486cd1a35950007a3ba671a128097d780084182a854d6115ddec7dad56e806 name:Mechanized Attack (USA) cheat description:Infinite lives code:f0b9/ce/ad cheat description:Infinite grenades code:f13e/ce/ad cheat description:Infinite bullets code:f105/ce/ad cheat description:Reduce damage by half code:91e8/03/00 cheat description:Magazine holds half normal amount of bullets after first magazine used code:f118/28/14+f003/28/14 cheat description:Start with only 1 life code:c01d/a2/a0+c01e/00/01+c079/8e/8c cheat description:Start with 6 lives code:c01d/a2/a0+c01e/00/06+c079/8e/8c cheat description:Start with 9 lives code:c01d/a2/a0+c01e/00/09+c079/8e/8c cheat description:Start with only 1 magazine code:c01d/a2/a0+c01e/00/00+c07e/8e/8c cheat description:Start with 8 magazines code:c01d/a2/a0+c01e/00/07+c07e/8e/8c cheat description:Start with only 1 grenade code:c01d/a2/a0+c01e/00/01+c082/8e/8c cheat description:Start with 8 grenades code:c01d/a2/a0+c01e/00/08+c082/8e/8c cartridge sha256:5314ad0c406161195b6bb100ee11304bab8af121bba85992be896d5cb26b109e name:Mega Man (USA) cheat description:Infinite health code:a244/85/a5 cheat description:Invincibility (except against bosses) code:a1eb/a5/60 cheat description:Infinite weapons on pick-up code:a8d2/fd/0d cheat description:Infinite weapons on pick-up (alt) code:a8d5/95/b5 cheat description:Infinite lives code:c259/c6/a9 cheat description:One hit kills code:c915/0b/00+bedf/90/d0 cheat description:One hit kills on bosses code:f3a4/30 cheat description:Collectable items never disappear code:b6b6/fe/bd cheat description:Climb up ladders faster code:97f8/00/01 cheat description:Climb down ladders faster code:982a/ff/fe cheat description:Disable boss invulnerability after hit code:c968/85/24 cheat description:Maximum points for shooting enemies code:b8d0/69/a9+b8d1/28/30 cheat description:Mega-jump code:961f/04/06 cheat description:Multi-jump code:95be/18/14+9cc6/b0/24+9583/29/bd+9584/96/95 cheat description:Enemies always drop extra lives code:bf19/3b/41+bf21/c8/ea cheat description:Enemies always drop large health refill code:bf19/3b/40+bf21/c8/ea cheat description:Enemies always drop large weapon refill code:bf21/c8/ea+bf19/3b/3f cheat description:Start with half energy code:912d/1c/0e cheat description:Start with 1 life code:9053/02/00 cheat description:Start with 6 lives code:9053/02/05 cheat description:Start with 9 lives code:9053/02/08 cheat description:Invincibility code:0055/5a cheat description:Infinite health (alt) code:006a/1c cheat description:Infinite lives (alt) code:00a6/03 cheat description:Have all weapons and all stages cleared code:005d/ff cheat description:Bosses have no invulnerability time code:0056/00 cartridge sha256:1e588d435e75d80c5c0b578b4fa8d196f2cf4346c11c9a7b7e435d768828ad01 name:Mega Man 2 (USA) cheat description:Invincibility code:ce36/f0/d0 cheat description:Invincibility (alt) code:ce36/f0/50+ce34/a5/85 cheat description:Infinite health code:e5a1/8d/ad cheat description:Infinite lives code:c1b6/c6/a5 cheat description:Infinite Heat Man code:ddd9/85/a5 cheat description:Infinite Air Man code:dadf/85/a5 cheat description:Infinite Wood Man code:df63/85/a5 cheat description:Infinite Bubble Man code:db34/c6/a5 cheat description:Infinite Quick Man code:db6f/c6/a5 cheat description:Infinite Metal Man code:dbc9/c6/a5 cheat description:Infinite Clash Man code:db8c/c6/a5 cheat description:Infinite 1 code:dc76/c6/a5 cheat description:Infinite 2 code:e224/c6/a5 cheat description:Infinite 3 code:e340/c6/a5 cheat description:Burst-fire from normal weapon code:da6d/27/23 cheat description:Maximum weapon energy on pick-up code:834f/30/24 cheat description:Hit anywhere (except bosses) code:e632/90/d0+e686/b0/24+e659/d0/24+e664/f0/24+e621/b0/24 cheat description:One hit kills code:e686/b0/24+a634/b0/24 cheat description:Power-jumps code:8a71/04/06 cheat description:Super power-jumps code:8a71/04/08 cheat description:Mega power-jumps code:8a71/04/10 cheat description:Multi-jump code:8b83/ad/20+858f/27/23+8b85/04/85+8b84/a0/8e cheat description:Moonwalking code:8904/29/49 cheat description:Collectable items never disappear code:bcf7/de/dd cheat description:Enemies always drop extra lives code:f2ba/90/50+f2bb/cc/dd cheat description:Enemies always drop large health refill code:f2ba/90/50+f2bb/cc/d9 cheat description:Enemies always drop large weapon refill code:f2ba/90/50+f2bb/cc/d5 cheat description:Special items re-appear after being collected code:e5e8/99/b9 cheat description:Able to access already defeated boss stages code:80e2/dc/00 cheat description:Start with half health code:80c5/1c/0e cheat description:Start with 1 life code:8073/03/01 cheat description:Start with 6 lives code:8073/03/06 cheat description:Start with 9 lives code:8073/03/09 cheat description:Invincibility (blinking) code:004b/02 cheat description:Infinite health (alt) code:06c0/1e cheat description:Have all weapons and all stages cleared code:009a/ff+009b/ff cheat description:Infinite Heat Man once obtained code:009c/1e cheat description:Infinite Air Man once obtained code:009d/1e cheat description:Infinite Wood Man once obtained code:009e/1e cheat description:Infinite Bubble Man once obtained code:009f/1e cheat description:Infinite Quick Man once obtained code:00a0/1e cheat description:Infinite Flash Man once obtained code:00a1/1e cheat description:Infinite Metal Man once obtained code:00a2/1e cheat description:Infinite Crash Man once obtained code:00a3/1e cheat description:Infinite 1 once obtained code:00a4/1e cheat description:Infinite 2 once obtained code:00a5/1e cheat description:Infinite 3 once obtained code:00a6/1e cheat description:Infinite energy tanks code:00a7/03 cheat description:Infinite lives (alt) code:00a8/04 cheat description:Atomic Fire always fully charged code:00ac/ff cheat description:Bosses have no invulnerability time code:05a8/00 cartridge sha256:5b85c1ff632c6ac34742ac87b9c8ddee9a13827caf1212ecfa1d11f1f9dece50 name:Mega Man 3 (USA) cheat description:Invincibility code:80ae/d0/f0 cheat description:Infinite health code:80e0/85/24 cheat description:Infinite health (alt) code:80e0/85/a5 cheat description:Infinite lives code:cb82/01/00 cheat description:Infinite weapons (except Top Man) code:def6/99/b9 cheat description:Infinite Top Man code:8292/85/a5 cheat description:Hit anywhere code:fbd2/38/18+fbd3/bd/60 cheat description:One hit kills code:81ca/02/00 cheat description:Mega-jump code:ceb9/04/07 cheat description:Multi-jump code:cd9b/07/36+cdb1/d0/ce+ce39/90/24 cheat description:Longer slides code:d3ae/14/50 cheat description:Faster slides code:d3c0/80/ff cheat description:Move faster code:cd42/4c/ff cheat description:Move mega-fast code:cd47/01/02 cheat description:Collectable items never disappear code:be3f/de/dd cheat description:Enemies always drop extra lives code:bf72/90/a0+bf73/09/05+bf76/f8/06 cheat description:Enemies always drop large health refill code:bf72/90/a0+bf73/09/03+bf76/f8/06 cheat description:Enemies always drop large weapon refill code:bf72/90/a0+bf73/09/01+bf76/f8/06 cheat description:Special items re-appear after being collected code:9caa/d4/00 cheat description:Able to access already defeated boss stages code:931c/d5/00 cheat description:Start with 1 life code:c8fc/02/00 cheat description:Start with 6 lives code:c8fc/02/05 cheat description:Start with 9 lives code:c8fc/02/08 cheat description:Start with 1 life after continue code:991f/02/01 cheat description:Start with 6 lives after continue code:991f/02/05 cheat description:Start with 9 lives after continue code:991f/02/08 cheat description:Invincibility (alt) code:0039/39 cheat description:Infinite health (alt 2) code:00a2/9c cheat description:Infinite lives code:00ae/03 cheat description:Infinite slide time code:0033/ff cheat description:Mega-jump (alt) code:ceb9/09 cheat description:Infinite Gemini Man code:00a3/9c cheat description:Infinite Needle Man code:00a4/9c cheat description:Infinite Hard Man code:00a5/9c cheat description:Infinite Magnet Man code:00a6/9c cheat description:Infinite Top Man (alt) code:00a7/9c cheat description:Infinite Snake Man code:00a8/9c cheat description:Infinite Rush Coil code:00a9/9c cheat description:Infinite Spark Man code:00aa/9c cheat description:Infinite Rush Sub code:00ab/9c cheat description:Infinite Shadow Man code:00ac/9c cheat description:Infinite Rush Jet code:00ad/9c cartridge sha256:ed8bc89c9cd44bf566666451779d7db2da3d9c211ff2a4824372c172b554e05b name:Mega Man 4 (USA) (Rev A) cheat description:Infinite health code:81ed/85/24 cheat description:Infinite health (alt) code:81ed/85/a5 cheat description:Infinite weapons code:fd88/99/b9 cheat description:Infinite weapon power code:fd88/99/2c cheat description:Always have 10 E-Tanks code:98f8/a5/86 cheat description:Infinite lives code:c833/c6/a5 cheat description:Infinite energy pods on pick-up code:96f2/c6/24 cheat description:Instant full Mega Buster code:8095/09/00 cheat description:Instant full Mega Buster (alt) code:8ccd/18/23 cheat description:Hit anywhere code:fa44/b9/18+fa45/28/60 cheat description:Hit anywhere continually code:fa44/b9/18+fa45/28/60+fa42/f0/24 cheat description:Longer slides code:8185/1a/2f cheat description:Shorter slides code:8185/1a/12 cheat description:Faster slides code:8194/02/04 cheat description:Mega-jump code:814f/05/08 cheat description:Multi-jump code:80fb/c8/30+810f/82/81+8133/90/24 cheat description:Move faster code:c679/01/02+83e3/01/02 cheat description:Cosack can't hurt you code:8880/85/a5 cheat description:Collectable items never disappear code:be3f/de/dd cheat description:Enemies always drop extra lives code:bb97/06/00+bb9a/f8/03 cheat description:Enemies always drop large health refill code:bb97/06/00+bb9a/f8/03+bb90/04/02 cheat description:Enemies always drop large weapon refill code:bb97/06/00+bb9a/f8/03+bb90/04/05 cheat description:Special items re-appear after being collected code:9caa/d4/00 cheat description:Start with 1 life code:c53a/02/00 cheat description:Start with 6 lives code:c53a/02/05 cheat description:Start with 79 lives code:c53a/02/08 cheat description:Invincibility code:003c/1f cheat description:Infinite health (alt 2) code:00b0/9c cheat description:Infinite lives (alt) code:00a1/03 cheat description:Infinite Bright Man code:00bc/9c cheat description:Infinite Dive Man code:00b7/9c cheat description:Infinite Drill Man code:00b9/9c cheat description:Infinite Dust Man code:00ba/9c cheat description:Infinite Pharaoh Man code:00bb/9c cheat description:Infinite Ring Man code:00b8/9c cheat description:Infinite Skull Man code:00bd/9c cheat description:Infinite Toad Man code:00b4/9c cheat description:Infinite Rush Coil code:00b1/9c cheat description:Infinite Rush Jet code:00b2/9c cheat description:Infinite Rush Marine code:00b3/9c cheat description:Infinite Balloon code:00b6/9c cheat description:Infinite Wire code:00b5/9c cheat description:Infinite time for 1st Balloon code:046b/fe cheat description:Infinite time for 2nd Balloon code:046a/fe cheat description:Infinite time for 3rd Balloon code:0469/fe cheat description:Instant full Mega Buster (alt 2) code:0559/23 cheat description:Bosses have no invulnerability time code:05cf/00 cartridge sha256:a1fda74d03a9dd0c168b1ecae66803d78723cf7ccd85a482dedf017b97e660e8 name:Mega Man 4 (USA) cheat description:Infinite health code:81ed/85/24 cheat description:Infinite health (alt) code:81ed/85/a5 cheat description:Infinite weapons code:fd88/99/b9 cheat description:Infinite weapon power code:fd88/99/2c cheat description:Always have 10 E-Tanks code:98f8/a5/86 cheat description:Infinite lives code:c833/c6/a5 cheat description:Infinite energy pods on pick-up code:96f2/c6/24 cheat description:Instant full Mega Buster code:8095/09/00 cheat description:Instant full Mega Buster (alt) code:8ccd/18/23 cheat description:Hit anywhere code:fa44/b9/18+fa45/28/60 cheat description:Hit anywhere continually code:fa44/b9/18+fa45/28/60+fa42/f0/24 cheat description:Longer slides code:8185/1a/2f cheat description:Shorter slides code:8185/1a/12 cheat description:Faster slides code:8194/02/04 cheat description:Mega-jump code:814f/05/08 cheat description:Multi-jump code:80fb/c8/30+810f/82/81+8133/90/24 cheat description:Move faster code:c679/01/02+83e3/01/02 cheat description:Collectable items never disappear code:be3f/de/dd cheat description:Enemies always drop extra lives code:bb97/06/00+bb9a/f8/03 cheat description:Enemies always drop large health refill code:bb97/06/00+bb9a/f8/03+bb90/04/02 cheat description:Enemies always drop large weapon refill code:bb97/06/00+bb9a/f8/03+bb90/04/05 cheat description:Special items re-appear after being collected code:9caa/d4/00 cheat description:Start with 1 life code:c53a/02/00 cheat description:Start with 6 lives code:c53a/02/05 cheat description:Start with 9 lives code:c53a/02/08 cheat description:Invincibility code:003c/1f cheat description:Infinite health (alt 2) code:00b0/9c cheat description:Infinite lives (alt) code:00a1/03 cheat description:Infinite Bright Man code:00bc/9c cheat description:Infinite Dive Man code:00b7/9c cheat description:Infinite Drill Man code:00b9/9c cheat description:Infinite Dust Man code:00ba/9c cheat description:Infinite Pharaoh Man code:00bb/9c cheat description:Infinite Ring Man code:00b8/9c cheat description:Infinite Skull Man code:00bd/9c cheat description:Infinite Toad Man code:00b4/9c cheat description:Infinite Rush Coil code:00b1/9c cheat description:Infinite Rush Jet code:00b2/9c cheat description:Infinite Rush Marine code:00b3/9c cheat description:Infinite Balloon code:00b6/9c cheat description:Infinite Wire code:00b5/9c cheat description:Infinite time for 1st Balloon code:046b/fe cheat description:Infinite time for 2nd Balloon code:046a/fe cheat description:Infinite time for 3rd Balloon code:0469/fe cheat description:Instant full Mega Buster (alt 2) code:0559/23 cheat description:Bosses have no invulnerability time code:05cf/00 cartridge sha256:4ddb728c3a007f1aa7184b60a1355cfd376cae46edc007fd48e6bcf41207cdb7 name:Mega Man 5 (USA) cheat description:Infinite health code:82df/85/24 cheat description:Invincible against spikes code:804a/05/85 cheat description:Infinite lives code:85a0/c6/24 cheat description:Infinite weapons code:954f/99/b9+b5fa/99/b9+8254/85/a5 cheat description:Infinite energy for most weapons code:b5f2/e5/e9+9547/e5/e9 cheat description:Infinite mega-tanks on pick-up code:82d9/c6/24 cheat description:Infinite energy tanks on pick-up code:8156/c6/24 cheat description:Hit anywhere code:f017/b9/18+f018/28/60 cheat description:Hit anywhere continually code:f017/b9/18+f018/28/60+f015/f0/24 cheat description:One hit kills code:81b2/2d/00 cheat description:Starting weapons use less energy code:b1e3/04/01 cheat description:Super-jump code:80ae/05/07+80bb/fb/f9 cheat description:Mega-jump code:80ae/05/01+80bb/fb/f7 cheat description:Multi-jump code:8046/15/8d+806a/82/80+8090/90/24 cheat description:Collectable items never disappear code:ae49/de/60 cheat description:Enemies always drop extra lives code:ae86/90/50+ae80/04/03 cheat description:Enemies always drop large health refill code:ae86/90/50+ae80/04/01 cheat description:Enemies always drop large weapon refill code:ae86/90/50 cheat description:Special items re-appear after being collected code:99be/d5/00 cheat description:Start with at least 2 energy tanks code:de4b/80/82 cheat description:Start with at least 6 energy tanks code:de4b/80/86 cheat description:Start with at least 2 mega-tanks code:de51/80/82 cheat description:Start with at least 6 mega-tanks code:de51/80/86 cheat description:Invincibility code:05b8/2d cheat description:Infinite health (alt) code:00b0/9c cheat description:Infinite lives (alt) code:00bf/03 cheat description:Infinite Beat code:00bc/9c cheat description:Infinite Charge Kick code:00b8/9c cheat description:Infinite Crystal Eye code:00b3/9c cheat description:Infinite Gravity Hold code:00b7/9c cheat description:Infinite Gyro Attack code:00b2/9c cheat description:Infinite Napalm Bomb code:00b4/9c cheat description:Infinite Power Stone code:00b6/9c cheat description:Infinite Star Crash code:00b9/9c cheat description:Infinite Super Arrow code:00b5/9c cheat description:Infinite Water Wave code:00b1/9c cheat description:Infinite Rush Coil code:00ba/9c cheat description:Infinite Rush Jet code:00bb/9c cheat description:Bosses have no invulnerability time code:05c0/00 cartridge sha256:2037babe50fed7a13b6f6559914cb81497245c9477592e6f8da183df09a3609a name:Mega Man 6 (USA) cheat description:Invincibility code:8ea4/f0/d0 cheat description:Infinite health code:8f86/8d/ad cheat description:Infinite health (except fires, falling into pits and spikes) code:8f84/e5/24 cheat description:Infinite weapons code:9ea2/99/b9 cheat description:Infinite Rush Jet code:8265/c6/a5 cheat description:Infinite lives (can sometimes die and go to another part of the game) code:8e8a/c6/a5 cheat description:Normal shots do more damage code:8c9c/11/13 cheat description:Mega shots do more damage code:8ccf/13/16 cheat description:Hit anywhere and shoot to pick-up items code:ecef/05/03 cheat description:One hit kills code:ebeb/0a/00+ebea/b1/a9 cheat description:Multi-jump code:810f/0f/40+8111/c8/80+8112/05/d0+8110/ad/29+810e/d0/a5+8113/30/ca+8114/0a/ea cheat description:Collectable items never disappear code:92ae/de/c3 cheat description:Enemies always drop extra lives code:81f5/19/00+821c/49/37+821b/4a/37+8219/39/37+821a/38/37 cheat description:Enemies always drop large health refill code:81f5/19/00+821c/49/39+821d/37/39+821b/4a/39+821a/38/39 cheat description:Enemies always drop large weapon refill code:81f5/19/00+821c/49/4a+821d/37/4a+8219/39/4a+821a/38/4a cheat description:Start with 9 lives code:cd3e/02/08 cheat description:Start with 6 lives code:cd3e/02/05 cheat description:Start with 1 life code:cd3e/02/00 cheat description:Invincibility (alt) code:00a2/36 cheat description:Infinite health (alt) code:03e5/1b cheat description:Infinite lives code:00a9/03 cheat description:Super Moonwalk (enable during stages only) code:05b1/00 cheat description:Infinite Beat code:0689/1b cheat description:Infinite C Flash code:0690/1b cheat description:Infinite Centaur code:0691/1b cheat description:Infinite F Blast code:068c/1b cheat description:Infinite Knight code:068e/1b cheat description:Infinite Plant B code:068d/1b cheat description:Infinite W Storm code:068b/1b cheat description:Infinite Yamato code:068a/1b cheat description:Have the Energy Balancer code:0696/01 cheat description:Bosses have no invulnerability time code:0640/00 cartridge sha256:741fbfeeec83073cc3d8b407c0ddc9f78a0dc5b52d8196c6222bffb459b73ed1 name:Menace Beach (USA) (Unl) cheat description:Infinite health and one hit kills (levels 1-9, 11, 12 only) code:e169/38/e0+e16b/11/f0+e16c/b0/06+e16d/02/ea+e16a/e5/00 cheat description:Infinite health and one hit kills (level 10 only) code:e169/38/e0+e16b/11/f0+e16c/b0/06+e16d/02/ea+e16a/e5/01 cheat description:Multi-jump code:f441/a5/a9+f442/62/82 cartridge sha256:1152961edf8d484f0e33294ae19fbcac8ab85099e6c8a59f1732c5f17b622885 name:Mendel Palace (USA) cheat description:Infinite lives code:da52/de/bd cheat description:More stars on pick-up code:d5a0/01/05 cheat description:P1 gains P2's speed-ups code:d931/bd/ad+d938/fe/ee cheat description:More lives - P1 code:bca2/8d/8c cheat description:More lives - P2 code:bca5/8d/8c cheat description:Start with 1 life code:a163/02/00 cheat description:Start with 5 lives code:a163/02/05 cheat description:Start with 9 lives code:a163/02/08 cheat description:Automatically finish level code:051b/00 cartridge sha256:25f5359a73cac2d16ed98940f0b537f0392f232554d457ed476e21a5979419ff name:Metal Force (K) cheat description:Invincibility code:e7a6/d0/f0+e772/d0/f0+e817/d0/f0 cheat description:Invincible against spikes code:e851/d0/f0 cheat description:Infinite energy code:97f6/00/10+97fb/02/1c cheat description:Infinite lives code:e6e2/8d/ad cheat description:Keep whatever weapon you started the level with code:d2b6/8d/ad cheat description:Start with max weapon power code:8391/00/02 cheat description:Start on Mission 7 code:8396/01/07 cartridge sha256:f6d29afbd7ddad33672852232791a396695de2e77dccb83088a8d6b139d8c9cb name:Metal Gear (USA) cheat description:Infinite health code:eae2/c6/a5+f231/c6/a5 cheat description:Invincible against Gas code:b487/c6/a5 cheat description:Invincible against Electric Floors code:ba5e/c6/a5 cheat description:Infinite Rations code:aea8/c6/a5 cheat description:Infinite Handgun ammo code:ef5e/c6/a5 cheat description:Infinite Mines code:ee8b/84/a4 cheat description:Infinite Explosives code:eea8/86/a6 cheat description:Infinite Missiles code:eeec/86/a6 cheat description:Infinite Machine Gun ammo code:ef4a/c6/a5 cheat description:Infinite Grenades code:ef0a/84/a4 cheat description:Infinite Rockets code:eecf/86/a6 cheat description:Have all weapons code:ac5c/a2/a9+ac5d/00/ff+ac5e/a5/85 cheat description:Enemies never attack or chase you code:dc73/95/b5 cheat description:Hit anywhere - Punch code:e305/eb/00+e311/df/00+e319/d7/00+e2ef/90/50 cheat description:Hit anywhere - Weapons except Grenade Launcher code:f25f/f0/50 cheat description:Start with a health boost code:d768/a6/a2+d769/6e/01+d7ca/05/08 cheat description:Start with a super health boost code:d768/a6/a2+d769/6e/01+d7ca/05/0c cheat description:Start at mystery location 1 code:d753/01/02 cheat description:Start at mystery location 2 code:d753/01/04 cheat description:Infinite health (alt) code:006d/10 cheat description:Have all equipment code:0075/ff+0076/ff+0077/ff+0078/0c cheat description:Have all weapons (alt) code:0070/ff cheat description:Infinite Handgun ammo (alt) code:0079/ff cheat description:Infinite Mines (alt) code:007a/0e cheat description:Infinite Explosives (alt) code:007b/0e cheat description:Infinite Missiles (alt) code:007c/0e cheat description:Infinite Machine Gun ammo (alt) code:007d/ff cheat description:Infinite Grenades (alt) code:007e/3c cheat description:Infinite Rockets (alt) code:007f/1e cheat description:Have Rank - 0 Stars code:006e/00 cheat description:Have Rank - 1 Star code:006e/01 cheat description:Have Rank - 2 Stars code:006e/02 cheat description:Have Rank - 3 Stars code:006e/03 cheat description:Have Rank - 4 Stars code:006e/04 cartridge sha256:a00c77c3130316625403aeea9a0dbb02acf4a176740dac7b9e9a42452e574d4f name:Metal Mech - Man & Machine (USA) cheat description:Invincibility code:8f32/20/ad cheat description:Infinite health code:97f7/8d/ad+9868/8d/ad cheat description:Infinite lives - Tony code:f600/ce/ad cheat description:Infinite Smart Bombs code:f565/ce/ad cheat description:Super-jumping Tony code:a0fe/ff/fe cheat description:Super-speeding Tony code:a08c/05/02 cheat description:Mega-speeding Tony code:a08c/05/01 cheat description:Start with 1 life and 1 Smart Bomb code:d3cd/03/01 cheat description:Start with 6 lives and 6 Smart Bombs code:d3cd/03/06 cheat description:Start with 9 lives and 9 Smart Bombs code:d3cd/03/09 cheat description:Start on level 2 code:d3d8/ff/00 cheat description:Start on level 3 code:d3d8/ff/01 cheat description:Start on level 4 code:d3d8/ff/02 cheat description:Start on level 5 code:d3d8/ff/03 cheat description:Start on level 6 code:d3d8/ff/04 cheat description:Infinite health (alt) code:05dd/1f cartridge sha256:2fbbc465fc239b483cb89582f75451b21276d97868d67f3d8d89c2269fec5e37 name:Metal Storm (USA) cheat description:Invincibility code:e674/85/a5+b71d/85/a5 cheat description:Infinite time code:f5c8/c6/a5 cheat description:Infinite lives code:975f/01/00 cheat description:Slower timer code:f5c1/3c/60 cheat description:Faster timer code:f5c1/3c/20 cheat description:Permanent Fireball code:ead4/0c/00 cheat description:Permanent Shield code:afda/7c/00 cheat description:Start with extra weapons code:bbf1/00/ff cheat description:Start with 6 lives code:bbaf/02/06 cheat description:Start with 9 lives code:bbaf/02/09 cartridge sha256:649db8035018f2512ccea70aca6606c3b3a6988cd9ed43953b38dc5103dec7bb name:Metroid (USA) cheat description:Invincibility code:fc44/9c/10+9e03/ad/60+fec2/20/60+f295/bd/60+f2b6/20/60+f2ef/20/60+fc43/20/90+e27b/84/90+9987/c9/a9+e27c/72/29 cheat description:Infinite health and Missiles, have all items code:c934/30 cheat description:Infinite health code:cea2/03/00 cheat description:Minimum energy of 30 code:ced7/8d/ad cheat description:Always have Screw Attack effect code:cd9c/38/18+cda0/88/60 cheat description:Infinite Missiles on pick-up code:d333/ce/ad cheat description:Hit anywhere code:f343/03/00+f2ca/b0/24+f53f/20/ff+f2d2/20/ad cheat description:Enemies die automatically code:f541/29/00 cheat description:Beam has longer range code:d505/55 cheat description:Get items from anywhere code:dbaf/46/00+f488/f0/24 cheat description:Gain 10 Missiles on pick-up code:dbfa/05/0a cheat description:Gain 15 Missiles on pick-up code:dbfa/05/0f cheat description:Gain 255 Missiles on pick-up code:dbfa/05/ff cheat description:High-jump without High Jump Boots code:cff4/18/12 cheat description:Mega-jump without High Jump Boots code:cff4/18/0c cheat description:Mega-jump with High Jump Boots code:cffd/12/0c cheat description:Multi-jump code:d030/f0/24+cd10/f0/24 cheat description:Break any block code:d61e/25 cheat description:No enemies code:eb61/88 cheat description:Fall through the floor code:e4a3/30 cheat description:Roll through walls, but loses energy (glitchy) code:8588/d5 cheat description:Start with 70 energy code:c926/03/07 cheat description:Infinite health and Missiles, have all items (alt) code:69b2/01 cheat description:Have all items code:6878/ff cheat description:Have Bombs code:6878/3f cheat description:Have Ice Beam code:6878/80 cheat description:Have Maru Mari (Morphing Ball) code:6878/10 cheat description:Have Long Beam code:6878/14 cheat description:Have Wave Beam code:6878/40 cartridge sha256:77c9100f4d3f291dd751098d3291b14e824cc367696c9167d01051041e08b5cb name:Michael Andretti's World GP (USA) cheat description:Infinite time code:0565/01 cartridge sha256:2d40d51736c2fa22f0cccf686e92efee3a7ebb8fa4eee5032206bab099a5aaf6 name:Mickey Mania 7 (Unl) cheat description:Infinite health code:9186/ce/ad cheat description:Infinite lives code:9507/ce/ad cheat description:Infinite Apples code:9641/ce/ad cartridge sha256:826ace604eb7a657acedd98cd3479dbe1d3ebb087dd7a1b2ad299ab854c0d519 name:Mickey Mouse 3 - Yume Fuusen (Japan) cheat description:Invincibility code:af79/d0/f0 cheat description:Infinite health (life) code:8849/8d/ad cheat description:Infinite lives code:8874/8d/ad cartridge sha256:989243c99d6e58c4fbcc6999473e48a389eba22cf1d3cb95dbe4c8b1f3ce15d7 name:Mickey Mousecapade (USA) cheat description:Invincibility code:9a84/f0/d0+9ae7/f0/d0 cheat description:Infinite health code:9691/e5/e9 cheat description:Infinite lives code:9259/c6/a5 cheat description:Mickey and Minnie can shoot on any level code:de50/0c/1c+de6e/02/03 cheat description:Start with 2 lives code:91dd/04/01 cheat description:Start with 6 lives code:91dd/04/05 cheat description:Start with 9 lives code:91dd/04/08 cartridge sha256:1df64e9554fb9997ceeab9954b2b7f8aa6206509a15e09298014ba765d87c094 name:Micro Machines (USA) (Unl) cheat description:Infinite lives code:a6d2/ce/2c cheat description:Qualify every race code:fac5/02/04 cheat description:Play with 9 lives code:f7c8/03/09 cheat description:Ruff Trux after every race code:fab2/03/01 cheat description:Kid out of game after every race code:f857/03/01 cheat description:Win Championship race code:fad1/01/04 cheat description:Faster Boat acceleration code:801d/05/00 cheat description:Faster Sports Car acceleration code:801c/05/00 cheat description:Faster Formula 1 acceleration code:801e/05/00 cheat description:Faster Turbo Wheels(tm) acceleration code:801f/05/00 cheat description:Faster 4x4 acceleration code:8020/05/00 cheat description:Faster Tank acceleration code:8022/02/00 cheat description:Faster Chopper acceleration code:8023/05/00 cheat description:Quicker Boat deceleration code:8026/09/00 cheat description:Quicker Sports Car deceleration code:8025/09/00 cheat description:Quicker Formula 1 deceleration code:8027/09/00 cheat description:Quicker Turbo Wheels deceleration code:8028/09/00 cheat description:Quicker 4x4 deceleration code:8029/09/00 cheat description:Quicker Tank deceleration code:802b/02/00 cheat description:Quicker Chopper deceleration code:802c/0f/00 cheat description:Higher bounce for Boats code:8002/01/07 cheat description:Higher bounce for Sports cars code:8001/01/05 cheat description:Higher bounce for Formula 1's code:8003/01/07 cheat description:Higher bounce for Turbo Wheels code:8004/01/07 cheat description:Higher bounce for 4x4's code:8005/01/07 cheat description:Higher bounce for Tanks code:8007/01/07 cheat description:Drive through vehicles code:8dbd/19 cheat description:Start on race 5 code:f7cd/00/04 cheat description:Start on race 10 code:f7cd/00/09 cheat description:Start on race 15 code:f7cd/00/0e cheat description:Start on race 20 code:f7cd/00/13 cheat description:Start on race 25 (Final Race) code:f7cd/00/18 cartridge sha256:31b8afd6e571d3ce8ddea49b813ceda2d350df3c84ceb5d8dd2c7a3a6de5ba88 name:Micro Machines (USA) (Aladdin Compact Cartridge) (Unl) cheat description:Infinite lives code:a67c/ce/2c cheat description:Qualify every race code:fa25/02/04 cheat description:Play with 9 lives code:f728/03/09 cheat description:Ruff Trux after every race code:fa12/03/01 cheat description:Kid out of game after every race code:f7b7/03/01 cheat description:Win Championship race code:fa31/01/04 cheat description:Faster Boat acceleration code:801d/05/00 cheat description:Faster Sports Car acceleration code:801c/05/00 cheat description:Faster Formula 1 acceleration code:801e/05/00 cheat description:Faster Turbo Wheels(tm) acceleration code:801f/05/00 cheat description:Faster 4x4 acceleration code:8020/05/00 cheat description:Faster Tank acceleration code:8022/02/00 cheat description:Faster Chopper acceleration code:8023/05/00 cheat description:Quicker Boat deceleration code:8026/09/00 cheat description:Quicker Sports Car deceleration code:8025/09/00 cheat description:Quicker Formula 1 deceleration code:8027/09/00 cheat description:Quicker Turbo Wheels deceleration code:8028/09/00 cheat description:Quicker 4x4 deceleration code:8029/09/00 cheat description:Quicker Tank deceleration code:802b/02/00 cheat description:Quicker Chopper deceleration code:802c/0f/00 cheat description:Higher bounce for Boats code:8002/01/07 cheat description:Higher bounce for Sports cars code:8001/01/05 cheat description:Higher bounce for Formula 1's code:8003/01/07 cheat description:Higher bounce for Turbo Wheels code:8004/01/07 cheat description:Higher bounce for 4x4's code:8005/01/07 cheat description:Higher bounce for Tanks code:8007/01/07 cheat description:Drive through vehicles code:8dbd/19 cheat description:Start on race 5 code:f72d/00/04 cheat description:Start on race 10 code:f72d/00/09 cheat description:Start on race 15 code:f72d/00/0e cheat description:Start on race 20 code:f72d/00/13 cheat description:Start on race 25 (Final Race) code:f72d/00/18 cartridge sha256:a2b4b0fd54028f1bbbdef152d8f2a172270b60162802d298accd0c698d258c3d name:Mighty Bomb Jack (USA) cheat description:Invincibility code:979f/29/a9 cheat description:Invincibility (alt) code:97b1/8d/ad+9b0a/8d/ad cheat description:Infinite lives code:873a/ce/ae cheat description:Infinite time code:87a3/ce/ad cheat description:Less time in game code:879c/60/40 cheat description:More time in game code:879c/60/80 cheat description:Enemies don't return from coin transformation code:889d/ce/ad cheat description:Power coins are not used up code:8b0a/ce/ad cheat description:Disable torture room code:9ed7/03/81 cheat description:Jump through walls code:98bb/01/02 cheat description:Start with 1 life code:821a/03/01 cheat description:Start with 6 lives code:821a/03/06 cheat description:Start with 9 lives code:821a/03/09 cheat description:Infinite lives (alt) code:0295/09 cheat description:Infinite time (one's digit) code:0229/09 cheat description:Infinite time (ten's digit) code:022d/09 cheat description:Infinite M's code:0235/09 cartridge sha256:02d86ba60b7f43f9d04131522263e7560d9ad1d4cc474b909d487cc0d470ccc3 name:Mighty Bomb Jack (Japan) cheat description:Invincibility code:9875/29/09 cheat description:Invincibility (alt) code:9887/8d/ad+9be5/8d/ad cartridge sha256:ef8ccb38760604f5122e034ae0c4591362364632fe2dc2fa10f2660e15bd368f name:Mighty Final Fight (USA) cheat description:Invincibility code:cf2f/00/80 cheat description:Infinite lives code:dd4f/c6/a5 cheat description:Infinite credits code:941b/c6/a5 cheat description:Protection from most hazards code:f92b/85/a5 cheat description:Cody is weaker code:8638/b9/ad cheat description:Cody is stronger code:85df/a4/a0+85e0/6b/05 cheat description:Cody is stronger and has a super-powerful normal punch code:85df/a4/a0+85e0/6b/05+8885/0b/40 cheat description:Cody is much stronger code:8638/b9/a9+8639/d6/40+863a/87/ea cheat description:Guy is weaker code:8656/b9/ad cheat description:Guy is stronger code:8607/a4/a0+8608/6b/05 cheat description:Guy is stronger and has a super-powerful normal punch code:8607/a4/a0+8608/6b/05+8934/02/40 cheat description:Guy is much stronger code:8656/b9/a9+8657/a8/40+8658/88/ea cheat description:Haggar is weaker code:8674/b9/ad cheat description:Haggar is stronger code:8627/a4/a0+8628/6b/03 cheat description:Haggar is stronger and has a super-powerful normal punch code:8627/a4/a0+8628/6b/03+89cb/0d/40 cheat description:Haggar is much stronger code:8674/b9/a9+8675/57/40+8676/89/ea cheat description:Gain EXP faster (10 pts at a time) (may be displayed incorrectly) code:8ac2/a5/a9+8ac3/05/10 cheat description:Gain EXP much faster (20 pts at a time) (may be displayed incorrectly) code:8ac2/a5/a9+8ac3/05/20 cheat description:Cody starts with 3/4 health (1st life only) code:c841/40/30 cheat description:Cody starts with 1/2 health (1st life only) code:c841/40/20 cheat description:Cody starts with 1/4 health (1st life only) code:c841/40/10 cheat description:Cody starts with 3/4 health (after 1st life) code:de4c/40/30 cheat description:Cody starts with 1/2 health (after 1st life) code:de4c/40/20 cheat description:Cody starts with 1/4 health (after 1st life) code:de4c/40/10 cheat description:Guy starts with 3/4 health (1st life only) code:c842/30/24 cheat description:Guy starts with 1/2 health (1st life only) code:c842/30/18 cheat description:Guy starts with 1/4 health (1st life only) code:c842/30/0c cheat description:Guy starts with 3/4 health (after 1st life) code:de52/30/24 cheat description:Guy starts with 1/2 health (after 1st life) code:de52/30/18 cheat description:Guy starts with 1/4 health (after 1st life) code:de52/30/0c cheat description:Haggar starts with 3/4 health (1st life only) code:c843/50/3c cheat description:Haggar starts with 1/2 health (1st life only) code:c843/50/28 cheat description:Haggar starts with 1/4 health (1st life only) code:c843/50/14 cheat description:Haggar starts with 3/4 health (after 1st life) code:de58/50/3c cheat description:Haggar starts with 1/2 health (after 1st life) code:de58/50/28 cheat description:Haggar starts with 1/4 health (after 1st life) code:de58/50/14 cheat description:Start with 2 lives (doesn't work on continues) code:c7ee/05/01 cheat description:Start with 4 lives (doesn't work on continues) code:c7ee/05/03 cheat description:Start with 8 lives (doesn't work on continues) code:c7ee/05/07 cheat description:Start with 10 lives (doesn't work on continues) code:c7ee/05/09 cheat description:Start with 1 credit code:c7f2/03/01 cheat description:Start with 5 credits code:c7f2/03/05 cheat description:Start with 7 credits code:c7f2/03/07 cheat description:Start with 9 credits code:c7f2/03/09 cheat description:Invincibility (alt) code:003b/25 cheat description:Infinite health code:003a/30 cheat description:Infinite lives (alt) code:003e/09 cheat description:Max level code:006b/05 cartridge sha256:5327792d8b5392cd5cec95ee254fc9f729777283c80f3d1f94d5147f3be73652 name:MiG 29 - Soviet Fighter (USA) (Unl) cheat description:Keep weapon after death code:db59/c6/a5 cheat description:Start with best weapon code:c179/00/03 cheat description:More time to refuel code:908a/00/ff cheat description:Less time to refuel code:908a/00/03 cheat description:Start with 1 life code:c174/03/00 cheat description:Start with 6 lives code:c174/03/05 cheat description:Start with 9 lives code:c174/03/08 cheat description:Start with 255 lives code:c174/03/fe cheat description:Start on mission 2 code:911f/a5/a9+9120/15/01+9122/51/da cheat description:Start on mission 3 code:911f/a5/a9+9120/15/02+9122/51/da cheat description:Start on mission 4 code:911f/a5/a9+9120/15/03+9122/51/da cheat description:Start on mission 5 code:911f/a5/a9+9120/15/04+9122/51/da cheat description:Start on mission 6 code:911f/a5/a9+9120/15/05+9122/51/da cartridge sha256:2ebab487204c42b0d9cf19c37bdc395e396226ca3eaa664907bf7f8216b3c4d3 name:Mike Tyson's Punch-Out!! (Japan, USA) (Rev A) cheat description:Invincibility code:8080/e5/00+82b5/f5/75 cheat description:Infinite health code:8503/a2/60 cheat description:Infinite hearts code:892b/00/09 cheat description:Infinite hearts (alt) code:844e/e5/24 cheat description:Infinite stars code:8168/1e/00 cheat description:Infinite stars once obtained code:897e/f0/30 cheat description:Infinite time code:87ab/8e/a2+87de/9d/bd cheat description:Infinite time (alt) code:87de/9d/bd cheat description:Opponent cannot block punches code:82b5/f5/75 cheat description:No health for opponent code:881a/8d/60+84c7/8d/ad cheat description:No health replenishment for opponent code:815b/20/ad cheat description:Take less damage code:8160/6d/ad cheat description:Take even less damage code:8163/20/ad cheat description:Normal punches do more damage code:836e/04/00 cheat description:Instant win code:9d3d/2f cheat description:Instant loss code:9d3d/ab cheat description:First knockdown will be a TKO code:9ddf/28 cheat description:Skip intro code:a290/01/f8 cheat description:Start with and have infinite stars code:8167/f0/30 cheat description:Start each round with 3 stars code:8950/00/03 cheat description:Infinite health (alt) code:0391/60 cheat description:Infinite hearts (alt 2) code:0324/0a cheat description:Infinite time code:0305/00+0306/00+0307/00 cheat description:No health for opponent (alt) code:0398/00 cheat description:First knockdown will be a TKO code:03ca/02+03d1/02 cheat description:Start with and infinite stars code:0342/03 cheat description:Start on match 02 - Von Keiser code:0001/01 cheat description:Start on match 03 - Piston Honda code:0001/02 cheat description:Start on match 04 - Don Flamenco code:0001/03 cheat description:Start on match 05 - King Hippo code:0001/04 cheat description:Start on match 06 - Great Tiger code:0001/05 cheat description:Start on match 07 - Bald Bull code:0001/06 cheat description:Start on match 08 - Piston Honda (2nd match) code:0001/07 cheat description:Start on match 09 - Soda Popinski code:0001/08 cheat description:Start on match 10 - Bald Bull (2nd match) code:0001/09 cheat description:Start on match 11 - Don Flamenco (2nd match) code:0001/0a cheat description:Start on match 12 - Mr. Sandman code:0001/0b cheat description:Start on match 13 - Super Macho Man code:0001/0c cheat description:Start on match 14 - Mike Tyson code:0001/0d cartridge sha256:752f9d07450e6ec075b109f5be1b1933e8385ad687ceaf24f70a590767bb5a27 name:Mike Tyson's Punch-Out!! (Japan, USA) cheat description:Invincibility code:8080/e5/00+82b5/f5/75 cheat description:Infinite health code:8503/a2/60 cheat description:Infinite hearts code:892b/00/09 cheat description:Infinite hearts (alt) code:844e/e5/24 cheat description:Infinite stars code:8168/1e/00 cheat description:Infinite stars once obtained code:897e/f0/30 cheat description:Infinite time code:87ab/8e/a2+87de/9d/bd cheat description:Infinite time (alt) code:87de/9d/bd cheat description:Opponent cannot block punches code:82b5/f5/75 cheat description:No health for opponent code:881a/8d/60+84c7/8d/ad cheat description:No health replenishment for opponent code:815b/20/ad cheat description:Take less damage code:8160/6d/ad cheat description:Take even less damage code:8163/20/ad cheat description:Normal punches do more damage code:836e/04/00 cheat description:Skip intro code:a290/01/f8 cheat description:Start with and have infinite stars code:8167/f0/30 cheat description:Start each round with 3 stars code:8950/00/03 cheat description:Infinite health (alt) code:0391/60 cheat description:Infinite hearts (alt 2) code:0324/0a cheat description:Infinite time code:0305/00+0306/00+0307/00 cheat description:No health for opponent (alt) code:0398/00 cheat description:First knockdown will be a TKO code:03ca/02+03d1/02 cheat description:Start with and infinite stars code:0342/03 cheat description:Start on match 02 - Von Keiser code:0001/01 cheat description:Start on match 03 - Piston Honda code:0001/02 cheat description:Start on match 04 - Don Flamenco code:0001/03 cheat description:Start on match 05 - King Hippo code:0001/04 cheat description:Start on match 06 - Great Tiger code:0001/05 cheat description:Start on match 07 - Bald Bull code:0001/06 cheat description:Start on match 08 - Piston Honda (2nd match) code:0001/07 cheat description:Start on match 09 - Soda Popinski code:0001/08 cheat description:Start on match 10 - Bald Bull (2nd match) code:0001/09 cheat description:Start on match 11 - Don Flamenco (2nd match) code:0001/0a cheat description:Start on match 12 - Mr. Sandman code:0001/0b cheat description:Start on match 13 - Super Macho Man code:0001/0c cheat description:Start on match 14 - Mike Tyson code:0001/0d cartridge sha256:bd84b27f752aa568374e1c8a6df948340a1374478b754f2ddc32e37d75b4a2b9 name:Millipede (USA) cheat description:Infinite lives - both players code:cec0/d6/b5 cheat description:Increase territory to half screen code:d58d/a0/50 cheat description:Increase territory to full screen code:d58d/a0/20 cheat description:Shrink territory code:d58d/a0/c7 cheat description:Player's bullets move faster code:dfba/06/0a cheat description:Player's bullets move slower code:dfba/06/03 cheat description:Start with 1 life - P1 code:c96d/04/01 cheat description:Start with 10 lives - P1 code:c96d/04/0a cheat description:Invincibility code:0071/00 cartridge sha256:6eea421f6c0738ff3abfd6e059e91c3409eedd2150093d3e01d49dfaad4dbf80 name:Milon's Secret Castle (USA) cheat description:Infinite health code:d27b/85/a5 cheat description:More health on pick-up code:cac7/08/18 cheat description:No health on pick-up code:cac7/08/00 cheat description:Max power bubbles code:a782/d0/50 cheat description:Hit anywhere code:d1b4/c9/d0+d1b5/08/24 cheat description:Floating Milon code:9af6/03/50 cheat description:Start with more health code:8a58/20/40 cheat description:Start with a bigger health bar code:8a51/38/50 cheat description:Infinite health (alt) code:00b2/3f cheat description:Doors always unlocked code:07bf/ff cheat description:Set money to $900 code:00a1/09 cheat description:Have all Crystals code:07b7/fa cheat description:Have Blimp Ship code:07a6/fa cheat description:Have Feather code:07a4/fa cheat description:Have Hammer code:07a0/fa cheat description:Have Ice Bottle code:07a8/fa cheat description:Have Jump Shoes code:079a/fa cheat description:Have Lantern code:079f/fa cheat description:Have Medicine code:079d/fa cheat description:Have Roller Shoes code:079b/fa cheat description:Have Saw code:079c/fa cheat description:Have Sword code:07a7/fa cheat description:Have Tube code:07a5/fa cheat description:Have Vest code:07a3/fa cartridge sha256:61e4e0a38f23eec3e931f21ad89cc901ca9f709dccfec952ed0e478172f04441 name:Mission Cobra (USA) (Unl) cheat description:Infinite health code:f17a/64/00+dd0e/64/00+db21/64/00 cheat description:Infinite health (alt) code:009a/63 cartridge sha256:6b04b87ab30e885974844ad693cc39ba8c87e7e650e1f9cf22a054e0a385df4e name:Mission Impossible (USA) cheat description:Infinite Type B weapons for all code:9235/01/00 cheat description:Take less damage code:86be/b9/ad cheat description:Take more damage code:86fe/01/02 cheat description:2 Type B weapons for Nicholas code:bcb2/05/02 cheat description:9 Type B weapons for Nicholas code:bcb2/05/09 cheat description:5 Type B weapons for Max and Grant code:bcaa/0a/05 cheat description:15 Type B weapons for Max and Grant code:bcaa/0a/0f cheat description:Longer disguise time code:8996/ad/ce+9309/01/04 cheat description:Start with less health code:bc9f/0c/06 cheat description:Start with more health code:bc9f/0c/10 cheat description:Infinite health code:03ec/0d+03ed/0d+03ee/0d cheat description:Infinite weapons code:03f5/0a+03f6/0a+03f7/09 cartridge sha256:0bd6257a4566c57c582421bfbf8e81a5491a94e13f4e7a9378c3332c70884532 name:Mitsume ga Tooru (Japan) cheat description:Hit anywhere code:bab2/03/00 cheat description:One hit kills code:bad3/01/ff+bad2/e9/a9 cheat description:Collect money from anywhere code:8423/b0/50+8d69/b0/30 cheat description:Increase projectile limit to 13 code:d68e/03/0d cheat description:Start a new game for hidden debug TEST MODE menu code:8341/04/03 cheat description:Start a new game to view the ending code:8341/04/07 cartridge sha256:f997fe34edf1d998694aa979c81fe0063480274b4284498f230fffe694fe87ac name:Monopoly (USA) cheat description:Collect $300 as you pass Go code:db59/31/3f cheat description:Collect $100 as you pass Go code:db59/31/1d cheat description:Pay $0 to get out of jail code:a864/17/00 cheat description:Pay $100 to get out of jail code:a864/17/1d cheat description:Pay $30 for luxury tax code:8c96/1a/13 cheat description:Pay $100 for luxury tax code:8c96/1a/1d cheat description:Pay $200 for luxury tax code:8c96/1a/31 cheat description:Pay $0 for income tax code:8cd6/31/00 cheat description:Pay $30 for income tax code:8cd6/31/13 cheat description:Pay $100 for income tax code:8cd6/31/1d cheat description:Pay $300 for income tax code:8cd6/31/3f cheat description:$300 to buy Boardwalk code:d41b/4b/3f cheat description:$600 to buy Boardwalk code:d41b/4b/53 cheat description:$200 to buy Park Place code:d412/45/31 cheat description:$400 to buy Park Place code:d412/45/4b cheat description:$600 to buy Park Place code:d412/45/53 cheat description:Houses on Park Place cost $100 code:d41a/31/1d cheat description:Houses on Park Place cost $300 code:d41a/31/3f cheat description:Houses on Boardwalk cost $100 code:d423/31/1d cheat description:Houses on Boardwalk cost $300 code:d423/31/3f cheat description:Go Back 7 spaces instead of 3 on Chance code:8315/03/07 cartridge sha256:08615e9e339bd2df713cdb15f6426895ba643fbd8f383758f7f5c06ebf7ac10b name:Monster in My Pocket (USA) cheat description:Invincibility after first hit code:85c9/de/bd+86e1/90/91 cheat description:Infinite energy code:86dd/de/bd cheat description:Infinite lives code:8550/de/bd cartridge sha256:219c94a1f0801ee255f4c8df6d7d1120bdcfd882fcaecba2c858b1e4c66d060b name:Monster Party (USA) cheat description:Invincibility code:879a/a5/60 cheat description:Infinite life against normal enemies code:87a7/c6/a5 cheat description:Infinite life against Guardians code:87a5/c6/e6 cheat description:One hit kills normal enemies code:850d/b0/f0 cheat description:One hit kills Guardians code:8d3b/02/00 cheat description:Walk twice as fast code:82ce/ff/fe+82b8/01/02 cheat description:Jump twice as far code:84f2/ff/fe+84df/01/02 cheat description:Start with double life code:9532/0c/18+94c6/0c/18 cheat description:Start with full life code:9532/0c/2c+94c6/0c/2c cheat description:Start on level 2 code:954a/00/01 cheat description:Start on level 3 code:954a/00/02 cheat description:Start on level 4 code:954a/00/03 cheat description:Start on level 5 code:954a/00/04 cheat description:Start on level 6 code:954a/00/05 cheat description:Start on level 7 code:954a/00/06 cheat description:Start on level 8 code:954a/00/07 cartridge sha256:ce493dcb4ba133d9a31e234a4c446a365bcf98c5f99c13968f1e1c777747ac29 name:Moon Crystal (Japan) cheat description:Multi-jump code:96dc/06/60+96d6/1c/04+96dd/98/97+977b/8d/ad cartridge sha256:66cb74efa264a285a541277b935d4b6cc9c49a18653bce90b65f0de98b05aec0 name:Moon Ranger (USA) (Unl) cheat description:Infinite lives code:d6bc/ce/ad cartridge sha256:aa0fe1b0b1e0c3a0a01695f1914fbb5e92649db33b74a9bdcb51be1481221f49 name:Mother (Japan) cheat description:Start a new game with $1024 code:be11/00/04 cheat description:Start a new game with $16,384 code:be11/00/40 cartridge sha256:ed219a1b03be92e3ac4a2229e3e7663fd126eca6332f0564e5d3a12ec56f2142 name:MotorCity Patrol (USA) cheat description:Don't take damage code:a68c/01/00 cheat description:Slow down timer code:819d/3c/70 cheat description:Speed up timer code:819d/3c/1f cheat description:Free equipment code:8cbd/ce/2c+8c33/d0/10 cheat description:Start with 5 merits code:a31d/00/05 cartridge sha256:3264e4c57ffaf64df816cc97b1d6d278042545a4be248f5c195d82037f0a9bfd name:Mr. Gimmick (Europe) cheat description:Invincibility code:8410/f0/d0+8412/ce/ee cheat description:Infinite health code:8c98/ce/cd cheat description:Infinite lives code:e5e6/ce/cd cheat description:Start with 3 Bombs code:e0e5/00/03 cheat description:Start with 3 Fireballs code:e0e5/00/02 cheat description:Start with 3 Potions code:e0e5/00/01 cheat description:Invincibility (alt) code:038c/02 cheat description:Infinite health (alt) code:0346/04 cheat description:Infinite lives (alt) code:0104/09 cartridge sha256:f7cc35a736ffd7804056b92ab92bfef02ded95d999ac126b680e87b573f18182 name:Ms. Pac-Man (USA) cheat description:Infinite lives - P1 code:003f/06 cheat description:Infinite lives - P2 code:004f/06 cheat description:Power pill effect always active code:00cf/0f cheat description:Start on stage 02 code:003e/02 cheat description:Start on stage 03 code:003e/03 cheat description:Start on stage 04 code:003e/04 cheat description:Start on stage 05 code:003e/05 cheat description:Start on stage 06 code:003e/06 cheat description:Start on stage 07 code:003e/07 cheat description:Start on stage 08 code:003e/08 cheat description:Start on stage 09 code:003e/09 cheat description:Start on stage 10 code:003e/0a cartridge sha256:3ec56ffa686a0e45dc5dfa02d3216b6c9302177b01a0bba506739a436c4ba730 name:Ms. Pac-Man (USA) (Unl) cheat description:Infinite lives for both players in alternating type games code:82fe/c6/a5 cheat description:Infinite lives for P2 only, in other type games code:8303/ce/ad cheat description:Super fast turbo speed code:f79d/4a/ea cheat description:Pinky out of game code:863a/02/00 cheat description:Sue out of game code:865a/02/00 cheat description:Start with 1 life - both players code:86b7/02/00 cheat description:Start with 6 lives - both players code:86b7/02/05 cheat description:Start with 9 lives - both players code:86b7/02/08 cheat description:Start with 1 life for P2 in 2P cooperative and competitive games code:86ba/8d/8c cheat description:Only pink ghost escapes from center code:002a/1b+023d/0e+002c/0b cheat description:Max score - P1 code:00d0/09+00d1/99+00d2/99 cheat description:Infinite lives code:00d4/09 cheat description:Ghosts stay blue until eaten code:00c5/01 cheat description:Start on level 2 code:0127/01 cheat description:Start on level 3 code:0127/02 cheat description:Start on level 4 code:0127/03 cheat description:Start on level 5 code:0127/04 cheat description:Start on level 6 code:0127/05 cartridge sha256:80f6f2b9cb2669e876328cf47ad94fd5288adeddaf45dee93087142ff589b6d6 name:Muppet Adventure - Chaos at the Carnival (USA) cheat description:Infinite power code:8a47/c6/a5 cartridge sha256:ac2374bd4a5f7c87a7bd51e296f79800f84ea6c91a35e0c79dd9a3b2f923ef37 name:Mutant Virus, The - Crisis in a Computer World (USA) cheat description:Invincibility code:cc8a/c6/a5 cheat description:Infinite health code:cb47/8d/ad cheat description:Infinite time code:d486/8e/ae cheat description:Infinite lives code:d486/8e/ea cheat description:Don't flash after getting hit code:d48a/ff/00 cheat description:Flash 1/2 as long after getting hit code:d48a/ff/63 cheat description:Start with 1 life code:c096/05/00 cheat description:Start with 3 lives code:c096/05/02 cheat description:Start with 7 lives code:c096/05/85 cheat description:Start with 10 lives code:c096/05/09 cheat description:Infinite health (alt) code:0119/0c cheat description:Infinite lives (alt) code:0110/06 cartridge sha256:61cb18d11771cffa08f79fd6973f634c8351703a2fe0f79858171d72a5a46582 name:Mystery Quest (USA) cheat description:Invincibility code:90f7/c6/24 cheat description:Infinite vitality code:90f7/c6/a5 cheat description:Immune to monster attacks code:90ac/f8/00 cheat description:Immune to shallow water code:90b8/ff/00 cheat description:Never lose Key code:9fe9/85/24 cheat description:Never lose Raft code:96f9/00/01 cheat description:Start with more vitality code:8f5b/40/60 cheat description:Start with less vitality code:8f5b/40/20 cheat description:Start with Raft and Key code:99bc/00/01 cartridge sha256:dc71dadc3f4eae03f26ac4afec8ef044e7874ad8fdee1567a9b9b9e2c112669e name:NARC (USA) cheat description:Invincibility (blinking) - both players code:a1f9/0e/00 cheat description:Infinite health - both players code:e3ac/f6/ea cheat description:Infinite Bullets code:d91b/01/00 cheat description:Infinite Missiles code:d483/01/00 cheat description:Infinite lives code:e3ce/d6/b5 cheat description:Enemies die automatically code:dfbf/f0/50+dfc0/f3/51 cheat description:Hit anywhere - P1 code:e150/03/00+dfc1/a4/50+dfc2/56/4f cheat description:More missiles code:80e4/35/39 cheat description:1 Missile on pick-up code:a2b1/05/01 cheat description:9 Missiles on pick-up code:a2b1/05/09 cheat description:45 Bullets on pick-up code:9356/02/04 cheat description:Start with 1 life code:8132/02/00 cheat description:Start with 6 lives code:8132/02/05 cheat description:Start with 9 lives code:8132/02/08 cartridge sha256:55efed163edb02abc2a344aba79edc5ad873a77ed92378ad0c3e62f1e1816d3e name:NES Open Tournament Golf (USA) cheat description:Always on first shot code:86b4/9d/01 cheat description:No wind code:da47/85/a5 cartridge sha256:4b382baa70cbc52977fd766f49a3c7c9a3239f0d9581cd961b8b26700c53247d name:NES Play Action Football (USA) cheat description:30-minute quarters code:f4c3/0f/1e cheat description:10-minute quarters code:f4c3/0f/0a cheat description:No timeouts - P2 code:bfc3/8d/8c cheat description:6 timeouts per half (ignore display) code:bfbf/03/06 cheat description:1 timeout per half code:bfbf/03/01 cartridge sha256:c03ffd0d5fb5439eb35f22f09df3cbd8f81f5cf3eb9b6718a4d7afb67c75c543 name:Nigel Mansell's World Championship Challenge (USA) cheat description:Almost no tire wear code:e053/ce/ad+f87a/ce/ad cheat description:Only need 1 lap on all tracks code:ca7a/07/02+c8fd/bd/ad cheat description:Accelerate faster code:f1dd/7d/6d cheat description:Accelerate a lot faster code:f1dd/7d/6d+f348/04/08 cheat description:No extra time in the pits code:b15b/ee/2c cheat description:Less tire wear code:e053/ce/ad cheat description:Only need 3 laps in South Africa instead of 6 code:ca7a/07/04 cheat description:Only need 3 laps in Mexico instead of 6 code:ca7b/07/04 cheat description:Only need 3 laps in Brazil instead of 5 code:ca7c/06/04 cheat description:Only need 3 laps in Spain instead of 4 code:ca7d/05/04 cheat description:Only need 3 laps in San Marino instead of 6 code:ca7e/07/04 cheat description:Only need 3 laps in Monaco instead of 5 code:ca7f/06/04 cheat description:Only need 3 laps in Canada instead of 6 code:ca80/07/04 cheat description:Only need 3 laps in France instead of 4 code:ca81/05/04 cheat description:Only need 3 laps in Great Britian instead of 5 code:ca82/06/04 cheat description:Only need 3 laps in Germany instead of 5 code:ca83/06/04 cheat description:Only need 3 laps in Hungary instead of 5 code:ca84/06/04 cheat description:Only need 3 laps in Belgium instead of 5 code:ca85/06/04 cheat description:Only need 3 laps in Italy instead of 6 code:ca86/07/04 cheat description:Only need 3 laps in Portugal instead of 4 code:ca87/05/04 cheat description:Only need 3 laps in Japan instead of 5 code:ca88/06/04 cheat description:Only need 3 laps in Australia instead of 5 code:ca89/06/04 cheat description:Full season ends after South Africa code:aa99/10/01 cheat description:Full season ends after Mexico code:aa99/10/02 cheat description:Full season ends after Brazil code:aa99/10/03 cheat description:Full season ends after Spain code:aa99/10/04 cheat description:Full season ends after San Marino code:aa99/10/05 cheat description:Full season ends after Monaco code:aa99/10/06 cheat description:Full season ends after Canada code:aa99/10/07 cheat description:Full season ends after France code:aa99/10/08 cheat description:Full season ends after Great Britian code:aa99/10/09 cheat description:Full season ends after Germany code:aa99/10/0a cheat description:Full season ends after Hungary code:aa99/10/0b cheat description:Full season ends after Belgium code:aa99/10/0c cheat description:Full season ends after Italy code:aa99/10/0d cheat description:Full season ends after Portugal code:aa99/10/0e cheat description:Full season ends after Japan code:aa99/10/0f cheat description:Start with 1/2 normal tire tread code:c88a/10/08 cartridge sha256:58be6a811ee3370882160115253b610581e8b4af7228669eb3fbd56e7a13117c name:Nightmare on Elm Street, A (USA) cheat description:Invincibility code:b315/f0/d0 cheat description:Infinite health code:bfbc/fe/bd cheat description:Infinite lives code:bb85/de/bd cheat description:Infinite 'zzz' code:9031/de/ad cheat description:Have all characters code:b9e7/f0/d0+b9d9/d0/f0 cheat description:Hit anywhere code:cf18/0d/00+cf20/f0/10+cefc/f0/50 cheat description:One hit kills code:cf6c/f0/d0 cheat description:No enemies code:a198/05/00+a197/ad/a9+a199/01/ea cheat description:Always able to switch characters code:b9ce/f0/30 cheat description:Freddy will not show up in Nightmare World code:e0f1/ce/ad cheat description:Mega-jumping teenagers code:b4b5/03/05 cheat description:Don't lose 'zzz' when hit code:d0db/80/00 cheat description:Don't lose 'zzz' when standing still code:902b/01/00 cheat description:Lose 'zzz' quicker code:902b/01/02 cheat description:Start with 1 continue code:ea38/03/01 cheat description:Start with 6 continues code:ea38/03/06 cheat description:Start with 9 continues code:ea38/03/09 cartridge sha256:02caaf66cc43a4c5a8d54252fca7bcb929dad91c71f127eabe37f29ef9199105 name:Nightshade (USA) cheat description:Invincible in fights code:d6dc/46 cheat description:Invincible out of fights code:d5d8/46 cartridge sha256:b1c2ae757c5ec76f488893f130f0f7f1aacf36a25467b9012ca3a11ab52204ce name:Ninja Crusaders (USA) cheat description:Invincibility code:c05f/d0/f0 cheat description:Infinite lives code:c148/de/bd cheat description:Hit anywhere code:ce7f/f0/4c+ce80/1b/d1+ce81/b9/ce cheat description:Collect items from anywhere code:a61b/b0/24+a62e/b0/24 cheat description:Multi-jump code:ae58/f0/24 cheat description:Mega-jump code:ae7f/12/25 cheat description:Super speed code:8b2d/fe/fd+8b2b/01/02 cheat description:Start with 1 life code:a890/03/01 cheat description:Start with 6 lives code:a890/03/06 cheat description:Start with 9 lives code:a890/03/09 cheat description:Start on stage 1-2 code:9406/00/01 cheat description:Start on stage 2-1 code:9406/00/02 cheat description:Start on stage 2-2 code:9406/00/03 cheat description:Start on stage 3-1 code:9406/00/04 cheat description:Start on stage 3-2 code:9406/00/05 cheat description:Start on stage 4-1 code:9406/00/06 cheat description:Start on stage 4-2 code:9406/00/07 cheat description:Start on stage 5-1 code:9406/00/08 cartridge sha256:6799437d4122b81c86ae35cefe5b6ae6e10e6f9a9c7b3140dd569f717ba32b3d name:Ninja Gaiden (USA) cheat description:Invincibility code:e162/a9 cheat description:Invincibility (alt) code:e177/a9/60 cheat description:Infinite health code:e1af/85/a5 cheat description:Infinite lives code:e401/c6/a5 cheat description:Hit anywhere code:ded5/00+dee3/00+deeb/00+def3/10+def7/d0 cheat description:Enemies die instantly code:ddf2/03/00+ded5/24/00+dee3/15/00+deeb/09/00+def3/90/10+def7/90/d0 cheat description:Multi-jump code:eb8d/80/00+ed92/1d/00+eced/d0/24+ee35/d0/24+eef6/85/a5 cheat description:Use windmill throwing-star without losing spiritual strength code:efae/05/00 cheat description:Use fire-wheel without losing spiritual strength code:ef03/05/00 cheat description:Use shuriken without losing spiritual strength code:ef67/03/00 cheat description:Maximum strength regained from restorer code:dc04/06/10 cheat description:Sound Test - hold down and press Start at Tecmo Presents screen code:805e/e6/04 cheat description:Start with 9 lives code:e53b/02/08 cheat description:Start with 6 lives code:e53b/02/05 cheat description:Start with 1 life code:e53b/02/00 cheat description:Invincibility after first hit code:0092/02+0093/80 cheat description:One hit kills bosses code:0497/00 cheat description:Start on stage 1-2 code:006d/01 cheat description:Start on stage 2-1 code:006d/02 cheat description:Start on stage 2-2 code:006d/03 cheat description:Start on stage 2-3 code:006d/04 cheat description:Start on stage 3-1 code:006d/05 cheat description:Start on stage 3-2 code:006d/06 cheat description:Start on stage 3-3 code:006d/07 cheat description:Start on stage 4-1 code:006d/08 cheat description:Start on stage 4-2 code:006d/09 cheat description:Start on stage 4-3 code:006d/0a cheat description:Start on stage 4-4 code:006d/0b cheat description:Start on stage 5-1 code:006d/0c cheat description:Start on stage 5-2 code:006d/0d cheat description:Start on stage 5-3 code:006d/0e cheat description:Start on stage 5-4 code:006d/0f cheat description:Start on stage 6-1 code:006d/10 cheat description:Start on stage 6-2 code:006d/11 cheat description:Start on stage 6-3 code:006d/12 cheat description:Start on stage 6-4 (1st boss) code:006d/13 cheat description:Start on stage 6-4 (2nd boss) code:006d/14 cheat description:Start on stage 6-5 (final boss) code:006d/15 cartridge sha256:21c51dc47a458a7de66544533d56eb9a69de0190d012b1645699e816d2cb5008 name:Ninja Gaiden II - The Dark Sword of Chaos (USA) cheat description:Invincibility code:cc34/50/a5 cheat description:Invincibility (alt) code:ca1b/cb/91 cheat description:Infinite health code:cc74/85/80 cheat description:Infinite health (alt) code:cc74/85/a5 cheat description:Infinite Ninja power code:9a8d/a6/a2+9a8e/7d/13+9a9d/4b/39 cheat description:Infinite time code:c6eb/c6/a5 cheat description:Infinite lives code:c8a2/c6/a5 cheat description:Hit anywhere code:ca6a/d3/00+ca81/bc/00+ca92/0d/00+ca9c/b0/f0 cheat description:Multi-jump code:c150/10/80+c157/d0/24+c14e/1f/13+c152/06/1b+d908/8d/ad+c14d/f0/a5+d97a/8d/ad+d7dd/86/a6 cheat description:Half-energy from medicine code:98bd/06/03 cheat description:Double energy from medicine code:98bd/06/0c cheat description:Never lose Ninja power item code:cdcb/86/24 cheat description:Fast running Ryu code:c0a7/01/02+c08f/fe/fd cheat description:Mega-fast running Ryu code:c0a7/01/03+c08f/fe/fc cheat description:Half-energy from Blue Ninja power code:983f/0a/05+9849/0a/05 cheat description:Double energy from Blue Ninja power code:983f/0a/14+9849/0a/14 cheat description:Double maximum Ninja power from scroll code:9881/0a/14+9898/01/02 cheat description:All powers use up only 5 points code:9a92/fd/ed+9a9c/fd/ed+9aaa/fd/ed cheat description:Less enemies code:e32f/00 cheat description:Start every life with two shadow ninjas code:d117/09/0f cheat description:Start with 1 life code:cec6/02/00 cheat description:Start with 6 lives code:cec6/02/05+cecc/95/85 cheat description:Start with 9 lives code:cec6/02/08+cecc/95/85 cheat description:Invincibility (alt) code:0068/09 cheat description:Infinite health (alt) code:0080/16 cheat description:Infinite lives (alt) code:00a5/03 cheat description:Infinite time (alt) code:00ab/04+00b1/f4 cartridge sha256:ba5968f14a02f1adf8a6144fcf9c4acde80bce8a3e01bae54b555f258540dd4b name:Ninja Gaiden III - The Ancient Ship of Doom (USA) cheat description:Invincibility code:9fe7/03/00 cheat description:Infinite lives code:cb8e/c6/a5 cheat description:Infinite health code:a30d/85/a5 cheat description:Infinite time (timer will still countdown) code:a565/c6/a5 cheat description:Infinite continues code:cba7/c6/a5 cheat description:Multi-jump and infinite time code:a8f9/14/00+a55c/32/20+a55a/8b/90+93b2/b0/24+a55b/d0/03+a558/bf/13+a55e/cf/a9+a57d/c6/a5+a55d/c6/da+a559/05/0a cheat description:Less time code:cc42/fa/96 cheat description:One hit kills code:a0ce/0f/00 cheat description:Sword hits several areas of the screen at once (sword upgrade negates the effect) code:cc28/10/7f+cc2c/07/7f cheat description:No power required for Windmill Throwing Star code:9fd4/01/00+9fca/0a/00 cheat description:No power required for Fire Wheel Art code:9fcb/08/00+9fd0/08/00 cheat description:No power required for Invincible Fire Wheel code:9fce/14/00+9fd8/02/00 cheat description:No power required for Fire Dragon Balls code:9fcc/08/00+9fd1/08/00 cheat description:No power required for Vacuum Wave Art code:9fcd/0a/00+9fd7/01/00 cheat description:Start with upgraded sword code:cc24/00/01+cc28/10/18+cc2c/07/10 cheat description:Start with 5 lives code:cc06/02/04 cheat description:Invincibility (alt) code:00ad/14 cheat description:Infinite health (alt) code:00a7/0a cartridge sha256:648cf7ac553517573cc9b3955ab50566a91974b2348154910bfa53ef15d55b56 name:Ninja Jajamaru - Ginga Daisakusen (Japan) cheat description:Invincibility code:9674/20/ad cheat description:Infinite lives code:946c/de/dd cartridge sha256:bf546b0ce7fc60d89020ff7c0fadc7369925ba68a84d25b03de4190a91c46a95 name:Ninja Jajamaru-kun (Japan) cheat description:Infinite time code:002a/78 cheat description:Hit anywhere code:9a70/06/00+9a60/21/00+9aa2/8d/ad cartridge sha256:622c62d48aa244fb2427ce8d0cf45e5fc57d94ad82e47a3b5b45a0dd643c9cd7 name:Ninja Kid (USA) cheat description:Infinite Feathers code:a913/c6/a5 cheat description:Infinite Stars code:a62d/c6/a5 cheat description:Infinite Boomerangs code:94fc/c6/a5 cheat description:Infinite Fireflames code:a7b2/c6/a5 cheat description:More Invincibility time code:d703/0f/28 cheat description:Less Invincibility time code:d703/0f/07 cheat description:1 Feather on pick-up code:d82a/03/01 cheat description:6 Feathers on pick-up code:d82a/03/06 cheat description:10 Stars on pick-up code:d82b/14/0a cheat description:40 Stars on pick-up code:d82b/14/28 cheat description:1 Boomerang on pick-up code:d82c/04/02 cheat description:10 Fireflames on pick-up code:d82d/14/0a cheat description:40 Fireflames on pick-up code:d82d/14/28 cheat description:Start with 1 life code:806a/02/00 cheat description:Start with 6 lives code:806a/02/05 cheat description:Start with 9 lives code:806a/02/08 cartridge sha256:b0e4d88db0b21db4a84e3c21d51898c686e9031dc138b2939877ecad20dd2350 name:Nintendo World Cup (USA) cheat description:1 minute in tournament mode code:ea3c/03/00 cheat description:6 minutes in tournament mode code:ea3c/03/05 cheat description:9 minutes in tournament mode code:ea3c/03/08 cheat description:6 minutes in match mode code:ea42/09/05 cheat description:3 minutes in match mode code:ea42/09/02 cheat description:1 minutes in match mode code:ea42/09/00 cheat description:Faster players code:bda3/00/01 cheat description:More powerful 'normal' shots code:aa2f/38/70 cartridge sha256:6157c99fe7a214025c65fd3649e4afe9cd2d38c333e65af028b935e49fbeb500 name:Noah's Ark (Europe) cheat description:Invincibility code:b83f/20/ad cheat description:Invincible against spikes code:cf8b/20/ad cheat description:Infinite lives code:83fc/ce/cd+88d6/ce/cd cheat description:Infinite health code:bc4b/85/a5 cheat description:Infinite time code:e10a/ce/cd cartridge sha256:55c2d10ae1b034b39533f780f6205f736735df1954c0eca6d147cfc13a224f82 name:North and South (USA) cheat description:Cannon has 5 shots code:81b6/09/05 cheat description:Cannon has 15 shots code:81b6/09/0f cheat description:Cannon has infinite shots code:9327/de/ad cheat description:No cannons allowed code:81a6/9d/2c cheat description:Only 2 daggers in the fortress code:8134/04/02 cheat description:Infinite daggers in the fortress code:94a3/de/2c cheat description:2 men in the fortress code:813e/0a/02 cheat description:5 men in the fortress code:813e/0a/05 cheat description:2 men on the train code:8154/0a/02 cheat description:5 men on the train code:8154/0a/05 cartridge sha256:106a9cd2acc3373bf2fae05158bdf7587d5f645402ba8073aaee65cb8b7b11cd name:Operation Secret Storm (USA) (Unl) cheat description:Infinite lives code:e33a/99/b9 cheat description:Infinite Gun ammo code:e54f/99/bd cheat description:Infinite health code:0520/17 cartridge sha256:36666e3314ee9e0a340b04ea8427aaefb6df8937425a016e78c26fb1fa77b017 name:Operation Wolf (USA) (Rev 0A) cheat description:Infinite continues code:bdef/09/05 cheat description:Never die code:d2db/36/00 cheat description:Infinite magazines code:d56d/01/00 cheat description:Infinite grenades code:d600/01/00 cheat description:Double bullets in each magazine code:d577/02/04 cheat description:Heal completely between levels code:d08a/03/ff cheat description:Grenades inflict double damage code:b27b/02/04 cheat description:Super power drinks code:b104/05/0a cheat description:Increase magazines code:cfee/07/09+d56d/05/09 cheat description:Increase grenades code:cff2/05/09+d56d/03/09 cheat description:Start on mission 2 code:a4d5/00/01 cheat description:Start on mission 3 code:a4d5/00/02 cheat description:Start on mission 4 code:a4d5/00/03 cheat description:Start on mission 5 code:a4d5/00/04 cheat description:Start on mission 6 code:a4d5/00/05 cartridge sha256:4d2b5339703d2300539348e3aad055fd00828afcbd9f3a97565e37725221fc0a name:Orb 3D (USA) cheat description:Infinite fuel code:03fd/50 cheat description:Start on level 10 code:03e2/09 cheat description:Start on level 15 code:03e2/13 cheat description:Start on level 30 code:03e2/1d cartridge sha256:6d310d9f2249932c7187130ebd696c42ff05f678c3086ac727ee6a27fdad4f43 name:Otaku no Seiza - An Adventure in the Otaku Galaxy (Japan) cheat description:No random battles code:dc82/a9/60 cartridge sha256:d50327afa539f4a5ccfd6e10f685326eb0f01915ccf305f752deae2bf17385a6 name:Over Horizon (Europe) cheat description:Invincibility (blinking) code:def0/c6/a5 cheat description:Infinite lives code:bdb0/ce/ad cheat description:Enable alternate graphics code:d685/00/01 cartridge sha256:b3a798ab7f2f237c7bd3c3e8b36cc752d850d10a8597e43771c82dcd654d5dae name:Overlord (USA) cheat description:Food not decreased code:8101/0d/1c cheat description:Hover tanks never decrease in battle code:beac/ce/ad cheat description:Ballistic Missiles never decrease in battle code:9149/ce/ad cheat description:Homing Missiles never decrease in battle code:9154/ce/ad cheat description:Enemy starts with 0 Missiles code:bf6c/9f/a7 cheat description:Constantly get 9999999 cash on all planets with 1% or higher tax code:81c3/b0/d0 cheat description:View a planet's stats for high food code:b725/00/7f+b729/b9/99 cheat description:View a planet's stats for high people code:b810/00/7f+b814/b9/99 cheat description:View a planet's stats for high energy code:b7cf/00/7f+b7d3/b9/99 cheat description:View a planet's stats for high fuel code:b78e/00/7f+b792/b9/99 cartridge sha256:ae2dddda1f90b8f8e3a990a2247ab4e373f69e6599f4e63f531d3a541b54bd85 name:P.O.W. - Prisoners of War (USA) cheat description:Invincibility code:ba6b/85/60 cheat description:Infinite lives code:d1fb/01/00 cheat description:Infinite bullets code:ce61/01/00 cheat description:One hit kills code:b90d/bd/b9 cheat description:Hit anywhere code:b8df/23/00+b8de/b0/4c+b8e0/c8/b9 cheat description:Take less damage when hit from behind code:bb11/f9/ed cheat description:Keep weapons after dying code:bb3f/8d/2c+bd51/8d/2c cheat description:Start with half health code:c341/20/10+d20f/20/10 cheat description:Start with 1 life code:82bd/02/00 cheat description:Start with 6 lives code:82bd/02/05 cheat description:Start with 9 lives code:82bd/02/08 cheat description:Start with 99 lives code:82bd/02/63 cheat description:Have infinite Grenades, Brass Knuckles, Armor Vest code:0438/f9 cheat description:Have infinite Knives, Brass Knuckles, Armor Vest code:0438/e5 cheat description:Have infinite Gun, Brass Knuckles, Armor Vest code:0438/db cheat description:Start on stage 2 (disable after stage begins) code:0047/01 cheat description:Start on stage 3 (disable after stage begins) code:0047/02 cheat description:Start on stage 4 (disable after stage begins) code:0047/03 cheat description:Start on stage 5 (disable after stage begins) code:0047/04 cheat description:Start on stage 6 (disable after stage begins) code:0047/05 cartridge sha256:fa12a61eb787bf8346a81e5b6eaede75238a1735db24a6f4df51ac3a6b499f18 name:Pac-Man (USA) (Namco) cheat description:Invincibility code:d307/f0/24 cheat description:Get 8000+ points for eating ghosts code:d31b/a4/a0+d31c/d9/06+d327/e6/a5 cheat description:Power Pill effect always active code:0088/0f cheat description:Infinite lives code:0067/03 cartridge sha256:1e60a181e1f89f2249a3e0d44a7765c2cdd9e0446f1671c63bf2c6f6df562d4c name:Pac-Man (USA) (Tengen) cheat description:Invincibility code:d2c6/f0/24 cheat description:Walk through walls code:d36f/18/00+d43a/d0/50+d473/f0/50+d46a/f0/70 cheat description:Get 8000+ points for eating ghosts code:d2da/a4/a0+d2db/d9/06+d2e6/e6/a5 cheat description:Ghosts are re-eatable until Power Pill wears off code:d648/85/a5 cheat description:Power pills last longer code:d166/3c/70 cheat description:Power pills last extra long code:d166/3c/ff cheat description:Power pills don't last as long code:d166/3c/20 cheat description:Power pills don't work code:e022/a5/60 cheat description:Only 3 ghosts are edible code:e02f/0f/0d cheat description:Only 2 ghosts are edible code:e02f/0f/09 cheat description:Pac-Man moves manually code:d35b/35/af cheat description:Power Pill effect always active code:0088/15 cheat description:Infinite lives code:0067/03 cartridge sha256:25506ac6d6413a73249d3ce6a4ecc40048982596e01d778eddb71baca084efa6 name:Pac-Man (USA) (Tengen) (Unl) cheat description:Invincibility code:d2c6/f0/24 cheat description:Get 8000+ points for eating ghosts code:d2da/a4/a0+d2db/d9/06+d2e6/e6/a5 cheat description:Ghosts are re-eatable until Power Pill wears off code:d648/85/a5 cheat description:Power pills last longer code:d166/3c/70 cheat description:Power pills last extra long code:d166/3c/ff cheat description:Power pills don't last as long code:d166/3c/20 cheat description:Power pills don't work code:e022/a5/60 cheat description:Only 3 ghosts are edible code:e02f/0f/0d cheat description:Only 2 ghosts are edible code:e02f/0f/09 cheat description:Power Pill effect always active code:0088/15 cheat description:Infinite lives code:0067/03 cartridge sha256:acc561f57cfd0490fdce649deb16fa9df309bba1695608213a0ff8066d662492 name:Pac-Mania (USA) (Unl) cheat description:Infinite lives code:d941/c6/a5 cheat description:Trapped ghosts code:cfe3/78 cheat description:Go through ghosts code:d8b6/95 cheat description:Ghosts worth 3200 points code:d88f/01 cartridge sha256:6c47c73eb510fb0f71eeb2a3f5cca7c25eca8678ffe060aa17df6534dbd10ef1 name:Panic Restaurant (USA) cheat description:Invincibility code:90b1/d0/f0 cheat description:Infinite health - except when you fall on spikes code:90e1/c6/a9 cheat description:Infinite health (alt) code:90e1/c6/a5 cheat description:Infinite time code:c26c/c6/a9 cheat description:Infinite time (alt) code:c26c/c6/c5 cheat description:Infinite lives code:d418/c6/85 cheat description:Infinite lives (alt) code:d418/c6/a5 cheat description:Hit anywhere code:92c7/be/00+92e4/a1/00 cheat description:Moon-jump code:c303/29/00 cheat description:Start with 4 hearts code:f452/02/04 cheat description:Start with 2 lives code:ad17/02/01 cheat description:Start with 5 lives code:ad17/02/05 cheat description:Start with 6 hearts (heart meter will be distorted) code:f452/02/06 cheat description:Start with 10 hearts (heart meter will be distorted) code:f452/02/0a cheat description:Start with 10 lives (meter will display 9) code:ad17/02/0a cheat description:Start with 15 lives (meter will display 9) code:ad17/02/0f cheat description:Start with 80 on timer (1st level only) code:f464/63/50+cf6a/63/50 cheat description:Start with 70 on timer (1st level only) code:f464/63/46+cf6a/63/46 cheat description:Start with 60 on timer (1st level only) code:f464/63/3c+cf6a/63/3c cartridge sha256:73f0f7b9150fb080541426cedc87bf528c63393e6112812112e8c1339d9bfbf5 name:Panda Prince, The (Shin-Shin) (Unl) cheat description:Infinite lives code:979b/85/a5 cartridge sha256:f1c9c4723190d6be5f1f683ad5fd8cc123abd70d42f486c175a25f1237db6199 name:Paperboy (USA) cheat description:Invincibility against moving objects code:8a79/90/18+8a7a/04/60 cheat description:Invincibility against non-moving objects code:9c45/06/00 cheat description:Infinite lives code:8ade/c6/a5 cheat description:Infinite papers code:987c/c6/a9 cheat description:Infinite time in training course code:982b/8d/ad cheat description:Broken windows count as deliveries code:9943/02/01 cheat description:Can deliver to houses with broken windows code:9944/99/ad cheat description:Deliver from anywhere (must be within range of house) code:98d9/f0/50+98da/50/77 cheat description:Hold down to stop moving code:8fc3/3f/00+8fc1/06/0d cheat description:Gain 20 papers on pick-up code:9b3f/0a/14 cheat description:Start with 1 life code:9d38/04/01 cheat description:Start with 6 lives code:9d38/04/06 cheat description:Start with 20 papers code:89a3/0a/14 cartridge sha256:dec09033f68850bd25cf3e8bf0e05a44970301c4aaac2cbc27b8f9e96392b409 name:Paperboy 2 (USA) cheat description:Infinite lives code:834a/01/00 cheat description:Infinite papers code:9be7/01/00 cheat description:5 papers on pick-up code:8990/0a/05 cheat description:15 papers on pick-up code:8990/0a/0f cheat description:20 papers on pick-up code:8990/0a/14 cheat description:Start with 1 life - Paperboy only code:b49f/05/01 cheat description:Start with 3 lives - Paperboy only code:b49f/05/03 cheat description:Start with 10 lives - Paperboy only code:b49f/05/0a cheat description:Start with 15 papers code:b604/0a/0f cheat description:Start with 20 papers code:b604/0a/14 cartridge sha256:25ae9f90412612715a254973006f0056016a840efc8af1fbdb6fc2eb7cd5eb7c name:Parasol Stars - Rainbow Islands II (Europe) cheat description:Invincibility code:005c/03 cheat description:Automatically finish levels code:0320/00+0321/00+0322/00+0323/00+0324/00+0325/00+0326/00+0327/00 cheat description:Make the Miracle Icon appear (enable then disable) code:04fb/01 cartridge sha256:f0d89b53126513e1df56b46bae3a43b4a4b87543d48974c9087ba94737249801 name:Parodius (Europe) cheat description:Enemies die automatically code:008b/02 cheat description:Infinite Shield on pick-up code:64d0/0f cartridge sha256:f1762c9f40e6e45a123b73a035841768e0132fa82c92f9d066a8718a7f99b6cc name:Pesterminator (USA) (Unl) cheat description:Infinite health code:d799/ce/e6 cheat description:Infinite lives code:d0f5/ce/ae cartridge sha256:1c598fe0b58811b1bedfc6f2cda05f0960b4a6e2770c8a2f73cd6da370ed2448 name:Phantom Fighter (USA) cheat description:Infinite health code:a3d3/8d/ad cheat description:Take less damage when attacked code:a3d1/e5/e9+a3d2/00/01 cheat description:Start with Sacred Sword code:cc68/85/e6+cc69/87/84 cheat description:Start with Bell code:cc68/85/e6+cc69/87/85 cheat description:Start with Tonten code:cc68/85/e6+cc69/87/83 cheat description:Start with Talisman code:cc68/85/e6+cc69/87/82 cheat description:Start with 3 Scrolls code:cc5f/00/03+cc69/87/86 cheat description:Start with 6 Scrolls code:cc5f/00/06+cc69/87/86 cheat description:Infinite HP code:0408/c8 cheat description:Max HP code:040a/c8 cheat description:One hit kills code:0448/01 cheat description:Have 99 Scrolls code:0086/63 cheat description:Have 3 Crystal Balls code:0087/03 cheat description:Have strongest punch code:0076/03 cheat description:Have strongest kick code:0077/03 cheat description:Have highest jump code:0078/03 cheat description:Have best Tiger move code:0079/03 cheat description:Have best Mirage move code:007a/03 cheat description:Have Talisman code:0082/01 cheat description:Have Tonten code:0083/01 cheat description:Have Sacred Sword code:0084/01 cheat description:Have Bell code:0085/01 cartridge sha256:c701cffa5315b4375c0a71d2e7378137bcdeed0684f57bf7eb2fbed3b2c1b1da name:Pictionary - The Game of Video Quick Draw (USA) cheat description:Infinite time code:0084/20 cartridge sha256:f4ddb0f1a02f823ebed30b55547344de3c8fb9d87254ff993584373ecadd9141 name:Pin Bot (USA) cheat description:Infinite balls code:e26f/e6/a9 cheat description:Start with only 1 ball code:e274/03/01 cheat description:Start with 6 balls code:e274/03/06 cheat description:Start with 9 balls code:e274/03/09 cartridge sha256:910ba4505b46a99b3779d84fd22ba8b18f3a649b0c1a11706c4609d06ce0bc18 name:Pinball (World) cheat description:Infinite balls code:c0ab/de/bd cheat description:Start with lots of balls code:c051/03/2f cheat description:Start with 1 ball code:c051/03/01 cheat description:Start with 6 balls code:c051/03/06 cheat description:Start with 9 balls code:c051/03/09 cartridge sha256:7dd47bac196af9874181e86f64402035e255814739828d5d00c03bac8689d40a name:Pipe 5 (Asia) (Unl) cheat description:Infinite time (disable to finish round) code:0080/09 cheat description:1 distance needed code:008e/01 cheat description:Automatically finish round code:008e/00 cartridge sha256:a57f873ccb2c8842e9ef1a8380c87026a8ef0c6649f1cc02ce0743fae61ea120 name:Pipe Dream (USA) cheat description:Infinite wrenches code:e341/ce/ad cheat description:One-way pipes from level 1 code:c212/05/00 cheat description:One-way pipes from level 5 code:c210/03/05 cheat description:One-way pipes from level 10 code:c219/03/0a cheat description:Tunnels galore code:8eb3/8d/8c cheat description:Pumps instead of reservoirs code:dc40/12/14 cheat description:Pumps before reservoirs code:dc40/12/14+dc47/14/12 cheat description:Start with 1 wrench code:8113/03/01 cheat description:Start with 6 wrenches code:8113/03/06 cheat description:Start with 9 wrenches code:8113/03/09 cartridge sha256:ac1215af2a3315f8bbff01987f24a85e9c1fe984287c05fc21246b0a66fd5dfd name:Platoon (USA) (Rev A) cheat description:Stage 1 - Infinite grenades code:91ca/c6/a5 cheat description:Stage 1 - Start with double capacity magazine code:9057/c6/a5 cheat description:Stage 1 - Double hits code:8fcd/04/08 cheat description:Stage 1 - Don't take damage code:8fc3/e6/a5 cheat description:Stage 2 - Don't take damage code:8e62/e6/a5 cheat description:Stage 4 - Infinite time code:8acb/c6/a5 cheat description:Stage 4 - Play with more time code:89e9/03/05 cheat description:Stage 4 - Double hits code:914d/05/09 cheat description:Stage 4 - Halve hits code:914d/05/02 cheat description:Stage 4 - Start with double ammo code:89ab/06/0c cheat description:Start on stage 2 code:8148/05/04 cheat description:Start on stage 3 code:c004/06/03 cartridge sha256:61ac77e84b4aa089115a682a2e8cfaa6811ba83b567ae1f13d8b644e0c42a2bf name:Platoon (USA) cheat description:Stage 1 - Infinite grenades code:91ca/c6/a5 cheat description:Stage 1 - Start with double capacity magazine code:9057/c6/a5 cheat description:Stage 1 - Double hits code:8fcd/04/08 cheat description:Stage 1 - Don't take damage code:8fc3/e6/a5 cheat description:Stage 2 - Don't take damage code:8e62/e6/a5 cheat description:Stage 4 - Infinite time code:8acb/c6/a5 cheat description:Stage 4 - Play with more time code:89e9/03/05 cheat description:Stage 4 - Double hits code:914d/05/09 cheat description:Stage 4 - Halve hits code:914d/05/02 cheat description:Stage 4 - Start with double ammo code:89ab/06/0c cheat description:Start on stage 2 code:8148/05/04 cheat description:Start on stage 3 code:c004/06/03 cartridge sha256:97f56ee3bcb0542996401a65c63a0e91c1c9c71da07f0619975e910946f9540d name:Popeye (World) (Rev A) cheat description:Invincibility against enemy code:d147/60 cheat description:Invincibility against shots code:d35e/60 cheat description:Start with 1 life code:c81f/01 cheat description:Start with 6 lives code:c81f/06 cheat description:Start with 9 lives code:c81f/09 cartridge sha256:23e457d854d5ce2bb8b81cef9fbbff0164171505a4d2d9e28ecbc2d062c81517 name:Popo Team (Asia) (Unl) cheat description:Invincibility code:004f/01 cheat description:Infinite lives code:003f/03 cheat description:Slower enemies code:004d/01 cartridge sha256:4986c3862a04fcf5b22df58b1182ec2ad636e6083714ac7c069adc1639023ebf name:Power Blade (USA) cheat description:Infinite health code:8a4d/e5/e9 cheat description:Infinite lives code:d050/c6/a5 cheat description:Hit anywhere code:8c97/22/00+8c8b/90/f0 cheat description:Take minimum damage code:8a44/b9/ad cheat description:Mega-jump code:d628/38/28 cheat description:Don't lose boomerang strength when you die code:d036/c6/24+d066/85/24 cheat description:Don't lose multi-boomerangs when you die code:d03c/c6/24+d06a/85/24 cheat description:Press Start to finish the level (don't use on Protect level) code:d181/01/08+d183/4d/18+d184/a9/60 cheat description:Start a new game to view the ending code:f67b/02/07 cheat description:Start with 1 life code:f722/02/00 cheat description:Start with 6 lives code:f722/02/05 cheat description:Start with 9 lives code:f722/02/08 cheat description:Infinite health (alt) code:04ab/12 cheat description:Infinite lives (alt) code:0027/09 cheat description:Infinite time code:0095/09+0096/99 cheat description:Infinite Bombs code:005a/09 cheat description:Infinite health refills code:005b/09 cheat description:Powered up Boomerang code:005e/03 cheat description:Triple Boomerangs code:0099/02 cheat description:One hit kills on bosses code:04ba/00 cheat description:Moon jump (Can cause you to die in areas with no ceiling) code:051d/c0 cheat description:Have Suit code:009c/03 cheat description:Start on last stage code:0059/3f cartridge sha256:6c462c3fa07aab70759376fe6b59e9c91e808f79fae2960f869bafc9cf20dca2 name:Power Blade 2 (USA) cheat description:Infinite health - except for spikes code:b3d2/e5/e9 cheat description:Infinite lives code:d053/c6/24 cheat description:Infinite time code:ca4a/a5/60 cheat description:Infinite life tanks code:ee8a/c6/24 cheat description:Infinite energy tanks code:d301/c6/24 cheat description:Speed up timer code:ca47/3f/1f cheat description:Slow down timer code:ca47/3f/7f cheat description:Throw meter doesn't decrease when boomerang is thrown code:d24a/a5/85 cheat description:Take minimal damage code:b3d2/e5/e9+b3d3/00/01 cheat description:Maximum throwing ability on pick-up code:b56b/c9/a9+b572/e6/85 cheat description:Start a new game to view the ending code:ee27/03/07 cheat description:Start with 1 life code:86c9/02/00 cheat description:Start with 6 lives code:86c9/02/05 cheat description:Start with 9 lives code:86c9/02/08 cheat description:Infinite health code:049a/12 cheat description:Infinite lives (alt) code:009f/99 cheat description:Have max POW code:0054/0f cheat description:Have max energy code:00a0/12 cheat description:Have Dual Power-Blades code:0099/01 cheat description:Have Red Power-Blades code:00a2/01 cheat description:View ending code:0018/07 cartridge sha256:ae360d56679f179109ca7d07ad8b4da644ad53a39ffe1d47c8db00648af4bdb0 name:Power Punch II (USA) cheat description:Infinite health code:fc02/85/a5 cheat description:Infinite health (alt) code:00ce/ff cheat description:Instant win code:00cd/00 cheat description:Max Punch code:00c3/ff cheat description:max Stamina code:00c4/ff cartridge sha256:76cdd991b85e4a15c62275fe6b3ccd5132ee2d17e70fe4d2173b8ce5d1193ec0 name:Predator (USA) cheat description:Invincibility (normal mode) code:8851/85/86+cc4f/c6/c9 cheat description:Infinite health (big mode) code:8be2/ce/ee cheat description:Infinite health in jungle mode code:ccb6/85/60 cheat description:Infinite lives in jungle mode code:c274/ce/ad cheat description:Infinite lives in big mode code:c1a2/ce/ad cheat description:Hit anywhere code:ed08/a5/60+ed60/a5/60+ed21/a5/60+ecf4/a5/60+ed9d/a5/60 cheat description:Mega-jumps in jungle mode code:819e/09/08 cheat description:Don't die if you fall down holes code:880f/0c/ef+8810/a9/60 cheat description:Start each life with Laser Rifle code:8859/0b/03+885b/ae/ba cheat description:Start with double lives code:c16c/04/08 cheat description:Invincibility code:0010/02 cheat description:Infinite lives code:0504/09 cartridge sha256:7b0899bfde9661d1af5c2d88c46a8a70f1623729bf52db654fb40cda4554820b name:Prince of Persia (USA) cheat description:Infinite health code:8725/9d/bd cheat description:Infinite time code:b245/8d/ad cheat description:Infinite health (except for deep sword hit or a long fall) (alt) code:06cf/03 cheat description:Infinite time (alt) code:04ef/80 cartridge sha256:99f3ca1657ad48f9a4f128dce3e0e4efd2c4fee413a120a462055801c9581ebd name:Princess Tomato in the Salad Kingdom (USA) cheat description:Infinite gold coins code:03cb/09 cartridge sha256:3910ae7495a71e6a55f70ed31eb345d28d6e9d524fe88679719d831f8f2553ce name:Pro Sport Hockey (USA) cheat description:P1 goals worth 2 code:b7da/01/02 cheat description:P1 goals worth 3 code:b7da/01/03 cheat description:P1 goals worth 4 code:b7da/01/04 cheat description:P1 goals worth 5 code:b7da/01/05 cheat description:P1 goals worth 6 code:b7da/01/06 cheat description:P1 goals worth 7 code:b7da/01/07 cheat description:P1 goals worth 8 code:b7da/01/08 cheat description:P2 goals worth 2 code:b7f2/01/02 cheat description:P2 goals worth 3 code:b7f2/01/03 cheat description:P2 goals worth 4 code:b7f2/01/04 cheat description:P2 goals worth 5 code:b7f2/01/05 cheat description:P2 goals worth 6 code:b7f2/01/06 cheat description:P2 goals worth 7 code:b7f2/01/07 cheat description:P2 goals worth 8 code:b7f2/01/08 cheat description:P1 starts with 1 point code:91f6/8d/ee cheat description:P2 starts with 1 point code:91f9/8d/ee cheat description:P1 starts with 2 points code:91f5/00/02+91fa/e7/e6 cheat description:P1 starts with 4 points code:91f5/00/04+91fa/e7/e6 cheat description:P1 starts with 6 points code:91f5/00/06+91fa/e7/e6 cheat description:P1 starts with 8 points code:91f5/00/08+91fa/e7/e6 cheat description:P1 starts with 10 points code:91f5/00/0a+91fa/e7/e6 cheat description:P2 starts with 2 points code:91f5/00/02+91f7/e6/e7 cheat description:P2 starts with 4 points code:91f5/00/04+91f7/e6/e7 cheat description:P2 starts with 6 points code:91f5/00/06+91f7/e6/e7 cheat description:P2 starts with 8 points code:91f5/00/08+91f7/e6/e7 cheat description:P2 starts with 10 points code:91f5/00/0a+91f7/e6/e7 cartridge sha256:e144020f37416f80f1a0da47aa9b3fbda338c61fcd175e8b2dc98df181e24b85 name:Pro Wrestling (USA) (Rev A) cheat description:Infinite health and time code:e655/0b/ef+e654/d6/a9+e656/f0/85+e657/0a/67 cheat description:Only have 5 seconds to get back into ring code:e286/14/05 cheat description:Only have 10 seconds to get back into ring code:e286/14/0a cheat description:Have 30 seconds to get back into ring code:e286/14/1e cheat description:Rounds are only 1 minute code:dfa4/05/01 cheat description:Rounds are only 3 minutes code:dfa4/05/03 cheat description:Rounds are 8 minutes code:dfa4/05/08 cheat description:Rounds are 10 minutes code:dfa4/05/0a cheat description:2-second pin count code:e46e/03/02 cheat description:5-second pin count code:e46e/03/05 cheat description:7-second pin count code:e46e/03/07 cheat description:Infinite time (minutes) code:0087/09 cheat description:Infinite time (seconds) code:0086/3b cheat description:Pin once to win match code:0077/00 cartridge sha256:96dafa1208bda2eaa601d6855d86cf670556018c2859805cae51a88f83e66e9e name:Pro Wrestling (USA) cheat description:Infinite health and time code:e655/0b/ef+e654/d6/a9+e656/f0/85+e657/0a/67 cheat description:Only have 5 seconds to get back into ring code:e286/14/05 cheat description:Only have 10 seconds to get back into ring code:e286/14/0a cheat description:Have 30 seconds to get back into ring code:e286/14/1e cheat description:Rounds are only 1 minute code:dfa4/05/01 cheat description:Rounds are only 3 minutes code:dfa4/05/03 cheat description:Rounds are 8 minutes code:dfa4/05/08 cheat description:Rounds are 10 minutes code:dfa4/05/0a cheat description:2-second pin count code:e46e/03/02 cheat description:5-second pin count code:e46e/03/05 cheat description:7-second pin count code:e46e/03/07 cheat description:Infinite time (minutes) code:0087/09 cheat description:Infinite time (seconds) code:0086/3b cheat description:Pin once to win match code:0077/00 cartridge sha256:635271fe654636ec37c882f76c5f8cd39b7b3a476c9aa75cefb548d82de8f896 name:Punch-Out!! (USA) cheat description:Infinite health code:0391/60 cheat description:Infinite hearts code:0326/42 cheat description:Infinite Stars code:0342/04 cheat description:One-hit knockdowns code:0398/01 cartridge sha256:ea81de1a6d901d8d1ad229a6d8d88edcc8e1aeeae6146aa4cd01eb0310eb44d5 name:Punisher, The (USA) cheat description:Invincibility (blinking) code:e4c4/f0/d0+e4c6/ca/e8 cheat description:Infinite health code:a974/8d/ad+a631/8d/ad+a947/8e/ae cheat description:Infinite Grenades code:ef5d/ca/ea cheat description:Infinite bullets and Rockets code:f1d0/01/00 cheat description:Never lose a life against normal enemy code:e29c/ca/ea cheat description:Never lose a life against end of level enemy code:899a/ca/ea cheat description:Hit anywhere code:a274/28/00+a21f/0d/00+a428/09/00+a12a/32/00 cheat description:Faster Punisher code:b5bf/02/04 cheat description:Stage scrolls 2x as fast code:e47c/00/01 cheat description:Stage scrolls 3x as fast code:e47c/00/02 cheat description:Stage scrolls 4x as fast code:e47c/00/03 cheat description:150 Machine Gun bullets on pick-up code:fbb7/00/01 cheat description:150 Assault Rifle bullets on pick-up code:fbba/00/01 cheat description:Less energy on pick-up code:b90b/10/08 cheat description:More energy on pick-up code:b90b/10/18 cheat description:Start with 1 life code:e697/05/01 cheat description:Start with 10 lives code:e697/05/0a cartridge sha256:691ef0807cacd7032c52ff65ab1718c28be45c7220afcc13f20c645dfb40d4ed name:Puss n Boots - Pero's Great Adventure (USA) cheat description:Infinite health code:cd71/85/a5 cheat description:Infinite lives code:c21a/c6/a5 cheat description:Auto-fire and auto-jump code:e81f/ff/00 cheat description:Mega-jump code:cb27/09/00 cheat description:Start with less health code:ebd7/38/1c cheat description:Start with 1 life code:c092/03/01 cheat description:Start with 6 lives code:c092/03/06 cheat description:Start with 9 lives code:c092/03/09 cheat description:Start on stage 1 code:c500/00/04 cheat description:Start on stage 2 code:c500/00/09 cheat description:Start on stage 3 code:c500/00/0e cheat description:Infinite health (alt) code:0092/38 cheat description:Infinite lives (alt) code:000a/09 cartridge sha256:0cf2fc17a59a0932ce43e6b2e9ea4e2570f03139784b5c9df429a499e734b92e name:Puzznic (USA) cheat description:Press A to destroy blocks (no need to match blocks) code:a639/94/00+a63d/05/00 cheat description:Slower timer code:d241/3c/65 cheat description:Faster timer code:d241/3c/1e cheat description:Start on level 2-1 code:81b5/00/0a cheat description:Start on level 3-1 code:81b5/00/14 cheat description:Start on level 4-1 code:81b5/00/1e cheat description:Start on level 5-1 code:81b5/00/28 cheat description:Start on level 6-1 code:81b5/00/32 cheat description:Start on level 7-1 code:81b5/00/3c cheat description:Start on level 8-1 code:81b5/00/46 cheat description:Start on level 9-1 code:81b5/00/50 cartridge sha256:5fa346174b6b5a9dc2b5fe113ef8d8ac013a32b26dde6d5dfc9ed631d5e9af25 name:Q-bert (USA) cheat description:Infinite lives code:a1d4/c6/a5 cheat description:Clear level automatically code:c142/a5/a9 cheat description:Start with 1 life code:9cb9/05/01+a323/05/01 cheat description:Start with 10 lives code:a323/05/0a+9cb9/05/0a cheat description:Start on level 3 code:9cd6/00/08 cheat description:Start on level 6 code:9cd6/00/14 cheat description:Start on level 9 code:9cd6/00/20 cheat description:Infinite lives - P1 code:004c/63 cheat description:Start on level 1 round 2 code:0049/01 cheat description:Start on level 1 round 3 code:0049/02 cheat description:Start on level 1 round 4 code:0049/03 cheat description:Start on level 2 round 1 code:0049/04 cheat description:Start on level 2 round 2 code:0049/05 cheat description:Start on level 2 round 3 code:0049/06 cheat description:Start on level 2 round 4 code:0049/07 cheat description:Start on level 3 round 1 code:0049/08 cheat description:Start on level 3 round 2 code:0049/09 cheat description:Start on level 3 round 3 code:0049/0a cheat description:Start on level 3 round 4 code:0049/0b cheat description:Start on level 4 round 1 code:0049/0c cheat description:Start on level 4 round 2 code:0049/0d cheat description:Start on level 4 round 3 code:0049/0e cheat description:Start on level 4 round 4 code:0049/0f cheat description:Start on level 5 round 1 code:0049/10 cheat description:Start on level 5 round 2 code:0049/11 cheat description:Start on level 5 round 3 code:0049/12 cheat description:Start on level 5 round 4 code:0049/13 cheat description:Start on level 6 round 1 code:0049/14 cheat description:Start on level 6 round 2 code:0049/15 cheat description:Start on level 6 round 3 code:0049/16 cheat description:Start on level 6 round 4 code:0049/17 cheat description:Start on level 7 round 1 code:0049/18 cheat description:Start on level 7 round 2 code:0049/19 cheat description:Start on level 7 round 3 code:0049/1a cheat description:Start on level 7 round 4 code:0049/1b cheat description:Start on level 8 round 1 code:0049/1c cheat description:Start on level 8 round 2 code:0049/1d cheat description:Start on level 8 round 3 code:0049/1e cheat description:Start on level 8 round 4 code:0049/1f cheat description:Start on level 9 round 1 code:0049/20 cheat description:Start on level 9 round 2 code:0049/21 cheat description:Start on level 9 round 3 code:0049/22 cheat description:Start on level 9 round 4 code:0049/23 cartridge sha256:882a02c538cb097531da74d0ad685f6896dcfb7fa9b1a0cd540b4274968a7c13 name:Q Boy (Asia) (Unl) cheat description:Infinite lives code:8f54/ce/ad cheat description:Infinite life code:a9f2/ce/ad cheat description:Invincibility after first hit code:95a7/c6/60 cheat description:Infinite Breath Power code:aa8e/ce/ad+aa91/ce/ad cheat description:Infinite Lift Power code:ab22/ce/ad+ab25/ce/ad cartridge sha256:745050dec23a692e1e759eb3e291f58ad7739fadb3a1308ec8d60085fefaec69 name:QIX (USA) cheat description:1 life - P1 code:8281/04/01 cheat description:1 life - P2 code:8288/04/01 cheat description:Start on Level 5 - 1P game code:8272/01/05 cheat description:Start on Level 10 - 1P game code:8272/01/0a cheat description:Start on Level 20 - 1P game code:8272/01/14 cheat description:Start on Level 5 - 2P game code:828c/01/05 cheat description:Start on Level 10 - 2P game code:828c/01/0a cheat description:Start on Level 20 - 2P game code:828c/01/14 cartridge sha256:5dcea6d649f5ab79cf43dde76b92fb53b056fe92c6b49fd41f5158d9af0e9c32 name:Quattro Adventure (USA) (Unl) cheat description:Boomerang Kid - Infinite lives code:ce12/ce/ad cheat description:Boomerang Kid - Start with 6 lives code:c611/03/06 cheat description:Linus Spacehead - Increase oxygen code:c749/18/20 cheat description:Linus Spacehead - Never lose oxygen code:b5b2/01/00 cheat description:Linus Spacehead - Never lose life in the water code:c783/c6/a5 cheat description:Linus Spacehead - Never lose life in the land code:d325/c6/a5 cheat description:Linus Spacehead - Start with 9 lives code:c3c4/03/09 cheat description:Super Robin Hood - Invincibility code:f59d/49/60 cheat description:Super Robin Hood - Infinite lives code:c5fa/c6/a5 cheat description:Super Robin Hood - 9 energy hearts, you may lose some hearts when you pick up new ones code:c603/03/09 cheat description:Super Robin Hood - Start with 1 life code:c365/03/01 cheat description:Super Robin Hood - Start with 6 lives code:c365/03/06 cheat description:Super Robin Hood - Start with 9 lives code:c365/03/09 cheat description:Treasure Island Dizzy - Invincible Dizzy Starts you in the Island In The Sky, walk left to arrive at the original starting point - code:d7aa/00/01 cheat description:Treasure Island Dizzy - Walk backwards code:e874/a5/a9 cheat description:Treasure Island Dizzy - Start with snorkel code:d7bf/00/01 cheat description:Treasure Island Dizzy - Start with axe code:d7bf/00/01+f2cd/12/01 cheat description:Treasure Island Dizzy - Start with dynamite code:d7bf/00/01+f2cd/12/02 cheat description:Treasure Island Dizzy - Start with heavy weight code:d7bf/00/01+f2cd/12/05 cartridge sha256:a537916d210a97e41e669c77f3ebcccb681dc44db4d8b758c2109baf8590d918 name:Quattro Arcade (USA) (Unl) cheat description:Go! Dizzy Go! - Always kill monsters code:dbe5/ea+dbe6/ea cheat description:Go! Dizzy Go! - Walk through walls code:d3e3/ea cheat description:Go! Dizzy Go! - Start with 1 life code:c562/03/01 cheat description:Go! Dizzy Go! - Start with 6 lives code:c562/03/06 cheat description:Go! Dizzy Go! - Start with 9 lives code:c562/03/09 cheat description:Go! Dizzy Go! - Start on world 1, stage 3 code:c58c/01/02 cheat description:Go! Dizzy Go! - Start on world 1, stage 5 code:c58c/01/04 cheat description:Go! Dizzy Go! - Start on world 2, stage 2 code:c58c/01/06 cheat description:Go! Dizzy Go! - Start on world 2, stage 4 code:c58c/01/08 cheat description:Go! Dizzy Go! - Start on world 4, stage 2 code:c58c/01/10 cheat description:Go! Dizzy Go! - Start on world 4, stage 4 code:c58c/01/12 cheat description:Go! Dizzy Go! - Start on world 5, stage 1 code:c58c/01/14 cheat description:Go! Dizzy Go! - Start on world 5, stage 3 code:c58c/01/16 cheat description:Go! Dizzy Go! - Start on world 5, stage 5 code:c58c/01/18 cheat description:Sunt Buggies - Infinite lives code:a09a/ce/ad cheat description:Sunt Buggies - Start with 1 life code:ec4a/03/01 cheat description:Sunt Buggies - Start with 6 lives code:ec4a/03/06 cheat description:Sunt Buggies - Start with 9 lives code:ec4a/03/09 cheat description:F-16 Renegade - Start with 2 lives - 1P game code:c8b0/03/01 cheat description:F-16 Renegade - Start with 7 lives - 1P game code:c8b0/03/06 cheat description:F-16 Renegade - Start with 10 lives - 1P game code:c8b0/03/09 cheat description:F-16 Renegade - Start on level 3 code:c8b5/01/03+c8c2/00/01 cheat description:F-16 Renegade - Start on level 5 code:c8b5/01/05+c8c2/00/02 cheat description:F-16 Renegade - Start on level 7 code:c8b5/01/07+c8c2/00/03 cheat description:F-16 Renegade - Start on level 9 code:c8b5/01/09+c8c2/00/04 cheat description:C.J.'s Elephant Antics - Infinite lives code:e3c2/de/bd cheat description:C.J.'s Elephant Antics - Start in Switzerland code:f801/00/01 cheat description:C.J.'s Elephant Antics - Start in Egypt code:f801/00/02 cheat description:C.J.'s Elephant Antics - Start in Africa code:f801/00/03 cheat description:C.J.'s Elephant Antics - Always run fast after losing all lives code:f31d/00/01 cheat description:C.J.'s Elephant Antics - Super C.J. after losing all lives code:f31d/00/0f cheat description:C.J.'s Elephant Antics - Start with 1 life code:ee55/09/01 cheat description:C.J.'s Elephant Antics - Start with 5 lives code:ee55/09/05 cheat description:C.J.'s Elephant Antics - Start with 15 lives code:ee55/09/0f cheat description:C.J.'s Elephant Antics - Start with 20 lives code:ee55/09/14 cartridge sha256:d4f1650059a011455577561ea607993a5046d452ba987b1c7381cad56550be0a name:R.B.I. Baseball (USA) cheat description:Perfectly straight pitches - both players code:bad3/36/80+bad2/71/a9 cheat description:Super slow pitches - both players code:baac/36/00+baab/b1/a9 cheat description:Slow pitches - both players code:baac/36/03+baab/b1/a9 cheat description:Fast pitches - both players code:baab/b1/a9+baac/36/07 cheat description:Super fast pitches - both players code:baab/b1/a9+baac/36/0f cheat description:All missed pitches are strikes - both players code:bbe5/d0/10 cartridge sha256:3f9e3d3b48a897d94003df004ab4b332d749f85ea5d0e1a1b29b6d4f5634049a name:R.C. Pro-Am (USA) (Rev A) cheat description:Infinite continues code:d101/01/00 cheat description:Max turbo on first pick-up code:c1b0/01/04 cheat description:Max tires on first pick-up code:c1cc/01/04 cheat description:Max speed on first pick-up code:c165/01/04 cheat description:Double turbo on first pick-up code:c1b0/01/02 cheat description:Double tires on first pick-up code:c1cc/01/02 cheat description:Double speed on first pick-up code:c165/01/02 cheat description:Computer cars go crazy code:b2e4/40/ad cheat description:Always win as 1st place code:005c/00 cheat description:Auto race at 128 MPH (disable if you get stuck) code:05dc/80 cheat description:Max Super Sticky Tires code:0453/04 cheat description:Max Turbo Acceleration code:0454/04 cheat description:Max higher top speed code:0455/04 cheat description:Infinite ammo for weapons code:0459/63 cheat description:Have Bombs code:045a/01 cheat description:Have Missiles code:045a/02 cheat description:Have pick-up truck as vehicle code:03f9/00 cheat description:Have off-road vehicle as vehicle code:03f9/01 cheat description:Have race car as vehicle code:03f9/02 cheat description:NINTENDO already spelled out (enable then disable) code:03f7/08 cheat description:Computer cars go crazy (alt) code:b2e4/ad cartridge sha256:aec6beb5b7e4d291a2bef75cb6dc43dc4db34f0313d26a8582ddf61b5b6a67c5 name:R.C. Pro-Am (USA) cheat description:Infinite continues code:d853/01/00 cheat description:Max turbo on first pick-up code:c811/01/04 cheat description:Max tires on first pick-up code:c82d/01/04 cheat description:Max speed on first pick-up code:c7c6/01/04 cheat description:Double turbo on first pick-up code:c811/01/02 cheat description:Double tires on first pick-up code:c82d/01/02 cheat description:Double speed on first pick-up code:c7c6/01/02 cheat description:Computer cars go crazy code:b941/40/ad cheat description:Always win as 1st place code:005c/00 cheat description:Auto race at 128 MPH (disable if you get stuck) code:05dc/80 cheat description:Max Super Sticky Tires code:0453/04 cheat description:Max Turbo Acceleration code:0454/04 cheat description:Max higher top speed code:0455/04 cheat description:Infinite ammo for weapons code:0459/63 cheat description:Have Bombs code:045a/01 cheat description:Have Missiles code:045a/02 cheat description:Have pick-up truck as vehicle code:03f9/00 cheat description:Have off-road vehicle as vehicle code:03f9/01 cheat description:Have race car as vehicle code:03f9/02 cheat description:NINTENDO already spelled out (enable then disable) code:03f7/08 cheat description:Computer cars go crazy (alt) code:b2e4/ad cartridge sha256:730399227c1566636f2e3475c398924165b21d88fc3321f60b29f4e6321a3c9c name:R.C. Pro-Am II (USA) cheat description:Infinite credits code:828c/de/bd cheat description:Infinite Lazers on purchase code:e6cb/de/ad cheat description:Infinite Bombs on purchase code:e4d2/de/ad cheat description:Infinite Freezes on purchase code:e69c/de/ad cheat description:Infinite Buckshot on purchase code:e52c/de/ad cheat description:Infinite Missiles on purchase code:e556/de/ad cheat description:Items in the Model Shop are free if you have enough money code:a43f/a5/60 cheat description:Buckshot costs 10 instead of 2,000 code:e980/c8/01 cheat description:Mega Pulse costs 2,080 instead of 20,000 code:e98b/07/00 cheat description:Scoopers costs 2,200 instead of 15,000 code:e975/05/00 cheat description:Dynafit tires costs 2,320 instead of 10,000 code:e973/03/00 cheat description:Mega Motor costs 1,360 instead of 50,000 code:e96b/13/00 cheat description:Hyper Motor costs 1,840 instead of 30,000 code:e969/0b/00 cheat description:Freeze costs 2,200 instead of 15,000 code:e989/05/00 cheat description:Lazer costs 1,200 instead of 14,000 code:e987/05/00 cheat description:Bombs costs 1,760 instead of 12,000 code:e985/04/00 cheat description:Nobbies costs 1,880 instead of 7,000 code:e971/02/00 cheat description:Missile costs 2,320 instead of 10,000 code:e983/03/00 cheat description:Nitro costs 10 instead of 1000 code:e97c/64/01 cheat description:Oil slicks costs 10 instead of 500 code:e97a/32/01 cheat description:Skinny tires costs 10 instead of 2,000 code:e96e/c8/01 cheat description:Gold Motor costs 10 instead of 16,000 code:e967/06/00+e966/40/01 cheat description:Start with 1 credit instead of 3 code:90db/02/00 cheat description:Start with 5 credits code:90db/02/04 cheat description:Start with 7 credits code:90db/02/06 cheat description:Start with 9 credits code:90db/02/08 cheat description:Start on Track 02 code:ce97/00/01 cheat description:Start on Track 03 code:ce97/00/02 cheat description:Start on Track 04 code:ce97/00/03 cheat description:Start on Track 05 code:ce97/00/04 cheat description:Start on Track 06 code:ce97/00/05 cheat description:Start on Track 07 code:ce97/00/06 cheat description:Start on Track 08 code:ce97/00/07 cheat description:Start on Track 09 code:ce97/00/09 cheat description:Start on Track 10 code:ce97/00/0a cheat description:Start on Track 11 code:ce97/00/0b cheat description:Start on Track 12 code:ce97/00/0c cheat description:Start on Track 13 code:ce97/00/0d cheat description:Start on Track 14 code:ce97/00/0e cheat description:Start on Track 15 code:ce97/00/0f cheat description:Start on Track 16 code:ce97/00/10 cheat description:Start on Track 17 code:ce97/00/12 cheat description:Start on Track 18 code:ce97/00/13 cheat description:Start on Track 19 code:ce97/00/14 cheat description:Start on Track 20 code:ce97/00/15 cheat description:Start on Track 21 code:ce97/00/16 cheat description:Start on Track 22 code:ce97/00/17 cheat description:Start on Track 23 code:ce97/00/18 cheat description:Start on Track 24 code:ce97/00/19 cheat description:Start on Track 25 code:ce97/00/1b cheat description:Start on Track 26 code:ce97/00/1c cheat description:Start on Track 27 code:ce97/00/1d cheat description:Start on Track 28 code:ce97/00/1e cheat description:Start on Track 29 code:ce97/00/1f cheat description:Start on first Tug-O-Truck Challenge code:ce97/00/08 cheat description:Start on Drag Race code:ce97/00/11 cheat description:Start on second Tug-O-Truck Challenge code:ce97/00/1a cheat description:Infinite continues code:0771/09 cheat description:Infinite time at continue screen code:0431/63 cartridge sha256:5cb8d03a90732d01737a401e8dc87a3d594ab2f901970f309fe551c0013ac5da name:Race America (USA) cheat description:Can't down shift code:b35c/d6/c5 cheat description:Cars only have 4 gears code:b36d/07/05+a548/07/05 cheat description:Go super fast in 6th gear code:9078/f0/a9+9079/05/ff+9224/e6/85 cartridge sha256:2e14f4481b5b762ba1ff0e7a25b07f316f7bdef0574a1704856f92823874f4e6 name:Rad Racer (USA) cheat description:Infinite time code:de27/ff cheat description:Never crash from things outside of the road code:d54f/01/00 cheat description:Less time to finish each stage code:de23/2d/24 cheat description:More time to finish each stage code:de23/2d/3c cheat description:Turbo acceleration code:c520/00/30 cheat description:Super Turbo acceleration code:c53c/30/7f cheat description:Ultra Turbo acceleration code:c581/00/01 cheat description:Start on stage 2 code:c029/00/01+cec4/85/24 cheat description:Start on stage 3 code:c029/00/02+cec4/85/24 cheat description:Start on stage 4 code:c029/00/03+cec4/85/24 cheat description:Start on stage 5 code:c029/00/04+cec4/85/24 cheat description:Start on stage 6 code:c029/00/05+cec4/85/24 cheat description:Start on stage 7 code:c029/00/06+cec4/85/24 cheat description:Start on stage 8 code:c029/00/07+cec4/85/24 cheat description:Start on stage 2 (alt) code:00e5/01 cheat description:Start on stage 3 (alt) code:00e5/02 cheat description:Start on stage 4 (alt) code:00e5/03 cheat description:Start on stage 5 (alt) code:00e5/04 cheat description:Start on stage 6 (alt) code:00e5/05 cheat description:Start on stage 7 (alt) code:00e5/06 cheat description:Start on stage 8 (alt) code:00e5/07 cartridge sha256:bcc8a24ab99f85933ff2cd0787daab6093710ef04f95b4c7bec842961ee0e3ad name:Rad Racer II (USA) cheat description:Instant Boost code:005f/ff cheat description:Don't wipeout when you hit something code:005b/00 cartridge sha256:879ada5f1aa0282d81f9f13e91de53e181ed1030242029fcce002dfb8847c0c9 name:Radia Senki - Reimei Hen (Japan) cheat description:No random battles code:fab5/85/a5 cartridge sha256:5d9f7deb09c9de8725c293366c943e6fef0a505a72bb1bc92be7a7a055cde464 name:Raf World (Japan) cheat description:Invincibility code:ea0a/29/09+ea18/29/09 cheat description:Infinite energy code:ea3b/85/a5 cheat description:Infinite weapons code:8e33/85/a5 cheat description:Infinite lives code:c3f7/c6/c5 cheat description:Double-jump code:81cd/a9/60 cartridge sha256:d79be89ff83550ba185d19fb586d2b5f988ad6743125b5233ab3bfe2cb814c94 name:Raid 2020 (USA) (Unl) cheat description:Infinite health code:ddd8/ce/ad+dd4e/ce/ad cheat description:Infinite lives code:d6ed/ce/ad cartridge sha256:b7b5fdf2b31c4b8c5340f93f166fb56aecf598f7c43a24b4334502bb81065143 name:Raid on Bungeling Bay (USA) cheat description:Infinite Damage code:e5e9/20/ad cheat description:Infinite Bombs code:d5d0/ce/ad cheat description:Can only carry 5 Bombs code:d015/2c/28 cheat description:Start with 9 lives code:c7f2/05/09 cheat description:Start with 1 life code:c7f2/05/01 cheat description:Start on round 3 code:c7ee/01/03 cheat description:Start on round 6 code:c7ee/01/06 cheat description:Start on round 9 code:c7ee/01/09 cheat description:Infinite Bombs (alt) code:0254/2c cheat description:0 Damage code:024d/23+024e/23 cartridge sha256:9866b51b16b503aa515967929060eb100ae4cbd851229a3125ecf3ee7c88346e name:Rally Bike (USA) cheat description:Infinite gas code:c33b/ee/dd cheat description:Infinite lives - 1P game code:d406/ee/ad cheat description:Infinite lives - 2P game, both players code:d41d/fe/ad cheat description:Start with 1 life - 1P game code:de34/05/01 cheat description:Start with 10 lives - 1P game code:de34/05/0a cheat description:Start with 1 life - 2P game, both players code:dd34/06/01+d42e/06/02 cheat description:Start with 10 lives - 2P game, both players code:de34/05/0a+d42e/05/0b cartridge sha256:2596cf1e1a9b09dac24aeffea708807173ec81fa7093b2a729f1539aec3b5764 name:Rambo (USA) (Rev A) cheat description:Invincibility code:dd1a/b5/60 cheat description:Infinite weapons code:ec9a/de/ad cheat description:Gain double amount on pick-up code:e2a2/0a/14 cheat description:Gain maximum amount on pick-up code:e2a2/0a/74 cheat description:Hit anywhere code:d9ef/3a/00 cheat description:Start with 2 Medicine Bottles code:868d/05/02 cheat description:Start with 9 Medicine Bottles code:868d/05/62 cheat description:Start with Hand Grenades code:867d/11/15+8683/11/15 cheat description:Infinite health code:010c/64 cheat description:Max EXP code:010f/23 cheat description:Infinite Throwing Knives code:011d/99 cheat description:Infinite Missiles type 1 code:011e/99 cheat description:Infinite Missiles type 2 code:011f/99 cheat description:Infinite Machine Gun code:0120/99 cheat description:Infinite Grenades code:0121/99 cheat description:Infinite Red Potions code:0122/99 cartridge sha256:94e0d73bfaa7dca6d117d8d6f92637ace17816bb37807152baa8978396fe8d46 name:Rambo (USA) cheat description:Invincibility code:dd1a/b5/60 cheat description:Infinite weapons code:ec9a/de/ad cheat description:Gain double amount on pick-up code:e2a2/0a/14 cheat description:Gain maximum amount on pick-up code:e2a2/0a/74 cheat description:Hit anywhere code:d9ef/3a/00 cheat description:Start with 2 Medicine Bottles code:868d/05/02 cheat description:Start with 9 Medicine Bottles code:868d/05/62 cheat description:Start with hand grenades code:867d/11/15+8683/11/15 cheat description:Infinite health code:010c/64 cheat description:Max EXP code:010f/23 cheat description:Infinite Throwing Knives code:011d/99 cheat description:Infinite Missiles type 1 code:011e/99 cheat description:Infinite Missiles type 2 code:011f/99 cheat description:Infinite Machine Gun code:0120/99 cheat description:Infinite Grenades code:0121/99 cheat description:Infinite Red Potions code:0122/99 cartridge sha256:bbe150f50bd11f5aa4e3edab47541261c58ab9899b6d9329450b3c77df172823 name:Rampage (USA) cheat description:No harm from attacks or bad food code:b3a0/91/24 cheat description:No harm from falling code:b4a1/10/00 cheat description:No harm from water code:b919/01/00+b955/01/00 cheat description:Buildings collapse automatically code:e5b1/b0/50 cheat description:Buildings collapse faster code:a6d4/f0/50+aa93/0d/15 cheat description:One hit to destroy buildings code:a1cf/05/80 cheat description:More health - P1 code:c353/7f/ff cheat description:More health - P2 code:c36e/7f/ff cheat description:Less health - P1 code:c353/7f/3f cheat description:Less health - P2 code:c36e/7f/3f cheat description:More health after continue - both players code:cff4/7f/ff cheat description:Less health after continue - both players code:cff4/7f/3f cheat description:More damage done from falling code:b4a1/10/20 cheat description:Double health from food code:b3b3/05/04 cheat description:Half health from food code:b3b3/05/00+b3b6/0a/4a cartridge sha256:501e921616931e4796c44b1e80c7112c881eb1e9a3190d0e6a3b4b199ee368e3 name:Ren & Stimpy Show, The - Buckeroo$! (USA) cheat description:Infinite health code:fb12/07/ff cheat description:Infinite lives code:ea39/06/ff cheat description:Infinite collectibles code:8a82/99/b9 cheat description:Shorter invincibility after getting hit code:fb01/3c/1f cheat description:Longer invincibility after getting hit code:fb01/3c/65 cheat description:2 custard pies on pick-up code:f229/05/02 cheat description:9 custard pies on pick-up code:f229/05/09 cheat description:Start with $11 instead of 0 code:85ab/9d/fe cheat description:Start with 2 lives code:82b1/03/01 cheat description:Start with 6 lives code:82b1/03/05 cheat description:Start with 8 lives code:82b1/03/07 cheat description:Start with 10 lives code:82b1/03/09 cheat description:Start on Rescue the Maiden level code:8709/d0/a9+870a/22/01 cheat description:Start on Out West level code:8709/d0/a9+870a/22/01+870b/ee/8d cheat description:Start on Robin Hoek level code:8709/d0/a9+870a/22/02+870b/ee/8d cartridge sha256:b4856061c9310015101c461aef744e9dcf3b158bd13d5d9cb4a76d3ca18a6864 name:Renegade (USA) cheat description:Infinite lives code:deb1/c6/a5 cheat description:Timer runs faster code:ead9/3e/1e cheat description:Timer runs slower code:ead9/3e/a0 cheat description:Start with a super energy boost code:933a/28/50 cheat description:Start with 1 life - both players code:d79b/02/00 cheat description:Start with 6 lives - both players code:d79b/02/05 cheat description:Start with 9 lives - both players code:d79b/02/08 cheat description:Start on mission 2 code:d7af/00/01 cheat description:Start on mission 3 code:d7af/00/02 cheat description:Start on mission 4 code:d7af/00/03 cheat description:Infinite time code:0472/59 cheat description:Enemies have no health code:007e/00+007f/00+0080/00 cartridge sha256:f17df83a3e714c9f839dcd428d31a0b8b3cdb5fe1a78f24f43f158cb379720c1 name:Ring King (USA) cheat description:Infinite power points - 1P game code:d601/ce/2c cheat description:Don't lose stamina from fighting code:afc2/91/24 cheat description:Rounds are 30 seconds code:d79b/06/03 cheat description:Rounds are 90 seconds code:d79b/06/09 cheat description:Players can't hurt each other code:ad91/91/24 cheat description:No health - P2 / CPU code:0319/00 cheat description:Infinite power (ten's digit) - P1 code:038d/09 cheat description:Infinite power (one's digit) - P1 code:038e/09 cheat description:Infinite time (ten's digit) code:06e4/09 cheat description:Infinite time (one's digit) code:06e5/09 cheat description:Max punch (ten's digit) - P1 code:038f/09 cheat description:Max punch (one's digit) - P1 code:0390/09 cheat description:Max speed (ten's digit) - P1 code:0391/09 cheat description:Max speed (one's digit) - P1 code:0392/09 cheat description:Max stamina (ten's digit) - P1 code:0393/09 cheat description:Max stamina (one's digit) - P1 code:0394/09 cheat description:No hits (hundred's digit) - P1 code:06ec/00 cheat description:No hits (ten's digit) - P1 code:06ed/00 cheat description:No hits (one's digit) - P1 code:06ee/00 cartridge sha256:54cdc8b6fab804339c44601663585c8e7a8b01ef35b49754eb13a767b57c7d07 name:River City Ransom (USA) cheat description:Infinite lives code:8cfb/9d/bd cheat description:Start with max stats code:f6d8/0f/63 cheat description:Infinite money code:9ac9/9d/bd+9ad0/9d/bd+9ad7/9d/bd cheat description:Coins worth max amount of money code:ec22/13/23 cheat description:Infinite Stamina code:bb86/b9/99+bbee/e9/a9 cheat description:Infinite Will Power code:af1f/9d/bd cheat description:Max Punch code:936d/3f/7f cheat description:Max Kick code:936e/3f/7f cheat description:Max Weapon code:936f/3f/7f cheat description:Max Throw code:9370/3f/7f cheat description:Max Agility code:9371/3f/7f cheat description:Max Defense code:9372/3f/7f cheat description:Max Strength code:9373/3f/7f cheat description:Max Will Power code:9374/3f/7f cheat description:Max Stamina code:9376/7f/ff cheat description:View the credits code:f2e2/d0/f0 cheat description:Start with double every attribute code:f6d8/0f/1e cheat description:Start with 127 of all stats code:f6d8/0f/7f cheat description:Start with 99 Stamina code:f6f5/3f/63 cheat description:Start with double money - P1 code:f708/20/40 cheat description:Start with double money - P2 code:f717/20/40 cheat description:Start with $100 extra - P1 code:f70d/00/01 cheat description:Start with $100 extra - P2 code:f71c/00/01 cartridge sha256:46361c5b4007e6ef855430934b5a205aa19c885857a7eb31072646753d06e321 name:RoadBlasters (USA) cheat description:Infinite credits code:d004/ce/ad cheat description:Double credits code:be63/02/04 cheat description:Extend lifetime of UZ Cannon code:8d80/05/09 cheat description:Extend lifetime of Nitro Injector code:8dd9/80/ff cheat description:Reduce lifetime of Nitro Injector code:8dd9/80/40 cheat description:Infinite Cruise missiles code:8dec/ce/ad+8d1f/1e/e0 cheat description:Infinite UZ Cannon code:8d78/a5/60+8d1f/1e/2b cheat description:Infinite Nitro Injectors code:8ddc/ce/60+8d1f/1e/8d+8dc9/f0/24 cheat description:Infinite Electro Shield code:8e5c/ce/ad+8d1f/1e/51+8d20/8d/8e cheat description:Infinite Fuel code:0085/cf cheat description:Infinite Reserve Fuel code:0086/6d cheat description:Max speed code:009a/ff cartridge sha256:46a38baf9067869e8ecdf227c3cd33f14df20998d0d27e645e47f6c57fd9703d name:Road Runner (USA) (Unl) cheat description:Infinite lives code:eb1b/ce/ad cheat description:Never lose seed code:c1b0/c8/ea+eba5/c8/ea cheat description:Start with 1 life code:e40e/05/00 cheat description:Start with 12 lives code:e40e/05/0b cheat description:Start with 18 lives code:e40e/05/11 cheat description:Start on level 5 code:e413/01/05 cheat description:Start on level 10 code:e413/01/0a cheat description:Start on level 15 code:e413/01/0f cheat description:Start on level 20 code:e413/01/14 cheat description:Start on level 25 code:e413/01/19 cheat description:Start on level 30 code:e413/01/1e cartridge sha256:687e4129be3b8e224a9748cba9687b8c10e5feb234a727bdf2dcb8d3c8c47097 name:Robin Hood - Prince of Thieves (USA) (Rev A) cheat description:Infinite HP for Robin in main combat code:8b29/85/86 cheat description:Infinite HP for Robin in dueling combat code:8921/30/f0 cheat description:Infinite Arrows code:9255/01/00 cheat description:Bandages give more HP back code:b7a3/08/14 cheat description:Food gives more HP back - Except the Leg of meat code:b3b5/08/18 cheat description:Infinite Arrows (alt) code:0179/ff cheat description:Max Exp points code:0604/ff cheat description:Max Level code:0176/ff cheat description:Max Attack code:0170/ff+0171/ff cheat description:Max Agility code:016e/ff+016f/ff cheat description:Max Defense code:0172/ff cheat description:Max Gold code:0177/ff cheat description:Load zero code:016c/00 cartridge sha256:bb0ed60fd8e83b56f23de16018696817cf8030b4898db6abe9dfc343e646e753 name:Robin Hood - Prince of Thieves (USA) cheat description:Infinite HP for Robin in main combat code:8b29/85/86 cheat description:Infinite HP for Robin in dueling combat code:8921/30/f0 cheat description:Infinite Arrows code:9255/01/00 cheat description:Bandages give more HP back code:b7a3/08/14 cheat description:Food gives more HP back - Except the Leg of meat code:b3b5/08/18 cheat description:Infinite Arrows (alt) code:0179/ff cheat description:Max Exp points code:0604/ff cheat description:Max Level code:0176/ff cheat description:Max Attack code:0170/ff+0171/ff cheat description:Max Agility code:016e/ff+016f/ff cheat description:Max Defense code:0172/ff cheat description:Max Gold code:0177/ff cheat description:Load zero code:016c/00 cartridge sha256:5431ed49f22ee8188871be088da433c26b1ddeac972ef4b8f89df4eacd5e42c2 name:Robo Warrior (USA) cheat description:No damage from bomb blast code:f23f/4e/2c cheat description:No damage from monsters and no power drain code:f27d/4e/2c cheat description:Infinite Barrier after pick-up code:c924/e6/ea cheat description:Infinite Mega Bombs after pick-up code:ddaf/d6/b5 cheat description:Infinite Super Bombs code:e147/c6/a5 cheat description:Walk through walls code:cbf0/10/90 cheat description:5 Super Bombs on pick-up code:e561/0a/05 cheat description:20 Super Bombs on pick-up code:e561/0a/14 cheat description:Set firing range to 5 code:c170/01/05 cheat description:Set firing range to 10 code:c170/01/0a cheat description:Start with 5 of everything code:c1eb/00/05 cheat description:Start with 10 of everything code:c1eb/00/0a cheat description:Start with defense level at 5 code:c1e5/01/05 cheat description:Start with defense level at 8 code:c1e5/01/08 cheat description:Always have 99 Medals code:0058/63 cheat description:Always have 99 Super Boots code:0061/63 cheat description:Always have 99 Clocks code:0062/63 cheat description:Always have 99 Flash code:0063/63 cheat description:Always have 99 CrossFires code:0064/63 cheat description:Always have 99 Candles code:0065/63 cheat description:Always have 99 Energy Capsule code:0066/63 cheat description:Always have 99 Missles code:0067/63 cheat description:Always have 99 Megaton Bombs code:004d/63 cheat description:Always have 99 Life Vest code:004e/63 cheat description:Always have 99 Lanterns code:004f/63 cartridge sha256:100c394264b40c17f635a6356c884135558bf2aee1a7f60c9ce43441e48a06cb name:Robocco Wars (Japan) cheat description:Start on level 5 code:a831/00/3c cartridge sha256:d04b445ac57cccb3a31a3bf83d002dc9a9765f15313e96f67be077b6114d2411 name:RoboCop (USA) cheat description:Invincibility code:e276/35/3b+b62f/20/bd cheat description:Infinite time code:a5cf/e6/a5 cheat description:Infinite ammunition code:eb14/05/c5 cheat description:No damage from touching enemies code:ee49/85/a5 cheat description:No damage from enemy bullets code:ef6e/85/a5 cheat description:Bosses die automatically code:a29d/3b/00 cheat description:Can't harm civilian at the end of level 1 code:a7c3/bd/9d cheat description:Triple normal power on power food pick-up code:fd17/03/09 cheat description:Triple normal time on battery pick-up code:fd28/03/09 cheat description:Max time on battery pick-up code:fd28/03/16 cheat description:Full power on power food pick-up code:fd17/03/16 cheat description:Use with COP Code 2 to start with machine gun and Cobra gun code:d128/01/0f cheat description:Press Start to finish the level (may cause graphical glitches in later levels) code:d224/0e/0f cheat description:Start on level 2 code:d10a/00/01+d10b/95/85+d10c/85/66 cheat description:Start on level 3 code:d10a/00/02+d10b/95/85+d10c/85/66 cheat description:Start on level 4 code:d10a/00/03+d10b/95/85+d10c/85/66 cheat description:Start on level 5 code:d10a/00/04+d10b/95/85+d10c/85/66 cheat description:Start on level 6 code:d10a/00/05+d10b/95/85+d10c/85/66 cheat description:Infinite health code:006e/00 cheat description:Infinite time (alt) code:0082/00 cartridge sha256:8ed3cb0046caecbefdc6c6b3ad8dae013442136f6a65c1a21b54586b0275e615 name:RoboCop 2 (USA) (Rev A) cheat description:Invincibility code:8feb/d0/f0 cheat description:Infinite health code:e7c1/99/60 cheat description:Infinite lives code:c17d/d6/d5 cheat description:Infinite time code:e704/c6/c5+e6fc/c6/c5 cheat description:No enemies code:8b72/f0/d0 cheat description:Each N (Nuke) is worth 10 code:e80c/03/00 cheat description:Infinite health (alt) code:0054/09+0055/09 cheat description:Infinite lives (alt) code:0058/04 cheat description:Infinite time (alt) code:0091/ff cheat description:Infinite N code:0052/09+0053/09 cartridge sha256:b65361b45eef137a57152dd8f64531c26e34d728e72800d1bdf8e4be9bff49e7 name:RoboCop 2 (USA) cheat description:Invincibility code:8feb/d0/f0 cheat description:Infinite lives code:c17d/d6/d5 cheat description:No enemies code:8b72/f0/d0 cheat description:Infinite health code:0054/09+0055/09 cheat description:Infinite lives (alt) code:0058/04 cheat description:Infinite time code:0091/ff cheat description:Infinite N code:0052/09+0053/09 cartridge sha256:a0f18e729a7ee6be9035e9691f4bac32c1b202afcb44100479a431055b15eee6 name:RoboCop 3 (USA) cheat description:Infinite efficiency code:f19b/e5/a9+f19c/e2/19 cheat description:Infinite efficiency (alt) code:f1a1/9d/b9 cheat description:One hit kills code:f0b8/fc/7c cheat description:Hit anywhere code:f088/eb/00 cheat description:Lots of repair icons code:c0c3/06/ee cheat description:Start with 2x health code:c265/19/32 cheat description:Start with 1/2 health code:c265/19/0c cheat description:Infinite P code:06a4/09 cheat description:Have main weapon - regular code:001c/00 cheat description:Have main weapon - Rapid code:001c/01 cheat description:have main weapon - 3-Way code:001c/02 cheat description:have secondary weapon - Missiles code:001d/00 cheat description:Have secondary weapon - Homing Missiles code:001d/01 cheat description:Have secondary weapon - Bang code:001d/02 cartridge sha256:92b1bde12ac860a385416b92529c15d149db54e53a56bd2a82ab97f517e67f86 name:RoboCop versus The Terminator (USA) (Proto) cheat description:Infinite lives code:d442/8d/ad cheat description:Infinite health code:e10c/8d/ad cheat description:Infinite health (alt) code:04ee/0a cartridge sha256:d0e5899cf6b756d697be9ad6700d1f612b1604496374da9606478d5cdbceebf1 name:Robodemons (USA) (Unl) cheat description:Infinite health code:051b/14 cartridge sha256:e1a3d949b9bf258b4d2c92104cedd7957a311f142dc2cb32eb92ce559837377f name:Rocketeer, The (USA) cheat description:Infinite health code:d75d/ed/2c cheat description:Have all weapons with infinite ammo code:bd64/05/00 cheat description:1/2 normal bullets on pick-up code:a212/0a/05 cheat description:2x normal bullets on pick-up code:a212/0a/14 cheat description:3x normal bullets on pick-up code:a212/0a/1e cheat description:1/2 silver bullets on pick-up code:a204/14/0a cheat description:2x silver bullets on pick-up code:a204/14/28 cheat description:3x silver bullets on pick-up code:a204/14/3c cheat description:Start with 1/2 health code:bcd7/08/04 cheat description:Start with 2x health code:bcd7/08/10 cheat description:Start with 3x health code:bcd7/08/18 cheat description:Infinite health (alt) code:05c5/0a cheat description:Infinite Rocket power code:05b0/27 cheat description:Have all weapons with infinite ammo (alt) code:05bf/63 cartridge sha256:a0d60fe16b09d2018e32c277f8a297adc71acdd9e851591625b2d460e96266c8 name:Rocket Ranger (USA) cheat description:Double amount of Lunarium in storage code:cf95/01/02 cheat description:Triple amount of Lunarium in storage code:cf95/01/03 cheat description:Lunarium level in backpack at 99 code:cf9a/3c/63 cheat description:Never lose Lunarium in backpack code:c351/8d/ad cheat description:Half amount of Lunarium in storage code:cf95/01/00+cf9f/00/32 cartridge sha256:683c49e4ea3f4b179065deccecd3e4a86a4e355e13924872571e7b7c79205d0c name:Rockin' Kats (USA) cheat description:Invincibility code:e628/f0/d0 cheat description:Infinite health code:e6ca/8d/ad cheat description:Infinite lives code:cd99/ce/cd cheat description:Hit anywhere code:e6f6/16/00 cheat description:Can select any item (you will not be able to see it) code:829f/d1/00 cheat description:Can always select channel 5 code:8ba8/10/00 cheat description:Can always buy items code:8f89/a5/a9 cheat description:Infinite health (alt) code:0423/0a cheat description:Infinite lives (alt) code:041f/09 cheat description:Have all items code:0105/0f cheat description:Infinite high cash code:0104/0e cheat description:Channels 1-4 completed code:0102/ff cartridge sha256:2bd31df34f925d030ceceb944c1ac973ccf892358de75c35fd77d61372d23a3b name:Rock 'n' Ball (USA) cheat description:Infinite balls code:a07f/de/bd cartridge sha256:9fdbaa2877363948b466a6e3e11a1bce02d2a6490cb90808be4d788fe4630eba name:Rod Land (Europe) cheat description:Infinite lives code:9911/5e/bd cheat description:Infinite time in extra game code:e490/c6/a5 cheat description:Start with invincibility code:dbe8/f0/d0 cheat description:Start on scene 31 code:c5df/00/1e cartridge sha256:1a35607e218d68106367e7b87735aa9f10bf330c3a71f607a21de2d7fc763ef8 name:Roger Clemens' MVP Baseball (USA) cheat description:Infinite balls (balls are not called) code:d3f0/00/91 cheat description:Infinite balls and strikes code:8173/f6/b5 cheat description:Strikes are not called when batter doesn't swing code:d3eb/01/91 cheat description:Strikes are not called when batter swings code:8170/02/04 cheat description:2 strikes and you're out code:8178/03/02+b19f/03/02+c1ec/03/02 cheat description:1 strike and you're out code:8178/03/01+b19f/03/01+c1ec/03/01 cheat description:1 ball for a walk code:c1fb/04/01 cheat description:2 balls for a walk code:c1fb/04/02 cheat description:3 balls for walk code:c1fb/04/03 cartridge sha256:942c802c34627c969c49dae94fb8b48c7b1e873a65803caad559324e2a54b4c8 name:Rollerblade Racer (USA) cheat description:Infinite lives code:d7e8/c6/a9 cheat description:1 fall and you're dead code:d7e1/04/01 cheat description:6 falls and you're dead code:d7e1/04/06 cheat description:8 falls and you're dead code:d7e1/04/08 cheat description:Start on the City Street code:ca3f/00/02 cheat description:Start with 1 life code:ca3b/03/01 cheat description:Start with 6 lives code:ca3b/03/06 cheat description:Start with 9 lives code:ca3b/03/09 cheat description:Start on Hit the Beach code:ca3f/00/04 cheat description:Start on Panic Park code:ca3f/00/06 cartridge sha256:7ddc56bf2b8d8f3f980837bbc48284fd7241e111a9f51599c6e358518d3469dc name:Rollergames (USA) cheat description:Infinite lives code:f788/c6/a5 cheat description:Infinite special moves code:92e0/c6/24 cheat description:9 special moves code:8052/03/09 cheat description:6 special moves code:8052/03/06 cheat description:Mega-jump code:8440/00/09 cheat description:Infinite time code:8d1f/85/24 cheat description:Faster timer code:8d13/3f/1f cheat description:Slower timer code:8d13/3f/7f cheat description:Start with less energy code:8056/0c/06 cheat description:Start with more energy code:8056/0c/18 cheat description:Infinite health code:04ce/0c cheat description:Infinite lives (alt) code:0082/10 cheat description:Infinite time (alt) code:0032/03 cartridge sha256:e91bb35c7a95388c06f978c6cee73b1169fa7ec66b1808de5f504dcfefafbaab name:Rolling Thunder (USA) (Unl) cheat description:Infinite health code:a654/8d/ad cheat description:Infinite lives code:eb73/c6/a5+eb53/c6/a5 cheat description:Infinite time code:e20f/c6/a5 cheat description:Hit anywhere code:a7d0/b8/40+d733/d0/60+a7d1/a8/a9 cheat description:200 Machine Gun bullets on pick-up code:e8d0/64/c8 cheat description:300 Machine Gun bullets and 300 bullets on pick-up code:a291/de/bd cheat description:Gain fewer bullets on pick-up code:e8cf/32/14 cheat description:Self-replenishing bullets code:d766/01/32 cheat description:Start with 200 bullets code:e0aa/32/c8 cheat description:Start with 200 bullets on each new life code:eb4c/32/c8 cheat description:Start with loads of ammunition code:e0a2/00/03+eb44/00/03 cheat description:Start with 1 life code:e09b/03/01 cheat description:Start with 6 lives code:e09b/03/06 cheat description:Start with 9 lives code:e09b/03/09 cheat description:Start with 1 life after continue code:9257/03/01 cheat description:Start with 6 lives after continue code:9257/03/06 cheat description:Start with 9 lives after continue code:9257/03/09 cheat description:Start with increased life meter code:e88d/02/08 cheat description:Start on story 1 area 02 code:8f6b/00/01+8f6d/b1/30 cheat description:Start on story 1 area 03 code:8f6b/00/02+8f6d/b1/30 cheat description:Start on story 1 area 04 code:8f6b/00/03+8f6d/b1/30 cheat description:Start on story 1 area 05 code:8f6b/00/04+8f6d/b1/30 cheat description:Start on story 2 area 06 code:8f6b/00/05+8f6d/b1/30 cheat description:Start on story 2 area 07 code:8f6b/00/06+8f6d/b1/30 cheat description:Start on story 2 area 08 code:8f6b/00/07+8f6d/b1/30 cheat description:Start on story 2 area 09 code:8f6b/00/08+8f6d/b1/30 cheat description:Start on story 2 area 10 code:8f6b/00/09+8f6d/b1/30 cheat description:Start on story 3 area 01 code:8dca/00/01 cheat description:Infinite health (not versus bullets) code:0089/02 cheat description:Infinite bullets code:00a0/32 cheat description:Infinite time (alt) code:059b/09+059c/09+059d/09 cheat description:Infinite lives (alt) code:05bc/09 cartridge sha256:644291444ae16a02a128c613fa4e10559a45e4740e3614fb57b73b8c736bdbef name:Roundball - 2-on-2 Challenge (USA) cheat description:Start with 1 ball - all players code:c175/03/01 cheat description:Infinite balls - all players code:c241/de/ad cartridge sha256:fade44d9c76173afe098fbe02d859735e06b2c509fd80da08b1cc85bfc01a556 name:Rush'n Attack (USA) cheat description:Invincibility (star effect) code:8724/05/84+872f/05/84 cheat description:Invincibility (except vs bullets) code:8131/d0/50 cheat description:Infinite POW code:8df5/01/00 cheat description:Always have 255 POW code:df6f/ad/8d cheat description:Hit anywhere code:82cb/b0/50+8520/b0/4c+82cc/6b/3b+8522/b9/85+8521/5c/37 cheat description:Infinite lives - P1 code:8718/c6/24 cheat description:Infinite lives - P2 code:871d/c6/24 cheat description:Multi-jump code:af33/ff/08+af3c/ff/60+87d3/f1/30+af39/ff/20+af36/ff/20+af34/ff/f0+af37/ff/f8+af31/ff/04+af35/ff/03+87d4/8b/af+af38/ff/89+af3a/ff/f1+af32/ff/29+af30/ff/a5+af3b/ff/8b cheat description:Start with 1 life - P1 code:d16e/05/01 cheat description:Start with 1 life - P2 code:d176/05/01 cheat description:Start with 10 lives - P1 code:d16e/05/0a cheat description:Start with 10 lives - P2 code:d176/05/0a cheat description:Start on stage 2 (disable when stage begins) code:0020/01 cheat description:Start on stage 3 (disable when stage begins) code:0020/02 cheat description:Start on stage 4 (disable when stage begins) code:0020/03 cheat description:Start on stage 5 (disable when stage begins) code:0020/04 cheat description:Start on stage 6 (disable when stage begins) code:0020/05 cartridge sha256:9bef1813dbcfa003b3b1978a66a8da3ff59c93dd74f1332801515aa4b633c51e name:Rygar (USA) (Rev A) cheat description:Invincibility code:ae01/84/60 cheat description:Infinite health code:aeb2/85/a5 cheat description:Infinite Mind points code:822a/00 cheat description:Have first three items after pressing B once code:a3c1/25/05 cheat description:Hit anywhere code:ad1c/b0/30+ad33/b0/30+ad22/b0/30+ad39/b0/f0 cheat description:One hit kills code:afae/85/11 cheat description:Pits aren't fatal (side view) code:a013/08/00 cheat description:Walk on water (side view) code:9cdd/d0/50 cheat description:Enemies always drop a health potion code:b557/b0/90+b57f/07/03+b57e/29/a9 cheat description:Enemies always drop a Mind unit code:b557/b0/90+b57f/07/04+b57e/29/a9 cheat description:Don't be pushed after being hit code:ae9e/05/60 cheat description:Jump higher code:966b/04/03 cheat description:Multi-jump code:ad4d/f0/10+a016/a9/60+ad4a/04/28+ad51/05/04+ad4b/29/25+ad4f/ad/8d+ad49/92/a5+ad50/32/c2+ad48/ad/ea+ad4c/20/2a cheat description:Grappling Hook continues until it finds something code:9931/ce/ad+a22c/85/a5 cheat description:Start with 12 units of health code:c0b1/06/18+c0b2/06/18 cheat description:Infinite Attack & Assail code:00cd/ff cheat description:Have all equipment code:00c0/ff+00c1/ff cheat description:Always have Power Up code:00c0/10 cheat description:Lots of Tone code:00c7/ff cheat description:Lots of Last code:00c8/ff cartridge sha256:e3a7e0b559b18e8e2fd6f2bf0fdadbf9094be63a01bac50e5505413e1d7697a4 name:Rygar (USA) cheat description:Invincibility code:ae01/84/60 cheat description:Infinite health code:aeb2/85/a5 cheat description:Infinite Mind points code:822a/00 cheat description:Have first three items after pressing B once code:a3c1/25/05 cheat description:Hit anywhere code:ad1c/b0/30+ad33/b0/30+ad22/b0/30+ad39/b0/f0 cheat description:One hit kills code:afae/85/11 cheat description:Pits aren't fatal (side view) code:a013/08/00 cheat description:Walk on water (side view) code:9cdd/d0/50 cheat description:Enemies always drop a health potion code:b557/b0/90+b57f/07/03+b57e/29/a9 cheat description:Enemies always drop a Mind unit code:b557/b0/90+b57f/07/04+b57e/29/a9 cheat description:Don't be pushed after being hit code:ae9e/05/60 cheat description:Jump higher code:966b/04/03 cheat description:Multi-jump code:ad4d/f0/10+a016/a9/60+ad4a/04/28+ad51/05/04+ad4b/29/25+ad4f/ad/8d+ad49/92/a5+ad50/32/c2+ad48/ad/ea+ad4c/20/2a cheat description:Grappling Hook continues until it finds something code:9931/ce/ad+a22c/85/a5 cheat description:Start with 12 units of health code:c0b1/06/18+c0b2/06/18 cheat description:Infinite Attack & Assail code:00cd/ff cheat description:Have all equipment code:00c0/ff+00c1/ff cheat description:Always have Power Up code:00c0/10 cheat description:Lots of Tone code:00c7/ff cheat description:Lots of Last code:00c8/ff cartridge sha256:9579a2b5a4083420d9bc3788cae39b068c0752ac68e7b7dc1be1d748cb2b7133 name:S.C.A.T. - Special Cybernetic Attack Team (USA) cheat description:Infinite health code:dc7b/01/00 cheat description:More energy on pick-up code:ec7f/03/0a cheat description:Don't lose speed-ups when hit code:dc8e/08/00 cheat description:Longer immunity code:dc84/40/ff cheat description:Shorter immunity code:dc48/40/10 cheat description:Faster maximum speed-up code:de04/06/09+de05/fa/f7 cheat description:Faster normal speed-up code:ddf4/04/06+ddf5/fc/fa cheat description:Start with more health code:cea4/06/32 cheat description:Infinite health - P1 code:001c/09 cartridge sha256:4d6e58f232dc1a592583889f858eac230b8e8921e715276e580073ab2dd18546 name:Saint Seiya - Ougon Densetsu (Japan) cheat description:Fly code:008b/c8 cheat description:Infinite health (damage) code:0689/40+068a/40 cheat description:Infinite Cosmos code:0685/40+0686/40 cartridge sha256:3ad57c83631233530bb421b14236fdba70d18f70ce46a8410ec7c2f156b559ab name:Saint Seiya - Ougon Densetsu Kanketsu Hen (Japan) cheat description:Start with infinite health (life) code:0063/40+0040/40 cheat description:Start with infinite Cosmos code:0059/40+005a/40 cheat description:Infinite Seven Sense code:05aa/40+05ab/40 cartridge sha256:9e8eb95ec2917597650131db254067ff59bc3669417563165518927357812c73 name:Salamander (Japan) cheat description:Invincibility code:0074/20 cheat description:Infinite lives code:0034/09 cheat description:Option always on Speed code:0068/01 cheat description:Option always on Missile code:0068/02 cheat description:Option always on Ripple code:0068/03 cheat description:Option always on Laser code:0068/04 cheat description:Option always on Option code:0068/05 cheat description:Option always on Force code:0068/06 cheat description:Start with and keep Missiles code:0076/02 cartridge sha256:7ee2b81ef8ab8e9c009ecd42ed5fa5a34e3e48896c3567fac1ca7520c1de870e name:Secret Scout in the Temple of Demise (USA) (Unl) cheat description:Infinite lives code:e4a7/99/b9 cheat description:View the ending code:d5e7/00/58 cartridge sha256:c33611fb6b3ced6cf0ab4cd8e6795be44dc164efd453a69bad404c95837ec420 name:Secret Ties (USA) (Proto) cheat description:Invincibility code:c8fb/cc/cd cheat description:Infinite health code:c960/85/a5 cheat description:Infinite lives code:faec/c6/c5 cheat description:Infinite Gun code:c763/c6/a5 cheat description:Infinite Shield code:c91d/c6/a5 cheat description:Super-jump code:c5f0/05/1f+c4e7/06/20 cheat description:Allways able to use Gun code:ef22/d0/50 cheat description:Allways able to use Shield code:ef1c/d0/50 cheat description:Start with 99 lives code:e1e0/03/64 cheat description:Start with double health code:e1f9/05/0a cheat description:Invincibility (alt) code:03cc/00 cheat description:Infinite health (alt) code:0009/07 cheat description:Infinite Gun (alt) code:000a/63 cheat description:Infinite Shield (alt) code:000b/63 cartridge sha256:a98e48a26c104375ae45e5c1bc4eb7b2a446e0e9ffa7ed3923c3cf5eec9a549a name:Section-Z (USA) cheat description:Infinite lives code:9d93/c6/a5 cheat description:Energy tube gives full energy boost code:fa3b/00/0a cheat description:Autofiring capability code:9efb/f5/f7 cheat description:Autofire without having to hold the button down code:9efb/f5/ff cheat description:Press Start to complete current mission (do not use past sector 40) code:d395/07/00+d391/49/a9+d394/fd/39+d392/01/02 cheat description:Start a new game to view the ending code:8702/01/03 cheat description:Start with 1 life code:d2ad/03/01 cheat description:Start with 6 lives code:d2ad/03/06 cheat description:Start with 9 lives code:d2ad/03/09 cheat description:Infinite energy code:005b/09+005a/09 cartridge sha256:afc7ce7262cc03039481b9338a94db35a1f4e9e54ee3dd34f979a7921d4a5e29 name:Seicross (USA) cheat description:Infinite lives code:8ae8/bd cheat description:Slow motion code:8ccb/01 cheat description:Start with 1 life code:80b4/01 cheat description:Start with 6 lives code:80b4/06 cheat description:Start with 9 lives code:80b4/09 cheat description:Infinite health - P1 code:0078/bd cheat description:Infinite lives - P1 code:0615/99 cartridge sha256:2395a8a102bfc403bb2c474f77035483792ec15bce37695c9f2d96d62bc8fe10 name:Shadow of the Ninja (USA) cheat description:Infinite continues code:f55d/c6/a5 cheat description:9 continues code:e08a/05/09 cheat description:1 continue code:e08a/05/01 cheat description:Don't lose energy from enemy attacks code:ac6d/9d/2c cheat description:Don't lose energy from falling code:9564/04/00 cheat description:Maximum energy gained from potion code:8c19/04/10 cheat description:Less energy gained from potion code:8c19/04/01 cheat description:40 Throwing Stars on pick-up code:8c31/14/28 cheat description:20 Bombs on pick-up code:8c46/05/14 cartridge sha256:fbc69cdaf7c1419906d8cf2a74ab70d11520b2f3877387b8fd70460b6e6dd542 name:Shadowgate (USA) cheat description:Infinite torches code:d78a/ce/ea cartridge sha256:c3f361c4a1441101d6a3eb42f5776073c712198e7ed45d6ab5350816ea15aee4 name:Shatterhand (USA) cheat description:Hit anywhere code:8519/b0/50+84f3/b0/24+84ff/90/24+84db/90/24 cheat description:Power-ups don't use up gold code:c94d/01/00 cheat description:Big coins worth double code:82a2/14/28 cheat description:Big coins worth half code:82a2/14/0a cheat description:Small coins worth triple code:8287/05/0f cheat description:Start with less health code:f5fa/08/04 cheat description:Start with 1 life code:f5e8/02/00 cheat description:Start with 6 lives code:f5e8/02/05 cheat description:Start with 9 lives code:f5e8/02/08 cheat description:Invincibility - Robot Suit code:05c2/7e cheat description:Powered up - Red Vest code:05c8/03 cartridge sha256:2b85e6411f42597ceab01f5eb3ba9fd362b07340c0665fd533a3c3d5f2b1e972 name:Shinobi (USA) (Unl) cheat description:Infinite life code:d771/ce/ad cheat description:Infinite lives code:920b/ce/ad cheat description:Turbo running code:9dcf/03/05 cheat description:Start with double life code:902e/06/0c+91f4/06/0c cheat description:Start with 1 life code:907b/02/00 cheat description:Start with 6 lives code:907b/02/05 cheat description:Start with 9 lives code:907b/02/08 cartridge sha256:0df6a7a16af6cffc9a54a3de1ab14225f2ce5d5a269a691f16a22d3fd42b942b name:Shinsenden (Japan) cheat description:No random battles code:b029/30/60 cartridge sha256:6c705f7980a08b7a7a5d74ddfd175155492168248f65c7d9e3cef1a6b14a2886 name:Shooting Range (USA) cheat description:Double bonus time for hourglasses code:9801/32/64 cheat description:Half bonus time for hourglasses code:9801/32/19 cheat description:More time for level 1 code:83c5/03/04+860e/03/04 cheat description:Less time for level 1 code:83c5/03/02+860e/03/02 cheat description:More time for level 2 code:8610/02/04+8611/32/00 cheat description:Less time for level 2 code:8610/02/01+8611/32/32 cheat description:More time for level 3 code:8612/02/04+8613/00/32 cheat description:Less time for level 3 code:8612/02/01+8613/00/00 cheat description:Double usual shots per round code:86b5/28/50+9aae/28/50+99ef/b9/ad cheat description:Triple usual shots per round code:86b5/28/50+9aae/28/78+99ef/b9/ad cheat description:Quadruple usual shots per round code:86b5/28/50+9aae/28/a0+99ef/b9/ad cartridge sha256:648f68ae58f3420096e052a68255d8e453ae1fc09a4214adbeaa66ff841aaa33 name:Side Pocket (USA) cheat description:Infinite turns - P1 code:abcf/85/a5 cartridge sha256:69399633df5ea1baf37d3e47087257e245fca1f260cac0f539e8e4437ddf2a28 name:Silent Assault (USA) (Unl) cheat description:Infinite lives code:002e/08 cheat description:Infinite Grenades code:00d9/04 cartridge sha256:37a5cfb1aacd9bb42746f20923441b5f613971d4dc99de68c216b10a8d7bcbfc name:Silent Service (USA) cheat description:Infinite deck gun shells code:e929/c6/a5 cheat description:Infinite bow torpedoes code:e95b/c6/a5 cheat description:Infinite aft torpedoes code:e983/c6/a5 cheat description:Start with 50 deck gun shells code:9d01/50/32 cheat description:Start with 99 deck gun shells code:9d01/50/63 cartridge sha256:28f0444e178830edf654eb72e54c7920296156524295b5a4f4418fc4d33f42fd name:Silk Worm (USA) cheat description:Infinite lives using helicopter code:e2dd/c6/a5 cheat description:Infinite lives using jeep code:e66c/c6/a5 cheat description:Keep firepower and speed-ups for helicopter code:e302/85/a5 cheat description:Keep firepower and speed-ups for jeep code:e691/85/a5 cheat description:Restrict movement area for helicopter code:e39f/d8/80 cheat description:Restrict movement area for jeep code:e79c/e0/88 cheat description:1 life using helicopter after continue code:c985/03/01 cheat description:6 lives using helicopter after continue code:c985/03/06 cheat description:9 lives using helicopter after continue code:c985/03/09 cheat description:1 life using jeep after continue code:c99f/03/01 cheat description:6 lives using jeep after continue code:c99f/03/06 cheat description:9 lives using jeep after continue code:c99f/03/09 cheat description:Start with 1 life code:c822/03/01 cheat description:Start with 6 lives code:c822/03/06 cheat description:Start with 9 lives code:c822/03/09 cheat description:Start at stage 2 code:c828/00/01 cheat description:Start at stage 3 code:c828/00/02 cheat description:Start at stage 4 code:c828/00/03 cheat description:Start at stage 5 code:c828/00/04 cheat description:Start at stage 6 code:c828/00/05 cheat description:Start at stage 7 code:c828/00/06 cartridge sha256:718dce0398dba4f8968969fe3e078f55ea0a5b3cff91895fd9ac0225fe4c437e name:Silver Surfer (USA) cheat description:Infinite lives - both players code:cf8d/ce/ad cheat description:Infinite Smart Bombs - both players code:e663/1c/ff cheat description:Keep cosmic weapons after losing a life code:d586/8d/2c cheat description:Keep Orbs after losing a life code:d583/8d/2c+dbc1/8d/2c cheat description:Have 5 Smart Bombs on a new life code:d58d/01/05 cheat description:Start with 1 life - P1 code:d513/05/01 cheat description:Start with 1 life - P2 code:d54c/05/01 cheat description:Start with 5 Smart Bombs - P1 code:d52c/01/05 cheat description:Start with 5 Smart Bombs - P2 code:d565/01/05 cheat description:Infinite lives code:05e6/09 cartridge sha256:ce1fd1fcf89d2d6334cc3d96101c7b995ff4959257ed04df92f0afad711d08da name:Simpsons, The - Bartman Meets Radioactive Man (USA) cheat description:Invincibility code:f3a9/20/ad cheat description:Infinite health code:f731/04/00 cheat description:Infinite health (alt) code:f732/8d/ad cheat description:Infinite Eyes on pick-up code:f8fe/ce/cd cheat description:Infinite Eyes on pick-up (alt) code:f8fe/ce/ad cheat description:Infinite Cold on pick-up code:f944/01/00 cheat description:Infinite lives code:f260/91/b1 cheat description:Infinite credits code:f80f/ce/ad cheat description:Eyes worth more on pick-up code:eae1/20/50 cheat description:Cold worth more on pick-up code:eabd/05/20 cheat description:Start with 2 lives and 2 credits code:8767/03/01 cheat description:Start with 6 lives and 6 credits code:8767/03/05 cheat description:Start with 8 lives and 8 credits code:8767/03/07 cheat description:Start with 10 lives and 10 credits code:8767/03/09 cheat description:Start in chapter 1 level 2 code:a730/00/02 cheat description:Start in chapter 1 level 3 code:a730/00/05 cheat description:Infinite health (alt 2) code:0787/20 cheat description:Infinite Eyes on pick-up (alt 2) code:0788/99 cheat description:Infinite Cold on pick-up (alt) code:0789/99 cartridge sha256:7e8a3accbd57c9fea4f86fb9f99d9adc579bacec52fc68d547125067f8e50816 name:Simpsons, The - Bart vs. the Space Mutants (USA) (Rev A) cheat description:Infinite time code:f293/ca/ea cheat description:Slow down time code:f27d/3c/78 cheat description:Speed up time code:f27d/3c/20 cheat description:Gain 2 coins for every 1 collected code:f70c/00/01 cheat description:Only 10 coins needed to get an extra life code:f712/0e/09 cheat description:Buy items for free code:a29d/ce/2c+b0a5/ce/2c cheat description:Super-jump code:fb36/0c/15 cheat description:Invincibility (blinking) code:04bd/ff cheat description:Infinite health code:04b2/01 cheat description:Infinite time (alt) code:066c/09 cartridge sha256:346fd8061a0b09c057855536012b146256bfbe386e304ef950ad93603048933c name:Simpsons, The - Bart vs. the Space Mutants (USA) cheat description:Invincibility code:d997/f0/d0 cheat description:Infinite health code:ed10/ce/ad cheat description:Infinite time code:f29f/ca/ea cheat description:Slow down time code:f289/3c/78 cheat description:Speed up time code:f289/3c/20 cheat description:Gain 2 coins for every 1 collected code:f718/00/01 cheat description:Only 10 coins needed to get an extra life code:f71e/0e/09 cheat description:Buy items for free code:a1a2/ce/2c+b0ab/ce/2c cheat description:Get all items by selecting them (be sure to get the Paint Can in level 1 and Gun in the Museum) code:e043/bd/9d cheat description:Super-jump code:fb42/0c/15 cheat description:Invincibility (blinking) code:04bd/ff cheat description:Infinite health (alt) code:04b2/01 cheat description:Infinite time (alt) code:066c/09 cartridge sha256:678565338a9efa2d9d4bd399b314b62864d486a4e9f4c314bf11ae5a240cdab8 name:Simpsons, The - Bart vs. the World (USA) cheat description:Invincibility code:e3ac/05/1a cheat description:Infinite health code:ec68/ce/ad cheat description:Infinite lives code:f11d/e5/a5 cheat description:Infinite Firecracker Balls code:f139/91/b1 cheat description:Infinite tries for the card match game code:a071/ce/ad cheat description:Bart flies code:b87c/b4 cheat description:Lose lives more easily code:ec5f/f0/d0 cheat description:Start with 99 Firecracker Balls code:a001/00/09 cheat description:Start with 9 lives code:ac2e/03/09 cheat description:Infinite health (alt) code:06bc/05 cheat description:Infinite lives (alt) code:06c1/09 cheat description:Infinite Firecracker Balls (alt) code:06bf/09 cartridge sha256:fe4043430276177b739137ee7ed8e6cb75e751732a3f796ce03708d3ef1755e8 name:Skate or Die (USA) cheat description:Snowball Blast - More snowballs picked up code:a6fe/01/02 cheat description:Snowball Blast - Start with more time code:9886/60/99 cheat description:Snowball Blast - Start with less time code:9886/60/40 cheat description:Snowball Blast - More time gained code:a6cd/10/15 cheat description:Snowball Blast - Less time gained code:a6cd/10/05 cheat description:Snowball Blast - Start with more ammo code:9836/02/04 cheat description:Snowball Blast - Start with less ammo code:9836/02/01 cheat description:Acro Aerials - More jumps allowed code:ed6f/03/05+efd0/03/05 cartridge sha256:3626bb5ce3035b39d70ed5f2941b69801c1a95629609f1ebd90a5a6a9e16794f name:Skate or Die 2 - The Search for Double Trouble (USA) cheat description:Adventure Game - Infinite health code:a1ba/c6/a5 cheat description:Adventure Game - Infinite Paint Clips code:96e6/ce/ad cheat description:Adventure Game - Infinite Eggs code:9172/01/00+932a/01/00 cheat description:Adventure Game - Infinite M-80's code:9366/01/00+9188/01/00 cheat description:Adventure Game - Skate at any speed code:d088/41/00+8046/41/00 cheat description:Stunt Ramp - Only 1 skateboard code:f333/03/01 cheat description:Stunt Ramp - 6 skateboards code:f333/03/06 cheat description:Stunt Ramp - 9 skateboards code:f333/03/09 cheat description:Stunt Ramp - More time code:f31d/03/06 cheat description:Stunt Ramp - Less time code:f31d/03/02 cheat description:Stunt Ramp - Infinite time code:8a34/c6/a5 cheat description:Stunt Ramp - Super speed code:9acc/05/06 cheat description:Stunt Ramp - Infinite skateboards code:9fc6/c6/a5+a0b4/c6/a5 cartridge sha256:a29461c583ec03909c1dbc4e7d783de0aaf2f391ae8329b3d8bf06e06cfdd2fa name:Ski or Die (USA) cheat description:Snowball Blast - More snowballs picked up code:a6fe/01/02 cheat description:Snowball Blast - Start with more time code:9886/60/99 cheat description:Snowball Blast - Start with less time code:9886/60/40 cheat description:Snowball Blast - More time gained code:a6cd/10/15 cheat description:Snowball Blast - Less time gained code:a6cd/10/05 cheat description:Snowball Blast - Start with more ammo code:9836/02/04 cheat description:Snowball Blast - Start with less ammo code:9836/02/01 cheat description:Acro Aerials - More jumps allowed code:efd0/03/05+ed6f/03/05 cartridge sha256:06fddd300a6d1cbe1be92e851e3d5d2defcc7e682903b569bc9fe71a26addd74 name:Skull & Crossbones (USA) (Unl) cheat description:Infinite continues code:977e/ce/ad cheat description:Infinite weapons code:869d/de/bd cheat description:Infinite time code:f21c/ce/ad cheat description:Faster timer code:f218/3c/20 cheat description:Slower timer code:f218/3c/70 cheat description:Half energy for Red Dog and One Eye code:97e3/32/19+9782/32/19 cheat description:Double energy for Red Dog and One Eye code:97e3/32/63+9782/32/19 cheat description:Better super-jump code:87ef/c8/b8+87e4/c8/b8 cheat description:1 continue code:97a6/05/01 cheat description:9 continues code:97a6/05/09 cartridge sha256:51958d12a19e7c573fab26b85fe81d57330ff6668d630c6bc95c7c563c441e93 name:Sky Kid (USA) cheat description:Infinite lives code:c28c/d6/a5 cheat description:P1 has more lives than P2 code:fa7e/85/86 cheat description:Shoot more bullets code:c21d/01/00 cheat description:Start with 1 life - both players code:fa77/03/01 cheat description:Start with 6 lives - both players code:fa77/03/06 cheat description:Start with 9 lives - both players code:fa77/03/09 cheat description:Start on level 5 code:fa6f/01/05+fa6b/00/04 cheat description:Start on level 10 code:fa6f/01/0a+fa6b/00/09 cheat description:Start on level 15 code:fa6f/01/10+fa6b/00/0f cheat description:Start on level 20 code:fa6f/01/14+fa6b/00/13 cheat description:Invincibility - P1 code:00bb/00 cheat description:Invincibility - P2 code:00cb/00 cartridge sha256:f845ee19cbe21f5b463073f3716659f9c82ef6342a20879165ed21f219f6653b name:Sky Shark (USA) (Rev 0A) cheat description:Infinite lives code:8078/d6/a9 cheat description:Infinite Bombs code:83b8/d6/24 cheat description:Infinite credits code:817d/de/2c cheat description:Autofire code:810b/5c/00 cheat description:Double Bombs code:9e65/03/06 cheat description:Double credits code:8037/03/06 cheat description:1 life after continue - both players code:817a/04/00 cheat description:9 lives after continue - both players code:817a/04/08 cheat description:Start with maximum firepower code:8121/a4/a0+8122/3d/06 cheat description:Start with 1 life - P1 code:8026/a9/24 cheat description:Start with 1 life - P2 code:8033/04/00 cheat description:Start with 9 lives - P1 code:802a/a2/06+802b/ff/21 cheat description:Start with 9 lives - P2 code:8033/04/08 cartridge sha256:f7f6d714c7758f679db8f0c7869ef19353fdcc49c267494bb41bfefda0f152d6 name:Slalom (USA) cheat description:Ski super fast code:b21b/00/01 cheat description:No track obstacles code:9503/01/00 cheat description:Timer at 5 minutes for all tracks code:9620/a6/a2+9621/79/09 cartridge sha256:6dde1137253e7e41972dd04e09dc736efee82cc7f41f8deac8d0dcb111301616 name:Smash T.V. (USA) cheat description:Infinite lives code:f264/de/db cheat description:Touch and kill most enemies code:a211/f0/80 cheat description:Infinite Grenades code:bfab/d6/a9 cheat description:Get a lot more Grenades code:ae7e/06/99 cartridge sha256:8df9c1a7a3806873db908604bb99749673241ccd58e1b32a6d7bf2fafc97d9d4 name:Smurfs, The (Europe) (En,Fr,De,Es) cheat description:Invincibility code:8b00/f0/d0+a3f9/f0/d0 cheat description:Infinite health code:96c3/ce/ad cheat description:Infinite lives code:bb92/8d/ad cheat description:Infinite time code:99c5/9d/bd cartridge sha256:c85ed147e6da0da5ef02c930cc52621ae38d66971a332d168bf31126a3a740ce name:Snake's Revenge (USA) cheat description:Invincibility code:e908/85/a5 cheat description:Infinite health code:e8cc/85/a5 cheat description:Infinite ammo for all weapons code:e672/88/ea cheat description:Infinite Beretta ammo code:8b09/8d/ad cheat description:Infinite Shotgun ammo code:8c95/8d/ad cheat description:Infinite Grenades code:8c44/8d/ad cheat description:Infinite Missiles code:8ce9/8d/ad cheat description:Reduce your injuries by up to 50% code:e8b9/07/00 cheat description:Play with less health code:f3b6/0a/ea+ac42/0a/ea cheat description:Infinite time for Metal Gear battle code:a0d6/ce/ad cheat description:One hit defeats Metal Gear code:83a3/f0/d0 cheat description:Start a new game to view the ending code:c530/0e/11 cheat description:Start with half bullets for Beretta M92 code:e7ac/40/20 cheat description:Start with double bullets for Beretta M92 code:e7ac/40/80 cheat description:Start with Machine Gun instead of Beretta code:e798/01/02+e7ae/c0/c2 cheat description:Start with Shotgun instead of Beretta code:e798/01/04+e7ae/c0/c4 cheat description:Start with Grenades instead of Beretta code:e798/01/20+e7ae/c0/c6 cheat description:Start with Missiles instead of Beretta code:e798/01/80+e7ae/c0/c8 cartridge sha256:98691aea357072f901095e47db056a01887083fd81710d425b9171db1cd1ad1b name:Snake Rattle n Roll (USA) cheat description:Infinite lives - both players code:be1d/de/bd cheat description:Infinite time code:fa81/c6/a5 cheat description:Faster timer code:fa7e/6e/40 cheat description:Slower timer code:fa7e/6e/90 cheat description:Super-jump code:9c2d/01/02 cheat description:Mega-jump code:9c2d/01/03 cheat description:1 life - both players code:82a7/02/00 cheat description:6 lives - both players code:82a7/02/05 cheat description:9 lives - both players code:82a7/02/08 cheat description:1 life - both players, after continue code:8eb0/02/00 cheat description:6 lives - both players, after continue code:8eb0/02/05 cheat description:9 lives - both players, after continue code:8eb0/02/08 cheat description:Start on level 2 code:82bc/ff/01 cheat description:Start on level 3 code:82bc/ff/02 cheat description:Start on level 4 code:82bc/ff/03 cheat description:Start on level 5 code:82bc/ff/04 cheat description:Start on level 6 code:82bc/ff/05 cheat description:Start on level 7 code:82bc/ff/06 cheat description:Invincibility (blinking) code:040d/11 cheat description:Infinite health code:059f/1c cheat description:Infinite lives code:03df/03 cheat description:Infinite time (alt) code:00cf/09 cheat description:Easy win code:0062/09 cheat description:Max tongue height code:0499/07 cartridge sha256:fbd7caadaf77c2b191e74328b9b836155f8498500f7e5af44edfc0ec53b15fee name:Snow Brothers (USA) cheat description:Invincibility code:8eb6/de/bd cheat description:Infinite number of chances code:8ffb/d6/a5 cheat description:Always get 10 chances after a continue (count restarts at 9) code:8317/02/09 cheat description:Always get 1 chance after a continue (count restarts at 0) code:8317/02/00 cheat description:Don't lose super ability after you lose a chance code:909c/99/b9 cheat description:Start with 10 chances instead of 3 (count starts at 9 instead of 2) code:a329/02/09 cheat description:Start with 1 chance (count starts at 0) code:a329/02/00 cheat description:Start with Speed Skates, Power Shots and super snow-throwing code:800f/00/0f cheat description:Start with Speed Skates (don't use with other "start with" codes) code:800f/00/01 cheat description:Start with Power Shots (don't use with other "start with" codes) code:800f/00/02 cheat description:Start with super snow-throwing ability (don't use with other "start with" codes) code:800f/00/04 cheat description:Start on 5th floor code:a2e6/00/04 cheat description:Start on 10th floor code:a2e6/00/09 cheat description:Start on 20th floor code:a2e6/00/13 cheat description:Start on 30th floor code:a2e6/00/1d cheat description:Start on 40th floor code:a2e6/00/27 cheat description:Start on 50th floor code:a2e6/00/31 cartridge sha256:6a0c8be0f6445d9d777080955c7aa8fbff7497633b878a36c8139ec13dabfb8b name:Soccer (World) cheat description:Each half lasts only 10 minutes code:9a1c/15/10 cheat description:Each half lasts for 50 minutes code:9a1c/15/50 cheat description:Start 1 goal up code:be56/00/01+be59/85/84+be5b/8d/8c cheat description:Start 3 goals up code:be56/00/03+be59/85/84+be5b/8d/8c cartridge sha256:45a0fd35f3141c140fb8d1f652876011f28d772b987da123c597aa8c924437b2 name:Solar Jetman - Hunt for the Golden Warpship (USA) cheat description:No damage taken from walls code:a6a4/fd/00+a6a8/ff/00 cheat description:Minimum damage taken from walls code:a6a8/ff/00 cheat description:Infinite lives code:9d2f/c6/a5 cheat description:Weapons use up no energy code:ce89/f9/ed cheat description:Items for free code:dab1/0f/00+dac9/85/24 cheat description:Reversed gravity for planet 1 code:95d3/0b/fb cheat description:Reversed gravity for planet 2 code:965a/1e/ee cheat description:Reversed gravity for planet 3 code:9690/14/e4 cheat description:Reversed gravity for planet 4 code:95ee/0a/fa cheat description:Reversed gravity for planet 5 code:9624/20/e0 cheat description:Reversed gravity for planet 6 code:963f/29/e9 cheat description:Reversed gravity for planet 7 code:9609/23/e3 cheat description:Normal gravity for planet 8 code:96ab/e8/18 cheat description:Start with 1 ship and 1 life code:d34a/04/01 cheat description:Start with 8 ships and 8 lives code:d34a/04/08 cheat description:Start with more money code:d35a/01/08 cheat description:Start on level 3 code:d35e/00/02 cheat description:Start on level 6 code:d35e/00/05 cheat description:Start on level 9 code:d35e/00/08 cheat description:Start on level 11 code:d35e/00/0a cartridge sha256:842478f0d9f01c6c547672a7e4dc4a33ed2c900f92e4b318f4d5941ba548b355 name:Solomon's Key (USA) cheat description:Invincibility code:8065/20/ad cheat description:Infinite life code:a1a7/91/b1 cheat description:Infinite lives code:c84c/ca/ea cheat description:Indestructible fireball code:a01b/20/2c cheat description:Continuous fairies code:a025/23/00 cheat description:Start with 40,000 life points code:9829/8e/8c cheat description:Start on last level reached code:9136/8d/2c cheat description:Start on next level code:9136/8d/ee cheat description:Start on level 10 code:9139/8d/ad+913b/04/93+9135/00/09 cheat description:Start on level 20 code:9139/8d/ad+913b/04/93+9135/00/13 cheat description:Start on level 30 code:9139/8d/ad+913b/04/93+9135/00/1d cheat description:Start on level 40 code:9139/8d/ad+913b/04/93+9135/00/27 cheat description:Invincibility (alt) code:0028/80 cheat description:Infinite life (alt) code:0438/09 cheat description:Infinite fireballs code:042f/80 cartridge sha256:e437dbafa7e20dd72412c869b9433901c3e9302cfa16b6e8379ecc56ae8dcc22 name:Solstice - The Quest for the Staff of Demnos (USA) cheat description:Infinite lives code:8a5d/ce/ad cheat description:Infinite Potions code:92d5/de/bd cheat description:Multi-jump code:a4bf/20/ad cheat description:1 life after continue code:812b/03/01 cheat description:8 lives after continue code:812b/03/08 cheat description:Start with full flasks of Potions code:8d1b/02/04 cheat description:Start with no Potions code:8d1b/02/00 cheat description:Start with 1 life code:8d46/04/01 cheat description:Start with 8 lives code:8d46/04/08 cheat description:Infinite lives (alt) code:0789/09 cheat description:Infinite Green Potion code:0784/04 cheat description:Infinite Yellow Potion code:0785/04 cheat description:Infinite Light Purple Potion code:0786/04 cheat description:Infinite Dark Purple Potion code:0787/04 cartridge sha256:69569bebb916fcd78f904abd28aa4ed69fde0467c050c539c5359409305ca4ea name:Space Invaders (Japan) cheat description:Infinite lives - P1 code:0029/09 cheat description:Infinite lives - P2 code:002a/09 cartridge sha256:cce92c9404d5dd48680b0b505acbbbce279a4f09606167f0aacfb6da991aac4c name:Space Hunter (Japan) cheat description:Infinite energy code:b714/ce/ad+b697/9d/ad cartridge sha256:dbd587ef5a12e03a336cda61cd120b4e8c585f45d82821e144ee8afdea9ee84e name:Spartan X 2 (Japan) cheat description:Infinite health code:dc82/ce/ad+dc3e/8d/ad cartridge sha256:6f58c6fb427cf18b4c28f07909db642abac09fac2d7ae7dc9c99f1cd79263d95 name:Spelunker (USA) cheat description:Invincibility code:9540/20/60+848f/ff/3e+8491/2d/2c cheat description:Infinite lives code:9599/ce/2d cheat description:Invisibility code:86a7/10/00 cheat description:Jump higher code:8884/fe/fd+8878/00/80 cheat description:Start with 1 life code:8176/02/00 cheat description:Start with 6 lives code:8176/02/05 cheat description:Start with 9 lives code:8176/02/08 cheat description:Infinite lives (alt) code:0234/63 cheat description:Have a high score code:022f/ff cheat description:Infinite Bombs code:0237/09 cheat description:Infinite Flares code:0238/09 cartridge sha256:1104d574711a103745aed2407997275e1ac43fd4d5c7ff96bde0af5bfa014c2d name:Spider-Man - Return of the Sinister Six (USA) cheat description:Invincibility code:b2fd/20/ad cheat description:Infinite health code:ce9e/8d/ad cartridge sha256:3c74b191d7d4cb6c34e6b2d5f76d9c86be63f8ebb61581c49810f0dd58c538c1 name:Spiritual Warfare (USA) (v6.1) (Unl) cheat description:Infinite energy code:c4e3/85/a5 cheat description:Infinite Vial Of God's Wrath code:cdc2/c6/a5 cheat description:Start with all armors, 7 of each fruit, all items, 99 Keys, 255 God's Wrath, 99 Birds code:b50f/00/ff cheat description:Start with max energy code:b542/06/18 cartridge sha256:5a82a1b0386407f1036c3d0ae750741c0835336f062d77480e1dd5b4da507386 name:Spiritual Warfare (USA) (v6.0) (Unl) cheat description:Invincibility code:ed9a/02/00 cheat description:Infinite energy code:c4bb/85/a5 cheat description:Infinite Vial Of God's Wrath code:b4df/00/ff cheat description:Infinite Vials code:cd9a/c6/a5 cheat description:Hit anywhere with fruits code:cc5c/06/24 cheat description:Items are free code:9161/b0/50 cheat description:Any answer is correct code:929e/4c/ad cheat description:Walk through walls (not diagonally) code:e5d4/c9/60 cheat description:Start with all armors, 7 of each fruit, all items, 99 Keys, 255 God's Wrath, 99 Birds code:b4df/00/ff cheat description:Start with max energy code:b512/06/18 cartridge sha256:14a86d409cc9e6ae2428f301e4aaa77290fe38ec3e660d971af9abda772747e2 name:Spiritual Warfare (USA) (v5.1) (Unl) cheat description:Infinite energy code:c4f9/85/a5 cheat description:Infinite Vial Of God's Wrath code:cdd8/c6/a5 cheat description:Start with all armors, 7 of each fruit, all items, 99 Keys, 255 God's Wrath, 99 Birds code:b525/00/ff cheat description:Start with max energy code:b558/06/18 cartridge sha256:387d82471ca5f54e70b3c4d445ae5c692640d99c47b30a6bf67f5a17b6236c85 name:Splatter House - Wanpaku Graffiti (Japan) cheat description:Hit anywhere code:a14c/03/00+a139/1b/00+a134/b0/24 cheat description:Moon-jump code:c4ab/20/28+c3a5/05/80+c3a4/c9/29+c3a3/8f/67 cheat description:Start a new game to view ending code:aeee/02/05 cartridge sha256:17da401495807145c9d4db275d429b7fe94be45dde00edc40aca885911cfd138 name:Spy Hunter (USA) cheat description:Infinite health code:9ae0/85/a5 cheat description:Infinite lives code:81c7/ce/ad cheat description:Infinite lives (alt) code:bc0d/c6/a5 cheat description:Infinite missiles code:b748/ce/ad cheat description:Infinite smoke code:b686/8d/ae cheat description:Hit anywhere code:9dfc/15/00+9df8/0e/00+abd8/0f/00+9ded/24/00+9dff/85/a5 cheat description:Enemies die automatically code:8538/0e/00+abd8/0f/00+abd2/60/ea cheat description:No enemies code:9ad9/85/a5+9b3e/85/a5 cheat description:Double missiles on pick-up code:a58b/03/06 cheat description:Slow down timer code:ad07/07/0f cheat description:Keep special weapons code:8bd4/8d/2c+8bd7/8d/2c cheat description:Start with 2 extra lives code:ad8c/00/02 cheat description:Start with 6 extra lives code:ad8c/00/06 cartridge sha256:91c61066a9b6b5ed169449b175190d75d38834e07da263f637af05801bc2f5ae name:Spy vs Spy (USA) cheat description:Stop black spy's clock code:8367/ce/ad cheat description:Stop white spy's clock code:83bb/ce/ad cheat description:Black spy has 100 seconds in a minute code:8381/35/39 cheat description:White spy has 100 seconds in a minute code:83d5/35/39 cheat description:Black spy has deadly punches code:a7e7/eb/f1 cheat description:White spy has deadly punches code:a7e3/05/0d cartridge sha256:687963e7fd12834543da99c60a533fcdfedacd27f8a67c0c9c4007c1263a79b3 name:Sqoon (USA) cheat description:Infinite lives code:8580/01/00 cheat description:Never lose your special weapon code:8d09/ce/ad cheat description:Never lose humans on dying code:8c84/8d/2c+b2da/8d/2c cheat description:Gain main weapon on rescuing 9 humans code:9f98/01/02 cheat description:Start with 1 life code:8bbd/02/00 cheat description:Start with 6 lives code:8bbd/02/05 cheat description:Start with 9 lives code:8bbd/02/08 cheat description:Start at phase 3 code:8b5a/01/03 cheat description:Start at phase 5 code:8b5a/01/05 cheat description:Start at phase 8 code:8b5a/01/08 cartridge sha256:b2e222df4d50fb75b108eac25e2beb671e37881bb357aa89bde7ef73d8d670f2 name:Squashed (USA) (Proto) cheat description:Invincibility code:969a/20/ad cheat description:Infinite lives code:9476/de/dd cheat description:Infinite time code:e665/ce/cd cartridge sha256:d9a666f7b122bff2db329d346e20d9708ad58471ea80fbd032aa4600e86ad8f1 name:Stanley - The Search for Dr. Livingston (USA) cheat description:Infinite health code:c307/8d/ad cheat description:Infinite time on continue screen code:af5a/c6/ea cheat description:Start a new game with complete map code:caa6/00/ff cheat description:Infinite health (alt) code:057e/26 cheat description:Have all weapons code:049e/5f+049d/5f+049c/5f+049b/5f+049a/5f+0499/5f+0498/01+0497/5f+0496/5f cartridge sha256:581851e22e8d499ada19e621c93571fba279fe9c8446ed2ee566b16128f13874 name:Star Force (USA) cheat description:Infinite lives code:8e4e/c6/a5 cheat description:Turbo speed code:816c/ff/fe cheat description:Start with 1 life code:8db3/02/00 cheat description:Start with 6 lives code:8db3/02/05 cheat description:Start with 9 lives code:8db3/02/08 cartridge sha256:7b7ccdcda705c2c3215c646b479c5d5868b72f3cd3eff97291d608756e5f3230 name:Starship Hector (USA) cheat description:Take minimum damage code:fcb0/e5/e9+fcb1/06/01 cheat description:Infinite lives code:dc41/c6/a5 cheat description:Extra health from capsules code:e5ec/01/04 cheat description:Start with 1 life code:dc79/02/00 cheat description:Start with 6 lives code:dc79/02/05 cheat description:Start with 9 lives code:dc79/02/08 cheat description:Start at stage 2 code:f5f4/00/01 cheat description:Start at stage 3 code:f5f4/00/02 cheat description:Start at stage 4 code:f5f4/00/03 cheat description:Start at stage 5 code:f5f4/00/04 cheat description:Infinite health code:00b0/10 cheat description:Play as Bomberking code:005f/01 cartridge sha256:025abe5ae4e1610fac2507296184f64173fd960adfc79d456001adec29c546a5 name:Star Soldier (USA) cheat description:Infinite lives code:8118/c6/a5 cheat description:Infinite shield power code:9ee2/c6/24 cheat description:Double shield power code:9f19/05/0a+93fc/05/0a cheat description:Start with laser code:8191/00/01 cartridge sha256:a3d132f118c0d95590579c6d6b89b6bbe448a93aab93b3a29490f985b821a42c name:Star Trek - 25th Anniversary (USA) cheat description:Kirk has more energy code:9c9e/07/0b cheat description:Kirk has less energy code:9c9e/07/04 cheat description:McCoy has more energy code:a03f/07/0b cheat description:McCoy has less energy code:a03f/07/04 cheat description:Spock has more energy code:a036/07/0b cheat description:Spock has less energy code:a036/07/04 cheat description:Security has more energy code:a063/07/0b cheat description:Geologist has more energy code:a048/07/0b cheat description:Geologist has less energy code:a048/07/04 cheat description:Biologist has more energy code:a05a/07/0b cheat description:Biologist has less energy code:a05a/07/04 cheat description:Historian has more energy code:a051/07/0b cheat description:Historian has less energy code:a051/07/04 cheat description:McCoy gives full energy to injured party code:b1cf/04/07 cartridge sha256:8271542561a71830886e88ac74e6eda309440920b3607e950d5f2cd1a7edd5ca name:Star Trek - The Next Generation (USA) cheat description:All systems are immune to damage - shields down code:e7a1/91/b1 cheat description:Shields are immune to damage - shields up code:e7be/8d/ad cheat description:Quicker damage repair code:e64e/90/40 cheat description:Very quick damage repair code:e64e/90/10 cheat description:Slower damage repair code:e64e/90/c0 cheat description:Enemy does less damage code:e0fb/0a/4a cheat description:Stop game time ticking over code:e505/ee/60 cheat description:Photon Torpedoes always work code:a031/74/00 cheat description:Phasers always work code:a10e/f7/00 cheat description:Phasers fire for longer code:a119/ec/00 cheat description:Damage is repaired immediately code:e662/3d/00 cheat description:Transporter power does not decrease most of the time code:beed/c6/a5 cheat description:Less transporter power required most of the time code:be7a/20/05 cheat description:Stardate does not advance code:aaf1/65/64 cartridge sha256:2e366cb5ebcce2cd7be431b84bbbb401104e2717322b15e5368707b4eddeb11a name:Star Trek V - The Final Frontier (Unknown) (Proto) cheat description:Invincibility (blinking) code:9a7f/f0/d0 cheat description:Infinite health code:9507/8d/ad+8972/8d/ad cheat description:Infinite Phasers code:9d96/8d/ad cheat description:Infinite Bombs code:a2fb/ce/ad cartridge sha256:69de2c7552fa81ca5921da0e457abf1be35f18ffbad159788a76141be59c9f6b name:StarTropics (USA) cheat description:Infinite health code:a163/ed/ae cheat description:Infinite lives code:e480/ce/ad cheat description:Infinite weapons code:a5a9/de/bd cheat description:Hit anywhere code:b2fc/29/50+b2fd/07/58+b3a0/c9/4c+b3a1/02/ef+b3a2/90/b3 cheat description:Enemies can't move code:d39e/9f cheat description:1 star needed to restore health code:a6af/05/01+a6b3/05/01 cheat description:9 stars needed to restore health code:a6af/05/09+a6b3/05/09 cheat description:1 life with a new character code:e257/03/01 cheat description:6 lives with a new character code:e257/03/06 cheat description:1 life after continue code:e534/03/01 cheat description:6 lives after continue code:e534/03/06 cheat description:Gain 50 fire weapons on pick-up code:b0e2/19/32 cheat description:Gain 50 bat weapons on pick-up code:b0df/1e/32 cheat description:Only 3 hearts needed to use shooting-star code:a7b2/0c/05 cheat description:Only 8 hearts needed to use super-nova code:a791/16/08 cheat description:Invincibility after one hit code:077b/2e cheat description:Infinite health (alt) code:0112/17 cheat description:Infinite Blue Stars code:011c/09 cheat description:Permanent Anklet (can jump 2 spaces) code:005b/02+0180/01 cartridge sha256:c4c139d2c349a513d4ccc724daee3fd37099c3c0d2742fad777a0edbe3d042ce name:Star Voyager (USA) cheat description:Infinite life support pods code:ae55/c6/24 cheat description:Start with double life support pods code:d540/0a/14 cheat description:Start with triple life support pods code:d540/0a/1e cheat description:Barrier won't take damage code:bb55/03/00 cheat description:Radar won't take damage code:bbc6/d0/10 cheat description:Cannon won't take damage code:bba2/d0/f0 cheat description:Engine won't take damage code:bb2a/03/00 cartridge sha256:b9116f11828e39d3e201c878a874f0d88fa0eae9dece0469bf94a7e9c8616775 name:Star Wars (USA) cheat description:Infinite lives code:8207/ce/ad cheat description:Immune to spikes, you can get stuck on them code:f553/9d/2c cheat description:Immune to most bullets code:b76f/9d/bd cheat description:Immune to most collisions code:b5fa/e5/24+b647/9d/bd cheat description:Full energy on big energy pick-ups code:bc47/02/00 cheat description:Less energy on big energy pick-ups code:bc43/20/08 cheat description:More energy on big energy pick-ups code:bc43/20/40 cheat description:Always running code:cd99/01/02+cdca/01/02 cheat description:Start with 1 life code:8024/02/00 cheat description:Start with 6 lives code:8024/02/05 cheat description:Start with 9 lives code:8024/02/08 cartridge sha256:01b1bc93f72286a10ac62869ebe1bf2493ca24b3386e01447b0ccac50acdee94 name:Star Wars - The Empire Strikes Back (USA) cheat description:Don't take damage from most enemies code:a766/99/2c cheat description:9 harpoons - scene 2 code:a1d7/05/09 cheat description:1 harpoons - scene 2 code:a1d7/05/01 cheat description:Infinite harpoons - scene 2 code:ac66/ce/2c cheat description:Infinite energy for ship - scene 2 code:b5d5/85/24 cheat description:Always have Lightsaber code:9ea8/37/00 cheat description:Start with 14 continues code:b5f4/07/0e cheat description:Start on scene 2 code:cb02/00/01 cheat description:Start on scene 3 code:cb02/00/02 cheat description:Start on scene 4 code:cb02/00/03 cheat description:Start on scene 5 code:cb02/00/04 cheat description:Start on scene 6 code:cb02/00/05 cheat description:Start on scene 7 code:cb02/00/06 cartridge sha256:8093144834f1153e95076a76dbc720cec37a31412b422c8adf9f5bcea1b642e8 name:Stealth ATF (USA) cheat description:Infinite missiles code:ad65/ce/ad cheat description:Start with double missiles code:a8ba/08/10 cheat description:No damage taken from enemy's bullets code:9f62/ee/ad cheat description:Start with less fuel code:a8bf/96/60 cheat description:More enemy planes on the screen code:a3c2/02/08 cartridge sha256:5ca7cb3c4168bb021a67b50fa071afe7679f4e79c5c46e229fbe7b88004bf51a name:Stinger (USA) cheat description:Keep weapons after death code:cb77/95/24 cheat description:Infinite lives code:cb6c/d6/a9 cheat description:Skip intro code:c3db/00/05 cheat description:Start with 1 life code:c429/03/01 cheat description:Start with 6 lives code:c429/03/06 cheat description:Start with 9 lives code:c429/03/09 cheat description:Start with Dual Cannons code:c470/3e/47+c46e/10/01 cheat description:Start with Laser code:c470/3e/47+c46e/10/02 cheat description:Start with Shoot Right code:c470/3e/47+c46e/10/04 cheat description:Start with Shoot Left code:c470/3e/47+c46e/10/08 cheat description:Start with Five Direction Firing code:c470/3e/47+c46e/10/10 cheat description:Start with Three Direction Firing code:c470/3e/47+c46e/10/20 cheat description:Start with Force field code:c470/3e/47+c46e/10/40 cheat description:Start at stage 2 (wait for demo game then press start) code:c415/85/24+c301/01/01 cheat description:Start at stage 3 code:c415/85/24+c301/01/02 cheat description:Start at stage 4 code:c415/85/24+c301/01/03 cheat description:Start at stage 5 code:c415/85/24+c301/01/04 cheat description:Start at stage 6 code:c415/85/24+c301/01/05 cheat description:Invincibility code:0056/50 cheat description:Infinite lives (alt) code:0038/09 cartridge sha256:d8a12772ddcb35d66a6518096c8415961cb43ceb9ffb96e5c7f83fe3a8e7f2c1 name:Street Cop (USA) cheat description:Infinite health code:d28e/e5/24 cheat description:Take minimum damage code:d28e/e5/e9+d28f/10/01 cheat description:Infinite time code:f05e/c6/a5 cheat description:Have less time code:e21e/09/06 cheat description:Have more time code:e21e/09/12 cheat description:Start with less health code:c8f7/30/18 cheat description:Start with more health code:c8f7/30/60 cheat description:Start at level 2 code:e121/00/01 cheat description:Start at level 3 code:e121/00/02 cheat description:Start at level 4 code:e121/00/03 cartridge sha256:885cfd4396e0ade5f3abbbdb5055bc48ef166f86207db631bac83c51c0844f08 name:Street Fighter 2010 - The Final Fight (USA) cheat description:Invincibility code:d45b/d0/f0 cheat description:Infinite health code:d4b1/02/00 cheat description:Infinite lives code:8136/c6/a5 cheat description:Infinite time code:c238/95/b5 cheat description:Hit anywhere code:d57f/11/20+d57e/b0/d0+d57b/d9/ad cheat description:Take less damage code:d4b1/02/01 cheat description:Take more damage code:d4b1/02/03 cheat description:Keep power-ups after losing a life code:8112/85/24 cheat description:Keep power-ups when hit code:d4c7/02/00 cheat description:Faster Ken code:89dd/01/02 cheat description:Portal always stays open code:ebe6/ce/ad cheat description:Start with 1 life code:800e/04/00 cheat description:Start with 9 lives code:800e/04/09 cartridge sha256:07401bfb725c61711ce0a1d5eade14e09cd0f1b90991691339077a0b7dea5e58 name:Street Heroes (Asia) (Unl) cheat description:Infinite health code:00d6/59 cheat description:One hit kills code:00d7/00 cheat description:Only one win needed to advance code:0059/02 cartridge sha256:d4fc5610f1355c545d1ecf21502c31a9d21a31e0d4f0043c7c8d8f199bea2a73 name:Strider (USA) cheat description:Infinite health code:8cf3/29/a9+8cf6/35/69 cheat description:Hit anywhere code:ea7d/26/00+ea8a/19/00 cheat description:More energy from small capsules (10) code:af38/01/0a cheat description:More energy from big capsules (20) code:af3a/0a/14 cheat description:Health from small capsules (10) code:af3c/01/0a cheat description:Health from big capsules (20) code:af3e/0a/14 cheat description:Double health and energy from all capsules code:af0e/18/0a cheat description:Have all Keys and start on Red Dragon level code:048c/ff cheat description:Have all Data Files code:048e/ff cheat description:Max stats, all tricks, Slide In, Plasma Arrow code:048b/09+048d/01 cheat description:Infinite power code:056b/63 cheat description:High-jump code:0538/0a cheat description:Plasma Sword is instantly charged code:055d/89 cartridge sha256:9aa6ced81adbfb09730591efa9aea369ec7bf57d8a1504dfd5f77ff5696b0427 name:Strike Wolf (MGC-014) cheat description:Infinite energy code:bd4f/85/a5 cheat description:Infinite ammo code:985f/ce/ad cheat description:Infinite Bombs code:97a3/ce/ad cartridge sha256:f3a140c16012c4e4fb0deda64cbee7d9ebe78d2fb717b80b12a9f938d57b78bb name:Stunt Kids (USA) (Unl) cheat description:Infinite time - P1 code:927f/de/bd cheat description:Infinite time - P2 code:932f/de/bd cheat description:Infinite lives code:ac55/ce/ad cheat description:Always have 9 coins after a race code:d673/8c/8e cheat description:Coins worth nothing on pick-up code:9948/ee/ad cheat description:Start with 1 life instead of 3 code:cad7/02/00 cheat description:Start with 6 lives code:cad7/02/05 cheat description:Start with 9 lives code:cad7/02/09 cheat description:Start with 0 turbos instead of 3 code:d089/03/00 cheat description:Start with 6 turbos code:d089/03/06 cheat description:Start with 9 turbos code:d089/03/09 cartridge sha256:4d16627301ff5def67247039b3a4b1cce4d20fbb867f4c5b7bcab43a8575f59f name:Sunday Funday - The Ride (USA) (Unl) cheat description:Enable level skip (press B then Select) code:fafb/f0/d0 cartridge sha256:a387a17294bb440eb821fa096bfe476f772c7f9f79c5fb251f6b0a50bdeda53d name:Super Arabian (Japan) cheat description:Invincibility code:a930/ad cheat description:Hit anywhere code:9c8d/07/00+9cba/95/cc cartridge sha256:3edd803db1cc88155720625ed8f3e362a5e3c660e7faf3285bbe3a2c6571511c name:Super C (USA) cheat description:Invincibility - both players code:a13a/3b cheat description:Infinite continues code:ea1a/c6/a5 cheat description:Activates 10 lives code code:e5a8/02/00 cheat description:10 lives code give you 30 code:e5aa/09/1d cheat description:Extra life for each enemy killed code:e6f6/02/00 cheat description:Hit anywhere code:a1ad/0d/11 cheat description:One hit kills code:a201/00 cheat description:Multi-jump - both players code:86e0/d0/24+86e9/6d/3a cheat description:Keep equiped weapon after dying code:8662/95/24 cheat description:Run faster to the right code:8870/f0 cheat description:Stage select after title screen code:e4af/d0/f0 cheat description:Press Start to complete current level code:ea9f/39/38+ea9d/01/04 cheat description:Start a new game to view the ending code:e4c3/00/08 cheat description:Start with Spray Gun code:e5b4/57/b8+e5a1/b8/57+e5b2/00/02 cheat description:Start with Fireball Gun code:e5b4/57/b8+e5a1/b8/57+e5b2/00/04 cheat description:Start with 1 life - both players code:e5a3/02/00 cheat description:Start with 6 lives - both players code:e5a3/02/05 cheat description:Start with 9 lives - both players code:e5a3/02/08 cheat description:Start with 255 lives - both players code:e5a3/02/ff cheat description:Start with 9 continues code:e58d/02/06 cheat description:Start at area 2 code:e583/00/01 cheat description:Start at area 3 code:e583/00/02 cheat description:Start at area 4 code:e583/00/03 cheat description:Start at area 5 code:e583/00/04 cheat description:Start at area 6 code:e583/00/05 cheat description:Start at area 7 code:e583/00/06 cheat description:Invincibility (blinking) code:00d4/55 cheat description:Infinite lives code:0053/03 cheat description:Have the Machine Gun code:00b8/81 cheat description:Have the Spread Gun code:00b8/82 cheat description:Have the Laser Gun code:00b8/83 cheat description:Have the Fireball Gun code:00b8/84 cheat description:Have the Single Shot MG code:00b8/85 cheat description:Have the Super Fireball Gun code:00b8/86 cartridge sha256:fcb6a0ef3a20c19b356005fbb21dc8009563b1cb5a9aaebc8e9386b4a8c5912e name:Super Mario Bros. (World) cheat description:Invincibility code:eee9/ad/8d+eeec/f0/d0 cheat description:Invincibility (Starman effect) code:d88d/d5 cheat description:Infinite time code:b766/ae cheat description:Infinite time (alt) code:b766/ad cheat description:Infinite lives - both players code:91d9/ad cheat description:Infinite lives code:91d9/ce/cd cheat description:Always Big Mario code:b263/a9+b264/00+d936/ad cheat description:Always Fiery Mario code:b626/22 cheat description:Always get 3 fireworks at end of stage code:d305/1c cheat description:Always get 6 fireworks at end of stage code:d2f6/07/86 cheat description:After falling down a hole, you drop from above code:bff3/95/a9 cheat description:Fireballs hit anywhere code:d721/90/24 cheat description:Gain a 1-up when an enemy is killed or power-up is gained code:84e5/07/00 cheat description:Goombas don't walk off ledges code:e0e6/0b cheat description:Mega-jump from a standing start only code:b424/10 cheat description:Mega-jump from running only code:b426/10 cheat description:Mega-jump from turbo running only code:b428/04 cheat description:Moon Gravity from a standing start code:b42b/07 cheat description:Moon Gravity from a running start code:b42d/07 cheat description:Moon Gravity from turbo running only code:b42f/07 cheat description:Multi-jump code:b48d/10 cheat description:Super-jump from a standing start only code:b424/18 cheat description:Super-jump from running only code:b426/16 cheat description:Super-jump from turbo running only code:b428/14 cheat description:Turn all enemies into Toad code:e8b4/b7 cheat description:Can control Mario in demo and title screen code:82bc/00/01+82be/fc/70+82bf/06/07 cheat description:Can control Mario in entrances that lead to underground code:b08b/f5 cheat description:Can move left or right while crouched code:b123/f0/10 cheat description:Can walk through pipes and blocks code:df56/54 cheat description:Small Mario can break bricks code:bd18/01/00+bcf7/02/00+bd17/d0/a0 cheat description:Fireballs can kill Bowser's Fire code:d794/2e/00 cheat description:Fireballs can kill Bullet Bill code:d78c/36/00 cheat description:Fireballs can kill Buzzy Beetle code:d757/6b/00 cheat description:Fireballs can kill Podoboo code:e02a/04/00+d790/32/00 cheat description:Enable level select code:8270/00 cheat description:Press Start to finish current world code:81ba/80/70+81b5/84/24+81b7/49/a9+81b9/09/8d+81bc/05/ea+81bb/d0/07+81b8/01/02 cheat description:Start with 1 life - both players code:906a/00 cheat description:Start with 6 lives - both players code:906a/05 cheat description:Start with 9 lives - both players code:906a/08 cheat description:Start P1 with 8 lives and P2 with 3 lives code:906b/8e cheat description:Start on World 2 code:9089/5f+908a/07+9087/01 cheat description:Start on World 3 code:9089/5f+908a/07+9087/02 cheat description:Start on World 4 code:9089/5f+908a/07+9087/03 cheat description:Start on World 5 code:9089/5f+908a/07+9087/04 cheat description:Start on World 6 code:9089/5f+908a/07+9087/05 cheat description:Start on World 7 code:9089/5f+908a/07+9087/06 cheat description:Start on World 8 code:9089/5f+908a/07+9087/07 cheat description:Invincibility (blinking) code:079e/06 cheat description:Invincibility (Starman effect) (alt) code:079f/18 cheat description:Infinite lives (alt) code:075a/09 cheat description:Infinite time (alt 2) code:0787/0c cheat description:Always Big Mario (alt) code:0754/00+0756/01 cheat description:Always Fiery Mario (alt) code:0754/00+0756/02 cartridge sha256:5dde385041aa7364c78205f2ba49615f416c701b6025e38aa1d7b9c4f99a62db name:Super Mario Bros. + Duck Hunt (USA) cheat description:DH - Infinite ammo code:d171/c6/a5 cheat description:DH - Infinite ammo (alt) code:00ba/03 cheat description:DH - Hit anywhere code:d22c/f5/00 cheat description:DH - Always get the perfect bonus code:d350/0a/00+d351/d0/30 cheat description:DH - Ducks never fly away - Game A code:ca6c/c6/05 cheat description:DH - Enable game "D" (press Select three times) code:c19e/03/04 cheat description:SMB - Invincibility code:eee9/ad/8d+eeec/f0/d0 cheat description:SMB - Invincibility (Starman effect) code:d88d/d5 cheat description:SMB - Infinite time code:b766/ae cheat description:SMB - Infinite time (alt) code:b766/ad cheat description:SMB - Infinite lives - both players code:91d9/ad cheat description:SMB - Infinite lives code:91d9/ce/cd cheat description:SMB - Always Big Mario code:b263/a9+b264/00+d936/ad cheat description:SMB - Always Fiery Mario code:b626/22 cheat description:SMB - Always get 3 fireworks at end of stage code:d305/1c cheat description:SMB - Always get 6 fireworks at end of stage code:d2f6/07/86 cheat description:SMB - After falling down a hole, you drop from above code:bff3/95/a9 cheat description:SMB - Fireballs hit anywhere code:d721/90/24 cheat description:SMB - Gain a 1-up when an enemy is killed or power-up is gained code:84e5/07/00 cheat description:SMB - Goombas don't walk off ledges code:e0e6/0b cheat description:SMB - Mega-jump from a standing start only code:b424/10 cheat description:SMB - Mega-jump from running only code:b426/10 cheat description:SMB - Mega-jump from turbo running only code:b428/04 cheat description:SMB - Moon Gravity from a standing start code:b42b/07 cheat description:SMB - Moon Gravity from a running start code:b42d/07 cheat description:SMB - Moon Gravity from turbo running only code:b42f/07 cheat description:SMB - Multi-jump code:b48d/10 cheat description:SMB - Super-jump from a standing start only code:b424/18 cheat description:SMB - Super-jump from running only code:b426/16 cheat description:SMB - Super-jump from turbo running only code:b428/14 cheat description:SMB - Turn all enemies into Toad code:e8b4/b7 cheat description:SMB - Can control Mario in demo and title screen code:82bc/00/01+82be/fc/70+82bf/06/07 cheat description:SMB - Can control Mario in entrances that lead to underground code:b08b/f5 cheat description:SMB - Can move left or right while crouched code:b123/f0/10 cheat description:SMB - Can walk through pipes and blocks code:df56/54 cheat description:SMB - Small Mario can break bricks code:bd18/01/00+bcf7/02/00+bd17/d0/a0 cheat description:SMB - Fireballs can kill Bowser's Fire code:d794/2e/00 cheat description:SMB - Fireballs can kill Bullet Bill code:d78c/36/00 cheat description:SMB - Fireballs can kill Buzzy Beetle code:d757/6b/00 cheat description:SMB - Fireballs can kill Podoboo code:e02a/04/00+d790/32/00 cheat description:SMB - Enable level select code:8270/00 cheat description:SMB - Press Start to finish current world code:81ba/80/70+81b5/84/24+81b7/49/a9+81b9/09/8d+81bc/05/ea+81bb/d0/07+81b8/01/02 cheat description:SMB - Start with 1 life - both players code:906a/00 cheat description:SMB - Start with 6 lives - both players code:906a/05 cheat description:SMB - Start with 9 lives - both players code:906a/08 cheat description:SMB - Start P1 with 8 lives and P2 with 3 lives code:906b/8e cheat description:SMB - Start on World 2 code:9089/5f+908a/07+9087/01 cheat description:SMB - Start on World 3 code:9089/5f+908a/07+9087/02 cheat description:SMB - Start on World 4 code:9089/5f+908a/07+9087/03 cheat description:SMB - Start on World 5 code:9089/5f+908a/07+9087/04 cheat description:SMB - Start on World 6 code:9089/5f+908a/07+9087/05 cheat description:SMB - Start on World 7 code:9089/5f+908a/07+9087/06 cheat description:SMB - Start on World 8 code:9089/5f+908a/07+9087/07 cheat description:SMB - Invincibility (blinking) code:079e/06 cheat description:SMB - Invincibility (Starman effect) (alt) code:079f/18 cheat description:SMB - Infinite lives (alt) code:075a/09 cheat description:SMB - Infinite time (alt 2) code:0787/0c cheat description:SMB - Always Big Mario (alt) code:0754/00+0756/01 cheat description:SMB - Always Fiery Mario (alt) code:0754/00+0756/02 cartridge sha256:26977a6c51a6f1e1af895b8863e8e7d57c5321621f29cf58ebfbf85163a999dd name:Super Mario Bros. + Duck Hunt + World Class Track Meet (USA) (Rev A) cheat description:DH - Infinite ammo code:d171/c6/a5 cheat description:DH - Infinite ammo (alt) code:00ba/03 cheat description:DH - Hit anywhere code:d22c/f5/00 cheat description:DH - Always get the perfect bonus code:d350/0a/00+d351/d0/30 cheat description:DH - Ducks never fly away - Game A code:ca6c/c6/05 cheat description:DH - Enable game "D" (press Select three times) code:c19e/03/04 cheat description:SMB - Invincibility code:eee9/ad/8d+eeec/f0/d0 cheat description:SMB - Invincibility (Starman effect) code:d88d/d5 cheat description:SMB - Infinite time code:b766/ae cheat description:SMB - Infinite time (alt) code:b766/ad cheat description:SMB - Infinite lives - both players code:91d9/ad cheat description:SMB - Infinite lives code:91d9/ce/cd cheat description:SMB - Always Big Mario code:b263/a9+b264/00+d936/ad cheat description:SMB - Always Fiery Mario code:b626/22 cheat description:SMB - Always get 3 fireworks at end of stage code:d305/1c cheat description:SMB - Always get 6 fireworks at end of stage code:d2f6/07/86 cheat description:SMB - After falling down a hole, you drop from above code:bff3/95/a9 cheat description:SMB - Fireballs hit anywhere code:d721/90/24 cheat description:SMB - Gain a 1-up when an enemy is killed or power-up is gained code:84e5/07/00 cheat description:SMB - Goombas don't walk off ledges code:e0e6/0b cheat description:SMB - Mega-jump from a standing start only code:b424/10 cheat description:SMB - Mega-jump from running only code:b426/10 cheat description:SMB - Mega-jump from turbo running only code:b428/04 cheat description:SMB - Moon Gravity from a standing start code:b42b/07 cheat description:SMB - Moon Gravity from a running start code:b42d/07 cheat description:SMB - Moon Gravity from turbo running only code:b42f/07 cheat description:SMB - Multi-jump code:b48d/10 cheat description:SMB - Super-jump from a standing start only code:b424/18 cheat description:SMB - Super-jump from running only code:b426/16 cheat description:SMB - Super-jump from turbo running only code:b428/14 cheat description:SMB - Turn all enemies into Toad code:e8b4/b7 cheat description:SMB - Can control Mario in demo and title screen code:82bc/00/01+82be/fc/70+82bf/06/07 cheat description:SMB - Can control Mario in entrances that lead to underground code:b08b/f5 cheat description:SMB - Can move left or right while crouched code:b123/f0/10 cheat description:SMB - Can walk through pipes and blocks code:df56/54 cheat description:SMB - Small Mario can break bricks code:bd18/01/00+bcf7/02/00+bd17/d0/a0 cheat description:SMB - Fireballs can kill Bowser's Fire code:d794/2e/00 cheat description:SMB - Fireballs can kill Bullet Bill code:d78c/36/00 cheat description:SMB - Fireballs can kill Buzzy Beetle code:d757/6b/00 cheat description:SMB - Fireballs can kill Podoboo code:e02a/04/00+d790/32/00 cheat description:SMB - Enable level select code:8270/00 cheat description:SMB - Press Start to finish current world code:81ba/80/70+81b5/84/24+81b7/49/a9+81b9/09/8d+81bc/05/ea+81bb/d0/07+81b8/01/02 cheat description:SMB - Start with 1 life - both players code:906a/00 cheat description:SMB - Start with 6 lives - both players code:906a/05 cheat description:SMB - Start with 9 lives - both players code:906a/08 cheat description:SMB - Start P1 with 8 lives and P2 with 3 lives code:906b/8e cheat description:SMB - Start on World 2 code:9089/5f+908a/07+9087/01 cheat description:SMB - Start on World 3 code:9089/5f+908a/07+9087/02 cheat description:SMB - Start on World 4 code:9089/5f+908a/07+9087/03 cheat description:SMB - Start on World 5 code:9089/5f+908a/07+9087/04 cheat description:SMB - Start on World 6 code:9089/5f+908a/07+9087/05 cheat description:SMB - Start on World 7 code:9089/5f+908a/07+9087/06 cheat description:SMB - Start on World 8 code:9089/5f+908a/07+9087/07 cheat description:SMB - Invincibility (blinking) code:079e/06 cheat description:SMB - Invincibility (Starman effect) (alt) code:079f/18 cheat description:SMB - Infinite lives (alt) code:075a/09 cheat description:SMB - Infinite time (alt 2) code:0787/0c cheat description:SMB - Always Big Mario (alt) code:0754/00+0756/01 cheat description:SMB - Always Fiery Mario (alt) code:0754/00+0756/02 cartridge sha256:968cf4ae63fddf6a0d379bb12add5563f468e57ddddb69e00e1379a839234f95 name:Super Mario Bros. + Duck Hunt + World Class Track Meet (USA) cheat description:DH - Infinite ammo code:d171/c6/a5 cheat description:DH - Infinite ammo (alt) code:00ba/03 cheat description:DH - Hit anywhere code:d22c/f5/00 cheat description:DH - Always get the perfect bonus code:d350/0a/00+d351/d0/30 cheat description:DH - Ducks never fly away - Game A code:ca6c/c6/05 cheat description:DH - Enable game "D" (press Select three times) code:c19e/03/04 cheat description:SMB - Invincibility code:eee9/ad/8d+eeec/f0/d0 cheat description:SMB - Invincibility (Starman effect) code:d88d/d5 cheat description:SMB - Infinite time code:b766/ae cheat description:SMB - Infinite time (alt) code:b766/ad cheat description:SMB - Infinite lives - both players code:91d9/ad cheat description:SMB - Infinite lives code:91d9/ce/cd cheat description:SMB - Always Big Mario code:b263/a9+b264/00+d936/ad cheat description:SMB - Always Fiery Mario code:b626/22 cheat description:SMB - Always get 3 fireworks at end of stage code:d305/1c cheat description:SMB - Always get 6 fireworks at end of stage code:d2f6/07/86 cheat description:SMB - After falling down a hole, you drop from above code:bff3/95/a9 cheat description:SMB - Fireballs hit anywhere code:d721/90/24 cheat description:SMB - Gain a 1-up when an enemy is killed or power-up is gained code:84e5/07/00 cheat description:SMB - Goombas don't walk off ledges code:e0e6/0b cheat description:SMB - Mega-jump from a standing start only code:b424/10 cheat description:SMB - Mega-jump from running only code:b426/10 cheat description:SMB - Mega-jump from turbo running only code:b428/04 cheat description:SMB - Moon Gravity from a standing start code:b42b/07 cheat description:SMB - Moon Gravity from a running start code:b42d/07 cheat description:SMB - Moon Gravity from turbo running only code:b42f/07 cheat description:SMB - Multi-jump code:b48d/10 cheat description:SMB - Super-jump from a standing start only code:b424/18 cheat description:SMB - Super-jump from running only code:b426/16 cheat description:SMB - Super-jump from turbo running only code:b428/14 cheat description:SMB - Turn all enemies into Toad code:e8b4/b7 cheat description:SMB - Can control Mario in demo and title screen code:82bc/00/01+82be/fc/70+82bf/06/07 cheat description:SMB - Can control Mario in entrances that lead to underground code:b08b/f5 cheat description:SMB - Can move left or right while crouched code:b123/f0/10 cheat description:SMB - Can walk through pipes and blocks code:df56/54 cheat description:SMB - Small Mario can break bricks code:bd18/01/00+bcf7/02/00+bd17/d0/a0 cheat description:SMB - Fireballs can kill Bowser's Fire code:d794/2e/00 cheat description:SMB - Fireballs can kill Bullet Bill code:d78c/36/00 cheat description:SMB - Fireballs can kill Buzzy Beetle code:d757/6b/00 cheat description:SMB - Fireballs can kill Podoboo code:e02a/04/00+d790/32/00 cheat description:SMB - Enable level select code:8270/00 cheat description:SMB - Press Start to finish current world code:81ba/80/70+81b5/84/24+81b7/49/a9+81b9/09/8d+81bc/05/ea+81bb/d0/07+81b8/01/02 cheat description:SMB - Start with 1 life - both players code:906a/00 cheat description:SMB - Start with 6 lives - both players code:906a/05 cheat description:SMB - Start with 9 lives - both players code:906a/08 cheat description:SMB - Start P1 with 8 lives and P2 with 3 lives code:906b/8e cheat description:SMB - Start on World 2 code:9089/5f+908a/07+9087/01 cheat description:SMB - Start on World 3 code:9089/5f+908a/07+9087/02 cheat description:SMB - Start on World 4 code:9089/5f+908a/07+9087/03 cheat description:SMB - Start on World 5 code:9089/5f+908a/07+9087/04 cheat description:SMB - Start on World 6 code:9089/5f+908a/07+9087/05 cheat description:SMB - Start on World 7 code:9089/5f+908a/07+9087/06 cheat description:SMB - Start on World 8 code:9089/5f+908a/07+9087/07 cheat description:SMB - Invincibility (blinking) code:079e/06 cheat description:SMB - Invincibility (Starman effect) (alt) code:079f/18 cheat description:SMB - Infinite lives (alt) code:075a/09 cheat description:SMB - Infinite time (alt 2) code:0787/0c cheat description:SMB - Always Big Mario (alt) code:0754/00+0756/01 cheat description:SMB - Always Fiery Mario (alt) code:0754/00+0756/02 cartridge sha256:728d0ca6751b0c039fc3e34f2e7f27a870afcab30f5e270244ac40979c5f69ca name:Super Mario Bros. 2 (USA) (Rev A) cheat description:Invincibility code:f324/d0/a9+f326/a5/85 cheat description:Infinite health (except if you hit a spike) code:ba06/8d/2c cheat description:Infinite health (alt) code:ba06/8d/ad cheat description:Infinite lives code:8a7d/ce/ad cheat description:Hit anywhere code:b6a0/04/00+b69f/29/e0+b6a2/4d/44 cheat description:All characters can float code:8cf8/f0/70 cheat description:More sub-space time code:972e/1f cheat description:Quick pick-up code:8ab5/b9/ad cheat description:Twice as much time in sub-space code:95a2/60/ff cheat description:Infinite magic carpet time code:a372/d6/b5 cheat description:Jump as high as a squat jump code:8cbc/3c/00 cheat description:Princess has mega-float code:8d21/00/11 cheat description:Princess has mega-float and lunar descent code:8d21/00/01 cheat description:Super moon-jumps - Mario code:83dc/04/01 cheat description:Mega moon-jumps - Luigi code:840a/01/00 cheat description:Super moon-jumps - Toad code:83f3/04/01 cheat description:Super moon-jumps - Princess code:8421/04/01 cheat description:Speed up enemies code:84a3/02/00 cheat description:Super speed enemies code:85f2/08/20+85f3/f8/e0 cheat description:Walk backwards code:8c87/18/1c+8c88/8c/d3 cheat description:Super turbo running code:8de7/4a/ea+8dfa/6a/ea cheat description:Permanent turbo running code:8de6/05/00+8df8/06/00 cheat description:Fast run - Toad code:83f5/18/28+83f8/e8/d8 cheat description:Super fast run - Mario code:83de/18/28+83e1/e8/d8 cheat description:Super fast run - Luigi code:840c/18/28+840f/e8/d8 cheat description:Super fast run - Princess code:8423/18/28+8426/e8/d8 cheat description:Weak Birdo code:8f6f/02/00 cheat description:Strong Birdo code:8f6f/02/0d cheat description:Strong Wart code:b1d8/06/0f cheat description:Birdo spits eggs instead of fireballs (in late levels of the game) code:9003/20/1e cheat description:Start on World 2 code:9a83/40/01+9a85/00/35+9a86/01/06 cheat description:Start on World 3 code:9a83/40/02+9a85/00/35+9a86/01/06 cheat description:Start on World 4 code:9a83/40/03+9a85/00/35+9a86/01/06 cheat description:Start on World 5 code:9a83/40/04+9a85/00/35+9a86/01/06 cheat description:Start on World 6 code:9a83/40/05+9a85/00/35+9a86/01/06 cheat description:Start on World 7 code:9a83/40/06+9a85/00/35+9a86/01/06 cheat description:Invincibility (alt) code:0085/fa cheat description:Infinite coins code:062b/09 cheat description:Infinite sub-space time code:04b7/fa cheat description:Infinite magic carpet time (alt) code:00b9/fa cheat description:All characters can float (alt) code:04c9/fa cheat description:Multi-jump code:0099/00 cheat description:One hit kills on bosses code:0468/00 cheat description:Only 1 Cherry needed for Starman code:062a/04 cheat description:Only 1 big Radish needed for Stopwatch code:062c/04 cheat description:Receive small heart for every enemy defeated code:04ad/09 cheat description:Stopwatch always active code:04ff/fa cheat description:Start on World 2 (alt) code:0635/01 cheat description:Start on World 3 (alt) code:0635/02 cheat description:Start on World 4 (alt) code:0635/03 cheat description:Start on World 5 (alt) code:0635/04 cheat description:Start on World 6 (alt) code:0635/05 cheat description:Start on World 7 (alt) code:0635/06 cartridge sha256:cba920f9394733c82253685d7783f26a3033ba58a94623e9abf7892329b969b9 name:Super Mario Bros. 2 (USA) cheat description:Invincibility code:f324/d0/a9+f326/a5/85 cheat description:Infinite health (except if you hit a spike) code:ba06/8d/2c cheat description:Infinite health (alt) code:ba06/8d/ad cheat description:Infinite lives code:8a7d/ce/ad cheat description:Hit anywhere code:b6a0/04/00+b69f/29/e0+b6a2/4d/44 cheat description:Quick pick-up code:8ab5/b9/ad cheat description:Twice as much time in sub-space code:95a2/60/ff cheat description:Jump as high as a squat jump code:8cbc/3c/00 cheat description:Princess has mega-float code:8d21/00/11 cheat description:Princess has mega-float and lunar descent code:8d21/00/01 cheat description:Super moon-jumps - Mario code:83dc/04/01 cheat description:Mega moon-jumps - Luigi code:840a/01/00 cheat description:Super moon-jumps - Toad code:83f3/04/01 cheat description:Super moon-jumps - Princess code:8421/04/01 cheat description:Speed up enemies code:84a3/02/00 cheat description:Super speed enemies code:85f2/08/20+85f3/f8/e0 cheat description:Walk backwards code:8c87/18/1c+8c88/8c/d3 cheat description:Super turbo running code:8de7/4a/ea+8dfa/6a/ea cheat description:Permanent turbo running code:8de6/05/00+8df8/06/00 cheat description:Fast run - Toad code:83f5/18/28+83f8/e8/d8 cheat description:Super fast run - Mario code:83de/18/28+83e1/e8/d8 cheat description:Super fast run - Luigi code:840c/18/28+840f/e8/d8 cheat description:Super fast run - Princess code:8423/18/28+8426/e8/d8 cheat description:Hawkeye at end of level always open code:8dbd/f0/24 cheat description:Start on World 2 code:9a83/40/01+9a85/00/35+9a86/01/06 cheat description:Start on World 3 code:9a83/40/02+9a85/00/35+9a86/01/06 cheat description:Start on World 4 code:9a83/40/03+9a85/00/35+9a86/01/06 cheat description:Start on World 5 code:9a83/40/04+9a85/00/35+9a86/01/06 cheat description:Start on World 6 code:9a83/40/05+9a85/00/35+9a86/01/06 cheat description:Start on World 7 code:9a83/40/06+9a85/00/35+9a86/01/06 cheat description:Invincibility (alt) code:0085/fa cheat description:Infinite coins code:062b/09 cheat description:Infinite sub-space time code:04b7/fa cheat description:Infinite magic carpet time (alt) code:00b9/fa cheat description:All characters can float (alt) code:04c9/fa cheat description:Multi-jump code:0099/00 cheat description:One hit kills on bosses code:0468/00 cheat description:Only 1 Cherry needed for Starman code:062a/04 cheat description:Only 1 big Radish needed for Stopwatch code:062c/04 cheat description:Receive small heart for every enemy defeated code:04ad/09 cheat description:Stopwatch always active code:04ff/fa cheat description:Start on World 2 (alt) code:0635/01 cheat description:Start on World 3 (alt) code:0635/02 cheat description:Start on World 4 (alt) code:0635/03 cheat description:Start on World 5 (alt) code:0635/04 cheat description:Start on World 6 (alt) code:0635/05 cheat description:Start on World 7 (alt) code:0635/06 cartridge sha256:ff8afb9ae6b705b4e51dbcb193dcebadf4c049800a71003d3a45052648e52eda name:Super Mario Brothers 2 (Japan) (FDS) cheat description:Start with 50 lives code:c5e4/31 cheat description:Start with 9 lives code:c5e4/08 cheat description:Invincibility (Starman effect) code:079f/09 cheat description:Infinite lives code:701b/ad cartridge sha256:959fdd32c71735d6fb2bd16a646d39f4ee65623273dd035e6a968e991bd13ef8 name:Super Mario Bros. 3 (USA) (Rev A) cheat description:Invincibility (Starman effect) code:cee0/2a/00 cheat description:Invincibility after changing up from Super Mario (Raccoon, Frog, ect.) code:da44/8d/ad cheat description:Invincibility as miniture stone Mario code:a3cc/05/a0 cheat description:Invincibility as Super Mario code:a3cc/05/ba cheat description:Invincibility as Fire Mario code:a3cc/05/a3 cheat description:Invincibility as Raccoon Mario code:a3cc/05/af cheat description:Invincibility as Frog Mario code:a3cc/05/b9 cheat description:Invincibility as Sledgehammer Mario code:a3cc/05/fa cheat description:Infinite lives - both players code:9123/de/bd cheat description:Infinite time code:afb0/ce/ad cheat description:Infinite items - Mario code:a62b/0c/1f cheat description:Infinite tries at card match game code:d86d/ce/2c cheat description:Always win at line up the pictures game (prize is based on the top picture) code:d1df/20/00 cheat description:Fireballs hit anywhere code:a6a0/cb/00+a6af/4d/00 cheat description:Fireballs turn most solid objects into coins code:a54e/17/00+a560/05/00 cheat description:Tail hits anywhere code:db59/90/24 cheat description:1-up for each enemy you stomp code:c460/52 cheat description:1-up for each coin code:b08b/64/01+b090/64/01 cheat description:1-up for each 10 coins code:b08b/64/0a+b090/64/0a cheat description:Change to Super Mario if you fall off screen and die code:da9d/01/00+a416/00/01 cheat description:Change to Fire Mario if you fall off screen and die code:da9d/01/00+a416/00/02 cheat description:Change to Raccoon Mario if you fall off screen and die code:da9d/01/00+a416/00/03 cheat description:Change to Frog Mario if you fall off screen and die code:da9d/01/00+a416/00/04 cheat description:Change to Tanooki Mario if you fall off screen and die code:da9d/01/00+a416/00/05 cheat description:Change to Sledgehammer Mario if you fall off screen and die code:da9d/01/00+a416/00/06 cheat description:Move anywhere on the map code:d2c1/d1/a9+d348/20/10 cheat description:Multi-jump code:ac85/a9/a5 cheat description:Multi-jump (alt) code:ac85/a9/ad cheat description:Multi-jump (alt 2) code:ac3f/d0/24 cheat description:Power-jumps code:a647/c8/b8 cheat description:Super power-jumps code:a647/c8/a8 cheat description:Mega power-jumps code:a647/c8/88 cheat description:Super speed running code:abc0/a5/a9 cheat description:Turbo-charged running code:abbf/88/ea cheat description:Raise P meter while standing still (hold B) code:ab74/03/00 cheat description:Restore powers after playing an action scene code:8f3a/9d/ad cheat description:Card match game always appears after a level code:ac92/f0/24 cheat description:Small white ship level always appears after a level code:accd/4f/0c+ac92/f0/24+accc/bd/a9+acce/ac/ea cheat description:White money ship always appears after a level code:ac92/f0/24+accd/4f/0b+accc/bd/a9+acce/ac/ea cheat description:White toad house always appears after a level code:ac92/f0/24+accc/bd/a9+acce/ac/ea+accd/4f/0a cheat description:Press Start to complete current level (do not use on final ship/castle levels for each map) code:8e71/03/00+8e70/76/14 cheat description:1 life after continue - both players code:92c6/04/00 cheat description:9 lives after continue - both players code:92c6/04/08 cheat description:Start a new game as Fire Mario code:acbc/00/02 cheat description:Start a new game as Raccoon Mario code:acbc/00/03 cheat description:Start a new game as Frog Mario code:acbc/00/04 cheat description:Start a new game as Tanooki Mario code:acbc/00/05 cheat description:Start a new game as Sledgehammer Mario code:acbc/00/06 cheat description:Start a new game to see the ending code:a9c5/cf cheat description:Start on World 2 code:acb3/00/01 cheat description:Start on World 3 code:acb3/00/02 cheat description:Start on World 4 code:acb3/00/03 cheat description:Start on World 5 code:acb3/00/04 cheat description:Start on World 6 code:acb3/00/05 cheat description:Start on World 7 code:acb3/00/06 cheat description:Start on World 8 code:acb3/00/07 cheat description:Unused level - Plains 1 code:b47c/82/4c+b47d/bb/a7 cheat description:Unused level - Plains 2 code:b47c/82/ac+b47d/bb/a1 cheat description:Unused level - Dungeon code:b428/21/22+b47c/82/54+b47d/bb/b7 cheat description:Unused level - Underground 2 code:b428/21/23+b47c/82/42+b47d/bb/b4 cheat description:Unused level - Sky 1 code:b428/21/24+b47c/82/cd+b47d/bb/ad cheat description:Unused level - Sky 3 (level cannot be completed) code:b428/21/24+b47c/82/c4+b47d/bb/b0 cheat description:Unused level - Cloudy 1 code:b428/21/2d+b47c/82/a9+b47d/bb/ac cheat description:Unused level - Pipe level code:b428/21/28+b47c/82/18+b47d/bb/af cheat description:Unused level - Hilly level code:b428/21/23+b47c/82/dd+b47d/bb/b0 cheat description:Unused level - Ice/Water code:b428/21/2c+b47c/82/ba+b47d/bb/b7 cheat description:Unused level - Cloudy (level cannot be completed) code:b428/21/2d+b47c/82/ab+b47d/bb/ad cheat description:P meter always full code:03dd/7f cheat description:Invincibility as Super Mario (alt) code:00ed/01 cheat description:Invincibility as Fire Mario (alt) code:00ed/02 cheat description:Invincibility as Raccoon Mario (alt) code:00ed/03 cheat description:Invincibility as Frog Mario (alt) code:00ed/04 cheat description:Invincibility as Tanooki code:00ed/05 cheat description:Invincibility as Sledgehammer Mario (alt) code:00ed/06 cartridge sha256:d77d17d34af24871d7ce1160ccd3330555835c8e940b7100e095ac38973d927a name:Super Mario Bros. 3 (USA) cheat description:Invincibility (Starman effect) code:cee0/2a/00 cheat description:Invincibility after changing up from Super Mario (Raccoon, Frog, ect.) code:da44/8d/ad cheat description:Invincibility as miniture stone Mario code:a3cc/05/a0 cheat description:Never die from being hit while little (changes music) code:daaa/1c cheat description:Invincibility as Super Mario code:a3cc/05/ba cheat description:Invincibility as Fire Mario code:a3cc/05/a3 cheat description:Invincibility as Raccoon Mario code:a3cc/05/af cheat description:Invincibility as Frog Mario code:a3cc/05/b9 cheat description:Invincibility as Sledgehammer Mario code:a3cc/05/fa cheat description:Infinite lives - both players code:9123/de/bd cheat description:Infinite time code:afb0/ce/ad cheat description:Infinite items - Mario code:a62b/0c/1f cheat description:Infinite tries at card match game code:d86d/ce/2c cheat description:Always win at line up the pictures game (prize is based on the top picture) code:d1df/20/00 cheat description:Fireballs hit anywhere code:a6a0/cb/00+a6af/4d/00 cheat description:Fireballs turn most solid objects into coins code:a54e/17/00+a560/05/00 cheat description:Tail hits anywhere code:db59/90/24 cheat description:1-up for each enemy you stomp code:c460/52 cheat description:1-up for each coin code:b08b/64/01+b090/64/01 cheat description:1-up for each 10 coins code:b08b/64/0a+b090/64/0a cheat description:Change to Super Mario if you fall off screen and die code:da9d/01/00+a416/00/01 cheat description:Change to Fire Mario if you fall off screen and die code:da9d/01/00+a416/00/02 cheat description:Change to Raccoon Mario if you fall off screen and die code:da9d/01/00+a416/00/03 cheat description:Change to Frog Mario if you fall off screen and die code:da9d/01/00+a416/00/04 cheat description:Change to Tanooki Mario if you fall off screen and die code:da9d/01/00+a416/00/05 cheat description:Change to Sledgehammer Mario if you fall off screen and die code:da9d/01/00+a416/00/06 cheat description:Move anywhere on the map code:d2c1/d1/a9+d348/20/10 cheat description:Multi-jump code:ac85/a9/a5 cheat description:Multi-jump (alt) code:ac85/a9/ad cheat description:Multi-jump (alt 2) code:ac3f/d0/24 cheat description:Power-jumps code:a647/c8/b8 cheat description:Super power-jumps code:a647/c8/a8 cheat description:Mega power-jumps code:a647/c8/88 cheat description:Super speed running code:abc0/a5/a9 cheat description:Turbo-charged running code:abbf/88/ea cheat description:Raise P meter while standing still (hold B) code:ab74/03/00 cheat description:Restore powers after playing an action scene code:8f3a/9d/ad cheat description:Card match game always appears after a level code:ac92/f0/24 cheat description:Small white ship level always appears after a level code:accd/4f/0c+ac92/f0/24+accc/bd/a9+acce/ac/ea cheat description:White money ship always appears after a level code:ac92/f0/24+accd/4f/0b+accc/bd/a9+acce/ac/ea cheat description:White toad house always appears after a level code:ac92/f0/24+accc/bd/a9+acce/ac/ea+accd/4f/0a cheat description:Press Start to complete current level (do not use on final ship/castle levels for each map) code:8e71/03/00+8e70/76/14 cheat description:1 life after continue - both players code:92c6/04/00 cheat description:9 lives after continue - both players code:92c6/04/08 cheat description:Start a new game as Fire Mario code:acbc/00/02 cheat description:Start a new game as Raccoon Mario code:acbc/00/03 cheat description:Start a new game as Frog Mario code:acbc/00/04 cheat description:Start a new game as Tanooki Mario code:acbc/00/05 cheat description:Start a new game as Sledgehammer Mario code:acbc/00/06 cheat description:Start a new game to see the ending code:a9c5/cf cheat description:Start on World 2 code:acb3/00/01 cheat description:Start on World 3 code:acb3/00/02 cheat description:Start on World 4 code:acb3/00/03 cheat description:Start on World 5 code:acb3/00/04 cheat description:Start on World 6 code:acb3/00/05 cheat description:Start on World 7 code:acb3/00/06 cheat description:Start on World 8 code:acb3/00/07 cheat description:Unused level - Plains 1 code:b47c/82/4c+b47d/bb/a7 cheat description:Unused level - Plains 2 code:b47c/82/ac+b47d/bb/a1 cheat description:Unused level - Dungeon code:b428/21/22+b47c/82/54+b47d/bb/b7 cheat description:Unused level - Underground 2 code:b428/21/23+b47c/82/42+b47d/bb/b4 cheat description:Unused level - Sky 1 code:b428/21/24+b47c/82/cd+b47d/bb/ad cheat description:Unused level - Sky 3 (level cannot be completed) code:b428/21/24+b47c/82/c4+b47d/bb/b0 cheat description:Unused level - Cloudy 1 code:b428/21/2d+b47c/82/a9+b47d/bb/ac cheat description:Unused level - Pipe level code:b428/21/28+b47c/82/18+b47d/bb/af cheat description:Unused level - Hilly level code:b428/21/23+b47c/82/dd+b47d/bb/b0 cheat description:Unused level - Ice/Water code:b428/21/2c+b47c/82/ba+b47d/bb/b7 cheat description:Unused level - Cloudy (level cannot be completed) code:b428/21/2d+b47c/82/ab+b47d/bb/ad cheat description:P meter always full code:03dd/7f cheat description:Invincibility as Super Mario (alt) code:00ed/01 cheat description:Invincibility as Fire Mario (alt) code:00ed/02 cheat description:Invincibility as Raccoon Mario (alt) code:00ed/03 cheat description:Invincibility as Frog Mario (alt) code:00ed/04 cheat description:Invincibility as Tanooki code:00ed/05 cheat description:Invincibility as Sledgehammer Mario (alt) code:00ed/06 cartridge sha256:fe019a7da7fb7ecd2e6478bde546e6c5d6bba185d53e5c8692522ed8fdd617a2 name:Super Pitfall (USA) cheat description:Infinite bullets code:f395/01/00 cheat description:Infinite lives - 1P game code:d548/ce/ad cheat description:Infinite lives - P1 code:d58e/ce/ad cheat description:Infinite lives - P2 code:d5aa/ce/ad cheat description:30 bullets gained on pick-up code:bbf0/02/03 cheat description:10 bullets gained on pick-up code:bbf0/02/01 cheat description:Start with 1 life - both players code:d061/03/01 cheat description:Start with 6 lives - both players code:d061/03/06 cheat description:Start with 9 lives - both players code:d061/03/09 cheat description:Start with 30 bullets code:cfaf/02/03 cheat description:Start with 10 bullets code:cfaf/02/01 cheat description:Invincibility (blinking) - both players code:00dc/ff cartridge sha256:7c14c7e39943e7247c92d907f3362eab09a7306fb606d4a899a918fc6afd356a name:Super Shinobi, The (unl) cheat description:Infinite health code:04f5/09 cheat description:Infinite magic code:010d/09 cheat description:Infinite Shurikens code:0109/09+010b/09 cheat description:Always have powered-up Shurikens code:00af/01 cartridge sha256:d1defc7a6c6f96f89386c79ac887aa41a72fefa93ba22a8a08159ac891f73613 name:Super Sprint (USA) (Unl) cheat description:Infinite continues code:eb06/ce/ad cheat description:6 continues code:d059/03/07 cheat description:No continues code:d059/03/01 cheat description:More obstacles on tracks code:cecf/00/05+ced3/8d/2c cheat description:Even more obstacles on tracks code:cecf/00/0a+ced3/8d/2c cheat description:Lots and lots of obstacles on tracks code:cecf/00/0f+ced3/8d/2c cartridge sha256:7806ee6afcdf88ef6364da23af8b28f359ef7d850fe55224e188b8a01d5ade67 name:Super Spy Hunter (USA) cheat description:Infinite health code:9ae0/85/a5 cheat description:Start with max health gauge code:bda9/04/0c cheat description:Infinite lives code:0074/05 cheat description:Infinite health (alt) code:007b/40 cartridge sha256:639d5b9dad2f4eae48559dadc708d396f50f898a5912631c0a3c1715a5eab729 name:Super Turrican (Europe) cheat description:Infinite health code:038a/06 cheat description:Infinite lives code:7051/09 cartridge sha256:9ffc36dfc772e1020a9648949aecebab687d6b386d6f02526916d1d49973a78a name:Superman (USA) cheat description:Never die when out of super power code:dd28/80/00 cheat description:Never lose super power code:dcfd/8d/ad cheat description:Start with lots of super power code:e2bf/05/e2 cheat description:Double max power of all items at start code:9d8b/30/60 cheat description:Double usual item power on item power crystal pick-up code:93b7/10/20 cheat description:Full item power on item power crystal pick-up code:93b7/10/a0 cheat description:Start at mission 2 code:9d64/a9/a0+9d65/00/01+9d72/8d/8c cheat description:Start at mission 3 code:9d64/a9/a0+9d65/00/02+9d72/8d/8c cheat description:Start at mission 4 code:9d64/a9/a0+9d65/00/03+9d72/8d/8c cheat description:Start at mission 5 code:9d64/a9/a0+9d65/00/04+9d72/8d/8c cartridge sha256:d138aba5eb5c8cf1218abc7b57ad10709041fd68b6a6c47dd30432f8b33470e9 name:Swamp Thing (USA) cheat description:Invincibility code:94ee/29/09+94ea/f0/d0 cheat description:Infinite health code:e67a/ce/ad cheat description:Infinite lives code:e475/ce/ad cartridge sha256:553d6db3959c8ae3e3cfa598a33c57756b06653ce434fddd0de92bafb460cb05 name:Sword Master (USA) cheat description:Invincibility code:aa46/10/30 cheat description:Infinite health code:cadf/8d/ad+ca57/8d/ad cheat description:Infinite continues code:eb76/8d/ad cheat description:Gain a level for every EXP point gained code:cc04/21/00 cheat description:Invincibility (alt) code:042e/8f cheat description:Infinite health (alt) code:042f/0f cartridge sha256:cdd148ebf43ed8918b4cd5d03e685fe0f38b434a59ffb38f0d9ceb2ee7ca9d89 name:Swords and Serpents (USA) cheat description:All characters have Scale Armor code:ce74/86/8e cheat description:Warriors start with a Great Sword code:ce8d/81/8b cheat description:Warriors start with a Great Axe code:ce8d/81/8c cheat description:Magicians start with a Wizard's Wand code:ce80/85/8d cheat description:Magicians start with more spells code:ce45/03/1f cheat description:Magicians have greater spells code:ce4a/00/03 cheat description:Spells use up no magic points code:f443/f1/24 cheat description:Thieves start with a Long Sword code:ce96/82/8a cheat description:Thieves start with an Axe code:ce96/82/84 cheat description:Start with 30 health points each code:ce27/0a/1e+ce2d/0a/1e cheat description:Start with 50 health points each code:ce27/0a/32+ce2d/0a/32 cartridge sha256:f3955370fe7ecc99afc27cdccf3482f75f06e0f431e42823c95982bb553ad6b9 name:Town & Country Surf Designs - Wood & Water Rage (USA) cheat description:Infinite lives for skating code:a2b2/c6/24 cheat description:Infinite lives for surfing code:c3f8/c6/24 cheat description:When surfing lose only 1 symbol code:c395/02/01 cheat description:When skating lose only 1 symbol if you fall into the ocean or a crack code:a007/03/01 cheat description:Infinite time code:b8c2/c6/24 cheat description:Increase time code:92d4/01/03 cheat description:Infinite lives code:0047/04 cheat description:Infinite time (alt) code:0037/09 cartridge sha256:cfa1cc0f40cf139b1ba61794838d52c029b40ea12194b4248178d8ae59c69b7a name:Town & Country Surf Designs - Thrilla's Surfari (USA) cheat description:Infinite lives code:d752/c6/a9 cheat description:Can't collect Coconuts code:e58d/e6/a9 cheat description:Start with 5 Coconuts plus what you've collected in sub-game code:8133/00/05 cheat description:Start with 10 Coconuts plus what you've collected in sub-game code:8133/00/0a cheat description:Start with 15 Coconuts plus what you've collected in sub-game code:8133/00/0f cheat description:Start with less health code:812d/02/01 cheat description:Start with a little more health code:812d/02/03 cheat description:Start with 2x health code:812d/02/04 cheat description:Start with a lot more health code:812d/02/09 cheat description:Start with 1 life code:8129/03/01 cheat description:Start with 5 lives code:8129/03/05 cheat description:Start with 7 lives code:8129/03/07 cheat description:Start with 9 lives code:8129/03/09 cheat description:Start with mega lives code:8129/03/99 cheat description:Start on level 1-3 (can't advance to next level) code:b6f8/05/02+b6fa/b4/04 cheat description:Start on level 1-4 (can't advance to next level) code:b6f8/05/03+b6fa/b4/04 cheat description:Watch the level 2 Cinema (can't advance to next level) code:b6f8/05/04+b6fa/b4/04 cheat description:Start on level 2-2 (can't advance to next level) code:b6f8/05/06+b6fa/b4/04 cheat description:Start on level 2-3 (can't advance to next level) code:b6f8/05/07+b6fa/b4/04 cheat description:Start on level 2-4 (can't advance to next level) code:b6f8/05/08+b6fa/b4/04 cheat description:Have all 8 health slots code:0006/08 cartridge sha256:b002d1ebee16a5fd2bcae480df8ccc7b8dc7a6f96a80f5fac8b76e078e4f42f0 name:Tag Team Wrestling (USA) cheat description:Infinite health (glitchy) code:d2bb/95/99 cheat description:Never give up code:cefa/d6/b5 cheat description:Infinite health - P1 code:0048/18 cheat description:Infinite health - P2 code:0058/18 cheat description:Infinite health - tag team partner code:005d/18 cartridge sha256:65d11519c8bc1435a994e4f71362dbc734ca808ac3048b66e87c5a80475e3f5e name:Takahashi Meijin no Bouken-jima IV (Japan) cheat description:Invincibility code:a20f/f0/d0 cheat description:Infinite health code:c2c7/85/a5 cartridge sha256:6d10e95fcbf4cd1179293106d526373ea43a0c2b8531e694288b147310d617c6 name:TaleSpin (USA) cheat description:Infinite health code:812c/06/00 cheat description:Infinite continues code:cbfa/c6/a5 cheat description:Infinite lives from getting trapped by obstacles code:cc47/ce/2c cheat description:Add $1,000,000 to end-of-level bonus code:c863/70/71 cheat description:1 life after continue code:cbf6/73/70 cheat description:7 lives after continue code:cbf6/73/76 cheat description:10 lives after continue code:cbf6/73/79 cheat description:1 continue code:c605/73/71 cheat description:6 continues code:c605/73/76 cheat description:9 continues code:c605/73/79 cheat description:Start with 1 life code:c76a/73/70 cheat description:Start with 7 lives code:c76a/73/76 cheat description:Start with 10 lives code:c76a/73/79 cheat description:Invincibility (blinking) code:007c/5b cheat description:Infinite health (alt) code:05b6/60 cheat description:Infinite lives (alt) code:05db/79 cartridge sha256:f6e88113b5f64cf7ffd915dd60b49e55d7015aaeb8b232c87e9855d4b9759cbd name:Target Renegade (USA) cheat description:Don't take most damage code:aee6/85/a5 cheat description:Take half damage from bosses code:9955/14/06 cheat description:Infinite time code:8a01/c6/a5 cheat description:Set timer to 5:00 for all levels code:8286/bd/ad cheat description:Hearts replenish health to maximum code:8acd/02/00 cheat description:Set timer to 3:00 for all levels code:8286/bd/ad+8288/80/cf cheat description:Start on level 2 code:921f/00/01 cheat description:Start on level 3 code:921f/00/02 cheat description:Start on level 4 code:921f/00/03 cheat description:Start on level 5 code:921f/00/04 cheat description:Start on level 6 code:921f/00/05 cheat description:Start on level 7 code:921f/00/06 cheat description:Infinite health code:00da/40+00db/40 cheat description:Infinite time (alt) code:00eb/09 cartridge sha256:efb93dcae29f1ff85b58ccb9450c23d528073a019493d88a9abcabe4ca9aca4f name:Tatakae! Chou Robot Seimeitai Transformers - Convoy no Nazo (Japan) cheat description:Invincibility code:c238/f0/50+c4a1/a5/60 cheat description:Hit anywhere (enemies and platforms) code:c2c7/24/00+c2ea/90/50+c30b/9d/bd cheat description:Moon jump code:910e/2e/00+9102/3a/00+90f8/27/00 cheat description:Solve level 9 maze using any path code:8278/f0/70 cartridge sha256:d088f4b91a03dd6a618245fffb492bcda127c7faa6d880596aa5e751fdac0181 name:Tecmo Bowl (USA) (Rev A) cheat description:Instant touchdowns - P1 code:816b/03/00 cheat description:Instant touchdowns - P2 code:8d0c/03/00 cheat description:Always kick with max power - P1 code:9bac/02/65+9bab/69/a9 cheat description:Only 2 downs allowed code:8527/04/02+912e/04/02 cheat description:6 downs allowed code:8527/04/06+912e/04/06 cheat description:Infinite time (minutes) code:008b/09 cheat description:Infinite time (seconds) code:008a/99 cheat description:CPU/P2 has 0 points code:0048/00 cartridge sha256:d2b56b27912cfc03756c94df6667fdf923c8a3746fa37e4632eeb4134ef4c200 name:Tecmo Bowl (USA) cheat description:Instant touchdowns - P1 code:816b/03/00 cheat description:Instant touchdowns - P2 code:8d0c/03/00 cheat description:Always kick with max power - P1 code:9bac/02/65+9bab/69/a9 cheat description:Only 2 downs allowed code:8527/04/02+912e/04/02 cheat description:6 downs allowed code:8527/04/06+912e/04/06 cheat description:Infinite time (minutes) code:008b/09 cheat description:Infinite time (seconds) code:008a/99 cheat description:CPU/P2 has 0 points code:0048/00 cartridge sha256:54d809b38573248ff73e104505a57f71f8b4356c8a7983a363c2ee242f878205 name:Tecmo NBA Basketball (USA) cheat description:Infinite timeouts code:b369/de/bd cheat description:2-pt. shots worth 1, 3-pt. shots worth 2 code:b996/01/00 cheat description:2-pt. shots worth 3, 3-pt. shots worth 4 code:b996/01/02 cheat description:2-pt. shots worth 4, 3-pt. shots worth 5 code:b996/01/03 cheat description:2-pt. shots worth 5, 3-pt. shots worth 6 code:b996/01/04 cheat description:2-pt. shots worth 6, 3-pt. shots worth 7 code:b996/01/05 cheat description:3-pt. shots worth 2 pts. code:b9fe/ee/60 cheat description:5-second violations become 10-second violations code:8a5f/07/ff cheat description:No 10-second violations code:9716/0a/ff cheat description:Longer shot clock after getting ball on rebound code:b895/18/58 cheat description:Shorter shot clock after getting ball on rebound code:b895/18/08 cartridge sha256:cd5ad84e6bba35c19098c6f9783b568e4f1218582a12ec0513e5fafbdabb0303 name:Tecmo Super Bowl (USA) cheat description:Infinite time (continuous play) code:a2f9/c6/a5 cheat description:Almost every player has their skill level at 100 code:dde5/2a cheat description:10 minutes per quarter instead of 5 code:a23b/05/10 cheat description:20 minutes per quarter code:a23b/05/20 cheat description:2 minutes per quarter code:a23b/05/02 cheat description:Touchdown scores 0 instead of 6 - P1 code:8616/06/00 cheat description:Touchdown scores 0 - P2 or computer code:8d9e/06/00 cheat description:Touchdown scores 3 - P1 code:8616/06/03 cheat description:Touchdown scores 3 - P2 or computer code:8d9e/06/03 cheat description:Touchdown scores 9 - P1 code:8616/06/09 cheat description:Touchdown scores 9 - P2 or computer code:8d9e/06/09 cheat description:Touchdown scores 12 - P1 code:8616/06/0c cheat description:Touchdown scores 12 - P2 or computer code:8d9e/06/0c cheat description:Extra-point kick scores 0 instead of 1 - P1 code:8703/01/00 cheat description:Extra-point kick scores 0 - P2 or computer code:8e8b/01/00 cheat description:Extra-point kick scores 2 - P1 code:8703/01/02 cheat description:Extra-point kick scores 2 - P2 or computer code:8e8b/01/02 cheat description:Extra-point kick scores 3 - P1 code:8703/01/03 cheat description:Extra-point kick scores 3 - P2 or computer code:8e8b/01/03 cheat description:Extra-point kick scores 6 - P1 code:8703/01/06 cheat description:Extra-point kick scores 6 - P2 or computer code:8e8b/01/06 cheat description:Field goal scores 0 instead of 3 - P1 code:84c4/03/00 cheat description:Field goal scores 0 - P2 or computer code:8c4c/03/00 cheat description:Field goal scores 1 - P1 code:84c4/03/01 cheat description:Field goal scores 1 - P2 or computer code:8c4c/03/01 cheat description:Field goal scores 6 - P1 code:84c4/03/06 cheat description:Field goal scores 6 - P2 or computer code:8c4c/03/06 cheat description:Field goal scores 9 - P1 code:84c4/03/09 cheat description:Field goal scores 9 - P2 or computer code:8c4c/03/09 cheat description:Safety scores 0 instead of 2 - P1 code:8d55/02/00 cheat description:Safety scores 0 - P2 or computer code:85cd/02/00 cheat description:Safety scores 1 - P1 code:8d55/02/01 cheat description:Safety scores 1 - P2 or computer code:85cd/02/01 cheat description:Safety scores 4 - P1 code:8d55/02/04 cheat description:Safety scores 4 - P2 or computer code:85cd/02/04 cheat description:Safety scores 6 - P1 code:8d55/02/06 cheat description:Safety scores 6 - P2 or computer code:85cd/02/06 cartridge sha256:b6adca3680ba28efd41b2216cfcb9af66ed175e4359f0fbd5eda90e6cb6380e8 name:Tecmo World Cup Soccer (Europe) cheat description:Never lose guts code:86b9/91/a9 cheat description:Everyone has more guts code:ddf0/20/50+ddf1/03/06 cartridge sha256:daf07341c80a866333d69c7560f8402123adbb345b15185480393f0db6822b16 name:Tecmo World Wrestling (USA) cheat description:Infinite health - P1 code:d7c5/85/a5 cheat description:Half training time allowed code:d1be/0a/05 cheat description:Double training time allowed code:d1be/0a/14 cheat description:Lose all energy after being on the receiving end of a move code:d79f/91 cartridge sha256:892468d05a1097769d14e0ed4822267760d85dbfc79d83a0235878109f839dd1 name:Teenage Mutant Ninja Turtles (USA) cheat description:Invincibility code:9591/20/ad cheat description:Infinite health code:98db/e5/10 cheat description:Infinite health (alt) code:98e3/99/b9 cheat description:Infinite health (alt 2) code:98db/e5/24 cheat description:10 weapons on pick-up code:96f8/14/0a cheat description:50 weapons on pick-up code:96f8/14/32 cheat description:99 weapons on pick-up code:96f8/14/63 cheat description:20 missiles on pick-up code:973b/0a/14 cheat description:99 missiles on pick-up code:973b/0a/67 cheat description:Don't take damage from non-killing seaweed code:a5e4/99/ad cheat description:Full health boost from pizza slices code:969c/02/00 cheat description:Double rope on pick-up code:9749/03/06 cheat description:Never lose rope code:a3ee/c6/a5 cheat description:Reduce recovery time code:a696/8d/ad cheat description:No sound code:9150/55 cheat description:Start a new game to view the ending code:c621/02/05 cheat description:Invincibility (alt) code:0500/15 cheat description:Infinite health - Leonardo code:0077/80 cheat description:Infinite health - Raphael code:0078/80 cheat description:Infinite health - Michaelangelo code:0079/80 cheat description:Infinite health - Donatello code:007a/80 cheat description:Infinite Ropes code:00a7/09 cheat description:Infinite Missiles code:00bf/63 cheat description:Infinite time on water level code:00bb/32 cheat description:Have Scrolls - Leonardo code:0073/04 cheat description:Have Scrolls - Raphael code:0074/04 cheat description:Have Scrolls - Michaelangelo code:0075/04 cheat description:Have Scrolls - Donatello code:0076/04 cheat description:99 weapons - Leonardo code:00a8/63 cheat description:99 weapons - Raphael code:00a9/63 cheat description:99 weapons - Michaelangelo code:00aa/63 cheat description:99 weapons - Donatello code:00ab/63 cheat description:Permanent rolling power-up (disable on water level) code:0540/91 cartridge sha256:368d7ea3a066d4dc937473ca6cfc3e0d79d928b2308fff5ddd6ff199c7da153d name:Teenage Mutant Ninja Turtles II - The Arcade Game (USA) cheat description:Invincibility (except grabs from behind) - both players code:82b9/f0/d0 cheat description:Infinite health - both players code:8ee5/9d/bd+ec01/9d/bd cheat description:Infinite lives - both players code:8b03/01/00 cheat description:One hit kills - both players code:eaaa/d0/10 cheat description:Stronger turtle weapon code:eaa4/02/09 cheat description:Stronger jump + attack code:ea9c/04/09 cheat description:Stronger jump + attack code:ea9c/04/02 cheat description:Stronger kick code:eaa0/03/09 cheat description:Weaker kick code:eaa0/03/01 cheat description:In two-turtle mode, when one player is revived the other player's spare life won't get used code:8281/c6/a5+8237/c6/a5 cheat description:Enable stage select and 10 lives code code:caef/00/81 cheat description:Press Start to finish the level code:d3dc/01/04+d3de/3d/3c cheat description:Start with 1 life code:d190/02/01 cheat description:Start with 6 lives code:d190/02/06 cheat description:Start with 9 lives code:d190/02/09 cheat description:Invincibility - P1 code:0093/2b cheat description:Invincibility - P2 code:0094/2b cheat description:Infinite health - P1 code:0568/37 cheat description:Infinite health - P2 code:056a/37 cheat description:Infinite lives - P1 code:004d/09 cheat description:Infinite lives - P2 code:004e/09 cheat description:Infinite continues code:03d3/03 cheat description:One hit kills - both players (alt) code:eaaa/10 cheat description:Enable stage select after choosing your turtle code:0025/81 cartridge sha256:9f671090ffd2bb1dc95b9d413c3627f7aa0d576435eeb5b868fa7ca9c29c1190 name:Teenage Mutant Ninja Turtles III - The Manhattan Project (USA) cheat description:Invincibility (except grabs from behind) code:cddc/d0/f0 cheat description:Infinite health code:b22e/de/bd+a449/9d/bd cheat description:Infinite lives code:c2fb/01/00 cheat description:Infinite continues code:dcfc/ce/ad cheat description:No health loss from using turbo attack code:d20f/08/00 cheat description:Hit anywhere - both players code:a806/1e/00+aa7f/d7/00+a810/14/00+a822/ab/18+a820/d9/ea+a821/78/ea cheat description:High-jump code:cf36/40/30 cheat description:Super-jump code:cf36/40/28 cheat description:Mega-jump code:cf36/40/20 cheat description:1 continue code:ac31/03/01 cheat description:9 continues code:ac31/03/09 cheat description:Start with 1 life instead of 4 code:8390/03/00 cheat description:Start with 6 lives code:8390/03/05 cheat description:Start with 9 lives code:8390/03/08 cheat description:Infinite health - P1 code:04f1/7f cheat description:Infinite health - P2 code:04f2/7f cheat description:Infinite lives - P1 code:006a/05 cheat description:Infinite lives - P2 code:006b/05 cheat description:Infinite continues code:07b0/05 cheat description:Enemies automatically die code:0626/00+0627/00+0628/00 cheat description:Start on scene 02 - Ocean code:0058/01 cheat description:Start on scene 03 - Battleship code:0058/02 cheat description:Start on scene 04 - Bridge code:0058/03 cheat description:Start on scene 05 - N.Y. code:0058/04 cheat description:Start on scene 06 - Platform code:0058/05 cheat description:Start on scene 07 - Sewer code:0058/06 cheat description:Start on scene 08 - Sewer 2 code:0058/07 cheat description:Start on scene 09 - Technodrome code:0058/08 cheat description:Start on scene 10 - Technodrome 2 code:0058/09 cheat description:Start on scene 11 - Building code:0058/0a cheat description:Start on scene 12 - Roof code:0058/0b cheat description:Start on scene 13 - Spaceship code:0058/0c cheat description:Start on scene 14 - Spaceship 2 code:0058/0d cheat description:Start on scene 15 - Spaceship 3 code:0058/0e cartridge sha256:10e2091a1c5e3ff3f636944fb274cd61db09dc25d0c14868710675cf1f86fd0b name:Teenage Mutant Ninja Turtles - Tournament Fighters (USA) cheat description:Infinite health code:ee6e/90/a9+ee6f/1b/b0+ee71/bd/8d cheat description:Infinite time code:eacc/ce/2c cheat description:Select ultra strength (ignore strength meter and keep pushing to the right) - both players code:893d/07/ff cheat description:Select any character in story mode code:8362/04/07 cheat description:Infinite continues code:86ca/c6/c1 cheat description:First hit wins round code:80a4/b0/01 cheat description:One round wins match code:8a79/69/a9+8a7a/01/02 cheat description:Start with 1/3 health - both players code:80a4/b0/30 cheat description:Start a new game to view the ending code:f4a3/02/0b cheat description:Infinite health - P1 code:0590/b0 cheat description:No health - P2 / CPU code:0591/00 cheat description:Infinite time (one's digit) code:0673/09 cheat description:Infinite time (ten's digit) code:0672/09 cheat description:Turn off CPU's jumping, blocking and fighting routine code:06c3/00+06c7/00+06c9/00+06cb/00 cartridge sha256:dd89b8e08738243d20740194ef814b011df138d820844ee4e53d3a6e536b1c83 name:Terminator, The (USA, Europe) cheat description:Infinite health code:b8f7/8d/ad cheat description:Infinite Grenades code:f0e5/ce/ad cartridge sha256:6f66d14e5f17ca244444e74538afe31f8abda8376b5b0205afaeb86075407c45 name:Terminator 2 - Judgment Day (USA) cheat description:Infinite health code:eae2/20/2c cheat description:Take minimal damage code:eafc/49/a9+eafd/ff/fe cheat description:Infinite lives code:8196/ce/ad cheat description:Super-jump code:99ed/fc/fa cheat description:Slower running code:9a1e/02/01+9a3a/02/01 cheat description:Faster running code:9a1e/02/03+9a3a/02/03 cheat description:Faster and longer jumping code:9cd4/02/03+9ce0/02/03 cheat description:Start with 1 life code:a379/04/01 cheat description:Start with 9 lives code:a379/04/09 cartridge sha256:667bcf3ca1ebcf6f71fccd412ced546f4aba3b8cd2fc30d173cf6d3b4c15846a name:Terra Cresta (USA) cheat description:Invincibility code:d44b/20/e4 cheat description:Infinite lives code:e649/c6/a5 cheat description:Infinite "ship formation" splits code:ebd3/c6/a5 cheat description:9 "ship formation" splits code:e890/03/09+cec0/03/09 cheat description:A secret mega-weapon code:cfef/03/00 cheat description:Start with 1 life code:d449/02/00 cheat description:Start with 6 lives code:d449/02/05 cheat description:Start with 9 lives code:d449/02/08 cartridge sha256:2ae5fb18a1bf841077e3872ba05060f030ea0bfc573994b2f8fe2fb570dc7853 name:Tetris (USA) cheat description:Lines are cleared when a piece is dropped code:9a94/37/00 cheat description:Disable Game Over (press start) code:9d10/03/04+9a15/f0/4c+9a17/a5/9a+9a16/30/47 cheat description:999999 score with one piece dropped code:9c8b/08/00 cheat description:Puzzle area doesn't disappear on pause code:a3b7/16/1e cheat description:2P interactive game code:8783/f7/f8 cheat description:Need only complete 10 lines in game B code:875c/25/10 cheat description:Faster forced fall rate code:8953/01/09 cheat description:Must complete 50 lines in game B code:875c/25/50 cheat description:Must complete 80 lines in game B code:875c/25/80 cheat description:Next piece is a T-block code:00bf/02 cheat description:Next piece is a J-block code:00bf/07 cheat description:Next piece is a Z-block code:00bf/08 cheat description:Next piece is a square block code:00bf/0a cheat description:Next piece is a S-block code:00bf/0b cheat description:Next piece is a L-block code:00bf/0e cheat description:Next piece is a straight line block code:00bf/12 cartridge sha256:9daa4bec3013ae7ef498318432f438d70374af294d1dce28edd3c466aaf6b740 name:Tetris (USA) (Unl) cheat description:Lines are cleared when a piece is dropped code:87ab/2a/00+87af/26/00 cheat description:Always get straight pieces code:9940/f0/a9+9941/f9/01 cheat description:Speed stays the same code:9b24/24/a9+9b25/2f/21 cheat description:Press down to stop blocks from falling code:8109/04 cheat description:Press down to rotate block very fast code:8109/19 cheat description:Next piece is a straight line block - P1 code:0066/01 cheat description:Next piece is a T-block - P1 code:0066/02 cheat description:Next piece is a square block - P1 code:0066/03 cheat description:Next piece is a J-block - P1 code:0066/04 cheat description:Next piece is a L-block - P1 code:0066/05 cheat description:Next piece is a S-block - P1 code:0066/06 cheat description:Next piece is a Z-block - P1 code:0066/07 cheat description:Next piece is a straight line block - P2 code:0067/01 cheat description:Next piece is a T-block - P2 code:0067/02 cheat description:Next piece is a square block - P2 code:0067/03 cheat description:Next piece is a J-block - P2 code:0067/04 cheat description:Next piece is a L-block - P2 code:0067/05 cheat description:Next piece is a S-block - P2 code:0067/06 cheat description:Next piece is a Z-block - P2 code:0067/07 cheat description:Start at level 0 code:042c/30+042d/30 cheat description:Start at level 1 code:042c/30+042d/31 cheat description:Start at level 2 code:042c/30+042d/32 cheat description:Start at level 3 code:042c/30+042d/33 cheat description:Start at level 4 code:042c/30+042d/34 cheat description:Start at level 5 code:042c/30+042d/35 cheat description:Start at level 6 code:042c/30+042d/36 cheat description:Start at level 7 code:042c/30+042d/37 cheat description:Start at level 8 code:042c/30+042d/38 cheat description:Start at level 9 code:042c/30+042d/39 cheat description:Start at level 10 code:042c/31+042d/30 cheat description:Start at level 11 code:042c/31+042d/31 cheat description:Start at level 12 code:042c/31+042d/32 cheat description:Start at level 13 code:042c/31+042d/33 cheat description:Start at level 14 code:042c/31+042d/34 cheat description:Start at level 15 code:042c/31+042d/35 cheat description:Start at level 16 code:042c/31+042d/36 cheat description:Start at level 17 code:042c/31+042d/37 cheat description:Max score at 999,999 - P1 code:0418/39+0419/39+041a/39+041b/39+041c/39+041d/39 cheat description:Max score at 999,999 - P2 code:041e/39+041f/39+0420/39+0421/39+0422/39+0423/39 cartridge sha256:dd77dc88d380807990f55d0b1b55c151f78c480a0a0895e91d6edfb945ad71d7 name:Tetris 2 (USA) cheat description:(1P game) Speed doesn't increase code:8d3b/9d/08 cheat description:(1P game) Speed increases much faster code:8dbb/9d/fe cheat description:(1P game) Start and stay at speed of 25 code:8fa4/01/06 cheat description:(1P game) Max speed is 2 code:8dcd/19/02+8dd1/18/01 cheat description:(1P game) Max speed is 10 code:8dcd/19/0a+8dd1/18/09 cheat description:(1P game) Max speed is 15 code:8dcd/19/0f+8dd1/18/0e cheat description:(1P game) Max speed is 20 code:8dcd/19/14+8dd1/18/13 cheat description:(1P vs 2P or 1P vs Com) Every round starts with 4 fixed blocks code:817e/b1/a9+817f/00/01 cheat description:(1P vs 2P or 1P vs Com) Every round starts with 10 fixed blocks code:817e/b1/a9+817f/00/07 cheat description:(1P vs 2P or 1P vs Com) Every round starts with 15 fixed blocks code:817e/b1/a9+817f/00/0c cheat description:(1P vs 2P or 1P vs Com) Every round starts with 20 fixed blocks code:817e/b1/a9+817f/00/11 cheat description:(All game types) Cannot pause game code:af66/80/00 cheat description:(All game types) Don't hide remaining pieces during pause code:af89/a2/60 cartridge sha256:18d41a2dc65d8afce295eaf29c391539a69d7cfe6dd32503713ae13d4495a545 name:Thexder (Japan) cheat description:Infinite health code:9d85/85/a5 cheat description:Infinite shield code:980c/c6/a5 cheat description:Start on last level code:0074/63 cartridge sha256:e3be0290f198fceed633b037d9201aa4b95460617551b3a9fb5bb212b153a2d4 name:Thunder & Lightning (USA) cheat description:Infinite lives - P1 code:9371/d6/d5 cartridge sha256:c0c3d7c2682dd2e0dd2122682e2ae3a9ee7aa3d095bd22a36c759c29b5d05615 name:Thunderbirds (USA) cheat description:Don't lose life points when colliding with enemy code:eef1/ce/ad cheat description:Don't lose life points when hit code:ef3b/ce/ad cheat description:Don't lose energy points when colliding with enemy code:eefe/ce/ad cheat description:Don't lose energy points when hit code:ef48/ce/ad cheat description:81 Days to defeat Hood code:c68d/3c/51 cheat description:30 Days to defeat Hood code:c68d/3c/1e cheat description:Limited forward movement code:8728/08/60+872c/08/60 cheat description:Faster craft code:86ae/02/04+86aa/02/04 cheat description:Full firepower on first pick-up code:8e30/c0/a0+8e34/c8/ea cartridge sha256:c56af43761cb601a068cdc88c2fc36f715921dbae9a8a9d8c10479146c47ccb9 name:Thundercade (USA) cheat description:Infinite lives code:f2e1/d6/24 cheat description:Infinite Missiles code:f53b/11/00 cheat description:Infinite Bombs code:f622/d6/24 cheat description:Autofire code:f574/0a/02 cheat description:Start with double Bombs code:f2f9/03/06 cheat description:Start with triple Bombs code:f2f9/03/09 cheat description:Start with 1 life code:f515/03/01 cheat description:Start with 6 lives code:f515/03/06 cheat description:Start with 9 lives code:f515/03/09 cartridge sha256:e115dbf3de0a4e674ff3f9081d7f97b89f636d81ce524119c0af4ef799490695 name:Thunder Warrior (Asia) (Unl) cheat description:Invincibility code:b3be/f0/d0+b3c3/f0/d0 cheat description:Infinite health code:93a4/ce/ad cheat description:Infinite magic code:89c0/ce/ad cheat description:Infinite lives code:807d/ce/ad cheat description:Keep weapon after losing a life code:9bd1/8d/60 cheat description:Start with 9 lives code:a438/03/09 cartridge sha256:403fe1c4454dc1e23fb272c88f70ba30dd5e860ab48ecff59420a09fc84e9a2d name:Tiger-Heli (USA) cheat description:Invincibility code:f050/4c/ad cheat description:Infinite lives - 1P game code:b724/de/bd cheat description:Infinite lives - both players code:b7c5/de/bd+b7eb/de/bd cheat description:Autofire capability code:f2c8/0d/06 cheat description:Burstfire capability code:f2c8/0d/02 cheat description:Turbo boost code:f3ea/12/24 cheat description:Extra life every 5 bonus blocks code:fe5e/0a/03 cheat description:Start with 2 lives - 1P game code:b6bf/02/00 cheat description:Start with 9 lives - 1P game code:b6bf/02/08 cheat description:Start with 6 lives - P1 in a 2P game code:b75f/02/05 cheat description:Start with 9 lives - P1 in a 2P game code:b75f/02/08 cheat description:Start with 6 lives - P2 code:b772/02/05 cheat description:Start with 9 lives - P2 code:b772/02/08 cheat description:Start with 2 little-helis after dying code:b863/4a/ea cartridge sha256:13353e4e94633eba066e024ea7050b0801a8ccbe4c03bd97656852df4d2f3359 name:Time Lord (USA) cheat description:Infinite health code:d16b/8d/ad cheat description:Infinite lives code:cc3d/ce/ad cheat description:Hit anywhere code:d789/18/00+fb05/b0/90 cheat description:Moonwalking (don't combine with super speed) code:ce2a/01/00+ce36/00/01 cheat description:Super speed (don't combine with moonwalking) code:ced9/00/01+ce95/00/01 cheat description:Start with 1 life code:c18f/03/01 cheat description:Start with 6 lives code:c18f/03/06 cheat description:Start with 9 lives code:c18f/03/09 cartridge sha256:c47a01c9b32642ad3145316804e64b0475a20863e42e81d17c664d03dcdde3c5 name:Tiny Toon Adventures (USA) cheat description:Invincibility code:814c/d0/f0 cheat description:Infinite health after collecting one heart code:9e1d/ce/ad cheat description:Infinite health and one Carrot code:829f/ac/8d cheat description:Infinite time code:da47/de/dd cheat description:Infinite lives code:9f7b/ce/ad cheat description:Slow down timer code:da22/3b/7f cheat description:Speed up timer code:da22/3b/1f cheat description:Multi-jump code:9651/29/00 cheat description:Pick-up more hearts code:9781/01/00 cheat description:Power decreases slower when using Dizzy Devil's spin attack code:91ed/02/01 cheat description:Press Start to finish the level (don't use on 6-3) code:d9f6/01/0c+d9f8/4d/4c cheat description:Start a new game to view the ending code:cf9d/00/10 cheat description:1 life after continue code:aaa7/02/00 cheat description:6 lives after continue code:aaa7/02/05 cheat description:9 lives after continue code:aaa7/02/08 cheat description:Start with 1 life code:cf2b/02/00 cheat description:Start with 6 lives code:cf2b/02/05 cheat description:Start with 9 lives code:cf2b/02/08 cheat description:Start on level 2 code:cf51/85/86+cf2f/a9/a2+cf30/01/05 cheat description:Start on level 3 code:cf51/85/86+cf2f/a9/a2+cf30/01/0a cheat description:Start on level 4 code:cf51/85/86+cf2f/a9/a2+cf30/01/0f cheat description:Start on level 5 code:cf51/85/86+cf2f/a9/a2+cf30/01/14 cartridge sha256:d4a94fd07859485fc2aac73d627933b70e1977c93b744ec3d71b66d4365ab7f7 name:Tiny Toon Adventures 2 - Trouble in Wackyland (USA) cheat description:Invincibility code:8012/a5/85+8014/f0/d0 cheat description:Infinite time code:f230/20/ad cheat description:Protection against hits on log ride code:aabe/ce/ad cheat description:Protection against hits on train code:8558/ce/ad cheat description:Protection against hits on bumper cars code:9a1b/ce/ad cheat description:Protection against hits on roller coaster code:83c7/ce/ad cheat description:Protection against hits in fun house code:8153/ce/ad cheat description:Log ride costs nothing instead of 3 tickets code:9177/03/00 cheat description:Log ride costs 5 tickets code:9177/03/05 cheat description:Train costs nothing instead of 2 tickets code:9175/02/00 cheat description:Train costs 5 tickets code:9175/02/05 cheat description:Roller coaster costs nothing instead of 4 tickets code:9171/04/00 cheat description:Roller coaster costs 6 tickets code:9171/04/06 cheat description:Bumper cars cost nothing instead of 1 ticket code:9173/01/00 cheat description:Bumper cars cost 4 tickets code:9173/01/04 cheat description:Fun house costs nothing instead of 50 normal tickets code:917a/05/00 cheat description:Fun house costs 10 normal tickets code:917a/05/01 cheat description:Fun house costs 90 normal tickets code:917a/05/09 cheat description:Start a new game to view the ending code:f745/08/09 cheat description:Start with 20 tickets instead of 10 code:f701/01/02 cheat description:Start with 50 tickets instead of 10 code:f701/01/05 cheat description:Start with 90 tickets instead of 10 code:f701/01/09 cheat description:Start with 110 tickets instead of 10 code:f6e8/8d/ee cartridge sha256:f80e57788e32f73852d7d2aa4831edfe4c4bd5b8a02a322995263a13597c2f0c name:Titan Warriors (USA) (Proto) cheat description:Invincibility against enemies code:fc5d/85/a5 cheat description:Infinite lives code:9453/ce/ad cartridge sha256:44569cef71a0b859bd0390e0155b19077ddef4a684f6fba6569a5f918910d4a2 name:To the Earth (USA) cheat description:Shots use up no energy code:be0a/04/00 cheat description:Shots use up less energy code:be0a/04/02 cheat description:Shots use up more energy code:be0a/04/08 cheat description:Enemy bombs do no damage code:efb8/14/00 cheat description:Enemy bombs do half damage code:efb8/14/08 cheat description:Enemy bombs do more damage code:efb8/14/28 cheat description:Bonus energy for shooting enemy code:be88/0a/14 cheat description:Less energy for shooting enemy code:be88/0a/04 cheat description:No energy for shooting enemy code:be88/0a/00 cartridge sha256:e580f51b06217b102e56ec98fff7c4ebad5b925fa3a28042d67433cffa8c5cdc name:Toki (USA) cheat description:Infinite health code:80df/ce/80 cheat description:Infinite weapons code:937c/ee/ad+938b/ee/ad+939a/8d/ad cheat description:Infinite time code:8f4e/01/00 cheat description:Infinite lives code:f5f2/ce/ad cheat description:Hit anywhere - normal enemies code:86de/9d/ad+8681/60/ea cheat description:When weapon runs out of ammo it's replaced with the double weapon code:9396/00/01 cheat description:When weapon runs out of ammo it's replaced with the wave weapon code:9396/00/02 cheat description:When weapon runs out of ammo it's replaced with the 3-way weapon code:9396/00/03 cheat description:When weapon runs out of ammo it's replaced with the flame weapon code:9396/00/04 cheat description:When weapon runs out of ammo it's replaced with the fireball weapon code:9396/00/05 cheat description:Start with less time code:d804/03/01+8044/03/01 cheat description:Start with more time code:d804/03/05+8044/03/05 cheat description:Start with even more time code:d804/03/09+8044/03/09 cheat description:Start with one heart - first life only code:f509/02/01 cheat description:Start with one heart - after first life code:f5f6/02/00 cheat description:Start with 1 life code:ffc2/02/00 cheat description:Start with 2 lives code:ffc2/02/01 cheat description:Start with 5 lives code:ffc2/02/04 cheat description:Start with 9 lives code:ffc2/02/08 cheat description:Infinite health - P1 code:011c/02 cheat description:Infinite time (hundred's digit) code:0576/09 cheat description:Infinite time (ten's digit) code:0577/09 cheat description:Infinite time (one's digit) code:0578/09 cheat description:Infinite lives - P1 code:0114/09 cheat description:Infinite Coins (ten's digit) code:0118/09 cheat description:Infinite Coins (one's digit) code:0119/09 cheat description:Start on stage 2 - Lake Neptune code:0116/01 cheat description:Start on stage 3 - Cavern Of Fire code:0116/02 cheat description:Start on stage 4 - Ice Palace code:0116/03 cheat description:Start on stage 5 - Dark Jungle code:0116/04 cheat description:Start on stage 6 - Golden Palace code:0116/05 cartridge sha256:b49e3b3c2a307e9c24715ea5863d6c80b805f9566eb1f468a4c701cf54605a5a name:Tom & Jerry - The Ultimate Game of Cat and Mouse! (USA) cheat description:Infinite health code:f0a1/01/00 cheat description:Infinite lives code:f0df/ce/ad cheat description:Minimum health (one touch kills) code:f0a1/01/03 cheat description:Start with 1 life code:fa5e/03/01 cheat description:Start with 6 lives code:fa5e/03/06 cheat description:Start with 9 lives code:fa5e/03/09 cheat description:Start on world 2 code:f9e4/00/08 cheat description:Start on world 3 code:f9e4/00/10 cheat description:Start on world 4 code:f9e4/00/18 cheat description:Start on world 5 code:f9e4/00/20 cartridge sha256:fe052f7f6b4b41dcbc009860e0c997c31e2e236eb46d713137ee773cce96105e name:Toobin' (USA) (Unl) cheat description:Infinite lives code:e5b4/c6/a5 cheat description:Infinite cans code:a502/c6/a5 cheat description:Turbo left and right movement code:a04e/20/30+a06b/20/30 cheat description:Start with 2 lives code:e612/03/01 cheat description:Start with 6 lives code:e612/03/06 cheat description:Start with 9 lives code:e612/03/09 cheat description:Start with 18 cans code:e616/06/12 cheat description:Start with 12 cans code:e616/06/0c cheat description:Start with 1 can code:e616/06/01 cheat description:Start on level 2 code:a810/00/01 cheat description:Start on level 4 code:a810/00/03 cheat description:Start on level 6 code:a810/00/05 cheat description:Start on level 8 code:a810/00/07 cheat description:Invincibility (glitchy) code:02d3/00 cheat description:Infinite patches code:006e/09 cheat description:Infinite cans (alt) code:004c/ff cheat description:Have all letters code:006d/7f cheat description:Faster shots code:003f/02 cheat description:Don't go into dying animation (use with invincibility) code:004a/00+004b/00 cartridge sha256:e788ae1dff1b868795395e19357525b93ddd52ac86f6a505d14eac5fa323b023 name:Top Gun (USA) (Rev A) cheat description:Immune to Bullets (not Missiles) code:dbcf/03/00 cheat description:Infinite fuel code:dcbf/c6/24 cheat description:Infinite Missiles code:ddc4/c6/24 cheat description:Take off with double Hound Missiles code:c18e/28/50 cheat description:Take off with double Wolf Missiles code:c18f/14/28 cheat description:Take off with double Tiger Missiles code:c190/0a/14 cheat description:Start with half fuel code:c17b/0a/05 cheat description:Start on mission 2 code:c103/01/02 cheat description:Start on mission 3 code:c103/01/03 cheat description:Start on mission 4 code:c103/01/04 cheat description:Infinite health code:004e/0c cheat description:Infinite fuel (alt) code:0036/0a cheat description:Infinite lives code:0031/02 cheat description:Infinite Missiles code:003c/3f cartridge sha256:aa43f3138d4f731e5e8df530dbf8fc1f6f45303b84589f7a0715e392887f3dff name:Top Gun (USA) cheat description:Immune to Bullets (not Missiles) code:dbcf/03/00 cheat description:Infinite fuel code:dcbf/c6/24 cheat description:Infinite Missiles code:ddc4/c6/24 cheat description:Always land safely on Aircraft Carrier code:b725/04/00+b623/85/a5 cheat description:Take off with double Hound Missiles code:c18e/28/50 cheat description:Take off with double Wolf Missiles code:c18f/14/28 cheat description:Take off with double Tiger Missiles code:c190/0a/14 cheat description:Start with half fuel code:c17b/0a/05 cheat description:Start on mission 2 code:c103/01/02 cheat description:Start on mission 3 code:c103/01/03 cheat description:Start on mission 4 code:c103/01/04 cheat description:Infinite health code:004e/0c cheat description:Infinite fuel (alt) code:0036/0a cheat description:Infinite lives code:0031/02 cheat description:Infinite Missiles code:003c/3f cartridge sha256:55375474cdebdb05eeec27494761b686a7df63b8f874516004f1739760665c87 name:Top Gun - The Second Mission (USA) cheat description:Invincibility code:8b86/f0/50 cheat description:Infinite lives code:f563/c6/a5 cheat description:Infinite missiles - 1P game code:8f4b/01/00 cheat description:Infinite missiles - 2P game code:85f2/01/00 cheat description:60 Phoenix missiles - 1P game code:a5e6/94/bc cheat description:20 Phoenix missiles - 2P game code:a5ee/85/94 cheat description:Start with 1 life code:f350/03/01 cheat description:Start with 6 lives code:f350/03/06 cheat description:Start with 9 lives code:f350/03/09 cartridge sha256:45067f85328eabb3b8cb2bceec72192bfa8d73494521660f171b9ed6d151fdea name:Total Recall (USA) cheat description:Infinite health code:e8f9/a4/60 cheat description:Most enemies easier to kill code:d2b5/9d/2c cheat description:Take less damage code:e8fc/0c/09 cheat description:Gain maximum health from canisters code:eb3f/ea/f2 cheat description:Start with less health code:c978/a5/a9+c979/2b/30 cheat description:Start with more health code:c978/a5/a9+c979/2b/ff cheat description:Invincibility code:007f/03 cheat description:Infinite health (alt) code:02c0/fa cartridge sha256:0bd29c5b583570e195e05a4272e69b74257db1f4ff928d59c8eb1022bad871ce name:Totally Rad (USA) cheat description:Infinite health code:f4ee/f9/ed cheat description:Infinite magic code:84a1/fd/2c cheat description:Immune to fire and water code:8567/c6/a5 cheat description:Infinite lives code:825f/ce/ad cheat description:Super-jump code:8497/10/18 cheat description:Mega-jump code:8497/10/1f cheat description:Half a life or half magic give full health or magic code:988f/03/06 cheat description:Start with 1 life code:aebd/02/00 cheat description:Start with 6 lives code:aebd/02/05 cheat description:Start with 9 lives code:aebd/02/08 cheat description:Infinite health (alt) code:006e/0c cheat description:Infinite lives (alt) code:05d4/63 cartridge sha256:5ec7c3e91bfd5800073286ee978b1d152c19f924837788eb72700c7c01261fa4 name:Tower of Druaga, The (Japan) cheat description:Invincibility code:b6f8/a5/a9+b403/a5/a9 cheat description:Infinite lives code:00cb/03 cheat description:Infinite time code:00b7/69 cheat description:Doors are always open code:0099/40 cheat description:Treasure instantly appears code:00e5/01 cartridge sha256:c3fec0650f1709911432e8953a6075cb5883601a209323ba0744cb19d82b7f80 name:Toxic Crusaders (USA) cheat description:Infinite lives code:b5c6/84/a4 cheat description:Infinite health code:e4af/85/a5 cheat description:Never lose Mop code:efa2/8d/ad+b850/00/01 cheat description:Invincibility code:020f/00 cheat description:Infinite health (alt) code:00de/08 cheat description:Infinite lives (alt) code:00dd/09 cheat description:Never lose weapon code:020b/01 cartridge sha256:a2812d80b3057aac9753f48247a7a46b29bea0b9aec04ca4c327180085c25b58 name:Track & Field (USA) cheat description:Almost always qualify in Skeet Shooting and Archery code:c72e/ec/e7 cheat description:You don't have to score any points to qualify for Skeet Shooting, Triple Jump and Archery code:c4bd/c4/c3 cartridge sha256:58d2f6abe4445dadc332f37a34af54e78b6af47a8c0e6313ef898ef6db046f4f name:Treasure Master (USA) cheat description:Invincibility code:9af3/b8/e4+9af4/05/03 cheat description:Infinite health code:ec45/c6/c5 cheat description:Infinite lives code:808e/c6/a5 cheat description:Infinite oxygen code:a1ef/ce/cd cheat description:Infinite health (alt) code:00f6/07 cheat description:Infinite lives (alt) code:00f5/07 cheat description:Infinite Oxygen (alt) code:0435/ff cheat description:Infinite Fuse code:04a2/80 cartridge sha256:6b2004f30e7de67dfb86db7446f2204695a3a9b9b367bacf401dbf14bb1a74f2 name:Trog! (USA) cheat description:Infinite lives code:8126/de/ea cartridge sha256:a5ae39359aa5b16961a98a7aaeeb278787382d5282ee80b5b3a2de954283ebb7 name:Trojan (USA) cheat description:Infinite health - both players code:d26a/ce/ad cheat description:Infinite health - both players (alt) code:a4b4/3f/ff+fc68/3f/ff cheat description:Infinite time code:9484/de/2c cheat description:One hit kills code:d10b/ad/ee cheat description:Hit anywhere code:884f/56/00+f47d/1b/00+a713/25/00+8862/43/00+f489/0f/00+dbf0/18/00+f3bd/db/00+f3b1/e7/00+dbe3/25/00+a71f/b0/24 cheat description:Keep High-jump Boots on pick-up code:eacc/ce/ad cheat description:Always have High-jump Boots code:d3f0/1f/00 cheat description:Multi-jump - both players code:d338/1c/00+d3d2/d8/00+d3c5/f0/24 cheat description:Start with a health boost code:cb53/08/0f cheat description:Start with a super health boost code:cb53/08/1e cheat description:Start with half usual health code:cb53/08/04 cheat description:Start with 1 life - P1 code:c9fa/03/01 cheat description:Start with 1 life - P2 code:ca1f/03/01 cheat description:Start with 6 lives - P1 code:c9fa/03/06 cheat description:Start with 6 lives - P2 code:ca1f/03/06 cheat description:Start with 9 lives - P1 code:c9fa/03/09 cheat description:Start with 9 lives - P2 code:ca1f/03/09 cheat description:Start with 187 lives - P1 code:c9fa/03/f0 cheat description:Start with 196 lives - P2 code:ca1f/03/f0 cheat description:Start with 100 seconds code:cb58/02/01 cheat description:Start with 900 seconds code:cb58/02/09 cheat description:Infinite health (alt) code:0335/08 cheat description:Have Key code:0386/02 cheat description:Have High-jump Boots code:03cb/0e cheat description:Have Speed-Up code:03cc/ff cheat description:Have Power-Up code:03cd/ff cheat description:Start on level 2-1 code:03d1/02 cheat description:Start on level 2-2 code:03d1/03 cheat description:Start on level 3-1 code:03d1/04 cheat description:Start on level 3-2 code:03d1/05 cheat description:Start on level 4-1 code:03d1/06 cheat description:Start on level 4-2 code:03d1/07 cheat description:Start on level 5-1 code:03d1/08 cheat description:Start on level 5-2 code:03d1/09 cheat description:Start on level 6-1 code:03d1/0a cheat description:Start on level 6-2 code:03d1/0b cheat description:Start on level 7-1 code:03d1/0c cartridge sha256:5699da9924f31e0f1b7d5cacd05111786881b7a87da38a99aee092fc855ab353 name:Trolls in Crazyland, The (Europe) cheat description:Invincibility code:92ee/f0/60 cheat description:One hit kills code:a268/02/00 cheat description:Hit anywhere code:9133/1c/00 cartridge sha256:0b5d1465b23e31f24e1caecf1490f97a60deb97ba873a36fa948adb016e9c0d2 name:Trolls on Treasure Island (USA) (Unl) cheat description:Infinite time code:ce13/86/dd cheat description:Only one jewel needed to clear stage code:df77/d0/f0 cartridge sha256:e2b26560d326cc626736efa2addf1c66f5af77913968fcf5cde738188c4a0132 name:Twin Cobra (USA) cheat description:Infinite lives code:d26c/ce/ad cheat description:Infinite Bombs code:f972/ce/ad cheat description:Infinite continues code:c64f/01/00 cheat description:Autofire code:f916/1b/00 cheat description:Keep weapon type after death code:d276/85/24 cheat description:Keep super chargers after death code:d278/85/24 cheat description:9 Bombs after dying code:d270/03/0a cheat description:20 Bombs after dying code:d270/03/14 cheat description:Start with 1 life code:c5b2/02/00 cheat description:Start with 6 lives code:c5b2/02/05 cheat description:Start with 9 lives code:c5b2/02/08 cheat description:Start with 1 life after a continue code:c67b/02/00 cheat description:Start with 6 lives after a continue code:c67b/02/05 cheat description:Start with 9 lives after a continue code:c67b/02/08 cheat description:Start with 9 continues code:c59d/05/09 cheat description:Start with 9 Bombs code:cd04/03/0a cheat description:Start with 20 Bombs code:cd04/03/14 cartridge sha256:8eb6aa7818f1cac84af0f91350b167f2884dba45073c9f00510f47d0a38e4192 name:Twin Eagle (USA) cheat description:Infinite lives - P1 code:d99e/c6/a5 cheat description:Infinite Bombs on pick-up - P1 code:ddfa/ce/ad cheat description:Infinite Bombs on pick-up - P2 code:df52/ce/ad cheat description:Never lose weapons - P1 code:eb4e/8d/f0+eb4f/a4/07 cheat description:Never lose weapons - P2 code:ebac/8d/f0+ebad/a5/07 cheat description:1 life after a continue - P1 code:ce0a/03/01 cheat description:4 lives after a continue - P1 code:ce0a/03/04 cheat description:7 lives after a continue - P1 code:ce0a/03/07 cheat description:Start with 7 lives - both players code:e185/03/07 cheat description:Start with 4 lives - both players code:e185/03/04 cheat description:Start with 1 life - both players code:e185/03/01 cartridge sha256:4b9c46714fa085d61ad1177b72bdaa9428d104a171eb6335a03bf06ad9782389 name:TwinBee (Japan) cheat description:Invincibility code:0093/10 cartridge sha256:ef818c90f326383d13087b6e0131bf36563d76c3c1a3c13821c79368e377cf8d name:Ufouria - The Saga (Europe) cheat description:Invincibility code:806e/f0/d0+874b/f0/d0 cheat description:Start with all characters code:e7df/1f/01+e7e1/00/07 cartridge sha256:af5ac55d6283b709bcd96889708a6e7ad3c77e3bdd377aae796fd87b4b90dc4b name:Ultima - Exodus (USA) cheat description:Take no damage from most monsters code:cc39/e5/24 cheat description:No limit on stat points code:8e94/08/00 cheat description:Never lose tools code:d120/01/00 cheat description:Never lose magic code:da6b/91/94 cheat description:Never miss with the Fight command code:d0f9/80/48 cheat description:Can always attack with the Fight command code:d0dc/1e/00 cheat description:One hit kills code:b92b/90/d0 cheat description:Rapid magic recovery code:8739/01/00+8734/d1/b1 cheat description:Start with 5 of each item code:9196/01/05 cheat description:Start with 10 of each item code:9196/01/0a cheat description:Start with 40 of each item code:9196/01/f0 cheat description:Start with 35,328 gold code:9188/64/8a+9186/30/31 cheat description:Start with 512 gold code:9188/64/02+9186/30/31 cheat description:Start with 200 gold code:9188/64/c8 cheat description:Start with 75 stat points code:8e83/2e/47+8fb6/32/4b+9059/32/4b cheat description:Start with 5F stat points code:8e83/2e/5b+8fb6/32/5f+9059/32/5f cartridge sha256:bb625b8df6ddbeb991bb1cbf9b818a5352dcd4856d84640612b2df66148c442f name:Ultima - Quest of the Avatar (USA) cheat description:Infinite MP code:a032/99/b9 cheat description:Infinite Herbs code:ec9f/de/bd cheat description:Infinite Oil code:bc74/ce/ad cheat description:Infinite Torches code:b28d/de/bd cheat description:Infinite Gems code:b5ec/ce/ad cheat description:No random battles code:e952/85/a5 cheat description:Heal costs nothing instead of 70 code:d5c6/46/00 cheat description:Cure poison costs nothing code:d563/0a/00 cheat description:Axe costs 1 instead of 225 code:8f0f/e1/01 cheat description:Staff costs 1 instead of 20 code:8f0b/14/01 cheat description:Sword costs 144 instead of 400 code:8f12/01/00 cheat description:Bow costs 168 instead of 680 code:8f04/02/00 cheat description:Leather costs 1 instead of 200 code:8f21/c8/01 cheat description:Chain costs 88 instead of 600 code:8f24/02/00 cheat description:Plate costs 196 instead of 2500 code:8f2a/09/00 cheat description:Start with perfect virtues (worthy of Avatarhood) code:9562/32/63 cheat description:Start with 8336 Gold Pieces code:9546/01/20 cheat description:Start with 4240 Gold Pieces code:9546/01/10 cheat description:Start with 144 Gold Pieces (for experts) code:9546/01/00 cheat description:Start with 100 Ash instead of 8 code:9625/08/64 cheat description:Start with 100 Ginseng instead of 8 code:9626/08/64 cheat description:Start with 100 Garlic instead of 9 code:9627/09/64 cheat description:Start with 100 Silkweb instead of 7 code:9628/07/64 cheat description:Start with 100 Moss instead of 8 code:9629/08/64 cheat description:Start with 100 Pearl instead of 4 code:962a/04/64 cheat description:Start with 100 Fungus instead of none code:962b/00/64 cheat description:Start with 100 Manroot instead of none code:962c/00/64 cheat description:Mage starts with 712 HP code:95e6/00/02 cheat description:Mage starts with 381 EXP code:9616/00/01 cheat description:Mage starts with Strength of 32 code:95fd/10/20 cheat description:Fighter starts with Strength of 48 code:95ff/1b/30 cheat description:Fighter starts with 255 EXP code:9619/cd/ff cheat description:Fighter starts with 812 HP code:95ea/01/03 cheat description:Fighter starts with 75 MP code:95f7/00/4b cartridge sha256:1e8966fd8c9baf57c514fbf4d67ddd8c1ffd184be164f99342ccdec62def8db2 name:Ultima - Warriors of Destiny (USA) cheat description:Infinite consumable items such as food and torches - May not be able to discard some items code:edd2/de/bd cheat description:A night at the Wayfarer Inn is free code:a105/32/00 cheat description:At Healer's Herbs - Sulfurous ash is free instead of 1 GP code:a0b1/01/00 cheat description:At Healer's Herbs - Ginseng is free instead of 2 GP code:a0b4/02/00 cheat description:At Healer's Herbs - Garlic is free instead of 2 GP code:a0b7/02/00 cheat description:At Healer's Herbs - An Tym Scroll is free instead of 100 GP code:a0bd/64/00 cheat description:At Healer's Herbs - Spellbook is free instead of 150 GP code:a0c0/96/00 cheat description:At Healer's Herbs - Spidersilk is free instead of 4 GP code:a0ba/04/00 cheat description:From Pendra - Spidersilk is free instead of 4 GP code:a08a/04/00 cheat description:From Pendra - Black Pearl is free instead of 3 GP code:a087/03/00 cheat description:From Pendra - Garlic is free instead of 2 GP code:a084/02/00 cheat description:From Pendra - Ginseng is free instead of 2 GP code:a081/02/00 cheat description:From Pendra - Sant Talisman is free instead of 75 GP code:a08d/4b/00 cheat description:At Iolo's Bows - Bow is free instead of 75 GP code:a00d/4b/00 cheat description:At Iolo's Bows - Wooden shield is free instead of 25 GP code:a00a/19/00 cheat description:At Iolo's Bows - Dagger is free instead of 3 GP code:a004/03/00 cheat description:At Iolo's Bows - Short sword is free instead of 40 GP code:a007/28/00 cheat description:At Iolo's Bows - Crossbow is free instead of 150 GP code:a010/96/00 cheat description:At Iolo's Bows - Arrow is free instead of 1 GP code:a016/01/00 cheat description:At Iolo's Bows - Bolt is free instead of 2 GP code:a019/02/00 cheat description:At Iolo's Bows - Sell Dagger for 2,305 instead of 1 GP code:a110/00/09 cheat description:At Iolo's Bows - Sell Short sword for 2,848 instead of 20 GP code:a113/40/03 cheat description:At Iolo's Bows - Sell Wooden shield for 3,850 instead of 10 GP code:a116/00/0f cheat description:At Iolo's Bows - Magic bow is free instead of 800 GP code:a013/20/00+a014/03/00 cheat description:Start new game with 201 instead of 1,225 GP code:aad8/04/00 cheat description:Start new game with 4,297 instead of 1,225 GP code:aad8/04/10 cheat description:Start new game with 32,713 instead of 1,225 GP code:aad8/04/7f cheat description:Infinite Health - Avatar code:6a06/0f cheat description:Infinite Health - Shamino code:6a07/0f cheat description:Infinite Health - Iolo code:6a08/0f cartridge sha256:8dda0b6bcb5d66fd6983f71f9257225ce053822cbb5edda5d072feeddec9358e name:Ultimate Air Combat (USA) cheat description:Infinite Chaff code:a01d/ce/ad cheat description:Infinite Missiles code:a5e2/ce/ad+a60c/ce/ad cartridge sha256:f4de2a91acb2eb3024fb75231859a30c130c0169be0e6ad24330805c8f766e03 name:Ultimate Stuntman, The (USA) (Unl) cheat description:Infinite time code:d2ff/ce/ad cheat description:Infinite 'Crez' weapon until end of stage code:dbaf/ce/ad cheat description:Minimum damage taken code:a9b4/e5/e9+a9b5/ff/01 cheat description:Don't lose a life on Ground Pursuit, Boat and Hang Glider stages code:8cb1/ce/2c cheat description:9 seconds on clock pick-up code:a8ad/06/09 cheat description:Full energy on pick-up code:a992/02/00 cheat description:Shield lasts longer on Human Fly stages code:ae2e/78/ff cheat description:Shield lasts a shorter time on Human Fly stages code:ae2e/78/40 cheat description:Don't lose a life against end-of-stage bosses and on street combat stages code:affc/ce/ad cheat description:Don't lose a life on Human Fly stages code:bdaa/ce/ad cheat description:Start with 1 life (first credit only) code:ecff/02/00 cheat description:Start with 6 lives (first credit only) code:ecff/02/05 cheat description:Start with 9 lives (first credit only) code:ecff/02/08 cartridge sha256:c7ad19e926809adc47c0b44c852e19be7a95e7235ee58cb753e68d7cdee9c89c name:Uncanny X-Men, The (USA) cheat description:Infinite life code:8d8a/e5/a5 cheat description:Half life - Wolverine code:a1b1/c8/64 cheat description:Half life - Cyclops code:a1b7/c8/64 cheat description:Half life - Nightcrawler code:a1bd/82/41 cheat description:Half life - Iceman code:a1c3/be/5f cheat description:Half life - Colossus code:a1c9/ff/7f cheat description:Half life - Storm code:a1cf/a0/50 cartridge sha256:018f8a4f35d15af7891070cbfe6232791d603e92cbd95a49527e80f3825e770d name:Untouchables, The (USA) (Rev B) cheat description:Infinite energy code:0092/40 cheat description:Infinite ammo code:00c6/02+00c8/02 cheat description:Infinite time code:009a/09 cartridge sha256:9048cc77abdfd688395b2f8d1889d3d295d378c649cccbdf79f364fc73217051 name:Untouchables, The (USA) (Rev A) cheat description:Infinite energy on scenes 1 and 4 code:8418/d6/b5 cheat description:Infinite energy on scene 2 code:86c0/c6/a5 cheat description:Infinite time on scenes 1 and 4 code:84b2/c6/a5 cheat description:More time on scene 1 code:81ab/02/04 cheat description:Less time on scene 1 code:81ab/02/01 cheat description:More time on scene 2 code:802b/04/06 cheat description:Less time on scene 2 code:802b/04/02 cheat description:More time on scene 3 code:802f/04/06 cheat description:Less time on scene 3 code:802f/04/02 cheat description:More time on scene 5 code:8021/05/06 cheat description:Less time on scene 5 code:8021/05/03 cheat description:More time on scene 7 code:8018/01/02 cheat description:More ammo picked up on scene 2 code:847e/10/20 cheat description:Less ammo picked up on scene 2 code:847e/10/05 cheat description:More ammo picked up on scene 7 code:801c/06/09 cheat description:Start on scene 2 code:c02e/0c/00 cheat description:Start on scene 3 code:c02e/0c/02 cheat description:Start on scene 4 code:c02e/0c/04 cheat description:Start on scene 5 code:c02e/0c/06 cheat description:Start on scene 7 code:c02e/0c/0a cheat description:Infinite energy code:0092/40 cheat description:Infinite ammo code:00c6/02+00c8/02 cheat description:Infinite time code:009a/09 cartridge sha256:43198592f96005c1492165d5af8d41859dc164a99e39e37eff264ae5e0c63b75 name:Untouchables, The (USA) cheat description:Infinite energy on scenes 1 and 4 code:8418/d6/b5 cheat description:Infinite energy on scene 2 code:86c0/c6/a5 cheat description:Infinite time on scenes 1 and 4 code:84b2/c6/a5 cheat description:More time on scene 1 code:81ab/02/04 cheat description:Less time on scene 1 code:81ab/02/01 cheat description:More time on scene 2 code:802b/04/06 cheat description:Less time on scene 2 code:802b/04/02 cheat description:More time on scene 3 code:802f/04/06 cheat description:Less time on scene 3 code:802f/04/02 cheat description:More time on scene 5 code:8021/05/06 cheat description:Less time on scene 5 code:8021/05/03 cheat description:More time on scene 7 code:8018/01/02 cheat description:More ammo picked up on scene 2 code:847e/10/20 cheat description:Less ammo picked up on scene 2 code:847e/10/05 cheat description:More ammo picked up on scene 7 code:801c/06/09 cheat description:Start on scene 2 code:c02e/0c/00 cheat description:Start on scene 3 code:c02e/0c/02 cheat description:Start on scene 4 code:c02e/0c/04 cheat description:Start on scene 5 code:c02e/0c/06 cheat description:Start on scene 7 code:c02e/0c/0a cheat description:Infinite energy code:0092/40 cheat description:Infinite ammo code:00c6/02+00c8/02 cheat description:Infinite time code:009a/09 cartridge sha256:7255ab27932f7c07fa61c230a51342b0441ea9b24ba094ae3129ec7453de2449 name:Urban Champion (World) cheat description:Infinite time code:e312/c6/24 cheat description:Powerful quick punches code:d482/04/08 cheat description:Super powerful quick punch code:d482/04/16 cheat description:Speed up the timer code:e2fe/06/03 cheat description:Become a stronger fighter code:d32b/01/00 cheat description:Become a weaker fighter code:d32b/01/03 cheat description:Infinite stamina code:00ca/99 cartridge sha256:433f6bcbd59a9d5916d2209ddeacd39d24810c1ed21a33366171b4991fc7e844 name:Vice - Project Doom (USA) cheat description:Invincibility code:dd78/17/00 cheat description:Infinite lives code:c15d/ce/ad cheat description:Infinite time code:fd7f/ce/ad cheat description:Infinite grenades code:fc62/ce/ad cheat description:Infinite bullets code:fc4a/ce/ad cheat description:Infinite power code:fce6/8d/ad cheat description:Hit anywhere code:f882/e8/00 cheat description:Multi-jump code:c5ed/4a/ea cheat description:10 coins for an extra life code:fc97/64/0a cheat description:25 coins for an extra life code:fc97/64/19 cheat description:20 extra Grenades on pick-up code:fb88/05/14 cheat description:25 extra Bullets on pick-up code:fba2/0a/19 cheat description:Start timer for round 1 at 150 code:8419/fa/96 cheat description:Start timer for round 2 at 150 code:8432/fa/96 cheat description:Start with 99 grenades code:fb7a/05/63 cartridge sha256:8104dc7acdaea42b027b2cc7b05dc6a1ffdba6e74b35581c2bb0250df89a28fa name:Vindicators (USA) (Unl) cheat description:Infinite lives code:8634/d6/b4 cheat description:Automatic fuel replenishment code:cd38/d6/f6 cheat description:Never lose Stars code:8a1e/f9/2c cheat description:Quicker shot re-load code:c63f/12/02 cheat description:Turbo speed code:c64b/0c/1b cheat description:Start with increased shot range code:c647/08/20 cheat description:Start with 10 Stars code:81e0/85/e6 cheat description:Start with 80 Shots code:c63f/12/08+c641/d0/d6 cheat description:Start with 80 Bombs code:c63f/12/08+c641/d0/d4 cheat description:Start with 1 life code:c64f/02/00 cheat description:Start with 6 lives code:c64f/02/05 cheat description:Start with 9 lives code:c64f/02/08 cartridge sha256:2e312fc327c1e569eccf14eee5a00c41f676c1492035d99af0873681da0f034d name:Volleyball (USA, Europe) cheat description:Computer doesn't get points for scoring code:d6f0/0f cheat description:3 points - team 1 code:0063/03 cartridge sha256:f38b9681b53008d32813880c2f28a8969a228a4b3b485ce09f7c0a4334f4abcc name:VS. Castlevania (VS) cheat description:Invincibility (blinking) code:e991/f0/d0 cheat description:Infinite health code:e7fa/85/a5 cheat description:Infinite lives code:c2ec/c6/a5 cartridge sha256:60098a93322a9e07a2b164a02e5517bc22664ca33f6323c2ae23a62941ad393b name:VS. Super Mario Bros. (VS) cheat description:Invincibility code:b1f9/89/9e+ee51/f0/d0 cheat description:Infinite lives code:988b/ad cheat description:Go to minus world code:9718/23+971a/5f+971b/07 cartridge sha256:8589b1dc55e04d23e56e864f1b001c6eecf18b7dcb7a0c4a9c4a40cbcc451601 name:Wacky Races (USA) cheat description:Invincibility code:d97b/f0/d0+d9b5/f0/d0+cd8d/f0/d0 cheat description:Infinite health code:ced5/ce/cd+cdbb/ce/cd cheat description:Infinite health (alt) code:ced5/ce/2c+ce7e/ce/2c+cdbb/ce/2c cheat description:Don't take most damage code:ced5/ce/2c cheat description:Infinite lives code:d05a/ce/8d+d0c7/ce/8d cheat description:Infinite lives (alt) code:d054/ad/10+d055/5d/08 cheat description:Infinite Bones after obtaining one code:d793/8d/ad cheat description:Go straight to level boss code:edbc/c4/f2 cheat description:Start at race 1, end of stage 1 code:edbc/c4/c8 cheat description:Start at race 1, end of stage 2 code:edbc/c4/cf cheat description:Start at race 1, end of stage 3 code:edbc/c4/d4 cheat description:Start at race 2, end of stage 1 code:edbe/d6/d8 cheat description:Start at race 2, end of stage 2 code:edbe/d6/dc cheat description:Start at race 2, end of stage 3 code:edbe/d6/e0 cheat description:Start at race 3, end of stage 1 code:edc0/e2/e4 cheat description:Start at race 3, end of stage 2 code:edc0/e2/e8 cheat description:Start at race 3, end of stage 3 code:edc0/e2/ec cheat description:Start at race 3, end of stage 4 code:edc0/e2/f0 cheat description:Start with 1 life code:ed48/02/00 cheat description:Start with 5 lives code:ed48/02/04 cheat description:Start with 7 lives code:ed48/02/06 cheat description:Start with 9 lives code:ed48/02/08 cheat description:Start with 6 hearts code:ed51/03/06 cheat description:Start with 8 hearts code:ed51/03/08 cheat description:Invincibility (alt) code:0453/01 cheat description:Invincibility (blinking) code:0452/11 cheat description:Infinite health (alt 2) code:0459/03 cheat description:Infinite time code:00a4/59 cheat description:Infinite lives (alt 2) code:045d/63 cheat description:Infinite Gems code:042f/63 cartridge sha256:60667bc0ed1c0c6355f59b5716c678954c5f3915064bdbfbb8e0195f2643eda8 name:Wall Street Kid (USA) cheat description:Infinite money code:fbde/91/b1 cheat description:Sart a new game with $16,777,215 code:810b/07/ff+810a/a1/ff+8109/20/ff cheat description:Infinite money (alt) code:03e1/ff cartridge sha256:50b6f1f87fb14c8ff74a54e60b85139e11adcaecb62eb24174aeb58a20b7698f name:Wally Bear and the No! Gang (USA) (Unl) cheat description:Invincibility code:a7bf/d0/10 cheat description:Multi-jump code:a57a/85/24 cheat description:Collect items from anywhere code:b775/5c/00+b77b/56/00 cartridge sha256:c12771e8155b030eff0081bfabd98e57a162d6592899f29dd16f141f0e6e08a3 name:Wario's Woods (USA) cheat description:Infinite time code:a17b/ce/ea cheat description:Clear round A data to complete round A and B code:9b41/00/63+9b46/42/41 cheat description:Each coin gives you a credit code:9a68/1e/01 cheat description:Always get blue monsters code:b85f/b1/a9+b860/b3/f0 cheat description:Always get 1 line of monsters code:b850/8d/ee cheat description:Wario doesn't cause ceiling to fall, no enemies fall code:87f6/8d/a9 cheat description:One bomb in Birdo time only code:a24c/ce/ea cheat description:Invisible Toad code:d891/85/a5 cheat description:Invisible coins code:99a5/d0/f0 cheat description:Coins worth 5 code:98a5/8d/ea cheat description:Infinite coins fall code:98a8/ce/ea cheat description:Only 1 coin falls code:97de/ce/ae cheat description:No Coins fall code:97de/ce/80 cheat description:Diamonds don't form in lesson mode code:ad53/99/ff cartridge sha256:059409954035963f1f13029dfa25468100a8e6a90d9388c4a225f235ade97a45 name:Wayne's World (USA) cheat description:Infinite lives code:8acd/ce/ae cheat description:Infinite time code:81d3/ce/ad cheat description:Infinite Worthiness code:8b5a/8d/ad cheat description:More time in level 1 code:b7d7/b4/ff cheat description:More time in Donut shop in level 1 code:b7f5/32/ff cheat description:Power-up restores all Worthiness code:8b74/02/00 cheat description:Power-up worth nothing code:8b77/8d/ad cheat description:Getting all donuts is worth no extra lives code:9b1d/ee/ad cheat description:Faster timer code:81ca/3b/1f cheat description:Slower timer code:81ca/3b/60 cheat description:5 special moves on pick-up code:a802/14/05 cheat description:40 special moves on pick-up code:a802/14/28 cheat description:Start with less Worthiness code:807a/b0/80 cheat description:Start with much less Worthiness code:807a/b0/40 cheat description:Start with 2 lives code:807f/04/01 cheat description:Start with 8 lives code:807f/04/07 cheat description:Start with 10 lives code:807f/04/09 cartridge sha256:a00db4c89bfd12704c53768b62b4f09d57d28891093447d81a0678b059629e59 name:WCW World Championship Wrestling (USA) cheat description:Always win - P1 code:a715/1d/c0+a716/09/01+a717/05/ea cartridge sha256:ab6f1bbcda6f0c0bbe1450b5f2ab2b21a5e01ec39143a455701862965cdbd7b4 name:Werewolf - The Last Warrior (USA) cheat description:Infinite time code:e326/c6/a5 cheat description:Only 1 anger point needed to become Super-Werewolf code:f60c/05/01 cheat description:Blue "W" won't change you back to a man code:f629/ce/ad cheat description:Gain maximum energy from small hearts code:f5ce/d4/d0 cheat description:Hit anywhere code:cf66/64/00+cf6c/5e/00+cfa2/28/00+cfa8/22/00 cheat description:Don't lose energy from blue "W" code:f63c/0a/00+f639/08/00 cheat description:Infinite health - P1 code:00bc/14 cheat description:Infinite time (alt) code:00bf/f4 cheat description:Always Werewolf code:044e/01+042e/01 cheat description:Always Super Werewolf code:044e/02 cheat description:Have Gun in Werewolf form code:044f/01+044d/01 cartridge sha256:84e3a018cbaaf2311d7e9414112cb05cf3b43608de0b9f8a2f77bc4da33ce8e6 name:Wheel of Fortune - Junior Edition (USA) cheat description:Always spin $1000 - All players code:0071/aa cartridge sha256:a66195e11e38bee9f602abd279b7c04367528380dfa5b915dce0fa6fd272c23c name:Where's Waldo (USA) cheat description:Infinite time code:e283/01/00 cheat description:Guesses cost nothing code:e75f/06/ee cartridge sha256:700ebc3c2dd27420bbdcccb987ba60d3f0680469101353de15a1b2bd565ac701 name:Who Framed Roger Rabbit (USA) cheat description:Invincibility code:e145/d0/60+db64/d0/60+c921/d0/60+e598/d0/60 cheat description:Infinite continues code:87cb/ce/ad cheat description:Never lose a life except in Punch lines code:95ef/c6/a5 cheat description:Never lose a life in Punch lines code:af52/c6/a5 cheat description:Harder to build strength code:ce3a/04/01 cheat description:Strength to full instantly code:ce3a/04/90 cheat description:Start with 1 life code:dfdd/03/01 cheat description:Start with 6 lives code:dfdd/03/06 cheat description:Start with 9 lives code:dfdd/03/09 cartridge sha256:b9a4542417439619239cdb2cefd8c7eced2407ba2954f026c0ab1ea7d4def3d3 name:Whomp 'Em (USA) cheat description:Invincibility code:815b/f0/60 cheat description:Infinite health code:8176/85/a5 cheat description:Don't lose a life from health loss code:818a/c6/a5 cheat description:Creatures can't steal extra lives code:99ab/c6/a5 cheat description:Keep Buffalo Headdress for present level code:814c/c6/a5 cheat description:Always have Buffalo Headdress code:814b/08/02 cheat description:Start with 1 life code:c0cc/03/00 cheat description:Start with 5 lives code:c06f/00/03 cheat description:Start with 10 lives code:c06f/00/08 cartridge sha256:9d875583dbdf80a0631ce4ffb3099064454d80568b5e9fe748a5e850f8fa0161 name:Widget (USA) cheat description:Invincibility code:eaf8/d0/f0 cheat description:Infinite health (not against spikes) code:bcd0/8d/ad cheat description:Infinite health (only against spikes) code:e8b9/ce/ad cheat description:Infinite time code:8ab6/ce/ad+8aa7/ce/ad cheat description:Infinite MP code:96a1/8d/ad cheat description:Infinite lives code:ca35/ce/ad cheat description:Invincibility (blinking) code:00b9/01 cheat description:Infinite health code:0581/06 cheat description:Infinite lives (alt) code:04f5/02 cheat description:Infinite special code:058b/06 cheat description:Have Mouse Widget code:0331/01 cheat description:Have Rock-Man Widget code:0332/01 cheat description:Have Bird-Man Widget code:0333/01 cheat description:Have Dolphin Widget code:0334/01 cheat description:Have powered-up Gun code:0594/03+0595/03 cartridge sha256:adff304553b64384f86f6c2b63571f43972b9d087f92359a1b9b93b54d523542 name:Wild Gunman (World) (Rev A) cheat description:Infinite lives in Gang Mode code:cf16/c6/24 cheat description:Infinite ammo in Gang Mode code:d071/c6/24 cheat description:Shoot 5 enemies to finish level code:d9fb/0a/05+dbbd/0a/05 cheat description:Start with double normal ammo code:d9e0/0f/20 cheat description:Start with triple normal ammo code:d9e0/0f/30 cheat description:Start with half normal ammo code:d9e0/0f/08 cheat description:Start with 1 life code:d9b5/03/0f+c8f6/03/01 cheat description:Start with 10 lives code:d9b5/03/0a+c8f6/03/0a cheat description:Start with 15 lives code:d9b5/03/0f+c8f6/03/0f cartridge sha256:62aec65696ecf24a487b7cdd19bad5cbd19f4229a89a7888634d468c67da378a name:Wild Gunman (Japan, USA) cheat description:Infinite lives in Gang Mode code:cf07/d0 cheat description:Infinite ammo in Gang Mode code:d062/f0 cheat description:Shoot 5 enemies to finish level code:d9fb/0a/05+dbbd/0a/05 cheat description:Start with double normal ammo code:d9e0/0f/20 cheat description:Start with triple normal ammo code:d9e0/0f/30 cheat description:Start with half normal ammo code:d9e0/0f/08 cheat description:Start with 1 life code:d9b5/03/0f+c8f6/03/01 cheat description:Start with 10 lives code:d9b5/03/0a+c8f6/03/0a cheat description:Start with 15 lives code:d9b5/03/0f+c8f6/03/0f cartridge sha256:adb1a1a9e853c2390a702e40573d145d08ca6c649cc789e4c8b41fcb63503bb6 name:Willow (USA) cheat description:Infinite magic code:815c/db/02 cheat description:Don't take any hits code:d473/85/46 cheat description:Start with all items code:f345/94/a2+9dba/a9/60 cheat description:Start at EXP Level 5 code:dec5/0a/04+dec7/b5/71 cheat description:Start at EXP Level 10 code:dec5/0a/09+dec7/b5/71 cheat description:Start at EXP Level 15 code:dec5/0a/0e+dec7/b5/71 cartridge sha256:e9539f088b4463e36c2a0d324d6a184fc1ecc3aa26ca4c5675ad9dc948bba5e5 name:Wing of Madoola, The (Japan) (Sample) cheat description:Invincibility code:cec2/85/a5 cheat description:Infinite hits and magic code:bf3e/95/b5 cheat description:Hit anywhere code:ce10/09/00+ce15/5a/00+ce14/f5/29 cheat description:One hit kills code:ce28/e5/18+ce29/88/18 cheat description:Start with 9999 hits code:a9c4/00/99+a9c8/10/99 cheat description:Start with 9999 max hits code:a9cc/00/99+a9d0/10/99 cheat description:Start with 9999 magic code:a9d8/10/99+a9d4/00/99 cartridge sha256:c3136379fc4e9401dec41be356fd6963e79dd46193c61cc03b59d9935835401f name:Wizardry - Proving Grounds of the Mad Overlord (USA) cheat description:Annointed Mace costs nothing instead of 30 code:81ed/30/00 cheat description:Long Sword costs nothing instead of 25 code:816d/25/00 cheat description:Short Sword costs nothing instead of 15 code:81ad/15/00 cheat description:Small Shield costs nothing instead of 20 code:82ed/20/00 cheat description:Staff costs nothing instead of 10 code:826d/10/00 cheat description:Dagger costs nothing instead of 15 code:82ad/05/00 cheat description:Robes costs nothing instead of 15 code:836d/15/00 cheat description:S of Pain costs nothing instead of 500 code:87ec/05/00 cheat description:S of Fire costs nothing instead of 500 code:882c/05/00 cheat description:Body Armor costs nothing instead of 1500 code:87ac/15/00 cheat description:Large Shield costs nothing instead of 40 code:832d/40/00 cheat description:Leather Armor costs nothing instead of 50 code:83ad/50/00 cheat description:Chain Mail costs nothing instead of 90 code:83ed/90/00 cheat description:Breast Plate costs nothing instead of 200 code:842c/02/00 cheat description:Helm costs nothing instead of 100 code:84ac/01/00 cheat description:S of Curing costs nothing instead of 500 code:84ec/05/00 cheat description:Rod of Iron costs nothing instead of 3000 code:862c/30/00 cheat description:Padded Leather costs nothing instead of 1500 code:86ac/15/00 cheat description:Shiny Chain costs nothing instead of 1500 code:86ec/15/00 cheat description:Sturdy Plate costs nothing instead of 1500 code:872c/15/00 cheat description:Iron Shield costs nothing instead of 1500 code:876c/15/00 cheat description:Gloves of Copper costs nothing instead of 6000 code:8cec/60/00 cheat description:S of Glass costs nothing instead of 1500 code:8b6c/15/00 cheat description:Studly Staff costs nothing instead of 2500 code:892c/25/00 cheat description:S of Neutralizing costs nothing instead of 300 code:852c/03/00 cheat description:Plate Mail costs nothing instead of 750 code:846d/50/00+846c/07/00 cheat description:Blade of Biting costs nothing instead of 15000 code:85ac/50/00+85ab/01/00 cartridge sha256:d30e480e7a99b5c3d8fe8faecf0bc0a14a9b163025eca9bf787f600fa927bb89 name:Wizards & Warriors (USA) (Rev A) cheat description:Invincibility code:e57e/f0/d0 cheat description:Invincibility (flashes) code:e581/30 cheat description:Infinite lives code:b4ea/c6/24 cheat description:Infinite lives (alt) code:b4ea/c6/a5 cheat description:Infinite health code:e37d/e5/24 cheat description:Infinite health (alt) code:e698/d0/a9+e699/3c/0c+e69a/a5/85 cheat description:Potions last longer code:df07/4f/ef cheat description:Meat gives half health code:e488/02/01 cheat description:Meat gives double health code:e488/02/04 cheat description:Enter doors without needing a key code:f341/30 cheat description:Jump higher code:d15e/fc cheat description:Jump to the top of the scren code:d166/cc cheat description:Start with 6 lives code:b83c/02/05+c024/02/05 cheat description:Start with 9 lives code:b83c/02/08+c024/02/08 cheat description:Invincibility (alt) code:00fc/02 cheat description:Infinite health (alt 2) code:0076/0c cheat description:Super-jump (disable if you get stuck) code:0148/40 cartridge sha256:3ba4f6fd63a74338e438df43ddd1195f8913d69c11f6668d3bbf23a2a3cea459 name:Wizards & Warriors (USA) cheat description:Invincibility code:e57e/f0/d0 cheat description:Invincibility (flashes) code:e581/30 cheat description:Infinite lives code:b4ea/c6/24 cheat description:Infinite lives (alt) code:b4ea/c6/a5 cheat description:Infinite health code:e37d/e5/24 cheat description:Infinite health (alt) code:e698/d0/a9+e699/3c/0c+e69a/a5/85 cheat description:Potions last longer code:df07/4f/ef cheat description:Meat gives half health code:e488/02/01 cheat description:Meat gives double health code:e488/02/04 cheat description:Enter doors without needing a key code:f341/30 cheat description:Jump higher code:d15e/fc cheat description:Jump to the top of the scren code:d166/cc cheat description:Start with 6 lives code:b83c/02/05+c024/02/05 cheat description:Start with 9 lives code:b83c/02/08+c024/02/08 cheat description:Invincibility (alt) code:00fc/02 cheat description:Infinite health (alt 2) code:0076/0c cheat description:Super-jump (disable if you get stuck) code:0148/40 cartridge sha256:2fa3ee5f9ef17dcd63f2f3936dc79b95a71f9e58521080250d4b4e7efbd471d2 name:Wizards & Warriors III - Kuros...Visions of Power (USA) cheat description:Infinite keys code:f6ad/c6/a5 cheat description:Infinite gold code:f777/f0 cheat description:Shopkeeper sometimes forgets to charge code:f772/8d/ad cheat description:Infinite lives code:e3e4/c6/a5 cheat description:Infinite lives (except boss stages) code:e3f1/c6/a5 cheat description:Coins worth 25 code:84d4/32/19 cheat description:Coins worth 100 code:84d4/32/64 cheat description:Coins worth 255 code:84d4/32/ff cheat description:Bags worth 5 code:84d2/0a/05 cheat description:Bags worth 50 code:84d2/0a/32 cheat description:Bags worth 255 code:84d2/0a/ff cheat description:Less health after death (except boss stages) code:b203/80/40 cheat description:More health after death (except boss stages) code:b203/80/b0 cheat description:Start with Less health code:a744/80/40 cheat description:Start with More health code:a744/80/b0 cheat description:Start with very little life force code:a744/80/01 cheat description:Start with about half life force code:a744/80/40 cheat description:Start with 2 lives code:a729/03/01 cheat description:Start with 7 lives code:a729/03/06 cheat description:Start with 10 lives code:a729/03/09 cheat description:Invincibility code:008b/2b cheat description:Infinite health code:00eb/80 cheat description:Infinite Keys code:0087/02 cheat description:Infinite money code:0669/09 cheat description:One hit kills on most enemies/bosses code:049d/01+049e/01+049f/01+04a0/01+04a1/01 cheat description:Have the Orb in slot 1 (enable then disable) code:0657/01 cheat description:Have the Orb in slot 2 (enable then disable) code:0658/01 cheat description:Have the Orb in slot 3 (enable then disable) code:0659/01 cheat description:Have the Orb in slot 4 (enable then disable) code:065a/01 cheat description:Have the Scepter in slot 1 (enable then disable) code:0657/02 cheat description:Have the Scepter in slot 2 (enable then disable) code:0658/02 cheat description:Have the Scepter in slot 3 (enable then disable) code:0659/02 cheat description:Have the Scepter in slot 4 (enable then disable) code:065a/02 cheat description:Have the Coin in slot 1 (enable then disable) code:0657/03 cheat description:Have the Coin in slot 2 (enable then disable) code:0658/03 cheat description:Have the Coin in slot 3 (enable then disable) code:0659/03 cheat description:Have the Coin in slot 4 (enable then disable) code:065a/03 cheat description:Have the Chalice in slot 1 (enable then disable) code:0657/04 cheat description:Have the Chalice in slot 2 (enable then disable) code:0658/04 cheat description:Have the Chalice in slot 3 (enable then disable) code:0659/04 cheat description:Have the Chalice in slot 4 (enable then disable) code:065a/04 cheat description:Have the Amulet in slot 1 (enable then disable) code:0657/05 cheat description:Have the Amulet in slot 2 (enable then disable) code:0658/05 cheat description:Have the Amulet in slot 3 (enable then disable) code:0659/05 cheat description:Have the Amulet in slot 4 (enable then disable) code:065a/05 cheat description:Have the Crown in slot 1 (enable then disable) code:0657/06 cheat description:Have the Crown in slot 2 (enable then disable) code:0658/06 cheat description:Have the Crown in slot 3 (enable then disable) code:0659/06 cheat description:Have the Crown in slot 4 (enable then disable) code:065a/06 cheat description:Have the Crown Jewel 1 in slot 1 (enable then disable) code:0657/07 cheat description:Have the Crown Jewel 1 in slot 2 (enable then disable) code:0658/07 cheat description:Have the Crown Jewel 1 in slot 3 (enable then disable) code:0659/07 cheat description:Have the Crown Jewel 1 in slot 4 (enable then disable) code:065a/07 cheat description:Have the Crown Jewel 2 in slot 1 (enable then disable) code:0657/08 cheat description:Have the Crown Jewel 2 in slot 2 (enable then disable) code:0658/08 cheat description:Have the Crown Jewel 2 in slot 3 (enable then disable) code:0659/08 cheat description:Have the Crown Jewel 2 in slot 4 (enable then disable) code:065a/08 cheat description:Have the Crown Jewel 3 in slot 1 (enable then disable) code:0657/09 cheat description:Have the Crown Jewel 3 in slot 2 (enable then disable) code:0658/09 cheat description:Have the Crown Jewel 3 in slot 3 (enable then disable) code:0659/09 cheat description:Have the Crown Jewel 3 in slot 4 (enable then disable) code:065a/09 cheat description:Have the Crown Jewel 4 in slot 1 (enable then disable) code:0657/0a cheat description:Have the Crown Jewel 4 in slot 2 (enable then disable) code:0658/0a cheat description:Have the Crown Jewel 4 in slot 3 (enable then disable) code:0659/0a cheat description:Have the Crown Jewel 4 in slot 4 (enable then disable) code:065a/0a cheat description:Have the Bronze Knight Statue in slot 1 (enable then disable) code:0657/0b cheat description:Have the Bronze Knight Statue in slot 2 (enable then disable) code:0658/0b cheat description:Have the Bronze Knight Statue in slot 3 (enable then disable) code:0659/0b cheat description:Have the Bronze Knight Statue in slot 4 (enable then disable) code:065a/0b cheat description:Have the Silver Knight Statue in slot 1 (enable then disable) code:0657/0c cheat description:Have the Silver Knight Statue in slot 2 (enable then disable) code:0658/0c cheat description:Have the Silver Knight Statue in slot 3 (enable then disable) code:0659/0c cheat description:Have the Silver Knight Statue in slot 4 (enable then disable) code:065a/0c cheat description:Have the Gold Knight Statue in slot 1 (enable then disable) code:0657/0d cheat description:Have the Gold Knight Statue in slot 2 (enable then disable) code:0658/0d cheat description:Have the Gold Knight Statue in slot 3 (enable then disable) code:0659/0d cheat description:Have the Gold Knight Statue in slot 4 (enable then disable) code:065a/0d cheat description:Have the Bronze Thief Statue in slot 1 (enable then disable) code:0657/0e cheat description:Have the Bronze Thief Statue in slot 2 (enable then disable) code:0658/0e cheat description:Have the Bronze Thief Statue in slot 3 (enable then disable) code:0659/0e cheat description:Have the Bronze Thief Statue in slot 4 (enable then disable) code:065a/0e cheat description:Have the Silver Thief Statue in slot 1 (enable then disable) code:0657/0f cheat description:Have the Silver Thief Statue in slot 2 (enable then disable) code:0658/0f cheat description:Have the Silver Thief Statue in slot 3 (enable then disable) code:0659/0f cheat description:Have the Silver Thief Statue in slot 4 (enable then disable) code:065a/0f cheat description:Have the Gold Thief Statue in slot 1 (enable then disable) code:0657/10 cheat description:Have the Gold Thief Statue in slot 2 (enable then disable) code:0658/10 cheat description:Have the Gold Thief Statue in slot 3 (enable then disable) code:0659/10 cheat description:Have the Gold Thief Statue in slot 4 (enable then disable) code:065a/10 cheat description:Have the Bronze Wizard Statue in slot 1 (enable then disable) code:0657/11 cheat description:Have the Bronze Wizard Statue in slot 2 (enable then disable) code:0658/11 cheat description:Have the Bronze Wizard Statue in slot 3 (enable then disable) code:0659/11 cheat description:Have the Bronze Wizard Statue in slot 4 (enable then disable) code:065a/11 cheat description:Have the Silver Wizard Statue in slot 1 (enable then disable) code:0657/12 cheat description:Have the Silver Wizard Statue in slot 2 (enable then disable) code:0658/12 cheat description:Have the Silver Wizard Statue in slot 3 (enable then disable) code:0659/12 cheat description:Have the Silver Wizard Statue in slot 4 (enable then disable) code:065a/12 cheat description:Have the Gold Wizard Statue in slot 1 (enable then disable) code:0657/13 cheat description:Have the Gold Wizard Statue in slot 2 (enable then disable) code:0658/13 cheat description:Have the Gold Wizard Statue in slot 3 (enable then disable) code:0659/13 cheat description:Have the Gold Wizard Statue in slot 4 (enable then disable) code:065a/13 cartridge sha256:2d62114f3f139e8dd01c3e6e56d83a848a236ebb0c146fac5d372ba40ae456d5 name:Wolverine (USA) cheat description:No enemies code:d3df/5d cheat description:Infinite lives - both players code:a108/ce/2c cheat description:Mega-jump code:bba7/0d/28 cheat description:Claws use up no health code:c327/01/00 cheat description:Super speed code:bb2e/fe/fc+bb38/02/04 cheat description:Take less damage from bullets code:b525/08/02+c408/08/02 cheat description:Start each new life as a berserker code:d072/00/40 cheat description:Start with 1 life - P1 code:d0ba/03/01 cheat description:Start with 6 lives - P1 code:d0ba/03/06 cheat description:Start with 9 lives - P1 code:d0ba/03/09 cheat description:Start with 1 life - P2 code:d0e7/03/01 cheat description:Start with 6 lives - P2 code:d0e7/03/06 cheat description:Start with 9 lives - P2 code:d0e7/03/09 cheat description:Start on stage 2 - P1 code:d0a2/00/01 cheat description:Start on stage 4 - P1 code:d0a2/00/03 cheat description:Start on stage 6 - P1 code:d0a2/00/05 cheat description:Start on stage 8 - P1 code:d0a2/00/07 cheat description:Start on stage 2 - P2 code:d0cf/00/01 cheat description:Start on stage 4 - P2 code:d0cf/00/03 cheat description:Start on stage 6 - P2 code:d0cf/00/05 cheat description:Start on stage 8 - P2 code:d0cf/00/07 cheat description:Infinite health code:00cd/1e cheat description:Infinite lives code:04da/03 cartridge sha256:3950d679fd6bbd5b59b720ef0284cb916f916a985103ccec60de2f256bcd8786 name:Wrath of the Black Manta (USA) (Rev A) cheat description:Invincibility (blinking) code:0589/fa cheat description:Start on stage 2 code:054a/01 cheat description:Start on stage 3 code:054a/03 cheat description:Start on stage 4 code:054a/04 cheat description:Start on stage 5 code:054a/05 cartridge sha256:545a5533481f4f7bd8f7e9d6c7ccad9195f870522d7d2a9d83c18958804da008 name:Wrath of the Black Manta (USA) cheat description:Take no damage from most enemies code:bbd2/ce/ad cheat description:Never die from falling off screen code:986c/ce/ad cheat description:Mega-jump when stationary code:ab35/9d/2c cheat description:Start with extra energy code:8692/03/08 cheat description:Start with 1 life code:8697/02/00 cheat description:Start with 6 lives code:8697/02/05 cheat description:Start with 9 lives code:8697/02/08 cheat description:Invincibility (blinking) code:0589/fa cheat description:Start on stage 2 code:054a/01 cheat description:Start on stage 3 code:054a/03 cheat description:Start on stage 4 code:054a/04 cheat description:Start on stage 5 code:054a/05 cartridge sha256:f1eb29dd1c7b2b29f4932df853f32a7560bbfe64997281aa79f61ba9f131fb17 name:Wrecking Crew (World) cheat description:Invincibility code:c27f/20/60 cheat description:Infinite lives - P1 code:a3cc/a5 cheat description:Infinite lives - P2 code:a3da/a5 cheat description:Annoying guy doesn't bother you code:d223/9d/ad+d1c3/9d/ad cheat description:Start with Golden Hammer code:a1bc/85/e6 cheat description:Start with 1 life - both players code:a1bf/01 cheat description:Start with 10 lives - both players code:a1bf/09 cheat description:Start with 15 lives - both players code:a1bf/0f cheat description:Start with 250 lives code:a1bf/f8 cartridge sha256:a0354fb9c1c29e25b8bd2bd45735e8af2263cde66b56cc2e61eb5d9295a42de1 name:Wurm - Journey to the Center of the Earth! (USA) cheat description:Infinite fuel code:c757/8d/ad cheat description:Infinite shields and life code:c6f2/85/a5 cheat description:Start on Act 2 - Dyna Crystal code:d4a6/01/02 cheat description:Start on Act 3 - Magma Falls code:d4a6/01/03 cheat description:Start on Act 4 - Ziggy code:d4a6/01/04 cheat description:Start on Act 5 - Dual Duel code:d4a6/01/05 cartridge sha256:e5de4656729ffa37f7f6afdccb7c207ca7b867768369cc1a2817626919bff8dc name:WWF King of the Ring (USA) cheat description:Infinite health - both players code:b63d/99/ae cheat description:Infinite health - P1 code:0168/bf cheat description:No health - P2 code:0194/00 cartridge sha256:a6f98e57ffb4544152138f109b00d1016ae957f7d842f29b41e118045fd54056 name:WWF Wrestlemania (USA) cheat description:Infinite health - P1 code:cf27/b0/a9+cf28/02/ca+cf29/e6/85 cheat description:One hit drains all health code:cd96/90/f0 cheat description:Opponent is idle after a body slam code:e9a5/ad cheat description:Countdown starts on 3 code:e343/01/03 cheat description:1 minute tournament rounds code:c922/03/01 cheat description:6 minute tournament rounds code:c922/03/06 cheat description:9 minute tournament rounds code:c922/03/09 cartridge sha256:89df74e7b275929c91a64580c5b1733bee26bcaf3a923dcca9fffdda835b2964 name:WWF Wrestlemania Challenge (USA) cheat description:Pin count extended to 9 seconds code:b483/04/0a cheat description:10-count reduced to 5 seconds code:c1d7/0b/06 cheat description:All counts slower code:c1fc/3c/65 cheat description:All counts faster code:c1fc/3c/1f cartridge sha256:b0e4bcb63416c32fc247ff8afc28915ba15906a9b02aaed77a41e8109eab91fc name:WWF Wrestlemania Steel Cage Challenge (USA) cheat description:P1 cannot lose (constant 1 count) code:8bd5/ce/ae cheat description:Infinite energy refills (press select when energy is low) code:dfa2/9d/bd cheat description:1 minute tournament rounds code:c922/03/01 cheat description:6 minute tournament rounds code:c922/03/06 cheat description:9 minute tournament rounds code:c922/03/09 cartridge sha256:4b11689be770a7dd6ef560568ba1fd70d6c585babedd8c9088769a0d63d89cf1 name:Xenophobe (USA) cheat description:Infinite health - both players code:d747/eb/00 cheat description:Increase starting health - both players code:d152/09/03 cheat description:More health - P1 code:d163/ff/03+d165/5c/50 cheat description:No health pick-ups allowed code:d6f6/99/ad cheat description:Start on level 2 code:d148/07/06 cheat description:Start on level 3 code:d148/07/05 cheat description:Start on level 4 code:d148/07/04 cheat description:Start on level 5 code:d148/07/03 cheat description:Infinite health - P1 (one's digit) code:0753/09 cheat description:Infinite health - P1 (ten's digit) code:0752/0a cheat description:Infinite health - P1 (hundred's digit) code:0751/09 cheat description:Infinite health - P1 (thousand's digit) code:0750/09 cheat description:Infinite health - P2 (one's digit) code:0757/0b cheat description:Infinite health - P2 (ten's digit) code:0756/0b cheat description:Infinite health - P2 (hundred's digit) code:0755/09 cheat description:Infinite health - P2 (thousand's digit) code:0754/09 cheat description:Character modifier - Dr. Kwack code:0795/00 cheat description:Character modifier - Mr. Frogg code:0795/01 cheat description:Character modifier - Dr. Zordirz code:0795/02 cartridge sha256:9112f5b30c8a8d0dbd967973e84357860b5f0cf37ab3511b39128b5d37fa86ff name:Xevious - The Avenger (USA) cheat description:Invincibility code:fdc4/a5/85 cheat description:Infinite lives code:f73a/a5 cheat description:Hit anywere code:dd13/13/00+dd21/05/00+eb8e/bd/60 cheat description:Start with 1 life code:fc21/01 cheat description:Start with 6 lives code:fc21/06 cheat description:Start with 9 lives code:fc21/09 cartridge sha256:2508e4eada73f233b2df86af2248a370b2d40ec2de590c8886a8750ddfb5b79c name:Xexyz (USA) cheat description:Immune to enemy bullets code:c774/e5/e9 cheat description:Immune to monsters code:c674/e5/e9 cheat description:Infinite lives code:a40e/ce/ad cheat description:Become a whirlwind on new life code:a418/8d/ee cheat description:1 life after continue code:a53b/03/01 cheat description:Start with 1 life code:a236/03/01 cheat description:Start with 6 lives code:a236/03/06 cheat description:Start with 9 lives code:a236/03/09 cheat description:Start with and keep foot-wing code:b711/08/00 cartridge sha256:1f349392d49c60c3e52a06be6ab4d914bf71ffd5b73857964ec9d604806b131b name:Xybots (USA) (Proto) (Unl) cheat description:Infinite lives and second shots code:f385/de/bd cheat description:Infinite Keys - both players code:9004/de/ad cheat description:Infinite money - both players code:8986/9d/bd cheat description:Infinite Slow Energy Drain and Zap power code:e96b/9d/ad cheat description:Infinite Warning Arrows and Level Mappers code:b6bb/9d/ad cheat description:Infinite Enemy Mappers and Guard Mapper code:e950/99/b9 cheat description:Start with 6 lives and 6 second shots code:e15c/12/66 cheat description:Start with 3 Slow Energy Drain and 4 Zap power - P1 code:e152/02/24 cheat description:Start with 3 Slow Energy Drain and 4 Zap power - P2 code:e157/12/24 cheat description:Start with 6 Warning Arrows and Level Mappers code:e164/21/66 cheat description:Start with 6 Enemy Mappers and have Guard Mapper code:e16c/01/16 cheat description:Start with 99 Keys, $99 and 2,544,300 points code:e4ac/00/63 cheat description:Start with 4 extra Speed, extra Armor, extra Shot Speed, extra Shot Power and Wide Shot code:e130/00/44 cheat description:Start at last level code:e176/01/36 cheat description:Infinite health - P1 code:0192/ff cheat description:Infinite health - P2 code:0193/ff cheat description:Infinite Keys - P1 code:0196/09 cheat description:Infinite Keys - P2 code:0197/09 cheat description:Infinite Money - P1 code:0194/ff cheat description:Infinite Money - P2 code:0195/ff cartridge sha256:0624c93899a588232f9193db0d560291b15636727813a4cd6c3dab8b7f74badb name:Yie Ar Kung-Fu (Japan) (Rev 1.4) cheat description:Infinite health code:dd93/e6/b5 cheat description:Infinite health (alt) code:00db/00 cheat description:One hit kills code:de21/25/00 cheat description:Hit anywhere code:dc49/d0/f0+dc39/d0/f0 cartridge sha256:dbe10104fc90c36ff7c95424cb192dfd9619fb7c1238bbae8da87e0bc9cc5a4e name:Yie Ar Kung-Fu (Japan) (Rev 1.2) cheat description:Invincible against punches and kicks code:dd32/85/a5 cheat description:Tao does not throw fireballs code:e6fb/85/a5 cheat description:Chen does not hit you with his chain code:e8f5/85/a5 cheat description:Lang does not throw shurikens code:e668/c0/a9 cheat description:Bonus doesn't end when you're hit with a sword or fan code:de99/a9/60 cheat description:Infinite health code:00db/00 cartridge sha256:62a3551ce546fa7df5fd4970e725e36f1ca269be62b1e33f92546d6e649b8371 name:Yo! Noid (USA) cheat description:Invincibility code:baad/60 cheat description:Invincibility (alt) code:b631/20/ad cheat description:Infinite time code:b4a5/c6/a5 cheat description:Infinite lives code:e3c6/ce/ad+e3c9/ce/ad cheat description:More magic from small scrolls code:bc4e/01/05 cheat description:Multi-mega-jumps code:ccb5/2e/00 cheat description:1 continue code:da2f/03/01 cheat description:6 continues code:da2f/03/06 cheat description:Start with 1 life code:d9b6/32/30+d9b9/42/40 cheat description:Start with 6 lives code:d9b6/32/35+d9b9/42/45 cheat description:Start with 9 lives code:d9b6/32/39+d9b9/42/49 cheat description:Start on stage 2 code:d9ec/01/02 cheat description:Start on stage 4 code:d9ec/01/04 cheat description:Start on stage 6 code:d9ec/01/06 cheat description:Start on stage 8 code:d9ec/01/08 cheat description:Start on stage 10 code:d9ec/01/0a cheat description:Start on stage 12 code:d9ec/01/0c cartridge sha256:56a169bb3a6101057fb278f2febd58cb1dbf056e5aaeb709c51a55ce4cfac20d name:Yoshi (USA) cheat description:Short wait for next characters code:f0b1/28/14 cheat description:Really short wait for next characters code:f0b1/28/02 cheat description:Really long wait for next characters code:f0b1/28/ff cheat description:Freeze characters for a short time (press Down) code:b7db/02/60 cheat description:Need only 1 Victory Egg to win code:8160/03/01+e2d0/03/01+e3a2/03/01 cheat description:Need only 2 Victory Eggs to win code:8160/03/02+e2d0/03/02+e3a2/03/02 cartridge sha256:fd4884c98d9412eb362c0654c8f5475e7f24266984f11e19961495c2d642d38a name:Young Indiana Jones Chronicles, The (USA) cheat description:Infinite health code:81dc/85/ea cheat description:Infinite lives code:9c0b/c6/a5 cheat description:Start with 2 lives code:dcce/03/01 cheat description:Start with 7 lives code:dcce/03/06 cheat description:Start with 10 lives code:dcce/03/09 cartridge sha256:c79202082042baeb3a45e747a1675c9530137f847c357c393270715efc32217e name:Ys II - Ancient Ys Vanished - The Final Chapter (Japan) cheat description:Infinite HP code:ed9a/85/a5 cheat description:Infinite gold code:852b/85/a5+8532/85/a5 cheat description:Lots of EXP code:dd9f/09/08+dda5/0a/08 cheat description:Start with all equipment code:dd4c/01/7f cartridge sha256:ec1d85479d72847d3adbd76e2e79221143e6c9324d5647be2c4a11aa87123f75 name:Ys III - Wanderers from Ys (Japan) cheat description:Hit anywhere code:a84d/60/ea+a87b/60/ea+a864/60/ea+a892/60/ea cheat description:One hit kills code:a707/04/00 cartridge sha256:91d281ee84a71483cd9b8e8021222ef509a8c0ea4be0a4fa675140a91b65c2da name:Yume Koujou Doki Doki Panic (Japan) [b] (FDS) cheat description:Multi-jump code:863d/d0/24 cheat description:Invincibility code:0085/fa cheat description:Infinite coins code:062b/09 cheat description:Infinite sub-space time code:04b7/fa cheat description:Infinite magic carpet time code:00b9/fa cheat description:All characters can float code:04c9/fa cheat description:Multi-jump (alt) code:0099/00 cheat description:One hit kills on bosses code:0468/00 cheat description:Only 1 Cherry needed for Starman code:062a/04 cheat description:Only 1 big Radish needed for Stopwatch code:062c/04 cheat description:Receive small heart for every enemy defeated code:04ad/09 cheat description:Stopwatch always active code:04ff/fa cheat description:Start on World 2 code:0635/01 cheat description:Start on World 3 code:0635/02 cheat description:Start on World 4 code:0635/03 cheat description:Start on World 5 code:0635/04 cheat description:Start on World 6 code:0635/05 cheat description:Start on World 7 code:0635/06 cartridge sha256:bdc9dfed1b03db470a1453da0252b3e9fcd0869d02a48622476ddaa350e53374 name:Zanac (USA) cheat description:Invincibility + Hit anywhere code:825c/b0/38+825d/31/60+821b/99/ad cheat description:Infinite lives code:8f8f/c6/a9 cheat description:Start with Straight Crusher code:9490/00/01 cheat description:Start with Field Shutter code:9490/00/02 cheat description:Start with the Circular code:9490/00/03 cheat description:Start with the Vibrator code:9490/00/04 cheat description:Start with the Rewinder code:9490/00/05 cheat description:Start with the Plasma Flash code:9490/00/06 cheat description:Start with rapid fire code:9490/00/07 cheat description:Start with 1 life code:cb89/03/01 cheat description:Start with 6 lives code:cb89/03/06 cheat description:Start with 9 lives code:cb89/03/09 cheat description:Invincibility code:0764/00 cartridge sha256:4cfc55e1521e58039d502f2a5ff16c233b84c0a05b1048185c75c971f3814c16 name:Zelda II - The Adventure of Link (USA) cheat description:Infinite health code:e335/e5/ea+e336/0c/ea cheat description:Almost infinite health code:e330/e2 cheat description:Infinite magic code:8df0/f9/2c cheat description:Infinite magic (alt) code:8df5/8d/ad cheat description:Infinite magic and health in battle code:d3f8/08 cheat description:Infinite lives code:ca44/ce/ad cheat description:Infinite Keys after obtaining one code:d9e4/ce/ad cheat description:Keys not necessary to open doors code:d9e3/ea+d9e2/e2 cheat description:Gain over 2048 EXP when you defeat an enemy most of the time code:d465/00/08 cheat description:Gain 256 EXP when you defeat an enemy most of the time code:d45e/8d/ea cheat description:Gain more than 256 EXP for every EXP code:d465/00/01 cheat description:Don't lose EXP points while leveling up code:9f6b/8d/ad+9f74/8d/ad cheat description:All sword levels do massive damage code:e732/f9/ed cheat description:Hit anywhere (press up if you get stuck at a Palace entrance) code:e6a4/b0/50 cheat description:Multi-jump code:9530/f7/f5+9535/ad/a9+9536/7d/fb+9537/05/8d+9538/10/7d+9539/02/05 cheat description:Mega-jump code:953b/30/20 cheat description:Link can fly (hold A) code:953b/30/00 cheat description:Walk through walls in Overworld code:871e/02/00 cheat description:Swap Shield spell for Fire spell code:8e48/8d/f1+8e49/8e/97 cheat description:Swap Shield spell for Spell spell code:8e48/8d/73+8e49/8e/8e cheat description:Swap Shield spell for Fairy spell code:8e48/8d/23+8e49/8e/91 cheat description:Swap Shield spell for Life spell code:8e48/8d/5d+8e49/8e/8e cheat description:Swap Shield spell for Thunder spell code:8e48/8d/e6+8e49/8e/91 cheat description:Start with all spells code:a60d/bd/de cheat description:Start with 1 life code:c359/03/01 cheat description:Start with 6 lives code:c359/03/06 cheat description:Start with 9 lives code:c359/03/09 cheat description:Invincibility (disable when fighting your shadow) code:0518/03 cheat description:Infinite health (alt) code:0774/ff cheat description:Infinite magic (alt 2) code:0773/ff cheat description:Infinite lives (alt) code:0700/04 cheat description:Infinite Keys code:0793/09 cheat description:No enemies in overworld code:0086/00+0087/00+0088/00+0089/00 cheat description:Jump spell always on code:076f/02 cheat description:Max sword level code:0777/ff cheat description:Max magic level code:0778/ff cheat description:Max life level code:0779/ff cheat description:Have up/down thrust code:0796/ff cheat description:Have Shield spell code:077b/01 cheat description:Have Jump spell code:077c/01 cheat description:Have Life spell code:077d/01 cheat description:Have Fairy spell code:077e/01 cheat description:Have Fire spell code:077f/01 cheat description:Have Reflect spell code:0780/01 cheat description:Have Spell spell code:0781/01 cheat description:Have Thunder spell code:0782/01 cheat description:Max magic jars code:0783/08 cheat description:Have Boots code:0788/01 cheat description:Have Candle code:0785/01 cheat description:Have Cross code:078a/01 cheat description:Have Flute code:0789/01 cheat description:Have Glove code:0786/01 cheat description:Have Hammer code:078b/01 cheat description:Have Key code:078c/01 cheat description:Have Raft code:0787/01 cheat description:Can enter final palace code:0794/00 cheat description:One hit kill on final boss code:00c2/01 cartridge sha256:939dcb88fce04f9c91e1ce49016b12e301afc4861684576ab5862eada5860db7 name:Zen - Intergalactic Ninja (USA) cheat description:Invincibility code:8849/11/00 cheat description:Hit anywhere code:b281/2f/00+b297/19/00+b2ac/b0/a9 cheat description:One hit kills code:b4c7/02/00 cheat description:Infinite health code:b377/8d/2c cheat description:Infinite lives code:9654/c6/a5+a617/c6/a5 cheat description:9 lives allowed in options menu code:bc07/05/0a cheat description:Slower timer code:ae7e/81/ff cheat description:Faster timer code:ae7e/81/6f cheat description:Even faster timer code:ae7e/81/5f cheat description:Zen does increased damage - isometric stages code:8bb1/04/08 cheat description:Zen does mega damage - isometric stages code:8bb1/04/14 cheat description:Jab attack does more damage - horizontal stages code:ad4b/04/08 cheat description:Mega jab attack damage - horizontal stages code:ad4b/04/14 cheat description:Fewer hits in shield code:b40c/03/01+be2f/03/01 cheat description:Double hits in shield code:b40c/03/06+be2f/03/06 cheat description:Triple hits in shield code:b40c/03/09+be2f/03/09 cartridge sha256:d0850075065ecbd125a33accc952de5d012527be45aa14a1b8223a9adf1643ae name:Zoda's Revenge - StarTropics II (USA) cheat description:Invincibility code:a140/ed/ae cheat description:Infinite lives code:e4c9/ce/ad cheat description:Infinite weapons code:a536/de/bd cheat description:Hit anywhere code:b40d/b9/4c+b40f/70/b4+b40e/b4/8b cheat description:Walk faster - battle mode code:a83c/01/02 cheat description:Jump faster and further - battle mode code:a83c/00/01 cheat description:Throw Tink's axe further code:b0cb/40/60 cheat description:1 star gives energy code:a651/05/01+a655/05/01 cheat description:Throw Tink's Axe faster (can't be combined with other Axe code) code:b038/41/f1 cheat description:Tink's Axe splits into 3 little ones when thrown (can't be combined with other Axe code) code:b038/41/43 cheat description:Throw Tink's splitting-Axe faster (can't be combined with other Axe code) code:b038/f1/f3 cheat description:Start with 1 life (Only effective in battle mode on first life) code:e266/03/01 cheat description:Start with 6 lives (Only effective in battle mode on first life) code:e266/03/06 cheat description:Start with 9 lives (Only effective in battle mode on first life) code:e266/03/09 cartridge sha256:91eae4e0e59dadd5de7cdbe71fe57e304d741ae5107928e29e0f6ff8813151a9 name:Zombie Nation (USA) cheat description:Infinite health code:eda0/a5/60 cheat description:Infinite continues code:053b/05 cartridge sha256:061d1c3865ad62ae883bb30b9f0071e8f7aa572f15f61bfb91b3a755eeeb5eb0 name:Zunou Senkan Galg (Japan) cheat description:Invincibility code:860d/68/60+cf59/a5/60 cheat description:Infinite lives code:80f8/c6/a9 cartridge sha256:8808783f789ca6413364a7abea240f6f7291b5906026f360ba8cfdd2791fc179 name:2020 Super Baseball (USA) cheat description:Have lots of money - P1 code:7f80ca/63+7f80cc/63+7f80cb/63 cheat description:Have 9 points - P1 code:7fc13b/09 cheat description:Have no outs code:7fc138/00 cheat description:Have no strikes code:7fc136/00 cheat description:Have no balls code:7fc137/00 cartridge sha256:2ffe8828480f943056fb1ab5c3c84d48a0bf8cbe3ed7c9960b349b59adb07f3b name:3 Ninjas Kick Back (USA) cheat description:Invincibility code:82f5c6/f0+809416/d0 cheat description:Infinite lives code:82ee7e/ad cheat description:Infinite health code:7e0a2a/06 cheat description:Infinite lives (alt) code:7e1e51/14 cheat description:Infinite time code:7e1e6b/14 cheat description:Infinite Bombs code:7e1e63/14+7e1e65/14 cheat description:Max coins code:7e1e5b/14+7e1e59/14 cheat description:Have throwing weapon code:7e1e5b/14+7e1e59/14 cheat description:Less enemies to pass trials (disable then enable) code:7e1fe0/02 cartridge sha256:4dd631433c867ba920997fd3add2c838b62e70e06e0ef55c53884b8b68b0dd27 name:7th Saga, The (USA) cheat description:Human fighter has 50 HP code:c0623f/32 cheat description:Human fighter has 100 HP code:c0623f/64 cheat description:Human fighter has 200 HP code:c0623f/c8 cheat description:Tetujin has 50 HP code:c06287/32 cheat description:Tetujin has 100 HP code:c06287/64 cheat description:Tetujin has 200 HP code:c06287/c8 cheat description:Dwarf has 50 HP code:c06251/32 cheat description:Dwarf has 100 HP code:c06251/64 cheat description:Dwarf has 200 HP code:c06251/c8 cheat description:Human mage has 50 HP code:c06299/32 cheat description:Human mage has 100 HP code:c06299/64 cheat description:Human mage has 200 HP code:c06299/c8 cheat description:Elf has 50 HP code:c06263/32 cheat description:Elf has 100 HP code:c06263/64 cheat description:Elf has 200 HP code:c06263/c8 cheat description:Demon has 50 HP code:c062ab/32 cheat description:Demon has 100 HP code:c062ab/64 cheat description:Demon has 200 HP code:c062ab/c8 cheat description:Alien has 50 HP code:c06275/32 cheat description:Alien has 100 HP code:c06275/64 cheat description:Alien has 200 HP code:c06275/c8 cheat description:Human fighter has 20 power code:c06243/14 cheat description:Tetujin has 20 power code:c0628b/14 cheat description:Dwarf has 20 power code:c06255/14 cheat description:Human mage has 20 power code:c0629d/14 cheat description:Elf has 20 power code:c06267/14 cheat description:Demon has 20 power code:c062af/14 cheat description:Alien has 20 power code:c06279/14 cheat description:Human fighter has 30 MP code:c06241/1e cheat description:Tetujin has 30 MP code:c06289/1e cheat description:Dwarf has 30 MP code:c06253/1e cheat description:Human mage has 30 MP code:c0629b/1e cheat description:Elf has 30 MP code:c06265/1e cheat description:Demon has 30 MP code:c062ad/1e cheat description:Alien has 30 MP code:c06277/1e cheat description:Human fighter has 20 speed code:c06246/14 cheat description:Tetujin has 20 speed code:c0628e/14 cheat description:Dwarf has 20 speed code:c06258/14 cheat description:Human mage has 20 speed code:c062a0/14 cheat description:Elf has 20 speed code:c0626a/14 cheat description:Demon has 20 speed code:c062b2/14 cheat description:Alien has 20 speed code:c0627c/14 cheat description:Enemies aren't generated code:c01780/6b cheat description:Touching an enemy doesn't cause a battle code:c01f36/6b cheat description:Sell an item for maximum gold code:c0b139/80 cheat description:Get 999 Max HP when you use a 'V Seed' code:c4a066/00 cheat description:Get 999 Max MP when you use an 'M Seed' code:c4a0d7/00 cheat description:Get 999 Power when you use a 'P Seed' code:c4a148/00 cheat description:Get 999 Guard when you use a 'Pr Seed' code:c4a1b9/00 cheat description:Get 255 Magic when you use an 'I Seed' code:c4a226/00 cheat description:Get 255 Speed when you use an 'A Seed' code:c4a292/00 cheat description:Human fighter starts with Sword of Anger code:c0624d/69 cheat description:Human fighter starts with Sword of Courage code:c0624d/6c cheat description:Human fighter starts with Sword of Fire code:c0624d/6f cheat description:Dwarf starts with Sword of Nature code:c0625f/6a cheat description:Dwarf starts with Sword of Courage code:c0625f/6c cheat description:Dwarf starts with Sword of Fire code:c0625f/6f cheat description:Human mage starts with petrified staff code:c062a7/8e cheat description:Human mage starts with Rod of Tide code:c062a7/8f cheat description:Elf starts with petrified staff code:c06271/8e cheat description:Elf starts with Staff of Brilliance code:c06271/91 cheat description:Demon starts with Sword of Anger code:c062b9/69 cheat description:Demon starts with Sword of Despair code:c062b9/6d cheat description:Demon starts with Sword of Fire code:c062b9/6f cheat description:Start with 297 gold code:c0920b/2c+c0920c/01 cheat description:Start with 62,708 gold code:c0920b/f4+c0920c/01 cheat description:Start with 2000 gold code:c0920b/d0+c0920c/07 cartridge sha256:69c5805ad0494703e7d636d3d40d615d33e79bebef9d2cdb4a23b73d44c7b6f9 name:A.S.P. - Air Strike Patrol (USA) cheat description:No damage from enemy fire code:81dac1/ad+81e220/a7 cheat description:Infinite fuel code:819f6e/ad cheat description:Infinite flares code:81ea37/ad cheat description:Infinite missles for F-15 Strike Eagle code:8194b3/ad cheat description:Infinite missles for A-10 Thunderbolt II code:819638/ad cartridge sha256:ce164872c4f5814bce04cf0565edcdb5b7969ae95a3b5cd515cfb626b5cde7b3 name:Aaahh!!! Real Monsters (USA) cheat description:Invincibility code:009dfe/8d cheat description:Infinite health code:00bddb/ad cheat description:Infinite Fish code:00bcf2/ad cheat description:Infinite Books code:00c9c5/bd cheat description:Infinite Garbage code:80bcf0/00 cheat description:Infinite Scares code:80c9ca/00 cheat description:Infinite lives code:80a744/00 cheat description:Get nothing for each Trash Bag code:00a5b7/00 cheat description:Get 20 for each Trash Bag code:00a5b7/20 cheat description:Get 100 for each Trash Bag code:00a5b7/bb cheat description:1-ups worth nothing code:00a2f6/00 cheat description:1-ups worth 3 code:00a2f6/03 cheat description:1-ups worth 5 code:00a2f6/05 cheat description:Monster books are worth nothing code:00a3c5/00 cheat description:Monster books are worth 2 code:00a3c5/02 cheat description:Monster books are worth 10 code:00a3c5/10 cheat description:Most health power-ups worth nothing code:00a39c/00 cheat description:Most health power-ups worth more code:00a39c/02 cheat description:Start with 1 life code:86a93c/01 cheat description:Start with 10 lives code:86a93c/09 cheat description:Start with 50 lives code:86a93c/49 cheat description:Start with 0 special scares code:84875e/00 cheat description:Start with 10 special scares code:84875e/10 cheat description:Start with 20 special scares code:84875e/20 cheat description:Infinite health (alt) code:7e0b7a/0d cheat description:Infinite lives (alt) code:7e13c8/09 cartridge sha256:bb83f982961c33b81fefc1f545e18ab572d1c43cf6c241948544f05a1a71f2ba name:ABC Monday Night Football (USA) cheat description:Always 1st down code:7e119c/01 cheat description:1 yard to go for 1st down code:7e119d/01 cheat description:Infinite time - minutes code:7e11a6/09 cheat description:Infinite time - seconds code:7e11a6/09 cheat description:Cannot be tackled (hold X) - diving tackles code:01e7da/43+01e7d9/a5+01e7db/0a+01e7dc/10 cheat description:Cannot be tackled (hold X) - normal tackles code:01e3d9/44+01e3dc/23+01e3db/30+01e3d8/a5+01e3da/0a cheat description:Have 0 points - Team 1 code:7e1182/00 cheat description:Have 0 points - Team 2 code:7e118c/00 cheat description:Have 7 points - Team 1 code:7e1182/07 cheat description:Have 7 points - Team 2 code:7e118c/07 cheat description:Have 14 points - Team 1 code:7e1182/14 cheat description:Have 14 points - Team 2 code:7e118c/14 cheat description:Have 21 points - Team 1 code:7e1182/21 cheat description:Have 21 points - Team 2 code:7e118c/21 cheat description:Have 99 points - Team 1 code:7e1182/99 cheat description:Have 99 points - Team 2 code:7e118c/99 cartridge sha256:d07e8802a6d9c777247874e05ec08fce7e0fa1bf122cc1ab9913f7d828e4072b name:ACME Animation Factory (USA) cheat description:Infinite time - game mode code:7e1ba4/3c cartridge sha256:555ff99acb1b02e67ae7da12b776cdbfa9a56b8ddf248258158ec58a151554ef name:Acrobat Mission (Japan) cheat description:Invincibility code:02a3de/ea cheat description:Infinite lives code:02a6d8/bd cheat description:Invincibility (alt) code:7e042a/30 cheat description:Infinite lives (alt) code:7e0412/04 cheat description:Infinite lives (alt 2) code:7e0412/0b cheat description:Most Powerful gun [00-10] (don't pick any weapon icons) code:7e0424/00 cheat description:Score Modifier [00-99] code:7e02b3/00+7e02b4/00 cartridge sha256:41af71166f509b0e615b00e7dc3cf2dc660d1701014ecadfd1629257b18471b9 name:Action Pachio (Japan) cheat description:Invincibility code:898546/f0 cheat description:Infinite health code:908390/a5 cheat description:Infinite time code:87dad4/a5 cheat description:Infinite lives code:8780e1/a5 cheat description:Infinite health (alt) code:7e00cc/0a cheat description:Infinite lives (alt) code:7e00c8/09 cheat description:Infinite Coins code:7e00c2/99 cheat description:Infinite time (alt) code:7e00c0/63+7e00c1/63 cheat description:Infinite continue time code:7e1e12/09 cheat description:Max score code:7e00c4/99+7e00c5/99+7e00c6/99+7e00c7/99 cartridge sha256:b8055844825653210d252d29a2229f9a3e7e512004e83940620173c57d8723f0 name:ActRaiser (USA) cheat description:Invincibility after one hit code:009c98/60 cheat description:Infinite health in action sequences code:008a24/dd cheat description:Infinite MP (Magic Points) code:009e0a/a5 cheat description:Infinite SP (Spell Points) code:03ca73/af cheat description:Infinite time code:02bc9a/a5 cheat description:Infinite time (alt) code:02bc98/00 cheat description:Faster timer code:02bc8b/10 cheat description:Slower timer code:02bc8b/50 cheat description:Hit anywhere continually code:008ad6/24+008ae1/24+008ae6/24+008aba/80+008ac8/80 cheat description:Monster lairs are always empty code:03b99c/9e cheat description:Towns always able to grow code:03854f/00 cheat description:Unlock professional mode code:00803f/00 cheat description:Unlock action mode (press start at title screen) code:008041/00 cheat description:Have Fire magic and 24 MP in professional mode code:02ab26/85+02ab2c/8d+02ab2a/a9+02ab2b/01 cheat description:Have Stardust and 24 MP in professional mode code:02ab26/85+02ab2c/8d+02ab2a/a9+02ab2b/02 cheat description:Have Aura magic and 24 MP in professional mode code:02ab26/85+02ab2c/8d+02ab2a/a9+02ab2b/03 cheat description:Start with 1/2 health (first game only) code:02be60/04 cheat description:Infinite health in action sequences (alt) code:7e001d/08 cheat description:Infinite health in sim mode code:7e0286/08 cheat description:Infinite magic in action sequences code:7e0021/05 cheat description:Infinite time (alt 2) code:02bc98/00 cheat description:Level 99 code:7e0291/63 cheat description:One hit kills on bosses code:7e0bcc/00 cheat description:Have Aura magic code:7e02ac/03 cheat description:Have Fire magic code:7e02ac/01 cheat description:Have Stardust magic code:7e02ac/02 cheat description:Have Sword Shot code:7e00e4/80 cheat description:Have Light magic code:7e02ac/04 cheat description:Slot 1 - Source of Life code:7e02a2/05 cheat description:Slot 1 - Source of Magic code:7e02a2/06 cheat description:Slot 1 - Loaf of Bread code:7e02a2/07 cheat description:Slot 1 - Wheat code:7e02a2/08 cheat description:Slot 1 - Herb code:7e02a2/09 cheat description:Slot 1 - Bridge code:7e02a2/0a cheat description:Slot 1 - Harmonious Music code:7e02a2/0b cheat description:Slot 1 - Ancient Tablet code:7e02a2/0c cheat description:Slot 1 - Magic Skull code:7e02a2/0e cheat description:Slot 1 - Sheep's Fleece code:7e02a2/0f cheat description:Slot 1 - Bomb code:7e02a2/10 cheat description:Slot 1 - Compass code:7e02a2/13 cheat description:Slot 1 - Strength of Angel code:7e02a2/14 cheat description:Slot 2 - Source of Life code:7e02a3/05 cheat description:Slot 2 - Source of Magic code:7e02a3/06 cheat description:Slot 2 - Loaf of Bread code:7e02a3/07 cheat description:Slot 2 - Wheat code:7e02a3/08 cheat description:Slot 2 - Herb code:7e02a3/09 cheat description:Slot 2 - Bridge code:7e02a3/0a cheat description:Slot 2 - Harmonious Music code:7e02a3/0b cheat description:Slot 2 - Ancient Tablet code:7e02a3/0c cheat description:Slot 2 - Magic Skull code:7e02a3/0e cheat description:Slot 2 - Sheep's Fleece code:7e02a3/0f cheat description:Slot 2 - Bomb code:7e02a3/10 cheat description:Slot 2 - Compass code:7e02a3/13 cheat description:Slot 2 - Strength of Angel code:7e02a3/14 cheat description:Slot 3 - Source of Life code:7e02a4/05 cheat description:Slot 3 - Source of Magic code:7e02a4/06 cheat description:Slot 3 - Loaf of Bread code:7e02a4/07 cheat description:Slot 3 - Wheat code:7e02a4/08 cheat description:Slot 3 - Herb code:7e02a4/09 cheat description:Slot 3 - Bridge code:7e02a4/0a cheat description:Slot 3 - Harmonious Music code:7e02a4/0b cheat description:Slot 3 - Ancient Tablet code:7e02a4/0c cheat description:Slot 3 - Magic Skull code:7e02a4/0e cheat description:Slot 3 - Sheep's Fleece code:7e02a4/0f cheat description:Slot 3 - Bomb code:7e02a4/10 cheat description:Slot 3 - Compass code:7e02a4/13 cheat description:Slot 3 - Strength of Angel code:7e02a4/14 cheat description:Slot 4 - Source of Life code:7e02a5/05 cheat description:Slot 4 - Source of Magic code:7e02a5/06 cheat description:Slot 4 - Loaf of Bread code:7e02a5/07 cheat description:Slot 4 - Wheat code:7e02a5/08 cheat description:Slot 4 - Herb code:7e02a5/09 cheat description:Slot 4 - Bridge code:7e02a5/0a cheat description:Slot 4 - Harmonious Music code:7e02a5/0b cheat description:Slot 4 - Ancient Tablet code:7e02a5/0c cheat description:Slot 4 - Magic Skull code:7e02a5/0e cheat description:Slot 4 - Sheep's Fleece code:7e02a5/0f cheat description:Slot 4 - Bomb code:7e02a5/10 cheat description:Slot 4 - Compass code:7e02a5/13 cheat description:Slot 4 - Strength of Angel code:7e02a5/14 cheat description:Slot 5 - Source of Life code:7e02a6/05 cheat description:Slot 5 - Source of Magic code:7e02a6/06 cheat description:Slot 5 - Loaf of Bread code:7e02a6/07 cheat description:Slot 5 - Wheat code:7e02a6/08 cheat description:Slot 5 - Herb code:7e02a6/09 cheat description:Slot 5 - Bridge code:7e02a6/0a cheat description:Slot 5 - Harmonious Music code:7e02a6/0b cheat description:Slot 5 - Ancient Tablet code:7e02a6/0c cheat description:Slot 5 - Magic Skull code:7e02a6/0e cheat description:Slot 5 - Sheep's Fleece code:7e02a6/0f cheat description:Slot 5 - Bomb code:7e02a6/10 cheat description:Slot 5 - Compass code:7e02a6/13 cheat description:Slot 5 - Strength of Angel code:7e02a6/14 cheat description:Slot 6 - Source of Life code:7e02a7/05 cheat description:Slot 6 - Source of Magic code:7e02a7/06 cheat description:Slot 6 - Loaf of Bread code:7e02a7/07 cheat description:Slot 6 - Wheat code:7e02a7/08 cheat description:Slot 6 - Herb code:7e02a7/09 cheat description:Slot 6 - Bridge code:7e02a7/0a cheat description:Slot 6 - Harmonious Music code:7e02a7/0b cheat description:Slot 6 - Ancient Tablet code:7e02a7/0c cheat description:Slot 6 - Magic Skull code:7e02a7/0e cheat description:Slot 6 - Sheep's Fleece code:7e02a7/0f cheat description:Slot 6 - Bomb code:7e02a7/10 cheat description:Slot 6 - Compass code:7e02a7/13 cheat description:Slot 6 - Strength of Angel code:7e02a7/14 cheat description:Slot 7 - Source of Life code:7e02a8/05 cheat description:Slot 7 - Source of Magic code:7e02a8/06 cheat description:Slot 7 - Loaf of Bread code:7e02a8/07 cheat description:Slot 7 - Wheat code:7e02a8/08 cheat description:Slot 7 - Herb code:7e02a8/09 cheat description:Slot 7 - Bridge code:7e02a8/0a cheat description:Slot 7 - Harmonious Music code:7e02a8/0b cheat description:Slot 7 - Ancient Tablet code:7e02a8/0c cheat description:Slot 7 - Magic Skull code:7e02a8/0e cheat description:Slot 7 - Sheep's Fleece code:7e02a8/0f cheat description:Slot 7 - Bomb code:7e02a8/10 cheat description:Slot 7 - Compass code:7e02a8/13 cheat description:Slot 7 - Strength of Angel code:7e02a8/14 cheat description:Slot 8 - Source of Life code:7e02a9/05 cheat description:Slot 8 - Source of Magic code:7e02a9/06 cheat description:Slot 8 - Loaf of Bread code:7e02a9/07 cheat description:Slot 8 - Wheat code:7e02a9/08 cheat description:Slot 8 - Herb code:7e02a9/09 cheat description:Slot 8 - Bridge code:7e02a9/0a cheat description:Slot 8 - Harmonious Music code:7e02a9/0b cheat description:Slot 8 - Ancient Tablet code:7e02a9/0c cheat description:Slot 8 - Magic Skull code:7e02a9/0e cheat description:Slot 8 - Sheep's Fleece code:7e02a9/0f cheat description:Slot 8 - Bomb code:7e02a9/10 cheat description:Slot 8 - Compass code:7e02a9/13 cheat description:Slot 8 - Strength of Angel code:7e02a9/14 cartridge sha256:71bdd448a30b88725864e55594ebb67a118b1f197a3f9e5dd39dbf23399efa15 name:ActRaiser 2 (USA) cheat description:Infinite health from most enemies code:809e45/ad cheat description:Infinite health from some ground hazards code:839adc/ad cheat description:Infinite time code:80e4ee/00 cheat description:Infinite MP (must have one to cast) code:828e77/ea cheat description:Infinite lives code:828c3a/00 cheat description:Hit anywhere code:80997f/24+80998b/24+80999c/24+8099a3/24 cheat description:One hit kills code:809aee/00 cheat description:Small magic power-up adds 3 instead of 1 code:80af4f/03 cheat description:Small magic power-up adds 5 code:80af4f/05 cheat description:Small magic power-up adds 9 code:80af4f/09 cheat description:Large magic power-up adds 1 instead of 3 code:80af59/01 cheat description:Large magic power-up adds 5 code:80af59/05 cheat description:Large magic power-up adds 9 code:80af59/09 cheat description:Small health power-ups add 1 instead of 2 code:80af32/01 cheat description:Small health power-ups add 4 code:80af32/04 cheat description:Small health power-ups add 15 code:80af32/15 cheat description:Small health power-ups heal completely code:80af32/14 cheat description:Medium health power-ups add 2 instead of 5 code:80af54/02 cheat description:Medium health power-ups add 8 code:80af54/08 cheat description:Medium health power-ups add 15 code:80af54/15 cheat description:Medium health power-ups heal completely code:80af54/14 cheat description:Large health power-ups add 2 instead of 10 code:80af37/02 cheat description:Large health power-ups add 5 code:80af37/04 cheat description:Large health power-ups add 15 code:80af37/15 cheat description:Large health power-ups heal completely code:80af37/14 cheat description:Start with 3 lives on Easy code:81d830/03 cheat description:Start with 10 lives on Easy code:81d830/10 cheat description:Start with 50 lives on Easy code:81d830/50 cheat description:Start with 1 life on Normal code:81d832/01 cheat description:Start with 5 lives on Normal code:81d832/05 cheat description:Start with 10 lives on Normal code:81d832/10 cheat description:Start with 50 lives on Normal code:81d832/50 cheat description:Start with 1 life on Hard code:81d834/01 cheat description:Start with 5 lives on Hard code:81d834/05 cheat description:Start with 10 lives on Hard code:81d834/10 cheat description:Start with 50 lives on Hard code:81d834/50 cheat description:Start with 2 MP on Easy code:82b126/02 cheat description:Start with 7 MP on Easy code:82b126/07 cheat description:Start with 9 MP on Easy code:82b126/09 cheat description:Start with 1 MP on Normal or Hard code:82b11e/01 cheat description:Start with 5 MP on Normal or Hard code:82b11e/05 cheat description:Start with 7 MP on Normal or Hard code:82b11e/07 cheat description:Start with 9 MP on Normal or Hard code:82b11e/09 cheat description:Start with 1/2 health code:82b115/0a cheat description:Start with 3/4 health code:82b115/0f cheat description:Invincibility (blinking) code:7f205e/18 cheat description:Infinite health (alt) code:7e091d/16 cheat description:Infinite time (alt) (disable at end of level) code:7e094d/63 cartridge sha256:e645310d2406ace85523ed91070ee7ff6aa245217267dacb158ae9fc75109692 name:Addams Family, The (USA) cheat description:Invincibility code:00c23d/d0 cheat description:Infinite health code:00cf3a/ea cheat description:Infinite health (alt) code:00cf3b/60 cheat description:Infinite health (alt 2) code:00cf3b/a5 cheat description:Infinite lives code:00cf6b/00 cheat description:Infinite lives (alt) code:00cf6c/a5 cheat description:Double-jump code:00bd37/00 cheat description:Each $ worth 5 code:00a413/05 cheat description:Each $ worth 10 code:00a413/10 cheat description:Each $ worth 25 code:00a413/25 cheat description:Have Fezi-copter code:00c2a4/80 cheat description:Start with and keep Fezi-copter (disable after defeating a boss, land before password screen) code:00c30a/ea+009acd/84 cheat description:Start with 1 heart code:008165/01+008166/01 cheat description:Start with 3 hearts code:008165/03+008166/03 cheat description:Start with 4 hearts code:008165/04+008166/04 cheat description:Start with 5 hearts code:008165/05+008166/05 cheat description:Start with 1 life code:009ab5/01 cheat description:Start with 3 lives code:009ab5/03 cheat description:Start with 9 lives code:009ab5/09 cheat description:Start with 20 lives code:009ab5/20 cheat description:Start with 50 lives code:009ab5/50 cheat description:Start with 99 lives code:009ab5/99 cheat description:Infinite health and max hearts code:7e00c3/05 cheat description:Always throw Balls code:7e00ef/01 cheat description:Have Fezi-copter (alt) code:7e0064/ff cheat description:Have Foil (Sword) code:7e00ee/01 cartridge sha256:b6957bae7fd97ba681afbf8962fe2138e209649fd88ed9add2d5233178680aaa name:Addams Family, The - Pugsley's Scavenger Hunt (USA) cheat description:Infinite health code:80a0aa/ea cheat description:Infinite hearts code:80a0aa/ea cheat description:Infinite lives code:809d87/00 cheat description:Each $ worth 5 code:80a05e/05 cheat description:Each $ worth 25 code:80a05e/25 cheat description:Higher jump code:80cb7c/e9+80cb7d/05 cheat description:Super-jump code:80cb7c/e9+80cb7d/07 cheat description:Mega-jump code:80cb7c/e9+80cb7d/09 cheat description:Longer invulnerability time after being hit code:80a0b0/7f cheat description:Shorter invulnerability time after being hit code:80a0b0/08 cheat description:Get 0 lives for each $100 and 1-Up code:809e4e/00 cheat description:Get 2 lives for each $100 and 1-Up code:809e4e/02 cheat description:Start with 1 heart (don't edit hearts in options menu) code:00f00e/00 cheat description:Start with 2 hearts (don't edit hearts in options menu) code:00f00e/01 cheat description:Start with 5 hearts (don't edit hearts in options menu) code:00f00e/04 cheat description:Start with 4 lives (don't edit lives in options menu) code:00f009/00 cheat description:Start with 16 lives (don't edit lives in options menu) code:00f009/09 cheat description:Start with 64 lives (don't edit lives in options menu) code:00f009/30 cheat description:Infinite health (alt) code:7e0095/03 cheat description:Infinite lives (alt) code:7e004d/09 cheat description:Infinite Cash code:7e004e/99 cartridge sha256:f59a0a8ed11ea2ba6217b1640e74bab8d8d8161a4585f5ae4a02edd7958ad9a3 name:Addams Family Values (USA) (En,Fr,De) cheat description:Infinite health against enemies code:809e0e/11 cheat description:Infinite health against everything code:80b219/ea cheat description:Infinite Small Rocks code:80d721/00 cheat description:Infinite Blue Marbles code:80d6af/00 cheat description:Infinite Magic Seeds code:80d6d5/00 cheat description:Infinite Swamp Slime code:80d6fb/00 cheat description:Infinite cookies code:80d1c2/bf cheat description:Start with full skull meter code:8083d5/1c cheat description:Start with all items code:b083a5/ff cheat description:Have Amulet of True Sight code:7ee9fc/ff cheat description:Have Big Book of Bisquits code:7ee9f0/ff cheat description:Have Black Beetle Cookies code:7ee9e0/ff+7ee9e4/ff cheat description:Have Black Egg code:7eea05/ff cheat description:Have Black Rose code:7ee9fa/ff cheat description:Have Bone Spoon code:7ee9f7/ff cheat description:Have Book of Flying code:7ee9f9/ff cheat description:Have Candle code:7ee9f6/ff cheat description:Have Clyde's Cookie Compendium code:7ee9ef/ff cheat description:Have Crumble Cookies code:7ee9e2/ff+7ee9e6/ff cheat description:Have Crusty Cookies code:7ee9e1/ff+7ee9e5/ff cheat description:Have Dragon Belch Cookies code:7ee9df/ff+7ee9e3/ff cheat description:Have Firefly code:7eea03/ff cheat description:Have Gold Coin code:7eea06/ff cheat description:Have Green Key code:7ee9d8/ff cheat description:Have Greenhouse Key code:7ee9d7/ff cheat description:Have Headless Teddy code:7ee9f4/ff cheat description:Have Iron Key code:7ee9de/ff cheat description:Have Jewelled Key code:7ee9db/ff cheat description:Have Journal code:7ee9f2/ff cheat description:Have Large Vine code:7eea02/ff cheat description:Have Lurch's Bowling Ball code:7eea04/ff cheat description:Have Magnet code:7ee9ff/ff cheat description:Have Max's Munch Manual code:7ee9f1/ff cheat description:Have Money code:7e004e/63 cheat description:Have Musical Box code:7ee9fb/ff cheat description:Have Plant Food code:7ee9ea/ff cheat description:Have Portal Potion code:7ee9e8/ff cheat description:Have Pumpkin code:7ee9f3/ff cheat description:Have Red Potion code:7ee9e7/ff cheat description:Have Sack of Gold code:7ee9f5/ff cheat description:Have Slimming Potion code:7ee9e9/ff cheat description:Have Shockwave code:7ee9fd/ff cheat description:Have Skull Rattle code:7ee9f8/ff cheat description:Have Skull Key code:7ee9d9/ff cheat description:Have Spider Key code:7ee9dd/ff cheat description:Have Spider's Eye code:7ee9fe/ff cheat description:Have Stone Button code:7eea01/ff cheat description:Have Stone Key code:7ee9dc/ff cheat description:Have Stone Twig Key code:7ee9da/ff cheat description:Have Strange Black Cube code:7eea00/ff cartridge sha256:0a8cd5101f849ccd4e40d55fdc4edce914b2825b69eb76ec31cf53b59719e79e name:Advanced Dungeons & Dragons - Eye of the Beholder (USA) cheat description:Infinite HP code:06ba73/bd+7e05f9/bd cheat description:No waiting to hit again code:06bf0d/bd cheat description:One hit kills (works for enemies also) code:06c3cf/a9+06c3d1/ea cheat description:Pick a lawful, human male fighter and he will be at Level 8 code:0cbb98/08 cheat description:Pick a lawful, human male fighter and he will be at level 6 code:0cbb98/06 cheat description:999,999 EXP 1st class code:7e0533/3f+7e0534/42+7e0535/0f cartridge sha256:8083307f3f4b7df9e5bf53d5f25877c2e548f0f677540d4ee62d60ccca3098f8 name:Adventures of Batman & Robin, The (USA) cheat description:Invincibility (except after being grabbed) code:80a133/d0 cheat description:Infinite health code:80b0d5/a5 cheat description:Infinite health (alt) code:80b0c2/00 cheat description:Get full health from hearts code:848899/28 cheat description:Infinite Stars code:80c76b/a5 cheat description:Infinite Spray Gun ammo code:80c778/a5 cheat description:Infinite Plastic Explosives code:80c792/a5 cheat description:Infinite Smoke Bombs code:80c785/a5 cheat description:Infinite Missiles code:80c76b/00 cheat description:Infinite Bombs code:80c792/00 cheat description:Infinite lives code:80b3b9/a5 cheat description:Hit anywhere code:8793b9/a5+879406/a5+87939a/00+80a48b/00+8793e7/00+83f451/00 cheat description:Moon-jump code:80c518/20 cheat description:Super-jump code:80a738/f8 cheat description:Move slower code:81be0e/00+81be10/ff cheat description:Move faster code:81be0e/04+81be10/fb cheat description:Move even faster code:81be0e/07+81be10/f8 cheat description:Moon-walk code:81be0e/fe+81be10/01 cheat description:Moon-walk faster code:81be0e/fb+81be10/04 cheat description:Moon-walk even faster code:81be0e/f8+81be10/f7 cheat description:No credits code:89b481/00 cheat description:Don't start with any Explosives and Smoke Bomb ammo code:8097f5/00 cheat description:Don't start with any Stars and Spray Gun ammo code:8097ee/00 cheat description:Start with 25 Stars and Spray Gun ammo code:8097ee/19 cheat description:Start with 50 Stars and Spray Gun ammo code:8097ee/33 cheat description:Start with 25 Explosives and Smoke Bomb ammo code:8097f5/19 cheat description:Start with 50 Explosives and Smoke Bomb ammo code:8097f5/33 cheat description:Start with 9 lives - not on easy mode code:89b486/09 cheat description:Start with 6 lives - not on easy mode code:89b486/06 cheat description:Start with 1 life - not on easy mode code:89b486/00 cheat description:Start with 9 credits code:89b481/09 cheat description:Start with 6 credits code:89b481/06 cheat description:Infinite health (alt 2) code:7e0098/28 cheat description:Infinite item #3 code:7e00a0/09 cheat description:Infinite item #4 code:7e00a2/09 cheat description:Infinite item #5 code:7e00a4/09 cheat description:Infinite item #6 code:7e00a6/09 cartridge sha256:ecd964ae44e61203bc8759cfc6441365bf0c6e7bae6ad2a0fd553d4c7efab71e name:Adventures of Dr. Franken, The (USA) cheat description:Invincibility code:809e90/ea cheat description:Health power-ups give a full health bar code:80c949/0e+80c97a/8d cheat description:Infinite health (glitchy) code:809495/ad+809498/ad cheat description:Infinite time code:80da4f/ad cheat description:Infinite lives code:80925b/ad cheat description:Infinite Power Balls code:80957b/ea cheat description:Infinite Freeze code:809595/ea cheat description:Infinite Fire code:809591/ea cheat description:Infinite Lightning code:809577/ea cartridge sha256:670d898bdcf97d7ca3aab6c2dd1641f1270fcc2a070bbd3028ab413aef2b2ecc name:Adventures of Kid Kleets, The (USA) (En,Fr,Es) cheat description:Invincibility code:81c18b/60 cheat description:Infinite time code:8187cd/ad cheat description:Infinite health code:81c18d/ad cheat description:Infinite lives code:81bbdb/ad cheat description:Hit anywhere code:83c04e/00+83c056/00 cheat description:Moon jump code:81b5b1/7a+81b5b3/30+81b5ef/00 cartridge sha256:b70099186d3774355ac5db370240e370c73f9ce5341f6c805cf9f771374b43ae name:Adventures of Rocky and Bullwinkle and Friends, The (USA) cheat description:Invincibility code:9ca9c7/d0+9ca9cd/f0 cheat description:Infinite chances code:88b9a4/ad cheat description:Infinite lives code:81aaf6/ad cheat description:Infinite ammo code:81aa15/ad cheat description:Infinite health code:9ca312/ad cheat description:Infinite continues code:8af0ee/ad cheat description:Don't lose ammo when you die code:9ca35f/ad cheat description:Don't lose collected flags when you die code:9ca23a/ad cheat description:1-Up with every flag collected code:81a9ce/01 cartridge sha256:8049175767eddbc3e21ca5b94ee23fc225f834ccfab4ded30d2e981b0ef73ab6 name:Adventures of Yogi Bear (USA) cheat description:Infinite health code:80a909/ad cheat description:Infinite lives code:80805c/ad cartridge sha256:b737de81315eef8ded7cfd5df6b37aba01d9e6e14566486db7ec83eb0c1aa85e name:Aero Fighters (USA) cheat description:Invincibility code:80a8d2/bd cheat description:Infinite lives - both players code:81d35f/bd cheat description:Infinite Bombs for American F-18 - P1 code:81e83f/bd cheat description:Infinite Bombs for Japanese FSX - P1 code:81e43f/bd cheat description:Infinite Bombs for Swedish AJ-37 - P1 code:81e531/bd cheat description:Infinite Bombs for British AV-8 - P1 code:81e53f/bd cheat description:Infinite Bombs for American F-15 - P2 code:81e3f2/bd cheat description:Infinite Bombs for Japanese F-15 - P2 code:81e4c1/bd cheat description:Infinite Bombs for Swedish JAS-39 - P2 code:81e554/bd cheat description:Infinite Bombs for British IDS - P2 code:81e60e/bd cheat description:Don't lose power-ups when you die - both players code:81d35c/bd cheat description:Hit anywhere + one hit kills code:80a1c8/24+80a1cf/24+80a1d4/24+80a1d8/24+80a1dc/24+80a175/80+80a193/80 cheat description:One hit kills code:80a193/80 cheat description:Infinite lives (alt) code:7fb78c/02 cheat description:Max Cannon power code:7fb794/03 cheat description:Infinite Bombs / Specials code:7fb790/02 cartridge sha256:18a553dafd4980cc2869180b05f9fdf6e980bf092cc683e498ec6373c9701c6e name:Aero the Acro-Bat (USA) cheat description:Infinite health from most enemies code:82fb00/ea cheat description:Start with more health code:83d831/6c cheat description:Infinite time code:83f1aa/00 cheat description:Infinite lives code:80879f/00 cheat description:Start with 19 lives code:8080b4/70 cheat description:Infinite continues code:848bff/ad cheat description:Each star platform is worth 4 code:80e22f/04 cartridge sha256:fc5df5db0a96d39d3df651f63993adf0f5cb5a6b92a36211f3a05d460d92c72d name:Aero the Acro-Bat 2 (USA) cheat description:Invincibility code:809042/d0 cheat description:Infinite health code:83be37/cd cheat description:Almost infinite health code:83be37/ad cheat description:Infinite lives code:8084a1/ad cheat description:Infinite Stars code:83dc30/ad cheat description:Infinite Shots code:83dc2e/00 cheat description:Stars worth 3 code:83a9bc/03 cheat description:Stars worth 5 code:83a9bc/05 cheat description:Stars worth 7 code:83a9bc/07 cheat description:Double Drill icon lasts 99 seconds code:83aada/99 cheat description:Double Drill icon lets you drill 4 times instead of 2 code:83aad1/04 cheat description:Double Drill icon lets you drill 9 times instead of 2 code:83aad1/09 cheat description:Can drill 5 times in the air until you pick-up a drill icon code:85e880/05 cheat description:Can drill 9 times in the air until you pick-up a drill icon code:85e880/09 cheat description:Drill as many times as you want without hitting the ground code:8388f5/ad cheat description:Move faster code:8382b3/02+8382c1/fd cheat description:Move even faster code:8382b3/03+8382c1/fc cheat description:Jump higher code:838730/10 cheat description:Super-jump when standing still code:8384f6/f8+83866e/f8 cheat description:Flying icon worth 99 seconds of flight time code:83abe2/99 cheat description:Start each life with max health code:85e958/05 cartridge sha256:d5f0fbeed3774bbccbd769698fc4051487a0a5eb699790a8a094451595600f60 name:Aerobiz (USA) cheat description:In scenario 1, Tokyo starts with $649,280,000 code:04c180/00 cheat description:In scenario 1, Tokyo starts with $7,202,880,000 code:04c180/05 cheat description:In scenario 1, Beijing starts with $420,160,000 code:04c183/52 cheat description:In scenario 1, Beijing starts with $7,393,600,000 code:04c184/05 cheat description:In scenario 1, Hong Kong starts with $449,440,000 code:04c187/57 cheat description:In scenario 1, Hong Kong starts with $7,453,600,000 code:04c188/05 cheat description:In scenario 1, Singapore starts with $400,640,000 code:04c18b/4e cheat description:In scenario 1, Singapore starts with $7,353,600,000 code:04c18c/05 cheat description:In scenario 1, Sydney starts with $297,920,000 code:04c18f/3a cheat description:In scenario 1, Sydney starts with $7,153,600,000 code:04c190/05 cheat description:In scenario 1, Delhi starts with $317,440,000 code:04c193/3e cheat description:In scenario 1, Delhi starts with $7,193,600,000 code:04c194/05 cheat description:In scenario 1, Tehran starts with $239,360,000 code:04c197/2e cheat description:In scenario 1, Tehran starts with $7,033,600,000 code:04c198/05 cheat description:In scenario 1, Cairo starts with $249,120,000 code:04c19b/30 cheat description:In scenario 1, Cairo starts with $7,053,600,000 code:04c19c/05 cheat description:In scenario 1, Nairobi starts with $200,320,000 code:04c19f/27 cheat description:In scenario 1, Nairobi starts with $6,953,600,000 code:04c1a0/05 cheat description:In scenario 1, Lagos starts with $229,600,000 code:04c1a3/2c cheat description:In scenario 1, Lagos starts with $7,013,600,000 code:04c1a4/05 cheat description:In scenario 1, Moscow starts with $289,280,000 code:04c1a8/00 cheat description:In scenario 1, Moscow starts with $6,842,880,000 code:04c1a8/05 cheat description:In scenario 1, London starts with $949,280,000 code:04c1ac/00 cheat description:In scenario 1, London starts with $7,502,880,000 code:04c1ac/05 cheat description:In scenario 1, Paris starts with $289,280,000 code:04c1b0/00 cheat description:In scenario 1, Paris starts with $6,842,880,000 code:04c1b0/05 cheat description:In scenario 1, Rome starts with $371,360,000 code:04c1b3/48 cheat description:In scenario 1, Rome starts with $7,293,600,000 code:04c1b4/05 cheat description:In scenario 1, New York starts with $189,280,000 code:04c1b8/00 cheat description:In scenario 1, New York starts with $6,742,880,000 code:04c1b8/05 cheat description:In scenario 1, Vancouver starts with $258,880,000 code:04c1bb/32 cheat description:In scenario 1, Vancouver starts with $7,073,600,000 code:04c1bc/05 cheat description:In scenario 1, Los Angeles starts with $649,280,000 code:04c1c0/00 cheat description:In scenario 1, Los Angeles starts with $7,202,880,000 code:04c1c0/05 cheat description:In scenario 1, Honolulu starts with $268,640,000 code:04c1c3/34 cheat description:In scenario 1, Honolulu starts with $7,093,600,000 code:04c1c4/05 cheat description:In scenario 1, Mexico City starts with $258,880,000 code:04c1c7/32 cheat description:In scenario 1, Mexico City starts with $7,073,600,000 code:04c1c8/05 cheat description:In scenario 1, Lima starts with $180,800,000 code:04c1cb/23 cheat description:In scenario 1, Lima starts with $6,913,600,000 code:04c1cc/05 cheat description:In scenario 1, Rio de Janeiro starts with $317,440,000 code:04c1cf/3e cheat description:In scenario 1, Rio de Janeiro starts with $7,193,600,000 code:04c1d0/05 cheat description:In scenario 1, Buenos Aires starts with $210,080,000 code:04c1d3/29 cheat description:In scenario 1, Buenos Aires starts with $6,973,600,000 code:04c1d4/05 cheat description:In scenario 2, Tokyo starts with $1,149,280,000 code:04c1d8/00 cheat description:In scenario 2, Tokyo starts with $7,702,880,000 code:04c1d8/05 cheat description:In scenario 2, Beijing starts with $498,240,000 code:04c1db/61 cheat description:In scenario 2, Beijing starts with $7,553,600,000 code:04c1dc/05 cheat description:In scenario 2, Hong Kong starts with $649,760,000 code:04c1df/7e cheat description:In scenario 2, Hong Kong starts with $7,853,600,000 code:04c1e0/05 cheat description:In scenario 2, Singapore starts with $552,160,000 code:04c1e3/6b cheat description:In scenario 2, Singapore starts with $7,653,600,000 code:04c1e4/05 cheat description:In scenario 2, Sydney starts with $581,440,000 code:04c1e7/71 cheat description:In scenario 2, Sydney starts with $7,713,600,000 code:04c1e8/05 cheat description:In scenario 2, Delhi starts with $517,760,000 code:04c1eb/65 cheat description:In scenario 2, Delhi starts with $7,593,600,000 code:04c1ec/05 cheat description:In scenario 2, Tehran starts with $297,920,000 code:04c1ef/3a cheat description:In scenario 2, Tehran starts with $7,153,600,000 code:04c1f0/05 cheat description:In scenario 2, Cairo starts with $390,880,000 code:04c1f3/4c cheat description:In scenario 2, Cairo starts with $7,333,600,000 code:04c1f4/05 cheat description:In scenario 2, Nairobi starts with $249,120,000 code:04c1f7/30 cheat description:In scenario 2, Nairobi starts with $7,053,600,000 code:04c1f8/05 cheat description:In scenario 2, Lagos starts with $299,040,000 code:04c1fb/3a cheat description:In scenario 2, Lagos starts with $7,149,600,000 code:04c1fc/05 cheat description:In scenario 2, Moscow starts with $689,280,000 code:04c200/00 cheat description:In scenario 2, Moscow starts with $7,242,880,000 code:04c200/05 cheat description:In scenario 2, London starts with $38,560,000 code:04c204/00 cheat description:In scenario 2, London starts with $6,592,160,000 code:04c204/05 cheat description:In scenario 2, Paris starts with $909,280,000 code:04c208/00 cheat description:In scenario 2, Paris starts with $7,462,880,000 code:04c208/05 cheat description:In scenario 2, Rome starts with $571,680,000 code:04c20b/6f cheat description:In scenario 2, Rome starts with $7,693,600,000 code:04c20c/05 cheat description:In scenario 2, New York starts with $829,280,000 code:04c210/00 cheat description:In scenario 2, New York starts with $7,382,880,000 code:04c210/05 cheat description:In scenario 2, Vancouver starts with $420,160,000 code:04c213/52 cheat description:In scenario 2, Vancouver starts with $7,393,600,000 code:04c214/05 cheat description:In scenario 2, Los Angeles starts with $1,109,280,000 code:04c218/00 cheat description:In scenario 2, Los Angeles starts with $7,662,880,000 code:04c218/05 cheat description:In scenario 2, Honolulu starts with $381,120,000 code:04c21b/4a cheat description:In scenario 2, Honolulu starts with $7,313,600,000 code:04c21c/05 cheat description:In scenario 2, Mexico City starts with $468,960,000 code:04c21f/5b cheat description:In scenario 2, Mexico City starts with $7,493,600,000 code:04c220/05 cheat description:In scenario 2, Lima starts with $258,880,000 code:04c223/32 cheat description:In scenario 2, Lima starts with $7,073,600,000 code:04c224/05 cheat description:In scenario 2, Rio de Janeiro starts with $630,240,000 code:04c227/7b cheat description:In scenario 2, Rio de Janeiro starts with $7,813,600,000 code:04c228/05 cheat description:In scenario 2, Buenos Aires starts with $361,600,000 code:04c22b/46 cheat description:In scenario 2, Buenos Aires starts with $7,273,600,000 code:04c22c/05 cheat description:Key Code code:03f8ea/90 cheat description:Set money to less than $655,350,000 (must have Key) - P1, saved game 1 code:70001c/00 cheat description:Set money to over $327,680,000 (must have Key) - P1, saved game 1 code:70001c/05 cheat description:Set money to over $5,242,880,000 (must have Key) - P1, saved game 1 code:70001c/08 cheat description:Set money to over $10,485,760,000 (must have Key) - P1, saved game 1 code:70001c/10 cheat description:Set money to over $20,971,520,000 (must have Key) - P1, saved game 1 code:70001c/20 cheat description:Set money to over $41,943,040,000 (must have Key) - P1, saved game 1 code:70001c/40 cheat description:Set money to less than $655,350,000 (must have Key) - P2, saved game 1 code:70005c/00 cheat description:Set money to over $327,680,000 (must have Key) - P2, saved game 1 code:70005c/05 cheat description:Set money to over $5,242,880,000 (must have Key) - P2, saved game 1 code:70005c/08 cheat description:Set money to over $10,485,760,000 (must have Key) - P2, saved game 1 code:70005c/10 cheat description:Set money to over $20,971,520,000 (must have Key) - P2, saved game 1 code:70005c/20 cheat description:Set money to over $41,943,040,000 (must have Key) - P2, saved game 1 code:70005c/40 cheat description:Set money to less than $655,350,000 (must have Key) - P3, saved game 1 code:70009c/00 cheat description:Set money to over $327,680,000 (must have Key) - P3, saved game 1 code:70009c/05 cheat description:Set money to over $5,242,880,000 (must have Key) - P3, saved game 1 code:70009c/08 cheat description:Set money to over $10,485,760,000 (must have Key) - P3, saved game 1 code:70009c/10 cheat description:Set money to over $20,971,520,000 (must have Key) - P3, saved game 1 code:70009c/20 cheat description:Set money to over $41,943,040,000 (must have Key) - P3, saved game 1 code:70009c/40 cheat description:Set money to less than $655,350,000 (must have Key) - P4, saved game 1 code:7000dc/00 cheat description:Set money to over $327,680,000 (must have Key) - P4, saved game 1 code:7000dc/05 cheat description:Set money to over $5,242,880,000 (must have Key) - P4, saved game 1 code:7000dc/08 cheat description:Set money to over $10,485,760,000 (must have Key) - P4, saved game 1 code:7000dc/10 cheat description:Set money to over $20,971,520,000 (must have Key) - P4, saved game 1 code:7000dc/20 cheat description:Set money to over $41,943,040,000 (must have Key) - P4, saved game 1 code:7000dc/40 cheat description:Set money to less than $655,350,000 (must have Key) - P1, saved game 2 code:70101c/00 cheat description:Set money to over $327,680,000 (must have Key) - P1, saved game 2 code:70101c/05 cheat description:Set money to over $5,242,880,000 (must have Key) - P1, saved game 2 code:70101c/08 cheat description:Set money to over $10,485,760,000 (must have Key) - P1, saved game 2 code:70101c/10 cheat description:Set money to over $20,971,520,000 (must have Key) - P1, saved game 2 code:70101c/20 cheat description:Set money to over $41,943,040,000 (must have Key) - P1, saved game 2 code:70101c/40 cheat description:Set money to less than $655,350,000 (must have Key) - P2, saved game 2 code:70105c/00 cheat description:Set money to over $327,680,000 (must have Key) - P2, saved game 2 code:70105c/05 cheat description:Set money to over $5,242,880,000 (must have Key) - P2, saved game 2 code:70105c/08 cheat description:Set money to over $10,485,760,000 (must have Key) - P2, saved game 2 code:70105c/10 cheat description:Set money to over $20,971,520,000 (must have Key) - P2, saved game 2 code:70105c/20 cheat description:Set money to over $41,943,040,000 (must have Key) - P2, saved game 2 code:70105c/40 cheat description:Set money to less than $655,350,000 (must have Key) - P3, saved game 2 code:70109c/00 cheat description:Set money to over $327,680,000 (must have Key) - P3, saved game 2 code:70109c/05 cheat description:Set money to over $5,242,880,000 (must have Key) - P3, saved game 2 code:70109c/08 cheat description:Set money to over $10,485,760,000 (must have Key) - P3, saved game 2 code:70109c/10 cheat description:Set money to over $20,971,520,000 (must have Key) - P3, saved game 2 code:70109c/20 cheat description:Set money to over $41,943,040,000 (must have Key) - P3, saved game 2 code:70109c/40 cheat description:Set money to less than $655,350,000 (must have Key) - P4, saved game 2 code:7010dc/00 cheat description:Set money to over $327,680,000 (must have Key) - P4, saved game 2 code:7010dc/05 cheat description:Set money to over $5,242,880,000 (must have Key) - P4, saved game 2 code:7010dc/08 cheat description:Set money to over $10,485,760,000 (must have Key) - P4, saved game 2 code:7010dc/10 cheat description:Set money to over $20,971,520,000 (must have Key) - P4, saved game 2 code:7010dc/20 cheat description:Set money to over $41,943,040,000 (must have Key) - P4, saved game 2 code:7010dc/40 cartridge sha256:1f5738552c51de25ffe8aa44ff396c1ab238435296f1e8f99f8cf335483c03d5 name:Air Cavalry (USA) cheat description:Infinite lives code:00fbb2/e0 cheat description:Infinite 7.62mm rounds code:009c3f/bd cheat description:Infinite 2.75 rockets code:00f86c/b5+00f880/b5+009c75/bd cartridge sha256:aa768b8b00123717c8d49f2c6731cdbfd80ab6a54128bae7594e93f45e38a19e name:Aladdin (USA) cheat description:Invincibility code:81e8c1/d0 cheat description:Almost invincible code:838031/ad cheat description:Infinite health code:838031/cd cheat description:Infinite lives code:81dc67/cd+81dc67/ad cheat description:Infinite Apples code:81ce5c/ad+81ce5b/ea cheat description:Infinite continues code:80b3ec/ad cheat description:Level select on main menu code:809f7a/00+809fc7/00 cheat description:Emeralds worth 2 instead of 1 code:83bc4b/1c cheat description:Emeralds worth 3 code:83bc4b/19 cheat description:Rubies worth 1 instead of 3 code:83bc65/ce cheat description:Rubies worth 2 code:83bc65/ad cheat description:Bonus round played after every level code:81cc30/00 cheat description:Only 10 gems needed for health increase/free life code:83bc86/10 cheat description:Only 20 gems needed for health increase/free life code:83bc86/20 cheat description:Only 30 gems needed for health increase/free life code:83bc86/30 cheat description:Only 40 gems needed for health increase/free life code:83bc86/40 cheat description:Only 50 gems needed for health increase/free life code:83bc86/50 cheat description:Only 60 gems needed for health increase/free life code:83bc86/60 cheat description:Only 90 gems needed for health increase/free life code:83bc86/90 cheat description:Apple power-ups worth 20 instead of 10 code:83b890/20 cheat description:Apple power-ups worth 50 code:83b890/50 cheat description:Apple power-ups worth 90 code:83b890/90 cheat description:Start with 5 Apples code:818136/05 cheat description:Start with 20 Apples code:818136/20 cheat description:Start with 2 health code:81812b/02 cheat description:Start with 5 health code:81812b/05 cheat description:Start with 7 health code:81812b/07 cheat description:Start with 1 life code:818120/01 cheat description:Start with 5 lives code:818120/05 cheat description:Start with 20 lives code:818120/14 cheat description:Start with 1 continue code:809fb5/01 cheat description:Start with 5 continues code:809fb5/05 cheat description:Start with 9 continues code:809fb5/0a cheat description:Invincibility (alt) code:7e0347/04 cheat description:Infinite Apples (alt) code:7e0369/99 cheat description:Moon-jump code:7e08fb/16 cartridge sha256:e637b8241d55ee334a3452888df5e30d72c520dbb55c498db1a984438bab3e55 name:Alien 3 (USA) cheat description:Invincibility code:818154/00 cheat description:Infinite energy code:818122/80 cheat description:Take less damage code:818122/02 cheat description:Most attacks do no damage code:818122/00 cheat description:Longer invulnerability after being hit code:818291/ff cheat description:Slower fuel consumption for flame thrower code:80db8c/ff cheat description:Faster fuel consumption for flame thrower code:80db8c/30 cheat description:Infinite oil for flame thrower code:80db7d/ea cheat description:Infinite flame thrower code:81d9cc/ad cheat description:Infinite machine-gun code:80d8b9/b9 cheat description:Infinite missiles code:80dbd3/b9 cheat description:Infinite ammo for pulse rifle code:80d8b8/ea cheat description:Infinite ammo for grenade launcher code:80dbd2/ea cheat description:Less ammo in rifle clips (works with extra clips only, not the ones you start with) code:80d8cb/32 cheat description:More ammo in rifle clips (works with extra clips only, not the ones you start with) code:80d8cb/a0 cheat description:Less ammo in grenade clips (works with extra clips only, not the ones you start with) code:80dbe2/05 cheat description:More ammo in grenade clips (works with extra clips only, not the ones you start with) code:80dbe2/14 cheat description:Maximum energy from medi-kits code:81810d/00 cheat description:Less energy from medi-kits code:818103/03 cheat description:Start with more rifle clips code:81e888/10 cheat description:Start with even more rifle clips code:81e888/20 cheat description:Start with fewer rifle clips code:81e888/04 cheat description:Start with more grenade clips code:81e895/10 cheat description:Start with even more grenade clips code:81e895/20 cheat description:Start with fewer grenade clips code:81e895/04 cheat description:Mission 1 completed code:7e0fde/ff cheat description:Mission 2 completed code:7e0ff0/ff cheat description:Mission 3 completed code:7e0ff2/ff cheat description:Mission 4 completed code:7e0ff4/ff cheat description:Mission 5 completed code:7e0ff6/ff cheat description:Mission 6 completed code:7e0ff8/ff cheat description:Mission 7 completed code:7e0ffa/ff cheat description:Mission 8 completed code:7e0ffc/ff cartridge sha256:05eb897d7696555790591c431c9d55a43ff9a1c12162443c17c5fcddfa5eb3c5 name:Alien vs Predator (USA) cheat description:Invincibility code:00e197/60+00dcd8/80 cheat description:Infinite health code:00e1b4/ad+00e180/ad cheat description:No damage taken from punches code:00e180/ad cheat description:No damage taken from jumping attacks, tail attacks, rushes code:00e1b4/ad cheat description:Infinite lives code:00b38d/ad cheat description:Infinite lives (alt) code:00b38d/00 cheat description:Infinite continues code:02fecc/ea cheat description:One hit kills code:00df07/80+00e238/80+019fbe/80+00e452/80 cheat description:Hit anywhere code:00de94/24+00dd91/06+00dd02/06+00e3c8/06 cheat description:Disc power-ups give 1 disc instead of 6 (handicap) code:00b6eb/01 cheat description:Disc power-ups give 3 discs code:00b6eb/03 cheat description:Disc power-ups give 10 discs code:00b6eb/0a cheat description:Disc power-ups give 25 discs code:00b6eb/19 cheat description:Spear power-ups give 1 spear instead of 6 code:00b6f2/01 cheat description:Spear power-ups give 3 spears code:00b6f2/03 cheat description:Spear power-ups give 10 spears code:00b6f2/0a cheat description:Spear power-ups give 25 spears code:00b6f2/19 cheat description:Spear and disc power-ups last until end of level (can't pick up other power-ups) code:00a9c0/f0 cheat description:Rhynth meat doesn't add to your maximum health code:00b6d4/ad cheat description:Rhynth meat adds 1/2 as much to maximum health (handicap) code:00b6c6/04 cheat description:Rhynth meat adds 2x as much to maximum health code:00b6c6/10 cheat description:Rhynth meat adds 4x as much to maximum health code:00b6c6/20 cheat description:Rhynth meat adds nothing to your current health code:00b6dc/00 cheat description:Rhynth meat adds half as much to current health code:00b6dc/04 cheat description:Rhynth meat adds 2x as much to current health code:00b6dc/10 cheat description:Rhynth meat adds 4x as much to current health code:00b6dc/20 cheat description:Ptera meat doesn't heal code:00b709/ad cheat description:Blue bottles don't heal at all code:00b70f/60 cheat description:Blue bottles heal 1/2 of your health instead of 1/4 code:00b71e/ea cheat description:Blue bottles heal completely code:00b728/00 cheat description:Light laser can be fired instantly code:009f68/01 cheat description:Medium laser is fired above 3rd line instead of 2nd code:009f6d/18 cheat description:Medium laser can be fired above 1st line code:009f70/05 cheat description:Medium laser can be fired below 1st line - eliminates light laser code:009f6b/0a cheat description:No damage is taken from using heavy laser code:009f75/18 cheat description:Heavy laser can be fired above 2nd line - eliminates medium laser code:009f72/01 cheat description:Start with full health bar on Standard level code:009a79/ff+009a7b/ff cheat description:Start with full health bar on Novice level code:009a7d/ff+009a7f/ff cheat description:Start with full health bar on Advanced level code:009a81/ff+009a83/ff cheat description:Start with full health bar on Expert level code:009a85/ff+009a87/ff cheat description:Start with up to 9 lives on Options screen (selecting downward from 1 goes to 6) code:04b311/09 cheat description:Start with up to 30 continues on Options screen (selecting downward from 0 goes to 3) code:04b313/1e cheat description:Start on level 1-2 code:02f3fe/02 cheat description:Start on level 2-1 code:02f3fe/03 cheat description:Start on level 3-1 code:02f3fe/04 cheat description:Start on level 4-1 code:02f3fe/05 cheat description:Start on level 5-1 code:02f3fe/06 cheat description:Start on level 5-2 code:02f3fe/07 cheat description:Start on level 5-3 code:02f3fe/08 cheat description:Start on level 6-1 code:02f3fe/09 cheat description:Start on level 6-2 code:02f3fe/0a cheat description:Infinite health (alt) code:7e1024/64 cartridge sha256:5c4e283efc338958b8dd45ebd6daf133a9eb280420a98e2e1df358ae0242c366 name:Amazing Spider-Man, The - Lethal Foes (Japan) cheat description:Infinite health code:7e0e0c/40 cheat description:Infinite lives code:7e1c23/09 cheat description:Infinite time code:7e1c22/63 cartridge sha256:dc9cefb4dd50dce2e9d626ac71d4a06306516cba4bc784c90e4a30fe4e7ff4ef name:American Gladiators (USA) cheat description:Infinite time code:7e00b2/59 cheat description:Always have 9 points - P1 code:7e0306/09 cheat description:Always have 9 points in ball game - P1 code:7e0304/09 cartridge sha256:6931a3eacb7ab3c2f2fb57ba7d59c6da56fe6c7d60484cebec9332e6caca3ae9 name:American Tail, An - Fievel Goes West (USA) cheat description:Invincibility code:0c840b/d0 cheat description:Invincibility (alt) code:0c8408/a9 cheat description:Infinite health code:0c8442/d0 cheat description:Infinite lives code:00a674/ad cheat description:Infinite time code:00a728/ea cheat description:Walk left faster code:0c8335/fb cheat description:Walk right faster code:0c82f3/04 cheat description:Multi-jumps code:0c8972/00 cartridge sha256:626f1fe52b0df0f8ede23f0062cd842321c8dabf14aefdca12e526876ecf383a name:Animaniacs (USA) cheat description:Every coin gives 999 saved slot rotations code:82abb1/01 cheat description:Every second coin gives 99 continues code:82abff/02 cheat description:Every slot machine roll gives 99 continues code:82abff/05 cheat description:Super-jump and float code:83901c/a9+83901d/08+83901e/01 cheat description:Invincibility code:0cfcc0/90 cheat description:99 Coins code:7f0016/63 cheat description:Every coin gives 999 saved slot rotations (alt) code:82abb1/01 cheat description:Every second coin gives 99 continues (alt) code:82abff/02 cheat description:Every slot machine roll gives 99 continues (alt) code:82abff/05 cheat description:Hold up or down against some walls to climb them code:8390d1/ff cheat description:Higher jump code:839011/ff cheat description:Super jump and float (alt) code:83901c/a9+83901d/08+83901e/01 cheat description:Moon-jump (enable to rise slowly, disable to fall back down) code:7e0415/ff cartridge sha256:31569bef662bc438194726967970bf19f504101060763cbd649350362fb6ef2f name:Arcade's Greatest Hits - The Atari Collection 1 (USA) cheat description:Asteroids - Invincibility code:838feb/60 cheat description:Asteroids - Infinite lives - both players code:838ff2/b5 cheat description:Battlezone - Invincibility code:8594e4/c0+8594e5/00+8594e6/d0+859c11/60 cheat description:Battlezone - Infinite lives code:8594fe/a5 cheat description:Centipede - Infinite lives - both players code:8286dc/bd cheat description:Super Breakout - Infinite serves - both players code:81ca90/ad cheat description:Tempest - Infinite lives - both players code:86c689/bd cartridge sha256:aac9d6f2b8408e4bbdc83ebbba755428caf8021fefbfac7220fb4c772abd9944 name:Arcana (USA) cheat description:Infinite money for weapons code:03d575/ad cheat description:Infinite money for items code:03d5c9/ad cheat description:Infinite money for rooms code:03de59/ad cheat description:Infinite money for elixir code:03df1c/ad cheat description:Level and statistics for all characters in group are increased after each battle code:07b434/9e cheat description:Magic points don't decrease code:07bf97/bd cheat description:Start with 60,000 gold pieces code:018354/60+018355/ea cheat description:Start with 250 gold pieces code:018354/fa+018355/00 cartridge sha256:41084f83e269d46b9d589f11c802a15e84fede57d604c7986053f2858f757adc name:Archer Maclean's Super Dropzone (Europe) cheat description:Infinite lives code:7e0025/04 cheat description:Infinite bombs code:7e0026/04 cartridge sha256:0f474dafe5a26f3dea491d18073dd490d2f1f91313a7e91086565510d38d9a09 name:Ardy Lightfoot (USA) cheat description:Invincibility code:80e01a/d0+80bf19/d0 cheat description:Infinite lives code:8082b5/ad cheat description:Get Stars from anywhere code:85b493/80+85b494/19 cartridge sha256:14d3ece30898587eda20c661a4a55ec595ba6352ca1f0bfc177542aa0eef0039 name:Arkanoid - Doh It Again (USA) cheat description:Infinite lives code:8099bd/bd cheat description:Paddle hits ball anywhere code:8192fa/80+8192f4/00 cheat description:"S" capsule gives you the longest paddle code:818dd8/03 cheat description:"S" capsule gives you the laser paddle code:818dd8/04 cheat description:Force field lasts until end of level code:819306/ad cheat description:Keep current paddle when you get force field code:818e87/00 cartridge sha256:55e57c5e012583ff0fafd1aee16b3f8269ee2b34fe10f10b93ba0dde72f2b78d name:Art of Fighting (USA) cheat description:Invincibility (except projectiles) code:c0683a/e0+c0683b/00+c0683c/00 cheat description:Infinite health code:c0e5af/a9+c0e5b0/ef+c0e5b1/8d cheat description:Infinite time code:c0e973/ad cheat description:Hit anywhere - both players code:c06820/80 cartridge sha256:59f217912f4dbfb3dd0844f46128e71d6ddd522d7e246eb687000adeaa38d13d name:Ashita no Joe (Japan) cheat description:Hit anywhere - P1 code:00b66b/00 cheat description:Hit anywhere - P2 code:00b3ca/00 cheat description:Invincibility - P1 code:00b2c0/80 cheat description:Invincibility - P2 code:00b564/80 cartridge sha256:d54d2703e474d7f469766d2d095ffcbbcab893e3fe58bbbcc57e24082a44bb40 name:Asterix (Europe) (En,Fr,De,Es) cheat description:Invincibility code:0083b3/d0+0083b5/c5 cheat description:Infinite health code:00fa56/bd cheat description:Infinite lives code:00fa41/bd cheat description:Infinite health (alt) code:7e05f0/03 cheat description:Infinite lives (alt) code:7e05fc/09+7e05fd/09 cheat description:Infinite time code:7e05f7/09+7e05f8/09+7e05f9/09 cheat description:Infinite coins code:7e05ee/09+7e05ef/09 cartridge sha256:d9127808fb02c47dd74fd22f39582c69f19936a794a8efc153cc0e51a0d4d782 name:Asterix & Obelix (Europe) (En,Fr,De,Es) cheat description:Infinite health code:7e008c/28 cheat description:Infinite lives code:7e101d/09 cheat description:Infinite time code:7e1076/27 cheat description:Always Magic Chicken code:7e008e/04 cheat description:Moon jump (disable to drop back down) code:7e007d/c0 cartridge sha256:2431f8dc067ba27c6c3a846929f3deac6a45aa53a9a9ac20ede8ec5ca6854ea2 name:Axelay (USA) cheat description:Invincibility code:00bb31/d0 cheat description:Infinite lives code:00c0f6/cd cheat description:Infinite lives (alt) code:00c0f6/ad+00bd18/ad cheat description:Infinite credits code:00a470/ad cheat description:Don't lose weapon when hit code:00bf75/bd+00c2ce/bd cheat description:Hit anywhere code:00e4a1/a5+029c09/a5+00e48d/00+00e495/00 cheat description:Start with 1 credit code:008c8f/03 cheat description:Start with 2 credits code:008c8f/04 cheat description:Start with 3 credits code:008c8f/05 cheat description:Start with 4 credits code:008c8f/06 cheat description:Start with 6 credits code:008c8f/08 cheat description:Start with 7 credits code:008c8f/09 cheat description:Start with 8 credits code:008c8f/0a cheat description:Start with 9 credits code:008c8f/0b cheat description:Start with 1 life code:00db61/01 cheat description:Start with 2 lives code:00db61/02 cheat description:Start with 5 lives code:00db61/05 cheat description:Start with 7 lives code:00db61/07 cheat description:Start with 9 lives code:00db61/09 cheat description:Start with 15 lives code:00db61/0f cheat description:Start with 25 lives code:00db61/19 cheat description:Start with 50 lives code:00db61/32 cheat description:Start with 75 lives code:00db61/4b cheat description:Start with 99 lives code:00db61/63 cheat description:Start on Stage 2 code:009f37/a9+009f38/01+009f39/00 cheat description:Start on Stage 3 code:009f37/a9+009f38/02+009f39/00 cheat description:Start on Stage 4 code:009f37/a9+009f38/03+009f39/00 cheat description:Start on Stage 5 code:009f37/a9+009f38/04+009f39/00 cheat description:Start on Stage 6 code:009f37/a9+009f38/05+009f39/00 cheat description:Infinite lives (alt 2) code:7e005e/02 cheat description:Have 1st weapon - Straight Laser code:7e0330/02 cheat description:Have 1st weapon - Round Vulcan code:7e0330/03 cheat description:Have 1st weapon - Wind Laser code:7e0330/05 cheat description:Have 1st weapon - Explosion Bomb code:7e0330/06 cheat description:Have 1st weapon - Macro Missiles code:7e0330/07 cheat description:Have 1st weapon - Cluster Bomb code:7e0330/09 cheat description:Have 1st weapon - Morning Star code:7e0330/0a cheat description:Have 1st weapon - Needle Cracker code:7e0330/0b cheat description:Have 2nd weapon - Straight Laser code:7e0332/02 cheat description:Have 2nd weapon - Round Vulcan code:7e0332/03 cheat description:Have 2nd weapon - Wind Laser code:7e0332/05 cheat description:Have 2nd weapon - Explosion Bomb code:7e0332/06 cheat description:Have 2nd weapon - Macro Missiles code:7e0332/07 cheat description:Have 2nd weapon - Cluster Bomb code:7e0332/09 cheat description:Have 2nd weapon - Morning Star code:7e0332/0a cheat description:Have 2nd weapon - Needle Cracker code:7e0332/0b cheat description:Have 3rd weapon - Straight Laser code:7e0334/02 cheat description:Have 3rd weapon - Round Vulcan code:7e0334/03 cheat description:Have 3rd weapon - Wind Laser code:7e0334/05 cheat description:Have 3rd weapon - Explosion Bomb code:7e0334/06 cheat description:Have 3rd weapon - Macro Missiles code:7e0334/07 cheat description:Have 3rd weapon - Cluster Bomb code:7e0334/09 cheat description:Have 3rd weapon - Morning Star code:7e0334/0a cheat description:Have 3rd weapon - Needle Cracker code:7e0334/0b cheat description:Start a new game to view ending code:009f67/0c cartridge sha256:9e6ebebcf14609c2a38a5f4409d0c8c859949cded70c5b6fd16fd15d9983d9d3 name:B.O.B. (USA) cheat description:Infinite health (P) code:00d162/ad cheat description:Infinite lives code:0081f5/bd cheat description:Infinite lives (alt) code:0081f5/2c cheat description:Infinite time code:908230/ad cheat description:Infinite weapons code:00eb3d/b9 cheat description:Infinite Remotes code:8daf37/b9 cheat description:Infinite Remotes (alt) code:8daf36/ea cheat description:Infinite weapons (except for Flame) code:00eb3c/ea cheat description:Hit anywhere code:00fad1/00+00fb11/00 cheat description:Max weapons on pick-up code:8da24c/00 cheat description:Slow down timer code:008962/a0 cheat description:Speed up timer code:008962/35 cheat description:Start with 20 3-way code:8dc581/14 cheat description:Start with 20 Flame code:8dc587/14 cheat description:Start with 20 Rocket code:8dc58d/14 cheat description:Start with 20 Bolt code:8dc593/14 cheat description:Start with 20 Wave code:8dc599/14 cheat description:Start with 3 Flash Remotes code:8dc5b6/00 cheat description:Start with 3 Shield Remotes code:8dc5b6/01 cheat description:Start with 3 Umbrella Remotes code:8dc5b6/02 cheat description:Start with 3 Helicopter Hat Remotes code:8dc5b6/04 cheat description:Start with 3 Floating Bomb Remotes code:8dc5b6/05 cheat description:Start with 6 of selected remote code:8dc5b8/06 cheat description:Start with 15 of selected remote code:8dc5b8/0f cheat description:Start with 1 life code:008180/00 cheat description:Start with 9 lives code:008180/08 cheat description:Start with 6 lives code:008180/05 cheat description:Infinite health (P) (alt) code:7e0221/30 cheat description:Infinite E code:7e0222/30 cheat description:Infinite weapons (except for Flame) (alt) code:00eb3c/ea cheat description:Infinite Remotes (alt 2) code:8daf36/ea cheat description:Infinite time (alt) code:7e0f42/3b cheat description:Infinite Flash Remotes code:7e0209/63 cheat description:Infinite Shield Remotes code:7e020a/63 cheat description:Infinite Umbrella Remotes code:7e020b/63 cheat description:Infinite Spring Remotes code:7e020c/63 cheat description:Infinite Helicopter Hat Remotes code:7e020d/63 cheat description:Infinite Floating Bomb Remotes code:7e020e/63 cheat description:Max weapons on pick-up (alt) code:8da24c/00 cartridge sha256:e25d052d25264a14c4904aebc383482577bb5d2bb135f3ece88b1b7b0456a6bc name:Ballz 3D - Fighting at Its Ballziest (USA) cheat description:Infinite time code:c05b72/ad+c05b8c/ad cheat description:Always fight Kronk code:c0b3d5/a9+c0b3d6/04+c0b3d7/00 cheat description:Always fight Boomer code:c0b3d5/a9+c0b3d6/08+c0b3d7/00 cheat description:Always fight Bruiser code:c0b3d5/a9+c0b3d6/0c+c0b3d7/00 cheat description:Always fight Turbo code:c0b3d5/a9+c0b3d6/10+c0b3d7/00 cheat description:Always fight Tsunami code:c0b3d5/a9+c0b3d6/14+c0b3d7/00 cheat description:Always fight Yoko code:c0b3d5/a9+c0b3d6/18+c0b3d7/00 cheat description:Always fight Divine code:c0b3d5/a9+c0b3d6/1c+c0b3d7/00 cheat description:Always fight Crusher code:c0b3d5/a9+c0b3d6/20+c0b3d7/00 cheat description:Death match code:c0f6bf/a0 cheat description:Start rounds with 10 seconds code:c033bf/0a cheat description:Start rounds with 20 seconds code:c033bf/14 cheat description:Start rounds with 30 seconds code:c033bf/1e cheat description:Start rounds with 40 seconds code:c033bf/28 cheat description:Start rounds with 50 seconds code:c033bf/32 cheat description:Start rounds with 60 seconds code:c033bf/3c cheat description:Start rounds with 70 seconds code:c033bf/46 cheat description:Start with with 1/4 energy code:c100ae/2f cheat description:Start with with 1/2 energy code:c100ae/5f cheat description:Start with with 3/4 energy code:c100ae/9f cartridge sha256:865919b25a9d241c907bcda18b380e3c704f33f4997ad44559046f0f08c4968b name:Barbie Super Model (USA) cheat description:Infinite chances code:00dc55/ad cartridge sha256:fe1ad128313b2b9a47f89cf0d95d4c0cc2cb35a817ac5d915ee6c4d98d47d675 name:Barkley Shut Up and Jam! (USA) cheat description:Infinite time code:7e0780/47 cartridge sha256:e2be173c77bd1957787be36d13334f655e14d32dad99cacb0fd5e5fc65d96fa1 name:Bassin's Black Bass (USA) cheat description:Always catch a 60.32 pound fish code:03abc8/a9 cheat description:Always catch a 75.68 pound fish code:03abc8/a9+03abca/0e cheat description:Always catch a largemouth bass code:03abb9/a9+03abba/00+03abbb/ea cheat description:Always have all lures (open the lure menu, close it, open it again to have all lures) code:01f0c6/a9+01f0c7/01+01f0c8/9d+01f0cb/29 cartridge sha256:db1ac03cc8b7daaa812da239029bcf999b30b2afe1c03d51f7ae849a796617ea name:Bass Masters Classic - Pro Edition (USA) cheat description:Start with $65,380 code:7e2242/ff cheat description:Infinite money code:7e2242/ff cartridge sha256:e36aaba64be016cabc33a2dcf88913341e2edacc722e2a1ebe04eccda2a5d6e7 name:Batman Forever (USA) cheat description:Straight low punches are super strong code:82d6dd/ff cheat description:Straight high punches are super strong code:82d741/ff cheat description:Straight low kicks are super strong code:82d455/ff cheat description:Straight high kicks are super strong code:82d4ab/ff cheat description:Crouching low punches are super strong code:82d98b/ff cheat description:Crouching high punches are super strong code:82e347/ff cheat description:Crouching low kicks are super strong code:82e311/ff cheat description:Crouching high kicks are super strong code:82e2c5/ff cheat description:Straight low punches do no damage code:82d6dd/00 cheat description:Straight high punches do no damage code:82d741/00 cheat description:Straight low kicks do no damage code:82d455/00 cheat description:Straight high kicks do no damage code:82d4ab/00 cheat description:Crouching low punches do no damage code:82d98b/00 cheat description:Crouching high punches do no damage code:82e347/00 cheat description:Crouching low kicks do no damage code:82e311/00 cheat description:Crouching high kicks do no damage code:82e2c5/00 cheat description:Start with half energy after your first life code:80dca1/20+81adfa/20 cheat description:Play as an Inmate code:a9e3a5/12 cheat description:Play as a Clown code:a9e3a5/14 cheat description:Play as Two-Face code:a9e3a5/18 cheat description:Play as a Riddler Thug code:a9e3a5/1a cheat description:Play as the Muscle Riddler code:a9e3a5/1c cheat description:Start with 1 life code:8098ec/00 cheat description:Start with 3 lives code:8098ec/02 cheat description:Start with 10 lives code:8098ec/09 cheat description:Infinite health - P1 code:7e132c/ff cheat description:Infinite health - P2 code:7e132e/ff cheat description:Infinite lives code:7e0017/09 cheat description:One hit kills enemy #1 code:7e1330/00 cartridge sha256:f8d5c51f74df33edc827fbf8df7aab70160770ab0a896db6e59438ad9208cc6e name:Batman Returns (USA) cheat description:Invincibility code:80c9c7/d0+80c035/24 cheat description:Infinite health code:80ca3f/a5 cheat description:Infinite lives (3/4 view levels) code:80c97e/a5 cheat description:Infinite special moves code:80d004/a5 cheat description:Protection from some hazards code:80ca39/a5 cheat description:Hit anywhere code:80eff4/00+82c2ff/00+87f577/00+87f58d/00 cheat description:Cape sweep uses up no health code:80cffd/00 cheat description:Spear gun uses up no health code:80d017/00 cheat description:Cape sweep uses up more health code:80cffd/10 cheat description:Spear gun uses up more health code:80d017/10 cheat description:Maximum health from hearts code:82d7f2/00 cheat description:Cape sweep does more damage code:81ac15/15 cheat description:Normal punch does more damage code:81ac0d/15 cheat description:Normal knee does more damage code:81ac0e/15 cheat description:Jump kick does more damage code:81ac11/15+81ac10/15 cheat description:Cape sweep does mega-damage code:81ac15/30 cheat description:Normal punch does mega-damage code:81ac0d/30 cheat description:Normal knee does mega-damage code:81ac0e/30 cheat description:Jump kick does mega-damage code:81ac11/30+81ac10/30 cheat description:Cape sweep does less damage code:81ac15/02 cheat description:Normal punch does less damage code:81ac0d/02 cheat description:Normal knee does less damage code:81ac0e/02 cheat description:Jump kick does less damage code:81ac11/02+81ac10/02 cheat description:Enable stage select code:8085a4/13+8085a5/86+80a7be/af+9efdb0/ad cheat description:Start with 9 code:8180b5/09 cheat description:Start with 6 test tubes code:80881a/06+80ac40/06 cheat description:Start with 9 test tubes code:80881a/09+80ac40/09 cheat description:Enemy 1 has 0 health code:7e0567/00 cheat description:Enemy 2 has 0 health code:7e0576/00 cheat description:Enemy 3 has 0 health code:7e0666/00 cheat description:Enemy 4 has 0 health code:7e0756/00 cartridge sha256:51cc42c58145f3e33b762e8ff36e9a9b7016ca831306d0d5f84830948a1a5967 name:Batman - Revenge of the Joker (USA) (Proto) cheat description:Invincibility code:81c03a/d0 cheat description:Infinite health code:82fd17/ad cheat description:Infinite lives code:8080e8/bd cheat description:Infinite health (alt) code:7e0353/07+7e0355/07 cheat description:Infinite lives (alt) code:7e0356/03+7e0358/03 cartridge sha256:983022203546e031773db0d1af7552c489187954882843f13ff123f09064c1d3 name:Battle Blaze (USA) cheat description:Infinite continues code:02b47b/ad cheat description:Infinite health (disable at end of round) - P1 code:7e06dc/c0 cheat description:Infinite health (disable at end of round) - P2 code:7e0704/c0 cheat description:No health - P1 code:7e06dc/00 cheat description:No health - P2 code:7e0704/00 cheat description:Hit anywhere - both players code:00f4b9/42+00f4b8/80 cartridge sha256:32f42fda0667d9435a2de84c7ce7b067bcbab1164f8f6d837992ad6cfac4f8de name:Battle Clash (USA) cheat description:Infinite health code:83eb24/ad cheat description:Protection from most enemy attacks code:83eb24/ad cheat description:Infinite time code:818eb7/ad cheat description:Weapon charges faster code:80cd53/05 cheat description:Weapon charges much faster code:80cd53/10 cheat description:Once charged, weapon always stays charged code:80c7c7/60 cheat description:Start in Cairo instead of New York code:88f7f1/ee cheat description:Fight Garam at New York code:81c293/a9+81c295/00+81c294/00 cheat description:Fight Scarab at Cairo code:81c293/a9+81c295/00+81c294/01 cheat description:Fight Lorca at London code:81c293/a9+81c295/00+81c294/02 cheat description:Fight Artemis at Andes code:81c293/a9+81c295/00+81c294/03 cheat description:Fight Schneider at Kyoto code:81c293/a9+81c295/00+81c294/04 cheat description:Fight Ivan at Oceania code:81c293/a9+81c295/00+81c294/05 cheat description:Fight Valius at Babel code:81c293/a9+81c295/00+81c294/06 cheat description:Fight Baron at Moonbase Luna code:81c293/a9+81c295/00+81c294/07 cheat description:Fight Thanatos at last stage code:81c293/a9+81c295/00+81c294/08 cheat description:Infinite health - P1 code:7e15c0/80 cheat description:One hit kills code:7e15a0/00 cartridge sha256:36cbc43a3ec85f235ecb6e0d5b134f069b619d3cc51e475427d3fcf8abb6ba44 name:Battle Zeque Den (Japan) cheat description:Invincibility code:7eb26a/03+81e7ab/1a cheat description:Invincibility (alt) code:7eb26a/03 cheat description:Infinite lives code:81e67f/af cheat description:Infinite Special code:81a2dc/bd cheat description:One hit kills code:818ef8/e0+818ef9/2e+818efa/b2+818efb/d0 cheat description:Infinite health code:7eb246/4e cheat description:Infinite lives (alt) code:7e0329/0a cheat description:Infinite Special (Red) code:7eb24c/02 cheat description:Infinite Special (Blue) code:7eb24c/04 cheat description:Infinite Special (Green) code:7eb24c/06 cartridge sha256:c7f0269498d190e4fd0f6f880a148fbe3713cd3a632083bac1e5bd18f8172371 name:Battletoads-Double Dragon (USA) cheat description:Infinite lives code:0095bb/24 cheat description:Enemies have less health code:8281fa/0f cheat description:Abobo has less health code:829130/2f cheat description:Big Blag has less health code:8296e8/2f cheat description:Roper has less health code:829fc7/03 cheat description:Robo-Manus has less health code:82a376/03 cheat description:Start with 2 lives code:00804e/01 cheat description:Start with 10 lives code:00804e/09 cheat description:Start on level 2 with 11 lives code:008071/00+00808a/a9+00808b/01 cheat description:Start on level 3 with 11 lives code:008071/00+00808a/a9+00808b/02 cheat description:Start on level 4 with 11 lives code:008071/00+00808a/a9+00808b/03 cheat description:Start on level 5 with 11 lives code:008071/00+00808a/a9+00808b/04 cheat description:Start on level 6 with 11 lives code:008071/00+00808a/a9+00808b/05 cheat description:Invincibility (blinking) - P1 code:7e1112/7f cheat description:Infinite health - P1 code:7e003a/2f cheat description:Infinite lives - P1 code:7e0026/05 cheat description:Stage select enabled code:7e00fd/10 cartridge sha256:b0dbd4d7e5689c32234e80b0c5362ef67c425ab72d6ddb49d1cb1133ef630ef7 name:Battletoads in Battlemaniacs (USA) cheat description:Invincibility code:82df4b/d0 cheat description:Invincibility in motorcycle levels code:829f26/ad cheat description:Infinite health code:81b3fb/dd+81b440/dd cheat description:Infinite lives code:81ba85/bd cheat description:Infinite lives - both players (except level 2, doesnメt work on falling) code:81ba85/b5 cheat description:Infinite continues - P1 code:8087ca/a5 cheat description:Infinite continues - P2 code:808798/a5 cheat description:Infinite lives when falling code:82de81/b4 cheat description:Longer invincibility after getting hit code:82df4b/80 cheat description:One hit kills code:81b43b/e0+81b43c/00+81b43d/00+81b440/a9+81b441/ff+81b442/ff+81b443/9d cheat description:Take less damage from hits code:81b440/bd cheat description:Protection against most strength level 1 hits code:80c737/bd cheat description:Protection against most strength level 2 hazards code:81bad4/b5 cheat description:Easy finish on motorcycle levels. The turtle will keep going on until the end of the level. code:82da45/ad cheat description:Start with 2 lives code:008101/01 cheat description:Start with 6 lives code:008101/05 cheat description:Start with 10 lives code:008101/09 cheat description:Start with 0 continues code:00810b/00 cheat description:Start with 5 continues code:00810b/05 cheat description:Start with 9 continues code:00810b/09 cheat description:Infinite health - P1 code:7e108e/0a cheat description:Infinite health - P2 code:7e1090/0a cartridge sha256:0960f1de179f90e3d8488dacf09d5fe246fdb314913c370b3698dfdce58aa8ba name:Bazooka Blitzkrieg (USA) cheat description:Immune to most damage code:809773/2c cheat description:Fewer Missiles on pick-up code:82c1ad/05 cheat description:More Missiles on pick-up code:82c1ad/14 cheat description:Only 10 Missiles on pick-up (set Missiles to 10) code:82c19b/0a+82c19f/0a cheat description:30 Missiles allowed code:82c19b/1e+82c19f/1e cheat description:Less energy on pick-up from 'L' pods code:82c119/02 cheat description:More energy on pick-up from 'L' pods code:82c119/0a cheat description:A lot more energy on pick-up from 'L' pods code:82c119/2f cheat description:Infinite health code:7e0305/ff cheat description:Infinite Missiles code:7e0304/14 cartridge sha256:d7271ca08400bbf5ae165b0aaa6e8a8a1b266f72e6e0ae10aae529732a472f7c name:Beauty and the Beast (USA) cheat description:Invincibility (disable to pick up rocks, spikes still do damage) code:83a34e/ea+83a34f/ea cheat description:Invincibility (but you can't pick up objects) code:818013/d0 cheat description:Invincibility after one hit code:818015/ea cheat description:Infinite health code:83a3b1/ad cheat description:Infinite time code:008e59/ad cheat description:Infinite flower time code:008e79/ad cheat description:Infinite continues code:00f445/ad cheat description:Hit anywhere code:82816d/24+82817f/24+828174/24+828186/24 cheat description:Don't take damage from some enemies code:83a3b1/ea cheat description:No loss of light when the candle runs off the screen code:82acbf/2c cheat description:Death flash time is longer code:838087/ff cartridge sha256:15d4fc90cb202a9391718cd40b9f0384165aef03018ed932540e8f7c18b397dd name:Beavis and Butt-Head (USA) cheat description:Start with half health (1st life) code:0081a1/06 cheat description:Start with half health (after 1st life) code:008365/06 cheat description:Almost infinite health code:02dfa5/ad cheat description:Gun power-ups worth 30 code:82cabc/30 cheat description:Gun power-ups worth 5 code:82cabc/05 cheat description:Infinite lives code:00833d/ad cheat description:Start with 2 life code:0081a9/01 cheat description:Start with 4 lives code:0081a9/03 cheat description:Start with 10 lives code:0081a9/09 cheat description:Invincibility after one hit code:01fbc8/bd cheat description:Everyone is invincible, including enemies code:01fbc7/00+02cd4b/00 cartridge sha256:4958eda26f2419f473449017c64121caee5e49c480ffa205422e7dd45cd23e31 name:Bebe's Kids (USA) cheat description:Infinite health code:7e047b/00 cheat description:Infinite time code:7e0470/63 cheat description:Infinite lives code:7e03c9/09 cartridge sha256:4d22279e534848012e0f1595468687742ae18cabc3fe44eeef938bc3a4dd08bf name:Beethoven - The Ultimate Canine Caper! (USA) cheat description:Infinite health code:81eb11/bd cheat description:Infinite time code:81dd2d/bd cheat description:Infinite lives code:80abba/bd cheat description:Infinite health (alt) code:7e1628/04 cheat description:Infinite time (alt) code:7e1654/63 cheat description:Infinite lives (alt) code:7e15c6/09 cartridge sha256:e4e9beaeeb3e968af772d1c4c9e4c1b4dfdba4e47c0205b458e1ab3a62a96060 name:Best of the Best - Championship Karate (USA) cheat description:Almost infinite health code:01bf12/08 cheat description:Infinite special moves code:01b409/bd cheat description:No special moves - P2 code:01a6e6/9c cheat description:Can play with any boxer (can't use special moves or get password) - P1 code:00a1e3/02 cheat description:Less strength code:00a1e4/0a cheat description:Less resistance code:00a1e5/0a cheat description:Less reflexes code:00a1e6/0a cheat description:More strength code:00a1e4/32 cheat description:More resistance code:00a1e5/32 cheat description:More reflexes code:00a1e6/32 cheat description:Start with 1 special move code:01a6e2/01 cheat description:Start with 8 special moves code:01a6e2/08 cheat description:Infinite time code:7e1a39/09 cheat description:No health - P2 code:7e0222/00 cheat description:Max Reflexes code:7e0459/63 cheat description:Max Resistance code:7e0455/63 cheat description:Max Strength code:7e0457/63 cartridge sha256:4cb601168c91fa0608c16a8cf2f292d991c6a5615d51861dee2f9b91c8d6bb19 name:Big Sky Trooper (USA) cheat description:Infinite HP code:7e1e0a/20 cheat description:Infinite hearts code:7e1e10/99 cheat description:Infinite Power Pack meter code:7e1e0c/20 cartridge sha256:91ba5691dea3cdf103177ae5779110fc372fce8229cf91f263073667e7a8b5b7 name:Biker Mice from Mars (USA) cheat description:Infinite ammo code:8398b6/ea cheat description:Infinite cash code:82b65c/bf cheat description:Infinite Shield/Armor code:8092be/bd cheat description:Infinite Skull effect code:8382e0/ad cheat description:Infinite Star effect code:83b855/bd cheat description:Infinite Stopwatch effect code:8384ac/ad cheat description:Infinite Money - P1 code:7efe30/99+7efe31/99 cheat description:Infinite Ammo - P1 code:7e17c6/12 cheat description:Infinite Armor - P1 code:7e179e/03 cheat description:Infinite Money - P2 code:7efe32/99+7efe33/99 cheat description:Infinite Ammo - P1 code:7e1816/12 cheat description:Infinite Armor - P1 code:7e17ee/03 cheat description:Always finish 1st code:7e0928/00 cheat description:Max Engine upgrade - P1 code:7efe38/05 cheat description:Max Tire upgrade - P1 code:7efe3c/05 cheat description:Max Armor upgrade - P1 code:7efe40/05 cheat description:Max Shot upgrade - P1 code:7efe44/05 cheat description:Max Engine upgrade - P2 code:7efe3a/05 cheat description:Max Tire upgrade - P2 code:7efe3e/05 cheat description:Max Armor upgrade - P2 code:7efe42/05 cheat description:Max Shot upgrade - P2 code:7efe46/05 cheat description:Have Nitro item - P1 code:7e17ce/01 cheat description:Have Star item - P1 code:7e17ce/02 cheat description:Have Skull item - P1 code:7e17ce/03 cheat description:Have Clock item - P1 code:7e17ce/04 cheat description:Have Money Bag item - P1 code:7e17ce/05 cheat description:Have Nitro item - P2 code:7e181e/01 cheat description:Have Star item - P2 code:7e181e/02 cheat description:Have Skull item - P2 code:7e181e/03 cheat description:Have Clock item - P2 code:7e181e/04 cheat description:Have Money Bag item - P2 code:7e181e/05 cartridge sha256:6fa6b8a8804ff6544bdedf94339a86ba64ce0b6dbf059605abb1cd6f102d3483 name:Bill Laimbeer's Combat Basketball (USA) cheat description:2-point shots worth 3, 3-point shots worth 4 code:00971b/38 cheat description:All shots worth 1 point code:00971c/69+00971d/01 cheat description:All shots worth 3 points code:00971c/69+00971d/03 cheat description:All shots worth 4 points code:00971c/69+00971d/04 cheat description:All shots worth 5 points code:00971c/69+00971d/05 cheat description:All shots worth 6 points code:00971c/69+00971d/06 cheat description:Each half is 0:30 instead of 1:30 code:00962c/00 cheat description:Each half is 2:30 code:00962c/02 cheat description:Each half is 3:30 code:00962c/03 cheat description:Each half is 4:30 code:00962c/04 cheat description:Start with $65,296 instead of $10,000 code:0aa275/ff cheat description:Start with $8,398,608 code:0aa27a/80 cheat description:Start with $16,721,680 code:0aa27a/ff cheat description:No money is deducted from your total when you trade a player (but you must have enough money to make the trade) code:0a96f0/ad+0a96f8/ad cheat description:Trade players for free code:0a96f0/ad+0a96f8/ad+0a97f0/80 cheat description:Timer continues to count when it is normally stopped (time-out by pressing start) code:00963c/00 cartridge sha256:ec2d91e238c26a5ddf7067d104b3b3e2eaee89255377e1eb6c4df8f301300e64 name:Bill Walsh College Football (USA) cheat description:Cannot be tackled (hold X) code:c005ea/73+c005ec/30+c005e9/a5+c005eb/0a+c005ed/f5 cartridge sha256:de1de85ad549a6aaf0431cceb47cbd07e1f6e81f9e16fd62575305e2c1f06240 name:BioMetal (USA) cheat description:Invincibility (blinking) code:038400/24 cheat description:Infinite lives code:0386f1/ad cheat description:Infinite charge code:0385d2/ad cheat description:Hit anywhere code:00ddfe/28+00ddfd/80+00de34/a5 cheat description:Infinite lives (alt) code:7e029d/0a cartridge sha256:3f030b6c6aa86bc4ab3d39568740d8c6b0ec3422a1964fe1b56e94de47dfa420 name:Bishin Densetsu Zoku (Japan) cheat description:Infinite health code:7e122c/50 cheat description:No car damage code:7e0d9b/2f cheat description:Infinite time code:7e0c96/00 cheat description:Infinite time (alt) code:7e0c97/09 cartridge sha256:ff936a073032205daadfea3738526a381daf7e402e8216d08561ddca8ceaf526 name:Bishoujo Senshi Sailor Moon (Japan) cheat description:One hit kills code:c11204/24+c117b2/24+c1185b/24 cheat description:Invincibility code:c14f0e/d0 cheat description:Infinite health code:c11115/b9+c11a5c/a5 cheat description:Infinite lives code:c15067/a5 cheat description:Hit anywhere code:c11188/80 cartridge sha256:8860380ae0afa280619fdca8723aed1393485a22bec442880acc75249cab37f4 name:Bishoujo Senshi Sailor Moon R (Japan) cheat description:Invincibility code:c14f07/d0+c14f0b/d0 cheat description:Infinite health code:c108a2/b9 cheat description:Infinite lives code:c151da/a5 cheat description:Infinite Special code:c14319/a5 cheat description:Hit anywhere code:c1090a/80 cheat description:One hit kills code:c109e7/24+c14c05/24+c11171/24 cartridge sha256:328c8f57e2ea371f6fd5b8a9834c56e35eb3bfe710502dd80f370739f9ccb7e1 name:Blackthorne (USA) cheat description:Infinite items (enable after obtaining first item, disable before getting next item, repeat this process) code:80a984/b5 cheat description:Infinite health code:7e0fc5/18 cheat description:3rd slot item mod code:7e187a/03 cheat description:Standard Shotgun code:7e021c/00 cheat description:Unrestricted manual Shotgun without reload (more presses, more shots) code:7e021c/01 cheat description:Very fast automatic Shotgun code:7e021c/02 cheat description:Very fast automatic Shotgun with explosive shells code:7e021c/03 cheat description:Normal automatic Shotgun code:7e021c/04 cheat description:Infinite Iron Keys code:7e1876/02 cheat description:Infinite Potions code:7e1878/04 cheat description:Infinite Hover Bombs code:7e187a/05 cheat description:Infinite Levitators code:7e187c/06 cheat description:Infinite Bridge Keys code:7e187e/07 cheat description:Infinite Remote Wasps code:7e1880/08 cheat description:Infinite Fire Bombs code:7e1882/0a cartridge sha256:0d4e0d134396bd1c7254cdc1da356eb944ca14910b6690f484a75a9c3a8106e7 name:BlaZeon - The Bio-Cyborg Challenge (USA) cheat description:Invincibility code:01830d/d0 cheat description:Infinite lives code:009028/bd cheat description:Infinite lives (alt) code:009028/ad+00920b/ad cheat description:Infinite Atomic Shields - Mars code:00ac3f/ad cheat description:Infinite Hyper Bombs - Neptune code:00ace6/ad cheat description:Hit anywhere code:00b771/60+00b793/60+00b8cf/ad+00b770/38+00b792/38 cheat description:Start with 1 ship code:008efd/00 cheat description:Start with 2 ships code:008efd/01 cheat description:Start with 4 ships code:008efd/03 cheat description:Start with 5 ships code:008efd/04 cheat description:Start with 7 ships code:008efd/06 cheat description:Start with 10 ships code:008efd/09 cheat description:Start with 26 ships code:008efd/19 cheat description:Start on Stage 2 code:008e01/01 cheat description:Start on Stage 3 code:008e01/02 cheat description:Start on Stage 4 code:008e01/03 cheat description:Start on Stage 5 code:008e01/04 cartridge sha256:99f40f06fa4dbeeea4fe67d2de5b4c1bf301bedac1958ba1c239dcaf39b0a998 name:Blues Brothers, The (USA) cheat description:Invincibility code:8095e8/60 cheat description:Infinite health (1P game) code:80c3e5/bd cheat description:Infinite health (2P game) code:80cdf8/bd cheat description:Infinite lives code:80b718/bd cheat description:Infinite time code:809bee/ad cheat description:Infinite Discs code:80b654/bd cheat description:Multi-jump code:80d667/80+80d652/80 cartridge sha256:d50ef11383d78544dbad4d350cfd1486fb28e459e208d1553acdecbd84a808b8 name:Bobby's World (USA) (Proto) cheat description:Invincibility code:829d30/d0 cheat description:Infinite health code:829daa/bd cheat description:Infinite health (alt) code:7e139b/03 cheat description:Infinite lives code:80d50f/bd cheat description:Infinite lives (alt) code:7e1395/09 cheat description:Multi-jump code:8299ef/00 cartridge sha256:854d2492d1cb059749bb0904ca5f92a5eeec09167abf84f7cca4023b1819e4f0 name:Bonkers (USA) cheat description:Invincibility code:80aa09/d0 cheat description:Infinite health code:80a520/b5 cheat description:Infinite bombs code:80c294/a5 cheat description:Infinite lives code:8086e1/a5 cheat description:Infinite dash code:80b6a1/a5 cheat description:Hit anywhere code:80f965/80+80f966/50 cartridge sha256:8f131182b286bd87f12cf4f00453336538ce690d0e1f0972ac0be98df4d48987 name:Boogerman - A Pick and Flick Adventure (USA) cheat description:Infinite health code:c0113f/a0 cheat description:Infinite lives code:c01049/00 cheat description:Infinite Loogies code:c174ab/00 cheat description:Infinite Boogers code:c173ee/00 cheat description:Infinite Belches code:c17575/00 cheat description:Infinite Super Belches code:c17667/00 cheat description:Infinite Farts code:c17a2c/00 cheat description:Infinite Super Farts code:c17b22/00 cheat description:Infinite Chili Belches and Farts code:c19db0/00 cheat description:Infinite Super Chili Belches and Farts code:c19e9e/00 cheat description:Infinite Rocket Farts code:c118f4/00 cheat description:Get chili when hit code:c11cd1/01 cheat description:Get Milk when hit code:c11ccb/01 cheat description:Infinite health (alt) code:7e0ef8/02 cheat description:Infinite Boogers (alt) code:7e0224/20 cheat description:Infinite Belches and Farts (both kinds) code:7e0226/20 cartridge sha256:e67940a2106c1507f3a8d38790f263bbbf814578ebf3dbc4e3eb6007d310793c name:Boxing Legends of the Ring (USA) cheat description:Invincibility - P1 code:8186cb/80 cheat description:Invincibility - P2 code:818f81/80 cheat description:Infinite super punches - P1 code:818f05/ad cheat description:Infinite super punches - P2 or CPU code:81864b/ad cheat description:Infinite strength beads code:81d59c/00+81d658/ad cheat description:Infinite time per round code:009fcf/ad cheat description:Hit anywhere - P1 code:81900a/60+819009/18 cheat description:Hit anywhere - P2 code:818754/60+818753/18 cheat description:Blocking disabled - P1 code:8186d1/00 cheat description:Blocking disabled - P2 code:818f87/00 cheat description:Each round is 1 minute code:80be03/01 cheat description:Each round is 2 minutes code:80be03/02 cheat description:Each round is 4 minutes code:80be03/04 cheat description:Each round is 5 minutes code:80be03/05 cheat description:Each round is 6 minutes code:80be03/06 cheat description:Both fighters start with no super punches code:80ba38/00 cheat description:Both fighters start with 2 super punches code:80ba38/02 cheat description:Both fighters start with 3 super punches code:80ba38/03 cheat description:Create a stronger left jab code:8bfef4/80 cheat description:Create a stronger left hook body code:8bfef6/80 cheat description:Create a stronger left hook head code:8bfef8/80 cheat description:Create a stronger left uppercut code:8bfefa/80 cheat description:Create a stronger right cross body code:8bfefc/80 cheat description:Create a stronger right cross head code:8bfefe/80 cheat description:Create a stronger right uppercut code:8bff00/80 cheat description:Start on round 5 code:80ba1f/ee cheat description:Start on round 12 code:80ba1f/ce cheat description:Infinite full stanima code:7e05af/0f cartridge sha256:f4666355e7fea434843dc6d5119673bd6c23e69b884aac0b382ff036997e52b5 name:Brain Lord (USA) cheat description:9999 HP code:7e08c2/0f+7e08c3/27 cheat description:9999 Max HP code:7e08c4/0f+7e08c5/27 cheat description:255 Power code:7e08ca/ff cheat description:Have the best status code:7e08dd/00 cheat description:Move faster, same effect as wearing the Cloak code:7e08d4/07 cheat description:Infinite G code:7e0376/97 cheat description:Can access 13 spells code:7e08d1/0d cheat description:Have Magic Shot spell code:7e0910/02 cheat description:Have Magic Shield spell code:7e0911/03 cheat description:Have Flame Ring spell code:7e0912/04 cheat description:Have Fireball spell code:7e0913/05 cheat description:Have Impulse spell code:7e0914/06 cheat description:Have Lightning spell code:7e0915/07 cheat description:Have Magic Missile spell code:7e0916/08 cheat description:Have Bound spell code:7e0917/09 cheat description:Have Ice spell code:7e0918/0a cheat description:Have Phaser spell code:7e0919/0b cheat description:Have Slow spell code:7e091a/0e cheat description:Have Stop spell code:7e091b/0f cheat description:Have Ghost spell code:7e091c/10 cheat description:Quick spell charge code:7e08c7/01 cheat description:Have the Iron Sword code:7e0921/01+7e0920/02 cheat description:Have the Steel Buster code:7e0921/01+7e0920/03 cheat description:Have the Platinum Sword code:7e0921/01+7e0920/05 cheat description:Have the Battle Axe code:7e0921/01+7e0920/06 cheat description:Have the Tomahawk code:7e0921/01+7e0920/07 cheat description:Have the Rock Breaker code:7e0921/01+7e0920/08 cheat description:Have the Great Axe code:7e0921/01+7e0920/09 cheat description:Have the Boomerang code:7e0921/01+7e0920/0a cheat description:Have the Chuckler code:7e0921/01+7e0920/0b cheat description:Have the Mornin Star code:7e0921/01+7e0920/0c cheat description:Have the Heavy Mall code:7e0921/01+7e0920/0d cheat description:Have the Long Bow code:7e0921/01+7e0920/0e cheat description:Have the Silver Bow code:7e0921/01+7e0920/0f cheat description:Have the Lightning Bow code:7e0921/01+7e0920/10 cheat description:Have the Fire Sword code:7e0921/01+7e0920/12 cheat description:Have the Iron Helmet code:7e0923/02+7e0922/02 cheat description:Have the Cross Helmet code:7e0923/02+7e0922/03 cheat description:Have the Blackgold Helm code:7e0923/02+7e0922/04 cheat description:Have the Warrior's Helm code:7e0923/02+7e0922/05 cheat description:Have the Platinum Helm code:7e0923/02+7e0922/06 cheat description:Have the Nameless Helm code:7e0923/02+7e0922/07 cheat description:Have the Nameless Helm code:7e0923/02+7e0922/08 cheat description:Have the Nameless Helm code:7e0923/02+7e0922/09 cheat description:Have the Chain Mail code:7e0925/03+7e0924/02 cheat description:Have the Banded Mail code:7e0925/03+7e0924/03 cheat description:Have the Bone Mail code:7e0925/03+7e0924/04 cheat description:Have the Plate Armor code:7e0925/03+7e0924/05 cheat description:Have the Royal Armor code:7e0925/03+7e0924/06 cheat description:Have the Cape code:7e0925/03+7e0924/07 cheat description:Have the Nameless Armor code:7e0925/03+7e0924/08 cheat description:Have the Nameless Armor code:7e0925/03+7e0924/09 cheat description:Have the Round Shield code:7e0927/04+7e0926/02 cheat description:Have the Kite Shield code:7e0927/04+7e0926/03 cheat description:Have the Bone Shield code:7e0927/04+7e0926/04 cheat description:Have the Warrior Shield code:7e0927/04+7e0926/05 cheat description:Have the Battle Shield code:7e0927/04+7e0926/06 cheat description:Have the Shield code:7e0927/04+7e0926/07 cheat description:Have the Reviving Mirror code:7e0929/05+7e0928/01 cheat description:Have the Debug Mirror (a debug item) code:7e0929/05+7e0928/02 cheat description:Have the Wind Shoes code:7e0929/05+7e0928/03 cheat description:Have the Spike Boots code:7e0929/05+7e0928/04 cheat description:Have the Life Jade code:7e092b/06+7e092a/01 cheat description:Have the Crimson Jade code:7e092b/06+7e092a/02 cheat description:Have the Foundation Jade code:7e092b/06+7e092a/03 cheat description:Have the Power Jade code:7e092b/06+7e092a/04 cheat description:Have the Lightning Jade code:7e092b/06+7e092a/05 cheat description:Have the Anger Jade code:7e092b/06+7e092a/06 cheat description:Have the Water Jade code:7e092b/06+7e092a/07 cheat description:Have the Deceased Jade code:7e092b/06+7e092a/08 cheat description:Have the Light Jade code:7e092b/06+7e092a/09 cheat description:Have the Key to the Seal code:7e092d/07+7e092c/01 cheat description:Have the 3rd floor Key code:7e092d/07+7e092c/02 cheat description:Have the 4th floor Key code:7e092d/07+7e092c/03 cheat description:Have the Puzzle Key code:7e092d/07+7e092c/04 cheat description:Have the Crossroads Key code:7e092d/07+7e092c/05 cheat description:Have the Sky Room Key code:7e092d/07+7e092c/06 cheat description:Have the Cave Room Key code:7e092d/07+7e092c/07 cheat description:Have the Dark Room Key code:7e092d/07+7e092c/08 cheat description:Have the Basement Key code:7e092d/07+7e092c/09 cheat description:Have the Detour Key code:7e092d/07+7e092c/0a cheat description:Have the Bottomless Key code:7e092d/07+7e092c/0b cheat description:Have the Distance Key code:7e092d/07+7e092c/0c cheat description:Have the Office Key code:7e092d/07+7e092c/0d cheat description:Have the Flyer's Key code:7e092d/07+7e092c/0e cheat description:Have the Steel Sky Key code:7e092d/07+7e092c/0f cheat description:Have the Invisible Key code:7e092d/07+7e092c/10 cheat description:Have the Underground Key code:7e092d/07+7e092c/11 cheat description:Have the Control Key code:7e092d/07+7e092c/12 cheat description:Have the Preparation Key code:7e092d/07+7e092c/13 cheat description:Have the Laboratory Key code:7e092d/07+7e092c/14 cheat description:Have the Power Room Key code:7e092d/07+7e092c/15 cheat description:Have the Oblivion Key code:7e092d/07+7e092c/16 cheat description:Have the Western Sky Key code:7e092d/07+7e092c/1f cheat description:Have the Ocean Key code:7e092d/07+7e092c/20 cheat description:Have the Under Ice Key code:7e092d/07+7e092c/21 cheat description:Have the Waterfall Key code:7e092d/07+7e092c/22 cheat description:Have the Flood Gate Key code:7e092d/07+7e092c/23 cheat description:Have the Wave Key code:7e092d/07+7e092c/24 cheat description:Have the Ice Key code:7e092d/07+7e092c/25 cheat description:Have the Water-Air Key code:7e092d/07+7e092c/26 cheat description:Have the Red Wing Key code:7e092d/07+7e092c/27 cheat description:Have the 1st Gate Key code:7e092d/07+7e092c/28 cheat description:Have the 2nd Gate Key code:7e092d/07+7e092c/29 cheat description:Have the 3rd Gate Key code:7e092d/07+7e092c/2a cheat description:Have the Sky Dragon Key code:7e092d/07+7e092c/2b cheat description:Have the Land Dragon Key code:7e092d/07+7e092c/2c cheat description:Have the Sea Dragon Key code:7e092d/07+7e092c/2d cheat description:Have the Dead Dragon Key code:7e092d/07+7e092c/2e cheat description:Have the Silence Key code:7e092d/07+7e092c/33 cheat description:Have the Castle Key code:7e092d/07+7e092c/34 cheat description:Have the Endless Key code:7e092d/07+7e092c/35 cheat description:Have the Spirit Key code:7e092d/07+7e092c/36 cheat description:Have the Destruction Key code:7e092d/07+7e092c/37 cheat description:Have the Platinum Key code:7e092d/07+7e092c/38 cheat description:Have the Night Key code:7e092d/07+7e092c/39 cheat description:Have the Afterworld Key code:7e092d/07+7e092c/3a cheat description:Have the Entropy Key code:7e092d/07+7e092c/3b cheat description:Have the Fountain Key code:7e092d/07+7e092c/3c cheat description:Have the Duplicate Key code:7e092d/07+7e092c/3e cheat description:Have the Duplicate Key code:7e092d/07+7e092c/3f cartridge sha256:5f1912fdac09cd60d3a8962cad3875c6221b38347f0e98abc5800c73214678a9 name:Brainies, The (Europe) cheat description:Timer disable cheat to get score then re-enable code:7e091c/17 cartridge sha256:9885ca148d32c4df6230642bcfa153f7e51b9559415042a831db14d07b3e6c3d name:Brainies, The (USA) cheat description:Infinite time code:0089d0/ad cheat description:Infinite continues code:0086df/ad cheat description:Start with and always have 9 Jokers code:00a2a6/09 cheat description:Start on level 25 code:0083e6/1a cheat description:Start on level 50 code:0083e6/33 cheat description:Start on level 75 code:0083e6/4c cheat description:Start on level 100 code:0083e6/65 cartridge sha256:bbde8b46c7262f9d4a5b3926a00850cb00b4f7711f6421f0adf4e2b0c847a5d6 name:Bram Stoker's Dracula (USA) cheat description:Infinite energy code:0485e7/ad cheat description:Infinite lives code:0487b2/ad cheat description:Infinite pistol ammo code:03d398/a5 cheat description:Infinite shotgun ammo code:03d28b/a5 cheat description:Turbo walking code:00a2d6/ea cheat description:Infinite missile weapon code:03d43e/a5 cheat description:One hit kills all enemies, except bosses code:0484b4/80 cheat description:Freeze most ground enemies code:00cab8/2c cheat description:Freeze most aerial enemies code:00ca96/2c cheat description:Start at the final battle code:03f9a5/10 cartridge sha256:130a74e76369b0ec4d6378a014550921433f1ae1ac1dddffb51f77c9f21a818f name:Brandish (USA) cheat description:Have over 10,000,000 gold code:307fe8/10 cheat description:Sell an item for max gold code:81bd29/02+81bd28/80 cheat description:Luck stays maxed out code:83e494/80 cheat description:Map gets filled when entering a level code:c244dd/80+c244de/ea cartridge sha256:044b61613ed66eae08abd5fa5dcd13b24aab11a942e3309cdff624d198c47440 name:Brawl Brothers (USA) cheat description:Invincibility and infinite special attack code:8589ed/80+8589ee/01 cheat description:Infinite health code:858b62/c5 cheat description:One hit kills on most enemies code:858a97/ff+858a98/ff+858a9a/24 cheat description:Bosses die immediately code:8589f3/ff+8589f4/ff+8589f6/24 cheat description:Hit anywhere - both players code:85a4da/24+85a4df/24+85a4a1/24+85a500/24+85a4fb/24 cheat description:Invincibility - P1 code:7e0908/01 cheat description:Invincibility - P2 code:7e09d8/01 cheat description:Infinite health - P1 code:7e0924/50 cheat description:Infinite health - P2 code:7e09f4/50 cheat description:Infinite lives - P1 code:7e0946/09 cheat description:Infinite lives - P2 code:7e0a16/09 cheat description:One hit kills on most enemies (alt) code:7e0b94/00+7e0919/00+7e0d34/00+7e0c64/00+7e0ac4/00 cheat description:Have Lots of Kills - P1 code:7e0c34/ff cheat description:Play as Dieter (glitchy) - P1 code:7e0920/0a cheat description:Play as Dieter (glitchy) - P2 code:7e09f0/0a cartridge sha256:aad8c9be1b7a9662256b0c3d76f5b7a273bcd497aa838232d307e9f2e80cf699 name:BreakThru! (USA) cheat description:Infinite time code:7e125b/ff cartridge sha256:cbc496a7879ba78f32c51c3df4ba1a1a42f17d78d48a39ea9c709d1ad18cb8df name:Breath of Fire (USA) cheat description:9999 EXP after every battle code:84811f/ee cheat description:Infinite usable items in menu code:94faf2/0f cheat description:Infinite Gold code:87fa6c/bf+87fa73/bf+87faf7/bf cheat description:Create a new character at level 5 code:819612/05 cheat description:Create a new character with 153 max HP code:819614/99 cheat description:Create a new character with 153 HP code:819616/99 cheat description:Create a new character with 20 max AP code:819618/14 cheat description:Create a new character with 20 AP code:81961a/14 cheat description:Create a new character with INT at 22 code:819621/16 cheat description:Create a new character with Agility at 22 code:819622/16 cheat description:Create a new character with Fate at 40 code:819624/28 cheat description:Create a new character with strength at 50 code:81961f/32 cheat description:Create a new character with Vigor at 50 code:819620/32 cheat description:Ryu starts with Tri-Rang code:819630/5f cheat description:Ryu starts with EmporSD code:819630/08 cheat description:Ryu starts with DragonSH code:819632/54 cheat description:Ryu starts with LifeAR code:819634/1d cheat description:Ryu starts with DragonHT code:819636/8a cheat description:Nina starts with PowerRP code:819690/1d cheat description:Nina starts with MaskSH code:819692/53+819693/21 cheat description:Nina starts with ClearCL code:819694/2e cheat description:Nina starts with LoveHT code:819696/78+819697/21 cheat description:Bo starts with HeroBW code:819660/5b cheat description:Bo starts with IcyAR code:819662/11 cheat description:Bo starts with CursedHT code:819664/6b cheat description:Ox starts with Mallet code:8196c0/26 cheat description:Ox starts with StarSH code:8196c2/84 cheat description:Ox starts with WorldAR code:8196c4/25 cheat description:Ox starts with CursedHT code:8196c6/6b cheat description:Gobi starts with Sleeper code:8196f0/38 cheat description:Gobi starts with StarSH code:8196f2/84+8196f3/21 cheat description:Gobi starts with SpineCL code:8196f4/14 cheat description:Gobi starts with CursedHT code:8196f6/6b cheat description:Karn starts with DarkDR code:819720/4c cheat description:Karn starts with StarSH code:819722/84+819723/21 cheat description:Karn starts with QuartzAR code:819724/1f cheat description:Karn starts with CursedHT code:819726/6b cheat description:Mogu starts with MystCW code:819750/3f cheat description:Mogu starts with StarSH code:819752/84+819753/21 cheat description:Mogu starts with FlameAR code:819754/0e cheat description:Mogu starts with CursedHT code:819756/6b+819757/21 cheat description:Bleu starts with GlowCN code:819780/2f cheat description:Bleu starts with MaskSH code:819782/53 cheat description:Bleu starts with ClearCL code:819784/2e cheat description:Bleu starts with CursedHT code:819786/6b cheat description:Character 1 - Max LEVEL code:7e104a/ff cheat description:Character 1 - Infinite HP code:7e104e/e7+7e104f/03 cheat description:Character 1 - Max HP code:7e104c/e7+7e104d/03 cheat description:Character 1 - Infinite AP code:7e1052/e7+7e1053/03 cheat description:Character 1 - Max AP code:7e1050/e7+7e1051/03 cheat description:Character 1 - Max Str code:7e1057/ff cheat description:Character 1 - Max Vigor code:7e1058/ff cheat description:Character 1 - Max Wisdom code:7e1059/ff cheat description:Character 1 - Max Agil code:7e105a/ff cheat description:Character 1 - Max MAG code:7e105b/ff cheat description:Character 1 - Max Luck code:7e105c/ff cheat description:Character 1 - Max ATK code:7e105d/e7+7e105e/03 cheat description:Character 1 - Max DEF code:7e105f/e7+7e1060/03 cheat description:Character 1 - Max INT code:7e1061/ff cheat description:Character 1 - Max ACT code:7e1062/ff cheat description:Character 1 - Max FATE code:7e1063/ff cheat description:Character 2 - Max LEVEL code:7e10ea/ff cheat description:Character 2 - Infinite HP code:7e10ee/e7+7e10ef/03 cheat description:Character 2 - Max HP code:7e10ec/e7+7e10ed/03 cheat description:Character 2 - Infinite AP code:7e10f2/e7+7e10f3/03 cheat description:Character 2 - Max AP code:7e10f0/e7+7e10f1/03 cheat description:Character 2 - Max Str code:7e10f7/ff cheat description:Character 2 - Max Vigor code:7e10f8/ff cheat description:Character 2 - Max Wisdom code:7e10f9/ff cheat description:Character 2 - Max Agil code:7e10fa/ff cheat description:Character 2 - Max MAG code:7e10fb/ff cheat description:Character 2 - Max Luck code:7e10fc/ff cheat description:Character 2 - Max ATK code:7e10fd/e7+7e10fe/03 cheat description:Character 2 - Max DEF code:7e10ff/e7+7e1100/03 cheat description:Character 2 - Max INT code:7e1101/ff cheat description:Character 2 - Max ACT code:7e1102/ff cheat description:Character 2 - Max FATE code:7e1103/ff cheat description:Character 3 - Max LEVEL code:7e118a/ff cheat description:Character 3 - Infinite HP code:7e118e/e7+7e118f/03 cheat description:Character 3 - Max HP code:7e118c/e7+7e118d/03 cheat description:Character 3 - Infinite AP code:7e1192/e7+7e1193/03 cheat description:Character 3 - Max AP code:7e1190/e7+7e1191/03 cheat description:Character 3 - Max Str code:7e1197/ff cheat description:Character 3 - Max Vigor code:7e1198/ff cheat description:Character 3 - Max Wisdom code:7e1199/ff cheat description:Character 3 - Max Agil code:7e119a/ff cheat description:Character 3 - Max MAG code:7e119b/ff cheat description:Character 3 - Max Luck code:7e119c/ff cheat description:Character 3 - Max ATK code:7e119d/e7+7e119e/03 cheat description:Character 3 - Max DEF code:7e119f/e7+7e11a0/03 cheat description:Character 3 - Max INT code:7e11a1/ff cheat description:Character 3 - Max ACT code:7e11a2/ff cheat description:Character 3 - Max FATE code:7e11a3/ff cheat description:Character 4 - Max LEVEL code:7e122a/ff cheat description:Character 4 - Infinite HP code:7e122e/e7+7e122f/03 cheat description:Character 4 - Max HP code:7e122c/e7+7e122d/03 cheat description:Character 4 - Infinite AP code:7e1232/e7+7e1233/03 cheat description:Character 4 - Max AP code:7e1230/e7+7e1231/03 cheat description:Character 4 - Max Str code:7e1237/ff cheat description:Character 4 - Max Vigor code:7e1238/ff cheat description:Character 4 - Max Wisdom code:7e1239/ff cheat description:Character 4 - Max Agil code:7e123a/ff cheat description:Character 4 - Max MAG code:7e123b/ff cheat description:Character 4 - Max Luck code:7e123c/ff cheat description:Character 4 - Max ATK code:7e123d/e7+7e123e/03 cheat description:Character 4 - Max DEF code:7e123f/e7+7e1240/03 cheat description:Character 4 - Max INT code:7e1241/ff cheat description:Character 4 - Max ACT code:7e1242/ff cheat description:Character 4 - Max FATE code:7e1243/ff cheat description:Character 5 - Max LEVEL code:7e12ca/ff cheat description:Character 5 - Infinite HP code:7e12ce/e7+7e12cf/03 cheat description:Character 5 - Max HP code:7e12cc/e7+7e12cd/03 cheat description:Character 5 - Infinite AP code:7e12d2/e7+7e12d3/03 cheat description:Character 5 - Max AP code:7e12d0/e7+7e12d1/03 cheat description:Character 5 - Max Str code:7e12d7/ff cheat description:Character 5 - Max Vigor code:7e12d8/ff cheat description:Character 5 - Max Wisdom code:7e12d9/ff cheat description:Character 5 - Max Agil code:7e12da/ff cheat description:Character 5 - Max MAG code:7e12db/ff cheat description:Character 5 - Max Luck code:7e12dc/ff cheat description:Character 5 - Max ATK code:7e12dd/e7+7e12de/03 cheat description:Character 5 - Max DEF code:7e12df/e7+7e12e0/03 cheat description:Character 5 - Max INT code:7e12e1/ff cheat description:Character 5 - Max ACT code:7e12e2/ff cheat description:Character 5 - Max FATE code:7e12e3/ff cheat description:Character 6 - Max LEVEL code:7e136a/ff cheat description:Character 6 - Infinite HP code:7e136e/e7+7e136f/03 cheat description:Character 6 - Max HP code:7e136c/e7+7e136d/03 cheat description:Character 6 - Infinite AP code:7e1372/e7+7e1373/03 cheat description:Character 6 - Max AP code:7e1370/e7+7e1371/03 cheat description:Character 6 - Max Str code:7e1377/ff cheat description:Character 6 - Max Vigor code:7e1378/ff cheat description:Character 6 - Max Wisdom code:7e1379/ff cheat description:Character 6 - Max Agil code:7e137a/ff cheat description:Character 6 - Max MAG code:7e137b/ff cheat description:Character 6 - Max Luck code:7e137c/ff cheat description:Character 6 - Max ATK code:7e137d/e7+7e137e/03 cheat description:Character 6 - Max DEF code:7e137f/e7+7e1380/03 cheat description:Character 6 - Max INT code:7e1381/ff cheat description:Character 6 - Max ACT code:7e1382/ff cheat description:Character 6 - Max FATE code:7e1383/ff cheat description:Character 7 - Max LEVEL code:7e140a/ff cheat description:Character 7 - Infinite HP code:7e140e/e7+7e140f/03 cheat description:Character 7 - Max HP code:7e140c/e7+7e140d/03 cheat description:Character 7 - Infinite AP code:7e1412/e7+7e1413/03 cheat description:Character 7 - Max AP code:7e1410/e7+7e1411/03 cheat description:Character 7 - Max Str code:7e1417/ff cheat description:Character 7 - Max Vigor code:7e1418/ff cheat description:Character 7 - Max Wisdom code:7e1419/ff cheat description:Character 7 - Max Agil code:7e141a/ff cheat description:Character 7 - Max MAG code:7e141b/ff cheat description:Character 7 - Max Luck code:7e141c/ff cheat description:Character 7 - Max ATK code:7e141d/e7+7e141e/03 cheat description:Character 7 - Max DEF code:7e141f/e7+7e1420/03 cheat description:Character 7 - Max INT code:7e1421/ff cheat description:Character 7 - Max ACT code:7e1422/ff cheat description:Character 7 - Max FATE code:7e1423/ff cheat description:Character 8 - Max LEVEL code:7e14aa/ff cheat description:Character 8 - Infinite HP code:7e14ae/e7+7e14af/03 cheat description:Character 8 - Max HP code:7e14ac/e7+7e14ad/03 cheat description:Character 8 - Infinite AP code:7e14b2/e7+7e14b3/03 cheat description:Character 8 - Max AP code:7e14b0/e7+7e14b1/03 cheat description:Character 8 - Max Str code:7e14b7/ff cheat description:Character 8 - Max Vigor code:7e14b8/ff cheat description:Character 8 - Max Wisdom code:7e14b9/ff cheat description:Character 8 - Max Agil code:7e14ba/ff cheat description:Character 8 - Max MAG code:7e14bb/ff cheat description:Character 8 - Max Luck code:7e14bc/ff cheat description:Character 8 - Max ATK code:7e14bd/e7+7e14be/03 cheat description:Character 8 - Max DEF code:7e14bf/e7+7e14c0/03 cheat description:Character 8 - Max INT code:7e14c1/ff cheat description:Character 8 - Max ACT code:7e14c2/ff cheat description:Character 8 - Max FATE code:7e14c3/ff cartridge sha256:fede9d4aec8c35ed11e2868c3c517bce53ee3e6af724085c92500e99e43e63de name:Breath of Fire II (USA) cheat description:Infinite HP in battle code:c213c7/a5 cheat description:Infinite AP In menu code:c38323/bf cheat description:Infinite AP In battle code:c20ac0/b9 cheat description:Main character is different code:c00acc/28+c00acc/27+c00acc/10+c00acc/12+c00acc/14 cheat description:Start with 50 HP code:c00ac6/32 cheat description:Start with 100 HP code:c00ac6/64 cheat description:Start with 150 HP code:c00ac6/96 cheat description:Start with 250 HP code:c00ac6/fa cheat description:Start with 500 HP code:c00ac7/01+c00ac6/f4 cheat description:Start with 750 HP code:c00ac7/02+c00ac6/ee cheat description:Start with a lot of HP code:c00ac7/1f cheat description:Start with 50 AP code:c00aca/32 cheat description:Start with 100 AP code:c00aca/64 cheat description:Start with 150 AP code:c00aca/96 cheat description:Start with 250 AP code:c00aca/fa cheat description:Start with 500 AP code:c00acb/01+c00aca/f4 cheat description:Start with 750 AP code:c00acb/02+c00aca/ee cheat description:Start with a lot of AP code:c00acb/1f cheat description:Start with 0 strength code:c00acd/00 cheat description:Start with Mega strength code:c00acd/ff cheat description:Start with 0 stamina code:c00ace/00 cheat description:Start with Mega stamina code:c00ace/ff cheat description:Start with 0 agility code:c00acf/00 cheat description:Start with Mega agility code:c00acf/ff cheat description:Start with 0 wisdom code:c00ae8/00 cheat description:Start with Mega wisdom code:c00ae8/ff cheat description:Start with 0 luck code:c00ae9/00 cheat description:Start with Mega luck code:c00ae9/ff cheat description:Start with Mega EXP code:c00aec/ff cheat description:No random battles code:7e12dc/00 cheat description:Infinite Fishing Rod power code:7e128c/60 cheat description:Have all warp points code:7e5670/ff+7e5671/ff+7e5672/ff+7e5673/ff cheat description:Have all Shamans code:7e5695/ff cheat description:Infinite Shaman use code:7e5696/00+7e5697/00+7e5698/00+7e5699/00+7e569a/00+7e569b/00 cheat description:Have all non-shop tenants code:7e55eb/de+7e55ec/7b+7e55ed/77+7e55ee/0b cheat description:Character 1 - No Status Effects code:7e51e5/00 cheat description:Character 1 - Level 99 code:7e51e7/63 cheat description:Character 1 - Infinite HP code:7e51e8/0f+7e51e9/27 cheat description:Character 1 - Maximum HP code:7e51ea/0f+7e51eb/27 cheat description:Character 1 - Infinite AP code:7e51ec/0f+7e51ed/27 cheat description:Character 1 - Maximum AP code:7e51ee/0f+7e51ef/27 cheat description:Character 1 - 255 Str code:7e51f1/ff cheat description:Character 1 - 255 Stmna code:7e51f2/ff cheat description:Character 1 - 255 Agil code:7e51f3/ff cheat description:Character 1 - 9999 Off code:7e5202/0f+7e5203/27 cheat description:Character 1 - 9999 Def code:7e5204/0f+7e5205/27 cheat description:Character 1 - 9999 Vigor code:7e5206/0f+7e5207/27 cheat description:Character 1 - 255 Temporary Wisdom code:7e5208/ff cheat description:Character 1 - 255 Temporary Luck code:7e5209/ff cheat description:Character 1 - 255 Permanant Wisdom (next time you change equipment) code:7e520c/ff cheat description:Character 1 - 255 Permanant Luck (next time you change equipment) code:7e520d/ff cheat description:Character 1 - Maximum Guts code:7e520b/ff cheat description:Character 1 - 9999999 EXP code:7e520e/7f+7e520f/96+7e5210/98 cheat description:Character 1 - Maximum Jewel color code:7e520a/ff cheat description:Character 2 - No Status Effects code:7e5225/00 cheat description:Character 2 - Level 99 code:7e5227/63 cheat description:Character 2 - Infinite HP code:7e5228/0f+7e5229/27 cheat description:Character 2 - Maximum HP code:7e522a/0f+7e522b/27 cheat description:Character 2 - Infinite AP code:7e522c/0f+7e522d/27 cheat description:Character 2 - Maximum AP code:7e522e/0f+7e522f/27 cheat description:Character 2 - 255 Str code:7e5231/ff cheat description:Character 2 - 255 Stmna code:7e5232/ff cheat description:Character 2 - 255 Agil code:7e5233/ff cheat description:Character 2 - 9999 Off code:7e5242/0f+7e5243/27 cheat description:Character 2 - 9999 Def code:7e5244/0f+7e5245/27 cheat description:Character 2 - 9999 Vigor code:7e5246/0f+7e5247/27 cheat description:Character 2 - 255 Temporary Wisdom code:7e5248/ff cheat description:Character 2 - 255 Temporary Luck code:7e5249/ff cheat description:Character 2 - 255 Permanant Wisdom (next time you change equipment) code:7e524c/ff cheat description:Character 2 - 255 Permanant Luck (next time you change equipment) code:7e524d/ff cheat description:Character 2 - Maximum Guts code:7e524b/ff cheat description:Character 2 - 9999999 EXP code:7e524e/7f+7e524f/96+7e5250/98 cheat description:Character 2 - Maximum Jewel color code:7e524a/ff cheat description:Character 3 - No Status Effects code:7e5265/00 cheat description:Character 3 - Level 99 code:7e5267/63 cheat description:Character 3 - Infinite HP code:7e5268/0f+7e5269/27 cheat description:Character 3 - Maximum HP code:7e526a/0f+7e526b/27 cheat description:Character 3 - Infinite AP code:7e526c/0f+7e526d/27 cheat description:Character 3 - Maximum AP code:7e526e/0f+7e526f/27 cheat description:Character 3 - 255 Str code:7e5271/ff cheat description:Character 3 - 255 Stmna code:7e5272/ff cheat description:Character 3 - 255 Agil code:7e5273/ff cheat description:Character 3 - 9999 Off code:7e5282/0f+7e5283/27 cheat description:Character 3 - 9999 Def code:7e5284/0f+7e5285/27 cheat description:Character 3 - 9999 Vigor code:7e5286/0f+7e5287/27 cheat description:Character 3 - 255 Temporary Wisdom code:7e5288/ff cheat description:Character 3 - 255 Temporary Luck code:7e5289/ff cheat description:Character 3 - 255 Permanant Wisdom (next time you change equipment) code:7e528c/ff cheat description:Character 3 - 255 Permanant Luck (next time you change equipment) code:7e528d/ff cheat description:Character 3 - Maximum Guts code:7e528b/ff cheat description:Character 3 - 9999999 EXP code:7e528e/7f+7e528f/96+7e5290/98 cheat description:Character 3 - Maximum Jewel color code:7e528a/ff cheat description:Character 4 - No Status Effects code:7e52a5/00 cheat description:Character 4 - Level 99 code:7e52a7/63 cheat description:Character 4 - Infinite HP code:7e52a8/0f+7e52a9/27 cheat description:Character 4 - Maximum HP code:7e52aa/0f+7e52ab/27 cheat description:Character 4 - Infinite AP code:7e52ac/0f+7e52ad/27 cheat description:Character 4 - Maximum AP code:7e52ae/0f+7e52af/27 cheat description:Character 4 - 255 Str code:7e52b1/ff cheat description:Character 4 - 255 Stmna code:7e52b2/ff cheat description:Character 4 - 255 Agil code:7e52b3/ff cheat description:Character 4 - 9999 Off code:7e52c2/0f+7e52c3/27 cheat description:Character 4 - 9999 Def code:7e52c4/0f+7e52c5/27 cheat description:Character 4 - 9999 Vigor code:7e52c6/0f+7e52c7/27 cheat description:Character 4 - 255 Temporary Wisdom code:7e52c8/ff cheat description:Character 4 - 255 Temporary Luck code:7e52c9/ff cheat description:Character 4 - 255 Permanant Wisdom (next time you change equipment) code:7e52cc/ff cheat description:Character 4 - 255 Permanant Luck (next time you change equipment) code:7e52cd/ff cheat description:Character 4 - Maximum Guts code:7e52cb/ff cheat description:Character 4 - 9999999 EXP code:7e52ce/7f+7e52cf/96+7e52d0/98 cheat description:Character 4 - Maximum Jewel color code:7e52ca/ff cartridge sha256:0a07808939e77d8c4a13a6ec7bbc008ee758cd209f8404411bf15d225453beee name:BS Zelda no Densetsu - Dai-3-wa (Japan) (BS) cheat description:Disable the 57 minute time limit code:cc0005/ea+cc0006/ea+cc0007/80 cartridge sha256:811cbc3287c0959e8eb242e817684d36de664ebebc5873a1fa9958693857c438 name:Bubsy in - Claws Encounters of the Furred Kind (USA) cheat description:Infinite lives code:8e996d/00 cheat description:Infinite time code:809b29/00 cheat description:Numbered t-shirts worth one more code:8281ae/38 cheat description:Bogus jump code:8e8592/52 cheat description:Super-jump code:8e8592/36 cheat description:Mega-jump code:8e8592/2e cheat description:Each yarn ball worth 0 code:828144/00 cheat description:Each yarn ball worth 5 code:828144/05 cheat description:Each yarn ball worth 10 code:828144/10 cheat description:Crate of yarn holds 0 instead of 25 code:828856/00 cheat description:Crate of yarn holds 50 code:828856/50 cheat description:Crate of yarn holds 75 code:828856/75 cheat description:Crate of yarn holds 99 code:828856/99 cheat description:Start with 1 life code:80e022/00 cheat description:Start with 5 lives code:80e022/04 cheat description:Start with 25 lives code:80e022/24 cheat description:Start with 50 lives code:80e022/50 cheat description:Start with 75 lives code:80e022/75 cheat description:Start on chapter 2 code:87800f/01 cheat description:Start on chapter 3 code:87800f/02 cheat description:Start on chapter 4 code:87800f/03 cheat description:Start on chapter 5 code:87800f/04 cheat description:Start on chapter 6 code:87800f/05 cheat description:Start on chapter 7 code:87800f/06 cheat description:Start on chapter 8 code:87800f/08 cheat description:Start on chapter 9 code:87800f/0a cheat description:Start on chapter 10 code:87800f/0c cheat description:Start on chapter 11 code:87800f/0d cheat description:Start on chapter 12 code:87800f/0e cheat description:Start on chapter 13 code:87800f/0f cheat description:Start on chapter 14 code:87800f/10 cheat description:Start on Chapter 15 code:87800f/11 cheat description:Start on Chapter 16 code:87800f/12 cartridge sha256:2357d344af77d25dda030520ce203045fd9060f83e3b9609a228dba859d9017b name:Bubsy II (USA) cheat description:Invincibility code:c0f575/8d cheat description:Infinite health code:c00b70/b1 cheat description:Infinite lives code:c004b3/ad cheat description:Infinite time in most main levels code:c06e30/ad+c06e1f/ad cheat description:Infinite time in some bonus levels code:c070a9/ad cheat description:Infinite Warp Holes code:c101f8/ad cheat description:Infinite Diving Suits code:c061df/ad cheat description:Infinite Smart Bombs code:c13060/ad cheat description:Infinite ammo for Nerf Gun code:c12d3a/ad cheat description:Infinite health (alt) code:7e1188/04 cheat description:Infinite lives (alt) code:7e3422/09 cartridge sha256:49020695a017acc3dfadea97a60e28609e583571f69c5abeb3c6b1c2db8113fa name:Bugs Bunny - Rabbit Rampage (USA) cheat description:Invincibility code:8085cf/d0 cheat description:Infinite energy code:80b4a7/ad cheat description:Infinite lives code:80cfe1/00 cheat description:Infinite lives (alt) code:80cfe3/ad cheat description:Take minimal damage code:80b4a7/ce cheat description:Full energy from carrots code:80b4be/00 cheat description:Moon jumping Bugs code:809929/14 cheat description:Super-jumping Bugs code:809929/40+809930/f4 cheat description:Start and continue with 10 lives code:808241/0a cheat description:Start and continue with 2 lives code:808241/02 cartridge sha256:ba4f31353e0e1233b574391ad97a80901d7de212e2c55d7be2af11a9a57c8225 name:Bulls vs Blazers and the NBA Playoffs (USA) cheat description:Never miss a shot code:84828a/00 cartridge sha256:d6f6c30732dae8d00cd83628c3156acbdf26f99df701f779522e21de74dae5fe name:Bust-A-Move (USA) cheat description:Infinite continues code:0fb467/ad cheat description:Infinite time to shoot each ball code:00ebbe/ea cheat description:Always get max bonus in shooting rounds code:00bcea/ea cheat description:Shot guide is always on (new 1P game) code:00b993/ee cheat description:Shot guide is always on (password game) code:00b90f/ee cheat description:Shot guide is always on ("challenge record" mode) code:05e8ff/ee cartridge sha256:9590110a990e90f525d5c8d70fc2a3da10879378003173b6761afb8bf042ee0d name:Capcom's MVP Football (USA) cheat description:Cannot be tackled (hold B) code:01c4e5/e0+01c4e4/30+01c4e1/ad+01c4e2/07+01c4e3/13 cartridge sha256:2a117951adcfbc4298763673a834d502c3f7a3964db1e59650f113c07bb831fb name:Captain America and the Avengers (USA) cheat description:Invincibility - both players code:81eab7/60+81c2c1/80+81c382/bd cheat description:Infinite lives - both players code:81b3eb/ad cheat description:Invincibility - P1 code:7e16a8/20 cheat description:Invincibility - P2 code:7e16a9/63 cheat description:Infinite health - P1 code:7e0226/63 cheat description:Infinite health - P2 code:7e0227/63 cheat description:Infinite lives - P1 code:7e0229/09 cheat description:Infinite lives - P2 code:7e022a/09 cheat description:Hit anywhere code:81b1f6/ad+81b1f8/0a+81b1f7/fa+81b1f9/f0 cartridge sha256:d9b7f9356be0780f0037093a86ef8450f15e569cbd3680073d1cd345dfadb709 name:Captain Commando (USA) cheat description:Invincibility - p1 code:c028f4/a9+c028f5/04+c028f6/9d cheat description:Hit anywhere (throws are disabled) code:c0126a/80+c01458/80+c014c1/80+c01459/57 cheat description:One hit kills - Both players code:c0152c/38+c0152d/e9+c0152e/80 cheat description:Invincibility - P1 (alt) code:7e0404/03 cheat description:Infinite health - P1 code:7e0895/32 cheat description:Infinite health - P2 code:7e0893/32 cheat description:9 lives - P1 code:7e0b15/09 cheat description:9 lives - P2 code:7e0b13/09 cheat description:9 continues code:7e1d5a/39 cartridge sha256:8784614896e2b3e8d98c8166613ca5d2329643795a4dc107791c58c6c51e1268 name:Captain Novolin (USA) (En,Fr,Es) cheat description:Invincibility code:7e0c02/29 cheat description:Infinite health code:7e0bda/04 cheat description:Infinite time code:7e16f2/00 cartridge sha256:be2bdb03549665136cc91173ac538b41b3085e0f1f6b02d6567d174b5b78e435 name:Caravan Shooting Collection (Japan) cheat description:Hector 87 - Infinite health code:7e00e5/10 cheat description:Hector 87 - Infinite lives code:7e00e4/02 cheat description:Star Force - Invincibility code:7e09ca/01 cheat description:Star Force - Always have powered-up weapon code:7e099e/01 cheat description:Star Force - Infinite lives code:7e094d/02 cheat description:Star Force - No enemies (disable before reaching the boss) code:7e0963/05 cheat description:Star Soldier - Invincibility code:7e0086/39 cheat description:Star Soldier - Infinite lives code:7e062f/02 cheat description:Star Soldier - Rapid fire code:7e0630/00 cheat description:Star Soldier - Ship is always blue code:7e0087/00 cheat description:Star Soldier - No enemies except bosses code:7e062e/00 cartridge sha256:ee5fc27dd19a2ecb3c3c7c73d558a18ffd5ff365710c18b88150e277f08d587e name:Carrier Aces (USA) cheat description:Invincibility (works for dogfights and ship fire) code:00f60d/00+00f2f8/80 cheat description:Infinite fuel code:009ae6/ad cheat description:Infinite rockets code:00a85e/ea cartridge sha256:b9b982cd8f91c51089d49b550f11882b1ee785ebddcb7355cfc465916d61a042 name:Casper (USA) cheat description:Infinite lives code:9dd970/ad cheat description:Infinite health code:9dd966/ad cheat description:Infinite health (alt) code:7e1ab7/06 cheat description:Have all items and 5 lives after you leave the first room code:88caa0/d0 cheat description:Do not need the girl in the room to transform code:7e1a47/00 cartridge sha256:367725a149a471411e4f72ad77603b61fb101c9cab4521be5647e13708cc97ba name:Castlevania - Dracula X (USA) cheat description:Invincibility code:848251/d0 cheat description:Invincibility after one hit code:848253/a5 cheat description:Infinite health code:84850c/a5 cheat description:Infinite lives code:80cc1f/a5 cheat description:All hearts worth 99 code:83d974/d0+83d975/00 cheat description:Keep sub-weapon after dying code:80cc2c/a5 cheat description:Keep sub-weapon after continue code:80b57c/a5 cheat description:Item Crash doesn't use hearts code:84cb81/a5 cheat description:Hit anywhere code:83db48/00+83db29/00 cheat description:Small hearts worth 0 code:83d95e/00 cheat description:Small hearts worth 10 code:83d95e/10 cheat description:Small hearts worth 25 code:83d95e/25 cheat description:No Invincibility after getting hit code:848616/00 cheat description:More invincibility after getting hit code:848616/ff cheat description:Super jump code:84b23e/f9 cheat description:Super-Duper jump code:84b23e/f8 cheat description:Mega-jump code:86ba3e/f7 cheat description:Have the Axe code:7e00a4/01 cheat description:Have the Cross code:7e00a4/02 cheat description:Have the Holy Water code:7e00a4/03 cheat description:Have the Knife code:7e00a4/04 cheat description:Have the Clock code:7e00a4/05 cheat description:Have the Key code:7e00a4/06 cheat description:Start with half energy code:80dd6d/20 cheat description:Start with 1/4 energy code:80dd6d/12 cheat description:Start with 3/4 energy code:80dd6d/30 cheat description:Start with 99 hearts code:80b56d/80 cheat description:Start with 50 hearts code:80b56d/50 cheat description:Start with 25 hearts code:80b56d/25 cheat description:Start with 1 life code:80b572/00 cheat description:Start with 10 lives code:80b572/09 cheat description:Start with 25 lives code:80b572/24 cheat description:Start with 50 lives code:80b572/49 cheat description:Start with 99 lives code:80b572/99 cheat description:Start with 25 hearts after you die code:80cc28/25 cheat description:Start with 50 hearts after you die code:80cc28/50 cheat description:Start with 99 hearts after you die code:80cc28/99 cheat description:Start on level 2 code:7e0078/01 cheat description:Start on level 3 code:7e0078/02 cheat description:Start on level 4 code:7e0078/03 cheat description:Start on level 5 code:7e0078/04 cheat description:Start on level 6 code:7e0078/05 cheat description:Start on level 7 code:7e0078/06 cartridge sha256:aa69d4e19c2eb206fe88eba65994c830256c220e5506f59824aefa0a75dd44d5 name:Chavez (USA) cheat description:Infinite time code:7e1f93/15 cartridge sha256:ee0e51d922d1cf8abe3dfc6b0d84a988a6635dc96b2a96962007c41aaa542774 name:Chessmaster, The (USA) cheat description:White player's timer is stopped code:00a43e/a5 cheat description:Black player's timer is stopped code:00a454/a5 cheat description:Timers count 2x as slow code:00a42a/78 cheat description:Timers count 3x times as slow code:00a42a/b4 cheat description:Timers count 2x as fast code:00a42a/1e cheat description:Timers count 3x times as fast code:00a42a/14 cartridge sha256:c7e7df8932bf0056aa530f3dc3c913c1171a359af4c197094c2b972946dc6051 name:Chester Cheetah - Too Cool to Fool (USA) cheat description:Invincibility (blinking) (you may freeze if you get the guitar and fall in water) code:018548/ea cheat description:Infinite life points code:019512/ea cheat description:Infinite credits code:008918/cd cheat description:Badges worth 5 code:02847c/05 cheat description:Badges worth 25 code:02847c/25 cheat description:Badges worth 50 code:02847c/50 cheat description:Start with 2 life points code:018454/02 cheat description:Start with 0 life points code:018454/00 cartridge sha256:21a2aa488cb8140ca318f7d1f513103d14e758181aa336a594097d32ba0a7587 name:Chester Cheetah - Wild Wild Quest (USA) cheat description:Invincibility (once you eat a bag of Cheetos) code:00aea1/ae cheat description:Infinite Cheetos bags (once you collect one) code:00b8d4/ad cheat description:Infinite time code:0093db/ad cheat description:Infinte lives code:0094af/ad cartridge sha256:9a064b67f522b75b82d0857519c0e33b4dbbe494c2ef79a44fdc913d605d0b26 name:Choplifter III - Rescue-Survive (USA) cheat description:Have all weapons and infinte ammo code:808e33/00+808e46/00 cheat description:Infinite secondary weapons code:808f48/ea cheat description:Infinite choppers code:808d0e/ad cheat description:Chopper can carry 30 hostages code:8fab31/1e+8fad65/1e cheat description:Invincibility code:7e0ceb/5a cartridge sha256:224572832b988f31a81c907f751f0292f5702a3acea5866ce6742387c7c6239d name:Choujikuu Yousai Macross - Scrambled Valkyrie (Japan) cheat description:Infinite health code:8088b6/ad+80885f/ad cheat description:Infinite absorb charge code:819ad8/ad cheat description:Hit anywhere code:808f94/00+808f7a/00+808f88/00 cheat description:Invincibility code:7e0a90/ff cheat description:Infinite continues code:7e02aa/09 cartridge sha256:06d1c2b06b716052c5596aaa0c2e5632a027fee1a9a28439e509f813c30829a9 name:Chrono Trigger (USA) cheat description:Use "organize" to get 90 of all items code:c2ab8e/98+c2ab9c/00+c2ab9e/5a cheat description:Maxed out abilities for all characters code:c1f79b/87 cheat description:Every attack causes 9999 damage code:c1dce9/9e cheat description:Can open sealed chests code:c064ad/80 cheat description:Start with a higher max HP code:cc0005/ff cheat description:Start with a higher max MP code:cc0009/8e cheat description:Start with max power code:cc000b/90 cheat description:Start with max stamina code:cc000c/90 cheat description:Start with max speed code:cc000d/90 cheat description:Start with max magic code:cc000e/90 cheat description:Start with max hit ratio code:cc000f/90 cheat description:Start with max evade code:cc0010/90 cheat description:Start with max magic defense code:cc0011/90 cheat description:Position 1 - Infinite health code:7e5e30/e7+7e5e31/03 cheat description:Position 1 - Infinite Magic code:7e5e34/63 cheat description:Position 1 - Attack bar always full code:7eafab/00 cheat description:Position 2 - Infinite health code:7e5eb0/e7+7e5eb1/03 cheat description:Position 2 - Infinite Magic code:7e5eb4/63 cheat description:Position 2 - Attack bar always full code:7eafac/00 cheat description:Position 3 - Infinite health code:7e5f30/e7+7e5f31/03 cheat description:Position 3 - Infinite Magic code:7e5f34/63 cheat description:Position 3 - Attack bar always full code:7eafad/00 cheat description:Infinite Speed Boosts code:7e009a/03 cheat description:Instantly enable next Speed Boost code:7e00ba/00 cartridge sha256:63ab79e86ea13e2cf9bb67aec971febb68450db9865b00b5f412610653822393 name:Chuck Rock (USA) cheat description:Infinite health code:00c36d/a5 cheat description:Infinite lives code:00c395/a5 cheat description:Hit anywhere code:00c1a9/00+00c1fe/00 cheat description:Jump higher code:00a35c/34 cheat description:Super-jump code:00a35c/25 cheat description:Mega-jump code:00a35c/17 cheat description:Invincibility code:7e0baa/25 cartridge sha256:8b7525b2aa30cbea9e3deee601dd26e0100b8169c1948f19866be15cae0ac00d name:Clay Fighter (USA) cheat description:Infinite health - P1 code:da4095/ad+da738f/ad cheat description:Enable Blob's Bomb move (away, away + down, down, towards + down, towards, punch) code:00b442/8d cheat description:Always fight Bad Mr. Frosty after 1st match code:da2ecc/00+db5faf/00 cheat description:Always fight Taffy after 1st match code:da2ecc/00+db5faf/01 cheat description:Always fight Tiny after 1st match code:da2ecc/00+db5faf/02 cheat description:Always fight The Blob after 1st match code:da2ecc/00+db5faf/03 cheat description:Always fight Blue Suede Goo after 1st match code:da2ecc/00+db5faf/04 cheat description:Always fight Ickybod Clay after 1st match code:da2ecc/00+db5faf/05 cheat description:Always fight Helga after 1st match code:da2ecc/00+db5faf/06 cheat description:Always fight Bonker after 1st match code:da2ecc/00+db5faf/07 cheat description:Always fight N. Boss after 1st match code:da2ecc/00+db5faf/08 cheat description:Start with 1/6 health - 1st round code:db1f3e/10 cheat description:Start with 1/3 health - 1st round code:db1f3e/20 cheat description:Start with 1/2 health - 1st round code:db1f3e/30 cheat description:Start with 2/3 health - 1st round code:db1f3e/40 cheat description:Start with 5/6 health - 1st round code:db1f3e/50 cheat description:Start with 1/6 health - 2nd and later rounds code:da2bc1/10 cheat description:Start with 1/3 health - 2nd and later rounds code:da2bc1/20 cheat description:Start with 1/2 health - 2nd and later rounds code:da2bc1/30 cheat description:Start with 2/3 health - 2nd and later rounds code:da2bc1/40 cheat description:Start with 5/6 health - 2nd and later rounds code:da2bc1/50 cheat description:Bad Mr. Frosty's Brutal Punches do more damage code:db278a/30+db278b/30+db278c/30+db278d/30+db278e/30 cheat description:Bad Mr. Frosty's Medium Punches do more damage code:db278f/30+db2790/30+db2791/30+db2792/30+db2793/30 cheat description:Bad Mr. Frosty's Quick Punches do more damage code:db2794/30+db2795/30+db2796/30+db2797/30+db2798/30 cheat description:Bad Mr. Frosty's Brutal Kicks do more damage code:db2799/30+db279a/30+db279b/30+db279c/30+db279d/30 cheat description:Bad Mr. Frosty's Medium Kicks do more damage code:db279e/30+db279f/30+db27a0/30+db27a1/30+db27a2/30 cheat description:Bad Mr. Frosty's Quick Kicks do more damage code:db27a3/30+db27a4/30+db27a5/30+db27a6/30+db27a7/30 cheat description:Bad Mr. Frosty's Snow Ball (all punches) does more damage code:db27a8/30 cheat description:Taffy's Brutal Punches do more damage code:db27b2/30+db27b3/30+db27b4/30+db27b5/30+db27b6/30 cheat description:Taffy's Medium Punches do more damage code:db27b7/30+db27b8/30+db27b9/30+db27ba/30+db27bb/30 cheat description:Taffy's Quick Punches do more damage code:db27bc/30+db27bd/30+db27be/30+db27bf/30+db27c0/30 cheat description:Taffy's Brutal Kicks do more damage code:db27c1/30+db27c2/30+db27c3/30+db27c4/30+db27c5/30 cheat description:Taffy's Medium kick does more damage code:db27c6/30+db27c7/30+db27c8/30+db27c9/30+db27ca/30 cheat description:Taffy's Quick Kicks do more damage (not in crouch) code:db27cb/30+db27cc/30+db28cd/30+db27ce/30+db27cf/30 cheat description:Taffy's Whack (all punches) does more damage code:db27d5/30 cheat description:Taffy's Whack (all kicks) does more damage code:db27d6/30 cheat description:Tiny's Brutal Punches do more damage code:db27da/30+db27db/30+db27dc/30+db27dd/30+db27de/30 cheat description:Tiny's Medium Punches do more damage code:db27df/30+db27e0/30+db27e1/30+db27e2/30+db27e3/30 cheat description:Tiny's Quick Punches do more damage code:db27e4/30+db27e5/30+db27e6/30+db27e7/30+db27e8/30 cheat description:Tiny's Brutal Kicks do more damage code:db27e9/30+db27ea/30+db27eb/30+db27ec/30+db27ed/30 cheat description:Tiny's Medium Kicks do more damage code:db27ee/30+db27ef/30+db27f0/30+db27f1/30+db27f2/30 cheat description:Tiny's Quick Kicks do more damage code:db27f3/30+db27f4/30+db27f5/30+db27f6/30+db27f7/30 cheat description:Tiny's Medicine Ball Does more damage code:db27f8/30 cheat description:Tiny's Sucker Punch does more damage code:db27fd/30 cheat description:Blob's Brutal Punches do more damage code:db2802/30+db2803/30+db2804/30+db2805/30+db2806/30 cheat description:Blob's Medium Punches do more damage code:db2807/30+db2808/30+db2809/30+db280a/30+db280b/30 cheat description:Blob's Quick Punches do more damage code:db280c/30+db280d/30+db280e/30+db280f/30+db2810/30 cheat description:Blob's Brutal kick does more damage code:db2811/30+db2812/30+db2813/30+db2814/30+db2815/30 cheat description:Blob's Medium Kicks do more damage code:db2816/30+db2817/30+db2818/30+db2819/30+db281a/30 cheat description:Blob's Quick Kicks do more damage code:db281b/30+db281c/30+db281d/30+db281e/30+db281f/30 cheat description:Blue Suede Goo's Brutal Punches do more damage code:db282a/30+db282b/30+db282c/30+db282d/30+db282e/30 cheat description:Blue Suede Goo's Medium Punches do more damage code:db282f/30+db2830/30+db2831/30+db2832/30+db2833/30 cheat description:Blue Suede Goo's Quick Punches do more damage code:db2834/30+db2835/30+db2836/30+db2837/30+db2838/30 cheat description:Blue Suede Goo's Brutal Kicks do more damage code:db2839/30+db283a/30+db283b/30+db283c/30+db283d/30 cheat description:Blue Suede Goo's Medium Kicks do more damage code:db283e/30+db283f/30+db2840/30+db2841/30+db2842/30 cheat description:Blue Suede Goo's Quick Kicks do more damage code:db2843/30+db2844/30+db2845/30+db2846/30+db2847/30 cheat description:Ickybod Clay's Brutal Punches do more damage code:db2852/30+db2853/30+db2854/30+db2855/30+db2856/30 cheat description:Ickybod Clay's Medium Punches do more damage code:db2857/30+db2858/30+db2859/30+db285a/30+db285b/30 cheat description:Ickybod Clay's Quick Punches do more damage code:db285c/30+db285d/30+db285e/30+db285f/30+db2860/30 cheat description:Ickybod Clay's Brutal Kicks do more damage code:db2861/30+db2862/30+db2863/30+db2864/30+db2865/30 cheat description:Ickybod Clay's Medium Kicks do more damage code:db2866/30+db2867/30+db2868/30+db2869/30+db286a/30 cheat description:Ickybod Clay's Quick Kicks do more damage code:db286b/30+db286c/30+db286d/30+db286e/30+db286f/30 cheat description:Ickybod Clay's Ecto Punch does more damage code:db2871/30 cheat description:Helga's Brutal Punches do more damage code:db287a/30+db287b/30+db287c/30+db287d/30+db287e/30 cheat description:Helga's Medium Punches do more damage code:db287f/30+db2880/30+db2881/30+db2882/30+db2883/30 cheat description:Helga's Quick Punches do more damage code:db2884/30+db2885/30+db2886/30+db2887/30+db2888/30 cheat description:Helga's Brutal Kicks do more damage code:db2889/30+db288a/30+db288b/30+db288c/30+db288d/30 cheat description:Helga's Medium Kicks do more damage code:db288e/30+db288f/30+db2890/30+db2891/30+db2892/30 cheat description:Helga's Quick Kicks do more damage (not far away) code:db2983/30+db2894/30+db2895/30+db2896/30+db2897/30 cheat description:Helga's Viking Ram does more damage code:db289a/30 cheat description:Bonker's Brutal Punches do more damage code:db28a2/30+db28a3/30+db28a4/30+db28a5/30+db28a6/30 cheat description:Bonker's Medium Punches do more damage code:db28a7/30+db28a8/30+db28a9/30+db28aa/30+db28ab/30 cheat description:Bonker's Quick Punches do more damage code:db28ac/30+db28ad/30+db28ae/30+db28af/30+db28b0/30 cheat description:Bonker's Brutal Kicks do more damage code:db28b1/30+db28b2/30+db28b3/30+db28b4/30+db28b5/30 cheat description:Bonker's Medium Kicks do more damage code:db28b6/30+db28b7/30+db28b8/30+db28b9/30+db28ba/30 cheat description:Bonker's Quick Kicks do more damage code:db28bb/30+db28bc/30+db28bd/30+db28be/30+db28bf/30 cheat description:Bonker's Cutting Cartwheel does more damage code:db28c0/30 cartridge sha256:2d40c86bc19d85555bf2672acf515b04dbf56a6a59b29ad503e672310b0fae3b name:Clay Fighter 2 - Judgment Clay (USA) cheat description:Select more speed in options code:c14bbb/20 cheat description:Select more difficulty in options code:c14b98/09 cheat description:Both players jump off the screen code:c07f53/b1 cheat description:Infinite health and time code:c07862/a9+c07865/8d+c07866/28+c07867/18 cheat description:Blob - Blob spit kills code:cd44af/ff cheat description:Blob - Buzz saw kills code:cd44f8/ff cheat description:Blob - Rocket-anvil attack kills code:cd455e/ff cheat description:Hoppy - Spinning carrot kills code:ce9940/ff cheat description:Hoppy - Spin kick towards (special move) kills code:ce9996/ff cheat description:Octo - Brutal cartwheel kills (when close) code:cd6dae/ff cheat description:Octo - Ground spin kills code:cd6e73/ff cartridge sha256:1d19e7fbe32eb26181c95fcbb028a5d64797ab65b86568eb059c60b8acf0d702 name:Claymates (USA) (Sample) cheat description:Invincibility code:cd0225/ad cheat description:Infinite time code:cd678c/ad cheat description:Multi-jump (tap jump button) code:cd06cf/b5 cheat description:Infinite lives code:cd66b8/ad cartridge sha256:e5980b990605a9c91fa89101c440b2ec9993329296ba09a9538042d724a080fb name:Cliffhanger (USA) cheat description:Invincibility code:81894e/f0 cheat description:Infinite health code:81b4fb/ad cheat description:Infinite ammo code:81af0b/ad cheat description:Infinite lives code:81b592/ea cheat description:Hit anywhere code:81b216/00 cheat description:One hit kills on normal enemies code:8297a6/a9+8297a7/01 cheat description:Stop snow avalanche (run into it) code:81b4d2/6b cartridge sha256:03f6c69aef92d36b5ea25a6023368da0e1da9fa160e8316ebd533d4f358ffacf name:Clue (USA) cheat description:Always roll a 1 code:009da1/a9+009da3/ea+009da2/00 cheat description:Always roll a 2 code:009da1/a9+009da3/ea+009da2/01 cheat description:Always roll a 3 code:009da1/a9+009da3/ea+009da2/02 cheat description:Always roll a 4 code:009da1/a9+009da3/ea+009da2/03 cheat description:Always roll a 5 code:009da1/a9+009da3/ea+009da2/04 cheat description:Always roll a 6 code:009da1/a9+009da3/ea+009da2/05 cheat description:Allow no interrogations instead of 2 code:0098ca/90 cheat description:Allow only 1 interrogation code:0098c8/01 cheat description:Allow 3 interrogations code:0098c8/03 cheat description:Allow 4 interrogations code:0098c8/04 cheat description:Allow 5 interrogations code:0098c8/05 cheat description:Infinite interrogations code:00b5ed/b9 cartridge sha256:5536cea2da39f2572abe3b0fcf71f8fcd981376b470b174969772aae4a7a1845 name:College Football USA 97 (USA) cheat description:Always 1st down code:7e1836/05 cheat description:Infinite time code:7e1828/ff cheat description:Have 50 points - P1 code:7fb140/32+7fb726/32 cheat description:Have 50 time outs - P1 code:7fb1c7/32 cartridge sha256:c88a882ad72dfa07a9b1eb8a2183aa10057d60877a02edf90cf2cd8c78abe65e name:Combatribes, The (USA) cheat description:Invincibility - both players code:009b6c/d0 cheat description:Infinite health - both players code:009a76/ea+009a77/a9+009a78/c8+009a7a/8d cheat description:Infinite credits code:009be9/cd cheat description:Hit anywhere - P1 code:00919e/e0+0091a2/34+00919f/00+0091a0/00+0091a1/f0 cheat description:One hit kills - both players code:00c6eb/e0+00c6ec/00+00c6ed/00+00c6f7/24 cheat description:Invincibility - P1 code:7e1934/01 cheat description:Infinite health - P1 code:7e1794/c8 cheat description:Infinite health - P2 code:7e1796/c8 cheat description:Infinite credits (alt) code:7e1564/09 cheat description:Unlock all characters in vs mode code:7e1ee7/10 cartridge sha256:26e09f5bc2bde28d57aeca0bf5be7f7fb8e3b3887af975bcbf2e6f29b07df56f name:Congo's Caper (USA) cheat description:Infinite lives code:80f2a6/00 cheat description:Hit anywhere code:008b93/00 cheat description:Multi-jump code:00c4d0/00 cheat description:Stay as Super Congo (you may change if you walk on spikes) code:808f58/a9 cheat description:1 life after continue code:809848/00 cheat description:6 lives after continue code:809848/05 cheat description:9 lives after continue code:809848/08 cheat description:1 ruby turns you into Super Congo code:8093d9/a9+8093da/02 cheat description:Start as Super Congo code:809854/82 cheat description:Start with 1 life code:81c4a5/00 cheat description:Start with 6 lives code:81c4a5/05 cheat description:Start with 9 lives code:81c4a5/08 cartridge sha256:a93ea87fc835c530b5135c5294433d15eef6dbf656144b387e89ac19cf864996 name:Contra III - The Alien Wars (USA) cheat description:Invincibility (top-view levels) code:028e65/b5 cheat description:Invincibility (side-view levels) - P1 code:019ae5/b5+01a641/b5 cheat description:Invincibility (side-view levels) - P2 code:01a674/b5+019b87/b5 cheat description:Infinite continues code:00a9c5/ad cheat description:Infinite lives (side-view levels) code:019b91/dd cheat description:Infinite lives (top-view levels) code:029695/dd+029698/80 cheat description:Infinite bombs (side-view levels) code:01802e/dd cheat description:Infinite bombs (top-view levels) code:0291be/dd cheat description:Enable 30 and 99 lives in option menu (99 actually gives 35,081 lives) code:00bb37/05 cheat description:Keep main weapon when you die (side-view levels) code:019ac7/bd cheat description:Keep main weapon when you die (top-view levels) code:0296aa/bd cheat description:Multi-jump code:01856b/ff+01856c/95+01856d/1e+018562/a5+018563/28+018564/29+018565/00+018566/80+018567/f0+018568/05+018569/a9+01856a/fa cheat description:Enable stage select code:00a6ac/24 cheat description:Start with 5 bombs on each life (side-view levels) code:019b97/05+00a2f1/05 cheat description:Start with 9 bombs on each life (side-view levels) code:019b97/09+00a2f1/09 cheat description:Start with 5 bombs on each life (top-view levels) code:028eed/05+00a6f1/05 cheat description:Start with 9 bombs on each life (top-view levels) code:028eed/09+00a6f1/09 cheat description:Always have Scatter Blaster for gun 1 (disable during bonus stages) code:7e1f84/01 cheat description:Always have Missile Launcher for gun 1 (disable during bonus stages) code:7e1f84/02 cheat description:Always have Homing Missile for gun 1 (disable during bonus stages) code:7e1f84/03 cheat description:Always have Torch for gun 1 (disable during bonus stages) code:7e1f84/04 cheat description:Always have Laser for gun 1 (disable during bonus stages) code:7e1f84/05 cheat description:Always have Scatter Blaster for gun 2 (disable during bonus stages) code:7e1f86/01 cheat description:Always have Missile Launcher for gun 2 (disable during bonus stages) code:7e1f86/02 cheat description:Always have Homing Missile for gun 2 (disable during bonus stages) code:7e1f86/03 cheat description:Always have Torch for gun 2 (disable during bonus stages) code:7e1f86/04 cheat description:Always have Laser for gun 2 (disable during bonus stages) code:7e1f86/05 cheat description:Enable stage select (alt) code:7e1e60/01 cheat description:Start on stage 2 code:7e0086/02 cheat description:Start on stage 3 code:7e0086/03 cheat description:Start on stage 4 code:7e0086/04 cheat description:Start on stage 5 code:7e0086/05 cheat description:Start on stage 6 code:7e0086/06 cartridge sha256:c7d622391f7699fb0dc6367e141c894e700cc9bd8abca69f36785e7bc2f42a49 name:Cool Spot (USA) cheat description:Infinite health code:7e00d0/07 cheat description:Infinite lives code:01d8ac/24 cheat description:Infinite lives (alt) code:7e00d4/09 cheat description:Infinite time (disable after completing stage) code:7e00ce/68 cheat description:100% Coolness (disable after completing stage) code:7e00d2/64 cheat description:Less invincibility time code:01b456/1f cheat description:More invincibility time code:01b456/ff cheat description:5 seconds picked up code:01bda1/05 cheat description:1 minute picked up code:01bda1/3c cheat description:16% picked up from '7up' code:01bd5c/10 cheat description:Be able to free fellow spot right away code:01d488/00 cheat description:Start with 1 life code:00d8b9/01 cheat description:Start with 6 lives code:00d8b9/06 cheat description:Start with 9 lives code:00d8b9/09 cartridge sha256:9674cc269d89a52d1719a487b44acf004fb777cbd58d76b19a2cd25749728215 name:Cool World (USA) cheat description:Infinite lives code:029888/ad cheat description:Infinite continues code:009cd6/ad cheat description:A Nickel for a life costs nothing (must have 1 Nickel) code:00b50a/00+00b50b/00 cheat description:Bank deposits cost nothing (must have 5 Nickels) code:00b5a6/00+00b5a7/00 cheat description:Opening a bank account costs nothing (must have 10 Nickels) code:00c887/00+00c888/00 cheat description:High-Low game at the Gold Rush costs nothing (must have 5 Nickels) code:01afb3/00+01afb4/00 cheat description:Most Nickels worth 2 on pick-up (must have 5 Nickels) code:0199ff/02+019a2e/02 cheat description:Most Nickels worth 10 on pick-up (must have 5 Nickels) code:0199ff/0a+019a2e/0a cheat description:Continue with 9 lives code:00b213/09 cheat description:Start with 1 life code:009cf1/01 cheat description:Start with 9 lives code:009cf1/09 cheat description:Start with 10 Nickels code:00b238/e6+00b239/ee cheat description:Start with 1 Nickel code:00b238/e6 cheat description:Invincibility (blinking) code:7e02bf/ff cheat description:Infinite Nickels code:7e00ed/63 cartridge sha256:b9d2483ba547b22cb1173ca0895e4fb20b33d1c4cca62526b12d75280dd8501b name:Cosmo Gang - The Puzzle (Japan) cheat description:Clear level automatically code:01db9b/00 cartridge sha256:73533c37fcd3eddce4804eb4c016214d1741c348c349f00d8e6838d341a50df9 name:Cosmo Gang - The Video (Japan) cheat description:Infinite lives code:7e0200/0a cheat description:Weapon modifier code:7e0d0b/00 cartridge sha256:2602f6e598c711aedb2e3a22414b7869a8490993aef32f53127c408e549afc6d name:Cosmo Police Galivan II - Arrow of Justice (Japan) cheat description:Invincibility code:009623/a9+009624/01+009625/8d+009626/77+009627/12 cheat description:Infinite health code:00ee12/ad cheat description:Infinite lives code:009e67/cd cheat description:One hit kills code:00eacf/9e cheat description:Hit anywhere code:00ea08/24+00e9ea/80+00ea07/80 cheat description:Invincibility (alt) code:7e1277/df cheat description:Infinite health (alt) code:7e126c/60 cheat description:Infinite health (alt 2) code:7e126c/61 cheat description:Infinite lives (alt) code:7e1485/03 cartridge sha256:0ac2b8d84a7cd1801d8fb6cb03c07273df4b02c0445e9d69a952bd7ac92eac64 name:Crayon Shin-chan - Arashi o Yobu Enji (Japan) cheat description:Invincibility code:7e00ba/09 cheat description:Infinite health code:7e0461/04 cheat description:Infinite lives code:7e00b2/09 cheat description:Infinite time code:7e00ac/7f+7e00ad/7f+7e00ae/7f+7e00af/7f cheat description:Infinite Invincibility Cards code:7e00b6/09 cheat description:Infinite Guard Dog Cards code:7e00b7/09 cheat description:Infinite Elephant Dance Cards code:7e00b8/09 cheat description:Infinite Health Restore Cards code:7e00b9/09 cheat description:Always carry an item to throw code:7e00b4/01 cheat description:Enemies are always stunned (Elephant Card effect) code:7e00c0/7f cheat description:Guard Dog stay indefinitely code:7e00c8/7f+7e00c9/7f cheat description:Golden Card exists code:7e00cc/02 cheat description:Moon-jump code:7e00cd/01 cheat description:Walk through most walls code:7e00ce/ff cheat description:Always make a choice - Rock, Paper, Scissors minigame code:7e1f00/01 cheat description:Infinite tries - Card Matching minigame code:7e1943/03 cheat description:Infinite time - Jumbled Picture minigame code:7e1920/7f+7e1921/7f+7e1922/7f cheat description:Infinite tries - Card Search minigame code:7e191a/00 cheat description:No blur - Playground Fountain minigame code:7e190f/01 cheat description:Losing still allows you to move forward code:7e1f07/01 cheat description:Instant win - TV Flags minigame code:7e191a/00 cheat description:Very easy wins code:7e1925/01 cheat description:Only need 1 Star to win code:7e1935/01 cheat description:Enemy can't win (0 Stars) code:7e1937/00 cheat description:Enemy always raise both flags code:7e1930/01+7e1931/01 cartridge sha256:7c722f9941957630467c1784d0eb3f92fbfc0a2a1da3c8f5c27f593eca2a5a04 name:Cutthroat Island (USA) cheat description:Stage select menu after character select screen code:878c9d/ea cheat description:Infinite health - P1 code:7e09f4/28 cheat description:Infinite health - P2 code:7e0a53/28 cheat description:Stage select menu after character select screen (alt) code:878c9d/ea cheat description:9 lives - P1 code:7e1ef7/09 cheat description:9 lives - P2 code:7e1ef9/09 cartridge sha256:c4ae2797fac2586b8640064be6398f2b4f2b3158a07f26c66912b29f7fd197de name:Cyber Spin (USA) cheat description:Infinite power code:019b53/ad+019b75/ad+019b97/ad cartridge sha256:ad31b94ce928ecff605e2b89082154671691509e95d38370ed381437f2c36698 name:Cybernator (USA) cheat description:Infinite health code:82a834/bd+82a85d/bd+8293eb/a5 cheat description:Protection against some hazards code:82a85d/bd+82a834/bd cheat description:Infinite Vulcan code:848723/ad+848720/ad cheat description:Never overheat code:829372/ad cheat description:Infinite credits code:80e024/ad cheat description:Only 2 P's needed for level 2 Vulcan code:838462/02 cheat description:Only 4 P's needed for level 3 Vulcan code:838464/04 cheat description:Only 3 P's needed for level 3 Laser code:83846a/03 cheat description:Only 3 P's needed for level 3 Missile code:838470/03 cheat description:Only 2 P's needed for level 2 Napalm code:838474/02 cheat description:Only 4 P's needed for level 3 Napalm code:838476/04 cheat description:Only 2 P's needed for level 2 Punch code:83847a/02 cheat description:Only 3 P's needed for level 3 Punch code:83847c/03 cheat description:Energy chip worth nothing code:82e119/00 cheat description:Energy chip worth more code:82e119/a0 cheat description:Weapons start at level 2 code:809514/02 cheat description:Weapons start at level 3 code:809514/03 cheat description:Start with Lasers code:80951f/8d cheat description:Start with Homing Missiles code:80951c/8d cheat description:Start with Napalm code:809522/8d cheat description:Start with 2 credits code:80956f/01 cheat description:Start with 6 credits code:80956f/05 cheat description:Start with 10 credits code:80956f/09 cheat description:Start on level 3.1 code:80950e/02 cheat description:Start on level 3.2 code:80950e/03 cheat description:Start on level 3.3 code:80950e/04 cheat description:Start on level 4.1 code:80950e/05 cheat description:Start on level 4.2 code:80950e/06 cheat description:Start on level 5.1 code:80950e/07 cheat description:Start on level 5.2 code:80950e/08 cheat description:Start on level 6.1 code:80950e/09 cheat description:Start on level 7.3 code:80950e/10 cheat description:Start on level 7.4 code:80950e/11 cheat description:View the failed ending code:80950e/12 cheat description:View the successful ending code:80950e/13 cartridge sha256:71e77fdbd9c865ae07e907549b02549ebe87fa8d436401c485e588c61797754a name:Cyborg 009 (Japan) cheat description:Infinite health code:7e0ae1/3c cheat description:Infinite lives code:7e1a31/02 cheat description:Infinite Super Power code:7e0ae3/3c cartridge sha256:4068add412571bd85adac32dff9835e4a4886077d752adb104fee3908e42b7ef name:Daffy Duck - The Marvin Missions (USA) cheat description:Infinite health code:80b7e2/ad cheat description:Infinite ammo (must have some ammo for the gun to be selectable) code:80b17c/00 cheat description:Infinite lives code:809be9/00 cheat description:Infinite continues code:82cade/00 cheat description:Infinite Nutty attacks code:80b33b/ad cheat description:Hit anywhere code:80e5e0/00 cheat description:Get items from anywhere code:80da4f/00+80d984/00+80de37/00+80e1a2/00 cheat description:One hit kills code:80b58c/80 cheat description:Disable recoil code:80b257/00 cheat description:Juice cans set health to 1/2 code:80da62/06 cheat description:Juice cans set health to 3/4 code:80da62/09 cheat description:Gem power-ups worth 0 code:80e0aa/00 cheat description:Gem power-ups worth 5 (1 continue) code:80e0aa/05 cheat description:Gems are free code:82c0b8/00 cheat description:Freeze Gun ammo is free code:82c0a9/00 cheat description:Freeze Gun ammo is $200 code:82c0a9/20 cheat description:Electricity Gun ammo is free code:82c0ab/00 cheat description:Electricity Gun ammo is $150 code:82c0ab/15 cheat description:3-way Gun ammo is free code:82c0ad/00 cheat description:3-way Gun ammo is $150 code:82c0ad/15 cheat description:Bomb Gun ammo is free code:82c0af/00 cheat description:Bomb Gun ammo is $150 code:82c0af/15 cheat description:Antimatter Gun ammo is free code:82c0b1/00 cheat description:Antimatter Gun ammo is $200 code:82c0b1/20 cheat description:Freeze Gun ammo power-ups are worth 20 code:80dcb7/20 cheat description:Electricity Gun ammo power-ups are worth 20 code:80dd83/20 cheat description:Three-way Gun ammo power-ups are worth 20 code:80de4f/20 cheat description:Bomb Gun ammo power-ups are worth 20 code:80df1b/20 cheat description:Antimatter Gun ammo power-ups are worth 20 code:80dfe7/20 cheat description:Nutty attacks are free code:82c0b5/00 cheat description:Nutty attacks are $400 code:82c0b5/40 cheat description:Jetpack fuel is free code:82c0b3/00 cheat description:Fuel is consumed at 1/4 normal rate code:80adbb/06 cheat description:Fuel is consumed at 1/2 normal rate code:80adbb/0c cheat description:Fuel is consumed at 3/4 normal rate code:80adbb/12 cheat description:Fuel power-ups are worth 1/2 as much code:80d99c/06 cheat description:Fuel power-ups are worth 2x code:80d99c/1a cheat description:Buy a life and get a ton of money code:82c3be/80 cheat description:Bought Freeze Gun ammo is worth 20 code:82c0f8/20 cheat description:Bought gems worth 0 code:82c38b/00 cheat description:Bought gems worth 5 (1 continue) code:82c38b/05 cheat description:Bought Electricity Gun ammo is worth 20 code:82c159/20 cheat description:Bought Three-way Gun ammo is worth 20 code:82c1ba/20 cheat description:Bought Bomb Gun ammo is worth 20 code:82c21b/20 cheat description:Bought Anti matter Gun ammo is worth 20 code:82c27c/20 cheat description:Bought fuel is worth 1/2 as much code:82c2df/06 cheat description:Bought fuel is worth 2x as much code:82c2df/1a cheat description:Extra lives cost $500 code:82c0ba/00 cheat description:Extra lives cost $1,500 code:82c0ba/01 cheat description:Extra life power-ups don't work code:80dbe8/00 cheat description:Extra life power-ups worth 2 code:80dbe8/02 cheat description:Extra life power-ups worth 5 code:80dbe8/05 cheat description:Extra lives can't be bought code:82c3e7/00 cheat description:2 extra lives for each one purchased code:82c3e7/02 cheat description:5 extra lives for each one purchased code:82c3e7/05 cheat description:Start with 1 life code:809903/01 cheat description:Start with 9 lives (don't set lives in options menu) code:809903/09 cheat description:Start with 25 lives (don't set lives in options menu) code:809903/25 cheat description:Start with 51 lives (don't set lives in options menu) code:809903/51 cheat description:Start with 1/2 health code:809f20/06 cheat description:Start with 3/4 health code:809f20/09 cheat description:Start with no nutty attacks code:809a05/00 cheat description:Start with 3 nutty attacks code:809a05/03 cheat description:Start with 5 nutty attacks code:809a05/05 cheat description:Start with 7 nutty attacks code:809a05/07 cheat description:Start with 0 gems code:809a2e/00 cheat description:Start with 10 gems (2 continues) code:809a2e/10 cheat description:Start with 25 gems (5 continues) code:809a2e/25 cheat description:Start with 10 ammo for all Guns (except blaster) code:809a16/10 cheat description:Start with 50 ammo for all Guns code:809a16/50 cheat description:Start with 90 ammo for all Guns code:809a16/90 cheat description:Start with almost no fuel code:809a29/00 cheat description:Start with 2x fuel code:809a29/1b cheat description:Start with 3x fuel code:809a29/27 cheat description:Start with $2,500 code:809a0c/02 cheat description:Start with $3,500 code:809a0c/03 cheat description:Start with $9,500 code:809a0c/09 cheat description:Start with $30,500 code:809a0c/30 cheat description:Start on level 1-2 code:809951/01 cheat description:Start on level 1-3 code:809951/02 cheat description:Start on level 1-4 code:809951/03 cheat description:Start on level 2-1 code:809951/04 cheat description:Start on level 2-2 code:809951/05 cheat description:Start on level 2-3 code:809951/06 cheat description:Start on level 2-4 code:809951/07 cheat description:Start on level 3-1 code:809951/08 cheat description:Start on level 3-2 code:809951/09 cheat description:Start on level 3-3 code:809951/0a cheat description:Start on level 3-4 code:809951/0b cheat description:Start on level 4-1 code:809951/0c cheat description:Start on level 4-2 code:809951/0d cheat description:Start on level 4-3 code:809951/0e cheat description:Start on level 4-4 code:809951/0f cheat description:Start on level 5-1 code:809951/10 cheat description:Start on level 5-2 code:809951/11 cheat description:Start on level 5-3 code:809951/12 cheat description:Start on level 5-4 code:809951/13 cheat description:Invincibility (blinking) code:7e1f12/05 cheat description:Infinite health (alt) code:7e1f0e/0c cheat description:Infinite lives (alt) code:7e1f10/99 cheat description:Infinite continues (alt) code:7e1f82/99 cheat description:Infinite Nutty attacks (alt) code:7e1f16/07 cheat description:Infinite Fuel code:7e1f45/10 cheat description:Infinite money code:7e00f7/99+7e00f8/99 cheat description:Infinite ammo for Freeze Gun code:7e1f2a/99 cheat description:Infinite ammo for Electricity Gun code:7e1f2c/99 cheat description:Infinite ammo for 3-way Gun code:7e1f2e/99 cheat description:Infinite ammo for Bomb Gun code:7e1f30/99 cheat description:Infinite ammo for Antimatter Gun code:7e1f32/99 cartridge sha256:f3527855afea87b29406700b9dab45ebbb48edcb5a01d59cc2b0986abd3b1dd7 name:Darius Force (Japan) cheat description:Invincibility (can make the screen flash if you use both weapons) code:7e1000/81 cheat description:Infinite lives code:7e0111/03 cartridge sha256:ceb470157576eac3b8b8c16e8ab6b59672409681ffb4232e4ec39dd0cb37ef91 name:Darius Twin (USA) cheat description:Invincibility - P1 code:01d60c/ad cheat description:Invincibility - P2 code:01e3a6/ad cheat description:Infinite lives - P1 code:01ee77/00 cheat description:Infinite lives - P2 code:01ee97/00 cheat description:Hit anywhere - both players code:00dae7/80+00db0e/ad+00dabf/00+00daf1/00 cheat description:Start with the strongest main weapon and 8 lives - both players code:00aee3/ea+00aeea/8d+00aeed/8d+00aee1/a9+00aee2/08 cheat description:Start with 1 Green Power Cube - P1 code:00af06/8d+00aef8/2c cheat description:Start with 1 Green Power Cube - P2 code:00af09/8d+00aef8/2c cheat description:Start with 10 lives - both players code:00aee2/10+00aee1/a9+00aee3/ea cheat description:Start with 15 lives - both players code:00aee2/15+00aee1/a9+00aee3/ea cheat description:Start with 20 lives - both players code:00aee2/20+00aee1/a9+00aee3/ea cheat description:Start with 25 lives - both players code:00aee2/25+00aee1/a9+00aee3/ea cheat description:Start on planet B code:00934c/01+00934b/a0+00934d/00+00934e/8c cheat description:Start on planet C code:00934c/02+00934b/a0+00934d/00+00934e/8c cheat description:Start on planet D code:00934c/03+00934b/a0+00934d/00+00934e/8c cheat description:Start on planet E code:00934c/04+00934b/a0+00934d/00+00934e/8c cheat description:Start on planet F code:00934c/05+00934b/a0+00934d/00+00934e/8c cheat description:Start on planet G code:00934c/06+00934b/a0+00934d/00+00934e/8c cheat description:Start on planet H code:00934c/07+00934b/a0+00934d/00+00934e/8c cheat description:Start on planet I code:00934c/08+00934b/a0+00934d/00+00934e/8c cheat description:Start on planet J code:00934c/09+00934b/a0+00934d/00+00934e/8c cheat description:Start on planet K code:00934c/0a+00934b/a0+00934d/00+00934e/8c cheat description:Start on planet L code:00934c/0b+00934b/a0+00934d/00+00934e/8c cheat description:Invincibility - P1 (alt) code:01d60c/ad cheat description:Invincibility - P2 (alt) code:01e3a6/ad cheat description:Start with 99 lives - both players code:7e1067/99 cheat description:Infinite Shield - P1 code:7e177b/ff cheat description:Infinite Shield - P2 code:7e188b/ff cheat description:Max 1st Gun - P1 code:7e17a4/08 cheat description:Max 1st Gun - P2 code:7e1835/08 cheat description:Max 2nd Gun - P1 code:7e17eb/08 cheat description:Max 2nd Gun - P2 code:7e177c/08 cheat description:Start with 1 Green Power Cube - P1 (alt) code:00aef8/2c+00af06/8d cheat description:Start with 1 Green Power Cube - P2 (alt) code:00aef8/2c+00af09/8d cartridge sha256:6c1749b24124f74d3aceefa24297b836b6ee7598fc2094f4d065b3c762c898a4 name:Dark Law - Meaning of Death (Japan) cheat description:Sell an item to get maximum cash code:c27cea/80+c27ceb/08 cheat description:Fewer random battles code:c338f3/80 cheat description:Any code will open locked doors code:d124a5/00 cheat description:One hit kills code:c9a261/80 cheat description:Infinite walking range in battle code:c955b5/00 cartridge sha256:e6efb6361af04963f22c772f879a466543f56b3b6a084204fef2dcb4659d82d9 name:David Crane's Amazing Tennis (USA) cheat description:Faster side-to-side movement code:00b394/fc+00b37c/04 cheat description:Even faster side-to-side movement code:00b394/fa+00b37c/06 cartridge sha256:6ce516e3d1a7068cc9732cd3517cfd1e92179f2340c63a244625a1ff49815085 name:Daze Before Christmas (Europe) cheat description:Infinite health code:7e06f9/05 cheat description:Infinite lives code:7e1e68/04 cartridge sha256:300c1937e4b68108302e9b0f49974d1ec6b6c45dd8da69dddc19443f9562ecf4 name:Death and Return of Superman, The (USA) cheat description:Invincibility code:808296/d0+8082a7/f0 cheat description:Infinite health code:80d20c/a5+80d20d/55+80d20e/8d+80d20f/d2+80d210/0e cheat description:Infinite lives code:80d326/ee cheat description:Infinite special attacks code:80d2ee/ee+80d2ef/0e cartridge sha256:a33af57e62a46282e3755824cc5fc39870a8eab8a28aaeb1c3817ba2c8e8655e name:Death Brade (Japan) cheat description:Infinite heath - P1 code:7e0a10/50 cartridge sha256:752d24fab240f4dd1dfbfea5ec83438998316806ad44488bf8c84430ca5a2cd0 name:Demolition Man (USA) cheat description:Infinite health code:80b75e/15 cheat description:Infinite health (alt) code:7e9f30/7f cheat description:Infinite lives code:80c1a4/ad cheat description:Infinite Grenades code:81c8d3/bd cheat description:Infinite ammo - Shotgun and Magnum code:80c5cf/bd cheat description:Infinite ammo - Shotgun code:80c5c8/01 cheat description:Infinite ammo - Magnum code:859114/02 cheat description:Jump 2x higher code:00b64c/20 cheat description:Jump 4x higher code:00b64c/10 cheat description:Jump 8x higher code:00b64c/08 cartridge sha256:248217975279bbf9db8e74da11a906a6dd867a3ec88441b0b031ecf900466618 name:Demon's Blazon - Makai Mura Monshou Hen (Japan) cheat description:Invincibility code:7e103c/5a cheat description:Infinite health code:7e1062/15 cheat description:Maximum health bar code:7e1e50/15 cheat description:999 ZAM code:7e1063/e7+7e1064/03 cartridge sha256:18d40a807d5f88c5b6a1ad849eec7e0f189225d9a1586037c850f6680b5844de name:Demon's Crest (USA) cheat description:Invincibility after one hit code:80dccb/a5 cheat description:Infinite health code:80e599/a5 cheat description:Hit anywhere code:82888c/00+8288a2/00+828b00/80+828b23/80 cheat description:Get GP from anywhere code:82c97e/00 cheat description:Large health refills full health code:82c9ae/a5 cheat description:Rapid fire code:80ef5c/a5 cheat description:Enemies always drop the 20 coin code:82c77d/a5 cheat description:First enemy takes longer to kill code:838a3d/09 cheat description:First enemy take less time to kill code:838a3d/02 cheat description:More flash time code:80e5c3/ff cheat description:Die after one hit code:80de33/85 cheat description:Super-jump code:80e175/08 cheat description:Ginseng costs nothing code:81e6b4/00 cheat description:20 coin worth 999 code:82c9dc/a5 cheat description:1 coin worth 999 code:82c9dd/a5 cheat description:Start a new game with all items code:8488e8/ce+8488eb/ce+8488ee/ce cheat description:Disable anti-cheat (enable to use codes) code:7e0eee/00+7e0eed/00 cheat description:Invincibility code:7e103c/30 cheat description:Infinite health code:7e1062/14 cheat description:Infinite GP code:7e1063/e7+7e1064/03 cheat description:Infinite Hold spells code:7e1e30/02 cheat description:Infinite Death spells code:7e1e31/04 cheat description:Infinite Shock spells code:7e1e32/06 cheat description:Infinite Imp spells code:7e1e33/08 cheat description:Infinite Shadow spells code:7e1e34/0a cheat description:Infinite Herb potions code:7e1e35/0c cheat description:Infinite Ginseng potions code:7e1e36/0e cheat description:Infinite Mercury potions code:7e1e37/10 cheat description:Infinite Sulfer potions code:7e1e38/12 cheat description:Infinite Elixer potions code:7e1e39/14 cheat description:Have all Powers, Crests, Talismen, Jewels, can hold 5 Spells/Potions code:7e1e51/ff+7e1e52/ff+7e1e53/ff cartridge sha256:a362033d0d7e754d79202b255679186ad799b9e784719614b913ec8c9857ae33 name:Dennis the Menace (USA) cheat description:Infinite courage code:809c34/a5+809c3b/a5 cheat description:Infinite time code:87df11/a5 cheat description:Infinite lives code:80a49b/a5 cartridge sha256:606abf536440173ae36466db360c7db6b474beb7a105c8a62bc74a54cbe1c38b name:Desert Strike - Return to the Gulf (USA) cheat description:Infinite ammo code:01e59c/dd cheat description:Infinite fuel code:0187e9/00 cheat description:Infinite lives code:0189bb/2c cheat description:2x fuel consumption code:0187e9/04 cheat description:Faster gun auto-repeat speed code:00e6ae/01 cheat description:Slower gun auto-repeat speed code:00e6ae/18 cheat description:Missiles fly faster code:00e6d2/04 cheat description:Hydras fly faster code:00e6f0/04 cheat description:Guns do as much damage as missiles code:00e6b2/64 cheat description:Hydras do as much damage as missiles code:00e6d0/64 cheat description:Missiles do 250 points of damage code:00e6ee/fa cheat description:AK47's do 1 point of damage code:00e856/01 cheat description:AK47's do 1/2x damage code:00e856/02 cheat description:AK47's do 2x damage code:00e856/0a cheat description:APHIDs do 1 point of damage code:00e7fc/01 cheat description:APHIDs do 1/2x damage code:00e7fc/25 cheat description:APHIDs do 2x damage code:00e7fc/96 cheat description:AAA's do 1 point of damage code:00e70c/01 cheat description:AAA's do 1/2x damage code:00e70c/0a cheat description:AAA's do 2x damage code:00e70c/28 cheat description:Rapiers do 1 point of damage code:00e7a2/01 cheat description:Rapiers do 1/2x damage code:00e7a2/32 cheat description:Rapiers do 2x damage code:00e7a2/c8 cheat description:VDA's do 1 point of damage code:00e72a/01 cheat description:VDA's do 1/2x damage code:00e72a/0c cheat description:VDA's do 2x damage code:00e72a/32 cheat description:ZSU's do 1 point of damage code:00e766/01 cheat description:ZSU's do 1/2x damage code:00e766/14 cheat description:ZSU's do 2x damage code:00e766/50 cheat description:Speedboats do 1 point of damage code:00e81a/01 cheat description:Speedboats do 1/2x damage code:00e81a/19 cheat description:Speedboats do 2x damage code:00e81a/64 cheat description:Choppers do 1 point of damage code:00e838/01 cheat description:Choppers do 1/2x damage code:00e838/32 cheat description:Choppers do 2x damage code:00e838/c8 cheat description:M48's do 1 point of damage code:00e7de/01 cheat description:M48's do 1/2x damage code:00e7de/32 cheat description:M48's do 2x damage code:00e7de/c8 cheat description:Crotales do 1 point of damage code:00e7c0/01 cheat description:Crotales do 1/2x damage code:00e7c0/32 cheat description:Crotales do 2x damage code:00e7c0/c8 cheat description:AK47's have 1 armor point code:00d154/01 cheat description:AK47's have 1/2x armor points code:00d154/05 cheat description:AK47's have 2x armor points code:00d154/14 cheat description:APHIDs have 1 armor points code:00c03e/01 cheat description:APHIDs have 1/2x armor points code:00c03e/0c cheat description:APHIDs have 2x armor points code:00c03e/32 cheat description:AAA's have 1 armor points code:00bfe0/01 cheat description:AAA's have 1/2x armor points code:00bfe0/19 cheat description:AAA's have 2x armor points code:00bfe0/64 cheat description:Rapiers have 1 armor points code:00c2f6/01 cheat description:Rapiers have 1/2x armor points code:00c2f6/25 cheat description:Rapiers have 2x armor points code:00c2f6/96 cheat description:VDA's have 1 armor points code:00c354/01 cheat description:VDA's have 1/2x armor points code:00c354/32 cheat description:VDA's have 2x armor points code:00c354/c8 cheat description:ZSU's have 1 armor points code:00c404/01 cheat description:ZSU's have 1/2x armor points code:00c404/4b cheat description:ZSU's have 2x armor points code:00c404/ff cheat description:Speedboats have 1 armor points code:00c090/01 cheat description:Speedboats have 1/2x armor points code:00c090/4b cheat description:Speedboats have 2x armor points code:00c090/ff cheat description:Choppers have 1 armor points code:00c130/01 cheat description:Choppers have 1/2x armor points code:00c130/4b cheat description:Choppers have 2x armor points code:00c130/ff cheat description:M48's have 1 armor points code:00c24a/01 cheat description:M48's have 1/2x armor points code:00c24a/64 cheat description:M48's have 2x armor points code:00c24b/01 cheat description:Crotales have 1 armor points code:00c1ec/01 cheat description:Crotales have 1/2x armor points code:00c1ec/7d cheat description:Crotales have 2x armor points code:00c1ed/01 cheat description:AK47 bullets fly slower code:00e858/00 cheat description:APHID bullets fly slower code:00e7fe/00 cheat description:AAA bullets fly slower code:00e70e/00 cheat description:Rapier bullets fly slower code:00e7a4/00 cheat description:VDA bullets fly slower code:00e72c/00 cheat description:ZSU bullets fly slower code:00e768/00 cheat description:Speedboat bullets fly slower code:00e81c/00 cheat description:Chopper bullets fly slower code:00e83a/00 cheat description:M48 bullets fly slower code:00e7e0/00 cheat description:Armor starts at 344 code:0196ab/01+018a28/01 cheat description:Armor starts at 856 code:0196ab/03+018a28/03 cheat description:Armor starts at 1,112 code:0196ab/04+018a28/04 cheat description:Armor starts at 2,136 code:0196ab/08+018a28/08 cheat description:Armor starts at 5,208 code:0196ab/14+018a28/14 cheat description:Fuel starts at 25 code:02996c/19 cheat description:Fuel starts at 50 code:02996c/32 cheat description:Fuel starts at 75 code:02996c/4b cheat description:Fuel starts at 150 code:02996c/96 cheat description:Fuel starts at 200 code:02996c/c8 cheat description:Fuel starts at 868 code:02996d/03 cheat description:Guns start at 154 rounds remaining code:00e6b1/00 cheat description:Guns start at 666 rounds remaining code:00e6b1/02 cheat description:Guns start at 2,458 rounds remaining code:00e6b1/09 cheat description:Guns start at 5,018 rounds remaining code:00e6b1/13 cheat description:Guns start at 9,882 rounds remaining code:00e6b1/26 cheat description:Start with 10 hydras code:00e6ce/0a cheat description:Start with 50 hydras code:00e6ce/32 cheat description:Start with 100 hydras code:00e6ce/64 cheat description:Start with 250 hydras code:00e6ce/fa cheat description:Start with 1 missile code:00e6ec/01 cheat description:Start with 20 missiles code:00e6ec/14 cheat description:Start with 50 missiles code:00e6ec/32 cheat description:Start with 100 missiles code:00e6ec/64 cheat description:Start with 250 missiles code:00e6ec/fa cheat description:Start with 1 life code:029966/01 cheat description:Start with 5 lives code:029966/05 cheat description:Start with 7 lives code:029966/07 cheat description:Start with 10 lives code:029966/0a cheat description:Start with 20 lives code:029966/14 cheat description:Start with 50 lives code:029966/32 cheat description:Start with 99 lives code:029966/63 cheat description:Infinite lives (alt) code:7e209e/09 cheat description:Infinite fuel (alt) code:7e2098/64 cheat description:Infinite Load (carry unlimited number of passengers) code:7e209c/01 cheat description:Landing with infinite load (use with Infinite Load code, only when landing, then disable) code:7e209c/ff cheat description:Infinite Chaingun code:7eb0c6/ff cheat description:Infinite Hydras code:7eb0ea/ff cheat description:Infinite Hellfire Missiles code:7eb10e/ff cheat description:Infinite Hellfire Missiles code:7eb132/ff cheat description:Infinite Armor - Level 1 code:7e5d00/ff cheat description:Infinite Armor - Level 2 code:7e5da2/ff cheat description:Infinite Armor - Level 3 code:7e5e44/ff cheat description:Infinite Armor - Level 4 code:7e5d00/ff cheat description:Crotales do little or no damage in level 4 code:00e7c0/01 cartridge sha256:337e643d3e63915de06429992f306e8d2b73aed6849b795f9c855c2d03c18180 name:D-Force (USA) cheat description:Infinite lives code:00a0c8/ea cheat description:Continue equipped with unguided missiles code:0084a9/30+0084aa/da+0084ac/10 cheat description:Loss of a life does not decrease cannon power at normal difficulty (except on continues) code:00a431/00 cheat description:Loss of a life does not decrease cannon power at hard difficulty (except on continues) code:00a448/00 cheat description:Pink power-up increases missile power along with cannon power code:00ea0a/0c cheat description:Continue with 10 lives code:0084bd/36+0084be/a8 cheat description:Continue with 12 lives code:0084bd/ab+0084be/a4 cheat description:Continue with 14 lives code:0084bd/a1+0084be/f1 cheat description:Continue with 16 lives code:0084bd/5f+0084be/a4 cheat description:Continue with cannon power at level 2 code:0084b5/01+0084b2/0f cheat description:Continue with cannon power at level 3 code:0084b5/02+0084b2/0f cheat description:Continue with cannon power at level 4 code:0084b5/03+0084b2/0f cheat description:Continue with cannon power at level 6 code:0084b5/05+0084b2/0f cheat description:Continue with cannon power at level 8 code:0084b5/07+0084b2/0f cheat description:Continue with cannon power at level 10 code:0084b5/09+0084b2/0f cheat description:Continue with cannon power at level 12 code:0084b5/0b+0084b2/0f cheat description:Start with cannon power at level 2 code:009086/01 cheat description:Start with cannon power at level 3 code:009086/02 cheat description:Start with cannon power at level 4 code:009086/03 cheat description:Start with cannon power at level 6 code:009086/05 cheat description:Start with cannon power at level 8 code:009086/07 cheat description:Start with cannon power at level 10 code:009086/09 cheat description:Start with cannon power at level 12 code:009086/0b cheat description:Start equipped with unguided missiles code:00908e/0c+00908b/10 cheat description:Start with 10 lives code:1680bc/36+1680bd/a8 cheat description:Start with 12 lives code:1680bc/ab+1680bd/a4 cheat description:Start with 14 lives code:1680bc/a1+1680bd/f1 cheat description:Start with 16 lives code:1680bc/5f+1680bd/a4 cartridge sha256:7dbfc44d28a46e6d399628e43086aa9fd0b2abeda4c108751a5ad91c102c3aaf name:Dino City (USA) cheat description:Infinite health code:01c68f/b9 cheat description:No harm from most enemies code:01c682/80 cheat description:No harm if swallowed by a monster code:05e79c/ad+05eade/ad cheat description:Infinite plays - both players code:0482f3/ad cheat description:Infinite time (disable in bonus stage) code:058055/bd cheat description:Infinite credits - both players code:048e4c/ad cheat description:Hit and stomp anywhere code:01c6fa/80+01c6fb/15 cheat description:Clock runs faster code:05802b/3c cheat description:Clock runs slower code:05802b/f0 cheat description:Clock runs much slower code:05802b/f0+05802c/01 cheat description:Rex jumps higher code:078c96/fa cheat description:Rex jumps much higher code:078c96/f8 cheat description:Tops jumps higher code:07b8cd/fa cheat description:Tops jumps much higher code:07b8cd/f8 cheat description:Timmy and Jamie jump higher code:07d4d7/fa cheat description:Timmy and Jamie jump much higher code:07d4d7/f8 cheat description:Collect 2 eggs for extra play instead of 50 code:04d233/02 cheat description:Collect 5 eggs for extra play code:04d233/05 cheat description:Collect 10 eggs for extra play code:04d233/10 cheat description:Collect 15 eggs for extra play code:04d233/15 cheat description:Collect 25 eggs for extra play code:04d233/25 cheat description:Collect 75 eggs for extra play code:04d233/75 cheat description:Collect 99 eggs for extra play code:04d233/99 cheat description:1 play per game instead of 3 - both players code:04800e/01 cheat description:2 plays per game - both players code:04800e/02 cheat description:4 plays per game - both players code:04800e/04 cheat description:5 plays per game - both players code:04800e/05 cheat description:7 plays per game - both players code:04800e/07 cheat description:9 plays per game - both players code:04800e/09 cheat description:Start with 1 credit instead of 3 - P1 code:04abd9/01 cheat description:Start with 2 credits - P1 code:04abd9/02 cheat description:Start with 5 credits - P1 code:04abd9/05 cheat description:Start with 7 credits - P1 code:04abd9/07 cheat description:Start with 9 credits - P1 code:04abd9/09 cheat description:Start with No credits - P1 code:04abd9/00 cheat description:Start with 1 credit instead of 3 - P2 code:04ac14/01 cheat description:Start with 2 credits - P2 code:04ac14/02 cheat description:Start with 5 credits - P2 code:04ac14/05 cheat description:Start with 7 credits - P2 code:04ac14/07 cheat description:Start with 9 credits - P2 code:04ac14/09 cheat description:Start with No credits - P2 code:04ac14/00 cheat description:Infinite health - P1 code:7e16ed/03 cartridge sha256:10e07e9e094e77a2b71bab3bac1d79a62b7a7bfdb80111044b1f9c64645c622f name:Donald in Maui Mallard (Europe) cheat description:Infinite health code:7e0dd3/64 cheat description:Infinite lives code:7e1f4a/03 cheat description:Infinite Zapps code:7e0ddb/0a cheat description:Infinite Homers code:7e0ddd/0a cartridge sha256:fa8cacf5bbfc39ee6bbaa557adf89133d60d42f6cf9e1db30d5a36a469f74d15 name:Donkey Kong Country (USA) cheat description:Invincibility (no lockup) code:bfa2a0/60+bfa11b/18+bfa3ac/18 cheat description:Invincibility code:bfa2a0/60 cheat description:Almost invincible (disable if you get stuck) code:bfa2a0/60+bfa2c7/60 cheat description:Infinite lives code:b6a861/ad cheat description:Infinite lives (alt) code:b6a85f/ad+b6a861/ad cheat description:Get Life Balloons from anywhere code:b6a732/80 cheat description:Get KONG letters from anywhere code:bfd694/80 cheat description:Get Banana bunches from anywhere code:bfd74d/80 cheat description:Get Midway Barrel from anywhere code:b6f6ce/80 cheat description:Get most single Bananas from anywhere code:b8bbb1/80+b8bb4f/00+b8bb56/00 cheat description:10 Bananas needed for extra life code:80a362/09+80a36b/0a+80a359/09+80a362/0a cheat description:25 Bananas needed for extra life code:80a362/18+80a36b/19+80a359/18+80a362/19 cheat description:50 Bananas needed for extra life code:80a362/31+80a36b/32+80a359/31+80a362/32 cheat description:75 Bananas needed for extra life code:80a362/4a+80a36b/4b+80a359/4a+80a362/4b cheat description:Easy level exit (press start and select) code:809b50/00 cheat description:Easy level exit (press start and select) (alt) code:809b50/00+809b4b/00 cheat description:Bad buddy code (In 2P team mode, the inactive player can press select to gain control) code:bfb296/00 cheat description:Bad buddy code (In 2P team mode, the inactive player can press select to gain control) (alt) code:bfb296/00+bfb2bd/00 cheat description:Both Kongs return (get both Kongs back on map screen after dying, doesn't work when you fall off the screen) code:bf8f98/03 cheat description:Return of Kong (when your last Kong gets hit, the other one returns (reset if you get stuck). Must have had both Kongs at some point). code:bf8e78/ff cheat description:Keep Animals between stages code:808394/60+b883cb/65 cheat description:Keep Animals between stages (alt) code:808394/03+b883cb/65 cheat description:Keep Animals between stages (alt) code:808394/60+b883cb/65+808392/60+b883ce/68 cheat description:Multi-jump code:bfb32b/80+bfb924/24+bfb929/80+bfb934/d0 cheat description:Multi-jump - Expresso (the Ostrich) code:bfba48/ff cheat description:High-jump - Donkey Kong code:bfb964/c4 cheat description:Super-jump - Donkey Kong code:bfb964/d0 cheat description:Mega-jump - Donkey Kong code:bfb964/e0 cheat description:Moon-jump - Donkey Kong code:bfb964/ff cheat description:High-jump - Diddy Kong code:bfb96c/b4 cheat description:Super-jump - Diddy Kong code:bfb96c/c0 cheat description:Mega-jump - Diddy Kong code:bfb96c/d0 cheat description:Moon-jump - Diddy Kong code:bfb96c/ff cheat description:High-jump - Animals code:bfba14/c4 cheat description:Super-jump - Animals code:bfba14/d0 cheat description:Mega-jump - Animals code:bfba14/e0 cheat description:Moon-jump - Animals code:bfba14/ff cheat description:High-jump - Donkey Kong code:bfb964/c4+bfb98b/c4 cheat description:Super-jump - Donkey Kong code:bfb964/d0+bfb98b/d0 cheat description:Mega-Jump - Donkey Kong code:bfb964/e0+bfb98b/e0 cheat description:High-jump - Diddy Kong code:bfb96c/b4+bfb993/b4 cheat description:Super-jump - Diddy Kong code:bfb96c/c0+bfb993/c0 cheat description:Mega-Jump - Diddy Kong code:bfb96c/d0+bfb993/d0 cheat description:High-jump - all Animals code:bfba14/c4+bfba3b/c4 cheat description:Super-jump - all Animals code:bfba14/d0+bfba3b/d0 cheat description:Mega-jump - all Animals code:bfba14/e0+bfba3b/e4 cheat description:See the ending code:8083b4/a0+b883cb/dd cheat description:Start With 8 lives code:b882b8/07+b882bb/07 cheat description:Start With 11 lives code:b882b8/0a+b882bb/0a cheat description:Start With 16 lives code:b882b8/0f+b882bb/0f cheat description:Start With 26 lives code:b882b8/19+b882bb/19 cheat description:Start With 51 lives code:b882b8/32+b882bb/32 cheat description:Start With 76 lives code:b882b8/4b+b882bb/4b cheat description:Start With 100 lives code:b882b8/63+b882bb/63 cheat description:Start with 255 lives code:b882b8/ff cheat description:Return of Kong (alt) code:7e0579/01 cartridge sha256:df2644d435330192a13768cc1f79c5aa3084a64217a5250c6dd4ffdbe2175be4 name:Donkey Kong Country (USA) (Rev 1) cheat description:Invincibility (no lockup) code:bfa2c7/60+bfa142/18+bfa3d3/18 cheat description:Invincibility code:bfa2c7/60 cheat description:Almost invincible (disable if you get stuck) code:bfa2c7/60 cheat description:Infinite lives code:b6a863/ad cheat description:Get Life Balloons from anywhere code:b6a734/80 cheat description:Get KONG letters from anywhere code:bfd6bd/80 cheat description:Get Banana bunches from anywhere code:bfd776/80 cheat description:Get Midway Barrel from anywhere code:b6f6e2/80 cheat description:Get most single Bananas from anywhere code:b8bb4c/80+b8bbb4/80+b8bb59/00 cheat description:Easy level exit (press start and select) code:809b4b/00 cheat description:Bad buddy code (In 2P team mode, the inactive player can press select to gain control) code:bfb2bd/00 cheat description:Both Kongs return (get both Kongs back on map screen after dying, doesn't work when you fall off the screen) code:bf8fa4/03 cheat description:Return of Kong (when your last Kong gets hit, the other one returns (reset if you get stuck). Must have had both Kongs at some point). code:bf8e84/ff cheat description:Keep Animals code:808392/60+b883ce/68 cheat description:Multi-jump code:bfb352/80+bfb94b/24+bfb950/80+bfb95b/d0 cheat description:Multi-jump - Expresso (the Ostrich) code:bfba6f/ff cheat description:High-jump - Donkey Kong code:bfb98b/c4 cheat description:Super-jump - Donkey Kong code:bfb98b/d0 cheat description:Mega-jump - Donkey Kong code:bfb98b/e0 cheat description:Moon-jump - Donkey Kong code:bfb98b/ff cheat description:High-jump - Diddy Kong code:bfb993/b4 cheat description:Super-jump - Diddy Kong code:bfb993/c0 cheat description:Mega-jump - Diddy Kong code:bfb993/d0 cheat description:Moon-jump - Diddy Kong code:bfb993/ff cheat description:High-jump - Animals code:bfba3b/c4 cheat description:Super-jump - Animals code:bfba3b/d0 cheat description:Mega-jump - Animals code:bfba3b/e4 cheat description:Moon-jump - Animals code:bfba3b/ff cheat description:Land animals roll attack code:bfc2d0/a2 cheat description:Start with 255 lives code:b882bb/ff cheat description:Return of Kong (alt) code:7e0579/01 cartridge sha256:628147468c3539283197f58f03b94df49758a332831857481ea9cc31645f0527 name:Donkey Kong Country (USA) (Rev 2) cheat description:Invincibility (no lockup) code:bfa2db/60+bfa156/18+bfa3e7/18 cheat description:Invincibility code:bfa2db/60 cheat description:Infinite lives code:b6a873/ad cheat description:Get Life Balloons from anywhere code:b6a744/80 cheat description:Get KONG letters from anywhere code:bfd70d/80 cheat description:Get Banana bunches from anywhere code:bfd7c6/80 cheat description:Get Midway Barrel from anywhere code:b6f714/80 cheat description:Get most single Bananas from anywhere code:b8bcdd/80+b8bc75/80+b8bc82/00 cheat description:Easy level exit (press start and select) code:809b5e/00 cheat description:Bad buddy code (In 2P team mode, the inactive player can press select to gain control) code:bfb2df/00 cheat description:Both Kongs return (get both Kongs back on map screen after dying, doesn't work when you fall off the screen) code:bf8fa8/03 cheat description:Return of Kong (when your last Kong gets hit, the other one returns (reset if you get stuck). Must have had both Kongs at some point). code:bf8e88/ff cheat description:Multi-jump code:bfb374/80+bfb96d/24+bfb972/80+bfb97d/d0 cheat description:Multi-jump - Expresso (the Ostrich) code:bfba91/ff cheat description:High-jump - Donkey Kong code:bfb9ad/c4 cheat description:Super-jump - Donkey Kong code:bfb9ad/d0 cheat description:Mega-jump - Donkey Kong code:bfb9ad/e4 cheat description:Moon-jump - Donkey Kong code:bfb9ad/ff cheat description:High-jump - Diddy Kong code:bfb9b5/b4 cheat description:Super-jump - Diddy Kong code:bfb9b5/c0 cheat description:Mega-jump - Diddy Kong code:bfb9b5/d0 cheat description:Moon-jump - Diddy Kong code:bfb9b5/ff cheat description:High-jump - Animals code:bfba5d/c4 cheat description:Super-jump - Animals code:bfba5d/d0 cheat description:Mega-jump - Animals code:bfba5d/e4 cheat description:Moon-jump - Animals code:bfba5d/ff cheat description:Land animals can roll attack code:bfb394/c5 cheat description:Start with 255 lives code:b883eb/ff cheat description:Return of Kong (alt) code:7e0579/01 cartridge sha256:b79c2bb86f6fc76e1fc61c62fc16d51c664c381e58bc2933be643bbc4d8b610c name:Donkey Kong Country 2 - Diddy's Kong Quest (USA) (En,Fr) (Rev 1) cheat description:Master code - Must be entered code:00fffc/f8+bec522/80+bbbe1b/80 cheat description:Invincibility code:b8d1a0/a9+b8d1a1/10+b8d1a2/00 cheat description:Infinite lives code:bec66d/ad+bec678/ad cheat description:Get 2 lives per 100 bananas collected code:bec868/02+bec873/02 cheat description:Get 5 lives per 100 bananas collected code:bec868/05+bec873/05 cheat description:Get 255 lives per 100 bananas collected code:bec868/ff cheat description:When your last Kong is hit, the other returns code:b8a1d1/ff+b8a2a0/ff cheat description:Easy level exit (press start and select) code:808aac/00+808adb/00 cheat description:Kong family coins don't get used up code:b49d5a/ad+b49d68/ad cheat description:Kremcoins don't get used up code:b49d55/ad+b49d63/ad cheat description:Multi-jump code:b89a00/00+b89b05/07+b89bd4/09+b8b1f5/00+b8ba3b/83 cheat description:Mega-jump for Diddy code:ff0049/f0 cheat description:Super-jump - Diddy code:ff0049/f3 cheat description:Jump higher - Diddy code:ff0049/f6 cheat description:Jump lower - Diddy code:ff0049/f9 cheat description:Jump much lower - Diddy code:ff0049/fa cheat description:Mega-jump - Dixie code:ff0133/f0 cheat description:Super-jump - Dixie code:ff0133/f3 cheat description:Jump higher - Dixie code:ff0133/f7 cheat description:Jump lower - Dixie code:ff0133/f9 cheat description:Jump much lower - Dixie code:ff0133/fa cheat description:Mega-jump - Rambi with Diddy riding code:ff0109/f1 cheat description:Super-jump - Rambi with Diddy riding code:ff0109/f3 cheat description:Rambi jumps higher with Diddy riding code:ff0109/f7 cheat description:Rambi doesn't jump as high with Diddy riding code:ff0109/fa cheat description:Start with more kong family coins code:b4800e/8d cheat description:Start with more Kremcoins code:b4800b/8d cheat description:Start with 3 lives code:808f72/02+808fa1/02 cheat description:Start with 10 lives code:808f72/09+808fa1/09 cheat description:Start with 25 lives code:808f72/18+808fa1/18 cheat description:Start with 50 lives code:808f72/31+808fa1/31 cheat description:Start with 99 lives code:808f72/63+808fa1/63 cheat description:Start with 255 lives code:808f72/ff cartridge sha256:35421a9af9dd011b40b91f792192af9f99c93201d8d394026bdfb42cbf2d8633 name:Donkey Kong Country 2 - Diddy's Kong Quest (USA) (En,Fr) cheat description:Master code - Must be entered code:00fffc/f8+bec517/80+bbbe0b/80 cheat description:Invincibility code:b8d0b8/24 cheat description:Infinite lives code:bec66d/ad+bec678/ad cheat description:When your last Kong is hit, the other returns code:b8a1d1/ff+b8a2a0/ff cheat description:Easy level exit (press start and select) code:808aac/00+808adb/00 cheat description:Kong family coins don't get used up code:b49d5a/ad+b49d68/ad cheat description:Kremcoins don't get used up code:b49d55/ad+b49d63/ad cheat description:Get single Bananas from almost anywhere code:b5f7a8/80+b5f808/80+b5f7b6/00 cheat description:Get Banana bunches from anywhere code:b3c33b/80 cheat description:Get DK and Banana Coins from anywhere code:beb877/80 cheat description:Get KONG letters from anywhere code:bebaba/80 cheat description:Get Krem Koins from anywhere code:beb9e5/80 cheat description:Get Life balloons from anywhere code:b3c3fa/80 cheat description:Get Midway Barrel from anywhere code:b3e4c7/80 cheat description:Get 2 lives per 100 bananas collected code:bec868/02+bec873/02 cheat description:Get 5 lives per 100 bananas collected code:bec868/05+bec873/05 cheat description:Get 255 lives per 100 bananas collected code:bec868/ff cheat description:Multi-jump code:b8c515/20+b8c516/72+b8c517/c4+b8c518/60 cheat description:Mega-jump for Diddy code:ff0049/f0 cheat description:Super-jump - Diddy code:ff0049/f3 cheat description:Jump higher - Diddy code:ff0049/f6 cheat description:Jump lower - Diddy code:ff0049/f9 cheat description:Jump much lower - Diddy code:ff0049/fa cheat description:Mega-jump - Dixie code:ff0133/f0 cheat description:Super-jump - Dixie code:ff0133/f3 cheat description:Jump higher - Dixie code:ff0133/f7 cheat description:Jump lower - Dixie code:ff0133/f9 cheat description:Jump much lower - Dixie code:ff0133/fa cheat description:Mega-jump - Rambi with Diddy riding code:ff0109/f1 cheat description:Super-jump - Rambi with Diddy riding code:ff0109/f3 cheat description:Rambi jumps higher with Diddy riding code:ff0109/f7 cheat description:Rambi doesn't jump as high with Diddy riding code:ff0109/fa cheat description:Start with more kong family coins code:b4800e/8d cheat description:Start with more Kremcoins code:b4800b/8d cheat description:Start with 3 lives code:808f72/02+808fa1/02 cheat description:Start with 10 lives code:808f72/09+808fa1/09 cheat description:Start with 25 lives code:808f72/18+808fa1/18 cheat description:Start with 50 lives code:808f72/31+808fa1/31 cheat description:Start with 99 lives code:808f72/63+808fa1/63 cheat description:Start with 255 lives code:808f72/ff cartridge sha256:2277a2d8dddb01fe5cb0ae9a0fa225d42b3a11adccaeafa18e3c339b3794a32b name:Donkey Kong Country 3 - Dixie Kong's Double Trouble! (USA) (En,Fr) cheat description:Invincibility code:b882b8/93 cheat description:Invincibility (alt) code:b8c64e/a9+b8c64f/09+b8c650/00 cheat description:Infinite lives code:f880fa/a9 cheat description:Infinite bear coins code:f490b5/09 cheat description:Get Funky's Gyrocopter with no need for DK coins code:f484ac/80+f484d7/80 cheat description:Get Single Bananas from almost anywhere code:b7eba8/80+b7ec08/80+b7ebb6/00 cheat description:Get Banana Bunches from anywhere code:bbd028/80 cheat description:Get Bear Coins from anywhere code:bbd25a/80 cheat description:Get KONG letters from anywhere code:bbcd17/80 cheat description:Get Midway Barrel from anywhere code:bedc4a/80 cheat description:Get Bonus Coins from anywhere code:bbd2fd/80 cheat description:Get Life Balloons from anywhere code:bbd1d2/80 cheat description:Get DK Coins from anywhere code:b6a74a/00 cheat description:Multi-jump code:b8d79d/20+b8d79e/71+b8d79f/90+b8d7a0/60 cartridge sha256:d45e26eb10c323ecd480e5f2326b223e29264c3adde67f48f0d2791128e519e8 name:Doom (USA) cheat description:Infinite health code:5c01fd/8f+5c01fe/ae+5c01ff/5a+5c0200/70+5c0201/80 cheat description:Start with mega health and mega armor code:5ffac1/90+5ffac5/8d cheat description:Start with more ammo code:5ffac9/fe cheat description:Heat vision/color blind mode code:5c06e8/a9 cheat description:Select "The Shores of Hell" or "Inferno" in any skill level code:5fa815/03 cartridge sha256:8d4ada4f98464d176ae7f0fb8a20032056680f3241637a0f903f23f31f41ff36 name:Doom Troopers - Mutant Chronicles (USA) cheat description:Invincibility code:7e0c99/01 cheat description:Infinite health code:7e0c31/64 cheat description:Infinite lives code:7e0cb3/03+7e0102/03 cheat description:Infinite ammo code:7e00e6/63 cheat description:Infinite special weapon ammo code:7e00ea/0a cheat description:Die to complete level (don't use with infinite lives code) code:7e0102/01 cartridge sha256:bb915b286b33842e39e9022366169233a4041515c7ecc60ac428420b28e48dd5 name:Doomsday Warrior (USA) cheat description:Infinite health and matches last forever code:00a53a/bd cheat description:Always get 4 bonus points for improving abilities code:0093d0/a9+0093d1/04+0093da/80 cheat description:On normal level, start with all stats at 2 bars instead of 0 code:009258/05 cheat description:First 6 fights are against Sledge code:009343/00+009344/80+009345/f5 cheat description:First 6 fights are against Layban code:009343/01+009344/80+009345/f5 cheat description:First 6 fights are against Amon code:009343/02+009344/80+009345/f5 cheat description:First 6 fights are against Daisy code:009343/03+009344/80+009345/f5 cheat description:First 6 fights are against P-Lump code:009343/04+009344/80+009345/f5 cheat description:First 6 fights are against Grimrock code:009343/05+009344/80+009345/f5 cheat description:First 6 fights are against Nuform code:009343/06+009344/80+009345/f5 cheat description:First 7 fights are against Shadow code:009343/07+009344/80+009345/f5 cheat description:First 6 fights are against Ashura code:009343/08+009344/80+009345/f5 cheat description:First 6 fights are against Main code:009343/09+009344/80+009345/f5 cheat description:All fights are in order (you don't choose your opponent) code:009337/00 cheat description:You can heal completely, not just to the top of each segment code:00b4eb/00 cheat description:Don't heal at all code:00b4f3/ea cheat description:Infinite health - P1 code:7e02c6/64 cheat description:Infinite health - P2 code:7e03c6/64 cheat description:No health - P1 code:7e02c6/00 cheat description:No health - P2 code:7e03c6/00 cartridge sha256:b32aa9cbf8f6baacc84f6418fa6fbc33b9ce71458fecc91275aafdbf6f743a99 name:Double Dragon V - The Shadow Falls (USA) cheat description:Always win - P1 code:83cf93/00 cheat description:Can't perform special moves - P2/CPU code:84a6b6/9e+84a682/9e+84a756/9c cheat description:Pick up to 9 points of any attribute instead of 5 code:849da7/09 cheat description:Harder to recover from dizziness code:80be75/ea cheat description:Dizziness doesn't last long code:80be79/08 cheat description:Start with 50% health - both characters code:80a389/28 cheat description:Start with 25% health - both characters code:80a389/14 cheat description:Infinite health - P1 code:7e1b8d/50 cheat description:Infinite health - P2 code:7e1c8a/50 cheat description:No health - P1 code:7e1b8d/00 cheat description:No health - P2 code:7e1c8a/00 cheat description:Bosses unlocked cheat enabled code:7f0068/01 cheat description:Stuns disabled cheat enabled code:7f006a/01 cheat description:Throwing disabled cheat enabled code:7f006c/01 cheat description:P1 is Billy Lee code:7e0632/00 cheat description:P1 is Jimmy Lee code:7e0632/01 cheat description:P1 is Jawbreaker code:7e0632/02 cheat description:P1 is Icepick code:7e0632/03 cheat description:P1 is S Master code:7e0632/04 cheat description:P1 is Bones code:7e0632/05 cheat description:P1 is Sickle code:7e0632/06 cheat description:P1 is Blade code:7e0632/07 cheat description:P1 is T Happy code:7e0632/08 cheat description:P1 is Countdown code:7e0632/09 cheat description:P1 is Dominique code:7e0632/0a cheat description:P1 is Sekka code:7e0632/0b cheat description:P2 is Billy Lee code:7e0633/00 cheat description:P2 is Jimmy Lee code:7e0633/01 cheat description:P2 is Jawbreaker code:7e0633/02 cheat description:P2 is Icepick code:7e0633/03 cheat description:P2 is S Master code:7e0633/04 cheat description:P2 is Bones code:7e0633/05 cheat description:P2 is Sickle code:7e0633/06 cheat description:P2 is Blade code:7e0633/07 cheat description:P2 is T Happy code:7e0633/08 cheat description:P2 is Countdown code:7e0633/09 cheat description:P2 is Dominique code:7e0633/0a cheat description:P2 is Sekka code:7e0633/0b cartridge sha256:d98d7da1e7636e067563e2e480d7dfbc013b7e9bdf1329fd61c5cacac0293e1d name:Dragon - The Bruce Lee Story (USA) cheat description:Infinite health (disable before stage ends) code:7e00d9/ff cheat description:Infinite fighting power code:7e00db/ff cheat description:0 HP - Enemy 1 code:7e01d9/00 cheat description:0 HP - Enemy 2 code:7e02d9/00 cheat description:Infinite time (turn on only in a timed fight and off after defeating your opponent) code:7e2082/63 cheat description:Hyper Mode - P1 code:7e003e/01 cheat description:Hyper Mode - P2/Enemy 1 code:7e013e/01 cheat description:Hyper Mode - P3/Enemy 2 code:7e023e/01 cheat description:P1 Knocks Out Easier code:7e0093/02 cheat description:P2 Knocks Out Easier code:7e0193/02 cheat description:P3 Knocks Out Easier code:7e0293/02 cheat description:P1 Can't Be Hit code:7e0095/44 cheat description:P2 Can't Be Hit code:7e0195/44 cheat description:P3 Can't Be Hit code:7e0295/44 cheat description:Start in Alley outside kitchen (version 2) code:7e539e/01 cheat description:Start in Alley outside kitchen code:7e539e/02 cheat description:Start in the Seattle Gym code:7e539e/03 cheat description:Start in the George Wu Gym code:7e539e/04 cheat description:Start in Film Set code:7e539e/05 cheat description:Start in Bruce's Kwoon code:7e539e/06 cheat description:Start in Virgin Gym code:7e539e/07 cheat description:Start in the Big Boss Film set (version 2) code:7e539e/08 cheat description:Start in the Big Boss Film set code:7e539e/09 cheat description:Start in the Enter The Dragon set code:7e539e/0a cheat description:Start in the Armored Boss Arena code:7e539e/0b cheat description:Start in the Machine code:7e539e/0c cartridge sha256:32226fb8b126261dfec279aea51b2fe01e0c7bfbf26699ddcceb750a0d3a9fc0 name:Dragon Ball Z - Hyper Dimension (Japan) cheat description:One hit kills code:00c591/a9+00c592/01+00c593/00+00c59b/8d+00c59c/60 cartridge sha256:b698dd6e1db1a3fb2026dbc78c2cfbfd834f7c64fccb76139d5075c8b5233f28 name:Dragon Quest I & II (Japan) cheat description:DQ I & II - Infinite MP in battle code:0baa44/bd cheat description:DQ I & II - Infinite MP ouside battle code:00cc80/b9 cheat description:DQ I & II - Keep gold after deposit in the vault code:00f044/22 cheat description:DQ I & II - Take no damage from poison swamps code:1b8935/ea cheat description:DQ I & II - Take no damage from barriers code:1b897a/bd cheat description:DQ I & II - Take no damage from monster hits or magic code:0b8fc0/60 cheat description:DQ I & II - Take no damage from monster fire code:0b9880/80+0b9881/0a cheat description:DQ I & II - Inns don't take your money code:00f4e6/ad cheat description:DQ I & II - All equipment in shops is free code:00c78f/80 cheat description:DQ I - Infinite medical herbs code:09836e/ad cheat description:DQ I - Key shops don't take your money code:00ca40/ad cheat description:DQ I - Fairy water shops don't take your money code:00c9f7/ad cartridge sha256:a3b1cae3fe55fe52c035ab122e7f850640b0935524496d45b1915ca3c8a934f4 name:Dragon View (USA) cheat description:Infinite health (may crash at the end of Ortah Temple if using an emulator) code:9e807e/af cheat description:Infinite Jade code:92e329/af cheat description:Infinite Bombs code:7e0e23/a2 cheat description:Infinite Potions code:93d88b/af cheat description:Infinite magic for rings code:9ae039/ad cheat description:Max level after killing a Demon code:80ed26/3b cheat description:Sell a fruit to get 254 fruit code:92e536/80+92e623/37 cheat description:Infinite HP code:7e6fca/b8 cheat description:Max HP code:7e6fcb/be+7e6fcb/be cheat description:Max EXP code:7e7095/e7+7e7096/03 cheat description:Max money (Jade) code:7e2131/0f+7e2132/27 cheat description:Max attack power code:7e98e9/ff cheat description:Max defense power code:7e98ea/ff cartridge sha256:49a1f9f5e6084b3daa1b13ab5a37ebe8bd3cf20e1c7429fbf722298092893e81 name:Dragon's Lair (USA) cheat description:Infinite health code:00b9a7/ea cheat description:Infinite time code:00ba28/2c cheat description:Infinite lives code:0084dd/ea cheat description:Start with 1 life code:00b959/00 cheat description:Start with 6 lives code:00b959/05 cheat description:Start with 9 lives code:00b959/08 cheat description:Start with the Dagger code:00b980/01 cheat description:Start with the Shuriken code:00b980/02 cheat description:Slow timer code:00ba51/70 cheat description:Faster timer code:00ba51/25 cheat description:1 coin gives 10 code:00b9b6/01 cheat description:Infinite health (alt) code:7e1036/04 cheat description:Infinite time (alt) code:7e1033/09 cheat description:Infinite lives (alt) code:7e1028/03 cheat description:Infinite Gold code:7e1030/09 cartridge sha256:74910ce01d19d25cb97a243a51f21c3d522f02fb116682f60440da3292bb14f7 name:Drakkhen (USA) cheat description:Protection from some attacks code:10e206/bf+02ef49/bf+1bc9d9/bf cheat description:Magic points restored 50 points at a time while player is on screen code:02eee4/32 cheat description:Magic points restored 10 points at a time while player is on screen code:02eee4/0a cheat description:Magic points don't decrease except in battle code:06de33/bf cartridge sha256:1a79d51a2ad7dd4848205a07ff8e5d873b155dc420de5e52158c9bab935e05c3 name:Dream T.V. (USA) cheat description:Almost infinite health code:82cf83/b1+82cfc7/b1 cheat description:Infinite lives code:82aafc/00 cheat description:One hit kills, except skeletons code:82dfee/b1 cheat description:Mega-jump (disable to land again) code:82bd2c/b1 cheat description:Can't get hit - some characters are white code:82ad30/00 cheat description:Start with 5 lives code:8099b5/05 cheat description:Start with 1 life code:8099b5/01 cheat description:Start with 8 lives code:8099b5/08 cheat description:Start with 2/3 health - 1st life code:809a05/20 cheat description:Start with 2/3 health - after 1st life code:82aaf1/20 cheat description:Start with 1/3 health - 1st life code:809a05/10 cheat description:Start with 1/3 health - after 1st life code:82aaf1/10 cartridge sha256:c509e957873d6cff232bc360ae1795ea74e86bf4fa09c686f6cfc83bd8bac3d7 name:Dual Orb II (Japan) cheat description:Gain 65,535 EXP from each battle code:c41635/af+c41638/cb cheat description:Sell one item for maximum money code:c02a14/00 cheat description:Can skip barrel puzzle code:c220f4/72 cheat description:No random battles code:c2309c/80 cheat description:Enemies start with 10 HP code:c0d1a9/af+c0d1aa/39 cheat description:Enemies start with 100 HP code:c0d1a9/af cartridge sha256:2dfc2e037679a62a960dab9682bca6d1b2737f603edd336c8b2fdf05db10cc07 name:Dungeon Master (USA) cheat description:Almost no mana loss (must have enough to cast) code:01957c/b7 cheat description:Food meter doesn't go down code:05a517/b7 cheat description:Water meter doesn't go down code:05a576/b7 cheat description:1st character has 250 maximum hit points code:7004a6/fa cheat description:2nd character has 250 maximum hit points code:7007c5/fa cheat description:3rd character has 250 maximum hit points code:700ae4/fa cheat description:4th character has 250 maximum hit points code:700e03/fa cheat description:1st character has 250 maximum stamina code:7004aa/c4+7004ab/09 cheat description:2nd character has 250 maximum stamina code:7007c9/c4+7007ca/09 cheat description:3rd character has 250 maximum stamina code:700ae8/c4+700ae9/09 cheat description:4th character has 250 maximum stamina code:700e07/c4+700e08/09 cheat description:1st character has 250 maximum mana code:7004ae/fa cheat description:2nd character has 250 maximum mana code:7007cd/fa cheat description:3rd character has 250 maximum mana code:700aec/fa cheat description:4th character has 250 maximum mana code:700e0b/fa cheat description:1st character has 99 current strength code:7004ba/63 cheat description:2nd character has 99 current strength code:7007d9/63 cheat description:3rd character has 99 current strength code:700af8/63 cheat description:4th character has 99 current strength code:700e17/63 cheat description:1st character has 99 maximum strength code:7004b9/63 cheat description:2nd character has 99 maximum strength code:7007d8/63 cheat description:3rd character has 99 maximum strength code:700af7/63 cheat description:4th character has 99 maximum strength code:700e16/63 cheat description:1st character has 99 current dexterity code:7004bd/63 cheat description:2nd character has 99 current dexterity code:7007dc/63 cheat description:3rd character has 99 current dexterity code:700afb/63 cheat description:4th character has 99 current dexterity code:700e1a/63 cheat description:1st character has 99 maximum dexterity code:7004bc/63 cheat description:2nd character has 99 maximum dexterity code:7007db/63 cheat description:3rd character has 99 maximum dexterity code:700afa/63 cheat description:4th character has 99 maximum dexterity code:700e19/63 cheat description:1st character has 99 current wisdom code:7004c0/63 cheat description:2nd character has 99 current wisdom code:7007df/63 cheat description:3rd character has 99 current wisdom code:700afe/63 cheat description:4th character has 99 current wisdom code:700e1d/63 cheat description:1st character has 99 maximum wisdom code:7004bf/63 cheat description:2nd character has 99 maximum wisdom code:7007de/63 cheat description:3rd character has 99 maximum wisdom code:700afd/63 cheat description:4th character has 99 maximum wisdom code:700e1c/63 cheat description:1st character has 99 current vitality code:7004c3/63 cheat description:2nd character has 99 current vitality code:7007e2/63 cheat description:3rd character has 99 current vitality code:700b01/63 cheat description:4th character has 99 current vitality code:700e20/63 cheat description:1st character has 99 maximum vitality code:7004c2/63 cheat description:2nd character has 99 maximum vitality code:7007e1/63 cheat description:3rd character has 99 maximum vitality code:700b00/63 cheat description:4th character has 99 maximum vitality code:700e1f/63 cheat description:1st character has 99 current anti-magic code:7004c6/63 cheat description:2nd character has 99 current anti-magic code:7007e5/63 cheat description:3rd character has 99 current anti-magic code:700b04/63 cheat description:4th character has 99 current anti-magic code:700e23/63 cheat description:1st character has 99 maximum anti-magic code:7004c5/63 cheat description:2nd character has 99 maximum anti-magic code:7007e4/63 cheat description:3rd character has 99 maximum anti-magic code:700b03/63 cheat description:4th character has 99 maximum anti-magic code:700e22/63 cheat description:1st character has 99 current anti-fire code:7004c9/63 cheat description:2nd character has 99 current anti-fire code:7007e8/63 cheat description:3rd character has 99 current anti-fire code:700b07/63 cheat description:4th character has 99 current anti-fire code:700e26/63 cheat description:1st character has 99 maximum anti-fire code:7004c8/63 cheat description:2nd character has 99 maximum anti-fire code:7007e7/63 cheat description:3rd character has 99 maximum anti-fire code:700b06/63 cheat description:4th character has 99 maximum anti-fire code:700e25/63 cheat description:1st character is a level 15 fighter code:7004cf/7f cheat description:1st character is a level 15 ninja code:7004d5/7f cheat description:1st character is a level 15 healer code:7004db/7f cheat description:1st character is a level 15 wizard code:7004e1/7f cheat description:2nd character is a level 15 fighter code:7007ee/7f cheat description:2nd character is a level 15 ninja code:7007f4/7f cheat description:2nd character is a level 15 healer code:7007fa/7f cheat description:2nd character is a level 15 wizard code:700800/7f cheat description:3rd character is a level 15 fighter code:700b0d/7f cheat description:3rd character is a level 15 ninja code:700b13/7f cheat description:3rd character is a level 15 healer code:700b19/7f cheat description:3rd character is a level 15 wizard code:700b1f/7f cheat description:4th character is a level 15 fighter code:700e2c/7f cheat description:4th character is a level 15 ninja code:700e32/7f cheat description:4th character is a level 15 healer code:700e38/7f cheat description:4th character is a level 15 wizard code:700e3e/7f cheat description:1st character has a nearly full food meter code:7004b3/07 cheat description:1st character has a nearly full water meter code:7004b5/07 cheat description:2nd character has a nearly full food meter code:7007d2/07 cheat description:2nd character has a nearly full water meter code:7007d4/07 cheat description:3rd character has a nearly full food meter code:700af1/07 cheat description:3rd character has a nearly full water meter code:700af3/07 cheat description:4th character has a nearly full food meter code:700e10/07 cheat description:4th character has a nearly full water meter code:700e12/07 cartridge sha256:8481e47381bd98c27b9782b5727a5d5f0976fbb3aa3df25c2c42aa37e0586815 name:E.V.O. - Search for Eden (USA) cheat description:Invincibility code:06858f/60 cheat description:Infinite EVO points code:00d637/80 cheat description:Infinite EP code:7e00d2/10+7e00d3/27 cheat description:Protection from most hazards code:0685fc/a5 cheat description:Food replenishes hit points to full code:1e844a/00 cheat description:Less damage from stronger creatures code:068f8c/07 cheat description:Horn never breaks code:06832f/a5 cheat description:Collect one health to max it out code:1e8464/00 cheat description:One-hit kills code:0787a4/00 cartridge sha256:0408e3d9f2259044344a3bfbd7a7ca3c3427f82108fbecd6e5c4c41e80cd303b name:Earth Defense Force (USA) cheat description:Invincibility code:0086ce/24 cheat description:Infinite shields code:0086e7/ad cheat description:Infinite credits code:058bb9/ad cheat description:Continually hit anywhere code:138124/24+0086ce/24+138108/24+1380fa/24+138116/24 cheat description:Advancing experience levels is easier code:00d665/20 cheat description:Advancing experience levels is much easier code:00d665/0c cheat description:Keep current score when game is continued code:00dfe4/ad+00dfe7/ad cheat description:1 credit code:00dff6/00+00dff5/a9+00dff7/00 cheat description:2 credits code:00dff6/01+00dff5/a9+00dff7/00 cheat description:3 credits code:00dff6/02+00dff5/a9+00dff7/00 cheat description:6 credits code:00dff6/05+00dff5/a9+00dff7/00 cheat description:8 credits code:00dff6/07+00dff5/a9+00dff7/00 cheat description:10 credits code:00dff6/09+00dff5/a9+00dff7/00 cheat description:Start with 4 shields code:00dfeb/36+00dfec/e0 cheat description:Start with 5 shields code:00dfeb/d9+00dfec/9b cheat description:Start at experience level 2 code:00dfff/02 cheat description:Start at experience level 3 code:00dfff/03 cheat description:Start at experience level 4 code:00dfff/04 cheat description:Start at experience level 5 code:00dfff/05 cheat description:Start at stage 2 code:00e030/01+00e02f/a9+00e031/00 cheat description:Start at stage 3 code:00e030/02+00e02f/a9+00e031/00 cheat description:Start at stage 4 code:00e030/03+00e02f/a9+00e031/00 cheat description:Start at stage 5 code:00e030/04+00e02f/a9+00e031/00 cheat description:Start at stage 6 code:00e030/05+00e02f/a9+00e031/00 cheat description:Start a new game to view ending code:008235/08 cartridge sha256:a8fe2226728002786d68c27ddddf0b90a894db52e4dfe268fdf72a68cae5f02e name:EarthBound (USA) cheat description:Infinite health (all characters) code:c2716c/bd cheat description:Get to level 99 after one battle (all characters) code:c1d9fb/ff cheat description:Fast money (buy a bread with the code disabled, enable and sell it for $32,646) code:d55fcc/ff cheat description:Dad never calls code:c0527c/fe cheat description:Massive numbers of enemies (piracy check) code:c0281d/80 cheat description:Start with a level 9 character code:c1d8ec/09 cheat description:Start with a level 15 character code:c1d8ec/0f cheat description:Start with a level 50 character code:c1d8ec/32 cheat description:Start with a level 100 character code:c1d8ec/63 cheat description:Start with a level 255 character code:c1d8ec/ff cheat description:Start with a super strong character code:c1d8f1/ff cheat description:Start with a lot of HP code:c1d90a/99 cheat description:Start with a lot of PSI code:c1d91b/99 cheat description:Infinite health code:7e9a13/e7+7e9a14/03 cheat description:9999 current PP code:7e9a1b/0f+7e9a1c/27 cartridge sha256:4579e437279f79eedd6b9cf648a814df2ab2c83d937a1bcec1578d28965fb9a0 name:Earthworm Jim (USA) cheat description:Infinite health code:c0681a/cd cheat description:Infinite Ammo code:c06777/dd cheat description:Infinite lives code:c00ecf/cd cheat description:Hit anywhere (Gun) code:c0406e/80+c188e9/80+c0406f/15 cheat description:Die after one hit code:c06836/30 cheat description:Start with 1 life code:c066e4/30 cheat description:Start with 5 lives code:c066e4/34 cheat description:Start with 10 lives code:c066e4/39 cheat description:Start with 25 lives code:c066e4/48 cheat description:Start with 50 lives code:c066e4/61 cheat description:Start with 300% health code:c06836/33 cheat description:Start with 500% health code:c06836/35 cheat description:Start with 900% health code:c06836/39 cheat description:Invincibility against enemies code:7e682a/3d cheat description:Infinite health (alt) code:7e6627/39 cheat description:Infinite shields code:7e6b48/63 cheat description:Super shot always active code:7e661c/ff+7e69a0/09 cheat description:Infinite time in Sub code:7e6752/63 cheat description:Always win race in Andy Asteroids stages (glitchy graphics) code:7e6b46/ff cheat description:Start on What The Heck? code:7e512a/01 cheat description:Start on What The Heck? (Snowman Boss) code:7e512a/02 cheat description:Start on What The Heck? (Boss Fight With Evil The Cat) code:7e512a/03 cheat description:Start on Snot A Problem Round 1 code:7e512a/04 cheat description:Start on Snot A Problem Round 2 code:7e512a/05 cheat description:Start on Snot A Problem Round 3 code:7e512a/06 cheat description:Start on For Pete's Sake code:7e512a/07 cheat description:Start on Buttville, Part 2 code:7e512a/08 cheat description:Start on Buttville, Part 1 code:7e512a/09 cheat description:Start on Level 5, Part 1 code:7e512a/0a cheat description:Start on Level 5 (Chicken Boss) code:7e512a/0b cheat description:Start on Level 5, Part 2 code:7e512a/0c cheat description:Start on Down The Tubes code:7e512a/0d cheat description:Start on Tube Race code:7e512a/0e cheat description:Start on Andy Asteroids?, Course 1 code:7e512a/0f cheat description:Start on Andy Asteroids?, Course 2 code:7e512a/10 cheat description:Start on Andy Asteroids?, Course 3 code:7e512a/11 cheat description:Start on Andy Asteroids?, Course 4 code:7e512a/12 cheat description:Start on Andy Asteroids?, Course 5 code:7e512a/13 cheat description:Start on Andy Asteroids?, Course 6 code:7e512a/14 cheat description:Start on Who Turned Out The Light?, Part 1 code:7e512a/15 cheat description:Start on Who Turned Out The Light?, Part 2 code:7e512a/16 cheat description:Start on Who Turned Out The Light?, Part 3 code:7e512a/17 cheat description:Start on Who Turned Out The Light?, Part 4 code:7e512a/18 cheat description:Start on Who Turned Out The Light?, Part 5 code:7e512a/19 cheat description:Start on Psycrow code:7e512a/1a cartridge sha256:10eadaab168707829418702386e1bcedd2619d9bbefc37cf31c4118313bcf6de name:Earthworm Jim 2 (USA) cheat description:Infinite health code:c27431/a9 cheat description:Infinite lives code:c0184a/a9 cheat description:Hit anywhere (Gun) code:c27fa5/80+c27fa6/15 cheat description:Infinite time - Lorenzen's Soil level code:c21ac1/ad cheat description:Get 1000 bullets on pick-up code:c45cb8/03+c45cb7/e9 cheat description:Get 2000 bullets on pick-up code:c45cb8/07+c45cb7/e0 cheat description:Start with 200% health code:c2744d/32 cheat description:Start with 300% health code:c2744d/33 cheat description:Start with 400% health code:c2744d/34 cheat description:Start with 500% health code:c2744d/35 cheat description:Start with 700% health code:c2744d/37 cheat description:Start with 900% health code:c2744d/39 cheat description:Start with 1 life and no continues code:c27175/30 cheat description:Start with 5 lives code:c27175/34 cheat description:Start with 7 lives code:c27175/36 cheat description:Start with 9 lives code:c27175/38 cheat description:Start with 2000 bullets code:c459fa/32 cheat description:Start with 3000 bullets code:c459fa/33 cheat description:Start with 4000 bullets code:c459fa/34 cheat description:Start with 5000 bullets code:c459fa/35 cheat description:Start with 7000 bullets code:c459fa/37 cheat description:Start with 9000 bullets code:c459fa/39 cheat description:Invincibility code:7e653c/10 cartridge sha256:5d658b63d35e2e0baf48ae3bb04ea5e1553855b34bb39fc2c7ca41fbd3894d52 name:Eek! The Cat (USA) cheat description:Infinite health code:7e004e/bf cheat description:Infinite lives code:7e1fe5/09 cartridge sha256:a6eec3329d956e1ddc4acfe3c738387622c10fc95fb9ab63dd5f45be8bec0b16 name:Emerald Dragon (Japan) cheat description:Max level after one battle code:c00fcd/80 cheat description:Max Parus after one battle code:c00f88/80 cheat description:No random battles code:c1a14c/18 cartridge sha256:f14e30ee452ec930a6d08094094b287d0c40c8108f2017c418015242987649b3 name:Emmitt Smith Football (USA) cheat description:Cannot be tackled (hold B) code:80c919/ef+80c916/55+80c915/ad+80c917/01 cartridge sha256:cfd666f0bbabec59613d9fe189db7d0a060a78047bc084c0c365840769047bf2 name:Equinox (USA) cheat description:Invincibility against most small monsters code:08b314/ad cheat description:Infinite life code:08cd42/ea cheat description:Infinite magic (must have enough MP for spell to work) code:08cdf1/af cheat description:More life from Apples code:81d6c8/a9 cheat description:Super-jump code:81d135/21+81d144/24 cheat description:Mega-jump code:81d135/1a+81d144/24 cheat description:Super speed code:81d0a7/9e+81d0ad/a0 cheat description:Colored doors don't need keys code:08b68c/00+08b68d/ea cheat description:Walk through objects (hold L) code:08b27c/d0+08b27a/20+08b277/29+08b276/ad+08b26c/0c cheat description:Slow spell lasts 2x as long code:08ceab/05 cheat description:Slow spell lasts 3x as long code:08ceab/08 cheat description:Freeze spell lasts 2x as long code:08ce96/05 cheat description:Freeze spell lasts 3x as long code:08ce96/08 cartridge sha256:1576066e0cb771a91caf79e7d4f6dc00eb0daa47f0786f1604b32537429a7f45 name:Extra Innings (USA) cheat description:Game lasts 1 inning code:0093f3/01+009416/01+009524/01 cheat description:Game lasts 2 innings code:0093f3/02+009416/02+009524/02 cheat description:Game lasts 3 innings code:0093f3/03+009416/03+009524/03 cheat description:Game lasts 4 innings code:0093f3/04+009416/04+009524/04 cheat description:Game lasts 5 innings code:0093f3/05+009416/05+009524/05 cheat description:Game lasts 7 innings code:0093f3/07+009416/07+009524/07 cheat description:1 strike and batter's out code:008c35/01+008f48/00 cheat description:2 strikes and batter's out code:008c35/02+008f48/01 cheat description:Batter never strikes out code:008c2e/ad+008f4b/ad cheat description:1 ball and batter walks code:008cc7/01 cheat description:2 balls and batter walks code:008cc7/02 cheat description:3 balls and batter walks code:008cc7/03 cheat description:Batter never walks code:008cc0/ad cheat description:1 out per inning code:008f32/01+008c6b/01 cheat description:2 outs per inning code:008f32/02+008c6b/02 cartridge sha256:1d38e3af9e3a6409e93f4705b68c42558f558c68f3e83ef2a40e46cf560b26cc name:F-1 ROC - Race of Champions (USA) cheat description:No damage when hitting walls code:00c1bc/a5 cheat description:No damage when hitting other cars code:00d1d4/a5 cheat description:Normal tires are free code:05faf7/00 cheat description:Hi-grip tires are free code:05faf9/00 cheat description:Rain tires are free code:05faf5/00 cheat description:2L nitro is free code:05fb09/00 cheat description:3L nitro is free code:05fb0b/00 cheat description:4L nitro is free code:05fb0d/00 cheat description:Ford V-8 engine is free code:05faff/00+05fb00/00 cheat description:Ilmoa V-8 engine is free code:05fb01/00+05fb02/00 cheat description:Remart V-10 engine is free code:05fb03/00+05fb04/00 cheat description:Low DF rear wing is free code:05faed/00 cheat description:High DF rear wing is free code:05faf1/00+05faf2/00 cheat description:Low DF front wing is free code:05fae3/00 cheat description:High DF front wing is free code:05fae7/00+05fae8/00 cheat description:Special-L front wing is free code:05fae9/00+05faea/00 cheat description:Small diffuser is free code:05fadb/00 cheat description:Large diffuser is free code:05fadf/00 cheat description:Special diffuser is free code:05fae1/00+05fae2/00 cheat description:Hard suspension is free code:05fad7/00 cheat description:Active suspension is free code:05fad9/00+05fada/00 cheat description:Carbon brakes are free code:05fad1/00 cheat description:Antilock brakes are free code:05fad3/00+05fad4/00 cheat description:5-speed transmission is free code:05fac9/00 cheat description:6-speed transmission is free code:05facb/00+05facc/00 cheat description:7-speed transmission is free code:05facd/00+05face/00 cheat description:Type 2 chassis is free code:05fac3/00+05fac4/00 cheat description:Type 3 chassis is free code:05fac5/00+05fac6/00 cheat description:Start with no money instead of $500 code:08d788/9c cheat description:Start with $5,240 code:08d784/ea+08d785/a9+08d787/02 cheat description:Start with $20,600 code:08d784/ea+08d785/a9+08d787/08 cheat description:Start with $163,960 code:08d784/ea+08d785/a9+08d787/40 cheat description:Start with $327,800 code:08d784/ea+08d785/a9+08d787/80 cheat description:Start with $652,920 code:08d784/ea+08d785/a9+08d787/ff cartridge sha256:d689392884df91c2bb84b1411a96f3919b6c9cc8a583dff901a98f0d86d31c30 name:Faceball 2000 (USA) cheat description:Infinite lives code:02cc9d/b5 cheat description:Only need 8 tags to win in arena mode instead of 10 (start with 2 instead of 0) code:019a65/95 cheat description:Allow 98 seconds in zone 1 bonus level code:0f8461/64 cheat description:Allow 98 seconds in zone 2 bonus level code:0f865d/64 cheat description:Allow 98 seconds in zone 3 bonus level code:0f88b3/64 cheat description:Allow 98 seconds in zone 4 bonus level code:0f8b68/64 cheat description:Allow 198 seconds in zone 5 bonus level code:0f8da8/c8 cheat description:Allow 198 seconds in zone 6 bonus level code:0f9069/c8 cheat description:Allow 198 seconds in zone 7 bonus level code:0f9344/c8 cheat description:Start with 1 life instead of 3 code:019a8a/01 cheat description:Start with 5 lives code:019a8a/05 cheat description:Start with 7 lives code:019a8a/07 cheat description:Start with 9 lives code:019a8a/09 cheat description:Start with 25 lives code:019a8a/19 cheat description:Start with 50 lives code:019a8a/32 cheat description:Start with 75 lives code:019a8a/4b cheat description:Start with 99 lives code:019a8a/63 cheat description:Start with 255 lives code:019a8a/ff cheat description:Start each Cyberzone level with 1 tag required code:029279/a9+02927a/01 cheat description:Start each Cyberzone level with 5 tags required code:029279/a9+02927a/05 cheat description:Start each Cyberzone level with 20 tags required code:029279/a9+02927a/14 cheat description:Start each Cyberzone level with 30 tags required code:029279/a9+02927a/1e cheat description:Start each Cyberzone level with 60 tags required code:029279/a9+02927a/3c cheat description:Start each Cyberzone level with 90 tags required code:029279/a9+02927a/5a cheat description:Start Cyberzone mode on zone 1 level 2 code:02b1dd/ad+02adfa/01 cheat description:Start Cyberzone mode on zone 1 level 3 code:02b1dd/ad+02adfa/02 cheat description:Start Cyberzone mode on zone 1 level 4 code:02b1dd/ad+02adfa/03 cheat description:Start Cyberzone mode on zone 1 level 5 code:02b1dd/ad+02adfa/04 cheat description:Start Cyberzone mode on zone 1 bonus level code:02b1dd/ad+02adfa/05 cheat description:Start Cyberzone mode on zone 2 level 6 code:02b1dd/ad+02adfa/06 cheat description:Start Cyberzone mode on zone 2 level 7 code:02b1dd/ad+02adfa/07 cheat description:Start Cyberzone mode on zone 2 level 8 code:02b1dd/ad+02adfa/08 cheat description:Start Cyberzone mode on zone 2 level 9 code:02b1dd/ad+02adfa/09 cheat description:Start Cyberzone mode on zone 2 level 10 code:02b1dd/ad+02adfa/0a cheat description:Start Cyberzone mode on zone 2 bonus level code:02b1dd/ad+02adfa/0b cheat description:Start Cyberzone mode on zone 3 level 11 code:02b1dd/ad+02adfa/0c cheat description:Start Cyberzone mode on zone 3 level 12 code:02b1dd/ad+02adfa/0d cheat description:Start Cyberzone mode on zone 3 level 13 code:02b1dd/ad+02adfa/0e cheat description:Start Cyberzone mode on zone 3 level 14 code:02b1dd/ad+02adfa/0f cheat description:Start Cyberzone mode on zone 3 level 15 code:02b1dd/ad+02adfa/10 cheat description:Start Cyberzone mode on zone 3 bonus level code:02b1dd/ad+02adfa/11 cheat description:Start Cyberzone mode on zone 4 level 16 code:02b1dd/ad+02adfa/12 cheat description:Start Cyberzone mode on zone 4 level 17 code:02b1dd/ad+02adfa/13 cheat description:Start Cyberzone mode on zone 4 level 18 code:02b1dd/ad+02adfa/14 cheat description:Start Cyberzone mode on zone 4 level 19 code:02b1dd/ad+02adfa/15 cheat description:Start Cyberzone mode on zone 4 level 20 code:02b1dd/ad+02adfa/16 cheat description:Start Cyberzone mode on zone 4 bonus level code:02b1dd/ad+02adfa/17 cheat description:Start Cyberzone mode on zone 5 level 21 code:02b1dd/ad+02adfa/18 cheat description:Start Cyberzone mode on zone 5 level 22 code:02b1dd/ad+02adfa/19 cheat description:Start Cyberzone mode on zone 5 level 23 code:02b1dd/ad+02adfa/1a cheat description:Start Cyberzone mode on zone 5 level 24 code:02b1dd/ad+02adfa/1b cheat description:Start Cyberzone mode on zone 5 level 25 code:02b1dd/ad+02adfa/1c cheat description:Start Cyberzone mode on zone 5 bonus level code:02b1dd/ad+02adfa/1d cheat description:Start Cyberzone mode on zone 6 level 26 code:02b1dd/ad+02adfa/1e cheat description:Start Cyberzone mode on zone 6 level 27 code:02b1dd/ad+02adfa/1f cheat description:Start Cyberzone mode on zone 6 level 28 code:02b1dd/ad+02adfa/20 cheat description:Start Cyberzone mode on zone 6 level 29 code:02b1dd/ad+02adfa/21 cheat description:Start Cyberzone mode on zone 6 level 30 code:02b1dd/ad+02adfa/22 cheat description:Start Cyberzone mode on zone 6 bonus level code:02b1dd/ad+02adfa/23 cheat description:Start Cyberzone mode on zone 7 level 31 code:02b1dd/ad+02adfa/24 cheat description:Start Cyberzone mode on zone 7 level 32 code:02b1dd/ad+02adfa/25 cheat description:Start Cyberzone mode on zone 7 level 33 code:02b1dd/ad+02adfa/26 cheat description:Start Cyberzone mode on zone 7 level 34 code:02b1dd/ad+02adfa/27 cheat description:Start Cyberzone mode on zone 7 level 35 code:02b1dd/ad+02adfa/28 cheat description:Start Cyberzone mode on zone 7 bonus level code:02b1dd/ad+02adfa/29 cheat description:Start Cyberzone mode on zone 8 level 36 code:02b1dd/ad+02adfa/2a cheat description:Start Cyberzone mode on zone 8 level 37 code:02b1dd/ad+02adfa/2b cheat description:Start Cyberzone mode on zone 8 level 38 code:02b1dd/ad+02adfa/2c cheat description:Start Cyberzone mode on zone 8 level 39 code:02b1dd/ad+02adfa/2d cheat description:Start Cyberzone mode on zone 8 level 40 code:02b1dd/ad+02adfa/2e cheat description:Start Cyberzone mode on zone 8 level 41 code:02b1dd/ad+02adfa/2f cartridge sha256:2891f1eab285133364ecc379a5c9e1d0026d60f425f1a458d149014f386cfa50 name:Family Dog (USA) cheat description:Infinite health (except against vacuum or falls) code:81af8c/bd cheat description:Infinite lives code:81c6bc/ad cheat description:Infinite Super Barks code:81c6f2/ad cheat description:Start with 90 Super Barks code:80811f/09 cheat description:Cheese Treats worth 10 Super Barks code:81c6d3/0a cheat description:Start in the Hallway code:80ce46/50 cheat description:Start in the Living Room code:80ce46/64 cheat description:Start in the Hallway to the Kitchen code:80ce46/6e cheat description:Start in the Kitchen code:80ce46/82 cheat description:Start in the Hallway to the Backdoor code:80ce46/8c cheat description:Start outside the Yard code:80ce46/96 cheat description:Start in the Kennel Interior code:80ce46/be cheat description:Start in the Kennel Exterior code:80ce46/e0+80ce47/01 cheat description:Start in the Woods and Trees code:80ce46/f4+80ce47/01 cheat description:View the ending code:80ce46/1c+80ce47/02 cartridge sha256:c92f389d25870aada3002775838ec9f69a988120c0238af885fd08d46bd94930 name:Fatal Fury (USA) cheat description:Take minimum damage - P1 code:00c459/ad cheat description:Take minimum damage - P2/CPU code:00c4d6/ad cheat description:Win 1 bout to win the match instead of 2 out of 3 (disable on bonus rounds) code:00c678/01 cheat description:10 seconds to complete bonus rounds code:00a737/10 cheat description:30 seconds to complete bonus rounds code:00a737/30 cheat description:45 seconds to complete bonus rounds code:00a737/45 cheat description:60 seconds to complete bonus rounds code:00a737/60 cheat description:90 seconds to complete bonus rounds code:00a737/90 cheat description:Always fight Richard Myer on the West Subway code:009223/9c+0093aa/03 cheat description:Always fight Michael Max on the West Subway code:009223/9c+0093aa/04 cheat description:Always fight Duck King on the West Subway code:009223/9c+0093aa/05 cheat description:Always fight Tung Fu Rue on the West Subway code:009223/9c+0093aa/06 cheat description:Always fight Hwa Jai on the West Subway code:009223/9c+0093aa/07 cheat description:Always fight Raiden on the West Subway code:009223/9c+0093aa/08 cheat description:Always fight Billy Kane on the West Subway code:009223/9c+0093aa/09 cheat description:Always fight Geese Howard on the West Subway code:009223/9c+0093aa/0a cheat description:Start with 1/4 health - both players code:00a70b/18 cheat description:Start with 1/2 health - both players code:00a70b/30 cheat description:Start with 3/4 health - both players code:00a70b/48 cartridge sha256:a0c554d46034caef231c36dd6849828ca39703678fb7fdd15a11f292b93bcd6b name:Fatal Fury 2 (USA) cheat description:Infinite health - P1 code:c0310b/80 cheat description:Infinite time code:c030f4/00 cheat description:Timer is 2x fast code:c030f4/02 cheat description:Timer is 3x fast code:c030f4/03 cheat description:Computer can't win a round, except last round, game ends after 4 rounds code:c07c47/ad cheat description:P1 is Billy Kane code:c0b779/a9+c0b77a/08+c0b77b/00 cheat description:P1 is Axel Hawk code:c0b77a/09+c0b779/a9+c0b77b/00 cheat description:P1 is Lawrence B code:c0b779/a9+c0b77b/00+c0b77a/0a cheat description:P1 is Wolfgang Krauser code:c0b77a/0b+c0b779/a9+c0b77b/00 cheat description:P2 is Billy Kane code:c0b7d9/a9+c0b7da/08+c0b7db/00 cheat description:P2 is Axel Hawk code:c0b7da/09+c0b7d9/a9+c0b7db/00 cheat description:P2 is Lawrence B code:c0b7da/0a+c0b7d9/a9+c0b7db/00 cheat description:P2 is Wolfgang Krauser code:c0b7da/0b+c0b7d9/a9+c0b7db/00 cheat description:Super vertical jump - P1 code:ca0776/10 cheat description:Bogus vertical jump - P1 code:ca0776/ff cheat description:Start with 1/2 health code:c030bd/30 cartridge sha256:410e90db3d38507ccc85ad3bca6b27a080123fd5160e82b5de4d914d4b6d6e61 name:Fatal Fury Special (USA) cheat description:Instant win - P1 code:7ff9fd/00 cheat description:Almost infinite time code:7ffcc1/63 cheat description:Win 1 round to win the match - P1 code:7ffc49/02 cheat description:Play as Ryo Sakazaki code:7ff703/0f cartridge sha256:b9594d588816ae570ea5fea14577ed47de4db9ac9a40a116c84e0ad7a2ce58f8 name:Fighter's History (USA) (Rev 1) cheat description:Infinite health - P1 code:7e0a56/c8 cheat description:Enable Clown and Karnov code:7e09a4/01 cheat description:Enable sound test code:c107fa/ea+c107f9/20+c107f8/a9 cartridge sha256:f71817f55febd32fd1dce617a326a77b6b062dd0d4058ecd289f64af1b7a1d05 name:Final Fantasy - Mystic Quest (USA) (Rev 1) cheat description:Infinite cure potions code:00c019/be cheat description:Use a cure, gain a cure code:00c019/fe cheat description:Gain 198 cures after one is used code:00c019/4e cheat description:Cure restores life points to maximum code:00c029/00 cheat description:Infinite life points - can make enemies invincible code:02869b/a5 cheat description:Infinite ninja stars code:0290bb/a5 cheat description:Infinite bombs in battle code:02904f/a5 cheat description:Quick level gain code:0cd0c2/80 cheat description:Infinite Cure potions code:7e0e9e/10+7e0e9f/62 cheat description:Infinite Heal potions code:7e0ea0/10+7e0ea1/62 cheat description:Infinite Seeds code:7e0ea2/10+7e0ea3/62 cheat description:Infinite GP code:7e0e86/97 cheat description:Have most items code:7e0ea6/fe+7e0ea7/7f cheat description:Have all weapons code:7e1032/ff+7e1033/ff cheat description:Have all spells code:7e1038/ff+7e1039/ff cheat description:Cure potions restore full health code:00a040/44+15c049/d5 cheat description:99 items in row 1 slot 1 code:7e0e9f/63 cheat description:99 items in row 1 slot 2 code:7e0e91/63 cheat description:99 items in row 1 slot 3 code:7e0e93/63 cheat description:Character 1 - 9999 HP code:7e1014/0f+7e1015/27 cheat description:Character 1 - 9999 maximum HP code:7e1016/0f+7e1017/27 cheat description:Character 1 - max level code:7e1010/29 cheat description:Character 1 - max experience code:7e1011/7f+7e1012/96+7e1013/98 cheat description:Character 1 - 99 White MP code:7e1018/63 cheat description:Character 1 - 99 maximum White MP code:7e101b/63 cheat description:Character 1 - 99 Black MP code:7e1019/63 cheat description:Character 1 - 99 maximum Black MP code:7e101c/63 cheat description:Character 1 - 99 Wizard MP code:7e101a/63 cheat description:Character 1 - 99 maximum Wizard MP code:7e101d/63 cheat description:Character 1 - Infinite Bombs code:7e1030/63 cheat description:Character 1 - Have Sword level 3 code:7e1031/22 cheat description:Character 1 - Have Axe level 3 code:7e1031/25 cheat description:Character 1 - Have Claw level 3 code:7e1031/28 cheat description:Character 1 - Have Bombs level 3 code:7e1031/2b cheat description:Character 2 - 9999 HP code:7e1096/0f+7e1097/27 cheat description:Character 2 - 99 White MP code:7e1098/63 cheat description:Character 2 - 99 maximum White MP code:7e109b/63 cheat description:Character 2 - 99 Black MP code:7e1099/63 cheat description:Character 2 - 99 maximum Black MP code:7e109c/63 cheat description:Character 2 - 99 Wizard MP code:7e109a/63 cheat description:Character 2 - 99 maximum Wizard MP code:7e109d/63 cheat description:Character 2 - Infinite weapon code:7e10b0/62 cheat description:Character 2 - Have Sword level 3 code:7e10b1/22 cheat description:Character 2 - Have Axe level 3 code:7e10b1/25 cheat description:Character 2 - Have Claw level 3 code:7e10b1/28 cheat description:Character 2 - Have Bombs level 3 code:7e10b1/2b cheat description:Character 2 - Have Bow And Arrows code:7e10b1/2d cheat description:Character 2 - Have Throwing Star code:7e10b1/2e cartridge sha256:6151389f33ce2e53db3cd99592440c0020f5f4668f581ce3bd615bc92077f255 name:Final Fantasy - Mystic Quest (USA) cheat description:Infinite life points (can make enemies invincible, disable to defeat them) code:02869b/a5 cheat description:Infinite cure potions code:00c019/be cheat description:Infinite ninja stars code:0290bb/a5 cheat description:Infinite bombs in battle code:02904f/a5 cheat description:Use a cure, gain a cure code:00c019/fe cheat description:Gain 198 cures after one is used code:00c019/4e cheat description:Cure restores life points to maximum code:00c029/00 cheat description:Quick level gain code:0cd0c2/80 cheat description:Infinite Cure potions code:7e0e9e/10+7e0e9f/62 cheat description:Infinite Heal potions code:7e0ea0/10+7e0ea1/62 cheat description:Infinite Seeds code:7e0ea2/10+7e0ea3/62 cheat description:Infinite GP code:7e0e86/97 cheat description:Have most items code:7e0ea6/fe+7e0ea7/7f cheat description:Have all weapons code:7e1032/ff+7e1033/ff cheat description:Have all spells code:7e1038/ff+7e1039/ff cheat description:Cure potions restore full health code:00a040/44+15c049/d5 cheat description:99 items in row 1 slot 1 code:7e0e9f/63 cheat description:99 items in row 1 slot 2 code:7e0e91/63 cheat description:99 items in row 1 slot 3 code:7e0e93/63 cheat description:Character 1 - 9999 HP code:7e1014/0f+7e1015/27 cheat description:Character 1 - 9999 maximum HP code:7e1016/0f+7e1017/27 cheat description:Character 1 - max level code:7e1010/29 cheat description:Character 1 - max experience code:7e1011/7f+7e1012/96+7e1013/98 cheat description:Character 1 - 99 White MP code:7e1018/63 cheat description:Character 1 - 99 maximum White MP code:7e101b/63 cheat description:Character 1 - 99 Black MP code:7e1019/63 cheat description:Character 1 - 99 maximum Black MP code:7e101c/63 cheat description:Character 1 - 99 Wizard MP code:7e101a/63 cheat description:Character 1 - 99 maximum Wizard MP code:7e101d/63 cheat description:Character 1 - Infinite Bombs code:7e1030/63 cheat description:Character 1 - Have Sword level 3 code:7e1031/22 cheat description:Character 1 - Have Axe level 3 code:7e1031/25 cheat description:Character 1 - Have Claw level 3 code:7e1031/28 cheat description:Character 1 - Have Bombs level 3 code:7e1031/2b cheat description:Character 2 - 9999 HP code:7e1096/0f+7e1097/27 cheat description:Character 2 - 99 White MP code:7e1098/63 cheat description:Character 2 - 99 maximum White MP code:7e109b/63 cheat description:Character 2 - 99 Black MP code:7e1099/63 cheat description:Character 2 - 99 maximum Black MP code:7e109c/63 cheat description:Character 2 - 99 Wizard MP code:7e109a/63 cheat description:Character 2 - 99 maximum Wizard MP code:7e109d/63 cheat description:Character 2 - Infinite weapon code:7e10b0/62 cheat description:Character 2 - Have Sword level 3 code:7e10b1/22 cheat description:Character 2 - Have Axe level 3 code:7e10b1/25 cheat description:Character 2 - Have Claw level 3 code:7e10b1/28 cheat description:Character 2 - Have Bombs level 3 code:7e10b1/2b cheat description:Character 2 - Have Bow And Arrows code:7e10b1/2d cheat description:Character 2 - Have Throwing Star code:7e10b1/2e cartridge sha256:414bacc05a18a6137c0de060b4094ab6d1b75105342b0bb36a42e45d945a0e4d name:Final Fantasy II (USA) (Rev 1) cheat description:Almost infinite HP (can make big and sometimes normal monsters invincible, disable to defeat them) code:03caf6/bd cheat description:Infinite MP during battles, doesn't work on twin attacks code:038532/bd cheat description:Infinite items outside of battle except for the Whistle code:01a6f5/ae cheat description:Infinite Whistles code:01a328/ae cheat description:Money doesn't decrease if you run away from a battle code:0388d5/ad+0388de/ad cheat description:Money doesn't decrease in shops code:01c702/ad+01c707/ae cheat description:No random battles code:7e0686/00 cheat description:No random battles (alt) code:00894d/60 cheat description:Always fight the rarest enemy in that area code:008af4/0c cheat description:Always get a treasure from each enemy defeated code:03ecf1/80 cheat description:When treasures are awarded after battle, receive 5 instead of 1 code:01d488/05 cheat description:When arrows are awarded after battle, receive 50 instead of 10 code:01d47e/32 cheat description:When treasures are awarded after battle, receive the rarest code:03ed35/03 cheat description:Sumon the Big Chocobo anywhere by using a Carrot instead of the Whistle code:01a325/eb cheat description:The quantity of items don't decrease when selling them code:01ca54/bd cheat description:No music while traveling or in a town code:008b3f/60 cheat description:Gunslinger code code:01a6f2/44 cheat description:Save anywhere code:0099cf/a9 cheat description:Get at least 150 GP after each battle code:03ed72/69+03ed73/96+03ed74/ea cheat description:Get at least 255 GP after each battle code:03ed7e/ee cheat description:Get at least 65,536 GP after each battle code:03ed87/ee cheat description:Get 99 of items that you are given or find in a pot, treasure chest, ect code:009819/63 cheat description:Get 99 arrows when you find them in a pot or treasure chest code:009828/63 cheat description:Cure2 is ultra strong code:0f973b/c8 cheat description:Cure2 restores HP to all members in the party during battle code:0f973a/40 cheat description:Cure2 restores all HP/MP during battle code:0f973d/16 cheat description:Fire1 spell is ultra strong code:0f984f/c8 cheat description:Fire1 spell hits every enemy code:0f984e/c1 cheat description:Ice1 spell is ultra strong code:0f9861/c8 cheat description:Ice1 spell hits every enemy code:0f9860/c1 cheat description:Lit1 spell is ultra strong code:0f9873/c8 cheat description:Lit1 spell hits every enemy code:0f9872/c1 cheat description:Automatically win battles (no EXP or gold gained) code:7e1801/02+7e1800/08 cheat description:65,000+ exp points after each battle code:7e3592/ff+7e359e/ff cheat description:Character 1 - Max HP code:7e1047/0f+7e1048/27+7e1049/0f+7e104a/27 cheat description:Character 1 - Max MP code:7e104b/0f+7e104c/27+7e104d/0f+7e104e/27 cheat description:Character 1 - Max Agility code:7e1050/63+7e1055/63 cheat description:Character 1 - Max Strength code:7e104f/63+7e1054/63 cheat description:Character 1 - Max Vitality code:7e1051/63+7e1056/63 cheat description:Character 1 - Max Will code:7e1053/63+7e1058/63 cheat description:Character 1 - Max Wisdom code:7e1052/63+7e1057/63 cheat description:Character 2 - Max HP code:7e10c7/0f+7e10c8/27+7e10c9/0f+7e10ca/27 cheat description:Character 2 - Max MP code:7e10cb/0f+7e10cc/27+7e10cd/0f+7e10ce/27 cheat description:Character 2 - Max Agility code:7e10d0/63+7e10d5/63 cheat description:Character 2 - Max Strength code:7e10cf/63+7e10d4/63 cheat description:Character 2 - Max Vitality code:7e10d1/63+7e10d6/63 cheat description:Character 2 - Max Will code:7e10d3/63+7e10d8/63 cheat description:Character 2 - Max Wisdom code:7e10d2/63+7e10d7/63 cheat description:Character 3 - Max HP code:7e1007/0f+7e1008/27+7e1009/0f+7e100a/27 cheat description:Character 3 - Max MP code:7e100b/0f+7e100c/27+7e100d/0f+7e100e/27 cheat description:Character 3 - Max Agility code:7e1010/63+7e1015/63 cheat description:Character 3 - Max Strength code:7e100f/63+7e1014/63 cheat description:Character 3 - Max Vitality code:7e1011/63+7e1016/63 cheat description:Character 3 - Max Will code:7e1013/63+7e1018/63 cheat description:Character 3 - Max Wisdom code:7e1012/63+7e1017/63 cheat description:Character 4 - Max HP code:7e1107/0f+7e1108/27+7e1109/0f+7e110a/27 cheat description:Character 4 - Max MP code:7e110b/0f+7e110c/27+7e110d/0f+7e110e/27 cheat description:Character 4 - Max Agility code:7e1110/63+7e1115/63 cheat description:Character 4 - Max Strength code:7e110f/63+7e1114/63 cheat description:Character 4 - Max Vitality code:7e1111/63+7e1116/63 cheat description:Character 4 - Max Will code:7e1113/63+7e1118/63 cheat description:Character 4 - Max Wisdom code:7e1112/63+7e1117/63 cheat description:Character 5 - Max HP code:7e1087/0f+7e1088/27+7e1089/0f+7e108a/27 cheat description:Character 5 - Max MP code:7e108b/0f+7e108c/27+7e108d/0f+7e108e/27 cheat description:Character 5 - Max Agility code:7e1090/63+7e1095/63 cheat description:Character 5 - Max Strength code:7e108f/63+7e1094/63 cheat description:Character 5 - Max Vitality code:7e1091/63+7e1096/63 cheat description:Character 5 - Max Will code:7e1093/63+7e1098/63 cheat description:Character 5 - Max Wisdom code:7e1092/63+7e1097/63 cheat description:Have 99 of slot 1 code:7e1441/63 cheat description:Have 99 of slot 2 code:7e1443/63 cheat description:Have 99 of slot 3 code:7e1445/63 cheat description:Have 99 of slot 4 code:7e1447/63 cheat description:Have 99 of slot 5 code:7e1449/63 cheat description:Have 99 of slot 6 code:7e144b/63 cheat description:Have 99 of slot 7 code:7e144d/63 cheat description:Have 99 of slot 8 code:7e144f/63 cheat description:Have 99 of slot 9 code:7e1451/63 cheat description:Have 99 of slot 10 code:7e1453/63 cheat description:Have Cure3 in slot 1 code:7e1440/d0 cheat description:Have Cure3 in slot 2 code:7e1442/d0 cheat description:Have Ether2 in slot 3 code:7e1444/d2 cheat description:Have Elixer in slot 4 code:7e1446/d3 cheat description:Have Life in slot 5 code:7e1448/d4 cheat description:Have Cabin in slot 6 code:7e144a/e3 cheat description:Have Spoon in slot 7 code:7e144c/3e cheat description:Have Adamant Armor in slot 8 code:7e144e/9a cartridge sha256:680535dc1c4196c53b40dc9c2c9bc159a77802ab8d4b474bef5dc0281c15ad06 name:Final Fantasy II (USA) cheat description:Almost infinite HP (can make big and sometimes normal monsters invincible, disable to defeat them) code:03cae6/bd cheat description:Infinite MP during battles, doesn't work on twin attacks code:038532/bd cheat description:Infinite items outside of battle except for the Whistle code:01a6f5/ae cheat description:Infinite Whistles code:01a328/ae cheat description:Money doesn't decrease if you run away from a battle code:0388d5/ad+0388de/ad cheat description:Money doesn't decrease in shops code:01c702/ad+01c707/ae cheat description:No random battles code:7e0686/00 cheat description:No random battles (alt) code:00894d/60 cheat description:Always fight the rarest enemy in that area code:008af4/0c cheat description:Always get a treasure from each enemy defeated code:03ecdc/80 cheat description:When treasures are awarded after battle, receive 5 instead of 1 code:01d488/05 cheat description:When arrows are awarded after battle, receive 50 instead of 10 code:01d47e/32 cheat description:When treasures are awarded after battle, receive the rarest code:03ed20/03 cheat description:Sumon the Big Chocobo anywhere by using a Carrot instead of the Whistle code:01a325/eb cheat description:The quantity of items don't decrease when selling them code:01ca54/bd cheat description:No music while traveling or in a town code:008b3f/60 cheat description:Gunslinger code code:01a6f2/44 cheat description:Save anywhere code:0099cf/a9 cheat description:Get at least 150 GP after each battle code:03ed5d/69+03ed5e/96+03ed5f/ea cheat description:Get at least 255 GP after each battle code:03ed5d/69+03ed5e/ff+03ed5f/ea cheat description:Get at least 65,536 GP after each battle code:03ed72/ee cheat description:Get 99 of items that you are given or find in a pot, treasure chest, ect code:009819/63 cheat description:Get 99 arrows when you find them in a pot or treasure chest code:009828/63 cheat description:Cure2 is ultra strong code:0f973b/c8 cheat description:Cure2 restores HP to all members in the party during battle code:0f973a/40 cheat description:Cure2 restores all HP/MP during battle code:0f973d/16 cheat description:Fire1 spell is ultra strong code:0f984f/c8 cheat description:Fire1 spell hits every enemy code:0f984e/c1 cheat description:Ice1 spell is ultra strong code:0f9861/c8 cheat description:Ice1 spell hits every enemy code:0f9860/c1 cheat description:Lit1 spell is ultra strong code:0f9873/c8 cheat description:Lit1 spell hits every enemy code:0f9872/c1 cheat description:Infinite HP code:03cae6/bd cheat description:Automatically win battles (no EXP or gold gained) code:7e1801/02+7e1800/08 cheat description:65,000+ exp points after each battle code:7e3592/ff+7e359e/ff cheat description:Character 1 - Max HP code:7e1047/0f+7e1048/27+7e1049/0f+7e104a/27 cheat description:Character 1 - Max MP code:7e104b/0f+7e104c/27+7e104d/0f+7e104e/27 cheat description:Character 1 - Max Agility code:7e1050/63+7e1055/63 cheat description:Character 1 - Max Strength code:7e104f/63+7e1054/63 cheat description:Character 1 - Max Vitality code:7e1051/63+7e1056/63 cheat description:Character 1 - Max Will code:7e1053/63+7e1058/63 cheat description:Character 1 - Max Wisdom code:7e1052/63+7e1057/63 cheat description:Character 2 - Max HP code:7e10c7/0f+7e10c8/27+7e10c9/0f+7e10ca/27 cheat description:Character 2 - Max MP code:7e10cb/0f+7e10cc/27+7e10cd/0f+7e10ce/27 cheat description:Character 2 - Max Agility code:7e10d0/63+7e10d5/63 cheat description:Character 2 - Max Strength code:7e10cf/63+7e10d4/63 cheat description:Character 2 - Max Vitality code:7e10d1/63+7e10d6/63 cheat description:Character 2 - Max Will code:7e10d3/63+7e10d8/63 cheat description:Character 2 - Max Wisdom code:7e10d2/63+7e10d7/63 cheat description:Character 3 - Max HP code:7e1007/0f+7e1008/27+7e1009/0f+7e100a/27 cheat description:Character 3 - Max MP code:7e100b/0f+7e100c/27+7e100d/0f+7e100e/27 cheat description:Character 3 - Max Agility code:7e1010/63+7e1015/63 cheat description:Character 3 - Max Strength code:7e100f/63+7e1014/63 cheat description:Character 3 - Max Vitality code:7e1011/63+7e1016/63 cheat description:Character 3 - Max Will code:7e1013/63+7e1018/63 cheat description:Character 3 - Max Wisdom code:7e1012/63+7e1017/63 cheat description:Character 4 - Max HP code:7e1107/0f+7e1108/27+7e1109/0f+7e110a/27 cheat description:Character 4 - Max MP code:7e110b/0f+7e110c/27+7e110d/0f+7e110e/27 cheat description:Character 4 - Max Agility code:7e1110/63+7e1115/63 cheat description:Character 4 - Max Strength code:7e110f/63+7e1114/63 cheat description:Character 4 - Max Vitality code:7e1111/63+7e1116/63 cheat description:Character 4 - Max Will code:7e1113/63+7e1118/63 cheat description:Character 4 - Max Wisdom code:7e1112/63+7e1117/63 cheat description:Character 5 - Max HP code:7e1087/0f+7e1088/27+7e1089/0f+7e108a/27 cheat description:Character 5 - Max MP code:7e108b/0f+7e108c/27+7e108d/0f+7e108e/27 cheat description:Character 5 - Max Agility code:7e1090/63+7e1095/63 cheat description:Character 5 - Max Strength code:7e108f/63+7e1094/63 cheat description:Character 5 - Max Vitality code:7e1091/63+7e1096/63 cheat description:Character 5 - Max Will code:7e1093/63+7e1098/63 cheat description:Character 5 - Max Wisdom code:7e1092/63+7e1097/63 cheat description:Have 99 of slot 1 code:7e1441/63 cheat description:Have 99 of slot 2 code:7e1443/63 cheat description:Have 99 of slot 3 code:7e1445/63 cheat description:Have 99 of slot 4 code:7e1447/63 cheat description:Have 99 of slot 5 code:7e1449/63 cheat description:Have 99 of slot 6 code:7e144b/63 cheat description:Have 99 of slot 7 code:7e144d/63 cheat description:Have 99 of slot 8 code:7e144f/63 cheat description:Have 99 of slot 9 code:7e1451/63 cheat description:Have 99 of slot 10 code:7e1453/63 cheat description:Have Cure3 in slot 1 code:7e1440/d0 cheat description:Have Cure3 in slot 2 code:7e1442/d0 cheat description:Have Ether2 in slot 3 code:7e1444/d2 cheat description:Have Elixer in slot 4 code:7e1446/d3 cheat description:Have Life in slot 5 code:7e1448/d4 cheat description:Have Cabin in slot 6 code:7e144a/e3 cheat description:Have Spoon in slot 7 code:7e144c/3e cheat description:Have Adamant Armor in slot 8 code:7e144e/9a cartridge sha256:10eccc5d2fab81346dd759f6be478dcb682eef981e8d3d662da176e1f9a996bc name:Final Fantasy III (USA) (Rev 1) cheat description:Party has almost max HP and MP code:c20f93/ff cheat description:Activate Terra's Morph command code:7e1dd1/0c cheat description:Infinite Morph time out of battle code:7e1cf6/ff cheat description:Infinite Morph time in battle code:7e3f31/ff cheat description:All items in shops are free (disable to sell items) code:c3bba5/64+c3bbab/64 cheat description:Infinite item use code:c39db3/ea cheat description:Infinite item use (alt) code:c39dae/ea cheat description:Protect from all status ailments code:d86de8/e7+d86de9/f8 cheat description:Learn all spells after one battle code:c2613b/b0 cheat description:Earn 65,000+ exp points after each battle code:c25de8/43 cheat description:Earn tons of EXP after a battle (level 99 takes two battles) code:c25de8/42 cheat description:Auto cast Float, Regen, Haste, Shell, Safe and Rflect code:d86dea/eb cheat description:Remove curse from Cursed Shield after only 1 battle code:c26002/00 cheat description:Steal command always gets the more rare item an enemy has code:c239df/00 cheat description:Mog never stumbles when he dances code:c217a1/00 cheat description:Party has Sprint Shoes and Moogle Charm effect code:c20fa5/cc cheat description:Party has Sprint Shoes and Moogle Charm effect (alt) code:c20fa3/cc cheat description:Party has Offering effect code:c2293d/1a+c2293e/ea cheat description:Party has Merit Award effect code:c39c5a/00 cheat description:Party has Economizer effect code:c35134/00+c25744/00 cheat description:Offering gives character instant kill attacks code:c21625/3f cheat description:Enable all characters (once you are able to switch) code:7e1ede/ff+7e1edf/ff cheat description:Have 94 of all items when arrange is used code:c326ba/a9+c326bc/8a+c3272f/af+c32732/de cheat description:Have all Blitz's code:7e1d28/ff cheat description:Have all Dance's code:7e1d4c/ff cheat description:Have all Lore's code:7e1d29/ff+7e1d2a/ff+7e1d2b/ff cheat description:Have all SwdTech's code:7e1cf7/ff cheat description:Have all Espers code:7e1a69/ff+7e1a6a/ff+7e1a6b/ff+7e1a6c/ff cheat description:Enemy 1 has 0 HP code:7e3bfc/00+7e3bfd/00 cheat description:Enemy 2 has 0 HP code:7e3bfe/00+7e3bff/00 cheat description:Enemy 3 has 0 HP code:7e3c00/00+7e3c01/00 cheat description:Enemy 4 has 0 HP code:7e3c02/00+7e3c03/00 cheat description:Enemy 5 has 0 HP code:7e3c04/00+7e3c05/00 cheat description:Enemy 6 has 0 HP code:7e3c06/00+7e3c07/00 cheat description:Faster up/down movement on world map code:ee1f96/20+ee1fe3/e0 cheat description:Faster left/right movement on world map code:ee1efa/20+ee1f48/e0 cheat description:Save anywhere code:7e0201/80 cheat description:Start Terra with Man-eater equipped code:ed7caf/06 cheat description:Start Terra with Excalibur equipped code:ed7caf/18 cheat description:Start Terra with Illumina equipped code:ed7caf/1a cheat description:Start Terra with Atma equipped code:ed7caf/1c cheat description:Start Terra with Tempest equipped code:ed7caf/2e cheat description:Start Terra with Blizzard equipped code:ed7caf/0e cheat description:Start Terra with Enhancer equipped code:ed7caf/13 cheat description:Start Terra with Mithril shield equipped code:ed7cb0/5c cheat description:Start Terra with Gold shield equipped code:ed7cb0/5d cheat description:Start Terra with Ice shield equipped code:ed7cb0/61 cheat description:Start Terra with Fire shield equipped code:ed7cb0/60 cheat description:Start Terra with Hairband equipped code:ed7cb1/6a cheat description:Start Terra with Leather hat equipped code:ed7cb1/69 cheat description:Start Terra with Circlet equipped code:ed7cb1/7a cheat description:Start Terra with Mystery veil equipped code:ed7cb1/79 cheat description:Start Terra with Red cap equipped code:ed7cb1/78 cheat description:Start Terra with Silk robe equipped code:ed7cb2/88 cheat description:Start Terra with Mithril vest equipped code:ed7cb2/89 cheat description:Start Terra with White dress equipped code:ed7cb2/8b cheat description:Start Terra with Genji armor equipped code:ed7cb2/9a cheat description:Start Terra with Force armor equipped code:ed7cb2/94 cheat description:Party has Sprint Shoes and Moogle Charm effect (alt 2) code:7e11df/22 cheat description:Have 99 Sprint Shoes in slot 10 code:7e1872/e6+7e1972/63 cheat description:Enemy 1 has 0 HP (alt) code:7e3bfc/00+7e3bfd/00 cheat description:Enemy 2 has 0 HP (alt) code:7e3bfe/00+7e3bff/00 cheat description:Enemy 3 has 0 HP (alt) code:7e3c00/00+7e3c01/00 cheat description:Enemy 4 has 0 HP (alt) code:7e3c02/00+7e3c03/00 cheat description:Enemy 5 has 0 HP (alt) code:7e3c04/00+7e3c05/00 cheat description:Enemy 6 has 0 HP (alt) code:7e3c06/00+7e3c07/00 cheat description:Save anywhere (alt) code:7e0201/80 cheat description:Have all Rage's code:7e1d35/ff+7e1d36/ff+7e1d37/ff+7e1d3f/ff+7e1d38/ff+7e1d40/ff+7e1d39/ff+7e1d41/ff+7e1d3a/ff+7e1d49/ff+7e1d42/ff+7e1d3b/ff+7e1d4a/ff+7e1d43/ff+7e1d3c/ff+7e1d4b/ff+7e1d44/ff+7e1d3d/ff+7e1d45/ff+7e1d3e/ff+7e1d46/ff+7e1d47/ff+7e1d48/ff+7e1d2c/ff+7e1d2d/ff+7e1d2e/ff+7e1d2f/ff+7e1d30/ff+7e1d31/ff+7e1d32/ff+7e1d33/ff+7e1d34/ff cheat description:Celes - Level 99 code:7e16e6/63 cheat description:Celes - 9999 HP code:7e16e7/0f+7e16e8/27 cheat description:Celes - 9999 Max HP code:7e16e9/0f+7e16ea/27 cheat description:Celes - 9999 MP code:7e16eb/0f+7e16ec/27 cheat description:Celes - 9999 Max MP code:7e16ed/0f+7e16ee/27 cheat description:Celes - No Ailments code:7e16f2/00 cheat description:Celes - Float always on code:7e16f3/ff cheat description:Celes - 255 Vigor code:7e16f8/ff cheat description:Celes - 255 Speed code:7e16f9/ff cheat description:Celes - 255 Stamina code:7e16fa/ff cheat description:Celes - 255 Magic Power code:7e16fb/ff cheat description:Cyan - Level 99 code:7e1652/63 cheat description:Cyan - 9999 HP code:7e1653/0f+7e1654/27 cheat description:Cyan - 9999 Max HP code:7e1655/0f+7e1656/27 cheat description:Cyan - 9999 MP code:7e1657/0f+7e1658/27 cheat description:Cyan - 9999 Max MP code:7e1659/0f+7e165a/27 cheat description:Cyan - No Ailments code:7e165e/00 cheat description:Cyan - Float always on code:7e165f/ff cheat description:Cyan - 255 Vigor code:7e1664/ff cheat description:Cyan - 255 Speed code:7e1665/ff cheat description:Cyan - 255 Stamina code:7e1666/ff cheat description:Cyan - 255 Magic Power code:7e1667/ff cheat description:Edgar - Level 99 code:7e169c/63 cheat description:Edgar - 9999 HP code:7e169d/0f+7e169e/27 cheat description:Edgar - 9999 Max HP code:7e169f/0f+7e16a0/27 cheat description:Edgar - 9999 MP code:7e16a1/0f+7e16a2/27 cheat description:Edgar - 9999 Max MP code:7e16a3/0f+7e16a4/27 cheat description:Edgar - No Ailments code:7e16a8/00 cheat description:Edgar - Float always on code:7e16a9/ff cheat description:Edgar - 255 Vigor code:7e16ae/ff cheat description:Edgar - 255 Speed code:7e16af/ff cheat description:Edgar - 255 Stamina code:7e16b0/ff cheat description:Edgar - 255 Magic Power code:7e16b1/ff cheat description:Gau - Level 99 code:7e179f/63 cheat description:Gau - 9999 HP code:7e17a0/0f+7e17a1/27 cheat description:Gau - 9999 Max HP code:7e17a2/0f+7e17a3/27 cheat description:Gau - 9999 MP code:7e17a4/0f+7e17a5/27 cheat description:Gau - 9999 Max MP code:7e17a6/0f+7e17a7/27 cheat description:Gau - No Ailments code:7e17ab/00 cheat description:Gau - Float always on code:7e17ac/ff cheat description:Gau - 255 Vigor code:7e17b1/ff cheat description:Gau - 255 Speed code:7e17b2/ff cheat description:Gau - 255 Stamina code:7e17b3/ff cheat description:Gau - 255 Magic Power code:7e17b4/ff cheat description:Gogo - Level 99 code:7e17c4/63 cheat description:Gogo - 9999 HP code:7e17c5/0f+7e17c6/27 cheat description:Gogo - 9999 Max HP code:7e17c7/0f+7e17c8/27 cheat description:Gogo - 9999 MP code:7e17c9/0f+7e17ca/27 cheat description:Gogo - 9999 Max MP code:7e17cb/0f+7e17cc/27 cheat description:Gogo - No Ailments code:7e17d0/00 cheat description:Gogo - Float always on code:7e17d1/ff cheat description:Gogo - 255 Vigor code:7e17d6/ff cheat description:Gogo - 255 Speed code:7e17d7/ff cheat description:Gogo - 255 Stamina code:7e17d8/ff cheat description:Gogo - 255 Magic Power code:7e17d9/ff cheat description:Locke - Level 99 code:7e162d/63 cheat description:Locke - 9999 HP code:7e162e/0f+7e162f/27 cheat description:Locke - 9999 Max HP code:7e1630/0f+7e1631/27 cheat description:Locke - 9999 MP code:7e1632/0f+7e1633/27 cheat description:Locke - 9999 Max MP code:7e1634/0f+7e1635/27 cheat description:Locke - No Ailments code:7e1639/00 cheat description:Locke - Float always on code:7e163a/ff cheat description:Locke - 255 Vigor code:7e163f/ff cheat description:Locke - 255 Speed code:7e1640/ff cheat description:Locke - 255 Stamina code:7e1641/ff cheat description:Locke - 255 Magic Power code:7e1642/ff cheat description:Mog - Level 99 code:7e177a/63 cheat description:Mog - 9999 HP code:7e177b/0f+7e177c/27 cheat description:Mog - 9999 Max HP code:7e177d/0f+7e177e/27 cheat description:Mog - 9999 MP code:7e177f/0f+7e1780/27 cheat description:Mog - 9999 Max MP code:7e1781/0f+7e1782/27 cheat description:Mog - No Ailments code:7e1786/00 cheat description:Mog - Float always on code:7e1787/ff cheat description:Mog - 255 Vigor code:7e178c/ff cheat description:Mog - 255 Speed code:7e178d/ff cheat description:Mog - 255 Stamina code:7e178e/ff cheat description:Mog - 255 Magic Power code:7e178f/ff cheat description:Relm - Level 99 code:7e1730/63 cheat description:Relm - 9999 HP code:7e1731/0f+7e1732/27 cheat description:Relm - 9999 Max HP code:7e1733/0f+7e1734/27 cheat description:Relm - 9999 MP code:7e1735/0f+7e1736/27 cheat description:Relm - 9999 Max MP code:7e1737/0f+7e1738/27 cheat description:Relm - No Ailments code:7e173c/00 cheat description:Relm - Float always on code:7e173d/ff cheat description:Relm - 255 Vigor code:7e1742/ff cheat description:Relm - 255 Speed code:7e1743/ff cheat description:Relm - 255 Stamina code:7e1744/ff cheat description:Relm - 255 Magic Power code:7e1745/ff cheat description:Sabin - Level 99 code:7e16c1/63 cheat description:Sabin - 9999 HP code:7e16c2/0f+7e16c3/27 cheat description:Sabin - 9999 Max HP code:7e16c4/0f+7e16c5/27 cheat description:Sabin - 9999 MP code:7e16c6/0f+7e16c7/27 cheat description:Sabin - 9999 Max MP code:7e16c8/0f+7e16c9/27 cheat description:Sabin - No Ailments code:7e16cd/00 cheat description:Sabin - Float always on code:7e16ce/ff cheat description:Sabin - 255 Vigor code:7e16d3/ff cheat description:Sabin - 255 Speed code:7e16d4/ff cheat description:Sabin - 255 Stamina code:7e16d5/ff cheat description:Sabin - 255 Magic Power code:7e16d6/ff cheat description:Setzer - Level 99 code:7e1755/63 cheat description:Setzer - 9999 HP code:7e1756/0f+7e1757/27 cheat description:Setzer - 9999 Max HP code:7e1758/0f+7e1759/27 cheat description:Setzer - 9999 MP code:7e175a/0f+7e175b/27 cheat description:Setzer - 9999 Max MP code:7e175c/0f+7e175d/27 cheat description:Setzer - No Ailments code:7e1761/00 cheat description:Setzer - Float always on code:7e1762/ff cheat description:Setzer - 255 Vigor code:7e1767/ff cheat description:Setzer - 255 Speed code:7e1768/ff cheat description:Setzer - 255 Stamina code:7e1769/ff cheat description:Setzer - 255 Magic Power code:7e176a/ff cheat description:Shadow - Level 99 code:7e1677/63 cheat description:Shadow - 9999 HP code:7e1678/0f+7e1679/27 cheat description:Shadow - 9999 Max HP code:7e167a/0f+7e167b/27 cheat description:Shadow - 9999 MP code:7e167c/0f+7e167d/27 cheat description:Shadow - 9999 Max MP code:7e167e/0f+7e167f/27 cheat description:Shadow - No Ailments code:7e1683/00 cheat description:Shadow - Float always on code:7e1684/ff cheat description:Shadow - 255 Vigor code:7e1689/ff cheat description:Shadow - 255 Speed code:7e168a/ff cheat description:Shadow - 255 Stamina code:7e168b/ff cheat description:Shadow - 255 Magic Power code:7e168c/ff cheat description:Strago - Level 99 code:7e170b/63 cheat description:Strago - 9999 HP code:7e170c/0f+7e170d/27 cheat description:Strago - 9999 Max HP code:7e170e/0f+7e170f/27 cheat description:Strago - 9999 MP code:7e1710/0f+7e1711/27 cheat description:Strago - 9999 Max MP code:7e1712/0f+7e1713/27 cheat description:Strago - No Ailments code:7e1717/00 cheat description:Strago - Float always on code:7e1718/ff cheat description:Strago - 255 Vigor code:7e171d/ff cheat description:Strago - 255 Speed code:7e171e/ff cheat description:Strago - 255 Stamina code:7e171f/ff cheat description:Strago - 255 Magic Power code:7e1720/ff cheat description:Terra - Level 99 code:7e1608/63 cheat description:Terra - 9999 HP code:7e1609/0f+7e160a/27 cheat description:Terra - 9999 Max HP code:7e160b/0f+7e160c/27 cheat description:Terra - 9999 MP code:7e160d/0f+7e160e/27 cheat description:Terra - 9999 Max MP code:7e160f/0f+7e1610/27 cheat description:Terra - No ailments code:7e1614/00 cheat description:Terra - Float always on code:7e1615/ff cheat description:Terra - 255 Vigor code:7e161a/ff cheat description:Terra - 255 Speed code:7e161b/ff cheat description:Terra - 255 Stamina code:7e161c/ff cheat description:Terra - 255 Magic Power code:7e161d/ff cheat description:Umaro - Level 99 code:7e17e9/63 cheat description:Umaro - 9999 HP code:7e17ea/0f+7e17eb/27 cheat description:Umaro - 9999 Max HP code:7e17ec/0f+7e17ed/27 cheat description:Umaro - 9999 MP code:7e17ee/0f+7e17ef/27 cheat description:Umaro - 9999 Max MP code:7e17f0/0f+7e17f1/27 cheat description:Umaro - No Ailments code:7e17f5/00 cheat description:Umaro - Float always on code:7e17f6/ff cheat description:Umaro - 255 Vigor code:7e17fb/ff cheat description:Umaro - 255 Speed code:7e17fc/ff cheat description:Umaro - 255 Stamina code:7e17fd/ff cheat description:Umaro - 255 Magic Power code:7e17fe/ff cartridge sha256:0f51b4fca41b7fd509e4b8f9d543151f68efa5e97b08493e4b2a0c06f5d8d5e2 name:Final Fantasy III (USA) cheat description:Party has almost max HP and MP code:c20f93/ff cheat description:Activate Terra's Morph command code:7e1dd1/0c cheat description:Infinite Morph time out of battle code:7e1cf6/ff cheat description:Infinite Morph time in battle code:7e3f31/ff cheat description:All items in shops are free (disable to sell items) code:c3bba5/64+c3bbab/64 cheat description:Infinite item use code:c39db3/ea cheat description:Protect from all status ailments code:d86de8/e7+d86de9/f8 cheat description:Learn all spells after one battle code:c2613b/b0 cheat description:Earn 65,000+ exp points after each battle code:c25de8/43 cheat description:Earn tons of EXP after a battle (level 99 takes two battles) code:c25de8/42 cheat description:Auto Cast Float, Regen, Haste, Shell, Safe and Rflect code:d86dea/eb cheat description:Vigor/Speed/Stamina/MagPwr becomes 255 code:c28fd6/03 cheat description:Remove curse from Cursed Shield after only 1 battle code:c26002/00 cheat description:Steal command always gets the more rare item an enemy has code:c239df/00 cheat description:Mog never stumbles when he dances code:c217a1/00 cheat description:Party has Sprint Shoes and Moogle Charm effect code:7e11df/22 cheat description:Party has Offering effect code:c2293d/1a+c2293e/ea cheat description:Party has Merit Award effect code:c39c5a/00 cheat description:Party has Economizer effect code:c35134/00+c25744/00 cheat description:Offering gives character instant kill attacks code:c21625/3f cheat description:Enemy 1 has 0 HP code:7e3bfc/00+7e3bfd/00 cheat description:Enemy 2 has 0 HP code:7e3bfe/00+7e3bff/00 cheat description:Enemy 3 has 0 HP code:7e3c00/00+7e3c01/00 cheat description:Enemy 4 has 0 HP code:7e3c02/00+7e3c03/00 cheat description:Enemy 5 has 0 HP code:7e3c04/00+7e3c05/00 cheat description:Enemy 6 has 0 HP code:7e3c06/00+7e3c07/00 cheat description:Have 94 of all items when arrange is used code:c326ba/a9+c326bc/8a+c3272f/af+c32732/de cheat description:Have all Blitz's code:7e1d28/ff cheat description:Have all Dance's code:7e1d4c/ff cheat description:Have all Lore's code:7e1d29/ff+7e1d2a/ff+7e1d2b/ff cheat description:Have all SwdTech's code:7e1cf7/ff cheat description:Have all Espers code:7e1a69/ff+7e1a6a/ff+7e1a6b/ff+7e1a6c/ff cheat description:Faster up/down movement on world map code:ee1f96/20+ee1fe3/e0 cheat description:Faster left/right movement on world map code:ee1efa/20+ee1f48/e0 cheat description:Enable all characters (once you are able to switch) code:7e1ede/ff+7e1edf/ff cheat description:Save anywhere code:7e0201/80 cheat description:Start Terra with Man-eater equipped code:ed7caf/06 cheat description:Start Terra with Excalibur equipped code:ed7caf/18 cheat description:Start Terra with Illumina equipped code:ed7caf/1a cheat description:Start Terra with Atma equipped code:ed7caf/1c cheat description:Start Terra with Tempest equipped code:ed7caf/2e cheat description:Start Terra with Blizzard equipped code:ed7caf/0e cheat description:Start Terra with Enhancer equipped code:ed7caf/13 cheat description:Start Terra with Mithril shield equipped code:ed7cb0/5c cheat description:Start Terra with Gold shield equipped code:ed7cb0/5d cheat description:Start Terra with Ice shield equipped code:ed7cb0/61 cheat description:Start Terra with Fire shield equipped code:ed7cb0/60 cheat description:Start Terra with Hairband equipped code:ed7cb1/6a cheat description:Start Terra with Leather hat equipped code:ed7cb1/69 cheat description:Start Terra with Circlet equipped code:ed7cb1/7a cheat description:Start Terra with Mystery veil equipped code:ed7cb1/79 cheat description:Start Terra with Red cap equipped code:ed7cb1/78 cheat description:Start Terra with Silk robe equipped code:ed7cb2/88 cheat description:Start Terra with Mithril vest equipped code:ed7cb2/89 cheat description:Start Terra with White dress equipped code:ed7cb2/8b cheat description:Start Terra with Genji armor equipped code:ed7cb2/9a cheat description:Start Terra with Force armor equipped code:ed7cb2/94 cheat description:Party has Sprint Shoes and Moogle Charm effect (alt) code:7e11df/22 cheat description:Have 99 Sprint Shoes in slot 10 code:7e1872/e6+7e1972/63 cheat description:Enemy 1 has 0 HP (alt) code:7e3bfc/00+7e3bfd/00 cheat description:Enemy 2 has 0 HP (alt) code:7e3bfe/00+7e3bff/00 cheat description:Enemy 3 has 0 HP (alt) code:7e3c00/00+7e3c01/00 cheat description:Enemy 4 has 0 HP (alt) code:7e3c02/00+7e3c03/00 cheat description:Enemy 5 has 0 HP (alt) code:7e3c04/00+7e3c05/00 cheat description:Enemy 6 has 0 HP (alt) code:7e3c06/00+7e3c07/00 cheat description:Have all Rage's code:7e1d35/ff+7e1d36/ff+7e1d37/ff+7e1d3f/ff+7e1d38/ff+7e1d40/ff+7e1d39/ff+7e1d41/ff+7e1d3a/ff+7e1d49/ff+7e1d42/ff+7e1d3b/ff+7e1d4a/ff+7e1d43/ff+7e1d3c/ff+7e1d4b/ff+7e1d44/ff+7e1d3d/ff+7e1d45/ff+7e1d3e/ff+7e1d46/ff+7e1d47/ff+7e1d48/ff+7e1d2c/ff+7e1d2d/ff+7e1d2e/ff+7e1d2f/ff+7e1d30/ff+7e1d31/ff+7e1d32/ff+7e1d33/ff+7e1d34/ff cheat description:Celes - Level 99 code:7e16e6/63 cheat description:Celes - 9999 HP code:7e16e7/0f+7e16e8/27 cheat description:Celes - 9999 Max HP code:7e16e9/0f+7e16ea/27 cheat description:Celes - 9999 MP code:7e16eb/0f+7e16ec/27 cheat description:Celes - 9999 Max MP code:7e16ed/0f+7e16ee/27 cheat description:Celes - No Ailments code:7e16f2/00 cheat description:Celes - Float always on code:7e16f3/ff cheat description:Celes - 255 Vigor code:7e16f8/ff cheat description:Celes - 255 Speed code:7e16f9/ff cheat description:Celes - 255 Stamina code:7e16fa/ff cheat description:Celes - 255 Magic Power code:7e16fb/ff cheat description:Cyan - Level 99 code:7e1652/63 cheat description:Cyan - 9999 HP code:7e1653/0f+7e1654/27 cheat description:Cyan - 9999 Max HP code:7e1655/0f+7e1656/27 cheat description:Cyan - 9999 MP code:7e1657/0f+7e1658/27 cheat description:Cyan - 9999 Max MP code:7e1659/0f+7e165a/27 cheat description:Cyan - No Ailments code:7e165e/00 cheat description:Cyan - Float always on code:7e165f/ff cheat description:Cyan - 255 Vigor code:7e1664/ff cheat description:Cyan - 255 Speed code:7e1665/ff cheat description:Cyan - 255 Stamina code:7e1666/ff cheat description:Cyan - 255 Magic Power code:7e1667/ff cheat description:Edgar - Level 99 code:7e169c/63 cheat description:Edgar - 9999 HP code:7e169d/0f+7e169e/27 cheat description:Edgar - 9999 Max HP code:7e169f/0f+7e16a0/27 cheat description:Edgar - 9999 MP code:7e16a1/0f+7e16a2/27 cheat description:Edgar - 9999 Max MP code:7e16a3/0f+7e16a4/27 cheat description:Edgar - No Ailments code:7e16a8/00 cheat description:Edgar - Float always on code:7e16a9/ff cheat description:Edgar - 255 Vigor code:7e16ae/ff cheat description:Edgar - 255 Speed code:7e16af/ff cheat description:Edgar - 255 Stamina code:7e16b0/ff cheat description:Edgar - 255 Magic Power code:7e16b1/ff cheat description:Gau - Level 99 code:7e179f/63 cheat description:Gau - 9999 HP code:7e17a0/0f+7e17a1/27 cheat description:Gau - 9999 Max HP code:7e17a2/0f+7e17a3/27 cheat description:Gau - 9999 MP code:7e17a4/0f+7e17a5/27 cheat description:Gau - 9999 Max MP code:7e17a6/0f+7e17a7/27 cheat description:Gau - No Ailments code:7e17ab/00 cheat description:Gau - Float always on code:7e17ac/ff cheat description:Gau - 255 Vigor code:7e17b1/ff cheat description:Gau - 255 Speed code:7e17b2/ff cheat description:Gau - 255 Stamina code:7e17b3/ff cheat description:Gau - 255 Magic Power code:7e17b4/ff cheat description:Gogo - Level 99 code:7e17c4/63 cheat description:Gogo - 9999 HP code:7e17c5/0f+7e17c6/27 cheat description:Gogo - 9999 Max HP code:7e17c7/0f+7e17c8/27 cheat description:Gogo - 9999 MP code:7e17c9/0f+7e17ca/27 cheat description:Gogo - 9999 Max MP code:7e17cb/0f+7e17cc/27 cheat description:Gogo - No Ailments code:7e17d0/00 cheat description:Gogo - Float always on code:7e17d1/ff cheat description:Gogo - 255 Vigor code:7e17d6/ff cheat description:Gogo - 255 Speed code:7e17d7/ff cheat description:Gogo - 255 Stamina code:7e17d8/ff cheat description:Gogo - 255 Magic Power code:7e17d9/ff cheat description:Locke - Level 99 code:7e162d/63 cheat description:Locke - 9999 HP code:7e162e/0f+7e162f/27 cheat description:Locke - 9999 Max HP code:7e1630/0f+7e1631/27 cheat description:Locke - 9999 MP code:7e1632/0f+7e1633/27 cheat description:Locke - 9999 Max MP code:7e1634/0f+7e1635/27 cheat description:Locke - No Ailments code:7e1639/00 cheat description:Locke - Float always on code:7e163a/ff cheat description:Locke - 255 Vigor code:7e163f/ff cheat description:Locke - 255 Speed code:7e1640/ff cheat description:Locke - 255 Stamina code:7e1641/ff cheat description:Locke - 255 Magic Power code:7e1642/ff cheat description:Mog - Level 99 code:7e177a/63 cheat description:Mog - 9999 HP code:7e177b/0f+7e177c/27 cheat description:Mog - 9999 Max HP code:7e177d/0f+7e177e/27 cheat description:Mog - 9999 MP code:7e177f/0f+7e1780/27 cheat description:Mog - 9999 Max MP code:7e1781/0f+7e1782/27 cheat description:Mog - No Ailments code:7e1786/00 cheat description:Mog - Float always on code:7e1787/ff cheat description:Mog - 255 Vigor code:7e178c/ff cheat description:Mog - 255 Speed code:7e178d/ff cheat description:Mog - 255 Stamina code:7e178e/ff cheat description:Mog - 255 Magic Power code:7e178f/ff cheat description:Relm - Level 99 code:7e1730/63 cheat description:Relm - 9999 HP code:7e1731/0f+7e1732/27 cheat description:Relm - 9999 Max HP code:7e1733/0f+7e1734/27 cheat description:Relm - 9999 MP code:7e1735/0f+7e1736/27 cheat description:Relm - 9999 Max MP code:7e1737/0f+7e1738/27 cheat description:Relm - No Ailments code:7e173c/00 cheat description:Relm - Float always on code:7e173d/ff cheat description:Relm - 255 Vigor code:7e1742/ff cheat description:Relm - 255 Speed code:7e1743/ff cheat description:Relm - 255 Stamina code:7e1744/ff cheat description:Relm - 255 Magic Power code:7e1745/ff cheat description:Sabin - Level 99 code:7e16c1/63 cheat description:Sabin - 9999 HP code:7e16c2/0f+7e16c3/27 cheat description:Sabin - 9999 Max HP code:7e16c4/0f+7e16c5/27 cheat description:Sabin - 9999 MP code:7e16c6/0f+7e16c7/27 cheat description:Sabin - 9999 Max MP code:7e16c8/0f+7e16c9/27 cheat description:Sabin - No Ailments code:7e16cd/00 cheat description:Sabin - Float always on code:7e16ce/ff cheat description:Sabin - 255 Vigor code:7e16d3/ff cheat description:Sabin - 255 Speed code:7e16d4/ff cheat description:Sabin - 255 Stamina code:7e16d5/ff cheat description:Sabin - 255 Magic Power code:7e16d6/ff cheat description:Setzer - Level 99 code:7e1755/63 cheat description:Setzer - 9999 HP code:7e1756/0f+7e1757/27 cheat description:Setzer - 9999 Max HP code:7e1758/0f+7e1759/27 cheat description:Setzer - 9999 MP code:7e175a/0f+7e175b/27 cheat description:Setzer - 9999 Max MP code:7e175c/0f+7e175d/27 cheat description:Setzer - No Ailments code:7e1761/00 cheat description:Setzer - Float always on code:7e1762/ff cheat description:Setzer - 255 Vigor code:7e1767/ff cheat description:Setzer - 255 Speed code:7e1768/ff cheat description:Setzer - 255 Stamina code:7e1769/ff cheat description:Setzer - 255 Magic Power code:7e176a/ff cheat description:Shadow - Level 99 code:7e1677/63 cheat description:Shadow - 9999 HP code:7e1678/0f+7e1679/27 cheat description:Shadow - 9999 Max HP code:7e167a/0f+7e167b/27 cheat description:Shadow - 9999 MP code:7e167c/0f+7e167d/27 cheat description:Shadow - 9999 Max MP code:7e167e/0f+7e167f/27 cheat description:Shadow - No Ailments code:7e1683/00 cheat description:Shadow - Float always on code:7e1684/ff cheat description:Shadow - 255 Vigor code:7e1689/ff cheat description:Shadow - 255 Speed code:7e168a/ff cheat description:Shadow - 255 Stamina code:7e168b/ff cheat description:Shadow - 255 Magic Power code:7e168c/ff cheat description:Strago - Level 99 code:7e170b/63 cheat description:Strago - 9999 HP code:7e170c/0f+7e170d/27 cheat description:Strago - 9999 Max HP code:7e170e/0f+7e170f/27 cheat description:Strago - 9999 MP code:7e1710/0f+7e1711/27 cheat description:Strago - 9999 Max MP code:7e1712/0f+7e1713/27 cheat description:Strago - No Ailments code:7e1717/00 cheat description:Strago - Float always on code:7e1718/ff cheat description:Strago - 255 Vigor code:7e171d/ff cheat description:Strago - 255 Speed code:7e171e/ff cheat description:Strago - 255 Stamina code:7e171f/ff cheat description:Strago - 255 Magic Power code:7e1720/ff cheat description:Terra - Level 99 code:7e1608/63 cheat description:Terra - 9999 HP code:7e1609/0f+7e160a/27 cheat description:Terra - 9999 Max HP code:7e160b/0f+7e160c/27 cheat description:Terra - 9999 MP code:7e160d/0f+7e160e/27 cheat description:Terra - 9999 Max MP code:7e160f/0f+7e1610/27 cheat description:Terra - No ailments code:7e1614/00 cheat description:Terra - Float always on code:7e1615/ff cheat description:Terra - 255 Vigor code:7e161a/ff cheat description:Terra - 255 Speed code:7e161b/ff cheat description:Terra - 255 Stamina code:7e161c/ff cheat description:Terra - 255 Magic Power code:7e161d/ff cheat description:Umaro - Level 99 code:7e17e9/63 cheat description:Umaro - 9999 HP code:7e17ea/0f+7e17eb/27 cheat description:Umaro - 9999 Max HP code:7e17ec/0f+7e17ed/27 cheat description:Umaro - 9999 MP code:7e17ee/0f+7e17ef/27 cheat description:Umaro - 9999 Max MP code:7e17f0/0f+7e17f1/27 cheat description:Umaro - No Ailments code:7e17f5/00 cheat description:Umaro - Float always on code:7e17f6/ff cheat description:Umaro - 255 Vigor code:7e17fb/ff cheat description:Umaro - 255 Speed code:7e17fc/ff cheat description:Umaro - 255 Stamina code:7e17fd/ff cheat description:Umaro - 255 Magic Power code:7e17fe/ff cartridge sha256:c6858d5c02894a6cc71f4dd452c7f288b319d1952ca56fdb185b4bf5e26244a2 name:Final Fantasy V (Japan) cheat description:Max / infinite Gil code:7e0947/7f+7e0948/96+7e0949/98 cheat description:No random battles (overworld) code:7e16a9/00 cheat description:No random battles (dungeons) code:7e0b4f/00 cheat description:Walk faster code:7e0afa/7f cheat description:Walk through walls in overworld code:c011b0/70 cheat description:Save anywhere code:7e0a53/20 cartridge sha256:60cca2592d0756b8c4c7a0a254fafa5ac47aa752521fd1f77dcbf4b6ee1bee90 name:Final Fight (USA) cheat description:Invincibility code:02a706/d0 cheat description:Infinite health code:01c963/b5+02ab22/a5 cheat description:Infinite health (alt) code:7e0d14/50 cheat description:Infinite lives code:02a2e6/c5+00e5e2/02 cheat description:Infinite lives (alt) code:00e5ee/af cheat description:Infinite time code:01a34c/cd cheat description:Hit anywhere code:01c124/ea+01c10b/24+01c125/30+01c122/b5+01c123/15 cheat description:Slower timer code:01a354/02 cheat description:Faster timer code:01a354/00 cheat description:Any food restores all health code:02b205/00 cheat description:Attack speed greatly increased code:7e0d1e/01 cheat description:Start with 2 credits code:01a8bb/01 cheat description:Start with 6 credits code:01a8bb/05 cheat description:Start with 10 credits code:01a8bb/09 cheat description:Start on stage 2 - Subway code:7efffe/01 cheat description:Start on stage 3 - West Side code:7efffe/02 cheat description:Start on stage 4 - Bay Area code:7efffe/04 cheat description:Start on stage 5 - Uptown code:7efffe/05 cheat description:Start on bonus stage - Car code:7efffe/06 cheat description:Start on bonus stage - Glass code:7efffe/07 cheat description:Enemies never get knocked down, attack until they die code:7e0d70/00 cheat description:Enemy 1 has no health code:7e1014/00 cheat description:Enemy 2 has no health code:7e10b4/00 cheat description:Enemy 3 has no health code:7e1154/00 cheat description:Bosses have no health code:7e11f4/00+7e11f5/00 cheat description:Always get Knife code:7e1c11/00 cheat description:Always get Sword code:7e1c11/02 cheat description:Always get Pipe code:7e1c11/04 cartridge sha256:744d1a16c3f99970283597ae8f43b7c3621c5f995c4566ef24b8d70b0692007b name:Final Fight 2 (USA) cheat description:Invincibility code:82837d/d0 cheat description:Infinite health code:80f46a/a5+82a6b4/a5 cheat description:Infinite lives code:82a5f3/a5 cheat description:Infinite lives (alt) code:82a5f2/00 cheat description:Infinite time code:82c945/ad cheat description:Infinite time (alt) code:82c940/00 cheat description:One hit kills code:80f4bf/a9+80f4c0/ff cheat description:Hit anywhere - both players code:8281d3/24+8281d8/24+8281a3/24 cheat description:Faster timer code:82c940/02 cheat description:Barbecue restores vitality 50% instead of 95% code:82f903/40 cheat description:Barbecue worth nothing code:82f903/00 cheat description:Soft drink restores vitality 95% code:82f8fd/80 cheat description:Soft drink worth nothing code:82f8fd/00 cheat description:Both players can select same character code:80a979/ee cheat description:P1 and P2 can't harm each other in a 2P game code:829c2d/00 cheat description:Slow motion (disable until play begins) code:8085cb/02 cheat description:Hitting someone with your super move makes you invincible code:82a6a8/01 cheat description:Hitting someone with your super move uses all your health code:82a6a8/40 cheat description:Start with 1 life code:82a21c/00 cheat description:Start with 3 lives code:82a21c/02 cheat description:Start with 7 lives code:82a21c/06 cheat description:Start with 10 lives code:82a21c/09 cartridge sha256:f9dac709b2c2859f828103a0dd980716817e2bde3b9d7e2fdea36e9bb9bed7f2 name:Final Fight 3 (USA) cheat description:Infinite time code:c01658/ad cheat description:Instant super energy code:c09d71/a9+c09d72/28+c09d73/00+c09d75/29 cheat description:Can always do super special code:c067da/00+c06844/00 cheat description:Infinite lives code:c086ab/ea cheat description:Hit anywhere - both players code:c0c33e/e0+c0c340/07+c0c33f/00 cheat description:Invincibility (blinking) - P1 code:7e0520/02 cheat description:Invincibility (blinking) - P2 code:7e0620/02 cheat description:Infinite health - P1 code:7e0558/47 cheat description:Infinite health - P2 code:7e0658/47 cheat description:Infinite lives - P1 code:7e0515/05 cheat description:Infinite lives - P2 code:7e0615/05 cheat description:Infinite super energy - P1 code:7e0516/63 cheat description:Infinite super energy - P2 code:7e0616/63 cheat description:Infinite throw time - P1 code:7e0580/10 cheat description:Infinite throw time - P2 code:7e0680/10 cheat description:Have the Pipe - P1 code:7e0514/01 cheat description:Have the Pipe - P2 code:7e0614/01 cheat description:Have the Nunchaku - P1 code:7e0514/02 cheat description:Have the Nunchaku - P2 code:7e0614/02 cheat description:Have the Club - P1 code:7e0514/03 cheat description:Have the Club - P2 code:7e0614/03 cheat description:Have the Hammer - P1 code:7e0514/04 cheat description:Have the Hammer - P2 code:7e0614/04 cartridge sha256:8c47f9dc79748c0ae6c648f8480614d22eaefade065612ad1fe749fc3db4d1bc name:Final Fight Guy (USA) cheat description:Infinite health code:01c919/b5 cheat description:Infinite health (alt) code:7e0d14/50 cheat description:Infinite time code:01a6e9/60 cheat description:Infinite time (alt) code:7e0cbc/09 cheat description:Hit anywhere code:01c0e1/24+01c0c7/24 cheat description:Gain 9 lives every time you die code:02a343/00 cheat description:No energy lost from spin kick code:02ab91/b5 cheat description:Attack speed greatly increased code:7e0d1e/01 cheat description:Any food restores all health code:029205/00 cheat description:Enemies never get knocked down, hit them until they die code:7e0d70/00 cheat description:Enemy 1 has no health code:7e1014/00 cheat description:Enemy 2 has no health code:7e10b4/00 cheat description:Enemy 3 has no health code:7e1154/00 cheat description:Bosses have no health code:7e11f4/00+7e11f5/00 cheat description:Always get Knife code:7e1c11/00 cheat description:Always get Sword code:7e1c11/02 cheat description:Always get Pipe code:7e1c11/04 cheat description:Start on stage 2 - Subway code:7efffe/01 cheat description:Start on stage 3 - West Side code:7efffe/02 cheat description:Start on stage 4 - Bay Area code:7efffe/04 cheat description:Start on stage 5 - Uptown code:7efffe/05 cheat description:Start on bonus stage - Car code:7efffe/06 cheat description:Start on bonus stage - Glass code:7efffe/07 cartridge sha256:6f32355bef68d4ad58822f50074b46bcc9a68357cd2c6a5470c96bf5344f84d8 name:FireStriker (USA) cheat description:Infinite health code:7e1333/07 cheat description:Infinite Power code:7e1335/03 cheat description:Infinite Rest code:7e152d/03 cartridge sha256:a0106f9cff7abbf25e081e2531f6d4b4aedf6f0dc8d155a66506817bff267d12 name:Firemen, The (Europe) (En,Fr,De) cheat description:Invincibility code:7e08c9/01 cheat description:Infinite life code:7e15c7/31 cheat description:Infinite time code:7e1980/09 cheat description:Infinite Water Bombs code:7e091a/03 cartridge sha256:003dba0193acc5336840307194643ca3b1f848dcfc77580b4e17c605105b27f5 name:Firepower 2000 (USA) cheat description:Invincibility - Jeep code:7e612a/c7 cheat description:Invincibility - Heli code:7e612c/c7 cheat description:Infinite lives code:8084e0/bd cheat description:Loss of vehicle does not reduce bullet strength code:80853d/bd cheat description:Loss of vehicle does not reduce flame strength code:8084fd/bd cheat description:Loss of vehicle does not reduce plasma strength code:80850d/bd cheat description:Loss of vehicle does not reduce laser strength code:80851d/bd cheat description:Loss of vehicle does not reduce ionic strength code:80852d/bd cheat description:Bubble shield lasts for 4 seconds instead of 12 code:80be91/01 cheat description:Bubble shield lasts for 8 seconds code:80be91/02 cheat description:Bubble shield lasts for 16 seconds code:80be91/04 cheat description:Bubble shield lasts for 32 seconds code:80be91/08 cheat description:Bubble shield lasts for 64 seconds code:80be91/10 cheat description:Bubble shield on jeep lasts until end of level code:80ab94/ad cheat description:Bubble shield on helicopter lasts until end of level code:80a91a/ad cheat description:Start with bullet strength at 3 instead of 1 code:80857a/03 cheat description:Start with bullet strength at 6 code:80857a/06 cheat description:Start with flame strength at 3 instead of 1 code:808568/03 cheat description:Start with flame strength at 6 code:808568/06 cheat description:Start with flame strength at 0 code:808568/00 cheat description:Start with plasma strength at 3 instead of 1 code:80856e/03 cheat description:Start with plasma strength at 6 code:80856e/06 cheat description:Start with plasma strength at 0 code:80856e/00 cheat description:Start with laser strength at 1 instead of 0 code:808574/01 cheat description:Start with laser strength at 3 code:808574/03 cheat description:Start with laser strength at 6 code:808574/06 cheat description:Start with ionic strength at 1 instead of 0 code:808580/01 cheat description:Start with ionic strength at 3 code:808580/03 cheat description:Start with ionic strength at 6 code:808580/06 cheat description:Start with 1 life instead of 4 code:808553/01 cheat description:Start with 2 lives code:808553/02 cheat description:Start with 3 lives code:808553/03 cheat description:Start with 5 lives code:808553/05 cheat description:Start with 7 lives code:808553/07 cheat description:Start with 10 lives code:808553/0a cheat description:Start with 15 lives code:808553/0f cheat description:Start with 25 lives code:808553/19 cheat description:Start with 50 lives code:808553/32 cheat description:Start with 75 lives code:808553/4b cheat description:Start with 100 lives code:808553/64 cheat description:Start at level 2 code:8099ee/02 cheat description:Start at level 3 code:8099ee/03 cheat description:Start at level 4 code:8099ee/04 cheat description:Start at level 5 code:8099ee/05 cheat description:Start at level 6 code:8099ee/06 cartridge sha256:4c1354337efa788169387458fa6bdbcf4be0c98369920af2bd876ad98d29070f name:First Samurai (USA) cheat description:Infinite life and force code:019818/a5 cheat description:Infinite lives code:0188fa/24 cheat description:Infinite Axe, Dagger, Grendade (slot 2 item) code:01928d/a5+0192f1/a5 cheat description:Infinite Warp Lanterns code:018d0b/a5 cheat description:Collect items from anywhere code:01b585/24 cheat description:Hit anywhere Sword/Punch/Kick code:019351/24 cheat description:Hit anywhere Axe/Tri-blades code:01b0be/24 cheat description:Hit anywhere Knife/Dual Knives code:01b012/24 cheat description:Full weapon power for Dagger on pick-up code:01b5e5/03 cheat description:Less force picked up from enemies code:01af77/02 cheat description:More force picked up from enemies code:01af77/08 cheat description:Lots more power picked up from enemies code:01af77/15 cheat description:Less life force from food code:01b757/03 cheat description:More life force from food code:01b757/10 cheat description:Start with 9 lives code:0086ce/09 cheat description:Start with 2 lives code:0086ce/02 cheat description:Infinite life and force (alt) code:7e006e/3f+7e006f/3f cheat description:Infinite lives (alt) code:7e0072/09 cheat description:Infinite Axe, Dagger, Grendade (slot 2 item) (alt) code:7e0073/99 cheat description:Infinite Warp Lanterns (alt) code:7e0078/05 cheat description:Infinite Bells (slot 1 item) code:7e0074/09 cheat description:Have all Rune Stones code:7e0075/05 cartridge sha256:064a880a8dfcf576f74ae8a17c3ec7b0a27e8cb0300a5e5959452fcc30422f14 name:Flashback - The Quest for Identity (USA) (En,Fr,De) cheat description:Invincibility against enemies code:c20a33/ad cheat description:Infinite shield code:7ec746/05 cheat description:Never lose a shield when shot (disable to kill enemies) code:c26b13/ea cheat description:Don't die from most falls code:c26b62/b7 cheat description:Start with 1 shield code:ce0d24/02 cheat description:Start with 2 shields code:ce0d24/03 cheat description:Start with 3 shields code:ce0d24/04 cheat description:Start with 5 shields code:ce0d24/06 cheat description:Start with 10 shields code:ce0d24/0b cheat description:Start with 20 shields code:ce0d24/15 cheat description:Start with 50 shields code:ce0d24/33 cheat description:Start with 100 shields code:ce0d24/65 cheat description:Start with 50 credits code:ce1544/32 cheat description:Start with 100 credits code:ce1544/64 cheat description:Start with 250 credits code:ce1544/fa cheat description:Start with 512 credits code:ce1543/02 cheat description:Start with 1024 credits code:ce1543/04 cartridge sha256:ff09d72d6241b331dc429d1cf27c04c26546f23312a22c7a14e6a4bf41ed1069 name:Flintstones, The (USA) (En,Fr,De,Es,It) cheat description:Invincibility code:839752/d0+8396e1/d0 cheat description:Infinite health code:839699/bd+83975c/a5 cheat description:Infinite lives code:0083c0/dd cheat description:Infinite time code:82f2f4/cd cheat description:Hit anywhere code:83b7f0/26+83b7ef/80 cheat description:Get items from anywhere code:8192e8/00+81912e/00+81a624/00 cheat description:Multi-jump code:839d25/00 cheat description:Level skip enabled (Pause + X) code:7e0622/01 cartridge sha256:3d5bbc06e7e9797d937c803610c40b262c14c3f0a39e8048dd6b0b052a040fc1 name:Flintstones, The - The Treasure of Sierra Madrock (USA) cheat description:Invincibility code:84ad12/00 cheat description:Infinite stamina code:84b008/ad cheat description:Infinite time - 1P game code:80cb52/ad cheat description:Infinite lives - 1P game code:80a91f/ad cheat description:Hit anywhere code:809e07/e0+809e0b/32+809e08/38+809e09/00+809e0a/f0 cheat description:Get items from anywhere code:84f5ed/80+84f23e/80 cheat description:Multi-jump code:84c65f/ad cartridge sha256:204ecb9b809408c23d5f5772026fc248c70612d9bf6952e6b952ed7a85640867 name:Flying Hero - Bugyuru no Daibouken (Japan) cheat description:Invincibility code:01a028/1a+01a029/8d+01a02a/3f+01a02b/10 cheat description:Hit anywhere code:01862f/24+018628/24+018636/24+01863d/24+018668/80 cheat description:Hit anywhere continually code:018628/24+018636/24+018668/80+018618/80 cheat description:One hit kills code:018668/80+02f9e7/00 cartridge sha256:bc6b0344a434644c391ac69a53c7720c51e2d3c5c082b8d78598ae4df100c464 name:Foreman for Real (USA) cheat description:Infinite stamina - P1 code:7e11ae/64+7e1072/27+7e043a/78+7e045a/64 cartridge sha256:25b380f529f5a9295df7c0adcc5213d67f131f552d078a3d8f545f988047c90a name:Frantic Flea (USA) cheat description:Invincibility code:7e1e92/1e cartridge sha256:1ce72767795f41049a1f4d2829e837a8885eb91e1c14faf1ca62d05839ebe3c9 name:Frogger (USA) cheat description:Invincibility code:7e17f4/00 cheat description:Infinite lives code:7e183d/04 cheat description:Infinite time code:7e078c/95 cheat description:Cars don't move code:7e1886/00+7e1887/00+7e1888/00+7e1889/00+7e188a/00 cheat description:River objects don't move code:7e1880/04+7e1881/04+7e1882/04+7e1883/04+7e1884/04 cartridge sha256:dcceb5be536c9b91bf34f65e7fcec4b55a78af0192323cf86f3b9555072037ee name:Fun 'n Games (USA) cheat description:Style mode - nude legs code:7e0f80/fe cheat description:Style mode - nude top code:7e0fa3/ff cheat description:Style mode - nude feet code:7e0fc6/63 cheat description:Style mode - nude head code:7e0f5d/05 cartridge sha256:37fe99a0da8c2ca2296c35e6a08e48b9195074b2aa1955c1eed715d12196001b name:Fushigi no Dungeon 2 - Fuurai no Shiren (Japan) cheat description:Gain any EXP for maximum code:c23555/00 cheat description:Enemies start with 1 HP (If enabled when starting a new game, die, you'll restart with 1 HP, when you gain a level it should correct itself) code:c2380d/00+c2380e/af+c2380f/11 cheat description:Collect any Gitan for maximum code:c25c17/00 cheat description:Never lose Satiation code:c233d2/00 cheat description:One Arrow gains 99 code:c33b74/00 cheat description:Smith a weapon to make it +99 code:c30664/a9+c30665/62 cheat description:Items from bartender get +99 Refinement code:c302b9/a9+c302ba/63 cartridge sha256:bf16c3c867c58e2ab061c70de9295b6930d63f29f81cc986f5ecae03e0ad18d2 name:F-Zero (USA) cheat description:Always rank 1st code:00e9a7/a9+00e9a8/01 cheat description:Infinite turbos code:00b829/02 cheat description:Infinite spare machines code:008bfb/c5 cheat description:Start with 1 spare machine code:0381a5/01 cheat description:Start with 5 spare machines code:0381a5/05 cheat description:Start with 9 spare machines code:0381a5/09 cheat description:Infinite power code:7e00c9/00+7e00ca/08 cheat description:Infinite turbos (alt) code:7e0cf3/03 cheat description:Always rank 1st (alt) code:7e1150/00 cheat description:Always boosted code:7e0d51/08 cheat description:Low timer code:7e00c1/00 cartridge sha256:17b24fbda9103cd8cb6f31bd6beccb4a7dfff87c8aef5e79bcc9c7d3a27623fc name:Galaxy Wars (Japan) cheat description:Infinite lives code:7e0630/05 cartridge sha256:ca3dd4620c692b2b8d3dd49b7dbdb1daa251ee0f7943050cc8a036e209cd7a07 name:Ganpuru - Gunman's Proof (Japan) cheat description:Infinite health vs enemies/bullets code:878386/ad cheat description:Infinite ammo for picked up guns code:82b863/ad cheat description:Infinite ammo for picked up hand weapons code:82b887/ad cheat description:Always have stronger attacks code:87858a/00 cheat description:Always have super strong attacks code:878586/a9+878588/3f+87858b/85 cheat description:Easily get max money code:8784bb/00 cheat description:Easily get max score code:878506/00 cheat description:Always have Starmine Bombs (if you have none, fire 3 off) code:849374/00+88dd14/02 cheat description:Always get Rank S for dungeons, regardless of time taken code:88db96/9c cartridge sha256:1735f790ebcfa1bed2430aecde3abaf24c88ff99aa0186736f8f36b674bc9350 name:Garry Kitchen's Super Battletank - War in the Gulf (USA) (Rev 1) cheat description:Infinite health against most enemies and mines code:00cda2/a5 cheat description:Infinite weapon ammo (except Smoke Screens and Machine Gun) code:009803/2c cheat description:More Machine Gun ammo on stages 1-4 code:00d8f8/ff cheat description:Less Machine Gun ammo on stages 1-4 code:00d8f8/2b cheat description:More Cannon ammo on each mission code:00d8dc/64 cheat description:Less Cannon ammo on each mission code:00d8dc/19 cheat description:More Laser Shells on each mission code:00d8e5/05 cheat description:No Laser Shells on each mission code:00d8e5/00 cheat description:More Smoke Screens on each mission code:00d8ef/05 cheat description:No Smoke Screens on each mission code:00d8ef/00 cheat description:Infinite health against most enemies and mines (alt) code:00cda2/a5 cheat description:Infinite Fuel code:7e05c4/ff cheat description:Infinite 120mm Cannon code:7e049e/42 cheat description:Infinite Laser Missiles code:7e04a0/01 cheat description:Infinite Smoke Screens code:7e04a1/01 cheat description:Infinite 7.62mm Machine Gun code:7e04a2/96 cartridge sha256:94496e73fc7fdf2f72f16bf2becb0c3935db2ebd97555eac73b63400acbceec6 name:Garry Kitchen's Super Battletank - War in the Gulf (USA) cheat description:Infinite health against most enemies and mines code:00cda2/a5 cheat description:Infinite weapon ammo (except Smoke Screens and Machine Gun) code:009803/2c cheat description:More Machine Gun ammo on stages 1-4 code:00d8f8/ff cheat description:Less Machine Gun ammo on stages 1-4 code:00d8f8/2b cheat description:More Cannon ammo on each mission code:00d8dc/64 cheat description:Less Cannon ammo on each mission code:00d8dc/19 cheat description:More Laser Shells on each mission code:00d8e5/05 cheat description:No Laser Shells on each mission code:00d8e5/00 cheat description:More Smoke Screens on each mission code:00d8ef/05 cheat description:No Smoke Screens on each mission code:00d8ef/00 cheat description:Infinite health against most enemies and mines (alt) code:00cda2/a5 cheat description:Infinite Fuel code:7e05c4/ff cheat description:Infinite 120mm Cannon code:7e049e/42 cheat description:Infinite Laser Missiles code:7e04a0/01 cheat description:Infinite Smoke Screens code:7e04a1/01 cheat description:Infinite 7.62mm Machine Gun code:7e04a2/96 cartridge sha256:b87874a2292fe045385a2888e33009d5d2eabf55e379059aa5ef6c73b0475ff2 name:Gekitotsu Dangan Jidousha Kessen - Battle Mobile (Japan) cheat description:Invincibility code:01b55b/95+01bf94/b5+01bfb7/b5 cheat description:Infinite health code:01bf94/b5+01bfb7/b5 cheat description:Infinite lives code:01bfd6/ad cheat description:Infinite Shields code:019f1f/b9 cartridge sha256:fdafaa77f01a9a692411e27b3fb6045b247e5d625679b941d317a7b105f437d2 name:George Foreman's KO Boxing (USA) (Rev 1) cheat description:Infinite time code:0085d9/a9+0085da/78 cheat description:Infinite super punch after obtaining it code:00db7a/80 cheat description:Time goes slower code:00810c/78 cheat description:Time speeds up code:00810c/0a cheat description:Damage inflicted by your opponent affects him (your health may slightly decrease) code:00dbbe/ad+00dbbf/73+00dbc7/8d+00dbc8/73 cheat description:Start with 1/2x health - both players code:0080ad/20 cartridge sha256:b248b2122a0caf99298ebd9a4f66ad8047dbfce1e4bbac8219ba3ea9fb7488b5 name:Ghost Chaser Densei (Japan) cheat description:Invincibility code:80b1eb/d0 cheat description:Infinite health code:80c752/bd cheat description:Infinite time code:81c82c/ad cheat description:Hit anywhere code:80ba37/e0+80ba3a/30+80ba3b/30+80ba39/02 cheat description:99 hits in bonus round code:7e0516/63 cartridge sha256:a4ceb31b82ea532e6eb640fa2eda61625758e72251efa5f0ae9a984f4a98a8a0 name:Ghoul Patrol (USA) cheat description:Invincibility code:81a94a/60+81a9a9/60 cheat description:Infinite lives code:819700/ad cheat description:Super powered normal arrows code:838a6b/ff cheat description:Infinite health code:7e1d09/0a cheat description:Infinite lives (alt) code:7e1da1/63 cheat description:Always have weapon code:7e1cfe/01 cheat description:Infinite Keys code:7e1d5d/63 cheat description:Infinite Shot 1 code:7e1d21/63 cheat description:Infinite Shot 2 code:7e1d29/63 cheat description:Infinite Shot 3 code:7e1d23/63 cheat description:Infinite Shot 4 code:7e1d1f/63 cheat description:Infinite Blue Potions code:7e1d63/63 cheat description:Infinite Red Potions code:7e1d61/63 cheat description:Infinite Green Potions code:7e1d65/63 cheat description:Infinite Medipaks code:7e1d71/63 cheat description:Infinite ? Potions code:7e1d69/63 cheat description:Infinite Vials code:7e1d67/63 cheat description:All victims already rescued code:7e1e05/00 cartridge sha256:8796ca4de3aeffd3a494fe28e7d7e2aeb220ca652b43684f29e2cc94f02c20c4 name:Gods (USA) cheat description:Invincibility code:9e83bc/ad cheat description:Continually hit anywhere code:9eccd7/24+9ecce6/24+9ecd1a/24+9ecd06/80 cheat description:Shields last until at least end of the world (disable if you get stuck) code:9eff3b/60 cheat description:Infinite lives code:9e865b/ad cheat description:Items you can afford in the shops are free code:9ebb2f/cd cheat description:Start with 2 lives code:9fe8a0/01 cheat description:Start with 6 lives code:9fe8a0/05 cheat description:Start with 10 lives code:9fe8a0/09 cartridge sha256:2bb368c47189ce813ad716eef16c01cd47685cb98e2c1cb35fa6f0173c97dd7c name:Goof Troop (USA) cheat description:Infinite health code:80dd17/85 cheat description:Infinite lives code:828b16/a5 cheat description:Hit anywhere code:80d7e4/00+80d51e/00 cheat description:Get fruits and gems from anywhere code:82a205/00+82a211/00 cheat description:Walk through walls code:82856a/80+828285/80 cheat description:4 hearts give you a life code:82af47/04+82af50/9e cheat description:2 hearts give you a life code:82af47/02+82af50/9e cheat description:2 hearts from cherries code:83c4be/02 cheat description:4 hearts from bananas code:83c4bf/04 cheat description:1 heart from bananas code:83c4bf/01 cheat description:Goofy has quicker left-right movement code:838e1d/02+838e2d/fd cheat description:Max has quicker left-right movement code:838dfd/02+838e0d/fd cheat description:Start with 9 lives code:80a10a/09 cheat description:Start with 6 lives code:80a10a/06 cheat description:Start with 1 life code:80a10a/01 cartridge sha256:93da752a0c76167d0907efa832367e5d14aab8e835b864f345c386071a9af718 name:Gradius III (USA) cheat description:Invincibility code:00d80a/80 cheat description:Infinite Konami code use (up, up, down, down, left, right, left, right, B, A) code:00c150/ad cheat description:Infinite lives code:00bcf0/ea+00bcf1/ea cheat description:Infinite credits code:00d230/ad cheat description:Hit anywhere code:00eb2d/24 cheat description:Makes Earwig Scorpion (Stage 1 mayor) much easier to defeat code:02939e/01 cheat description:Makes Bubble Brain (Stage 2 mayor) easier to defeat code:029a66/01 cheat description:Weapons status gauge remains at current level after a weapon is selected code:00d95d/ea+00d95e/ea cheat description:Enemies shoot at you more code:00c01f/a9+00c020/01 cheat description:Enables Arcade option in options menu code:00b41b/03 cheat description:Start with 1 life code:00ba93/00 cheat description:Start with 2 lives code:00ba93/01 cheat description:Start with 4 lives code:00ba93/03 cheat description:Start with 5 lives code:00ba93/04 cheat description:Start with 9 lives code:00ba93/08 cheat description:Start with 16 lives code:00ba93/0f cheat description:Start with 31 lives code:00ba93/1e cheat description:Start with 1 credit (1P game) code:00a0e5/01 cheat description:Start with 2 credits code:00a0e5/02 cheat description:Start with 6 credits code:00a0e5/06 cheat description:Start with 7 credits code:00a0e5/07 cheat description:Start with 8 credits code:00a0e5/08 cheat description:Start with 9 credits code:00a0e5/09 cheat description:Infinite credits (alt) code:00d230/ad cheat description:Infinite continues code:7e1e06/03 cheat description:Infinite Forcefield code:7e0346/02+7e0350/02 cheat description:Weapons status gauge remains at current level after a weapon is selected (alt) code:00d95d/ea+00d95e/ea cheat description:Enemies die automatically code:7e00dc/0b cheat description:Have Mega Crush code:7e00b0/07 cheat description:Have Max Speed code:7e00b2/05 cheat description:Have support upgrade - Missile code:7e00b4/0b cheat description:Have support upgrade - Spread Bomb code:7e00b4/0c cheat description:Have support upgrade - 2-Way Missile code:7e00b4/0d cheat description:Have gun - Double code:7e00b6/02 cheat description:Have gun - Tailgun code:7e00b6/03 cheat description:Have gun - Back Double code:7e00b6/04 cheat description:Have gun - Verticle code:7e00b6/05 cheat description:Have gun - Twin Laser code:7e00b6/06 cheat description:Have gun - Laser code:7e00b6/07 cheat description:Have gun - Charged Laser code:7e00b6/09 cheat description:Have gun - Laser (2nd) code:7e00b6/0a cheat description:Have 99 million points - P1 code:7e1f47/99 cheat description:Have 99 million points - P2 code:7e1f4b/99 cartridge sha256:f8c02a0b996d33c0a64c30fb76b80f8e441d67b8ecebb6940bb1171760aa444c name:Great Battle II, The - Last Fighter Twin (Japan) cheat description:Invincibility code:00e14f/a9+00e150/01+00e151/8d+00e152/5b+00e153/04 cheat description:Infinite health code:009797/b5 cheat description:Infinite lives code:00a2bd/d5 cheat description:One hit kills code:00b5b8/80 cheat description:Invincibility (alt) code:7e045b/01 cheat description:Infinite health (alt) code:7e0454/60 cheat description:Infinite lives (alt) code:7e00d4/03 cartridge sha256:10a8d4a4eeefb124693ea72d4613cfd210a332d8ec2fdfcd64695427bf2f65d0 name:Great Battle III, The (Japan) cheat description:Invincibility code:00b540/d0+00b545/d0 cheat description:Infinite health code:00b07e/b5 cheat description:Infinite lives code:00bd6b/d5 cheat description:One hit kills code:00cca3/80 cheat description:Invincibility (alt) code:7e00d4/03 cheat description:Infinite health (alt) code:7e0464/48 cheat description:Infinite lives (alt) code:7e00e4/03 cartridge sha256:b5492aea296ee4bfcd2c677fbec5153fd4c4db758c835b372ef750cf2399649b name:Great Circus Mystery Starring Mickey & Minnie, The (USA) cheat description:Invincibility against enemies code:c05b2e/80 cheat description:Invincibility against ground hazards code:c111e7/80 cheat description:Infinite Vacuum code:c1159e/a5 cheat description:Infinite Bullets code:c11697/a5 cheat description:Collect one coin for 999 code:c05d01/00 cartridge sha256:f921297c361f16ad3f1257e91829638fc795f9323172015d7237ed648c8f7515 name:GunForce (USA) cheat description:Invincibility code:019b0b/85+019b09/a9 cheat description:Infinite ammo code:00f737/ad cheat description:Hit anywhere code:009b34/ad+0095bd/00+0095b6/00+00959b/00+0095a1/00 cheat description:Invincibility (alt) code:7e0055/b1 cheat description:Infinite time (enable during gameplay) code:7e0028/09+7e0029/09 cheat description:Infinite lives - P1 code:7e0051/09 cheat description:Infinite lives - P2 code:7e0052/09 cheat description:Infinite continues - P1 code:7e0053/09 cheat description:Infinite continues - P2 code:7e0054/09 cheat description:Have Rapid Fire code:7e0057/ff cheat description:Have regular gun code:7e9015/01 cheat description:Have Laser gun code:7e9015/04 cheat description:Have Bazooka code:7e9015/07 cheat description:Have Flamethrower code:7e9015/0e cartridge sha256:5a6deb5617e86a9f4b981031e939510e30c5c8ad047f5f012e40442113fd28c2 name:Hagane - The Final Conflict (USA) cheat description:Invincibility code:c0419e/60 cheat description:Infinite time code:c08611/80 cheat description:Infinite Bombs code:c09214/ea cheat description:Infinite Daggers code:c09156/ea cheat description:Infinite special attacks code:c08bb0/ea cheat description:Infinite lives code:c085d9/ea cheat description:Hit anywhere code:c03f89/00+c03f82/00+c03f90/00+c03f97/00 cheat description:One hit kills code:c0400d/00 cheat description:Jump higher code:c05a00/fd cheat description:Start with 9 lives code:c081ec/09 cheat description:Start with 9 special attack points code:c081f0/09 cheat description:Start with maximum health points code:c081e4/05 cheat description:Start on stage 2 - Fortress Of Doom code:c081c1/a9+c081c2/01 cheat description:Start on stage 3 - Violated Heavens code:c081c1/a9+c081c2/02 cheat description:Start on stage 4 - Cry Of The Spirits code:c081c1/a9+c081c2/03 cheat description:Start on stage 5 - Into The Darkness code:c081c1/a9+c081c2/04 cartridge sha256:de1cf1512e48473b03adb87b7504f394e8b330b346bac24044f833d83609799a name:HAL's Hole in One Golf (USA) cheat description:No penalty if you land in water or out of bounds code:0186a2/2c cheat description:Always start hole with 1-shot penalty code:018111/01 cheat description:Max 7 strokes per hole code:018ba9/07 cheat description:Max 5 strokes per hole code:018ba9/05 cartridge sha256:6e2a02a8944c19db3da76d2646f232fbe3ed039bc7d44cc03910814fa77a7acf name:Harley's Humongous Adventure (USA) cheat description:Protection against some hazards code:05ad42/ad cheat description:Infinite ammo code:05b33a/00 cheat description:Infinite lives code:05adbe/ad cheat description:Infinite Jet Fuel on pick-up code:05ae00/00 cheat description:Infinite time on Vent level code:00bbe3/ea cheat description:Any fuel power-up gives maximum amount code:05ae29/00 cheat description:Press X on the title screen with the house to get level select menu code:00e5fa/02 cheat description:Get only 5 ammo from a weapon power-up code:05b402/05 cheat description:Get 20 ammo from a weapon power-up code:05b402/20 cheat description:Get 30 ammo from a weapon power-up code:05b402/30 cheat description:Get 40 ammo from a weapon power-up code:05b402/40 cheat description:Get 50 ammo from a weapon power-up code:05b402/50 cheat description:20 seconds to collect power-ups on level 1 code:00bbad/14 cheat description:60 seconds to collect power-ups on level 1 code:00bbad/3c cheat description:90 seconds to collect power-ups on level 1 code:00bbad/5a cheat description:60 seconds to complete the Vent level code:00bbbc/3c cheat description:Start with maximum fuel on every level code:05a91a/80 cheat description:Start with 4 hearts code:05ab12/08 cheat description:Start with 5 hearts code:05ab12/0a cheat description:Start with 10 of every weapon code:09ded9/10 cheat description:Start with 25 of every weapon code:09ded9/25 cheat description:Start with 50 of every weapon code:09ded9/50 cheat description:Start with 99 of every weapon code:09ded9/99 cheat description:Start with 2 lives code:05ab1c/01 cheat description:Start with 6 lives code:05ab1c/05 cheat description:Start with 11 lives code:05ab1c/10 cheat description:Start with 26 lives code:05ab1c/25 cheat description:Start with 51 lives code:05ab1c/50 cheat description:Start with 100 lives code:05ab1c/99 cheat description:Infinite health against most enemies code:7eab45/32 cheat description:Start with all weapons code:09ded9/ff cheat description:Infinite weapons on pick-up code:7eab54/9a cheat description:Infinite Air code:7e24b2/ff cheat description:Infinite Fuel on pick-up (disable to complete level) code:7e24bc/ff cheat description:Infinte Nuts code:7e24ac/99 cheat description:Infinite Invincibility Spray code:7eab44/84 cheat description:Infinite time code:7e1c3b/64 cheat description:Moon-jump code:7e0283/02 cartridge sha256:73a3aa87ddd5ce5df5ba51292316f42b6e128280179b0a1b11b4dcddc17d4163 name:Harvest Moon (USA) cheat description:Can access all items temporarily code:81b34a/a5 cheat description:Don't lose stamina code:81d0f0/ad cheat description:Go to bed to get 200 stamina code:8283bb/a9+8283bc/c8+8283bd/ea cheat description:With 1 or more wood, take some to get 999 code:83b234/80 cheat description:With 0 wood, take some to get 999 code:83b230/15 cheat description:Fencing doesn't break when it storms code:82a773/80 cheat description:Go to sleep to put a bell plant next to the stable code:82845c/10 cheat description:Go to sleep to enable the egg festival prize code:828796/09+828797/00+828798/10 cheat description:Town always performs Flower Festival code:83d30f/00+83d311/d2 cartridge sha256:7c34908526db2a634216fab0276c42a8e4e22d59c728cd586200142a12dd2c2c name:Home Alone (USA) cheat description:Infinite power code:00d84a/ad cheat description:Infinite lives code:00d864/00 cheat description:Infinite Baseballs, Slingshot and Rifle ammo code:00d7ce/00 cheat description:Power boost on jumps code:019d6c/e0 cheat description:Super power boost on jumps code:019d6c/c0 cheat description:Need 1 item (instead of 24) to complete level 1 code:00dbee/01 cheat description:Need 5 items to complete level 1 code:00dbee/05 cheat description:Need 10 items to complete level 1 code:00dbee/10 cheat description:Need 15 items to complete level 1 code:00dbee/15 cheat description:Need 20 items to complete level 1 code:00dbee/20 cheat description:Need 1 item (instead of 30) to complete level 2 code:00dbef/01 cheat description:Need 5 items to complete level 2 code:00dbef/05 cheat description:Need 10 items to complete level 2 code:00dbef/10 cheat description:Need 15 items to complete level 2 code:00dbef/15 cheat description:Need 20 items to complete level 2 code:00dbef/20 cheat description:Need 25 items to complete level 2 code:00dbef/25 cheat description:Need 1 item (instead of 35) to complete level 3 code:00dbf0/01 cheat description:Need 5 items to complete level 3 code:00dbf0/05 cheat description:Need 10 items to complete level 3 code:00dbf0/10 cheat description:Need 15 items to complete level 3 code:00dbf0/15 cheat description:Need 20 items to complete level 3 code:00dbf0/20 cheat description:Need 25 items to complete level 3 code:00dbf0/25 cheat description:Need 1 item (instead of 35) to complete level 4 code:00dbf1/01 cheat description:Need 5 items to complete level 4 code:00dbf1/05 cheat description:Need 10 items to complete level 4 code:00dbf1/10 cheat description:Need 15 items to complete level 4 code:00dbf1/15 cheat description:Need 20 items to complete level 4 code:00dbf1/20 cheat description:Need 25 items to complete level 4 code:00dbf1/25 cheat description:Extra life with 1 pizza slice instead of 8 code:008d8b/01 cheat description:Extra life with 2 pizza slices code:008d8b/02 cheat description:Extra life with 3 pizza slices code:008d8b/03 cheat description:Extra life with 4 pizza slices code:008d8b/04 cheat description:Extra life with 5 pizza slices code:008d8b/05 cheat description:Extra life with 6 pizza slices code:008d8b/06 cheat description:Extra life with 7 pizza slices code:008d8b/07 cheat description:Start with 1 life instead of 3 code:00db94/01 cheat description:Start with 2 lives code:00db94/02 cheat description:Start with 5 lives code:00db94/05 cheat description:Start with 9 lives code:00db94/09 cheat description:Start with 25 lives code:00db94/25 cheat description:Start with 50 lives code:00db94/50 cheat description:Start with 99 lives code:00db94/99 cheat description:Start on level 2 code:008057/01+008059/c9+00805a/03 cheat description:Start on level 3 code:008057/02+008059/c9+00805a/03 cheat description:Start on level 4 code:008057/03+008059/c9+00805a/03 cartridge sha256:27eaccb4eea93832639565a664bf3561ed5a11ac025d377a3f33262d851c1b2b name:Home Alone 2 - Lost in New York (USA) cheat description:Infinite power (some things can still kill you) code:04d3f5/ad cheat description:Infinite ammo code:009a33/ea cheat description:Infinite lives code:00882a/ad cheat description:Dart guns have 50 shots code:04d737/32+04d751/32 cheat description:Extra life from 1 pizza slice instead of 6 code:04d796/01 cheat description:Extra life from 2 pizza slices code:04d796/02 cheat description:Extra life from 3 pizza slices code:04d796/03 cheat description:Extra life from 4 pizza slices code:04d796/04 cheat description:Extra life from 5 pizza slices code:04d796/05 cheat description:Start with 1 life instead of 3 code:009e77/01 cheat description:Start with 5 lives code:009e77/05 cheat description:Start with 9 lives code:009e77/09 cheat description:Start with 25 lives code:009e77/19 cheat description:Start with 50 lives code:009e77/32 cheat description:Start with 99 lives code:009e77/63 cartridge sha256:48a3ac52e2c9128abc2dc60e07817a51898e8a93be0d51d6f541a8635263a089 name:Home Improvement - Power Tool Pursuit! (USA) cheat description:Invincibility code:af84d6/80+af815b/80 cheat description:Infinite lives code:838d54/a9 cheat description:Infinite Nut Bolts code:af9ba0/a5+afa822/a5+af8012/ad cartridge sha256:acad4c594f156e0f30dec2532b35fcb3bab800e08263377634e2d96dfd055f3e name:Hook (USA) cheat description:Infinite power (disable if you get stuck) code:00c47d/ea cheat description:Infinite time code:038ab5/cd cheat description:Time starts at 7 min - stage 1 code:038793/07 cheat description:Time starts at 3 min - stage 1 code:038793/03 cheat description:Start with 3 power leaves code:008184/04 cheat description:Start with 1 leaf (shows 2, but you can only fill 1) code:008184/02 cheat description:Infinite power (alt) code:7ef7c1/03 cheat description:Infinite lives code:7e1f00/03 cheat description:Infinite flying code:7e1f07/80+7e1f08/01 cheat description:Infinite time (alt) code:7e1f14/59 cartridge sha256:ba6cb0d64cef410c5dd517ce0424fc0942a15b0df0274903939c043f3ac79d39 name:Humans, The (Europe) cheat description:Infinite lives code:7e010b/0c cheat description:Infinite time (disable at end of level) code:7e0122/78+7e0123/00 cartridge sha256:0f6fc06bab813b9654de97fafd4f140368714c58e79130d15046a5a955fc3083 name:Hungry Dinosaurs (Europe) cheat description:Walk anywhere on the grid code:c06489/80 cheat description:Move faster code:c00a45/00+c00a4d/00 cheat description:Change CPU's eggs to your own by walking over them code:c00d13/00+c00d14/d0 cartridge sha256:a03528344d40bf800cdbde2dd240b30442cec7aea6026fbbe312a7c36bf0f74a name:Hunt for Red October, The (USA) cheat description:Infinite Bombs code:80c9f9/ad cheat description:Infinite ECMs code:80cba8/ad cheat description:Infinite SAMs code:80ca94/ad cheat description:Infinite SSMs code:80cb32/ad cheat description:Infinite Torpedoes code:80c942/ad cheat description:Start with 0 Bombs instead of 40 code:81e82e/00 cheat description:Start with 99 Bombs code:81e82e/63 cheat description:Start with 0 Torpedoes instead of 60 code:81e81c/00 cheat description:Start with 99 Torpedoes code:81e81c/63 cheat description:Start with 0 Surface-to-Air Missiles (SAMs) instead of 25 code:81e828/00 cheat description:Start with 50 SAMs code:81e828/32 cheat description:Start with 99 SAMs code:81e828/63 cheat description:Start with 0 Surface-to-Surface Missiles (SSMs) instead of 25 code:81e822/00 cheat description:Start with 50 SSMs code:81e822/32 cheat description:Start with 99 SSMs code:81e822/63 cheat description:Start with 0 Electronic Countermeasures (ECMs) instead of 2 code:81e816/00 cheat description:Start with 50 ECMs code:81e816/32 cheat description:Start with 99 ECMs code:81e816/63 cheat description:Start in theatre I - Caribbean code:8099c6/02 cheat description:Start in theatre II - North Pacifi code:8099c6/06 cheat description:Start in theatre III - Mediterranean code:8099c6/0c cheat description:Start on the final mission - Return to the USSR code:8099c6/10 cartridge sha256:41cc900d2461a8dc4706640e493885ddf85db04d8dffceebf7a0ed89cc983d8d name:Hurricanes (USA) cheat description:Invincibility code:7e0ca2/ff cheat description:Infinite health code:7e0d0e/2c cheat description:Infinite time code:7e1252/09 cheat description:Infinite lives code:7e0d16/09 cartridge sha256:f57c49cc3e4c5e34929e12658db0de8794265c517e42f3c518bb1466ba46f14a name:HyperZone (USA) cheat description:Infinite power code:01b8c4/2c cheat description:Restore energy more quickly code:018ccc/03 cheat description:Restore energy more slowly code:018ccc/00 cheat description:Start with 8 lives code:01a824/07 cheat description:Start with 1 life code:01a824/00 cartridge sha256:fa143784fd20721d61101920e6aae9b7f5012b8157b1ce0c7ea83ea6c875d84d name:Ignition Factor, The (USA) cheat description:Infinite health code:7e0669/f9 cheat description:Max health code:7e069a/f9 cheat description:Always have full abilities regardless of how many items you carry code:7e0698/00 cheat description:Infinite Air Tank code:7e0690/b4 cheat description:Infinite CO2 Bombs code:7e0695/b4 cheat description:Infinite Fire Trucks code:7e0697/03 cheat description:Infinite Blue (electrical) Extinguisher code:7e068f/b4 cheat description:Infinite Green (chemical) Extinguisher code:7e068e/b4 cheat description:Infinite Red Extinguisher code:7e068d/b4 cheat description:Infinite Plastic Explosives code:7e0696/b4 cheat description:Infinite time - minutes code:7e1cba/00 cheat description:Infinite time - seconds code:7e1cb9/00 cheat description:Infinite time - milliseconds code:7e1cb8/00 cheat description:Have Green (chemical) Extinguisher in slot 1 code:7e14c2/02 cheat description:Have Blue (electrical) Extinguisher in slot 2 code:7e14c6/04 cheat description:Have Oxygen Tank and Mask in slot 3 code:7e14ca/06 cheat description:Have Chainsaw in slot 4 code:7e14ce/08 cheat description:Have Rope in slot 4 code:7e14ce/0a cheat description:Have Axe in slot 4 code:7e14ce/0c cheat description:Have Pole in slot 4 code:7e14ce/0e cheat description:Have CO2 Bombs in slot 4 code:7e14ce/10 cheat description:Have Plastic Explosives in slot 4 code:7e14ce/12 cheat description:Haev Fossile in slot 4 code:7e14ce/14 cheat description:Have First Aid Kit in slot 4 code:7e14ce/26 cartridge sha256:32adc048fd89228a4310c03df243e83de7d436cdb2460b4cc83ade20d359b2bd name:Illusion of Gaia (USA) cheat description:Infinite HP code:83c47b/ad cheat description:Less charge time for psycho dash code:82b815/05 cheat description:Less charge time for dark friar code:82b890/05 cheat description:Super run left/right only code:82c5c5/05+82c57b/fb cheat description:Super run up/down only code:82c532/fc+82c4ea/04 cheat description:Get 2x the energy from herbs code:83889f/10 cheat description:Get 3x the energy from herbs code:83889f/18 cheat description:Red Jewel 50 check passes code:88cf43/00 cheat description:Red Jewel 30 check passes code:88cf38/00 cheat description:Red Jewel 20 check passes code:88cf27/00 cheat description:Red Jewel 12 check passes code:88cf16/00 cheat description:Red Jewel 08 check passes code:88cf05/00 cheat description:Red Jewel 05 check passes code:88cef4/00 cheat description:Red Jewel 03 check passes code:88cee3/00 cheat description:Start with max HP code:808069/ff cheat description:Start with a lot more energy code:808068/14 cheat description:Start with 20 strength points code:808071/14 cheat description:Start with 50 strength points code:808071/32 cheat description:Start with 80 strength points code:808071/50 cheat description:Infinite HP code:7e0acd/32+7e0ace/32 cheat description:Max HP code:7e0aca/32+7e0acb/03 cheat description:Max Strength code:7e0ade/63 cheat description:Max Defense code:7e0adc/63 cheat description:Can always attack code:7e09ae/00 cheat description:One hit kills code:7e0ade/ff+7e0adf/ff cheat description:Play as Will code:7e0ad4/00 cheat description:Play as Knight code:7e0ad4/01 cheat description:Play as Shade code:7e0ad4/02 cheat description:Walk through walls code:82e301/af+82e304/9b cheat description:Can always attack code:7e09ae/00 cheat description:Have all Statues code:7e0a1f/bf cheat description:Have Red Jewel - slot 1 code:7e0ab4/01 cheat description:Have Red Jewel - slot 16 code:7e0ac3/01 cheat description:Have Prison Key - slot 1 code:7e0ab4/02 cheat description:Have Prison Key - slot 16 code:7e0ac3/02 cheat description:Have Incan Statue A - slot 1 code:7e0ab4/03 cheat description:Have Incan Statue A - slot 16 code:7e0ac3/03 cheat description:Have Incan Statue B - slot 1 code:7e0ab4/04 cheat description:Have Incan Statue B - slot 16 code:7e0ac3/04 cheat description:Have Incan Melody - slot 1 code:7e0ab4/05 cheat description:Have Incan Melody - slot 16 code:7e0ac3/05 cheat description:Have Herb - slot 1 code:7e0ab4/06 cheat description:Have Herb - slot 16 code:7e0ac3/06 cheat description:Have Blue Block - slot 1 code:7e0ab4/07 cheat description:Have Blue Block - slot 16 code:7e0ac3/07 cheat description:Have Wind Melody - slot 1 code:7e0ab4/08 cheat description:Have Wind Melody - slot 16 code:7e0ac3/08 cheat description:Have Lola's Melody - slot 1 code:7e0ab4/09 cheat description:Have Lola's Melody - slot 16 code:7e0ac3/09 cheat description:Have Meat - slot 1 code:7e0ab4/0a cheat description:Have Meat - slot 16 code:7e0ac3/0a cheat description:Have Mine Key A - slot 1 code:7e0ab4/0b cheat description:Have Mine Key A - slot 16 code:7e0ac3/0b cheat description:Have Mine Key B - slot 1 code:7e0ab4/0c cheat description:Have Mine Key B - slot 16 code:7e0ac3/0c cheat description:Have Memory Melody - slot 1 code:7e0ab4/0d cheat description:Have Memory Melody - slot 16 code:7e0ac3/0d cheat description:Have Crystal Ball - slot 1 code:7e0ab4/0e cheat description:Have Crystal Ball - slot 16 code:7e0ac3/0e cheat description:Have Elevator Key - slot 1 code:7e0ab4/0f cheat description:Have Elevator Key - slot 16 code:7e0ac3/0f cheat description:Have Palace Key - slot 1 code:7e0ab4/10 cheat description:Have Palace Key - slot 16 code:7e0ac3/10 cheat description:Have Purify Stone - slot 1 code:7e0ab4/11 cheat description:Have Purify Stone - slot 16 code:7e0ac3/11 cheat description:Have Statue of Hope - slot 1 code:7e0ab4/12 cheat description:Have Statue of Hope - slot 16 code:7e0ac3/12 cheat description:Have Rama Statue - slot 1 code:7e0ab4/13 cheat description:Have Rama Statue - slot 16 code:7e0ac3/13 cheat description:Have Magic Dust - slot 1 code:7e0ab4/14 cheat description:Have Magic Dust - slot 16 code:7e0ac3/14 cheat description:Have Blue Journal - slot 1 code:7e0ab4/15 cheat description:Have Blue Journal - slot 16 code:7e0ac3/15 cheat description:Have Lance's Leter - slot 1 code:7e0ab4/16 cheat description:Have Lance's Leter - slot 16 code:7e0ac3/16 cheat description:Have Necklace Stone - slot 1 code:7e0ab4/17 cheat description:Have Necklace Stone - slot 16 code:7e0ac3/17 cheat description:Have Will - slot 1 code:7e0ab4/18 cheat description:Have Will - slot 16 code:7e0ac3/18 cheat description:Have Tea Pot - slot 1 code:7e0ab4/19 cheat description:Have Tea Pot - slot 16 code:7e0ac3/19 cheat description:Have Mushroom Drop - slot 1 code:7e0ab4/1a cheat description:Have Mushroom Drop - slot 16 code:7e0ac3/1a cheat description:Have Bag of Gold - slot 1 code:7e0ab4/1b cheat description:Have Bag of Gold - slot 16 code:7e0ac3/1b cheat description:Have Black Glasses - slot 1 code:7e0ab4/1c cheat description:Have Black Glasses - slot 16 code:7e0ac3/1c cheat description:Have Gorgon Flower - slot 1 code:7e0ab4/1d cheat description:Have Gorgon Flower - slot 16 code:7e0ac3/1d cheat description:Have Heiroglyph 1 - slot 1 code:7e0ab4/1e cheat description:Have Heiroglyph 1 - slot 16 code:7e0ac3/1e cheat description:Have Heiroglyph 2 - slot 1 code:7e0ab4/1f cheat description:Have Heiroglyph 2 - slot 16 code:7e0ac3/1f cheat description:Have Heiroglyph 3 - slot 1 code:7e0ab4/20 cheat description:Have Heiroglyph 3 - slot 16 code:7e0ac3/20 cheat description:Have Heiroglyph 4 - slot 1 code:7e0ab4/21 cheat description:Have Heiroglyph 4 - slot 16 code:7e0ac3/21 cheat description:Have Heiroglyph 5 - slot 1 code:7e0ab4/22 cheat description:Have Heiroglyph 5 - slot 16 code:7e0ac3/22 cheat description:Have Heiroglyph 6 - slot 1 code:7e0ab4/23 cheat description:Have Heiroglyph 6 - slot 16 code:7e0ac3/23 cheat description:Have Aura - slot 1 code:7e0ab4/24 cheat description:Have Aura - slot 16 code:7e0ac3/24 cheat description:Have Lola's Letter - slot 1 code:7e0ab4/25 cheat description:Have Lola's Letter - slot 16 code:7e0ac3/25 cheat description:Have Father's Journal - slot 1 code:7e0ab4/26 cheat description:Have Father's Journal - slot 16 code:7e0ac3/26 cheat description:Have Crystal Ring - slot 1 code:7e0ab4/27 cheat description:Have Crystal Ring - slot 16 code:7e0ac3/27 cheat description:Have Red Apple - slot 1 code:7e0ab4/28 cheat description:Have Red Apple - slot 16 code:7e0ac3/28 cartridge sha256:4dc2b5de98e9109583d9b61b38d26a8216af4dba246ef71350122213630562d0 name:Imperium (USA) cheat description:Invincibility code:04aca3/80+01e7b7/00 cheat description:Hit anywhere code:01e863/80+01e881/ad cheat description:Infinite bombs code:00c45a/ad cheat description:Start with 1 life point code:00c8db/01 cheat description:Start with 3 life points code:00c8db/03 cheat description:Start with 5 bombs code:009e08/05 cheat description:Start with 9 bombs code:009e08/09 cartridge sha256:c41150c0e84055801377fb7cb273cc51ca442b269ca6287cadf514f553e34750 name:Incantation (USA) cheat description:Infinite energy code:80ee24/ad cheat description:Infinite lives code:80cf44/ad cheat description:Invincibility (blinking) code:7e07fc/5f cheat description:Infinite energy (alt) code:7e1115/30 cheat description:Infinite lives (alt) code:7e0846/64 cheat description:Super-jump with lunar descent code:7e163d/00 cheat description:3 wheat for toll code:7e0e69/03 cheat description:Max bonus code:7e083c/5a+7e083e/63 cheat description:Have larger shot code:7e07e8/d4+7e07ea/1a cartridge sha256:0415adfe80977485f84cdffaaa79f18c91c004c7dba202b4cf9a94eb11adeada name:Incredible Crash Dummies, The (USA) cheat description:Invincibility (blinking) code:7e1338/37 cheat description:Infinite health code:7e03b6/05 cheat description:Infinite lives code:7e03b5/05 cheat description:Infinite time (disable at end of level) code:7e04a6/3b cheat description:Infinite spanners code:7e04a0/0a cheat description:Infinite wrenches (disable at end of level) code:7e04a0/05 cheat description:Infinite airbag once obtained code:7e0492/c7 cheat description:Infinite lightning once obtained code:7e0490/c7 cheat description:Start at Parking Level 1 code:7e03b9/01 cheat description:Start at Crash Center code:7e03b9/02 cheat description:Start at Crash Center Boss code:7e03b9/03 cheat description:Start at Construction Site 1 code:7e03b9/04 cheat description:Start at Construction Site 2 code:7e03b9/05 cheat description:Start at Construction Site Boss code:7e03b9/06 cheat description:Start at Artillery Range 1 code:7e03b9/07 cheat description:Start at Military Complex code:7e03b9/08 cheat description:Start at Military Complex Boss code:7e03b9/09 cheat description:Start at Junk Kastle code:7e03b9/0a cheat description:Start at Junk Kastle Boss code:7e03b9/0b cheat description:Start at Title Screen code:7e03b9/0c cheat description:Start at Credits code:7e03b9/0d cheat description:Start at Parking Level 2 code:7e03b9/0e cheat description:Start at Vehicle Crash Test 1 'car' code:7e03b9/0f cheat description:Start at Vehicle Crash Test 2 'bulldozer' code:7e03b9/10 cheat description:Start at Artillery Range 2 code:7e03b9/11 cheat description:Start at Vehicle Crash Test 3 'tank' code:7e03b9/12 cartridge sha256:8d170628d2d2fdf142bb82ad80e908bba54c45fa33241c779b8eafaf1b21171f name:Incredible Hulk, The (USA) cheat description:Infinite health code:818d4a/bd+80f458/ad cheat description:Infinite transformation capsules on pick-up code:8a8202/a5 cheat description:Health doesn't decrease when Hulked-out code:8a804c/ad cheat description:Hit anywhere code:8190e1/4c+8190e0/d0+8190dd/e0+8190de/00+8190df/00 cheat description:One hit kills code:81901c/00 cheat description:Get items from anywhere code:8a951e/80 cheat description:Get 4 shots from gun code:8a95af/04 cheat description:Get 9 shots from gun code:8a95af/09 cheat description:Get 20 shots from gun code:8a95af/14 cheat description:Get 20 seconds from time icon code:8a9544/20 cheat description:Get 40 seconds from time icon code:8a9544/40 cheat description:2x energy from gamma capsules code:8a95f8/1e cheat description:Gamma capsules act as mega-gamma capsules code:8a95bd/00 cheat description:Super-jump (sometimes) code:80df7b/0c+80e02f/0c cheat description:Mega-jump (sometimes) code:80df7b/19+80e02f/19 cheat description:Mega damage from Hulk's uppercut code:819038/0a cheat description:Mega damage from Hulk's head butt code:819064/0a cheat description:4x damage from Hulk's uppercut code:819038/04 cheat description:4x damage from Hulk's head-butt code:819064/04 cheat description:Start with 1 life code:809602/01 cheat description:Start with 6 lives code:809602/06 cheat description:Start with 9 lives code:809602/09 cheat description:Start on level 2 code:8095d5/00 cheat description:Start on level 3 code:8095d5/20 cheat description:Start on level 4 code:8095d5/40 cheat description:Start on level 5 code:8095d5/80 cheat description:Infinite and max health code:7e0718/63 cheat description:Infinite lives code:7e00c0/09 cartridge sha256:cf611b40f9570e8fcfdc21db623965da62561e8ca82ded59e432ba6fb0bfb562 name:Indiana Jones' Greatest Adventures (USA) cheat description:Invincibility code:80c93e/8d+80b640/d0 cheat description:Infinite lives code:80abdf/ad cheat description:Infinite Bombs code:80978d/ad cheat description:Infinite Grenades code:80978d/ad cheat description:Infinite continues code:bfc69e/ea+8a95af/14 cheat description:Hearts don't restore health code:809489/ad cheat description:Can't collect Grenades code:80975c/ad cheat description:Start with very little health code:80af6d/01 cheat description:Start with about 1/2 health code:80af6d/03 cheat description:Start with more health (ignore health meter) code:81ab6d/0f cheat description:Start with 5 Grenades code:80a635/05 cheat description:Start with 9 Grenades code:80a635/09 cheat description:Start with 15 Grenades code:80a635/0f cheat description:Start with 2 lives code:bfa9ae/01 cheat description:Start with 5 lives code:bfa9ae/04 cheat description:Start with 10 lives code:bfa9ae/09 cheat description:Start with no continues code:bfa9bb/06 cheat description:Infinite health code:7e0120/06 cartridge sha256:5e5cac64fdcf09a52a9c0ab1ebc8bd309dcb1256faf1405284443569b5284fe5 name:Inindo - Way of the Ninja (USA) cheat description:Max defend code:7ef0c8/ff cheat description:Max intelligence code:7ef0c3/ff cheat description:Max luck code:7ef0c5/ff cheat description:Max power code:7ef0ca/ff cheat description:Max resist code:7ef0c9/ff cheat description:Max speed code:7ef0c4/ff cheat description:Start with 50,000 gold code:01f00a/c4 cheat description:Start with 250 health after the first battle code:01f0a4/fa cheat description:Start with 100 energy after the first level up code:01f0a8/64 cheat description:Infinite HP in battle code:7e9606/e7+7e9607/03 cheat description:Max HP code:7ef0b6/e7+7ef0b7/03 cheat description:Infinite energy code:7ef0bc/e7+7ef0bd/03 cheat description:Max energy code:7ef0ba/e7+7ef0bb/03 cheat description:Infinite chips code:7ef076/ff+7ef077/ff cartridge sha256:c7b1706a0ee96f3e0d65cd043c05966bfe3d5c57d08bbd2df3118817424adf82 name:Inspector Gadget (USA) cheat description:Invincibility (keep coat in collisions) code:c08151/ad cheat description:Infinite time code:c05635/ad cheat description:Infinite lives code:c06980/ad cheat description:Start with 3 plungers code:c02f9c/03 cartridge sha256:6443fecebcdc2ff7061a40432f3ad1db6dfd354909a5f306972cf6afa122752c name:International Superstar Soccer (USA) cheat description:Opponent's Goals don't count code:7e1774/00 cheat description:Infinite time code:7e1a46/55 cheat description:3 minute game instead of 5 (International Cup and World Series modes) code:7e1fa2/00 cheat description:7 Minute game (International Cup and World Series modes) code:7e1fa2/02 cheat description:No Fouls (International Cup and World Series modes) code:7e1f96/01 cheat description:No Cards (International Cup and World Series modes) code:7e1f98/01 cheat description:No Offside (International Cup and World Series modes) code:7e1f90/01 cheat description:Always Sunny (International Cup and World Series modes) code:7e1f92/00 cheat description:Always Rain (International Cup and World Series modes) code:7e1f92/01 cheat description:Always Snow (International Cup and World Series modes) code:7e1f92/02 cheat description:Stop Clock (Training mode) code:7e1e38/30 cheat description:Stop Bonus Clock (Training mode) code:7e1e3c/30 cheat description:Black Ball and Noob Saibot referee (Open Game mode) code:7e1f9f/03 cartridge sha256:8304d8bc55aa9e64bdd144d384f4b185af2426e7d64888c6c23dd41366a53981 name:Irem Skins Game, The (USA) cheat description:Ball goes in from anywhere code:00c6de/80+00c687/80+00c5ba/80+00c6bb/80+00c9f7/00 cartridge sha256:8e0d620a307a225a757bbc9ef2a2a666792e5d533aa0279d3c0060a1b93ead82 name:Iron Commando - Koutetsu no Senshi (Japan) cheat description:Invincibility - Bicycle stages code:81fac3/6b cheat description:Infinite ammo code:81c862/ad cheat description:One hit kills (most enemies) code:81f81a/24+82a059/9e+82a05c/9c cartridge sha256:39bfe828571cdb23e7c85c23cf5b175979dcc2042c5841add58f5ae6492168a9 name:Itchy & Scratchy Game, The (USA) cheat description:Infinite health code:97fc63/ad cheat description:Infinite lives code:809a90/ad cheat description:Infinite time code:8dbec1/ad cheat description:Infinite Bones code:80b7c0/ad cheat description:Infinite health - P1 code:7e022b/46 cheat description:Infinite lives (alt) code:7e023a/03 cheat description:Infinite Cheese speed boost code:7e023b/03 cheat description:Infinite Boss weapons code:7e023c/0f cartridge sha256:183af7d642b55d52cd594786ec2f031d033cc6c8c1a2a84a834e4ada04301b26 name:Izzy's Quest for the Olympic Rings (USA) cheat description:Infinite health (disable then enable when bored in sub games) code:7e9eb0/03 cheat description:Infinite lives code:7e9e90/0a cheat description:Start on Greek Village I code:7e0394/05+7e0398/05 cheat description:Start on Rocket Ride I code:7e0394/06+7e0398/06 cheat description:Start on Greek Village II code:7e0394/07+7e0398/07 cheat description:Start on Space Walk I code:7e0394/08+7e0398/08 cheat description:Start on Greek Village III code:7e0394/09+7e0398/09 cheat description:Start on Rocket Ride II code:7e0394/0a+7e0398/0a cheat description:Start on Lava Dome I code:7e0394/0b+7e0398/0b cheat description:Start on Space Walk II code:7e0394/0c+7e0398/0c cheat description:Start on Lava Dome II code:7e0394/0d+7e0398/0d cheat description:Start on Rocket Ride III code:7e0394/0e+7e0398/0e cheat description:Start on Lava Dome III code:7e0394/0f+7e0398/0f cheat description:Start on Space Walk III code:7e0394/10+7e0398/10 cheat description:Start on Exit to Atlanta I code:7e0394/11+7e0398/11 cheat description:Start on Exit to Atlanta II code:7e0394/12+7e0398/12 cheat description:Start on Round Ends code:7e0394/13+7e0398/13 cheat description:Start on Game Ending code:7e0394/14+7e0398/14 cartridge sha256:62557ee2a3fc3b5a3f59431f966eb61bb380ba983ef6c7742cb55cf075f15f6c name:J.R.R. Tolkien's The Lord of the Rings - Volume 1 (USA) cheat description:Invincibility - all characters code:80c2d6/bd cheat description:Start with 908 HP code:b1a2fa/09+81a2fb/09 cheat description:Start with 9908 HP code:b1a2fa/99+81a2fb/99 cheat description:Start the game with more strength code:81a308/8d cheat description:9999 HP - character 1 code:7e0224/99+7e0225/99 cheat description:9999 max HP - character 1 code:7e0236/99+7e0237/99 cheat description:9999 EXP - character 1 code:7e0246/99+7e0247/99 cheat description:Level 98 - character 1 code:7e0256/98 cheat description:9999 HP - character 2 code:7e0226/99+7e0227/99 cheat description:9999 max HP - character 2 code:7e0238/99+7e0239/99 cheat description:9999 EXP - character 2 code:7e0248/99+7e0249/99 cheat description:Level 98 - character 2 code:7e0258/98 cheat description:Have all items code:7e02b3/ff+7e02b4/ff+7e02b5/01+7e02aa/ff+7e02ab/ff+7e02ac/ff+7e02ad/ff+7e02ae/ff+7e02af/ff+7e02b0/ff+7e02b1/ff+7e02b2/ff cartridge sha256:3ffbb6e0ccf8e9f5e4c72d9fe526a16371e562b71a91d6430e562bf358a5126b name:Jack Nicklaus Golf (USA) cheat description:Ball goes in from anywhere code:00cca9/4e+00cca8/80 cheat description:Infinite mulligans code:009e1d/bd cheat description:Mulligan can be taken after any stroke code:009dd1/80 cheat description:No mulligans allowed code:009dca/00 cheat description:Each round ends after hole 1 code:00e5ee/01+03f099/00 cheat description:Each round ends after hole 2 code:00e5ee/02+03f099/01 cheat description:Each round ends after hole 3 code:00e5ee/03+03f099/02 cheat description:Each round ends after hole 4 code:00e5ee/04+03f099/03 cheat description:Each round ends after hole 5 code:00e5ee/05+03f099/04 cheat description:Each round ends after hole 6 code:00e5ee/06+03f099/05 cheat description:Each round ends after hole 7 code:00e5ee/07+03f099/06 cheat description:Each round ends after hole 8 code:00e5ee/08+03f099/07 cheat description:Each round ends after hole 9 code:00e5ee/09+03f099/08 cheat description:Each round ends after hole 10 code:00e5ee/0a+03f099/09 cheat description:Each round ends after hole 11 code:00e5ee/0b+03f099/0a cheat description:Each round ends after hole 12 code:00e5ee/0c+03f099/0b cheat description:Each round ends after hole 13 code:00e5ee/0d+03f099/0c cheat description:Each round ends after hole 14 code:00e5ee/0e+03f099/0d cheat description:Each round ends after hole 15 code:00e5ee/0f+03f099/0e cheat description:Each round ends after hole 16 code:00e5ee/10+03f099/0f cheat description:Each round ends after hole 17 code:00e5ee/11+03f099/10 cartridge sha256:9cf82dd9a851cdc38bf2afc286c077ff18a0a5d3bb301eba606cc52db62f8965 name:James Bond Jr (USA) cheat description:Infinite health (can still be hurt by some things) code:06d09a/af cheat description:Infinite Grenades code:06dac6/ad cheat description:Infinite Darts code:06dc30/ad cheat description:Infinite lives on the ground code:00f245/ad cheat description:Infinite lives in the air code:028ea5/ad cheat description:Hearts worth 0 code:06ea06/ad cheat description:Large red Grenade worth 0 instead of 5 code:06ea2d/00 cheat description:Large red Grenade worth 10 code:06ea2d/0a cheat description:Large red Grenade worth 20 code:06ea2d/14 cheat description:Large red Grenade worth 30 code:06ea2d/1e cheat description:Large red Grenade worth 40 code:06ea2d/28 cheat description:Small silver Grenade worth 0 instead of 1 code:06ebc0/ea cheat description:Start with 1 life on the ground instead of 5 code:00c24d/01 cheat description:Start with 3 lives on the ground code:00c24d/03 cheat description:Start with 7 lives on the ground code:00c24d/07 cheat description:Start with 9 lives on the ground code:00c24d/09 cheat description:Start with 1 life in the air instead of 5 code:0080b3/01 cheat description:Start with 3 lives in the air code:0080b3/03 cheat description:Start with 7 lives in the air code:0080b3/07 cheat description:Start with 9 lives in the air code:0080b3/09 cheat description:Start with 0 Grenades and Darts instead of 10 code:00f236/00 cheat description:Start with 5 Grenades and Darts code:00f236/05 cheat description:Start with 25 Grenades and Darts code:00f236/19 cheat description:Start with 50 Grenades and Darts code:00f236/32 cheat description:Start with 99 Grenades and Darts code:00f236/63 cheat description:Start with 0 Darts instead of 10 code:00c259/00+00f23b/af cheat description:Start with 5 Darts code:00c259/05+00f23b/af cheat description:Start with 25 Darts code:00c259/19+00f23b/af cheat description:Start with 50 Darts code:00c259/32+00f23b/af cheat description:Start with 99 Darts code:00c259/63+00f23b/af cheat description:Start on level 3 code:00c2a1/a9+00c2a2/01 cheat description:Start on level 5 code:00c2a1/a9+00c2a2/02 cheat description:Start on level 7 code:00c2a1/a9+00c2a2/03 cheat description:Start on level 3, part 2 code:00c29f/a9+00c2a0/04+00c2a1/80 cheat description:Start on level 3, part 3 code:00c29f/a9+00c2a0/07+00c2a1/80 cheat description:Start on level 5, part 2 code:00c29f/a9+00c2a0/05+00c2a1/80 cheat description:Start on level 5, part 3 code:00c29f/a9+00c2a0/08+00c2a1/80 cheat description:Start on level 7, part 2 code:00c29f/a9+00c2a0/06+00c2a1/80 cheat description:Start on level 7, part 3 code:00c29f/a9+00c2a0/09+00c2a1/80 cartridge sha256:f5e74f09c485d58b444ef2b168d041a1d451056b5feb295901974ca73190dbdb name:Jelly Boy (Europe) cheat description:Infinite lives code:80dbb4/ad cheat description:Infinite time code:81fde1/ad cheat description:Don't lose Music Notes when hit (can get stuck) code:80dc87/ad cartridge sha256:bc09f97cb988f6e445fc92e438fff4bf97aa56cb7bbecaa234ffe93bb285d915 name:Jelly Boy 2 (Japan) (Proto) cheat description:Invincibility code:7e026b/03 cheat description:Infinite lives code:7e0269/03 cartridge sha256:85e5f6fedc420925557092d728e1dc6b4e2042368fb78bf93c0df447f8c9c0c0 name:Jeopardy! (USA) cheat description:Always get the correct answer code:00aeb2/80+00aefb/80 cartridge sha256:ee7a29eb9c302ea2bb235ef990fd8344a6beb9817499941c40a8a94ad5f7c964 name:Jetsons, The - Invasion of the Planet Pirates (USA) cheat description:Invincibility code:8189de/ea cheat description:Infinite lives code:808c0e/ad cheat description:Infinite time code:80c402/ad cheat description:Maximum vacuum power code:80919a/04 cartridge sha256:6a2f280ed1ef5166d95e3b0eb1a6665564f7ddcfd3feaf53344a1268b54b85c6 name:Jikkyou Oshaberi Parodius (Japan) cheat description:Infinite lives code:7e00ac/04 cartridge sha256:a314583b11d594b8245b5177aa64a4d3b7497d096edabbea7c1842c57aa2ad2b name:Jim Lee's WildC.A.T.S - Covert-Action-Teams (USA) cheat description:Invincibility code:8aa672/ad cheat description:Infinite health code:8a82ae/bd cheat description:Infinite lives code:8a9935/ea cheat description:Infinite health (alt) code:7e401e/48 cheat description:Infinite lives (alt) code:7e1f93/03 cheat description:Infinite bombs code:7e1f95/09 cartridge sha256:6f0bec87ece503b0fbe108cd159ed6f5fa7711b1c4fe31e982af41ad5c638093 name:Jim Power - The Lost Dimension in 3D (USA) cheat description:Invincibility code:80c191/af cheat description:Infinite lives code:80c205/a5 cheat description:Infinite time code:81df47/a5 cheat description:Infinite SB code:80e81e/a5 cheat description:Invincibility (alt) code:7e074e/39 cheat description:Infinite lives (alt) code:7e003f/09 cheat description:Infinite time (alt) code:7e0043/ff cheat description:Infinite SB (alt) code:7e0041/09 cheat description:Hit anywhere code:81e63e/ff+81e63f/ff+81e736/ad cheat description:Jump as high as you want and jump through walls (disable to come back down) code:7e077e/10 cartridge sha256:3b2b8b813b58049a4a86ce1c42d2a651f19fd9bbab2407a494e20cf343d3c1a4 name:Joe & Mac (USA) cheat description:Invincibility after one hit code:00daa8/b5 cheat description:Infinite health code:009ec8/d9 cheat description:Infinite health (alt) code:009ec8/b9 cheat description:Infinite lives code:00e089/00 cheat description:Infinite lives (alt) code:00e08a/b5 cheat description:Infinite Keys code:02ec8d/a5 cheat description:All food fully restores health code:00f546/00 cheat description:Hit anywhere code:00a1e3/80+00f070/a5+00a12e/00 cheat description:One hit kills code:00a1ac/24 cheat description:Start with 2 lives code:00aab9/a9+00aaba/01 cheat description:Start with 6 lives code:00aab9/a9+00aaba/05 cheat description:Start with 10 lives code:00aab9/a9+00aaba/09 cheat description:Infinite health - P1 code:7e081c/14 cheat description:Infinite health - P2 code:7e085c/0f cheat description:Infinite lives - P1 code:7e0822/05 cheat description:Infinite lives - P2 code:7e0862/05 cheat description:Have no weapon - P1 code:7e081a/b8 cheat description:Have no weapon - P2 code:7e085a/b8 cheat description:Have Bone - P1 code:7e081a/b9 cheat description:Have Bone - P2 code:7e085a/b9 cheat description:Have Boomerang - P1 code:7e081a/ba cheat description:Have Boomerang - P2 code:7e085a/ba cheat description:Have Fire - P1 code:7e081a/bb cheat description:Have Fire - P2 code:7e085a/bb cheat description:Have Wheel - P1 code:7e081a/bc cheat description:Have Wheel - P2 code:7e085a/bc cartridge sha256:38451dcbbcd7069ba232e704dcb747a1438bab0a9508218611a027a7f8dfd547 name:Joe & Mac 2 - Lost in the Tropics (USA) (Beta) cheat description:Infinite health code:80b1de/95 cheat description:Infinite lives code:80e307/b5 cheat description:Start with $2020 code:80e39d/c3 cartridge sha256:c9889799a9ae8558f26d66ae546db930c99acb78d921b4395afbbc38da6272aa name:Joe & Mac 2 - Lost in the Tropics (USA) cheat description:Infinite health code:80b232/95 cheat description:Infinite lives code:80af6a/95 cheat description:Hit anywhere (disable to enter stores and houses) code:80eded/00+80ef23/00+828a8f/00 cheat description:Start with $2020 code:80e41f/c3 cartridge sha256:5a76347672ea7d27bb334b1e30bbc73e06f92373883bed499245377327a8f0cf name:John Madden Football (USA) cheat description:Always 1st down code:00ca9b/ad cheat description:Infinite time-outs code:00d32d/ea cheat description:Play clock is 20 seconds instead of 45 code:00c3d8/14 cheat description:Play clock is 30 seconds code:00c3d8/1e cheat description:Play clock is 60 seconds (CPU will run down the play clock) code:00c3d8/3c cheat description:Play clock is 90 seconds (CPU will run down the play clock) code:00c3d8/5a cheat description:Only have 3 plays to get a first down or TD (down counter starts at 2) code:00cae1/02 cheat description:Only have 2 plays to get a first down or TD (down counter starts at 3) code:00cae1/03 cheat description:Only have 1 play to get a first down or TD (down counter starts at 4) code:00cae1/04 cheat description:No time-outs instead of 3 - P1 code:008f59/00 cheat description:6 time-outs - P1 code:008f59/06 cheat description:9 time-outs - P1 code:008f59/09 cheat description:No time-outs - P2 code:008f5a/00 cheat description:6 time-outs - P2 code:008f5a/06 cheat description:9 time-outs - P2 code:008f5a/09 cheat description:Safeties worth 1 point instead of 2 code:00cb86/bd cheat description:Safeties worth 0 points code:00cb86/bd+00cb89/bd cheat description:Touchdowns worth 0 points instead of 6 code:00cd2e/00 cheat description:Touchdowns worth 1 point code:00cd2e/01 cheat description:Touchdowns worth 2 points code:00cd2e/02 cheat description:Touchdowns worth 3 points code:00cd2e/03 cheat description:Touchdowns worth 4 points code:00cd2e/04 cheat description:Touchdowns worth 5 points code:00cd2e/05 cheat description:Touchdowns worth 7 points code:00cd2e/07 cheat description:Touchdowns worth 8 points code:00cd2e/08 cheat description:Touchdowns worth 9 points code:00cd2e/09 cheat description:Extra points and field goals worth 0 code:00cf3d/ea+00cf3e/ea cheat description:Extra point or field goal resets score to 0 code:00cf3f/9e cheat description:Start with 3 points - P1 code:008ea1/a9+008ea4/8d+008ea5/26+008eaa/f0+008ea2/03 cheat description:Start with 5 points - P1 code:008ea1/a9+008ea4/8d+008ea5/26+008eaa/f0 cheat description:Start with 9 points - P1 code:008ea1/a9+008ea4/8d+008ea5/26+008eaa/f0+008ea2/09 cheat description:Start with 12 points - P1 code:008ea1/a9+008ea4/8d+008ea5/26+008eaa/f0+008ea2/0c cheat description:Start with 15 points - P1 code:008ea1/a9+008ea4/8d+008ea5/26+008eaa/f0+008ea2/0f cheat description:Start with 20 points - P1 code:008ea1/a9+008ea4/8d+008ea5/26+008eaa/f0+008ea2/14 cheat description:Start with 3 points - P2 code:008ea1/a9+008ea4/8d+008ea5/2b+008eaa/f0+008ea2/03 cheat description:Start with 5 points - P2 code:008ea1/a9+008ea4/8d+008ea5/2b+008eaa/f0 cheat description:Start with 9 points - P2 code:008ea1/a9+008ea4/8d+008ea5/2b+008eaa/f0+008ea2/09 cheat description:Start with 12 points - P2 code:008ea1/a9+008ea4/8d+008ea5/2b+008eaa/f0+008ea2/0c cheat description:Start with 15 points - P2 code:008ea1/a9+008ea4/8d+008ea5/2b+008eaa/f0+008ea2/0f cheat description:Start with 20 points - P2 code:008ea1/a9+008ea4/8d+008ea5/2b+008eaa/f0+008ea2/14 cartridge sha256:3e62872bf69ea90dd7093608268f8defa2c6016adb1011745dab3c2af45d69b7 name:John Madden Football '93 (USA) cheat description:Infinite timeouts - both players code:00e1c7/ea cheat description:9 timeouts - P1 code:0be04b/09 cheat description:6 timeouts - P1 code:0be04b/06 cheat description:1 timeout - P1 code:0be04b/01 cheat description:9 timeouts - P2 code:0be04c/09 cheat description:6 timeouts - P2 code:0be04c/06 cheat description:1 timeout - P2 code:0be04c/01 cartridge sha256:67fa7115eb6bf292c024c3a8b06ce9bd457c4d46de182a06a573afff968cc0f1 name:Judge Dredd (USA) cheat description:Invincible after first hit code:a4d1a7/ad cheat description:Almost infinite health code:a4cd53/ad cheat description:Almost infinite ammo code:ba94f0/ad cheat description:Don't flash after getting hit code:a4cd5a/00 cheat description:Don't flash as long after getting hit code:a4cd5a/32 cheat description:Flash longer after getting hit code:a4cd5a/ff cheat description:Start with all weapons and almost infinite ammo code:ba8de9/ff cheat description:Start with very little energy on your first life code:ba8e0b/0f cheat description:Start with half energy on your first life code:ba8e0b/80 cheat description:Start with about 3/4 energy on your first life code:ba8e0b/c6 cheat description:Start with very little energy after first life code:a4ecce/0f cheat description:Start with half energy after first life code:a4ecce/80 cheat description:Start with about 3/4 energy after first life code:a4ecce/c6 cheat description:Start with 1 life code:ba8dd3/01 cheat description:Start with 5 lives code:ba8dd3/05 cheat description:Start with 9 lives code:ba8dd3/09 cheat description:Invincibility code:7e1a91/01 cheat description:Infinite health code:7e1b11/ff cheat description:Infinite lives code:7e1af7/09 cheat description:Infinte Grenades code:7e1b01/99 cheat description:Infinite Boing code:7e1b0d/99 cheat description:Infinite Richochet code:7e1aff/99 cheat description:Infinite Seeker code:7e1b09/99 cheat description:Infinite Double Whammie code:7e1b0b/99 cheat description:Infinite Incindiary code:7e1b05/99 cheat description:Infinte High Explosive code:7e1b03/99 cheat description:Infinte Armor Piercing code:7e1b07/99 cheat description:Infinite Flare code:7e1b0f/99 cheat description:Infinite Hover Board and Hover Boots code:7e1aa5/f9 cartridge sha256:02cb423199be3368fc2b40148f83b7a48900394983e04d43f94bb7d76ce44e94 name:Judge Dredd (Europe) cheat description:Invincibility code:7e1a91/01 cheat description:Infinite health code:7e1b11/ff cheat description:Infinite lives code:7e1af7/09 cheat description:Infinte Grenades code:7e1b01/99 cheat description:Infinite Boing code:7e1b0d/99 cheat description:Infinite Richochet code:7e1aff/99 cheat description:Infinite Seeker code:7e1b09/99 cheat description:Infinite Double Whammie code:7e1b0b/99 cheat description:Infinite Incindiary code:7e1b05/99 cheat description:Infinte High Explosive code:7e1b03/99 cheat description:Infinte Armor Piercing code:7e1b07/99 cheat description:Infinite Flare code:7e1b0f/99 cheat description:Infinite Hover Board and Hover Boots code:7e1aa5/f9 cartridge sha256:771a0322d9f5f8e13a52d01e80257a1f75cc693cf4abf74793520eb5f8b5580e name:Jungle Book, The (USA) cheat description:Infinite weapons code:808810/00 cheat description:Infinite lives code:80a8ad/ad cheat description:Hearts from big jungle fruit restore all energy code:80a316/00 cheat description:Super-jump - Mowgli code:80abc3/fb cheat description:Mega-jump - Mowgli code:80abc3/fa cheat description:20 seconds from hourglass code:80a547/02 cheat description:30 seconds from hourglass code:80a547/03 cheat description:Bonus gems worth 2 (don't collect over 100) code:80a4c0/02 cheat description:Bonus gems worth 3 (don't collect over 100) code:80a4c0/03 cheat description:Bonus gems worth 4 (don't collect over 100) code:80a4c0/04 cheat description:Red gems worth 2 (don't collect over 100) code:80a4d7/02 cheat description:Red gems worth 3 (don't collect over 100) code:80a4d7/03 cheat description:Red gems worth 4 (don't collect over 100) code:80a4d7/04 cheat description:The amazing rock (just for fun) code:80807f/00 cheat description:Start with 9 hearts (normal game) code:80fd16/09 cheat description:Start with 6 hearts (normal game) code:80fd16/06 cheat description:Start with 1 heart (normal game) code:80fd16/01 cheat description:Start with 10 lives (normal game) code:80fd10/09 cheat description:Start with 2 lives (normal game) code:80fd10/01 cheat description:Invincibility code:7e068c/31 cheat description:Infinite health code:7e010b/04 cheat description:Have 99 green gems code:7e015d/99 cheat description:Have 99 red gems code:7e015e/99 cartridge sha256:8d812ea4fa897274116f7f43bc689e110f1cfbd3f7eb3a1737c2a85d36369159 name:Jungle Strike (USA) cheat description:Infinite ammo code:80c47e/ad cheat description:Infinite armor code:80cc57/ad cheat description:Infinite lives code:809af8/af cheat description:Start with less fuel code:81ba7c/32 cheat description:Start with more fuel code:81ba7c/32 cheat description:Start with mega fuel code:81ba7d/32 cheat description:Start with 0 hellfires code:81ba8e/00 cheat description:Start with more hellfires code:81ba8e/96 cheat description:Start with mega hellfires code:81ba8f/96 cheat description:Start with less gun ammo code:81ba9b/00 cheat description:Start with more gun ammo code:81ba9b/16 cheat description:Start with mega gun ammo code:81ba9b/32 cheat description:Start with less hydras code:81ba94/19 cheat description:Start with more hydras code:81ba94/ff cheat description:Start with mega hydras code:81ba95/32 cartridge sha256:0a4e9d6fa2ac16aa51da5538d93280734de480e44c430173ed14826c84553c7d name:Jurassic Park (USA) (Rev 1) cheat description:Infinite lives code:8180cd/ad cheat description:Cattle Prod energy recharges to about 3/4 full when outside code:80b2d7/18 cheat description:Cattle Prod energy recharges to about 1/2 full when outside code:80b2d7/10 cheat description:Cattle Prod energy recharges to about 1/4 full when outside code:80b2d7/08 cheat description:Infinite Cattle Prod energy when outside code:80b27e/ad cheat description:Infinite 1st weapons when outside code:80af99/ad cheat description:Infinite 2nd weapons when outside (except gas grenade) code:80b053/bd cheat description:Cattle Prod energy recharges to 1/2 full when inside code:80fcce/f0 cheat description:Infinite Cattle Prod energy when inside code:a1bcd6/ad cheat description:Infinite 1st weapons when inside code:a1af2a/ea+a1afc0/ea cheat description:Infinite 2nd weapons when inside (except gas grenade) code:a1ab84/ad cheat description:Infinite continues with 4 lives code:8192b8/ad cheat description:Continue 1st time with 5 lives code:8192a3/04 cheat description:Continue with 5 lives after 1st continue code:8192ac/04 cheat description:Start with 1 egg needed code:81d7ea/01 cheat description:Start with 2 lives code:81d7f0/01 cheat description:Start with 4 lives code:81d7f0/03 cheat description:Infinite health code:7e02eb/03 cheat description:Infinite lives (alt) code:7e02a3/03 cheat description:Infinite ammo - all weapons code:7e028b/20+7e0295/20+7e029f/20 cheat description:Generator on code:7e00f0/ef cheat description:Have level 1 security card code:7e0265/01 cheat description:Have level 2 security card code:7e0267/01 cheat description:Have all 18 Eggs code:7e0e0f/00+7e0e10/00 cheat description:Have John Hammond ID Card code:7e0253/01 cheat description:Have Dr. Ellie Sattler ID Card code:7e0255/01 cheat description:Have Robert Muldoon ID Card code:7e0257/01 cheat description:Have Dr. Allen Grant ID Card code:7e0259/01 cheat description:Have Donald Gennaro ID Card code:7e025b/01 cheat description:Have Ray Arnold ID Card code:7e025e/01 cheat description:Have Dennis Nedry ID Card code:7e0260/01 cheat description:Have Dr. Henry Wu ID Card code:7e0261/01 cheat description:Have Dr. Ian Malcolm ID Card code:7e0263/01 cartridge sha256:fe91d45201753ae9655d5ce38838e352f478b26b2d933c1bcb5bd8330121f9ff name:Jurassic Park (USA) cheat description:Infinite lives code:8180cd/ad cheat description:Cattle Prod energy recharges to about 3/4 full when outside code:80b2d7/18 cheat description:Cattle Prod energy recharges to about 1/2 full when outside code:80b2d7/10 cheat description:Cattle Prod energy recharges to about 1/4 full when outside code:80b2d7/08 cheat description:Infinite Cattle Prod energy when outside code:80b27e/ad cheat description:Infinite 1st weapons when outside code:80af99/ad cheat description:Infinite 2nd weapons when outside (except gas grenade) code:80b053/bd cheat description:Cattle Prod energy recharges to 1/2 full when inside code:80fcce/f0 cheat description:Infinite Cattle Prod energy when inside code:a1bcd6/ad cheat description:Infinite 1st weapons when inside code:a1af2a/ea+a1afc0/ea cheat description:Infinite 2nd weapons when inside (except gas grenade) code:a1ab84/ad cheat description:Infinite continues with 4 lives code:8192b8/ad cheat description:Continue 1st time with 5 lives code:8192a3/04 cheat description:Continue with 5 lives after 1st continue code:8192ac/04 cheat description:Start with 1 egg needed code:81d7ea/01 cheat description:Start with 2 lives code:81d7f0/01 cheat description:Start with 4 lives code:81d7f0/03 cheat description:Infinite health code:7e02eb/03 cheat description:Infinite lives (alt) code:7e02a3/03 cheat description:Infinite ammo - all weapons code:7e028b/20+7e0295/20+7e029f/20 cheat description:Generator on code:7e00f0/ef cheat description:Have level 1 security card code:7e0265/01 cheat description:Have level 2 security card code:7e0267/01 cheat description:Have all 18 Eggs code:7e0e0f/00+7e0e10/00 cheat description:Have John Hammond ID Card code:7e0253/01 cheat description:Have Dr. Ellie Sattler ID Card code:7e0255/01 cheat description:Have Robert Muldoon ID Card code:7e0257/01 cheat description:Have Dr. Allen Grant ID Card code:7e0259/01 cheat description:Have Donald Gennaro ID Card code:7e025b/01 cheat description:Have Ray Arnold ID Card code:7e025e/01 cheat description:Have Dennis Nedry ID Card code:7e0260/01 cheat description:Have Dr. Henry Wu ID Card code:7e0261/01 cheat description:Have Dr. Ian Malcolm ID Card code:7e0263/01 cartridge sha256:5eff7c27f69b3ebc1ec1294ffcd1debf3512bc3e6c1c75fbdc5e778dcaaba1c9 name:Jurassic Park Part 2 - The Chaos Continues (USA) (En,Fr,De,It) cheat description:Almost invincible code:b4f297/b9+a08d7a/b9 cheat description:Invincibility after one hit until you enter a new screen code:809a8d/bd cheat description:Infinite health against some larger dinosaurs code:b4f301/80 cheat description:One hit kills on some dinosaurs code:a080dc/02 cheat description:Regular Gun is super strong code:938dc2/40 cheat description:Flash longer after getting hit code:80e543/ff cheat description:Don't flash after getting hit code:80e543/00 cheat description:Velociraptor takes more damage code:aeaa70/20 cheat description:Start with less Machine Gun ammo code:9ca344/0f cheat description:Start with more Shotgun ammo code:9ca34b/64 cheat description:Start with less Tranquilizer Gun ammo code:9ca359/10 cheat description:Start with more Tranquilizer Missiles code:9ca360/64 cheat description:Invincibility - P1 code:7eb04a/0e cheat description:Infinite health - P1 code:7eb032/28 cheat description:Infinite Machine Gun ammo code:7ea9b0/ff cheat description:Infinite Shotgun ammo code:7ea9b2/ff cheat description:Infinite Grenade Launcher code:7ea9b6/ff cheat description:Infinite Dino stock code:7e0008/64 cheat description:Have Rifle code:7eb040/00 cheat description:Have Machine Gun code:7eb040/01 cheat description:Have Shotgun code:7eb040/02 cheat description:Have Charge Gun code:7eb040/03 cheat description:Have Tranquilizer Gun code:7eb040/04 cheat description:Have Big Bomb Gun code:7eb040/05 cheat description:Have Big Bomb Gun with Dinosaur icon code:7eb040/07 cheat description:Have Needle Gun with clock icon code:7eb040/08 cartridge sha256:7f05959f423bc656091ea3bddfbc89c877ae243dca346f63233e27973f34e0eb name:Justice League Task Force (USA) cheat description:Infinite health - P1 code:7e0cf7/60 cheat description:No health - P2 code:7e0cf9/00 cheat description:Infinite time code:7e0335/99 cheat description:Hit anywhere - Normal Attacks - P1 code:80c7e1/80+80c7e2/1e cheat description:Hit anywhere - Normal Attacks - P2 code:80c85c/80+80c85d/1e cheat description:Hit anywhere - Projectiles - both players code:808685/80+808686/1e cheat description:Win match after one round code:7e0547/02+7e0efb/02 cartridge sha256:05152bcf9bf086e7bcdbfa7dd8edfe2085f1339c4d7e193e0071c49a10471ef4 name:Ka-blooey (USA) cheat description:Infinite lives code:008165/ad cheat description:Bonus timer doesn't count down code:00d231/ea cheat description:Level is completed after only one bomb goes off code:00a9bc/9c cheat description:Start with 1 life instead of 5 code:00809e/01 cheat description:Start with 3 lives code:00809e/03 cheat description:Start with 10 lives code:00809e/0a cheat description:Start with 25 lives code:00809e/19 cheat description:Start with 50 lives code:00809e/32 cheat description:Start with 75 lives code:00809e/4b cheat description:Start with 98 lives code:00809e/62 cheat description:Start on level 2 code:00dd7c/9c+00dd78/01 cheat description:Start on level 3 code:00dd7c/9c+00dd78/02 cheat description:Start on level 4 code:00dd7c/9c+00dd78/03 cheat description:Start on level 5 code:00dd7c/9c+00dd78/04 cheat description:Start on level 6 code:00dd7c/9c+00dd78/05 cheat description:Start on level 7 code:00dd7c/9c+00dd78/06 cheat description:Start on level 8 code:00dd7c/9c+00dd78/07 cheat description:Start on level 9 code:00dd7c/9c+00dd78/08 cheat description:Start on level 10 code:00dd7c/9c+00dd78/09 cheat description:Start on level 11 code:00dd7c/9c+00dd78/0a cheat description:Start on level 12 code:00dd7c/9c+00dd78/0b cheat description:Start on level 13 code:00dd7c/9c+00dd78/0c cheat description:Start on level 14 code:00dd7c/9c+00dd78/0d cheat description:Start on level 15 code:00dd7c/9c+00dd78/0e cheat description:Start on level 16 code:00dd7c/9c+00dd78/0f cheat description:Start on level 17 code:00dd7c/9c+00dd78/10 cheat description:Start on level 18 code:00dd7c/9c+00dd78/11 cheat description:Start on level 19 code:00dd7c/9c+00dd78/12 cheat description:Start on level 20 code:00dd7c/9c+00dd78/13 cheat description:Start on level 21 code:00dd7c/9c+00dd78/14 cheat description:Start on level 22 code:00dd7c/9c+00dd78/15 cheat description:Start on level 23 code:00dd7c/9c+00dd78/16 cheat description:Start on level 24 code:00dd7c/9c+00dd78/17 cheat description:Start on level 25 code:00dd7c/9c+00dd78/18 cheat description:Start on level 26 code:00dd7c/9c+00dd78/19 cheat description:Start on level 27 code:00dd7c/9c+00dd78/1a cheat description:Start on level 28 code:00dd7c/9c+00dd78/1b cheat description:Start on level 29 code:00dd7c/9c+00dd78/1c cheat description:Start on level 30 code:00dd7c/9c+00dd78/1d cheat description:Start on level 31 code:00dd7c/9c+00dd78/1e cheat description:Start on level 32 code:00dd7c/9c+00dd78/1f cheat description:Start on level 33 code:00dd7c/9c+00dd78/20 cheat description:Start on level 34 code:00dd7c/9c+00dd78/21 cheat description:Start on level 35 code:00dd7c/9c+00dd78/22 cheat description:Start on level 36 code:00dd7c/9c+00dd78/23 cheat description:Start on level 37 code:00dd7c/9c+00dd78/24 cheat description:Start on level 38 code:00dd7c/9c+00dd78/25 cheat description:Start on level 39 code:00dd7c/9c+00dd78/26 cheat description:Start on level 40 code:00dd7c/9c+00dd78/27 cheat description:Start on level 41 code:00dd7c/9c+00dd78/28 cheat description:Start on level 42 code:00dd7c/9c+00dd78/29 cheat description:Start on level 43 code:00dd7c/9c+00dd78/2a cheat description:Start on level 44 code:00dd7c/9c+00dd78/2b cheat description:Start on level 45 code:00dd7c/9c+00dd78/2c cheat description:Start on level 46 code:00dd7c/9c+00dd78/2d cheat description:Start on level 47 code:00dd7c/9c+00dd78/2e cheat description:Start on level 48 code:00dd7c/9c+00dd78/2f cheat description:Start on level 49 code:00dd7c/9c+00dd78/30 cheat description:Start on level 50 code:00dd7c/9c+00dd78/31 cheat description:Start on level 51 code:00dd7c/9c+00dd78/32 cheat description:Start on level 52 code:00dd7c/9c+00dd78/33 cheat description:Start on level 53 code:00dd7c/9c+00dd78/34 cheat description:Start on level 54 code:00dd7c/9c+00dd78/35 cheat description:Start on level 55 code:00dd7c/9c+00dd78/36 cheat description:Start on level 56 code:00dd7c/9c+00dd78/37 cheat description:Start on level 57 code:00dd7c/9c+00dd78/38 cheat description:Start on level 58 code:00dd7c/9c+00dd78/39 cheat description:Start on level 59 code:00dd7c/9c+00dd78/3a cheat description:Start on level 60 code:00dd7c/9c+00dd78/3b cheat description:Start on level 61 code:00dd7c/9c+00dd78/3c cheat description:Start on level 62 code:00dd7c/9c+00dd78/3d cheat description:Start on level 63 code:00dd7c/9c+00dd78/3e cheat description:Start on level 64 code:00dd7c/9c+00dd78/3f cheat description:Start on level 65 code:00dd7c/9c+00dd78/40 cheat description:Start on level 66 code:00dd7c/9c+00dd78/41 cheat description:Start on level 67 code:00dd7c/9c+00dd78/42 cheat description:Start on level 68 code:00dd7c/9c+00dd78/43 cheat description:Start on level 69 code:00dd7c/9c+00dd78/44 cheat description:Start on level 70 code:00dd7c/9c+00dd78/45 cheat description:Start on level 71 code:00dd7c/9c+00dd78/46 cheat description:Start on level 72 code:00dd7c/9c+00dd78/47 cheat description:Start on level 73 code:00dd7c/9c+00dd78/48 cheat description:Start on level 74 code:00dd7c/9c+00dd78/49 cheat description:Start on level 75 code:00dd7c/9c+00dd78/4a cheat description:Start on level 76 code:00dd7c/9c+00dd78/4b cheat description:Start on level 77 code:00dd7c/9c+00dd78/4c cheat description:Start on level 78 code:00dd7c/9c+00dd78/4d cheat description:Start on level 79 code:00dd7c/9c+00dd78/4e cheat description:Start on level 80 code:00dd7c/9c+00dd78/4f cheat description:Start on level 81 code:00dd7c/9c+00dd78/50 cheat description:Start on level 82 code:00dd7c/9c+00dd78/51 cheat description:Start on level 83 code:00dd7c/9c+00dd78/52 cheat description:Start on level 84 code:00dd7c/9c+00dd78/53 cheat description:Start on level 85 code:00dd7c/9c+00dd78/54 cheat description:Start on level 86 code:00dd7c/9c+00dd78/55 cheat description:Start on level 87 code:00dd7c/9c+00dd78/56 cheat description:Start on level 88 code:00dd7c/9c+00dd78/57 cheat description:Start on level 89 code:00dd7c/9c+00dd78/58 cheat description:Start on level 90 code:00dd7c/9c+00dd78/59 cheat description:Start on level 91 code:00dd7c/9c+00dd78/5a cheat description:Start on level 92 code:00dd7c/9c+00dd78/5b cheat description:Start on level 93 code:00dd7c/9c+00dd78/5c cheat description:Start on level 94 code:00dd7c/9c+00dd78/5d cheat description:Start on level 95 code:00dd7c/9c+00dd78/5e cheat description:Start on level 96 code:00dd7c/9c+00dd78/5f cheat description:Start on level 97 code:00dd7c/9c+00dd78/60 cheat description:Start on level 98 code:00dd7c/9c+00dd78/61 cheat description:Start on level 99 code:00dd7c/9c+00dd78/62 cheat description:Start on level 100 code:00dd7c/9c+00dd78/63 cheat description:Start on level 101 code:00dd7c/9c+00dd78/64 cheat description:Start on level 102 code:00dd7c/9c+00dd78/65 cheat description:Start on level 103 code:00dd7c/9c+00dd78/66 cheat description:Start on level 104 code:00dd7c/9c+00dd78/67 cheat description:Start on level 105 code:00dd7c/9c+00dd78/68 cheat description:Start on level 106 code:00dd7c/9c+00dd78/69 cheat description:Start on level 107 code:00dd7c/9c+00dd78/6a cheat description:Start on level 108 code:00dd7c/9c+00dd78/6b cheat description:Start on level 109 code:00dd7c/9c+00dd78/6c cheat description:Start on level 110 code:00dd7c/9c+00dd78/6d cheat description:Start on level 111 code:00dd7c/9c+00dd78/6e cheat description:Start on level 112 code:00dd7c/9c+00dd78/6f cheat description:Start on level 113 code:00dd7c/9c+00dd78/70 cheat description:Start on level 114 code:00dd7c/9c+00dd78/71 cheat description:Start on level 115 code:00dd7c/9c+00dd78/72 cheat description:Start on level 116 code:00dd7c/9c+00dd78/73 cheat description:Start on level 117 code:00dd7c/9c+00dd78/74 cheat description:Start on level 118 code:00dd7c/9c+00dd78/75 cheat description:Start on level 119 code:00dd7c/9c+00dd78/76 cheat description:Start on level 120 code:00dd7c/9c+00dd78/77 cheat description:Start on level 121 code:00dd7c/9c+00dd78/78 cheat description:Start on level 122 code:00dd7c/9c+00dd78/79 cheat description:Start on level 123 code:00dd7c/9c+00dd78/7a cheat description:Start on level 124 code:00dd7c/9c+00dd78/7b cheat description:Start on level 125 code:00dd7c/9c+00dd78/7c cheat description:Start on level 126 code:00dd7c/9c+00dd78/7d cheat description:Start on level 127 code:00dd7c/9c+00dd78/7e cheat description:Start on level 128 code:00dd7c/9c+00dd78/7f cheat description:Start on level 129 code:00dd7c/9c+00dd78/80 cheat description:Start on level 130 code:00dd7c/9c+00dd78/81 cartridge sha256:6f2dc2486d680fe557ed6e2e7082480aad6537c6a04845bb6a6b8ef5e3d698ef name:Kamen Rider (Japan) cheat description:Invincibility code:808bb0/ad cheat description:Infinite health code:808bb8/40+808bba/8f+808bbb/6a+808bbc/0c+808bbd/7e cheat description:Infinite lives code:81fd14/cd cheat description:Infinite health (alt) code:7e0c6a/40 cheat description:Infinite lives (alt) code:7e0038/02 cartridge sha256:f9ec39546e18b15b8f6a738204d0227c1542cd8157e3e0ea16934e76f39e288c name:Karura Ou (Japan) cheat description:Invincibility code:7e0065/9e cheat description:Infinite health code:7ef801/04 cheat description:Infinite special power code:7e1f0d/08 cheat description:Infinite Warrior Force code:7e0089/ff cheat description:Have 99 gems code:7e1f0e/63 cheat description:Have Aura Attack code:7e1f0b/01 cheat description:Have Comet Flash code:7e1f0b/02 cheat description:Have Lightning Strike code:7e1f0b/03 cheat description:Have Time Stop code:7e1f0b/04 cheat description:Have Star Fire code:7e1f0b/05 cheat description:Have Warrior Force code:7e1f0b/06 cheat description:Have Heal code:7e1f0b/07 cheat description:Have Fiery Phoenix code:7e1f0b/08 cheat description:All enemies frozen code:7efa60/8d+7efa61/8d+7efa62/8d+7efa63/8d+7efa64/8d+7efa65/8d+7efa66/8d+7efa67/8d+7efa68/8d+7efa69/8d+7efa6a/8d+7efa6b/8d+7efa6c/8d+7efa6d/8d+7efa6e/8d+7efa6f/8d+7efa70/8d+7efa71/8d+7efa72/8d+7efa73/8d+7efa74/8d+7efa75/8d+7efa76/8d+7efa77/8d+7efa78/8d+7efa79/8d+7efa7a/8d+7efa7b/8d+7efa7c/8d+7efa7d/8d+7efa7e/8d+7efa7f/8d cartridge sha256:7cc3693cc5e1e834d57795f04b048fab27864a898a9507e7ca383771e2035414 name:Kawasaki Caribbean Challenge (USA) cheat description:Only 1 lap required to qualify instead of 2 code:00821b/01 cheat description:Races are 1 lap instead of 5 code:00823e/01 cheat description:Races are 2 laps code:00823e/02 cheat description:Races are 3 laps code:00823e/03 cheat description:Races are 4 laps code:00823e/04 cheat description:Coming in first is worth 9 points instead of 5 code:00bdd0/09 cheat description:Coming in last is worth 5 points instead of 0 code:00bdd4/05 cheat description:Coming in last is worth 9 points code:00bdd4/09 cheat description:Always advance to the next island regardless of points code:00b841/80 cheat description:Each island requires 3 points instead of 5 code:00a9d5/03 cheat description:Each island requires 4 points code:00a9d5/04 cheat description:Each island requires 6 points code:00a9d5/06 cheat description:Each island requires 7 points code:00a9d5/07 cheat description:Opponents drive erratically - player is guaranteed 1st place code:00813f/85 cheat description:Start the Challenge with the 2nd motorcycle and jet ski code:00813d/85 cartridge sha256:3104d6c06c8909c56f6adb2faecf1b4382f2490370798b605631da926c5306d8 name:Ken Griffey Jr. Presents Major League Baseball (USA) cheat description:Can't strike out code:8491fd/ad cheat description:No outs except strike outs code:84c8d1/ad+84c8ce/ad cheat description:Can't walk a player code:8491e3/a9 cheat description:Invisible baserunners code:80da37/01 cheat description:2 outs and whole team is out code:80a5ed/02 cheat description:1 ball and you walk code:80a5ed/01 cheat description:2 balls and you walk code:80a5ed/02 cheat description:1 strike and you're out code:80a5f5/01 cheat description:2 strikes and you're out code:80a5f5/02 cheat description:Computer can't score code:80bfc7/ad cheat description:Computer can't score code:849c4d/a9 cheat description:Computer can't score code:80bfe8/ad cartridge sha256:b16661d5151d73cea5ac46d7c899531c7b2cdee2558092c23a5460c8092b80b8 name:Kendo Rage (USA) cheat description:Invincibility code:7e1476/03 cheat description:Infinite HP code:7e148e/40 cheat description:Infinite lives code:7e0ce2/03 cheat description:Infinite PSY power code:7e148a/40 cheat description:Multi-jump code:1f8cda/00 cheat description:Have 9 Yellow Balls code:7e1494/09 cheat description:Have Triple Shot code:7e1492/00 cheat description:Have Multi-Attack code:7e1492/08 cheat description:Have Flame Shot code:7e1492/10 cheat description:Start on round 1 - Cliff Hanger code:7e0ce4/00 cheat description:Start on round 2 - Ice Queen code:7e0ce4/01 cheat description:Start on round 3 - The Pond code:7e0ce4/02 cheat description:Start on round 4 - Technodvne code:7e0ce4/03 cheat description:Start on round 5 - The Commute code:7e0ce4/04 cheat description:Start on round 6 - Triathalon code:7e0ce4/05 cheat description:Start on round 7 - School Daze code:7e0ce4/06 cartridge sha256:914652f72d6ceb83b8b43414d6c42581ec12e9b3f45259b8b2768d26b8d4f073 name:Kid Klown in Crazy Chase (USA) cheat description:Infinite health code:80dd52/ad cheat description:Infinite continues code:84edb7/ad cartridge sha256:317e25d731bbfec30bfdc5fbe4ed825cd08613a4d62d98247bae5ec85783074c name:Kidou Butouden G Gundam (Japan) cheat description:Infinite health code:7e07d4/80 cartridge sha256:1b50f8aa5ae75c4b01e237b29b0a1ec1f1f809bdbe76a23d9c204541ccbf403d name:Kidou Senshi V Gundam (Japan) cheat description:Infinite health code:7e0522/69 cheat description:One hit kills code:7e06a2/00+7e0822/00 cheat description:Infinite lives code:7e0306/63 cartridge sha256:a1c04fc26c65a6ae3c3a496410290e7f437d19ac24a930286521ce04c887212a name:Kidou Soukou Dion (Japan) cheat description:Invincibility (blinking) code:7e0a50/4c cheat description:Infinite health code:7e0b48/05 cheat description:Infinite bombs code:7e0b14/09 cartridge sha256:2b27e9bceb646a300566248fcdcbd582435f50bd6132b0f0025cc146a9d62bd9 name:Kikou Keisatsu Metal Jack (Japan) cheat description:Invincibility code:00bfba/f0 cheat description:Infinite health code:18b7e6/a5 cheat description:Infinite lives code:00c33e/a5 cheat description:Infinite health (alt) code:7e0060/31 cheat description:Infinite lives (alt) code:7e0061/09 cheat description:Infinite time code:7e0031/06+7e0032/00 cheat description:Infinite ammo code:7e006b/63 cheat description:Moon-jump code:7e005f/01 cheat description:Moon-jump when attacking code:7e0072/20 cheat description:Can't walk code:7e006c/03 cartridge sha256:7a5261f1a5e84b67483c79fb002ce1539f2360f88333bda60f12e617d86e0def name:Killer Instinct (USA) (Rev 1) cheat description:Invincibility - P1 code:809f95/e0+809f99/c3+809f96/00+809f98/f0 cheat description:Hit anywhere - P1 code:809f82/4c+809f83/ac+809f84/a1+809f81/0d+809f80/f0 cheat description:Infinite health - P1 code:7e0d24/78+7e0d26/78 cheat description:Infinite health - P2 code:7e0d28/78+7e0d2a/78 cheat description:No health - P1 code:7e0d24/00+7e0d26/00 cheat description:No health - P2 code:7e0d28/00+7e0d2a/00 cheat description:One button finishes and humiliations code:80b229/00 cheat description:CPU cannot move from starting position code:7e0e08/01 cheat description:CPU cannot perform special or danger moves code:80d5cd/a9+80d5ce/00 cheat description:Play as Eyedol code:7e024e/0a cartridge sha256:618a23636e07110e094277ec1d1e60c3620a6e9a5f386292808267593fa803ad name:Killer Instinct (USA) cheat description:Master code - must be entered code:008468/ea cheat description:Invincibility - P1 code:809f8a/e0+809f8e/c3+809f8b/00+809f8d/f0 cheat description:Hit anywhere - P1 code:809f77/4c+809f79/a1+809f78/a1+809f76/0d+809f75/f0 cheat description:One button finishes and humiliations code:80b222/00 cheat description:CPU cannot perform special or danger moves code:80d624/a9+80d625/00 cheat description:P1 takes all damage code:80a76b/ff cheat description:Always fight Jago code:808d7a/ad+83f48c/84 cheat description:Always fight Combo code:808d7a/ad+83f48c/8f cheat description:Always fight Thunder code:808d7a/ad+83f48c/89 cheat description:Always fight Glacius code:808d7a/ad+83f48c/81 cheat description:Always fight Cinder code:808d7a/ad+83f48c/80 cheat description:Always fight Orchid code:808d7a/ad+83f48c/82 cheat description:Always Fight Riptor code:808d7a/ad+83f48c/94 cheat description:Always fight Sabrewulf code:808d7a/ad+83f48d/a9 cheat description:Always fight Spinal code:808d7a/ad+83f4ad/a9 cheat description:Always fight Fulgore code:808d7a/ad+83f4b2/a9 cheat description:Always fight Eyedol code:808d7a/ad+83f4b7/a9 cheat description:Infinite health - P1 code:7e0d24/78+7e0d26/78 cheat description:Infinite health - P2 code:7e0d28/78+7e0d2a/78 cheat description:No health - P1 code:7e0d24/00+7e0d26/00 cheat description:No health - P2 code:7e0d28/00+7e0d2a/00 cheat description:CPU cannot move from starting position code:7e0e08/01 cheat description:Play as Eyedol code:7e024e/0a cartridge sha256:1b58d0aed4510811c73d267244a7e915aa0b334c86e68f3fa5883f5cb534e4d7 name:King Arthur & The Knights of Justice (USA) cheat description:Infinite health code:848998/b9 cheat description:Infinite attack power code:80950b/ee+80955e/ee cheat description:Infinite healing herbs code:82b8c3/ad cheat description:Start with 99 healing herbs code:80fb8c/62 cheat description:Start with 99 shield attacks code:80fb9e/62 cartridge sha256:aca9eb59d6783e2cae3787c69053888fea98f5dfe4c8af8b5a6360e0afb3b5d7 name:King Arthur's World (USA) cheat description:Infinite men - if you have at least one of that type code:04c6bb/bf+04c6a7/bf cheat description:Infinite spells - must have at least one to use code:0e9aa3/bf cheat description:Start with 4 of each type of spell code:0df6f0/a2+0df6f1/30+0df6f2/02 cheat description:Start with many men code:01fe99/a9+01fe9a/14+01fe9b/00 cheat description:Start on training level 2 code:0e8062/17 cheat description:Start on training level 3 code:0e8062/19 cheat description:Start on training level 4 code:0e8062/16 cheat description:Start on training level 5 code:0e8062/1d cheat description:Start on training level 6 code:0e8062/1e cheat description:Start on training level 7 code:0e8062/1f cheat description:Start on training level 8 code:0e8062/20 cheat description:Start on training level 9 code:0e8062/1a cheat description:Start on real world level 1 code:0e8062/01 cheat description:Start on real world level 2 code:0e8062/02 cheat description:Start on real world level 3 code:0e8062/03 cheat description:Start on real world level 4 code:0e8062/04 cheat description:Start on goblin underworld level 1 code:0e8062/05 cheat description:Start on goblin underworld level 2 code:0e8062/06 cheat description:Start on goblin underworld level 3 code:0e8062/07 cheat description:Start on goblin underworld level 4 code:0e8062/08 cheat description:Start on cloud world level 1 code:0e8062/0c cheat description:Start on cloud world level 2 code:0e8062/0d cheat description:Start on cloud world level 3 code:0e8062/0e cheat description:Start on cloud world level 4 code:0e8062/0f cheat description:Start on cloud world level 5 code:0e8062/10 cheat description:Start on cloud world level 6 code:0e8062/11 cheat description:Start on cloud world level 7 code:0e8062/12 cartridge sha256:6638b5541059814d4c34574e5e277ef613aebf81c91d3def557a7642fb5840e1 name:King of Dragons (USA) cheat description:Invincibility - both players code:c0378b/f0 cheat description:Infinite health - both players code:c09074/a5 cheat description:Infinite time code:c043f5/00 cheat description:Infinite credits code:c04275/af cheat description:One hit kills code:c08b56/24+c08b58/24 cheat description:Hit anywhere code:c08a63/80+c08a2f/80+c08a8f/80+c089f8/80+c089f1/80 cheat description:Start with level 6 Sword code:c07369/8e+c07370/85 cheat description:Start with level 6 Shield code:c0737f/8e+c07386/85 cheat description:Invincibility (blinking) - P1 code:7e0bb4/ff cheat description:Invincibility (blinking) - P2 code:7e0cb4/ff cheat description:Infinite health - P1 code:7e0b9a/09 cheat description:Infinite health - P2 code:7e0c9a/09 cheat description:Max attack - P1 code:7e0bee/07 cheat description:Max attack - P2 code:7e0cee/07 cheat description:Max defense - P1 code:7e0bf0/07 cheat description:Max defense - P2 code:7e0cf0/07 cheat description:Infinite lives - P1 code:7e0bec/09 cheat description:Infinite lives - P2 code:7e0cec/09 cheat description:Infinite time (alt) code:7e1f94/98 cheat description:Infinite time for player select screen code:7e5c24/0a cheat description:Start on stage 2 - Treasure In An Old Castle code:7e0658/01 cheat description:Start on stage 3 - Battle On Mountain Peak code:7e0658/02 cheat description:Start on stage 4 - Cave Of Hydra code:7e0658/03 cheat description:Start on stage 5 - To The Norde Isle code:7e0658/04 cheat description:Start on stage 6 - The Giant In The Shrine code:7e0658/05 cheat description:Start on stage 7 - Trent Woods code:7e0658/06 cheat description:Start on stage 8 - To The Castle code:7e0658/07 cheat description:Start on stage 9 - In The Castle code:7e0658/08 cheat description:Start on stage 10 - Underpass code:7e0658/09 cheat description:Start on stage 11 - Battle In The Front code:7e0658/0a cheat description:Start on stage 12 - Castle Garenos code:7e0658/0b cheat description:Start on stage 13 - Dark Wizard code:7e0658/0c cheat description:Start on stage 14 - A Cave In The Woods code:7e0658/0d cheat description:Start on stage 15 - Underground Labyrinth code:7e0658/0e cheat description:Start on stage 16 - Golden Limestone Cave code:7e0658/0f cartridge sha256:1135858a1ce686a0a163bb0e6f3a4d7cd71c0cd56efbc79677372f2624cf2306 name:King of the Monsters (USA) cheat description:Faster timer code:11c81f/17 cheat description:Slower timer code:01c817/60 cheat description:3 power points needed to get to next power level code:01c963/03 cheat description:Start with less health - P1 code:009fd6/80 cheat description:Start with less health - P2 code:00a82e/80 cheat description:Infinite health - P1 code:7e0a50/ff cheat description:No health - P2 code:7e0b40/00 cheat description:Infinite time - minutes code:7e29f3/09 cheat description:Infinite time - seconds code:7e29f2/54 cartridge sha256:a9729d049ce580839bbfef1836a13dc16f2fc934d203ebf7390e0b1c47ea9a2d name:King of the Monsters 2 (USA) cheat description:Infinite health code:7e1a3a/18 cheat description:Infinite lives code:7e09cc/03 cheat description:Infinite time code:7e0942/69 cheat description:Always have 2 power-ups code:7e1cb4/02 cartridge sha256:4e095fbbdec4a16b075d7140385ff68b259870ca9e3357f076dfff7f3d1c4a62 name:Kirby Super Star (USA) cheat description:Infinite health code:01fbd2/8d cheat description:Infinite lives code:0387e5/ad cheat description:Always have invincibility code:3035f1/0a cheat description:Infinite health (friend) code:40137e/30 cartridge sha256:67937dd7a29a93b1aaabb6df89f0748369ff47f3f6c655a402c00d5657973140 name:Kirby's Avalanche (USA) cheat description:Boulder warnings don't appear code:88c2ba/b4 cheat description:Only red blobs fall code:888e4f/a9+888e50/00+888e51/00 cheat description:Only yellow blobs fall code:888e4f/a9+888e50/01+888e51/01 cheat description:Only green blobs fall code:888e4f/a9+888e50/03+888e51/03 cheat description:Only purple blobs fall code:888e4f/a9+888e50/04+888e51/04 cheat description:Only blue blobs fall code:888e4f/a9+888e50/05+888e51/05 cheat description:Only red and yellow blobs fall code:888e4f/a9+888e50/00+888e51/01 cheat description:Only red and green blobs fall code:888e4f/a9+888e50/00+888e51/03 cheat description:Only red and purple blobs fall code:888e4f/a9+888e50/00+888e51/04 cheat description:Only red and blue blobs fall code:888e4f/a9+888e50/00+888e51/05 cheat description:Only red blobs with a boulder fall code:888e4f/a9+888e50/00+888e51/06 cheat description:Only yellow and red blobs fall code:888e4f/a9+888e50/01+888e51/00 cheat description:Only yellow and green blobs fall code:888e4f/a9+888e50/01+888e51/03 cheat description:Only yellow and purple blobs fall code:888e4f/a9+888e50/01+888e51/04 cheat description:Only yellow and blue blobs fall code:888e4f/a9+888e50/01+888e51/05 cheat description:Only yellow blobs with a boulder fall code:888e4f/a9+888e50/01+888e51/06 cheat description:Only green and yellow blobs fall code:888e4f/a9+888e50/03+888e51/01 cheat description:Only green and red blobs fall code:888e4f/a9+888e50/03+888e51/00 cheat description:Only green and purple blobs fall code:888e4f/a9+888e50/03+888e51/04 cheat description:Only green and blue blobs fall code:888e4f/a9+888e50/03+888e51/05 cheat description:Only green blobs with a boulder fall code:888e4f/a9+888e50/03+888e51/06 cheat description:Only purple and yellow blobs fall code:888e4f/a9+888e50/04+888e51/01 cheat description:Only purple and green blobs fall code:888e4f/a9+888e50/04+888e51/03 cheat description:Only purple and red blobs fall code:888e4f/a9+888e50/04+888e51/00 cheat description:Only purple and blue blobs fall code:888e4f/a9+888e50/04+888e51/05 cheat description:Only purple blobs with a boulder fall code:888e4f/a9+888e50/04+888e51/06 cheat description:Only blue and yellow blobs fall code:888e4f/a9+888e50/05+888e51/01 cheat description:Only blue and green blobs fall code:888e4f/a9+888e50/05+888e51/03 cheat description:Only blue and purple blobs fall code:888e4f/a9+888e50/05+888e51/04 cheat description:Only blue and red blobs fall code:888e4f/a9+888e50/05+888e51/00 cheat description:Only blue blobs with a boulder fall code:888e4f/a9+888e50/05+888e51/06 cheat description:Only a boulder and yellow blobs fall code:888e4f/a9+888e50/06+888e51/01 cheat description:Only a boulder and green blobs fall code:888e4f/a9+888e50/06+888e51/03 cheat description:Only a boulder and purple blobs fall code:888e4f/a9+888e50/06+888e51/04 cheat description:Only a boulder and blue blobs fall code:888e4f/a9+888e50/06+888e51/05 cheat description:Only a boulder and red blobs fall code:888e4f/a9+888e50/06+888e51/00 cheat description:Only boulders fall code:888e4f/a9+888e50/06+888e51/06 cheat description:Disable the next box code:889030/a9+889032/ea+889035/a9+889037/ea cartridge sha256:0f984dc5fe8293f75e3b8fad98b0cb564706d9b1e3902b56415aa399c2d4df2b name:Kirby's Dream Course (USA) cheat description:Infinite Strawberries code:83ac12/bd cheat description:Don't lose a life from falling out of bounds code:80f8d0/bd cheat description:Don't ever gain any Strawberries code:83ac01/bd cheat description:Start with 5 lives code:80c056/04 cheat description:Start with 7 lives code:80c056/06 cheat description:Start with 9 lives code:80c056/08 cheat description:Start with 1 Strawberry code:80c105/01 cheat description:Start with 2 Strawberries code:80c105/02 cheat description:Start with 3 Strawberries code:80c105/03 cheat description:Infinite Tomatoes code:83ac12/bd cartridge sha256:b50bf9d95485e8aeb7a6730e9f9f9c9c4ec23a85b336a4fb2e3b63034531e36f name:Kirby's Dream Land 3 (USA) cheat description:Always have Invincibility - Kirby code:4054b2/01 cheat description:Infinite life - Kirby code:4039d1/0a cheat description:Infinite life - Partner code:4039d3/08 cheat description:Infinite lives code:4039cf/0a cheat description:Infinite Mouth Shot code:4054ed/02 cheat description:Always have No Mouth power code:4054a9/00 cheat description:Always have Fireball Mouth power code:4054a9/01 cheat description:Always have Stone Mouth power code:4054a9/02 cheat description:Always have Ice Mouth power code:4054a9/03 cheat description:Always have Needle Mouth power code:4054a9/04 cheat description:Always have Broom Mouth power code:4054a9/05 cheat description:Always have Parasol Mouth power code:4054a9/06 cheat description:Always have Spark Mouth power code:4054a9/07 cheat description:Always have Boomerang Mouth power code:4054a9/08 cheat description:Have all level 1 Stars code:4053a7/01+4053a8/01+4053a9/01+4053aa/01+4053ab/01+4053ac/01 cheat description:Have all level 2 Stars code:4053ae/01+4053af/01+4053b0/01+4053b1/01+4053b2/01+4053b3/01 cheat description:Have all level 3 Stars code:4053b5/01+4053b6/01+4053b7/01+4053b8/01+4053b9/01+4053ba/01 cheat description:Have all level 4 Stars code:4053bc/01+4053bd/01+4053be/01+4053bf/01+4053c0/01+4053c1/01 cheat description:Have all level 5 Stars code:4053c3/01+4053c4/01+4053c5/01+4053c6/01+4053c7/01+4053c8/01 cheat description:Start a new game with 9 lives code:00ba78/0a cheat description:Start a new game with 25 lives code:00ba78/1a cheat description:Start a new game with 98 lives code:00ba78/63 cartridge sha256:fb601ead645edce139b0483d3155b4e3d7ab245bf87a3a66cb88c0a617c0a526 name:Knights of the Round (USA) cheat description:Invincibility code:81d714/f0 cheat description:More invincibility time after successful block code:82daac/ff cheat description:Infinite health code:81dc52/b9 cheat description:Almost infinite health code:81dc50/24+81ddd0/24 cheat description:Maximum health from most food code:84c50e/00 cheat description:Infinite lives code:82dc36/b9 cheat description:Infinite time code:8084af/ad cheat description:One hit kills code:81df3f/24+81e2be/24+81e0ee/24 cheat description:No health lost from special move code:82d3c9/00 cheat description:No health lost from special move (alt) code:82d3cb/b9 cheat description:Less health lost from special move code:82d3c9/06 cheat description:More health lost from special move code:82d3c9/14 cheat description:Super-jump - Arthur code:82a550/0c cheat description:Super-jump - Lancelot code:82a54c/0c cheat description:Super-jump - Percival code:82a554/0c cheat description:Slower timer code:80849f/60 cheat description:Faster timer code:80849f/1e cheat description:Enable hidden options screen in the options menu code:80c168/20+80c169/b2+80c16a/c9+80c9b8/60 cheat description:Start on stage 2 code:81b86a/ea+81b86b/a9+81b86c/01 cheat description:Start on stage 3 code:81b86a/ea+81b86b/a9+81b86c/02 cheat description:Start on stage 4 code:81b86a/ea+81b86b/a9+81b86c/03 cheat description:Start on stage 5 code:81b86a/ea+81b86b/a9+81b86c/04 cheat description:Start on stage 6 code:81b86a/ea+81b86b/a9+81b86c/05 cheat description:Invincibility (blinking) - P1 code:7e4136/02 cheat description:Invincibility (blinking) - P2 code:7e4336/02 cheat description:Infinite health (alt) code:7e4008/50 cheat description:Infinite time (alt) code:7e0c4a/59 cheat description:Quick level gain - P1 code:7e4149/00+7e414a/00+7e414b/00+7e414c/00 cheat description:Quick level gain - P2 code:7e4349/00+7e434a/00+7e434b/00+7e434c/00 cartridge sha256:6a37a20a4880b9ec38b1b7e17e42ea93a1bf826630ccbe5f8257f0d928f13953 name:Kouryuu no Mimi (Japan) cheat description:Infinite health code:848907/a9+848908/40+848909/00+84890c/8d cheat description:Infinite health (alt) code:7e09c0/40 cheat description:Infinite Ring power code:7e008c/20 cartridge sha256:e36322697c48baae6492db91e6cbf3844a420f6e0cc8a75f3a73556026ddbbb8 name:Krusty's Super Fun House (USA) (Rev 1) cheat description:Infinite lives code:7e11a3/03 cheat description:Infinite weapons code:7e032c/0a cartridge sha256:bed18c968aee0eb0c866c1964c28135364cd6d65fff7bcb5873342c04e63750d name:Krusty's Super Fun House (USA) cheat description:Invincibility - Krusty code:00d972/b3 cheat description:Infinite Custard Pies code:00f06c/a6 cheat description:Infinite Superballs code:00f0de/a6 cheat description:Infinite lives code:008d77/ad cheat description:Custard Pie bonus worth 2 pies instead of 10 code:00ee0c/02 cheat description:Custard Pie bonus worth 5 pies code:00ee0c/05 cheat description:Custard Pie bonus same as Superball bonus (disable is game freezes) code:00ee0e/04 cheat description:Superball bonus worth 2 balls instead of 5 (disable is game freezes) code:00ee16/02 cheat description:Superball bonus worth 10 balls (disable is game freezes) code:00ee16/0a cheat description:Superball bonus same as Custard Pie bonus (disable is game freezes) code:00ee13/80+00ee14/f4 cheat description:Food bonuses restore less strength code:00edf9/07 cheat description:Food bonuses restore more strength code:00edf9/1e cheat description:Food bonuses restore Krusty to full strength code:00edf9/63 cheat description:Food bonuses also get Custard Pie bonus code:00ee04/04 cheat description:Food bonuses also get Superball bonus code:00ee04/0e cheat description:Doll bonus same as Custard Pie bonus code:00ee22/e6+00ee21/80 cheat description:Doll bonus same as Superball bonus code:00ee22/f0+00ee21/80 cheat description:Doll bonus same as food bonus code:00ee22/d1+00ee21/80 cheat description:Jump higher - Krusty code:00e8ad/10 cheat description:Jump much higher - Krusty code:00e8ad/08 cheat description:Start with section 1 finished code:00867c/00+00867d/80+00867e/05 cheat description:Start with section 2 finished code:00867c/01+00867d/80+00867e/05 cheat description:Start with section 3 finished code:00867c/02+00867d/80+00867e/05 cheat description:Start with section 4 finished code:00867c/03+00867d/80+00867e/05 cheat description:Start with access to all sections code:00867c/04+00867d/80+00867e/05 cheat description:Start with 1 life instead of 3 code:0088ad/01 cheat description:Start with 2 lives code:0088ad/02 cheat description:Start with 5 lives code:0088ad/05 cheat description:Start with 7 lives code:0088ad/07 cheat description:Start with 9 lives code:0088ad/09 cheat description:Start with 0 Custard Pies code:00889e/00 cheat description:Start with 2 Custard Pies code:00889e/02 cheat description:Start with 5 Custard Pies code:00889e/05 cheat description:Start with 2 Superballs instead of 10 Custard Pies code:00889e/02+0088a3/01 cheat description:Start with 5 Superballs code:00889e/05+0088a3/01 cheat description:Start with 10 Superballs code:0088a3/01 cartridge sha256:46c811f0cacffe8f20e1d63072d25d7c47e9bb3fd5124851fd05aca9884d21fb name:Lagoon (USA) cheat description:HP always recovers instantly code:019147/a9+019148/ff cheat description:MP always recovers instantly code:01914f/a9+019150/ff cheat description:Save always available code:02bec7/80+02bec8/13 cheat description:Pit death disabled code:01c958/60 cheat description:Hit anywhere code:01b628/00 cheat description:Get 1 gold for each creature killed code:01947e/69+01947f/01+019480/ea cheat description:Get 100 gold for each creature killed code:01947e/69+01947f/64+019480/ea cheat description:Get 200 gold for each creature killed code:01947e/69+01947f/c8+019480/ea cheat description:Start with 0 STR code:02d9ec/00 cheat description:Start with 100 STR code:02d9ec/64 cheat description:Start with 255 STR code:02d9ec/ff cheat description:Start with 0 DEF code:02d9fb/00 cheat description:Start with 100 DEF code:02d9fb/64 cheat description:Start with 255 DEF code:02d9fb/ff cheat description:Start with 999 DEF code:02d9fc/f6+02d9fb/17 cheat description:Start with 612 gold code:02da02/02 cheat description:Start with 1,380 gold code:02da02/05 cheat description:Start with 2,148 gold code:02da02/08 cheat description:Start with 8,292 gold code:02da02/20 cheat description:Start with 22,116 gold code:02da02/56 cheat description:Start with 65,380 gold code:02da02/ff cheat description:Start on level 2, MP = 8/8, HP = 17/17, EXP = 0/40 code:02d9d9/02 cheat description:Start on level 3, MP = 10/10, HP = 23/23, EXP = 0/90 code:02d9d9/03 cheat description:Start on level 4, MP = 12/12, HP = 28/28, EXP = 0/170 code:02d9d9/04 cheat description:Start on level 5, MP = 19/19, HP =36/36, EXP = 0/280 code:02d9d9/05 cheat description:Start on level 241, HP = 255, MP = 255, EXP = 22859, walk at a regular speed code:02d9d9/f1 cheat description:Start on level 242, HP = 220, MP = 221, EXP = 30560, walk at a medium speed code:02d9d9/f2 cheat description:Infinite HP code:7e0520/ff cheat description:Infinite MP code:7e0522/ff cheat description:Have all equipment and magic code:7e04d0/ff+7e04d1/ff+7e04d2/ff+7e04d3/f8 cheat description:Have all items code:7e04d4/ff+7e04d5/ff+7e04d6/ff+7e04d7/80 cheat description:Shop item 1 free code:7e045c/00+7e045d/00 cheat description:Shop item 2 free code:7e045e/00+7e045f/00 cheat description:Shop item 3 free code:7e0460/00+7e0461/00 cheat description:Max EXP code:7e052a/ff+7e052b/ff cheat description:Max level (level 35) code:7e052c/23 cheat description:Max STR code:7e0525/02 cheat description:Max DEF code:7e0527/02 cheat description:Max Gold code:7e0529/ff cartridge sha256:48cd9476fef1ed685b9c30dd1669b46048f7295cbbb2abcfa5b1a48699346ea3 name:Lamborghini American Challenge (USA) cheat description:Always finish first code:8afe82/00+8afe84/02+8a8a4e/fe+8afe89/16+8afe86/1a+8afe8a/60+8afe83/d0+8a8a4c/20+8afe88/7e+8afe85/7b+8a8a4d/80+8afe80/c0+8afe87/99+8afe81/00 cheat description:Don't take damage in races code:80bf68/b9 cheat description:Free turbos code:8cd3cc/ad cheat description:Repair 10% of car for $100 code:8cd626/ad cheat description:Repair 10% of car for free code:8cd629/ee cheat description:Turbos for $1000 code:8cd3ba/0a+8cd3bb/00 cheat description:Turbos for $2000 code:8cd3ba/14+8cd3bb/00 cheat description:Start with 6-speed transmission code:8a845b/06 cheat description:Start with $128,000 code:8080f9/00+8080fa/05 cheat description:Start with $88,000 code:8080f9/70+8080fa/03 cheat description:Start with $12,800 code:8080f9/80 cheat description:Always finish first (alt) code:7e167e/01 cheat description:Infinite money code:7e0d21/ff+7e0d22/ff cheat description:Infinite Boost code:7e0ddd/09 cartridge sha256:314d53f409b66ba3f4426a6f1bb7c69f6779aeed277ce2e19535f94d7c8ca586 name:Last Action Hero (USA) cheat description:Invincibility code:80c119/8d cheat description:Infinite health code:80c142/ad cheat description:Infinite time code:809517/ad cheat description:Infinite lives code:80a497/cd cheat description:Invincibility (blinking) code:7e03b7/ff cheat description:Infinite health (alt) code:7e031f/ff cheat description:Infinite time (alt) code:7e0315/99 cheat description:Infinite lives (alt) code:7e0316/04 cheat description:Hit anywhere continually code:80d4d9/24+80d4ed/24 cheat description:One hit kills - enemy 1 code:7e0822/00 cheat description:One hit kills - enemy 2 code:7e0880/00 cheat description:One hit kills - enemy 3 code:7e08de/00 cheat description:Start on stage 2 code:7e030f/02 cheat description:Start on stage 3 code:7e030f/03 cheat description:Start on stage 4 code:7e030f/04 cheat description:Start on stage 5 code:7e030f/05 cartridge sha256:a179a1188220b59787c49a78a0dde79b89380e3a8a8a0ab558f0102c5796f873 name:Lawnmower Man, The (USA) cheat description:Invincible in Cyber Run level code:8289bf/ad cheat description:Invincible in Cyber Tube level code:828ac2/ad cheat description:Invincible in Cyber Jobe level code:81dde0/ad cheat description:Invincible in Cyber Space level code:86c8dd/ad cheat description:Infinite lives code:8091f3/24 cheat description:After you die, your main weapon is fully powered up from then on code:809273/04+809272/a9 cheat description:Super-jump code:809c84/fa cheat description:Energize icon effect lasts 2x longer code:80b77e/03 cheat description:Energize icon effect lasts 4x longer code:80b77e/05 cheat description:Bitstream powers up instantly (don't shoot too many bitstreams at once) code:809896/06 cheat description:Keep weapon power ups once gained code:809273/00 cheat description:Never lose homing bullets once gained code:809237/af cheat description:Never lose rear bullets once gained code:809233/af cartridge sha256:c7814cee0fc95d6422cf19a3dc8c9a65b60f6f56da75f09cebea02cc5f99261b name:Legend (USA) cheat description:Invincibility code:80c387/8d+80c388/d5+80c389/13 cheat description:Infinite health code:81f59d/ad cheat description:Infinite time code:80e110/ad cheat description:Infinite lives code:80bd50/ad cheat description:One hit kills code:81a68a/24+81b566/24 cheat description:Hit anywhere code:81f32f/24+81f30c/24+81f340/24+81f347/24+81f304/80+81f313/80 cheat description:Infinite health - P1 code:7e130d/08 cheat description:Infinite magic - P1 code:7e1315/09 cheat description:Infinite lives - P1 code:7e1309/09 cheat description:Infinite time (alt) code:7e15ef/09 cheat description:Infinite Keys - P1 code:7e12f1/63 cartridge sha256:c865fb17e8c59a21d32b9a605319241fa74ec732e3f0ee58f5d7fcbd8ee57c6b name:Legend of the Mystical Ninja, The (USA) cheat description:Invincibility code:00b767/24 cheat description:Infinite health code:05a51f/b5 cheat description:Infinite lives - top-view code:00cb8e/ea cheat description:Hit anywhere - top view code:03b581/24+03b20d/24 cheat description:Hit anywhere - side view code:03b16d/24+03b552/24 cheat description:Collect items from anywhere - top view code:03b505/24 cheat description:Don't lose most weapons when hit code:05a548/24 cheat description:Pick-up more coins from enemies code:03cc12/50 cheat description:No coins used up when thrown code:00f808/00 cheat description:Faster timer code:0593f7/14 cheat description:Slower timer code:0593f7/60 cheat description:Die after one hit code:05a51b/00 cheat description:Start with 6 lives code:00db3a/05 cheat description:Start with 9 lives code:00db3a/08 cheat description:Invincibility - P1 code:7e0592/02 cheat description:Infinite health - P1 code:7e1ab2/10 cheat description:Infinite money - P1 code:7e1aac/99+7e1aad/99+7e1aae/09 cheat description:Infinite lives - P1 code:7e1ab0/04 cheat description:Have Jutsu technique 1 code:7e1ad6/01 cheat description:Have Jutsu technique 2 code:7e1ad8/01 cheat description:Have Jutsu technique 3 code:7e1ada/01 cheat description:Have Jutsu technique 4 code:7e1adc/01 cheat description:Have 1st upgraded weapon code:7e1ab6/01+7e1ab8/01 cheat description:Have 2nd upgraded weapon code:7e1ab6/02+7e1ab8/02 cheat description:Infinite Bombs code:7e1aba/30 cheat description:Have Gold Helmet code:7e1ae0/08 cheat description:Have Iron Helmet code:7e1ae2/06 cheat description:Have Straw Hat code:7e1ae4/04 cheat description:Have Gold Armor code:7e1af0/08 cheat description:Have Chain Armor code:7e1af2/06 cheat description:Have Straw Coat code:7e1af4/04 cheat description:Have whole Pizza code:7e1b10/01 cheat description:Have slice of Pizza code:7e1b12/01 cheat description:Have Burger code:7e1b14/01 cheat description:Have Pass code:7e1b20/01 cheat description:Have Text code:7e1b22/01 cheat description:Max walking speed code:7e1ac2/02+7e1b00/03 cartridge sha256:66871d66be19ad2c34c927d6b14cd8eb6fc3181965b6e517cb361f7316009cfb name:Legend of Zelda, The - A Link to the Past (USA) cheat description:Invincibility code:7e031f/6a cheat description:Infinite rupees code:7ef360/e7 cheat description:Infinite health and all heart containers code:7ef36d/a0 cheat description:Almost infinite health code:0780f7/cf cheat description:Infinite magic code:7ef36e/80 cheat description:Almost infinite magic code:07b0c8/cf+07b101/cf cheat description:Max heart containers code:04f4f2/a0 cheat description:Infinite Bombs code:098133/cf cheat description:Infinite Bombs (alt) code:7ef343/63 cheat description:Infinite Arrows code:7ef377/63 cheat description:Hit anywhere (disable before fighting Ganon, use the Boomerang instead of Sword to hit switches) code:06f2d1/24+06ebfc/80+06ec13/24+06f3a7/24+06ec2c/80+1e83b3/24 cheat description:Get items from anywhere code:06d11e/24 cheat description:Regular sword is very strong (100 damage instead of 2) code:0db8fa/64 cheat description:Blue Boomerang has much longer reach code:089204/bd cheat description:Enemies frozen by Boomerang or Hookshot stay frozen code:06e321/bd cheat description:Sword can destroy solid objects in Overworld code:1bbe39/80 cheat description:Objects that you can pick up and throw never break away code:06e234/10 cheat description:Dash without having the Pegasus Boots code:7ef379/ff cheat description:Dash without charge up code:0790b9/27 cheat description:Walk on deep water code:0787cb/64+07da3b/de+07da3a/5b cheat description:Use the Magic Mirror to warp between the Light and Dark Worlds freely code:07a953/80 cheat description:Some shops don't take your money code:1ef3ae/cf cheat description:Spin attack needs nearly no time to charge code:079d79/08 cheat description:Spin attack needs no time at all to charge code:079d79/00 cheat description:100% enemy drop rate (from enemies that normally drop items) code:86f9bb/00 cheat description:No enemies in dungeons code:7e0d30/05+7e0d31/05+7e0d32/05 cheat description:Dark rooms are fully lit code:7e045a/03 cheat description:Trigger doors are open (works with most dungeon doors, some that even look closed) code:7e068d/ff cheat description:Have Bombos Medallion code:7ef347/01 cheat description:Have Book Of Mudora code:7ef34e/01 cheat description:Have Bug-Catching Net code:7ef34d/01 cheat description:Have Cane Of Byrna code:7ef351/01 cheat description:Have Cane Of Somaria code:7ef350/01 cheat description:Have Ether Medallion code:7ef348/01 cheat description:Have Fire Rod code:7ef345/01 cheat description:Have Flute code:7ef34c/02 cheat description:Have Flute with Duck code:7ef34c/03 cheat description:Have Golden Sword (level 4) code:7ef359/04 cheat description:Have Hookshot code:7ef342/01 cheat description:Have Ice Rod code:7ef346/01 cheat description:Have Lamp code:7ef34a/01 cheat description:Have Magic Boomerang code:7ef341/02 cheat description:Have Magic Cape code:7ef352/01 cheat description:Have Magic Hammer code:7ef34b/01 cheat description:Have Magic Mirror code:7ef353/02 cheat description:Have Magic Powder code:7ef344/02 cheat description:Have Mirror Shield code:7ef35a/03 cheat description:Have Moon Pearl code:7ef357/01 cheat description:Have Pegasus Boots code:7ef355/02 cheat description:Have Quake Medallion code:7ef349/01 cheat description:Have Red Mail code:7ef35b/02 cheat description:Have Shovel code:7ef34c/01 cheat description:Have Titan's Mitten code:7ef354/02 cheat description:Have Zora's Flippers code:7ef356/01 cheat description:Have 1/2 Magic curse code:7ef37b/01 cheat description:Have all abilities except Lift code:7ef379/6f cheat description:Have all Maps, Compasses and Big Keys code:7ef364/ff+7ef365/ff+7ef366/ff+7ef367/ff+7ef368/ff+7ef369/ff cheat description:Invincibility (alt) code:7e031f/10 cheat description:Invincibility (alt 2) code:7e031f/01 cheat description:Infinite rupees (alt) code:7ef360/e7+7ef361/03 cheat description:Infinite Keys code:7ef36f/09 cheat description:Bombs full code:7ef375/01 cheat description:Play chest game for free and able to open all chests code:7e04c4/01 cheat description:Infinite time for digging game in the Dark World code:7e04b4/1e cheat description:Always get Faerie at the Pond Of Happiness (as if you threw in 100 rupees) code:7ef36a/64 cheat description:Luck modifier - Great code:7e0cf9/01 cheat description:Luck modifier - Big Trouble code:7e0cf9/02 cheat description:Turn rain on code:7e001d/01 cheat description:Turn rain off code:7e001d/00 cheat description:Walk through walls code:07cb9a/ea+07cb9b/ea+07c1fa/ea+07c1fb/ea cheat description:Walk faster code:7e005e/16 cheat description:Walk much faster code:7e005e/10 cheat description:Have 20 Heart Containers and infinite health code:7ef36d/a0 cheat description:Have Blue Mail code:7ef35b/02 cheat description:Have Boomerang code:7ef341/01 cheat description:Have Bow code:7ef340/01 cheat description:Have Bow with Arrows code:7ef340/02 cheat description:Have Bow with Silver Arrows code:7ef340/04 cheat description:Have all Lift abilities code:7ef354/03 cheat description:Have all Crystals code:7ef37a/7f cheat description:Have all Pendants code:7ef374/47 cheat description:Have Small Key In dungeons code:7ef36f/09 cheat description:Have Big Key in dungeons code:7ef366/ff+7ef367/ff cheat description:Have Compass in dungeons code:7ef365/ff cheat description:Have bottle 1 code:7ef35c/02 cheat description:Have bottle 1 with infinite Mushrooms code:7ef35c/01 cheat description:Have bottle 1 with infinite Red Medicine (life) code:7ef35c/03 cheat description:Have bottle 1 with infinite Green Medicine (magic) code:7ef35c/04 cheat description:Have bottle 1 with infinite Blue Medicine (cure all) code:7ef35c/05 cheat description:Have bottle 1 with infinite Faeries code:7ef35c/06 cheat description:Have bottle 1 with infinite Bees code:7ef35c/07 cheat description:Have bottle 1 with infinite Good Bees code:7ef35c/08 cheat description:Have bottle 2 code:7ef35d/02 cheat description:Have bottle 2 with infinite Mushrooms code:7ef35d/01 cheat description:Have bottle 2 with infinite Red Medicine (life) code:7ef35d/03 cheat description:Have bottle 2 with infinite Green Medicine (magic) code:7ef35d/04 cheat description:Have bottle 2 with infinite Blue Medicine (cure all) code:7ef35d/05 cheat description:Have bottle 2 with infinite Faeries code:7ef35d/06 cheat description:Have bottle 2 with infinite Bees code:7ef35d/07 cheat description:Have bottle 2 with infinite Good Bees code:7ef35d/08 cheat description:Have bottle 3 code:7ef35e/02 cheat description:Have bottle 3 with infinite Mushrooms code:7ef35e/01 cheat description:Have bottle 3 with infinite Red Medicine (life) code:7ef35e/03 cheat description:Have bottle 3 with infinite Green Medicine (magic) code:7ef35e/04 cheat description:Have bottle 3 with infinite Blue Medicine (cure all) code:7ef35e/05 cheat description:Have bottle 3 with infinite Faeries code:7ef35e/06 cheat description:Have bottle 3 with infinite Bees code:7ef35e/07 cheat description:Have bottle 3 with infinite Good Bees code:7ef35e/08 cheat description:Have bottle 4 code:7ef35f/02 cheat description:Have bottle 4 with infinite Mushrooms code:7ef35f/01 cheat description:Have bottle 4 with infinite Red Medicine (life) code:7ef35f/03 cheat description:Have bottle 4 with infinite Green Medicine (magic) code:7ef35f/04 cheat description:Have bottle 4 with infinite Blue Medicine (cure all) code:7ef35f/05 cheat description:Have bottle 4 with infinite Faeries code:7ef35f/06 cheat description:Have bottle 4 with infinite Bees code:7ef35f/07 cheat description:Have bottle 4 with infinite Good Bees code:7ef35f/08 cartridge sha256:cd016c41c7ef9f4f243d57c2b1564b4ceb3b4c38cc165cd02ab6c8e35c93aa2e name:Lemmings (USA) (Rev 1) cheat description:Infinite climbers if you start with at least 1 code:00bf2a/a5 cheat description:Infinite floaters if you start with at least 1 code:00bf11/a5 cheat description:Infinite bombers if you start with at least 1 code:00bf39/a5 cheat description:Infinite blockers if you start with at least 1 code:00be23/a5 cheat description:Infinite builders if you start with at least 1 code:00bef1/a5 cheat description:Infinite bashers if you start with at least 1 code:00bed4/a5 cheat description:Infinite miners if you start with at least 1 code:00be6c/a5 cheat description:Infinite diggers if you start with at least 1 code:00be9b/a5 cheat description:Each saved lemming counts as two code:009687/e6+009688/6b cheat description:Start on Level 2; rating: Fun code:01aca1/a9+01aca2/01+01adb4/a5 cheat description:Start on Level 3; rating: Fun code:01aca1/a9+01aca2/02+01adb4/a5 cheat description:Start on Level 4; rating: Fun code:01aca1/a9+01aca2/03+01adb4/a5 cheat description:Start on Level 5; rating: Fun code:01aca1/a9+01aca2/04+01adb4/a5 cheat description:Start on Level 6; rating: Fun code:01aca1/a9+01aca2/05+01adb4/a5 cheat description:Start on Level 7; rating: Fun code:01aca1/a9+01aca2/06+01adb4/a5 cheat description:Start on Level 8; rating: Fun code:01aca1/a9+01aca2/07+01adb4/a5 cheat description:Start on Level 9; rating: Fun code:01aca1/a9+01aca2/08+01adb4/a5 cheat description:Start on Level 10; rating: Fun code:01aca1/a9+01aca2/09+01adb4/a5 cheat description:Start on Level 11; rating: Fun code:01aca1/a9+01aca2/0a+01adb4/a5 cheat description:Start on Level 12; rating: Fun code:01aca1/a9+01aca2/0b+01adb4/a5 cheat description:Start on Level 13; rating: Fun code:01aca1/a9+01aca2/0c+01adb4/a5 cheat description:Start on Level 14; rating: Fun code:01aca1/a9+01aca2/0d+01adb4/a5 cheat description:Start on Level 15; rating: Fun code:01aca1/a9+01aca2/0e+01adb4/a5 cheat description:Start on Level 16; rating: Fun code:01aca1/a9+01aca2/0f+01adb4/a5 cheat description:Start on Level 17; rating: Fun code:01aca1/a9+01aca2/10+01adb4/a5 cheat description:Start on Level 18; rating: Fun code:01aca1/a9+01aca2/11+01adb4/a5 cheat description:Start on Level 19; rating: Fun code:01aca1/a9+01aca2/12+01adb4/a5 cheat description:Start on Level 20; rating: Fun code:01aca1/a9+01aca2/13+01adb4/a5 cheat description:Start on Level 21; rating: Fun code:01aca1/a9+01aca2/14+01adb4/a5 cheat description:Start on Level 22; rating: Fun code:01aca1/a9+01aca2/15+01adb4/a5 cheat description:Start on Level 23; rating: Fun code:01aca1/a9+01aca2/16+01adb4/a5 cheat description:Start on Level 24; rating: Fun code:01aca1/a9+01aca2/17+01adb4/a5 cheat description:Start on Level 25; rating: Fun code:01aca1/a9+01aca2/18+01adb4/a5 cheat description:Start on Level 26; rating: Fun code:01aca1/a9+01aca2/19+01adb4/a5 cheat description:Start on Level 27; rating: Fun code:01aca1/a9+01aca2/1a+01adb4/a5 cheat description:Start on Level 28; rating: Fun code:01aca1/a9+01aca2/1b+01adb4/a5 cheat description:Start on Level 29; rating: Fun code:01aca1/a9+01aca2/1c+01adb4/a5 cheat description:Start on Level 30; rating: Fun code:01aca1/a9+01aca2/1d+01adb4/a5 cheat description:Start on Level 1; rating: Tricky code:01aca1/a9+01aca2/1e+01adb4/a5 cheat description:Start on Level 2; rating: Tricky code:01aca1/a9+01aca2/1f+01adb4/a5 cheat description:Start on Level 3; rating: Tricky code:01aca1/a9+01aca2/20+01adb4/a5 cheat description:Start on Level 4; rating: Tricky code:01aca1/a9+01aca2/21+01adb4/a5 cheat description:Start on Level 5; rating: Tricky code:01aca1/a9+01aca2/22+01adb4/a5 cheat description:Start on Level 6; rating: Tricky code:01aca1/a9+01aca2/23+01adb4/a5 cheat description:Start on Level 7; rating: Tricky code:01aca1/a9+01aca2/24+01adb4/a5 cheat description:Start on Level 8; rating: Tricky code:01aca1/a9+01aca2/25+01adb4/a5 cheat description:Start on Level 9; rating: Tricky code:01aca1/a9+01aca2/26+01adb4/a5 cheat description:Start on Level 10; rating: Tricky code:01aca1/a9+01aca2/27+01adb4/a5 cheat description:Start on Level 11; rating: Tricky code:01aca1/a9+01aca2/28+01adb4/a5 cheat description:Start on Level 12; rating: Tricky code:01aca1/a9+01aca2/29+01adb4/a5 cheat description:Start on Level 13; rating: Tricky code:01aca1/a9+01aca2/2a+01adb4/a5 cheat description:Start on Level 14; rating: Tricky code:01aca1/a9+01aca2/2b+01adb4/a5 cheat description:Start on Level 15; rating: Tricky code:01aca1/a9+01aca2/2c+01adb4/a5 cheat description:Start on Level 16; rating: Tricky code:01aca1/a9+01aca2/2d+01adb4/a5 cheat description:Start on Level 17; rating: Tricky code:01aca1/a9+01aca2/2e+01adb4/a5 cheat description:Start on Level 18; rating: Tricky code:01aca1/a9+01aca2/2f+01adb4/a5 cheat description:Start on Level 19; rating: Tricky code:01aca1/a9+01aca2/30+01adb4/a5 cheat description:Start on Level 20; rating: Tricky code:01aca1/a9+01aca2/31+01adb4/a5 cheat description:Start on Level 21; rating: Tricky code:01aca1/a9+01aca2/32+01adb4/a5 cheat description:Start on Level 22; rating: Tricky code:01aca1/a9+01aca2/33+01adb4/a5 cheat description:Start on Level 23; rating: Tricky code:01aca1/a9+01aca2/34+01adb4/a5 cheat description:Start on Level 24; rating: Tricky code:01aca1/a9+01aca2/35+01adb4/a5 cheat description:Start on Level 25; rating: Tricky code:01aca1/a9+01aca2/36+01adb4/a5 cheat description:Start on Level 26; rating: Tricky code:01aca1/a9+01aca2/37+01adb4/a5 cheat description:Start on Level 27; rating: Tricky code:01aca1/a9+01aca2/38+01adb4/a5 cheat description:Start on Level 28; rating: Tricky code:01aca1/a9+01aca2/39+01adb4/a5 cheat description:Start on Level 29; rating: Tricky code:01aca1/a9+01aca2/3a+01adb4/a5 cheat description:Start on Level 30; rating: Tricky code:01aca1/a9+01aca2/3b+01adb4/a5 cheat description:Start on Level 1; rating: Taxing code:01aca1/a9+01aca2/3c+01adb4/a5 cheat description:Start on Level 2; rating: Taxing code:01aca1/a9+01aca2/3d+01adb4/a5 cheat description:Start on Level 3; rating: Taxing code:01aca1/a9+01aca2/3e+01adb4/a5 cheat description:Start on Level 4; rating: Taxing code:01aca1/a9+01aca2/3f+01adb4/a5 cheat description:Start on Level 5; rating: Taxing code:01aca1/a9+01aca2/40+01adb4/a5 cheat description:Start on Level 6; rating: Taxing code:01aca1/a9+01aca2/41+01adb4/a5 cheat description:Start on Level 7; rating: Taxing code:01aca1/a9+01aca2/42+01adb4/a5 cheat description:Start on Level 8; rating: Taxing code:01aca1/a9+01aca2/43+01adb4/a5 cheat description:Start on Level 9; rating: Taxing code:01aca1/a9+01aca2/44+01adb4/a5 cheat description:Start on Level 10; rating: Taxing code:01aca1/a9+01aca2/45+01adb4/a5 cheat description:Start on Level 11; rating: Taxing code:01aca1/a9+01aca2/46+01adb4/a5 cheat description:Start on Level 12; rating: Taxing code:01aca1/a9+01aca2/47+01adb4/a5 cheat description:Start on Level 13; rating: Taxing code:01aca1/a9+01aca2/48+01adb4/a5 cheat description:Start on Level 14; rating: Taxing code:01aca1/a9+01aca2/49+01adb4/a5 cheat description:Start on Level 15; rating: Taxing code:01aca1/a9+01aca2/4a+01adb4/a5 cheat description:Start on Level 16; rating: Taxing code:01aca1/a9+01aca2/4b+01adb4/a5 cheat description:Start on Level 17; rating: Taxing code:01aca1/a9+01aca2/4c+01adb4/a5 cheat description:Start on Level 18; rating: Taxing code:01aca1/a9+01aca2/4d+01adb4/a5 cheat description:Start on Level 19; rating: Taxing code:01aca1/a9+01aca2/4e+01adb4/a5 cheat description:Start on Level 20; rating: Taxing code:01aca1/a9+01aca2/4f+01adb4/a5 cheat description:Start on Level 21; rating: Taxing code:01aca1/a9+01aca2/50+01adb4/a5 cheat description:Start on Level 22; rating: Taxing code:01aca1/a9+01aca2/51+01adb4/a5 cheat description:Start on Level 23; rating: Taxing code:01aca1/a9+01aca2/52+01adb4/a5 cheat description:Start on Level 24; rating: Taxing code:01aca1/a9+01aca2/53+01adb4/a5 cheat description:Start on Level 25; rating: Taxing code:01aca1/a9+01aca2/54+01adb4/a5 cheat description:Start on Level 26; rating: Taxing code:01aca1/a9+01aca2/55+01adb4/a5 cheat description:Start on Level 27; rating: Taxing code:01aca1/a9+01aca2/56+01adb4/a5 cheat description:Start on Level 28; rating: Taxing code:01aca1/a9+01aca2/57+01adb4/a5 cheat description:Start on Level 29; rating: Taxing code:01aca1/a9+01aca2/58+01adb4/a5 cheat description:Start on Level 30; rating: Taxing code:01aca1/a9+01aca2/59+01adb4/a5 cheat description:Start on Level 1; rating: Mayhem code:01aca1/a9+01aca2/5a+01adb4/a5 cheat description:Start on Level 2; rating: Mayhem code:01aca1/a9+01aca2/5b+01adb4/a5 cheat description:Start on Level 3; rating: Mayhem code:01aca1/a9+01aca2/5c+01adb4/a5 cheat description:Start on Level 4; rating: Mayhem code:01aca1/a9+01aca2/5d+01adb4/a5 cheat description:Start on Level 5; rating: Mayhem code:01aca1/a9+01aca2/5e+01adb4/a5 cheat description:Start on Level 6; rating: Mayhem code:01aca1/a9+01aca2/5f+01adb4/a5 cheat description:Start on Level 7; rating: Mayhem code:01aca1/a9+01aca2/60+01adb4/a5 cheat description:Start on Level 8; rating: Mayhem code:01aca1/a9+01aca2/61+01adb4/a5 cheat description:Start on Level 9; rating: Mayhem code:01aca1/a9+01aca2/62+01adb4/a5 cheat description:Start on Level 10; rating: Mayhem code:01aca1/a9+01aca2/63+01adb4/a5 cheat description:Start on Level 11; rating: Mayhem code:01aca1/a9+01aca2/64+01adb4/a5 cheat description:Start on Level 12; rating: Mayhem code:01aca1/a9+01aca2/65+01adb4/a5 cheat description:Start on Level 13; rating: Mayhem code:01aca1/a9+01aca2/66+01adb4/a5 cheat description:Start on Level 14; rating: Mayhem code:01aca1/a9+01aca2/67+01adb4/a5 cheat description:Start on Level 15; rating: Mayhem code:01aca1/a9+01aca2/68+01adb4/a5 cheat description:Start on Level 16; rating: Mayhem code:01aca1/a9+01aca2/69+01adb4/a5 cheat description:Start on Level 17; rating: Mayhem code:01aca1/a9+01aca2/6a+01adb4/a5 cheat description:Start on Level 18; rating: Mayhem code:01aca1/a9+01aca2/6b+01adb4/a5 cheat description:Start on Level 19; rating: Mayhem code:01aca1/a9+01aca2/6c+01adb4/a5 cheat description:Start on Level 20; rating: Mayhem code:01aca1/a9+01aca2/6d+01adb4/a5 cheat description:Start on Level 21; rating: Mayhem code:01aca1/a9+01aca2/6e+01adb4/a5 cheat description:Start on Level 22; rating: Mayhem code:01aca1/a9+01aca2/6f+01adb4/a5 cheat description:Start on Level 23; rating: Mayhem code:01aca1/a9+01aca2/70+01adb4/a5 cheat description:Start on Level 24; rating: Mayhem code:01aca1/a9+01aca2/71+01adb4/a5 cheat description:Start on Level 25; rating: Mayhem code:01aca1/a9+01aca2/72+01adb4/a5 cheat description:Start on Level 26; rating: Mayhem code:01aca1/a9+01aca2/73+01adb4/a5 cheat description:Start on Level 27; rating: Mayhem code:01aca1/a9+01aca2/74+01adb4/a5 cheat description:Start on Level 28; rating: Mayhem code:01aca1/a9+01aca2/75+01adb4/a5 cheat description:Start on Level 29; rating: Mayhem code:01aca1/a9+01aca2/76+01adb4/a5 cheat description:Start on Level 30; rating: Mayhem code:01aca1/a9+01aca2/77+01adb4/a5 cheat description:Start on Level 1; rating: Sunsoft code:01aca1/a9+01aca2/78+01adb4/a5 cheat description:Start on Level 2; rating: Sunsoft code:01aca1/a9+01aca2/79+01adb4/a5 cheat description:Start on Level 3; rating: Sunsoft code:01aca1/a9+01aca2/7a+01adb4/a5 cheat description:Start on Level 4; rating: Sunsoft code:01aca1/a9+01aca2/7b+01adb4/a5 cheat description:Start on Level 5; rating: Sunsoft code:01aca1/a9+01aca2/7c+01adb4/a5 cheat description:Have a lot of time code:7e0094/ff cheat description:Open all 'Fun' levels code:7fffc0/1e cheat description:Open all 'Tricky' levels code:7fffc1/1e cheat description:Open all 'Taxing' levels code:7fffc2/1e cheat description:Open all 'Mayhem' levels code:7fffc3/1e cheat description:Open all 'SUNSOFT' levels code:7fffc4/05 cheat description:Instantly win levels code:7e0091/00 cheat description:0% Lemmings needed code:7e0092/00 cheat description:Have 99 Climbers left code:7e0095/63 cheat description:Have 99 Floaters left code:7e0096/63 cheat description:Have 99 Exploders left code:7e0097/63 cheat description:Have 99 Blockers left code:7e0098/63 cheat description:Have 99 Builders left code:7e0099/63 cheat description:Have 99 Bashers left code:7e009a/63 cheat description:Have 99 Miners left code:7e009b/63 cheat description:Have 99 Diggers left code:7e009c/63 cheat description:Have 0 Lemmings left in level code:7e0069/00 cheat description:Have 0 Lemmings left to enter level code:7e006a/00 cheat description:Always rescued 100% of Lemmings code:7e006b/64 cartridge sha256:a2c1970670e2831e47e24ced01bf4ba5aba05cac3773bf524c62d689c35687e1 name:Lester the Unlikely (USA) cheat description:Infinite health against most enemies code:cea6d3/ad cheat description:Infinite lives code:ceac85/ad cheat description:Flashing lasts a long time after getting hit code:cea6da/04 cheat description:Flashing lasts a really long time after getting hit code:cea6da/0c cheat description:Lighter gravity effect (disable right after pressing start, donメt enable until first game play screen) code:cea5c1/40 cheat description:Even lighter gravity effect code:cea5c1/25 cheat description:Amazingly lighter gravity effect code:cea5c1/15 cheat description:Infinite health code:7e859b/03 cartridge sha256:3bc5f296c3dbee012e93a5cf25568f9288ce87b34d74085401a560350eaca03f name:Lethal Enforcers (USA) cheat description:Invincibility - both players code:84aad7/80 cheat description:Infinite ammo code:82a6fb/ea cheat description:Infinite health - both players code:829979/ea cheat description:No health loss when you hit civilians code:8298da/ea cheat description:Hit anywhere - both players code:84d0ee/80+8298ca/80+84843f/80+84d174/35 cheat description:1/2 health lost when you hit civilians code:8298da/ea cheat description:Play with more health code:808a76/1e+808ad2/1e cheat description:Keep weapon until you die code:829917/80 cheat description:Magnum - more shots per round code:81c0e6/0c cheat description:Normal gun - more shots per round code:81c0e2/0c cheat description:Shotgun - more shots per round code:81c0ea/0c cheat description:Invincibility - P1 code:7e00b2/07 cheat description:Invincibility - P2 code:7e00b4/07 cheat description:Infinite ammo for all guns - P1 code:7e1fc0/06 cheat description:Infinite ammo for all guns - P2 code:7e1fc2/06 cheat description:Have Grenade Launcher - P1 code:7e1fbc/02 cheat description:Have Grenade Launcher - P2 code:7e1fbe/02 cheat description:Have Magnum - P1 code:7e1fbc/04 cheat description:Have Magnum - P2 code:7e1fbe/04 cheat description:Have Shotgun - P1 code:7e1fbc/06 cheat description:Have Shotgun - P2 code:7e1fbe/06 cheat description:Have Automatic - P1 code:7e1fbc/08 cheat description:Have Automatic - P2 code:7e1fbe/08 cheat description:Have Glock 45 - P1 code:7e1fbc/0a cheat description:Have Glock 45 - P2 code:7e1fbe/0a cheat description:Have Uzi - P1 code:7e1fbc/0c cheat description:Have Uzi - P2 code:7e1fbe/0c cheat description:Start a new game to enter the Konami Gun System Check Mode code:8089d5/07 cheat description:Start a new game to enter the Sound Check Mode code:8089d5/10 cheat description:Start a new game to enter the Object Test code:8089d5/11 cartridge sha256:80c22cc92d51a54de9cd9fd00db5ff58a35fff35e822169c94e445d50834fba3 name:Lethal Weapon (USA) cheat description:Infinite health code:009ff4/2c cheat description:Infinite ammo code:00b80f/00 cheat description:Infinite time code:00b67d/ad cheat description:More bullets in magazine code:00b816/09 cheat description:2 magazines on pick-up code:00a7cf/02 cheat description:4 magazines on pick-up code:00a7cf/04 cheat description:Slower timer code:00b695/62 cheat description:Faster timer code:00b695/1f cheat description:Super-jump (can get stuck) code:009508/ea cheat description:Start with more badges code:0087dc/06 cheat description:Start with fewer badges code:0087dc/00 cheat description:Start with more magazine clips code:0087c6/09 cheat description:Start with fewer magazine clips code:0087c6/01 cheat description:Invincibility (blinking) code:7e025e/50 cheat description:Infinite health (alt) code:7e0226/06 cheat description:Infinite ammo (alt) code:7e021e/07 cheat description:Infinite time (alt) code:7e0d28/99+7e0d29/09 cheat description:Play as Riggs code:7e0246/00 cheat description:Play as Murtaugh code:7e0246/01 cartridge sha256:457abe634e0a8be03e29513a3dca8f3e9d0ddc6bf97d8931f2316094260f3712 name:Lion King, The (USA) cheat description:Almost infinite health code:c35cb0/ad cheat description:Infinite lives code:c08afa/af cheat description:Roaring doesn't decrease your roar meter code:c3596e/ad cheat description:Roar meter doesn't fill up with time code:c0b552/ad cheat description:Don't lose roar power when you get hit code:c35bed/ad cheat description:higher-jump code:c31152/a9+c31153/f6+c31154/ff cheat description:Mega-jump code:c31152/a9+c31153/f4+c31154/ff cheat description:Walk through walls code:c481a3/80+c48136/00+c0c7d3/00 cheat description:Invincibility (blinking) code:7eb259/3d cheat description:Infinite health code:7e2004/04 cheat description:Infinite Roar meter code:7e2002/10 cheat description:Infinite lives (alt) code:7fffaa/09 cheat description:Infinite continues code:7fffa8/09 cheat description:Infinite time - Bug Hunt I code:7ec0c1/28 cheat description:Infinite time - Bug Hunt II code:7ecb41/28 cheat description:Infinite time - Bug Hunt III code:7ebbc1/28 cheat description:Play as young Simba code:7e2000/00 cheat description:Play as adult Simba code:7e2001/ff cheat description:Start on The Pride Lands code:7fff9e/00 cheat description:Start on Roar At Monkeys code:7fff9e/01 cheat description:Start on The Elephant Graveyard code:7fff9e/02 cheat description:Start on The Stampede code:7fff9e/03 cheat description:Start on Simba's Exile code:7fff9e/04 cheat description:Start on Hakuna Matata code:7fff9e/05 cheat description:Start on Simba's Destiny code:7fff9e/06 cheat description:Start on Be Prepared code:7fff9e/07 cheat description:Start on Simba's Return code:7fff9e/08 cheat description:Start on Pride Rock code:7fff9e/09 cheat description:Start on Bug Toss code:7fff9e/0a cheat description:Start on Bug Hunt I code:7fff9e/0b cheat description:Start on Bug Hunt II code:7fff9e/0c cheat description:Start on Bug Hunt III code:7fff9e/0d cheat description:Start on Game Begins code:7fff9e/0e cheat description:Start on Kill Him code:7fff9e/0f cartridge sha256:52dbfdaca87debdf181b87d55192b0f8dd07e8aeb43afa4b04df16d44ec998e5 name:Little Magic (Japan) cheat description:Infinite Mays / Retries code:7e0059/09 cartridge sha256:7e1d6242ae2ec2c23afb876becdcf778098edd4d853234222dc16471cb51df9e name:Lock On (USA) cheat description:Infinite Flares code:7e1113/46 cheat description:Infinite Missile A code:7e1115/46 cheat description:Infinite Missile B code:7e1116/46 cheat description:Infinite lives code:7e1106/0a cartridge sha256:9f7782a92fda789f9d119b1f0a2f7da0f35606357556a48eca9487797ee1a888 name:Lost Vikings, The (USA) cheat description:Start with infinite health - all Vikings code:7e0fe9/08 cartridge sha256:ab3d97c1a3a979e1680a428ec65df54cfb72997bbfe2173292248a4fa8c51ba1 name:Lost Vikings 2 (USA) cheat description:Infinite health - 1st viking code:7e1037/06 cheat description:Infinite health - 2nd viking code:7e1039/06 cheat description:Infinite health - 3rd viking code:7e103b/06 cartridge sha256:8510491f99400115ccf33570269bc4e484fb56370f7ac36f12e73eec19d342da name:Lucky Luke (Europe) (En,Fr,De,Es) cheat description:Invincibility code:7e0526/48 cheat description:Infinite health code:7e059f/04 cheat description:Infinite lives code:7e05a0/09 cheat description:Infinite rounds code:7e05a2/09 cheat description:Infinite bombs code:7e05a3/09 cartridge sha256:73731a5a7932965de02a9e98055dcf88b4d17b8f710a6ecfde3e36a1f248773b name:Lufia & The Fortress of Doom (USA) cheat description:Move around caves and world map quicker (except when leaving a vehicle) code:019829/20 cheat description:Infinite HP (hit points) code:08e987/bd cheat description:Infinite magic points in battle mode code:08e9c6/bd cheat description:No HP lost when walking over swamp ground code:0196b4/00 cheat description:More HP lost when walking over swamp ground code:0196b4/04 cheat description:Cheap bombs - 1 gold each code:0aef4d/01 cheat description:Cheap smokeballs - 1 gold each code:0aeda1/01 cheat description:Immune to all petrifying effects (stone, poison, confused, etc.) code:08b912/80 cheat description:Shopkeepers don't charge for purchases - some shops only code:00cabf/57 cheat description:More agility points from speed potion code:0aed28/10 cheat description:More intelligence points from mind potion code:0aed4b/10 cheat description:More strength points from great potion code:0aed6e/10 cheat description:Higher max level of magic points from spell potion code:0aed05/10 cheat description:Higher max level of hit points from power potion code:0aece2/10 cheat description:99 of item in slot 1 code:7e14f8/63 cheat description:99 of item in slot 2 code:7e14fa/63 cheat description:99 of item in slot 3 code:7e14fc/63 cheat description:No random battles code:7e149e/00 cheat description:Slot 1 - Nothing code:7e14f7/00 cheat description:Slot 1 - Knife code:7e14f7/01 cheat description:Slot 1 - Club code:7e14f7/02 cheat description:Slot 1 - Mace code:7e14f7/03 cheat description:Slot 1 - Dagger code:7e14f7/04 cheat description:Slot 1 - Long Knife code:7e14f7/05 cheat description:Slot 1 - Short Sword code:7e14f7/06 cheat description:Slot 1 - Rod code:7e14f7/07 cheat description:Slot 1 - Gladius code:7e14f7/08 cheat description:Slot 1 - Glass Robe code:7e14f7/09 cheat description:Slot 1 - Brone Sword code:7e14f7/0a cheat description:Slot 1 - Staff code:7e14f7/0b cheat description:Slot 1 - Scimitar code:7e14f7/0c cheat description:Slot 1 - Rapier code:7e14f7/0d cheat description:Slot 1 - Long Sword code:7e14f7/0e cheat description:Slot 1 - Long Staff code:7e14f7/0f cheat description:Slot 1 - Axe code:7e14f7/10 cheat description:Slot 1 - Spear code:7e14f7/11 cheat description:Slot 1 - Morning Star code:7e14f7/12 cheat description:Slot 1 - Catwhip code:7e14f7/13 cheat description:Slot 1 - Battle Axe code:7e14f7/14 cheat description:Slot 1 - Hammer Rod code:7e14f7/15 cheat description:Slot 1 - Trident code:7e14f7/16 cheat description:Slot 1 - Silver Rod code:7e14f7/17 cheat description:Slot 1 - Silver Sword code:7e14f7/18 cheat description:Slot 1 - Buster Sword code:7e14f7/19 cheat description:Slot 1 - Zircon Rod code:7e14f7/1a cheat description:Slot 1 - Great Axe code:7e14f7/1b cheat description:Slot 1 - Great Blade code:7e14f7/1c cheat description:Slot 1 - Zircon Axe code:7e14f7/1d cheat description:Slot 1 - Zircon Sword code:7e14f7/1e cheat description:Slot 1 - Broad Sword code:7e14f7/1f cheat description:Slot 1 - Broad Rod code:7e14f7/20 cheat description:Slot 1 - Luck Blade code:7e14f7/21 cheat description:Slot 1 - Gloom Pick code:7e14f7/22 cheat description:Slot 1 - Dual Blade code:7e14f7/23 cheat description:Slot 1 - Dress code:7e14f7/24 cheat description:Slot 1 - Cloth code:7e14f7/25 cheat description:Slot 1 - Cloth Armor code:7e14f7/26 cheat description:Slot 1 - Robe code:7e14f7/27 cheat description:Slot 1 - Tan Armor code:7e14f7/28 cheat description:Slot 1 - Tan Robe code:7e14f7/29 cheat description:Slot 1 - Light Armor code:7e14f7/2a cheat description:Slot 1 - Light Robe code:7e14f7/2b cheat description:Slot 1 - Chain Mail code:7e14f7/2c cheat description:Slot 1 - Chain Cloth code:7e14f7/2d cheat description:Slot 1 - Plate Cloth code:7e14f7/2e cheat description:Slot 1 - Brone Armor code:7e14f7/2f cheat description:Slot 1 - Quilted Silk code:7e14f7/30 cheat description:Slot 1 - Half Mail code:7e14f7/31 cheat description:Slot 1 - Brone Robe code:7e14f7/32 cheat description:Slot 1 - Silver Armor code:7e14f7/33 cheat description:Slot 1 - Silver Robe code:7e14f7/34 cheat description:Slot 1 - Plate Mail code:7e14f7/35 cheat description:Slot 1 - Zircon Robe code:7e14f7/36 cheat description:Slot 1 - Zircon Armor code:7e14f7/37 cheat description:Slot 1 - Clear Silk code:7e14f7/38 cheat description:Slot 1 - Bracelet code:7e14f7/39 cheat description:Slot 1 - Tan Shield code:7e14f7/3a cheat description:Slot 1 - Wood Shield code:7e14f7/3b cheat description:Slot 1 - Buckler code:7e14f7/3c cheat description:Slot 1 - Wood Wrist code:7e14f7/3d cheat description:Slot 1 - Kite Shield code:7e14f7/3e cheat description:Slot 1 - Round Shield code:7e14f7/3f cheat description:Slot 1 - Round Wrist code:7e14f7/40 cheat description:Slot 1 - Brone Shield code:7e14f7/41 cheat description:Slot 1 - Tower Shield code:7e14f7/42 cheat description:Slot 1 - Large Shield code:7e14f7/43 cheat description:Slot 1 - Silver Wrist code:7e14f7/44 cheat description:Slot 1 - Silver Plate code:7e14f7/45 cheat description:Slot 1 - Zircon Wrist code:7e14f7/46 cheat description:Slot 1 - Zircon Plate code:7e14f7/47 cheat description:Slot 1 - Cloth Helm code:7e14f7/48 cheat description:Slot 1 - Tan Helm code:7e14f7/49 cheat description:Slot 1 - Hair Band code:7e14f7/4a cheat description:Slot 1 - Wood Helm code:7e14f7/4b cheat description:Slot 1 - Glass Cap code:7e14f7/4c cheat description:Slot 1 - Brone Helm code:7e14f7/4d cheat description:Slot 1 - Red Beret code:7e14f7/4e cheat description:Slot 1 - Iron Helm code:7e14f7/4f cheat description:Slot 1 - Plate Cap code:7e14f7/50 cheat description:Slot 1 - Plate Helm code:7e14f7/51 cheat description:Slot 1 - Glass Beret code:7e14f7/52 cheat description:Slot 1 - Silver Helm code:7e14f7/53 cheat description:Slot 1 - Sakret code:7e14f7/54 cheat description:Slot 1 - Zircon Beret code:7e14f7/55 cheat description:Slot 1 - Zircon Helm code:7e14f7/56 cheat description:Slot 1 - Sandal code:7e14f7/57 cheat description:Slot 1 - Cloth Shoes code:7e14f7/58 cheat description:Slot 1 - Tan Shoes code:7e14f7/59 cheat description:Slot 1 - Spike Shoes code:7e14f7/5a cheat description:Slot 1 - Heeled Shoes code:7e14f7/5b cheat description:Slot 1 - Wind Shoes code:7e14f7/5c cheat description:Slot 1 - Wind Heels code:7e14f7/5d cheat description:Slot 1 - Knife Shoes code:7e14f7/5e cheat description:Slot 1 - Needle Heels code:7e14f7/5f cheat description:Slot 1 - Sonic Shoes code:7e14f7/60 cheat description:Slot 1 - Sonic Heels code:7e14f7/61 cheat description:Slot 1 - Sword Shoes code:7e14f7/62 cheat description:Slot 1 - Cat Heels code:7e14f7/63 cheat description:Slot 1 - Mach Shoes code:7e14f7/64 cheat description:Slot 1 - Mach Heels code:7e14f7/65 cheat description:Slot 1 - Power Ring code:7e14f7/66 cheat description:Slot 1 - HiPower Ring code:7e14f7/67 cheat description:Slot 1 - Daze Ring code:7e14f7/68 cheat description:Slot 1 - Hi Daze Ring code:7e14f7/69 cheat description:Slot 1 - Mind Ring code:7e14f7/6a cheat description:Slot 1 - Sonic Ring code:7e14f7/6b cheat description:Slot 1 - Mach Ring code:7e14f7/6c cheat description:Slot 1 - Undead Ring code:7e14f7/6d cheat description:Slot 1 - Ghost Ring code:7e14f7/6e cheat description:Slot 1 - Dragon Ring code:7e14f7/6f cheat description:Slot 1 - Sea Ring code:7e14f7/70 cheat description:Slot 1 - Fly Ring code:7e14f7/71 cheat description:Slot 1 - Water Ring code:7e14f7/72 cheat description:Slot 1 - Fire Ring code:7e14f7/73 cheat description:Slot 1 - Ice Ring code:7e14f7/74 cheat description:Slot 1 - Electro Ring code:7e14f7/75 cheat description:Slot 1 - Flash Ring code:7e14f7/76 cheat description:Slot 1 - Flame Ring code:7e14f7/77 cheat description:Slot 1 - Water Ring code:7e14f7/78 cheat description:Slot 1 - Blast Ring code:7e14f7/79 cheat description:Slot 1 - Frost Ring code:7e14f7/7a cheat description:Slot 1 - Might Armor code:7e14f7/7b cheat description:Slot 1 - Might Shield code:7e14f7/7c cheat description:Slot 1 - Might Helmet code:7e14f7/7d cheat description:Slot 1 - Gloom Ring code:7e14f7/7e cheat description:Slot 1 - Gloom Voice code:7e14f7/7f cheat description:Slot 1 - Dummy (?) code:7e14f7/80 cheat description:Slot 1 - Brone Breast code:7e14f7/81 cheat description:Slot 1 - Carbo Sword code:7e14f7/82 cheat description:Slot 1 - Carbo Plate code:7e14f7/83 cheat description:Slot 1 - Carbo Shield code:7e14f7/84 cheat description:Slot 1 - Carbo Helm code:7e14f7/85 cheat description:Slot 1 - Carbo Cap code:7e14f7/86 cheat description:Slot 1 - Gloom Guard code:7e14f7/87 cheat description:Slot 1 - Diamond Ring code:7e14f7/88 cheat description:Slot 1 - Engage Ring code:7e14f7/89 cheat description:Slot 1 - Monster Ring code:7e14f7/8a cheat description:Slot 1 - Blue Ring code:7e14f7/8b cheat description:Slot 1 - Yellow Ring code:7e14f7/8c cheat description:Slot 1 - Red Ring code:7e14f7/8d cheat description:Slot 1 - Purple Ring code:7e14f7/8e cheat description:Slot 1 - Green Ring code:7e14f7/8f cheat description:Slot 1 - White Ring code:7e14f7/90 cheat description:Slot 1 - Black Ring code:7e14f7/91 cheat description:Slot 1 - Heavy Ring code:7e14f7/92 cheat description:Slot 1 - Wave Ring code:7e14f7/93 cheat description:Slot 1 - Potion code:7e14f7/94 cheat description:Slot 1 - Hi Potion code:7e14f7/95 cheat description:Slot 1 - Ex Potion code:7e14f7/96 cheat description:Slot 1 - Hi Magic code:7e14f7/97 cheat description:Slot 1 - Ex Magic code:7e14f7/98 cheat description:Slot 1 - Antidote code:7e14f7/99 cheat description:Slot 1 - Sweet Water code:7e14f7/9a cheat description:Slot 1 - Foul Water code:7e14f7/9b cheat description:Slot 1 - Awaken code:7e14f7/9c cheat description:Slot 1 - Stone Cure code:7e14f7/9d cheat description:Slot 1 - Mystery Pin code:7e14f7/9e cheat description:Slot 1 - Shriek code:7e14f7/9f cheat description:Slot 1 - Swing Wing code:7e14f7/a0 cheat description:Slot 1 - Magic Guard code:7e14f7/a1 cheat description:Slot 1 - Power Gourd code:7e14f7/a2 cheat description:Slot 1 - Mind Gourd code:7e14f7/a3 cheat description:Slot 1 - Power Potion code:7e14f7/a4 cheat description:Slot 1 - Spell Potion code:7e14f7/a5 cheat description:Slot 1 - Speed Potion code:7e14f7/a6 cheat description:Slot 1 - Mind Potion code:7e14f7/a7 cheat description:Slot 1 - Great Potion code:7e14f7/a8 cheat description:Slot 1 - Float code:7e14f7/a9 cheat description:Slot 1 - Smoke Ball code:7e14f7/aa cheat description:Slot 1 - Arrow code:7e14f7/ab cheat description:Slot 1 - Mid Arrow code:7e14f7/ac cheat description:Slot 1 - Big Arrow code:7e14f7/ad cheat description:Slot 1 - Arrows code:7e14f7/ae cheat description:Slot 1 - Hi Arrows code:7e14f7/af cheat description:Slot 1 - Ex Arrows code:7e14f7/b0 cheat description:Slot 1 - Dragon Arrow code:7e14f7/b1 cheat description:Slot 1 - Sleep Arrow code:7e14f7/b2 cheat description:Slot 1 - Puzzle Arrow code:7e14f7/b3 cheat description:Slot 1 - Stun Arrow code:7e14f7/b4 cheat description:Slot 1 - Gloom Arrow code:7e14f7/b5 cheat description:Slot 1 - Bomb code:7e14f7/b6 cheat description:Slot 1 - Hi Bomb code:7e14f7/b7 cheat description:Slot 1 - Ex Bomb code:7e14f7/b8 cheat description:Slot 1 - Miracle code:7e14f7/b9 cheat description:Slot 1 - Revive code:7e14f7/ba cheat description:Slot 1 - Pear Cider code:7e14f7/bb cheat description:Slot 1 - Sour Cider code:7e14f7/bc cheat description:Slot 1 - Lime Cider code:7e14f7/bd cheat description:Slot 1 - Plum Cider code:7e14f7/be cheat description:Slot 1 - Apple Cider code:7e14f7/bf cheat description:Slot 1 - Hair Band code:7e14f7/c0 cheat description:Slot 1 - Brooch code:7e14f7/c1 cheat description:Slot 1 - Earring code:7e14f7/c2 cheat description:Slot 1 - Necklace code:7e14f7/c3 cheat description:Slot 1 - Stuffed Bear code:7e14f7/c4 cheat description:Slot 1 - Stuffed Dog code:7e14f7/c5 cheat description:Slot 1 - Stuffed Pig code:7e14f7/c6 cheat description:Slot 1 - Emerald code:7e14f7/c7 cheat description:Slot 1 - Opal code:7e14f7/c8 cheat description:Slot 1 - Goblet code:7e14f7/c9 cheat description:Slot 1 - Ear Tip code:7e14f7/ca cheat description:Slot 1 - Empty Bottle code:7e14f7/cb cheat description:Slot 1 - Gown code:7e14f7/cc cheat description:Slot 1 - Ribbon code:7e14f7/cd cheat description:Slot 1 - Fry Pan code:7e14f7/ce cheat description:Slot 1 - Small Knife code:7e14f7/cf cheat description:Slot 1 - Pot code:7e14f7/d0 cheat description:Slot 1 - Chop Block code:7e14f7/d1 cheat description:Slot 1 - Apron code:7e14f7/d2 cheat description:Slot 1 - Dragon Egg code:7e14f7/d3 cheat description:Slot 1 - Crown code:7e14f7/d4 cheat description:Slot 1 - Secret Map code:7e14f7/d5 cheat description:Slot 1 - Miracle Gem code:7e14f7/d6 cheat description:Slot 1 - Silver Wick code:7e14f7/d7 cheat description:Slot 1 - Royal Statue code:7e14f7/d8 cheat description:Slot 1 - Silver Tarot code:7e14f7/d9 cheat description:Slot 1 - Golden Pawn code:7e14f7/da cheat description:Slot 1 - Crown Jewels code:7e14f7/db cheat description:Slot 1 - Wind Flute code:7e14f7/dc cheat description:Slot 1 - Escape code:7e14f7/dd cheat description:Slot 1 - Magic Jar code:7e14f7/de cheat description:Slot 1 - Dragon Tooth code:7e14f7/df cheat description:Slot 1 - Grilled Newt code:7e14f7/e0 cheat description:Slot 1 - Poison Pin code:7e14f7/e1 cheat description:Slot 1 - Might Sword code:7e14f7/e2 cheat description:Slot 1 - Straw Doll code:7e14f7/e3 cheat description:Slot 1 - Long Nail code:7e14f7/e4 cheat description:Slot 1 - Bomb code:7e14f7/e5 cheat description:Slot 1 - Alumina code:7e14f7/e6 cheat description:Slot 1 - Power Oil code:7e14f7/e7 cheat description:Slot 1 - Elven Bow code:7e14f7/e8 cheat description:Slot 1 - Artea's Bow code:7e14f7/e9 cheat description:Slot 1 - Might Bow code:7e14f7/ea cheat description:Slot 1 - Dummy (?) code:7e14f7/eb cheat description:Slot 1 - Dummy (?) code:7e14f7/ec cheat description:Slot 1 - Dummy (?) code:7e14f7/ed cheat description:Slot 1 - Dummy (?) code:7e14f7/ee cheat description:Slot 1 - Free Door code:7e14f7/ef cheat description:Slot 1 - Sheran Key code:7e14f7/f0 cheat description:Slot 1 - Letter code:7e14f7/f1 cheat description:Slot 1 - Dais Key code:7e14f7/f2 cheat description:Slot 1 - Shrine Key code:7e14f7/f3 cheat description:Slot 1 - Pirate Key code:7e14f7/f4 cheat description:Slot 1 - Light Key code:7e14f7/f5 cheat description:Slot 1 - Oil Key code:7e14f7/f6 cheat description:Slot 1 - Green Jade code:7e14f7/f7 cheat description:Slot 1 - Red Sapphire code:7e14f7/f8 cheat description:Slot 1 - Blue Jade code:7e14f7/f9 cheat description:Slot 1 - Purple Newt code:7e14f7/fa cheat description:Slot 1 - Glasdar Key code:7e14f7/fb cheat description:Slot 1 - Magic Flavor code:7e14f7/fc cheat description:Slot 1 - Fairy Kiss code:7e14f7/fd cheat description:Slot 2 - Nothing code:7e14f9/00 cheat description:Slot 2 - Knife code:7e14f9/01 cheat description:Slot 2 - Club code:7e14f9/02 cheat description:Slot 2 - Mace code:7e14f9/03 cheat description:Slot 2 - Dagger code:7e14f9/04 cheat description:Slot 2 - Long Knife code:7e14f9/05 cheat description:Slot 2 - Short Sword code:7e14f9/06 cheat description:Slot 2 - Rod code:7e14f9/07 cheat description:Slot 2 - Gladius code:7e14f9/08 cheat description:Slot 2 - Glass Robe code:7e14f9/09 cheat description:Slot 2 - Brone Sword code:7e14f9/0a cheat description:Slot 2 - Staff code:7e14f9/0b cheat description:Slot 2 - Scimitar code:7e14f9/0c cheat description:Slot 2 - Rapier code:7e14f9/0d cheat description:Slot 2 - Long Sword code:7e14f9/0e cheat description:Slot 2 - Long Staff code:7e14f9/0f cheat description:Slot 2 - Axe code:7e14f9/10 cheat description:Slot 2 - Spear code:7e14f9/11 cheat description:Slot 2 - Morning Star code:7e14f9/12 cheat description:Slot 2 - Catwhip code:7e14f9/13 cheat description:Slot 2 - Battle Axe code:7e14f9/14 cheat description:Slot 2 - Hammer Rod code:7e14f9/15 cheat description:Slot 2 - Trident code:7e14f9/16 cheat description:Slot 2 - Silver Rod code:7e14f9/17 cheat description:Slot 2 - Silver Sword code:7e14f9/18 cheat description:Slot 2 - Buster Sword code:7e14f9/19 cheat description:Slot 2 - Zircon Rod code:7e14f9/1a cheat description:Slot 2 - Great Axe code:7e14f9/1b cheat description:Slot 2 - Great Blade code:7e14f9/1c cheat description:Slot 2 - Zircon Axe code:7e14f9/1d cheat description:Slot 2 - Zircon Sword code:7e14f9/1e cheat description:Slot 2 - Broad Sword code:7e14f9/1f cheat description:Slot 2 - Broad Rod code:7e14f9/20 cheat description:Slot 2 - Luck Blade code:7e14f9/21 cheat description:Slot 2 - Gloom Pick code:7e14f9/22 cheat description:Slot 2 - Dual Blade code:7e14f9/23 cheat description:Slot 2 - Dress code:7e14f9/24 cheat description:Slot 2 - Cloth code:7e14f9/25 cheat description:Slot 2 - Cloth Armor code:7e14f9/26 cheat description:Slot 2 - Robe code:7e14f9/27 cheat description:Slot 2 - Tan Armor code:7e14f9/28 cheat description:Slot 2 - Tan Robe code:7e14f9/29 cheat description:Slot 2 - Light Armor code:7e14f9/2a cheat description:Slot 2 - Light Robe code:7e14f9/2b cheat description:Slot 2 - Chain Mail code:7e14f9/2c cheat description:Slot 2 - Chain Cloth code:7e14f9/2d cheat description:Slot 2 - Plate Cloth code:7e14f9/2e cheat description:Slot 2 - Brone Armor code:7e14f9/2f cheat description:Slot 2 - Quilted Silk code:7e14f9/30 cheat description:Slot 2 - Half Mail code:7e14f9/31 cheat description:Slot 2 - Brone Robe code:7e14f9/32 cheat description:Slot 2 - Silver Armor code:7e14f9/33 cheat description:Slot 2 - Silver Robe code:7e14f9/34 cheat description:Slot 2 - Plate Mail code:7e14f9/35 cheat description:Slot 2 - Zircon Robe code:7e14f9/36 cheat description:Slot 2 - Zircon Armor code:7e14f9/37 cheat description:Slot 2 - Clear Silk code:7e14f9/38 cheat description:Slot 2 - Bracelet code:7e14f9/39 cheat description:Slot 2 - Tan Shield code:7e14f9/3a cheat description:Slot 2 - Wood Shield code:7e14f9/3b cheat description:Slot 2 - Buckler code:7e14f9/3c cheat description:Slot 2 - Wood Wrist code:7e14f9/3d cheat description:Slot 2 - Kite Shield code:7e14f9/3e cheat description:Slot 2 - Round Shield code:7e14f9/3f cheat description:Slot 2 - Round Wrist code:7e14f9/40 cheat description:Slot 2 - Brone Shield code:7e14f9/41 cheat description:Slot 2 - Tower Shield code:7e14f9/42 cheat description:Slot 2 - Large Shield code:7e14f9/43 cheat description:Slot 2 - Silver Wrist code:7e14f9/44 cheat description:Slot 2 - Silver Plate code:7e14f9/45 cheat description:Slot 2 - Zircon Wrist code:7e14f9/46 cheat description:Slot 2 - Zircon Plate code:7e14f9/47 cheat description:Slot 2 - Cloth Helm code:7e14f9/48 cheat description:Slot 2 - Tan Helm code:7e14f9/49 cheat description:Slot 2 - Hair Band code:7e14f9/4a cheat description:Slot 2 - Wood Helm code:7e14f9/4b cheat description:Slot 2 - Glass Cap code:7e14f9/4c cheat description:Slot 2 - Brone Helm code:7e14f9/4d cheat description:Slot 2 - Red Beret code:7e14f9/4e cheat description:Slot 2 - Iron Helm code:7e14f9/4f cheat description:Slot 2 - Plate Cap code:7e14f9/50 cheat description:Slot 2 - Plate Helm code:7e14f9/51 cheat description:Slot 2 - Glass Beret code:7e14f9/52 cheat description:Slot 2 - Silver Helm code:7e14f9/53 cheat description:Slot 2 - Sakret code:7e14f9/54 cheat description:Slot 2 - Zircon Beret code:7e14f9/55 cheat description:Slot 2 - Zircon Helm code:7e14f9/56 cheat description:Slot 2 - Sandal code:7e14f9/57 cheat description:Slot 2 - Cloth Shoes code:7e14f9/58 cheat description:Slot 2 - Tan Shoes code:7e14f9/59 cheat description:Slot 2 - Spike Shoes code:7e14f9/5a cheat description:Slot 2 - Heeled Shoes code:7e14f9/5b cheat description:Slot 2 - Wind Shoes code:7e14f9/5c cheat description:Slot 2 - Wind Heels code:7e14f9/5d cheat description:Slot 2 - Knife Shoes code:7e14f9/5e cheat description:Slot 2 - Needle Heels code:7e14f9/5f cheat description:Slot 2 - Sonic Shoes code:7e14f9/60 cheat description:Slot 2 - Sonic Heels code:7e14f9/61 cheat description:Slot 2 - Sword Shoes code:7e14f9/62 cheat description:Slot 2 - Cat Heels code:7e14f9/63 cheat description:Slot 2 - Mach Shoes code:7e14f9/64 cheat description:Slot 2 - Mach Heels code:7e14f9/65 cheat description:Slot 2 - Power Ring code:7e14f9/66 cheat description:Slot 2 - HiPower Ring code:7e14f9/67 cheat description:Slot 2 - Daze Ring code:7e14f9/68 cheat description:Slot 2 - Hi Daze Ring code:7e14f9/69 cheat description:Slot 2 - Mind Ring code:7e14f9/6a cheat description:Slot 2 - Sonic Ring code:7e14f9/6b cheat description:Slot 2 - Mach Ring code:7e14f9/6c cheat description:Slot 2 - Undead Ring code:7e14f9/6d cheat description:Slot 2 - Ghost Ring code:7e14f9/6e cheat description:Slot 2 - Dragon Ring code:7e14f9/6f cheat description:Slot 2 - Sea Ring code:7e14f9/70 cheat description:Slot 2 - Fly Ring code:7e14f9/71 cheat description:Slot 2 - Water Ring code:7e14f9/72 cheat description:Slot 2 - Fire Ring code:7e14f9/73 cheat description:Slot 2 - Ice Ring code:7e14f9/74 cheat description:Slot 2 - Electro Ring code:7e14f9/75 cheat description:Slot 2 - Flash Ring code:7e14f9/76 cheat description:Slot 2 - Flame Ring code:7e14f9/77 cheat description:Slot 2 - Water Ring code:7e14f9/78 cheat description:Slot 2 - Blast Ring code:7e14f9/79 cheat description:Slot 2 - Frost Ring code:7e14f9/7a cheat description:Slot 2 - Might Armor code:7e14f9/7b cheat description:Slot 2 - Might Shield code:7e14f9/7c cheat description:Slot 2 - Might Helmet code:7e14f9/7d cheat description:Slot 2 - Gloom Ring code:7e14f9/7e cheat description:Slot 2 - Gloom Voice code:7e14f9/7f cheat description:Slot 2 - Dummy (?) code:7e14f9/80 cheat description:Slot 2 - Brone Breast code:7e14f9/81 cheat description:Slot 2 - Carbo Sword code:7e14f9/82 cheat description:Slot 2 - Carbo Plate code:7e14f9/83 cheat description:Slot 2 - Carbo Shield code:7e14f9/84 cheat description:Slot 2 - Carbo Helm code:7e14f9/85 cheat description:Slot 2 - Carbo Cap code:7e14f9/86 cheat description:Slot 2 - Gloom Guard code:7e14f9/87 cheat description:Slot 2 - Diamond Ring code:7e14f9/88 cheat description:Slot 2 - Engage Ring code:7e14f9/89 cheat description:Slot 2 - Monster Ring code:7e14f9/8a cheat description:Slot 2 - Blue Ring code:7e14f9/8b cheat description:Slot 2 - Yellow Ring code:7e14f9/8c cheat description:Slot 2 - Red Ring code:7e14f9/8d cheat description:Slot 2 - Purple Ring code:7e14f9/8e cheat description:Slot 2 - Green Ring code:7e14f9/8f cheat description:Slot 2 - White Ring code:7e14f9/90 cheat description:Slot 2 - Black Ring code:7e14f9/91 cheat description:Slot 2 - Heavy Ring code:7e14f9/92 cheat description:Slot 2 - Wave Ring code:7e14f9/93 cheat description:Slot 2 - Potion code:7e14f9/94 cheat description:Slot 2 - Hi Potion code:7e14f9/95 cheat description:Slot 2 - Ex Potion code:7e14f9/96 cheat description:Slot 2 - Hi Magic code:7e14f9/97 cheat description:Slot 2 - Ex Magic code:7e14f9/98 cheat description:Slot 2 - Antidote code:7e14f9/99 cheat description:Slot 2 - Sweet Water code:7e14f9/9a cheat description:Slot 2 - Foul Water code:7e14f9/9b cheat description:Slot 2 - Awaken code:7e14f9/9c cheat description:Slot 2 - Stone Cure code:7e14f9/9d cheat description:Slot 2 - Mystery Pin code:7e14f9/9e cheat description:Slot 2 - Shriek code:7e14f9/9f cheat description:Slot 2 - Swing Wing code:7e14f9/a0 cheat description:Slot 2 - Magic Guard code:7e14f9/a1 cheat description:Slot 2 - Power Gourd code:7e14f9/a2 cheat description:Slot 2 - Mind Gourd code:7e14f9/a3 cheat description:Slot 2 - Power Potion code:7e14f9/a4 cheat description:Slot 2 - Spell Potion code:7e14f9/a5 cheat description:Slot 2 - Speed Potion code:7e14f9/a6 cheat description:Slot 2 - Mind Potion code:7e14f9/a7 cheat description:Slot 2 - Great Potion code:7e14f9/a8 cheat description:Slot 2 - Float code:7e14f9/a9 cheat description:Slot 2 - Smoke Ball code:7e14f9/aa cheat description:Slot 2 - Arrow code:7e14f9/ab cheat description:Slot 2 - Mid Arrow code:7e14f9/ac cheat description:Slot 2 - Big Arrow code:7e14f9/ad cheat description:Slot 2 - Arrows code:7e14f9/ae cheat description:Slot 2 - Hi Arrows code:7e14f9/af cheat description:Slot 2 - Ex Arrows code:7e14f9/b0 cheat description:Slot 2 - Dragon Arrow code:7e14f9/b1 cheat description:Slot 2 - Sleep Arrow code:7e14f9/b2 cheat description:Slot 2 - Puzzle Arrow code:7e14f9/b3 cheat description:Slot 2 - Stun Arrow code:7e14f9/b4 cheat description:Slot 2 - Gloom Arrow code:7e14f9/b5 cheat description:Slot 2 - Bomb code:7e14f9/b6 cheat description:Slot 2 - Hi Bomb code:7e14f9/b7 cheat description:Slot 2 - Ex Bomb code:7e14f9/b8 cheat description:Slot 2 - Miracle code:7e14f9/b9 cheat description:Slot 2 - Revive code:7e14f9/ba cheat description:Slot 2 - Pear Cider code:7e14f9/bb cheat description:Slot 2 - Sour Cider code:7e14f9/bc cheat description:Slot 2 - Lime Cider code:7e14f9/bd cheat description:Slot 2 - Plum Cider code:7e14f9/be cheat description:Slot 2 - Apple Cider code:7e14f9/bf cheat description:Slot 2 - Hair Band code:7e14f9/c0 cheat description:Slot 2 - Brooch code:7e14f9/c1 cheat description:Slot 2 - Earring code:7e14f9/c2 cheat description:Slot 2 - Necklace code:7e14f9/c3 cheat description:Slot 2 - Stuffed Bear code:7e14f9/c4 cheat description:Slot 2 - Stuffed Dog code:7e14f9/c5 cheat description:Slot 2 - Stuffed Pig code:7e14f9/c6 cheat description:Slot 2 - Emerald code:7e14f9/c7 cheat description:Slot 2 - Opal code:7e14f9/c8 cheat description:Slot 2 - Goblet code:7e14f9/c9 cheat description:Slot 2 - Ear Tip code:7e14f9/ca cheat description:Slot 2 - Empty Bottle code:7e14f9/cb cheat description:Slot 2 - Gown code:7e14f9/cc cheat description:Slot 2 - Ribbon code:7e14f9/cd cheat description:Slot 2 - Fry Pan code:7e14f9/ce cheat description:Slot 2 - Small Knife code:7e14f9/cf cheat description:Slot 2 - Pot code:7e14f9/d0 cheat description:Slot 2 - Chop Block code:7e14f9/d1 cheat description:Slot 2 - Apron code:7e14f9/d2 cheat description:Slot 2 - Dragon Egg code:7e14f9/d3 cheat description:Slot 2 - Crown code:7e14f9/d4 cheat description:Slot 2 - Secret Map code:7e14f9/d5 cheat description:Slot 2 - Miracle Gem code:7e14f9/d6 cheat description:Slot 2 - Silver Wick code:7e14f9/d7 cheat description:Slot 2 - Royal Statue code:7e14f9/d8 cheat description:Slot 2 - Silver Tarot code:7e14f9/d9 cheat description:Slot 2 - Golden Pawn code:7e14f9/da cheat description:Slot 2 - Crown Jewels code:7e14f9/db cheat description:Slot 2 - Wind Flute code:7e14f9/dc cheat description:Slot 2 - Escape code:7e14f9/dd cheat description:Slot 2 - Magic Jar code:7e14f9/de cheat description:Slot 2 - Dragon Tooth code:7e14f9/df cheat description:Slot 2 - Grilled Newt code:7e14f9/e0 cheat description:Slot 2 - Poison Pin code:7e14f9/e1 cheat description:Slot 2 - Might Sword code:7e14f9/e2 cheat description:Slot 2 - Straw Doll code:7e14f9/e3 cheat description:Slot 2 - Long Nail code:7e14f9/e4 cheat description:Slot 2 - Bomb code:7e14f9/e5 cheat description:Slot 2 - Alumina code:7e14f9/e6 cheat description:Slot 2 - Power Oil code:7e14f9/e7 cheat description:Slot 2 - Elven Bow code:7e14f9/e8 cheat description:Slot 2 - Artea's Bow code:7e14f9/e9 cheat description:Slot 2 - Might Bow code:7e14f9/ea cheat description:Slot 2 - Dummy (?) code:7e14f9/eb cheat description:Slot 2 - Dummy (?) code:7e14f9/ec cheat description:Slot 2 - Dummy (?) code:7e14f9/ed cheat description:Slot 2 - Dummy (?) code:7e14f9/ee cheat description:Slot 2 - Free Door code:7e14f9/ef cheat description:Slot 2 - Sheran Key code:7e14f9/f0 cheat description:Slot 2 - Letter code:7e14f9/f1 cheat description:Slot 2 - Dais Key code:7e14f9/f2 cheat description:Slot 2 - Shrine Key code:7e14f9/f3 cheat description:Slot 2 - Pirate Key code:7e14f9/f4 cheat description:Slot 2 - Light Key code:7e14f9/f5 cheat description:Slot 2 - Oil Key code:7e14f9/f6 cheat description:Slot 2 - Green Jade code:7e14f9/f9 cheat description:Slot 2 - Red Sapphire code:7e14f9/f8 cheat description:Slot 2 - Blue Jade code:7e14f9/f9 cheat description:Slot 2 - Purple Newt code:7e14f9/fa cheat description:Slot 2 - Glasdar Key code:7e14f9/fb cheat description:Slot 2 - Magic Flavor code:7e14f9/fc cheat description:Slot 2 - Fairy Kiss code:7e14f9/fd cheat description:Slot 3 - Nothing code:7e14fb/00 cheat description:Slot 3 - Knife code:7e14fb/01 cheat description:Slot 3 - Club code:7e14fb/02 cheat description:Slot 3 - Mace code:7e14fb/03 cheat description:Slot 3 - Dagger code:7e14fb/04 cheat description:Slot 3 - Long Knife code:7e14fb/05 cheat description:Slot 3 - Short Sword code:7e14fb/06 cheat description:Slot 3 - Rod code:7e14fb/07 cheat description:Slot 3 - Gladius code:7e14fb/08 cheat description:Slot 3 - Glass Robe code:7e14fb/09 cheat description:Slot 3 - Brone Sword code:7e14fb/0a cheat description:Slot 3 - Staff code:7e14fb/0b cheat description:Slot 3 - Scimitar code:7e14fb/0c cheat description:Slot 3 - Rapier code:7e14fb/0d cheat description:Slot 3 - Long Sword code:7e14fb/0e cheat description:Slot 3 - Long Staff code:7e14fb/0f cheat description:Slot 3 - Axe code:7e14fb/10 cheat description:Slot 3 - Spear code:7e14fb/11 cheat description:Slot 3 - Morning Star code:7e14fb/12 cheat description:Slot 3 - Catwhip code:7e14fb/13 cheat description:Slot 3 - Battle Axe code:7e14fb/14 cheat description:Slot 3 - Hammer Rod code:7e14fb/15 cheat description:Slot 3 - Trident code:7e14fb/16 cheat description:Slot 3 - Silver Rod code:7e14fb/17 cheat description:Slot 3 - Silver Sword code:7e14fb/18 cheat description:Slot 3 - Buster Sword code:7e14fb/19 cheat description:Slot 3 - Zircon Rod code:7e14fb/1a cheat description:Slot 3 - Great Axe code:7e14fb/1b cheat description:Slot 3 - Great Blade code:7e14fb/1c cheat description:Slot 3 - Zircon Axe code:7e14fb/1d cheat description:Slot 3 - Zircon Sword code:7e14fb/1e cheat description:Slot 3 - Broad Sword code:7e14fb/1f cheat description:Slot 3 - Broad Rod code:7e14fb/20 cheat description:Slot 3 - Luck Blade code:7e14fb/21 cheat description:Slot 3 - Gloom Pick code:7e14fb/22 cheat description:Slot 3 - Dual Blade code:7e14fb/23 cheat description:Slot 3 - Dress code:7e14fb/24 cheat description:Slot 3 - Cloth code:7e14fb/25 cheat description:Slot 3 - Cloth Armor code:7e14fb/26 cheat description:Slot 3 - Robe code:7e14fb/27 cheat description:Slot 3 - Tan Armor code:7e14fb/28 cheat description:Slot 3 - Tan Robe code:7e14fb/29 cheat description:Slot 3 - Light Armor code:7e14fb/2a cheat description:Slot 3 - Light Robe code:7e14fb/2b cheat description:Slot 3 - Chain Mail code:7e14fb/2c cheat description:Slot 3 - Chain Cloth code:7e14fb/2d cheat description:Slot 3 - Plate Cloth code:7e14fb/2e cheat description:Slot 3 - Brone Armor code:7e14fb/2f cheat description:Slot 3 - Quilted Silk code:7e14fb/30 cheat description:Slot 3 - Half Mail code:7e14fb/31 cheat description:Slot 3 - Brone Robe code:7e14fb/32 cheat description:Slot 3 - Silver Armor code:7e14fb/33 cheat description:Slot 3 - Silver Robe code:7e14fb/34 cheat description:Slot 3 - Plate Mail code:7e14fb/35 cheat description:Slot 3 - Zircon Robe code:7e14fb/36 cheat description:Slot 3 - Zircon Armor code:7e14fb/37 cheat description:Slot 3 - Clear Silk code:7e14fb/38 cheat description:Slot 3 - Bracelet code:7e14fb/39 cheat description:Slot 3 - Tan Shield code:7e14fb/3a cheat description:Slot 3 - Wood Shield code:7e14fb/3b cheat description:Slot 3 - Buckler code:7e14fb/3c cheat description:Slot 3 - Wood Wrist code:7e14fb/3d cheat description:Slot 3 - Kite Shield code:7e14fb/3e cheat description:Slot 3 - Round Shield code:7e14fb/3f cheat description:Slot 3 - Round Wrist code:7e14fb/40 cheat description:Slot 3 - Brone Shield code:7e14fb/41 cheat description:Slot 3 - Tower Shield code:7e14fb/42 cheat description:Slot 3 - Large Shield code:7e14fb/43 cheat description:Slot 3 - Silver Wrist code:7e14fb/44 cheat description:Slot 3 - Silver Plate code:7e14fb/45 cheat description:Slot 3 - Zircon Wrist code:7e14fb/46 cheat description:Slot 3 - Zircon Plate code:7e14fb/47 cheat description:Slot 3 - Cloth Helm code:7e14fb/48 cheat description:Slot 3 - Tan Helm code:7e14fb/49 cheat description:Slot 3 - Hair Band code:7e14fb/4a cheat description:Slot 3 - Wood Helm code:7e14fb/4b cheat description:Slot 3 - Glass Cap code:7e14fb/4c cheat description:Slot 3 - Brone Helm code:7e14fb/4d cheat description:Slot 3 - Red Beret code:7e14fb/4e cheat description:Slot 3 - Iron Helm code:7e14fb/4f cheat description:Slot 3 - Plate Cap code:7e14fb/50 cheat description:Slot 3 - Plate Helm code:7e14fb/51 cheat description:Slot 3 - Glass Beret code:7e14fb/52 cheat description:Slot 3 - Silver Helm code:7e14fb/53 cheat description:Slot 3 - Sakret code:7e14fb/54 cheat description:Slot 3 - Zircon Beret code:7e14fb/55 cheat description:Slot 3 - Zircon Helm code:7e14fb/56 cheat description:Slot 3 - Sandal code:7e14fb/57 cheat description:Slot 3 - Cloth Shoes code:7e14fb/58 cheat description:Slot 3 - Tan Shoes code:7e14fb/59 cheat description:Slot 3 - Spike Shoes code:7e14fb/5a cheat description:Slot 3 - Heeled Shoes code:7e14fb/5b cheat description:Slot 3 - Wind Shoes code:7e14fb/5c cheat description:Slot 3 - Wind Heels code:7e14fb/5d cheat description:Slot 3 - Knife Shoes code:7e14fb/5e cheat description:Slot 3 - Needle Heels code:7e14fb/5f cheat description:Slot 3 - Sonic Shoes code:7e14fb/60 cheat description:Slot 3 - Sonic Heels code:7e14fb/61 cheat description:Slot 3 - Sword Shoes code:7e14fb/62 cheat description:Slot 3 - Cat Heels code:7e14fb/63 cheat description:Slot 3 - Mach Shoes code:7e14fb/64 cheat description:Slot 3 - Mach Heels code:7e14fb/65 cheat description:Slot 3 - Power Ring code:7e14fb/66 cheat description:Slot 3 - HiPower Ring code:7e14fb/67 cheat description:Slot 3 - Daze Ring code:7e14fb/68 cheat description:Slot 3 - Hi Daze Ring code:7e14fb/69 cheat description:Slot 3 - Mind Ring code:7e14fb/6a cheat description:Slot 3 - Sonic Ring code:7e14fb/6b cheat description:Slot 3 - Mach Ring code:7e14fb/6c cheat description:Slot 3 - Undead Ring code:7e14fb/6d cheat description:Slot 3 - Ghost Ring code:7e14fb/6e cheat description:Slot 3 - Dragon Ring code:7e14fb/6f cheat description:Slot 3 - Sea Ring code:7e14fb/70 cheat description:Slot 3 - Fly Ring code:7e14fb/71 cheat description:Slot 3 - Water Ring code:7e14fb/72 cheat description:Slot 3 - Fire Ring code:7e14fb/73 cheat description:Slot 3 - Ice Ring code:7e14fb/74 cheat description:Slot 3 - Electro Ring code:7e14fb/75 cheat description:Slot 3 - Flash Ring code:7e14fb/76 cheat description:Slot 3 - Flame Ring code:7e14fb/77 cheat description:Slot 3 - Water Ring code:7e14fb/78 cheat description:Slot 3 - Blast Ring code:7e14fb/79 cheat description:Slot 3 - Frost Ring code:7e14fb/7a cheat description:Slot 3 - Might Armor code:7e14fb/7b cheat description:Slot 3 - Might Shield code:7e14fb/7c cheat description:Slot 3 - Might Helmet code:7e14fb/7d cheat description:Slot 3 - Gloom Ring code:7e14fb/7e cheat description:Slot 3 - Gloom Voice code:7e14fb/7f cheat description:Slot 3 - Dummy (?) code:7e14fb/80 cheat description:Slot 3 - Brone Breast code:7e14fb/81 cheat description:Slot 3 - Carbo Sword code:7e14fb/82 cheat description:Slot 3 - Carbo Plate code:7e14fb/83 cheat description:Slot 3 - Carbo Shield code:7e14fb/84 cheat description:Slot 3 - Carbo Helm code:7e14fb/85 cheat description:Slot 3 - Carbo Cap code:7e14fb/86 cheat description:Slot 3 - Gloom Guard code:7e14fb/87 cheat description:Slot 3 - Diamond Ring code:7e14fb/88 cheat description:Slot 3 - Engage Ring code:7e14fb/89 cheat description:Slot 3 - Monster Ring code:7e14fb/8a cheat description:Slot 3 - Blue Ring code:7e14fb/8b cheat description:Slot 3 - Yellow Ring code:7e14fb/8c cheat description:Slot 3 - Red Ring code:7e14fb/8d cheat description:Slot 3 - Purple Ring code:7e14fb/8e cheat description:Slot 3 - Green Ring code:7e14fb/8f cheat description:Slot 3 - White Ring code:7e14fb/90 cheat description:Slot 3 - Black Ring code:7e14fb/91 cheat description:Slot 3 - Heavy Ring code:7e14fb/92 cheat description:Slot 3 - Wave Ring code:7e14fb/93 cheat description:Slot 3 - Potion code:7e14fb/94 cheat description:Slot 3 - Hi Potion code:7e14fb/95 cheat description:Slot 3 - Ex Potion code:7e14fb/96 cheat description:Slot 3 - Hi Magic code:7e14fb/97 cheat description:Slot 3 - Ex Magic code:7e14fb/98 cheat description:Slot 3 - Antidote code:7e14fb/99 cheat description:Slot 3 - Sweet Water code:7e14fb/9a cheat description:Slot 3 - Foul Water code:7e14fb/9b cheat description:Slot 3 - Awaken code:7e14fb/9c cheat description:Slot 3 - Stone Cure code:7e14fb/9d cheat description:Slot 3 - Mystery Pin code:7e14fb/9e cheat description:Slot 3 - Shriek code:7e14fb/9f cheat description:Slot 3 - Swing Wing code:7e14fb/a0 cheat description:Slot 3 - Magic Guard code:7e14fb/a1 cheat description:Slot 3 - Power Gourd code:7e14fb/a2 cheat description:Slot 3 - Mind Gourd code:7e14fb/a3 cheat description:Slot 3 - Power Potion code:7e14fb/a4 cheat description:Slot 3 - Spell Potion code:7e14fb/a5 cheat description:Slot 3 - Speed Potion code:7e14fb/a6 cheat description:Slot 3 - Mind Potion code:7e14fb/a7 cheat description:Slot 3 - Great Potion code:7e14fb/a8 cheat description:Slot 3 - Float code:7e14fb/a9 cheat description:Slot 3 - Smoke Ball code:7e14fb/aa cheat description:Slot 3 - Arrow code:7e14fb/ab cheat description:Slot 3 - Mid Arrow code:7e14fb/ac cheat description:Slot 3 - Big Arrow code:7e14fb/ad cheat description:Slot 3 - Arrows code:7e14fb/ae cheat description:Slot 3 - Hi Arrows code:7e14fb/af cheat description:Slot 3 - Ex Arrows code:7e14fb/b0 cheat description:Slot 3 - Dragon Arrow code:7e14fb/b1 cheat description:Slot 3 - Sleep Arrow code:7e14fb/b2 cheat description:Slot 3 - Puzzle Arrow code:7e14fb/b3 cheat description:Slot 3 - Stun Arrow code:7e14fb/b4 cheat description:Slot 3 - Gloom Arrow code:7e14fb/b5 cheat description:Slot 3 - Bomb code:7e14fb/b6 cheat description:Slot 3 - Hi Bomb code:7e14fb/b7 cheat description:Slot 3 - Ex Bomb code:7e14fb/b8 cheat description:Slot 3 - Miracle code:7e14fb/b9 cheat description:Slot 3 - Revive code:7e14fb/ba cheat description:Slot 3 - Pear Cider code:7e14fb/bb cheat description:Slot 3 - Sour Cider code:7e14fb/bc cheat description:Slot 3 - Lime Cider code:7e14fb/bd cheat description:Slot 3 - Plum Cider code:7e14fb/be cheat description:Slot 3 - Apple Cider code:7e14fb/bf cheat description:Slot 3 - Hair Band code:7e14fb/c0 cheat description:Slot 3 - Brooch code:7e14fb/c1 cheat description:Slot 3 - Earring code:7e14fb/c2 cheat description:Slot 3 - Necklace code:7e14fb/c3 cheat description:Slot 3 - Stuffed Bear code:7e14fb/c4 cheat description:Slot 3 - Stuffed Dog code:7e14fb/c5 cheat description:Slot 3 - Stuffed Pig code:7e14fb/c6 cheat description:Slot 3 - Emerald code:7e14fb/c7 cheat description:Slot 3 - Opal code:7e14fb/c8 cheat description:Slot 3 - Goblet code:7e14fb/c9 cheat description:Slot 3 - Ear Tip code:7e14fb/ca cheat description:Slot 3 - Empty Bottle code:7e14fb/cb cheat description:Slot 3 - Gown code:7e14fb/cc cheat description:Slot 3 - Ribbon code:7e14fb/cd cheat description:Slot 3 - Fry Pan code:7e14fb/ce cheat description:Slot 3 - Small Knife code:7e14fb/cf cheat description:Slot 3 - Pot code:7e14fb/d0 cheat description:Slot 3 - Chop Block code:7e14fb/d1 cheat description:Slot 3 - Apron code:7e14fb/d2 cheat description:Slot 3 - Dragon Egg code:7e14fb/d3 cheat description:Slot 3 - Crown code:7e14fb/d4 cheat description:Slot 3 - Secret Map code:7e14fb/d5 cheat description:Slot 3 - Miracle Gem code:7e14fb/d6 cheat description:Slot 3 - Silver Wick code:7e14fb/d7 cheat description:Slot 3 - Royal Statue code:7e14fb/d8 cheat description:Slot 3 - Silver Tarot code:7e14fb/d9 cheat description:Slot 3 - Golden Pawn code:7e14fb/da cheat description:Slot 3 - Crown Jewels code:7e14fb/db cheat description:Slot 3 - Wind Flute code:7e14fb/dc cheat description:Slot 3 - Escape code:7e14fb/dd cheat description:Slot 3 - Magic Jar code:7e14fb/de cheat description:Slot 3 - Dragon Tooth code:7e14fb/df cheat description:Slot 3 - Grilled Newt code:7e14fb/e0 cheat description:Slot 3 - Poison Pin code:7e14fb/e1 cheat description:Slot 3 - Might Sword code:7e14fb/e2 cheat description:Slot 3 - Straw Doll code:7e14fb/e3 cheat description:Slot 3 - Long Nail code:7e14fb/e4 cheat description:Slot 3 - Bomb code:7e14fb/e5 cheat description:Slot 3 - Alumina code:7e14fb/e6 cheat description:Slot 3 - Power Oil code:7e14fb/e7 cheat description:Slot 3 - Elven Bow code:7e14fb/e8 cheat description:Slot 3 - Artea's Bow code:7e14fb/e9 cheat description:Slot 3 - Might Bow code:7e14fb/ea cheat description:Slot 3 - Dummy (?) code:7e14fb/eb cheat description:Slot 3 - Dummy (?) code:7e14fb/ec cheat description:Slot 3 - Dummy (?) code:7e14fb/ed cheat description:Slot 3 - Dummy (?) code:7e14fb/ee cheat description:Slot 3 - Free Door code:7e14fb/ef cheat description:Slot 3 - Sheran Key code:7e14fb/f0 cheat description:Slot 3 - Letter code:7e14fb/f1 cheat description:Slot 3 - Dais Key code:7e14fb/f2 cheat description:Slot 3 - Shrine Key code:7e14fb/f3 cheat description:Slot 3 - Pirate Key code:7e14fb/f4 cheat description:Slot 3 - Light Key code:7e14fb/f5 cheat description:Slot 3 - Oil Key code:7e14fb/f6 cheat description:Slot 3 - Green Jade code:7e14fb/fb cheat description:Slot 3 - Red Sapphire code:7e14fb/f8 cheat description:Slot 3 - Blue Jade code:7e14fb/f9 cheat description:Slot 3 - Purple Newt code:7e14fb/fa cheat description:Slot 3 - Glasdar Key code:7e14fb/fb cheat description:Slot 3 - Magic Flavor code:7e14fb/fc cheat description:Slot 3 - Fairy Kiss code:7e14fb/fd cartridge sha256:7c34ecb16c10f551120ed7b86cfbc947042f479b52ee74bb3c40e92fdd192b3a name:Lufia II - Rise of the Sinistrals (USA) cheat description:Infinite 999 MP in and out of battle code:81f4f8/ff cheat description:Level 99 after one battle code:81f99f/8f cheat description:Level 83 after one battle code:81f99f/ff cheat description:Gain 35,000 gold after a battle code:81fc05/ff cheat description:Enemies always miss code:81fc74/ff cheat description:One hit kills code:81fc38/ff cheat description:No random battles on world map code:7e11e3/00 cheat description:9999999 GP code:7e0a8a/7f+7e0a8b/96+7e0a8c/98 cheat description:9999999 Coins code:7e0b55/7f+7e0b56/96+7e0b57/98 cheat description:All warps code:7e0986/ff+7e0988/ff+7e0989/ff+7e0991/ff+7e098a/ff+7e0992/ff+7e098b/ff+7e0996/ff+7e098c/ff+7e098d/ff+7e098e/ff+7e098f/ff+7e0990/ff+7e097b/ff+7e097c/ff+7e097d/ff+7e097e/ff+7e097f/ff+7e0980/ff+7e0981/ff+7e0982/ff+7e0983/ff cheat description:P1 - 999 HP code:7e0bbe/e7+7e0bbf/03 cheat description:P1 - 999 MP code:7e0bc0/e7+7e0bc1/03 cheat description:P1 - 999 MAX MP code:7e0bd4/e7+7e0bd5/03 cheat description:P1 - 999 STP code:7e0bfe/e7+7e0bff/03 cheat description:P1 - 999 DFP code:7e0c00/e7+7e0c01/03 cheat description:P1 - 999 STR code:7e0c02/e7+7e0c03/03 cheat description:P1 - 999 AGL code:7e0c04/e7+7e0c05/03 cheat description:P1 - 999 INT code:7e0c06/e7+7e0c07/03 cheat description:P1 - 999 GUT code:7e0c08/e7+7e0c09/03 cheat description:P1 - 999 MGR code:7e0c0a/e7+7e0c0b/03 cheat description:P1 - Max IP code:7e0c69/ff cheat description:P2 - 999 HP code:7e0c7c/e7+7e0c7d/03 cheat description:P2 - 999 MP code:7e0c7e/e7+7e0c7f/03 cheat description:P2 - 999 MAX MP code:7e0c92/e7+7e0c93/03 cheat description:P2 - 999 STP code:7e0cbc/e7+7e0cbd/03 cheat description:P2 - 999 DFP code:7e0cbe/e7+7e0cbf/03 cheat description:P2 - 999 STR code:7e0cc0/e7+7e0cc1/03 cheat description:P2 - 999 AGL code:7e0cc2/e7+7e0cc3/03 cheat description:P2 - 999 INT code:7e0cc4/e7+7e0cc5/03 cheat description:P2 - 999 GUT code:7e0cc6/e7+7e0cc7/03 cheat description:P2 - 999 MGR code:7e0cc8/e7+7e0cc9/03 cheat description:P2 - Max IP code:7e0d27/ff cheat description:P3 - 999 HP code:7e0d3a/e7+7e0d3b/03 cheat description:P3 - 999 MP code:7e0d3c/e7+7e0d3d/03 cheat description:P3 - 999 MAX MP code:7e0d50/e7+7e0d51/03 cheat description:P3 - 999 STP code:7e0d7a/e7+7e0d7b/03 cheat description:P3 - 999 DFP code:7e0d7c/e7+7e0d7d/03 cheat description:P3 - 999 STR code:7e0d7e/e7+7e0d7f/03 cheat description:P3 - 999 AGL code:7e0d80/e7+7e0d81/03 cheat description:P3 - 999 INT code:7e0d82/e7+7e0d83/03 cheat description:P3 - 999 GUT code:7e0d84/e7+7e0d85/03 cheat description:P3 - 999 MGR code:7e0d86/e7+7e0d87/03 cheat description:P3 - Max IP code:7e0de5/ff cheat description:P4 - 999 HP code:7e0df8/e7+7e0df9/03 cheat description:P4 - 999 MP code:7e0dfa/e7+7e0dfb/03 cheat description:P4 - 999 MAX MP code:7e0e0e/e7+7e0e0f/03 cheat description:P4 - 999 STP code:7e0e38/e7+7e0e39/03 cheat description:P4 - 999 DFP code:7e0e3a/e7+7e0e3b/03 cheat description:P4 - 999 STR code:7e0e3c/e7+7e0e3d/03 cheat description:P4 - 999 AGL code:7e0e3e/e7+7e0e3f/03 cheat description:P4 - 999 INT code:7e0e40/e7+7e0e41/03 cheat description:P4 - 999 GUT code:7e0e42/e7+7e0e43/03 cheat description:P4 - 999 MGR code:7e0e44/e7+7e0e45/03 cheat description:P4 - Max IP code:7e0ea3/ff cheat description:P5 - 999 HP code:7e0eb6/e7+7e0eb7/03 cheat description:P5 - 999 MP code:7e0eb8/e7+7e0eb9/03 cheat description:P5 - 999 MAX MP code:7e0ecc/e7+7e0ecc/03 cheat description:P5 - 999 STP code:7e0ef6/e7+7e0ef7/03 cheat description:P5 - 999 DFP code:7e0ef8/e7+7e0ef9/03 cheat description:P5 - 999 STR code:7e0efa/e7+7e0efb/03 cheat description:P5 - 999 AGL code:7e0efc/e7+7e0efd/03 cheat description:P5 - 999 INT code:7e0efe/e7+7e0eff/03 cheat description:P5 - 999 GUT code:7e0f00/e7+7e0f01/03 cheat description:P5 - 999 MGR code:7e0f02/e7+7e0f03/03 cheat description:P5 - Max IP code:7e0f61/ff cheat description:P6 - 999 HP code:7e0f74/e7+7e0f75/03 cheat description:P6 - 999 MP code:7e0f76/e7+7e0f77/03 cheat description:P6 - 999 MAX MP code:7e0f8a/e7+7e0f8b/03 cheat description:P6 - 999 STP code:7e0fb4/e7+7e0fb5/03 cheat description:P6 - 999 DFP code:7e0fb6/e7+7e0fb7/03 cheat description:P6 - 999 STR code:7e0fb8/e7+7e0fb9/03 cheat description:P6 - 999 AGL code:7e0fba/e7+7e0fbb/03 cheat description:P6 - 999 INT code:7e0fbc/e7+7e0fbd/03 cheat description:P6 - 999 GUT code:7e0fbe/e7+7e0fbf/03 cheat description:P6 - 999 MGR code:7e0fc0/e7+7e0fc1/03 cheat description:P6 - Max IP code:7e101f/ff cheat description:P7 - 999 HP code:7e1032/e7+7e1033/03 cheat description:P7 - 999 MP code:7e1034/e7+7e1035/03 cheat description:P7 - 999 MAX MP code:7e1048/e7+7e1049/03 cheat description:P7 - 999 STP code:7e1072/e7+7e1073/03 cheat description:P7 - 999 DFP code:7e1074/e7+7e1075/03 cheat description:P7 - 999 STR code:7e1076/e7+7e1077/03 cheat description:P7 - 999 AGL code:7e1078/e7+7e1079/03 cheat description:P7 - 999 INT code:7e107a/e7+7e107b/03 cheat description:P7 - 999 GUT code:7e107c/e7+7e107d/03 cheat description:P7 - 999 MGR code:7e107e/e7+7e107f/03 cheat description:P7 - Max IP code:7e10dd/ff cartridge sha256:7e77e196db47e87a5b297e60f0dfa7ce41df8d2d1fdd9152e06628d0b0e586af name:Madden NFL '94 (USA) cheat description:Always 1st down code:c0c1a0/ea cheat description:1 play to get a 1st down code:c0c1bb/02 cheat description:2 plays to get a 1st down code:c0c1bb/03 cheat description:3 plays to get a 1st down code:c0c1bb/04 cheat description:5 plays to get a 1st down code:c0c1bb/06 cheat description:7 plays to get a 1st down code:c0c1bb/08 cheat description:Extra points worth 0 points code:c0c7f1/00 cheat description:Extra points worth 3 points code:c0c7f1/03 cheat description:Extra points worth 5 points code:c0c7f1/05 cheat description:Extra points worth 7 points code:c0c7f1/07 cheat description:Field goals worth 0 points code:c0c7fe/00 cheat description:Field goals worth 2 points code:c0c7fe/02 cheat description:Field goals worth 5 points code:c0c7fe/05 cheat description:Field goals worth 7 points code:c0c7fe/07 cheat description:Field goals worth 9 points code:c0c7fe/09 cheat description:Safeties worth 0 points code:c0c293/00 cheat description:Safeties worth 3 points code:c0c293/03 cheat description:Safeties worth 5 points code:c0c293/05 cheat description:Safeties worth 7 points code:c0c293/07 cheat description:Touchdowns worth 0 points code:c0c5c1/00 cheat description:Touchdowns worth 3 points code:c0c5c1/03 cheat description:Touchdowns worth 5 points code:c0c5c1/05 cheat description:Touchdowns worth 9 points code:c0c5c1/09 cheat description:TD, FG, PAT, S worth 1 point - home team code:c0c2d6/a9+c0c2d7/01 cheat description:TD, FG, PAT, S worth 3 points - home team code:c0c2d6/a9+c0c2d7/03 cheat description:TD, FG, PAT, S worth 5 points - home team code:c0c2d6/a9+c0c2d7/05 cheat description:TD, FG, PAT, S worth 7 points - home team code:c0c2d6/a9+c0c2d7/07 cheat description:TD, FG, PAT, S worth 14 points - home team code:c0c2d6/a9+c0c2d7/0e cheat description:TD, FG, PAT, S worth 21 points - home team code:c0c2d6/a9+c0c2d7/15 cheat description:TD, FG, PAT, S worth 35 points - home team code:c0c2d6/a9+c0c2d7/23 cheat description:TD, FG, PAT, S worth 3 points - visitor code:c0c301/a9+c0c302/01 cheat description:TD, FG, PAT, S worth 5 points - visitor code:c0c301/a9+c0c302/05 cheat description:TD, FG, PAT, S worth 7 points - visitor code:c0c301/a9+c0c302/07 cheat description:TD, FG, PAT, S worth 14 points - visitor code:c0c301/a9+c0c302/0e cheat description:TD, FG, PAT, S worth 21 points - visitor code:c0c301/a9+c0c302/15 cheat description:TD, FG, PAT, S worth 35 points - visitor code:c0c301/a9+c0c302/23 cheat description:Home team starts with a 3-point lead code:c0e411/03+c0e416/0f cheat description:Home team starts with a 7-point lead code:c0e411/07+c0e416/0f cheat description:Home team starts with a 10-point lead code:c0e411/0a+c0e416/0f cheat description:Home team starts with a 14-point lead code:c0e411/0e+c0e416/0f cheat description:Home team starts with a 35-point lead code:c0e411/23+c0e416/0f cheat description:Visitors start with a 5-point lead code:c0e411/05+c0e412/0f cheat description:Visitors start with a 7-point lead code:c0e411/07+c0e412/0f cheat description:Visitors start with a 10-point lead code:c0e411/0a+c0e412/0f cheat description:Visitors start with a 14-point lead code:c0e411/0e+c0e412/0f cheat description:Visitors start with a 35-point lead code:c0e411/23+c0e412/0f cartridge sha256:0ad77ae7af231313e1369a52d1622b88e3751aa5ec774628df7071f9e4244abc name:Madden NFL 95 (USA) cheat description:Always 1st down code:c0833a/ad cheat description:Infinite timeouts - both players (slightly glitchy) code:c1714d/bd cheat description:Cannot be tackled (hold X) code:c07c54/80+c07c56/30+c07c53/a5+c07c55/0a+c07c57/f5 cheat description:Field goals worth 0 points code:c08a19/00 cheat description:Field goals worth 1 points code:c08a19/01 cheat description:Field goals worth 5 points code:c08a19/04 cheat description:Field goals worth 9 points code:c08a19/09 cheat description:Safetys worth 0 points code:c0841f/00 cheat description:Safetys worth 1 points code:c0841f/01 cheat description:Safetys worth 5 points code:c0841f/04 cheat description:Safetys worth 7 points code:c0841f/07 cheat description:Touchdowns worth 0 points code:c087d8/00 cheat description:Touchdowns worth 1 points code:c087d8/01 cheat description:Touchdowns worth 5 points code:c087d8/04 cheat description:Touchdowns worth 9 points code:c087d8/09 cheat description:Start with 15 seconds on the play clock code:c07678/0f cheat description:Start with 1 timeout - P1 code:c00043/01 cheat description:Start with 1 timeout - P2 code:c00044/01 cartridge sha256:3059d86cdc383985c564a7a891fe18e08f5222ead7ede9fa309159d60cde13a1 name:Madden NFL 96 (USA) cheat description:Infinite time (2P mode only) code:c002d5/ad cheat description:Infinite downs code:c08ece/ad cheat description:Infinite timeouts code:c15435/bd cheat description:Cannot be tackled (hold X) code:c087a4/80+c087a6/30+c087a3/a5+c087a5/0a+c087a7/f5 cheat description:Safeties are worth 0 points code:c08fd7/00 cheat description:Safeties are worth 1 point code:c08fd7/01 cheat description:Safeties are worth 3 points code:c08fd7/02 cheat description:Safeties are worth 5 points code:c08fd7/05 cheat description:Safeties are worth 7 points code:c08fd7/07 cheat description:Safeties are worth 9 points code:c08fd7/09 cheat description:Field Goals are worth 0 points code:c09693/00 cheat description:Field Goals are worth 1 point code:c09693/01 cheat description:Field Goals are worth 2 points code:c09693/02 cheat description:Field Goals are worth 5 points code:c09693/05 cheat description:Field Goals are worth 7 points code:c09693/07 cheat description:Field Goals are worth 9 points code:c09693/09 cheat description:Start with 5 downs each possession code:c08f7f/00 cheat description:Start with 3 downs each possession code:c08f7f/03 cheat description:Start with 2 downs each possession code:c08f7f/02 cheat description:Start with 1 down each possession code:c08f7f/01 cartridge sha256:6874568d985f65dd817d4b03998e71c8cbacc8d8707411fde7bffee350605a88 name:Madden NFL 97 (USA) cheat description:Cannot be tackled (hold X) code:c08c8e/80+c08c90/30+c08c8d/a5+c08c8f/0a+c08c91/f5 cartridge sha256:e3c62c9fe55d2311aa6a264f41b45d6cbc7b1b069ed3aa82ee57d381c062547d name:Madden NFL 98 (USA) cheat description:Cannot be tackled (hold X) code:c08d19/80+c08d1b/30+c08d18/a5+c08d1a/0a+c08d1c/f5 cartridge sha256:c01fb8989d391d3e343003934937f02bd8ef9aacdad68c32c3d3f56feb72f5b0 name:Magic Boy (USA) cheat description:Invincibility code:809483/80 cheat description:Infinite lives code:7e9bb6/03 cartridge sha256:9b6b0099f2b97ec3a18fef7a4935bfad235fdb83669dd99c3731a69506322cbe name:Magic Knight Rayearth (Japan) cheat description:Infinite Gold code:7E0D8A3F+7E0D8B42+7E0D8C0F cheat description:No random battles code:c02a90/80 cheat description:Walk through walls code:c02943/ad cheat description:Infinite items - slot 01 code:7e0d8f/63 cheat description:Infinite items - slot 02 code:7e0d91/63 cheat description:Infinite items - slot 03 code:7e0d93/63 cheat description:Infinite items - slot 04 code:7e0d95/63 cheat description:Infinite items - slot 05 code:7e0d97/63 cheat description:Infinite items - slot 06 code:7e0d99/63 cheat description:Infinite items - slot 07 code:7e0d9b/63 cheat description:Infinite items - slot 08 code:7e0d9d/63 cheat description:Infinite items - slot 09 code:7e0d9f/63 cheat description:Infinite items - slot 10 code:7e0da1/63 cheat description:Infinite items - slot 11 code:7e0da3/63 cheat description:Infinite items - slot 12 code:7e0da5/63 cheat description:Infinite items - slot 13 code:7e0da7/63 cheat description:Infinite items - slot 14 code:7e0da9/63 cheat description:Infinite items - slot 15 code:7e0dab/63 cheat description:Infinite items - slot 16 code:7e0dad/63 cheat description:Infinite items - slot 17 code:7e0daf/63 cheat description:Infinite items - slot 18 code:7e0db1/63 cheat description:Infinite items - slot 19 code:7e0db3/63 cheat description:Infinite items - slot 20 code:7e0db5/63 cartridge sha256:1d3cceaa05e054b002caeb09fd5fb9e718ec446764f4169d97bc185da76fdf4d name:Magic Sword (USA) cheat description:No health loss on collision with enemies code:019caf/ad+00b04c/ad cheat description:No health loss when magic is used code:019624/ad cheat description:No magic counter countdown code:00ada6/ad cheat description:Hit anywhere code:03813a/ea+038137/ad+038138/08+03813b/f0+038139/16 cheat description:One hit kills code:0380e9/80 cheat description:Slower magic counter countdown code:00ada2/7f cheat description:Faster magic counter countdown code:00ada2/ff cheat description:Invincibility code:7e831c/09 cheat description:Infinite continues code:7e042d/09 cheat description:Infinite health code:7e0432/09 cheat description:Infinite support health code:7e0423/04 cheat description:Infinite magic code:7e040c/09+7e040d/09 cheat description:Have powered-up attack code:7e068a/06 cheat description:Infinite Silver Keys code:7e040f/09 cheat description:Infinite Gold Keys code:7e0410/09 cheat description:Infinite Platinum Keys code:7e0411/09 cheat description:Have optimum sword code:7e040a/06 cheat description:Have optimum shield code:7e040b/04 cheat description:Never lose shield code:7e0435/02 cheat description:Barrier Invincibility code:7e06d6/ff cheat description:Set score to 90,000,000 code:7e0448/09 cheat description:Support modifier - Amazon code:7e0424/03 cheat description:Support modifier - Big Man code:7e0424/07 cheat description:Support modifier - Wizard code:7e0424/09 cheat description:Support modifier - Knight code:7e0424/0c cheat description:Support modifier - Lizardman code:7e0424/0f cheat description:Support modifier - Ninja code:7e0424/12 cheat description:Support modifier - Thief code:7e0424/15 cheat description:Support modifier - Cleric code:7e0424/18 cheat description:Max power for Amazon's Crossbow code:7e0413/07 cheat description:Max power for Big Man's Axe code:7e0414/07 cheat description:Max power for Wizard's Magic Missile code:7e0415/07 cheat description:Max power for Knight's Spear code:7e0416/07 cheat description:Max power for Lizardman's Sword code:7e0417/07 cheat description:Max power for Ninja's Throwing Star code:7e0418/07 cheat description:Max power for Thief's Bomb code:7e0419/07 cheat description:Max power for Cleric's Magic Bullet code:7e041a/07 cartridge sha256:ed617ad12c865fc9c9c5c75de840d3afeded57d13ca3a3062bf8e30095629414 name:Magical Pop'n (Japan) cheat description:Infinite health code:7e051a/06 cheat description:Infinite lives code:7e0516/02 cheat description:Infinite stars code:7e0508/09 cartridge sha256:f301bb8ea867e530ecb64e8eff504ed5b9697cf076c70e2036ecf2ffbe6c487a name:Magical Quest Starring Mickey Mouse, The (USA) cheat description:Protection from most hits (lose no hearts) (disable if you get stuck) code:03f43a/ad cheat description:Infinite magic - wizard's costume only code:01eef9/ad cheat description:Infinite lives code:01df93/ad cheat description:Small heart fill health completely code:02d010/8d+02d015/ad cheat description:Each gold coin worth 10 (if too many are collected you may go back to 0) code:02fd3d/01 cheat description:Longer invincibility after getting hit code:01e207/ad cheat description:No invincibility after getting hit code:01e202/a9 cheat description:Super-jump code:01de0e/69+01de0f/2c cheat description:Mega-jump code:01de0e/69+01de0f/20 cheat description:Ultra-jump code:01de0e/69+01de0f/14 cheat description:Items in general store are free if you can afford them code:02fd8b/80+02fd8c/2b cheat description:Start with 1 heart instead of 3 code:00ccf8/01 cheat description:Start with 5 hearts code:00ccf8/05 cheat description:Start with 7 hearts code:00ccf8/07 cheat description:Start with 10 hearts code:00ccf8/0a cheat description:Start with 1 life instead of 3 code:01815f/00 cheat description:Start with 7 lives code:01815f/06 cheat description:Start with 10 lives code:01815f/09 cheat description:Invincibility after first hit code:7e033f/03 cheat description:Infinite health code:7e02b1/0a cheat description:Infinite magic code:7e02b7/20 cheat description:Infinite water for Fireman costume code:7e02b9/17 cheat description:Infinite lives (alt) code:01df93/ad cheat description:Have all costumes code:7e02c1/01+7e02c2/01+7e02c3/01 cheat description:Mega-jump code:7e04b0/1a cheat description:Ultra-jump code:7e04b0/06 cartridge sha256:78d0f6dd9ce0813e0532c7b25c7fa0b6b945d12a4ace21aa940e98babf4dacb1 name:Majuu Ou (Japan) cheat description:Infinite health code:7e009f/50 cheat description:Infinite lives code:7e00a3/01 cartridge sha256:8267e2f092c86d5a29c9a826db82c7473638e28e2507cdaf5c86981f07cd0bef name:Mario Is Missing! (USA) cheat description:Talk to someone once to learn all they know (all four checks appear on computer for that person) code:80b50c/a9+80b50d/ff+80b50e/ea cheat description:Use computer to access any facts except pamphlets (no checks appear on computer) code:80b60b/80+80b64d/00+80b678/00 cheat description:Use computer to view pamphlets on any artifact (no checks appear on computer) code:80b5df/80 cheat description:Always get Yoshi after using Globulator code:80f801/01 cheat description:Pick up one artifact and get all three code:80b4ff/a9+80b500/ff+80b501/ea cheat description:Have all three arifacts code:7e050a/07 cheat description:Always have Yoshi (Globulator doesn't automatically pick your location) code:7e06db/01 cheat description:No waiting on wrong answer code:7e0565/00 cartridge sha256:e842cac1a4301be196f1e137fbd1a16866d5c913f24dbca313f4dd8bd7472f45 name:Mario Paint (Japan, USA) cheat description:Invincibility in bug swatting game code:01a51e/a9+01a523/8d+01a51f/ff cheat description:Infinite lives in bug swatting game code:01a6e9/cd cheat description:Have all icons in bug swatting game code:01a329/a9 cheat description:Star easier to get under "P" on title screen code:8f8555/00+8f8559/00+8f855a/01 cheat description:Invincibility in bug swatting game (alt) code:7f0040/ff cheat description:Infinite lives in bug swatting game (alt) code:7f0018/63 cheat description:Have all icons in bug swatting game (alt) code:7f0012/0f cheat description:Only need to swat once to move around and kill flies code:7f001e/02 cheat description:Enable all rotate/flip options code:7e099f/01 cheat description:One hit to kill boss code:7f00c9/14 cheat description:Start on level 2 code:7f0014/01 cheat description:Start on level 3 code:7f0014/02 cartridge sha256:4b69d4958e099c3b3f6ae45e153ced9b24755d8c161dfee06c9f67886a7c0f09 name:Mario's Time Machine (USA) cheat description:Bonus timer doesn't count down in the whole game code:818dc9/00 cheat description:Don't lose mushrooms in collisions code:818727/a9+808f28/00+818729/00 cheat description:1 wrong answer to questions allowed code:80d92d/01 cheat description:255 wrong answers allowed (ignore sad face icon) code:80d92d/ff cartridge sha256:49dd77b310b476c875633335243553be59ecfb0bffae62e46f2e53ff05c20fcd name:Marvel Super Heroes in War of the Gems (USA) cheat description:Infinite health code:c00858/95 cheat description:Infinite Air code:c00858/95 cheat description:Infinite Air (alt) code:c271c6/f6 cheat description:Infinite equipment, all Gems selectable on pick-up code:c0b87a/1c+c0b87d/80+c0b87e/1f cheat description:One hit kills code:c06315/a9 cheat description:Always have a Gem code:c27f28/9e cheat description:Always have 9 Gem power items code:c06089/f5 cheat description:Always have 9 Revive items code:c271c6/f6 cheat description:Invincibility - Boston Aquarium code:7e042d/03+7e042f/00 cheat description:Invincibility - Alaska code:7e02cd/03+7e02cf/00 cheat description:Invincibility - Dr. Doom's Castle code:7e02bd/03+7e02bf/00 cheat description:Invincibility - Amazon code:7e02fd/03+7e02ff/00 cheat description:Invincibility - Magus' Spaceship and Asteroid Belt code:7e026d/03+7e026f/00 cheat description:Invincibility - Egypt code:7e02dd/03+7e02df/00 cheat description:Invincibility - Arizona Mining Facility code:7e031d/03+7e031f/00 cheat description:Invincibility - Mt. Vezuvius code:7e039d/03+7e039f/00 cheat description:Invincibility - Nebula's Level code:7e033d/03+7e033f/00 cheat description:Invincibility - Thanos' Level code:7e034d/03+7e034f/00 cheat description:Infinite health - Dr. Doom's Castle code:7e026b/64 cheat description:Infinite health - Alaska code:7e027b/64 cheat description:Infinite health - Mt. Vesuvius code:7e034b/64 cheat description:Infinite health - Egypt code:7e028b/64 cheat description:Infinite health - Arizona Mining Facility code:7e02cb/64 cheat description:Always have 9 Big energy Tanks code:7fff1a/09 cheat description:Always have 9 Small energy Tanks code:7fff1b/09 cartridge sha256:2731f0bd1c87e75121f41d1ed5cc9fbf177f414b8bf831c76fd9c4b58c86ed08 name:Mary Shelley's Frankenstein (USA) cheat description:Infinite health code:809953/ad+80e3e5/b7 cheat description:Energy balls don't deplete health code:85f376/00+85f377/00 cheat description:Cool effects code:7e0000/00 cheat description:Invincibility (blinking) code:7e200d/09 cheat description:Infinite health (alt) code:7e2043/1d cartridge sha256:44cc113ce1e7616cc737adea9e8f140436c9f1c3fba57e8e9db48025d4ace632 name:Mask, The (USA) cheat description:Invincibility code:80a44c/24+80a456/24 cheat description:Invincibility after one hit code:80a44e/bd cheat description:Infinite mask power code:80b1d5/ad cheat description:Infinite lives code:80856a/a5 cheat description:Hit anywhere + collect items from anywhere) code:80ad7b/24+80ad8b/24+80ad8f/24+80ad5a/24+80ad5e/24 cheat description:Mallet doesn't use any power code:809b10/bf cheat description:Walk through walls code:80b433/ad cheat description:Green hearts worth 10 code:80af8d/10 cheat description:Green hearts worth 30 code:80af8d/30 cheat description:Green hearts worth 100 code:80af8d/a0 cheat description:Green hearts worth 0 code:80afa5/ad cheat description:Flash longer code:80b1b9/ff cheat description:Don't flash at all code:80b1b9/00 cheat description:M's worth 0 code:80af2a/a5 cheat description:M's worth 10 code:80af1f/10 cheat description:M's worth 30 code:80af1f/30 cheat description:M's worth 100 code:80af1f/a0 cheat description:Start with 100 mask energy code:8080fb/01 cheat description:Start with 300 mask energy code:8080fb/03 cheat description:Start with 900 mask energy code:8080fb/09 cheat description:Start with 1 life code:8080ea/a9+8080eb/00+8080ec/00 cheat description:Start with 5 lives code:8080ea/a9+8080eb/05+8080ec/00 cheat description:Start with 9 lives code:8080ea/a9+8080eb/09+8080ec/00 cheat description:Infinite life code:7e18af/20+7e18b0/03 cheat description:Infinite mask power (alt) code:7e008f/84+7e0090/03 cheat description:Cheat menu enabled (in options menu) code:7e0104/01 cartridge sha256:2a08704748f5ef6488348c4099729feca600412d331bda3756e51efd8b94e113 name:MechWarrior (USA) cheat description:Protection from most hazards code:85b0a7/8d cheat description:Infinite short-range missiles code:80da1f/ff cheat description:Infinite short-range homing missiles code:80da21/ff cheat description:Infinite medium-range missiles code:80da23/ff cheat description:Infinite medium-range homing missiles code:80da25/ff cheat description:Infinite long-range missiles code:80da27/ff cheat description:Infinite long-range homing missiles code:80da29/ff cheat description:Infinite machine gun ammo code:80da2b/ff cheat description:Never run out of any ammo code:80a809/ea cheat description:Getting any money sets money to 32 million C-bills code:80e1ba/00 cheat description:100 ammo for short-range missiles code:80da1f/64 cheat description:100 ammo for short-range homing missiles code:80da21/64 cheat description:80 ammo for medium-range missiles code:80da23/50 cheat description:80 ammo for medium-range homing missiles code:80da25/50 cheat description:40 ammo for long-range missiles code:80da27/28 cheat description:40 ammo for long-range homing missiles code:80da29/28 cheat description:200 short-range missiles code:80da1f/c8 cheat description:200 short-range homing missiles code:80da21/c8 cheat description:100 medium-range missiles code:80da23/64 cheat description:100 medium-range homing missiles code:80da25/64 cheat description:100 long-range missiles code:80da27/64 cheat description:100 long-range homing missiles code:80da29/64 cheat description:Mech isn't slowed down as much by most obstacles code:84ff08/a9+84ff0a/ea cheat description:Start with 100,000 C-bills code:80e2fb/64 cheat description:Start with 250,000 C-bills code:80e2fb/fa cheat description:Start with 562,000 C-bills code:80e2fc/02 cheat description:Start with 1,074,000 C-bills code:80e2fc/04 cheat description:Start with 5,170,000 C-bills code:80e2fc/14 cheat description:Start with 10,290,000 C-bills code:80e2fc/28 cartridge sha256:7bffa1dc31604fa3d61e06ce2c59168098cc8dd7e59998e1d5f30c49bdf8d617 name:MechWarrior 3050 (USA) cheat description:Almost infinite ammo code:c05177/ad cheat description:Almost invincible (disable to kill some enemies) code:c053f2/60 cheat description:Coolant does nothing code:c0899a/a9+c0899d/a9 cheat description:Guass Rifle starts at 10 code:d64c55/0a cheat description:Guass Rifle starts at 50 code:d64c55/32 cheat description:Guass Rifle starts at 100 code:d64c55/64 cheat description:Arrow VI Missiles start at 20 code:d64c53/14 cheat description:Arrow VI Missiles start at 50 code:d64c53/32 cheat description:Arrow VI Missiles start at 100 code:d64c53/64 cheat description:Particle Projection Cannon start at 10 code:d64c4f/0a cheat description:Particle Projection Cannon start at 50 code:d64c4f/32 cheat description:Particle Projection Cannon start at 100 code:d64c4f/64 cheat description:Machine Gun starts at 100 code:d64c46/00+d64c45/64 cheat description:Machine Gun starts at 1,000 code:d64c46/03+d64c45/e8 cheat description:Machine Gun starts at 10,000 code:d64c46/26+d64c45/10 cheat description:Auto Cannon starts at 50 code:d64c47/32 cheat description:Auto Cannon starts at 100 code:d64c47/64 cheat description:Auto Cannon starts at 250 code:d64c47/fa cheat description:Large Laser starts at 50 code:d64c4b/32+d64c4c/00 cheat description:Large Laser starts at 1,000 code:d64c4b/e8+d64c4c/03 cheat description:Large Laser starts at 10,000 code:d64c4b/10+d64c4c/26 cheat description:"Inferno" Short-Range Missiles start at 10 code:d64c49/0a cheat description:"Inferno" Short-Range Missiles start at 50 code:d64c49/32 cheat description:"Inferno" Short-Range Missiles start at 250 code:d64c49/fa cheat description:"Maelstrom" Long-Range Missiles start at 20 code:d64c51/14 cheat description:"Maelstrom" Long-Range Missiles start at 100 code:d64c51/64 cheat description:"Maelstrom" Long-Range Missiles start at 250 code:d64c51/fa cheat description:"Thunder" Time-Delay Mines start at 10 code:d64c4d/0a cheat description:"Thunder" Time-Delay Mines start at 100 code:d64c4d/64 cheat description:"Thunder" Time-Delay Mines start at 250 code:d64c4d/fa cartridge sha256:ee1a030f30f3ab06361921447b3fcf84c987dd13d76e62964e44720e0ec82c56 name:Mega lo Mania (Europe) (En,Fr,De) cheat description:Infinite number of people to use code:7ee8d9/64 cartridge sha256:a255fec32453739903a1954149f19bc9658f4a415600b44badf1d4e5e13a16f9 name:Mega Man 7 (USA) cheat description:Invincibility after first hit (blinking) code:c1325b/80 cheat description:Infinite health code:c30596/ad cheat description:Infinite health (alt) code:c30593/05 cheat description:Infinite E-Tanks code:c04853/ad cheat description:Infinite W-Tanks code:c04890/ad cheat description:Infinite S-Tanks code:c048f1/ad cheat description:Infinite Beat Whistles code:c13235/ad cheat description:Infinite weapon energy code:c12fd9/1f cheat description:One hit kills code:c304f4/24 cheat description:Hit anywhere code:c304b0/80 cheat description:Multi-jump code:c17f67/32+c17f68/20+c17f69/9a+c17f6a/11+c17f6b/60+c113a9/60+c113aa/7f+c17f60/a5+c17f61/45+c17f62/0a+c17f63/90+c17f64/03+c17f65/20+c17f66/b7 cheat description:Always Shoot Shots code:c12f49/11 cheat description:Always shoot Freeze Cracker code:c12f49/24 cheat description:Always shoot Scorch Wheel code:c12f49/26 cheat description:Always shoot Danger Wrap Bombs code:c12f49/2e cheat description:Always shoot Noise Crush code:c12f49/66 cheat description:Always shoot Fully Charged Mega Buster Blasts code:c12f49/7d cheat description:Always shoot Slash Claw code:c12f49/9c cheat description:Always shoot Thunder Bolt code:c12f49/b5 cheat description:Always shoot Wild Coil code:c12f49/f3 cheat description:Always shoot Charged Wild Coils code:c12f49/ff cheat description:White Shots/Special Weapons code:c14fda/ff cheat description:Infinite E-Tanks (alt) code:7e0ba0/ff cheat description:Infinite W-Tanks (alt) code:7e0ba1/ff cheat description:Infinite S-Tanks (alt) code:7e0ba2/ff cheat description:Infinite Beat Whistles (alt) code:7e0ba3/84 cheat description:Infinite Bolts code:7e0ba6/e7+7e0ba7/03 cheat description:Infinite slide code:7e0c61/ff cheat description:Moon-jump code:7e0c1a/f4 cheat description:Have exit code:7e0ba4/ff cheat description:Have S.Adapt code:7e0b9f/ff cheat description:Have Super Fist upgrade for S.Adapt code:7e0ba4/4f cheat description:Have Proto Shield code:7e0b95/ff cheat description:Infinite Feeze Cracker code:7e0b85/ff cheat description:Infinite Junk Shield code:7e0b89/ff cheat description:Infinite Scorch Wheel code:7e0b8b/ff cheat description:Infinite Slash Claw code:7e0b8d/ff cheat description:Infinite Thunder Bolt code:7e0b87/ff cheat description:Infinite Noise Crush code:7e0b8f/ff cheat description:Infinite Danger Wrap code:7e0b91/ff cheat description:Infinite Wild Coil code:7e0b93/ff cheat description:Infinite Rush Coil code:7e0b9b/ff cheat description:Infinite Rush Search code:7e0b97/ff cheat description:Infinite Rush Jet code:7e0b99/ff cartridge sha256:b8f70a6e7fb93819f79693578887e2c11e196bdf1ac6ddc7cb924b1ad0be2d32 name:Mega Man X (USA) (Rev 1) cheat description:Infinite weapons once obtained code:8194e7/00 cheat description:Immune to drain attack code:81c809/ad cheat description:One hit kills (most enemies) code:849e71/80 cheat description:Hit anywhere code:849b68/24 cheat description:Multi-jump code:81857f/24+818589/fc+81858a/95 cheat description:Enemies always drop large energy code:84a392/a2+84a393/02 cheat description:Enemies always drop large weapon energy code:84a392/a2+84a393/04 cheat description:Bogus jump (may go back to normal jumps) code:86b9c6/04 cheat description:Super-jump (may go back to normal jumps) code:86b9c6/07 cheat description:Mega-jump (may go back to normal jumps) code:86b9c6/09 cheat description:Start with less health code:8094ff/08 cheat description:Start with more health code:8094ff/20 cheat description:Start with 10 lives code:8094fa/09 cheat description:Start with 7 lives code:8094fa/06 cheat description:Start with 5 lives code:8094fa/04 cheat description:Start with 1 life code:8094fa/00 cheat description:Max health containers code:7e1f9a/20 cheat description:Infinite lives code:7e1f80/09 cheat description:Have all equipment code:7e1f99/ff cheat description:Enable Hadoken code:7e1f7e/85 cheat description:Have sub-tank 1 full code:7e1f83/ff cheat description:Have sub-tank 2 full code:7e1f84/ff cheat description:Have sub-tank 3 full code:7e1f85/ff cheat description:Have sub-tank 4 full code:7e1f86/ff cartridge sha256:3e1209f473bff8cd4bcbf71d071e7f8df17a2d564e9a5c4c427ee8198cebb615 name:Mega Man X (USA) cheat description:Infinite health code:849d54/ad cheat description:Infinite lives code:809b59/ad cheat description:Infinite weapons once obtained code:8194ee/a5 cheat description:One hit kills (most enemies) code:849e71/80 cheat description:Hit anywhere code:849b68/24 cheat description:Weapon charges to 1st power level faster code:819866/00 cheat description:Disable weapon charging code:819847/00 cheat description:Multi-jump code:818575/24+81857f/f2+818580/95 cheat description:Enemies always drop large energy code:84a38d/a2+84a38e/02 cheat description:Enemies always drop large weapon energy code:84a38d/a2+84a38e/04 cheat description:Bogus jump (may go back to normal jumps) code:86b9c6/04 cheat description:Super-jump (may go back to normal jumps) code:86b9c6/07 cheat description:Mega-jump (may go back to normal jumps) code:86b9c6/09 cheat description:Start with all weapons and all enemies defeated (except Sigma) code:809f05/de cheat description:Start with less health code:8094ff/08 cheat description:Start with more health code:8094ff/20 cheat description:Start with 10 lives code:8094fa/09 cheat description:Start with 7 lives code:8094fa/06 cheat description:Start with 5 lives code:8094fa/04 cheat description:Start with 1 life code:8094fa/00 cheat description:Max health containers code:7e1f9a/20 cheat description:Infinite lives (alt) code:7e1f80/09 cheat description:Have all equipment code:7e1f99/ff cheat description:Have sub-tank 1 full code:7e1f83/ff cheat description:Have sub-tank 2 full code:7e1f84/ff cheat description:Have sub-tank 3 full code:7e1f85/ff cheat description:Have sub-tank 4 full code:7e1f86/ff cartridge sha256:f3246755f608a1e1dc9c848b61da3b824c7853b29b3be40df6fc7f2793a887ed name:Mega Man X2 (USA) cheat description:Invincibility code:089440/08 cheat description:Infinite health code:08d9e9/ad cheat description:Infinite health (alt) code:08d9e6/9c cheat description:One hit kills code:08db05/80 cheat description:Hit anywhere code:08d7bf/24+08dadf/ad+06f430/02 cheat description:Multi-jump code:0898f0/24+0898fa/d8+0898fb/b9 cheat description:Infinite health (alt 2) code:7e09ff/20 cheat description:Max health containers code:7e1fd1/20 cheat description:Infinite lives code:7e1fb3/09 cheat description:Have Shouryuken (F, D, DF + Fire) (must have max health and health containers) code:7e1fb1/80 cheat description:Infinite L.Tracer code:7e1fcd/5c cheat description:Infinite Bubble.S code:7e1fbd/5c cheat description:Infinite Crystal.H code:7e1fbb/5c cheat description:Infinite Magnet.M code:7e1fc7/5c cheat description:Infinite S.Burner code:7e1fc9/5c cheat description:Infinite S.Chain code:7e1fc5/5c cheat description:Infinite S.Slicer code:7e1fc3/5c cheat description:Infinite S.Wheel code:7e1fc1/5c cheat description:Infinite Silk.S code:7e1fbf/5c cheat description:Infinite G.Crush code:7e1fcb/5c cheat description:Infinite Dash code:7e0a2a/16 cheat description:Have all equipment code:7e1fd0/ff cheat description:Have sub-tank 1 full code:7e1fb6/ff cheat description:Have sub-tank 2 full code:7e1fb7/ff cheat description:Have sub-tank 3 full code:7e1fb8/ff cheat description:Have sub-tank 4 full code:7e1fb9/ff cheat description:Have Zero's Head, Body and Legs code:7e1fd6/80+7e1fd7/80+7e1fd8/80 cartridge sha256:65b03268afac296330e8ff8d60dd0825879e13ed658b37713c034a3bd074f1d7 name:Mega Man X3 (USA) cheat description:Infinite health code:04ce04/ad cheat description:Infinite special weapons on pick-up code:04a593/bd+04a5c7/bd cheat description:Hit anywhere code:04cbae/24+04cf40/80+04cf11/80 cheat description:Multi-jump code:04852b/24+048535/0e+048536/a7 cheat description:Enemies always drop large energy code:04d5f3/a2+04d5f4/02 cheat description:Enemies always drop large weapon energy code:04d5f3/a2+04d5f4/04 cheat description:Super-jump code:06b287/07 cheat description:Mega-jump code:06b287/09 cheat description:Ultra mega-jump code:06b287/0b cheat description:Normal weapon is much more powerful code:04cf40/80 cheat description:Skip bosses at start of game and proceed to stage select code:02e8e6/95 cheat description:Start with max health bar code:04dbc0/14 cheat description:Invincibility code:7e0a08/08 cheat description:Infinite lives code:7e1fb4/09 cheat description:Infinite Boosts code:7e0a9a/01 cheat description:Get all equipment when you enter the start menu code:00cd80/a9+00cd81/ff+00cd82/8d+00cd83/d7 cheat description:Always have Super Shot code:7e0a67/02 cheat description:Infinite Air Dash code:7e0a34/78 cheat description:Have Zero-Saber code:7e1fb2/fc cheat description:Have all upgrades code:7e1fd1/4f cheat description:Invincible Ride Armor code:7e0cf8/01 cartridge sha256:cf4d603dc0a3759da571224c671a9bfd29f9e52ca8dbb61bcc8ac8be5481e9b2 name:Mega Man Soccer (USA) cheat description:Choose any character to play as Dr. Willy code:81a3c6/a9+81a3c7/14+81a3c8/00 cheat description:View ending (select Capcom Championship) code:81829b/ee+81829c/e0 cheat description:Unlock Capcom Championship mode ending code:82d1f0/ea+82d1f1/ea+82d1f2/ea+82d1f3/ea cheat description:Unlock Tournament mode ending code:82d29c/ea+82d29d/ea+82d29e/ea+82d29f/ea cartridge sha256:8815a2e8b26450053d43f2450936eced005d81ee9e33faa5aea2dd8d1e3e7d65 name:Melfand Stories (Japan) cheat description:Hit anywhere code:81ac80/80+81ac81/18 cheat description:One hit kills code:81b066/80 cartridge sha256:d4f2cb6b209db29f7aec62e5a23846681c14665fb007e94d7bcfc7b5611e938b name:Metal Combat - Falcon's Revenge (USA) cheat description:Infinite health code:7e1968/7f cheat description:No time code:7e03c5/00+7e03c7/00 cheat description:Infinite Bombs code:7e03fe/08 cheat description:Infinite Energy Bolt charge code:7e1b13/96 cheat description:Infinite Treble Energy Bolts code:7e1b17/03 cartridge sha256:0a9609a505dd1555006b16f53d961b3ce50c518aa1597a77dcd46e55ecc716ff name:Metal Marines (USA) cheat description:Building an ICBM only takes up one space code:00c26f/80 cheat description:Can view entire enemy map code:03a8f1/80 cheat description:Enemy has no attack phase code:02de7b/60 cheat description:Instant maximum energy code:00d17b/00 cheat description:Instant maximum war funds code:00d1b1/00 cheat description:Enemy always has 0 energy code:00d16f/9c cheat description:Enemy always has 0 war funds code:00d1a5/9c cartridge sha256:057484558ebd18165f98e556b994080535e31cefdd98b5edb190516f7040fc9d name:Metal Morph (USA) cheat description:Infinite ammo for all weapons (disable to change weapons) code:81da8f/a5 cheat description:Infinite continues code:81cc56/a5 cheat description:Infinite time on continue screen code:81cc02/ad cheat description:Hit anywhere (side-scrolling mode) code:81f946/24+81f938/24 cheat description:Hit anywhere (flying mode) code:81b327/24+81b2f1/24 cheat description:Start with 255 continues code:8081a4/ff cheat description:Invincibility code:7e0387/03 cartridge sha256:0d7f875877fe856066cfb39b4ecdbbe7d48393a75770720876c94419f809bb1c name:Metal Warriors (USA) cheat description:Infinite health (Mech) code:81b010/ae cheat description:Infinite health (Human) code:81c352/a5 cheat description:Infinite Gun ammo on pick-up code:818da2/e4 cheat description:Press L to go Hyper (Mech) code:818db5/a6 cartridge sha256:1b425ea5a883b7464637b74c2937fde699ffff52b53ad6940a66285e0663194a name:Michael Jordan - Chaos in the Windy City (USA) cheat description:Infinite lives code:7e1427/05 cheat description:Infinite Flame Balls code:7e594e/05 cheat description:Infinite Grenade(?) Balls code:7e5948/05 cheat description:Infinite Homing Balls code:7e5950/05 cheat description:Infinite Bounce Balls code:7e594c/05 cheat description:Invincibility and hit anywhere code:c041bf/24+c041b7/24+c041c7/24+c0114f/80 cartridge sha256:0773eb741ce28f963f767fc7dd44678eb3d37ed4dc7fc82bb9cce7d55f1cfc64 name:Mickey Mania - The Timeless Adventures of Mickey Mouse (USA) cheat description:Infinite health code:bb9ab2/ad cheat description:Infinite lives code:bb9ae9/ad cheat description:Infinite Marbles code:bbc6b3/ad cheat description:Hit anywhere code:bc9c93/da+bc9c95/d0+bc9c92/ad+bc9c94/06+bc9c96/16 cheat description:Each Marble worth 99 code:bfb2a4/a9 cheat description:One hit and you're dead code:a1c7ce/00 cheat description:Start with less health code:a1c7ce/02 cheat description:Start with more health code:a1c7ce/09 cheat description:Start with 1 life code:a1c7e0/00 cheat description:Start with 7 lives code:a1c7e3/06 cheat description:Start with 10 lives code:a1c7e3/09 cheat description:Start on stage - the Wharf code:a1c792/01 cheat description:Start on stage - Mad Doc 1 code:a1c792/02 cheat description:Start on stage - Mad Doc 2 code:a1c792/03 cheat description:Start on stage - Ride The Gurney code:a1c792/04 cheat description:Start on stage - Mad Doc 4 code:a1c792/05 cheat description:Start on stage - Elevator code:a1c792/06 cheat description:Start on stage - Mad Doc Eol code:a1c792/07 cheat description:Start on stage - Moose Hunt code:a1c792/08 cheat description:Start on stage - Moose Chase code:a1c792/09 cheat description:Start on stage - Haunted House code:a1c792/0a cheat description:Start on stage - Haunted Basement code:a1c792/0b cheat description:Start on stage - Haunted Halls code:a1c792/0c cheat description:Start on stage - Garden code:a1c792/0d cheat description:Start on stage - Tunnel code:a1c792/0e cheat description:Start on stage - Steps code:a1c792/0f cheat description:Start on stage - Table code:a1c792/10 cheat description:Start on stage - Library code:a1c792/11 cheat description:Start on stage - Kitchen code:a1c792/12 cheat description:Start on stage - Dungeon code:a1c792/13 cheat description:Start on stage - Tower Escape code:a1c792/14 cheat description:Start on stage - Dungeon 2 code:a1c792/15 cartridge sha256:453359b20f78787fcfea0dafe715238f0ff3f1d6f4d729285dc72a8004131a3b name:Mickey to Donald - Magical Adventure 3 (Japan) cheat description:Invincibility - P1 code:7e0454/ff cheat description:Invincibility - P2 code:7e0554/ff cheat description:Infinite health - P1 code:7e046f/03 cheat description:Infinite health - P2 code:7e056f/03 cheat description:Infinite lives - P1 code:7e0486/04 cheat description:Infinite lives - P2 code:7e0586/04 cheat description:Infinite Oxygen - P1 code:7e0481/0f cheat description:Infinite Oxygen - P2 code:7e0581/0f cheat description:Max power bar - P1 code:7e048a/ff cheat description:Max power bar - P2 code:7e058a/ff cartridge sha256:a2adeb4bf0e7cc943611ac726e5578da404373a79e91436c9bbd15480688b15c name:Micro Machines (USA) cheat description:Infinite lives code:7e0323/09 cartridge sha256:889beb58d2a48a05a6230cabda14555cb030e2e986c0293bdf396e85af5c6798 name:Mighty Max (USA) cheat description:Invincibility code:7e0254/a1 cheat description:Infinite energy code:7e0294/03 cheat description:Infinite lives code:7e028c/09 cartridge sha256:624a66607caef2ca34920ea15b84b28cdd1916ee089d496cec4f1d43621fdbb3 name:Mighty Morphin Power Rangers (USA) cheat description:Invincibility code:04b743/ad cheat description:Infinite health code:04ba80/ad cheat description:Infinite lives code:00c4c4/ea cheat description:Infinite bombs on pick-up code:049d34/ad cheat description:Collect items from anywhere code:04b82d/24+04b9cf/80+04b9d0/1d cheat description:Mega-jump code:048fc0/fa cheat description:More health from capsule code:018e2a/c0 cheat description:Trini moves faster before morphing code:0485ba/02 cheat description:Billy moves faster before morphing code:0485a2/02 cheat description:Jason moves faster before morphing code:04859a/02 cheat description:Kimberley moves faster before morphing code:0485a9/c0 cheat description:Zach moves faster before morphing code:0485b2/02 cheat description:Trini moves faster after morphing code:0485d2/ff cheat description:Billy moves faster after morphing code:0485c9/ff cheat description:Jason moves faster after morphing code:0485c1/02 cheat description:Kimberley moves faster after morphing code:0485d1/c0 cheat description:Zach moves faster, but the wrong way code:0485da/ff cheat description:Start game with full health code:00b2d8/c0 cheat description:Start with 1 life code:00b2c0/00 cheat description:Start with 6 lives code:00b2c0/05 cheat description:Start with 9 lives code:00b2c0/08 cheat description:Infinite health (Megazord) code:7e04c0/71 cheat description:Infinite power (Megazord) code:7e04c2/71 cartridge sha256:1b85c0690aa156a255c7f79e133e453345452698fa98abf8df744c262d0cf865 name:Mighty Morphin Power Rangers - The Fighting Edition (USA) cheat description:Infinite health - P1 code:7e1a22/70 cheat description:Infinite health - P2 code:7e1a26/70 cheat description:Special maxed - P1 code:7e06a0/30 cheat description:Special maxed -P2 code:7e06a6/30 cheat description:Play As Ivan Ooze - P1 code:7e1a68/10 cheat description:Play as Ivan Ooze - P2 code:7e1a6c/10 cheat description:Infinite round time code:7e06b8/06+7e06ba/00 cheat description:Infinite time code:7e06bc/01 cheat description:Special 1 - P1 code:7e1b00/07+7e1b02/0c cheat description:Special 2 - P1 code:7e1b08/07+7e1b0a/0c cheat description:Special 3 - P1 code:7e1b10/07+7e1b12/0c cheat description:Special 4 - P1 code:7e1b18/07+7e1b1a/0c cheat description:Special 5 - P1 code:7e1b20/07+7e1b22/0c cheat description:Special 1 - P2 code:7e1b04/07+7e1b06/0c cheat description:Special 2 - P2 code:7e1b0c/07+7e1b0e/0c cheat description:Special 3 - P2 code:7e1b14/07+7e1b16/0c cheat description:Special 4 - P2 code:7e1b1c/07+7e1b1e/0c cheat description:Special 5 - P2 code:7e1b24/07+7e1b26/0c cheat description:Super move - P2 code:7e1b34/03+7e1b36/18 cartridge sha256:c706b70097c679f6f0ced6f77a30620807d0b2555fc3c683c0ec2fc791176039 name:Mighty Morphin Power Rangers - The Movie (USA) cheat description:Invincibility code:03b08a/8d cheat description:Infinite life force code:03d58f/ad cheat description:Almost infinite life force code:03d58f/b9 cheat description:Infinite lives code:03d152/ad cheat description:Infinite continues - 1P mode code:03f045/ad cheat description:Infinite continues - 2P mode code:039367/ad cheat description:Large main power-up box gives max power code:03d547/18 cheat description:Main collectable power doesn't go down after ranger powerup as fast code:00be02/ea+03c228/ea cheat description:One hit kills code:03d332/80 cheat description:No continues code:00c1b0/00 cheat description:Start with mega-points code:00c1c0/03 cheat description:Start with a lot of energy - first life only code:00c1db/09 cheat description:Start with very little energy - first life only code:00c1db/01 cheat description:Start with very little energy after first life code:03d15c/01 cheat description:Start with more energy after first life code:03d15c/09 cheat description:Start with 9 continues code:00c1b0/09 cheat description:Start with 9 lives code:0081f2/09 cheat description:Start with 5 lives code:0081f2/05 cheat description:Start with 1 life code:0081f2/01 cheat description:Invincibility - P1 code:7e1c28/01 cheat description:Infinite health - P1 code:7e0628/05 cheat description:Infinite power - P1 code:7e062a/18 cheat description:Infinite time - P1 code:ff4139/09 cheat description:Infinite lives - P1 code:7e060a/09 cartridge sha256:2828e4485357585714f16f5bf96910794e22e4dfd19f2a22ce20d0a599f25878 name:Miracle Girls (Japan) cheat description:Invincibility code:c0e31b/60 cheat description:Infinite lives code:c02ced/ad cartridge sha256:8715a641f2e4dd8b6066be7f2683d9129fff3fcccaf0a09cc8bdd2aa56460764 name:Mohawk & Headphone Jack (USA) cheat description:Infinite health code:7e0308/03 cheat description:Infinite lives code:7e0306/05 cartridge sha256:6b0ac4d52d24536cdb7d9d0dc7d19ee30d08ac34363983290c5912ccc850fa0d name:Monopoly (USA) (Rev 1) cheat description:Land, rent and some other things are free - all players code:00b674/60 cheat description:Land, rent, and some other things are $50 - all players code:00b674/e9+00b675/32+00b676/00 cheat description:Land, rent, and some other things are $100 - all players code:00b674/e9+00b675/64+00b676/00 cheat description:Land, rent, and some other things are $200 - all players code:00b674/e9+00b675/c8+00b676/00 cheat description:Land, rent, and some other things are $500 - all players code:00b674/e9+00b675/f4+00b676/00 cheat description:Always throw double 6's code:0093e5/a9+0093e6/06+0093e7/06 cheat description:Always throw double 5's code:0093e5/a9+0093e6/05+0093e7/05 cheat description:Always throw double 4's code:0093e5/a9+0093e6/04+0093e7/04 cheat description:Always throw double 3's code:0093e5/a9+0093e6/02+0093e7/03 cheat description:Always throw double 2's code:0093e5/a9+0093e6/02+0093e7/02 cheat description:Always throw double 1's code:0093e5/a9+0093e6/01+0093e7/01 cheat description:P1 has a Get Out Of Jail card code:7e08f2/01 cheat description:P2 has a Get Out Of Jail card code:7e08f4/01 cheat description:P3 has a Get Out Of Jail card code:7e08f6/01 cheat description:P4 has a Get Out Of Jail card code:7e08f8/01 cheat description:P5 has a Get Out Of Jail card code:7e08fa/01 cheat description:P6 has a Get Out Of Jail card code:7e08fc/01 cheat description:P7 has a Get Out Of Jail card code:7e08fe/01 cheat description:P8 has a Get Out Of Jail card code:7e0900/01 cartridge sha256:480ae7186fd5b28200cd88e136b9cd3b6600d32508e280a0bc27ea0ed8d3c0bb name:Monopoly (USA) cheat description:Land, rent and some other things are free - all players code:00b674/60 cheat description:Land, rent, and some other things are $50 - all players code:00b674/e9+00b675/32+00b676/00 cheat description:Land, rent, and some other things are $100 - all players code:00b674/e9+00b675/64+00b676/00 cheat description:Land, rent, and some other things are $200 - all players code:00b674/e9+00b675/c8+00b676/00 cheat description:Land, rent, and some other things are $500 - all players code:00b674/e9+00b675/f4+00b676/00 cheat description:Always throw double 6's code:0093e5/a9+0093e6/06+0093e7/06 cheat description:Always throw double 5's code:0093e5/a9+0093e6/05+0093e7/05 cheat description:Always throw double 4's code:0093e5/a9+0093e6/04+0093e7/04 cheat description:Always throw double 3's code:0093e5/a9+0093e6/02+0093e7/03 cheat description:Always throw double 2's code:0093e5/a9+0093e6/02+0093e7/02 cheat description:Always throw double 1's code:0093e5/a9+0093e6/01+0093e7/01 cheat description:P1 has a Get Out Of Jail card code:7e08f2/01 cheat description:P2 has a Get Out Of Jail card code:7e08f4/01 cheat description:P3 has a Get Out Of Jail card code:7e08f6/01 cheat description:P4 has a Get Out Of Jail card code:7e08f8/01 cheat description:P5 has a Get Out Of Jail card code:7e08fa/01 cheat description:P6 has a Get Out Of Jail card code:7e08fc/01 cheat description:P7 has a Get Out Of Jail card code:7e08fe/01 cheat description:P8 has a Get Out Of Jail card code:7e0900/01 cartridge sha256:3c6d3e4a9c9af160f1c1cf11ce4ead531d9500c1f58f1cbe682c90a5eaa3efb2 name:Mortal Kombat (USA) cheat description:Invincibility (except against throws) code:80a4d4/24+80a4da/24+80a4de/e0+80a4df/77+80a4e0/17+80975b/60 cheat description:Infinite health code:80e647/a1+80e649/8d+80e64a/b9 cheat description:Infinite time code:8095df/a5 cheat description:Have much more fatality time code:809b76/7f cheat description:Always get Flawless Victory bonus code:809fb2/80 cheat description:First strike of any kind wins round code:8097ad/00 cheat description:Hit anywhere - P1 code:809711/e0+809712/d3+809713/18+809715/32 cheat description:All strikes do minimal damage (all equal to 1 hit point) (2P game only, donメt choose handicap for either player) code:809917/00 cheat description:P1 nearly invincible in 2P game (go to options, move P1メs handicap bar all the way to the right) code:98b460/0b cheat description:One button fatalities - Liu Kang (Press Down) code:80d10a/00 cheat description:One button fatalities - Johnny Cage (Press Y) code:80ca49/08 cheat description:One button fatalities - Kano (Press B) code:80d40b/08 cheat description:One button fatalities - Sonya (Press L or R) code:80dac0/00 cheat description:One button fatalities - Sub Zero (Press Y) code:80ccf0/08 cheat description:One button fatalities - Raiden (Press Y) code:80cb01/08 cheat description:One button fatalities - Scorpion (Press Up, L or R) code:80d03f/0d cheat description:All throws do more damage code:809053/78 cheat description:Kano's High Punch does more damage code:98d945/1e cheat description:Kano's Low Punch does more damage code:98d94e/1e cheat description:Kano's High Kick does more damage code:98d98d/48 cheat description:Kano's Low Kick does more damage code:98d996/48 cheat description:Kano's Head Blow does more damage code:98d960/48 cheat description:Kano's Knee does more damage code:98d957/48 cheat description:Kano's Crouched Kick does more damage code:98d984/3c cheat description:Kano's Uppercut does more damage code:98d97b/78 cheat description:Kano's Roundhouse Kick does more damage code:98d93c/60 cheat description:Kano's Foot Sweep does more damage code:98d972/3c cheat description:Kano's Flying Punch does more damage code:98d9a8/4b cheat description:Kano's Knife does more damage (only at close distance) code:98d92a/4b cheat description:Johnny Cage's High Punch does more damage code:98d8a4/1e cheat description:Johnny Cage's Low Punch does more damage code:98d8ad/1e cheat description:Johnny Cage's High Kick does more damage code:98d892/48 cheat description:Johnny Cage's Low Kick does more damage code:98d89b/42 cheat description:Johnny Cage's Head Blow does more damage code:98d8c8/3c cheat description:Johnny Cage's Knee does more damage code:98d8d1/48 cheat description:Johnny Cage's Crouched Kick does more damage code:98d8bf/18 cheat description:Johnny Cage's Uppercut does more damage code:98d8da/78 cheat description:Johnny Cage's Roundhouse Kick does more damage code:98d889/60 cheat description:Johnny Cage's Foot Sweep does more damage code:98d8b6/3c cheat description:Johnny Cage's Flying Punch does more damage code:98d880/4b cheat description:Johnny Cage's Shadow Kick does more damage code:98d84a/5a cheat description:Johnny Cage's Fireball does more damage (only at close distance) code:98d865/4b cheat description:Johnny Cage's Split Punch does more damage code:98d85c/66 cheat description:Liu Kang's High Punch does more damage code:98dae3/1e cheat description:Liu Kang's Low Punch does more damage code:98daec/1e cheat description:Liu Kang's High Kick does more damage code:98db22/48 cheat description:Liu Kang's Low Kick does more damage code:98db2b/48 cheat description:Liu Kang's Head Blow does more damage code:98dabf/3c cheat description:Liu Kang's Knee does more damage code:98daf5/48 cheat description:Liu Kang's Crouched Kick does more damage code:98db19/3c cheat description:Liu Kang's Uppercut does more damage code:98db10/78 cheat description:Liu Kang's Roundhouse Kick does more damage code:98dada/60 cheat description:Liu Kang's Foot Sweep does more damage code:98db07/3c cheat description:Liu Kang's Flying Punch does more damage code:98db3d/4b cheat description:Liu Kang's Special Flying Kick does more damage code:98dab6/5a cheat description:Liu Kang's Fireball does more damage (only at close distance) code:98dac8/4b cheat description:Sonya Blade's High Punch does more damage code:98d717/1e cheat description:Sonya Blade's Low Punch does more damage code:98d720/1e cheat description:Sonya Blade's High Kick does more damage code:98d6e1/54 cheat description:Sonya Blade's Low Kick does more damage code:98d6ea/51 cheat description:Sonya Blade's Head Blow does more damage code:98d6f3/3c cheat description:Sonya Blade's Knee does more damage code:98d6fc/48 cheat description:Sonya Blade's Crouched Kick does more damage code:98d70e/3c cheat description:Sonya Blade's Uppercut does more damage code:98d729/78 cheat description:Sonya Blade's Roundhouse Kick does more damage code:98d6d8/66 cheat description:Sonya Blade's Foot Sweep does more damage code:98d6cf/3c cheat description:Sonya Blade's Flying Punch does more damage code:98d73b/4b cheat description:Sonya Blade's Leg Grab does more damage code:80dd4f/78 cheat description:Sonya Blade's Sonic Rings does more damage (only at close distance) code:98d6db/4b cheat description:Sonya Blade's Special Flying Kick does more damage code:98d73b/4b cheat description:Rayden's High Punch does more damage code:98da25/1e cheat description:Rayden's Low Punch does more damage code:98da37/1e cheat description:Rayden's High Kick does more damage code:98da13/45 cheat description:Rayden's Low Kick does more damage code:98da1c/42 cheat description:Rayden's Head Blow does more damage code:98da52/3c cheat description:Rayden's Knee does more damage code:98da5b/48 cheat description:Rayden's Crouched Kick does more damage code:98da49/18 cheat description:Rayden's Uppercut does more damage code:98da64/78 cheat description:Rayden's Roundhouse Kick does more damage code:98da0a/5a cheat description:Rayden's Foot Sweep does more damage code:98da40/3c cheat description:Rayden's Flying Punch does more damage code:98da01/4b cheat description:Rayden's Flying Thunderbolt does more damage code:98d9dd/5a cheat description:Rayden's Lightning does more damage (only at close distance) code:98d9e6/4b cheat description:Scorpion's, Sub-Zero's and Reptile's High Punch do more damage code:98dbb7/1e cheat description:Scorpion's, Sub-Zero's and Reptile's Low Punch do more damage code:98dbc0/1e cheat description:Scorpion's, Sub-Zero's and Reptile's High Kick do more damage code:98dbf6/48 cheat description:Scorpion's, Sub-Zero's and Reptile's Low Kick do more damage code:98dbff/48 cheat description:Scorpion's, Sub-Zero's and Reptile's Head Blow do more damage code:98dbd2/3c cheat description:Scorpion's, Sub-Zero's and Reptile's Knee do more damage code:98dbc9/48 cheat description:Scorpion's, Sub-Zero's and Reptile's Crouched Kick do more damage code:98dc1a/18 cheat description:Scorpion's, Sub-Zero's and Reptile's Uppercut do more damage code:98dbae/78 cheat description:Scorpion's, Sub-Zero's and Reptile's Roundhouse Kick do more damage code:98dc11/60 cheat description:Scorpion's, Sub-Zero's and Reptile's Foot Sweep do more damage code:98dc08/3c cheat description:Scorpion's, Sub-Zero's and Reptile's Flying Punch do more damage code:98dbe4/4b cheat description:Sub-Zero's and Reptile's Deep Freeze do damage code:98dba5/28 cheat description:Sub-Zero's and Reptile's Slide do more damage code:98db78/27 cheat description:Scorpion's and Reptile's Harpoon do more damage code:98db8a/18 cheat description:Scorpion's and Reptile's Scorpion Split do more damage code:98dbe4/4b cheat description:Each round is 199 seconds (time counts down twice) code:808b81/02 cheat description:Each round is 90 seconds code:808b80/91+808b81/00 cheat description:Each round is 80 seconds code:808b80/81+808b81/00 cheat description:Each round is 70 seconds code:808b80/71+808b81/00 cheat description:Each round is 60 seconds code:808b80/61+808b81/00 cheat description:Each round is 50 seconds code:808b80/51+808b81/00 cheat description:Each round is 40 seconds code:808b80/41+808b81/00 cheat description:Each round is 30 seconds code:808b80/31+808b81/00 cheat description:Each round is 20 seconds code:808b80/21+808b81/00 cheat description:Each round is 10 seconds code:808b80/11+808b81/00 cheat description:Always fight in the the Courtyard code:8084cf/00 cheat description:After 1st match, almost always fight at the Palace Gates code:8084cb/a9+8084cc/01 cheat description:After 1st match, almost always fight in the Warrior Shrine code:8084cb/a9+8084cc/02 cheat description:After 1st match, almost always fight in the Pit code:8084cb/a9+8084cc/03 cheat description:After 1st match, almost always fight in the Throne Room code:8084cb/a9+8084cc/04 cheat description:After 1st match, almost always fight in Goro's Lair code:8084cb/a9+8084cc/05 cheat description:After 1st match, almost always fight in the bottom of the pit (screen says Goro's Lair) code:8084cb/a9+8084cc/06 cheat description:Almost always fight Johnny Cage code:9897c4/a9+9897c5/00 cheat description:Almost always fight Kano code:9897c4/a9+9897c5/01 cheat description:Almost always fight Rayden code:9897c4/a9+9897c5/02 cheat description:Almost always fight Liu Kang code:9897c4/a9+9897c5/03 cheat description:Almost always fight Scorpion code:9897c4/a9+9897c5/04 cheat description:Almost always fight Sub-Zero code:9897c4/a9+9897c5/05 cheat description:Almost always fight Sonya Blade code:9897c4/a9+9897c5/06 cheat description:Almost always fight Goro (don't use Kano's or Johnny Cage's finishing move on Goro) code:9897c4/a9+9897c5/07 cheat description:Start on Match 2 code:808168/01 cheat description:Start on Match 3 code:808168/02 cheat description:Start on Match 4 code:808168/03 cheat description:Start on Match 5 code:808168/04 cheat description:Start on Match 6 code:808168/05 cheat description:Start on Mirror Match code:808168/06 cheat description:Start on Endurance 1 match code:808168/07 cheat description:Start on Endurance 2 match code:808168/08 cheat description:Start on Endurance 3 match code:808168/09 cheat description:Start on match with Goro code:808168/0a cheat description:Start on match with Shang Tsung code:808168/0b cartridge sha256:6caa0ab221a3e690a104baa4935fc86dbc385d4272e88afb46b999bf6c6edb36 name:Mortal Kombat - Shinken Kourin Densetsu (Japan) cheat description:Infinite health code:80e866/a1+80e868/8d+80e869/f9+80e86a/04 cheat description:One hit kill - P1 code:80e8a8/00+80e8aa/8d+80e8ab/fb+80e8ac/04 cartridge sha256:43e36a74fb73a7efc46b380599e269b1fff8f55ecf80f5cf50c34d02ceda041a name:Mortal Kombat II (USA) cheat description:Invincibility - P1 code:849d68/ad cheat description:Invincibility - P2/CPU code:849d78/ad cheat description:Infinite health code:83b057/a9+83b058/a1+83b059/00+83b05b/fc+83b05c/2e cheat description:Infinite time code:83a133/80 cheat description:Infinite continues code:83a02f/ad cheat description:No health - P1 code:849d64/00 cheat description:No health - P2/CPU code:849d74/00 cheat description:Hit anywhere - P1 code:849c45/40+849c44/d0+849c41/e0+849c42/00 cheat description:Have 127x more fatality time code:83a6d5/7f cheat description:Disable throws - 2P mode code:82da9f/8d cheat description:Mileena's Sai Throw does massive damage code:80f96c/48 cheat description:Liu Kang's High Fireball does massive damage code:80fd50/48 cheat description:Kung Lao's Hat Throw does massive damage code:80fdde/48 cheat description:Cage's Shadow Kick does massive damage code:80fc1e/48 cheat description:Reptile's Force Ball does massive damage code:80f59f/48 cheat description:Shang Tsung's Flaming Skull attack does massive damage code:80f847/48 cheat description:Kitana's Fan Throw does massive damage code:80f95f/48 cheat description:Baraka's Blade Spark does massive damage code:80fafb/48 cheat description:Rayden's Lightning Bolt does massive damage code:80f728/48 cheat description:Enable all 2P rules/moves when fighting computer code:84a011/80 cheat description:Always fight Kung Lao code:83af82/a9+83af83/00 cheat description:Always fight Liu Kang code:83af82/a9+83af83/01 cheat description:Always fight Cage code:83af82/a9+83af83/02 cheat description:Always fight Baraka code:83af82/a9+83af83/03 cheat description:Always fight Kitana code:83af82/a9+83af83/04 cheat description:Always fight Mileena code:83af82/a9+83af83/05 cheat description:Always fight Shang Tsung code:83af82/a9+83af83/06 cheat description:Always fight Rayden code:83af82/a9+83af83/07 cheat description:Always fight Sub-Zero code:83af82/a9+83af83/08 cheat description:Always fight Reptile code:83af82/a9+83af83/09 cheat description:Always fight Scorpion code:83af82/a9+83af83/0a cheat description:Always fight Jax code:83af82/a9+83af83/0b cheat description:Always fight Kintaro code:83af82/a9+83af83/0c cheat description:Always fight Shao Kahn code:83af82/a9+83af83/0d cheat description:Always fight Smoke code:83af82/a9+83af83/0e cheat description:Always fight Noob Saibot code:83af82/a9+83af83/0f cheat description:Always fight Jade code:83af82/a9+83af83/10 cheat description:Start with 0 continues code:83b2a0/01 cheat description:Start with 2 continues code:83b2a0/03 cheat description:Start with 6 continues code:83b2a0/07 cheat description:Start with 8 continues code:83b2a0/09 cheat description:Invincibility - P1 (alt) code:849c68/80+849c69/09+849c7b/00+85aa52/60+85ab1c/60+85ac2a/60 cheat description:Invincibility - P2/CPU (alt) code:849c68/80+849c69/06+849c76/00+85aa52/60+85ab1c/60+85ac2a/60 cartridge sha256:ca2f86ca77f822fcd8e86f5a287f2a76d0becbb81a7bce73ae22909beb2f834c name:Mortal Kombat II (USA) (Rev 1) cheat description:P1 is killed by one hit code:849d64/00 cheat description:P2/CPU is killed by one hit code:849d74/00 cheat description:Have 127x more fatality time code:83a6e5/7f cheat description:Disable throws - 2P mode code:82da9f/8d cheat description:Enable all 2P rules/moves when fighting computer code:84a011/80 cartridge sha256:417874aa57856fe93eefdb24066fa1a9ca3f23c72c09d5247ae2b3ab4b3d09d1 name:Mortal Kombat 3 (USA) cheat description:Infinite health - P1 code:83e642/ad cheat description:Infinite health - P2 code:83e652/ad cheat description:P1 takes all damage code:83e636/00 cheat description:P2 takes all damage code:83e635/80 cheat description:Infinite continues code:86d346/cd cheat description:Hit anywhere - P1 code:83ff82/00+83ff83/f0+83ff84/03+83e54b/ff+83ff85/4c+83ff89/4c+83ff88/4c+83ff8a/e5+83ff87/e5+83ff80/e0+83e54a/80+83ff86/a2+83ff81/02 cheat description:Press A on main menu for Sound Test code:82dcf8/02 cheat description:Press Up on main menu for Kool Stuff Menu code:82dd2c/02 cheat description:Press Select on main menu for Kooler Stuff Menu code:82dd60/02 cheat description:Press X on main menu for Scott's Menu code:82dd94/02 cheat description:Always fight Kano in Master mode code:84bf16/af+84dfef/9c+84c4f4/00 cheat description:Always fight Sonya in Master mode code:84bf16/af+84dfef/9c+84c4f4/01 cheat description:Always fight Jax in Master mode code:84bf16/af+84dfef/9c+84c4f4/02 cheat description:Always fight Nightwolf in Master mode code:84bf16/af+84dfef/9c+84c4f4/03 cheat description:Always fight Sub-Zero in Master mode code:84bf16/af+84dfef/9c+84c4f4/04 cheat description:Always fight Stryker in Master mode code:84bf16/af+84dfef/9c+84c4f4/05 cheat description:Always fight Sindel in Master mode code:84bf16/af+84dfef/9c+84c4f4/06 cheat description:Always fight Sektor in Master mode code:84bf16/af+84dfef/9c+84c4f4/07 cheat description:Always fight Cyrax in Master mode code:84bf16/af+84dfef/9c+84c4f4/08 cheat description:Always fight Kung Lao in Master mode code:84bf16/af+84dfef/9c+84c4f4/09 cheat description:Always fight Kabal in Master mode code:84bf16/af+84dfef/9c+84c4f4/0a cheat description:Always fight Sheeva in Master mode code:84bf16/af+84dfef/9c+84c4f4/0b cheat description:Always fight Shang Tsung in Master mode code:84bf16/af+84dfef/9c+84c4f4/0c cheat description:Always fight Liu Kang in Master mode code:84bf16/af+84dfef/9c+84c4f4/0d cheat description:Always fight Smoke in Master mode code:84bf16/af+84dfef/9c+84c4f4/0e cheat description:Always fight Motaro in Master mode code:84bf16/af+84dfef/9c+84c4f4/0f cheat description:Always fight Shao Kahn in Master mode code:84bf16/af+84dfef/9c+84c4f4/10 cheat description:Always fight Noob-Saibot in Master mode code:84bf16/af+84dfef/9c+84c4f4/11 cheat description:Invincibility (except throws and uppercuts) - P1 code:7e5447/01 cheat description:Invincibility (except throws and uppercuts) - P2 code:7e5449/01 cheat description:First round / one button fatalities code:7e3af0/01 cartridge sha256:340293c06536d7b6981ad7c681e404f4390ff6c62340f844a4558877c1b82af0 name:Mr. Do! (USA) cheat description:Invincibility code:02e78d/80 cheat description:Infinite lives code:7e18b2/09 cheat description:Two enemies on screen at most code:7e1440/00 cheat description:Only one Cherry needed to clear level code:02a4d9/9c cheat description:Level modifier (level is always one less than entered) code:7e189e/00+7e18a0/00+7e18b4/00 cartridge sha256:3472dd574b50aed2fa998f464398db4fbb00f5a300a672c3737ee9336a008a16 name:Mr. Nutz (USA) (En,Fr) cheat description:Invincibility code:7e008d/2d cheat description:Infinite Nuts code:7e0a29/99 cheat description:Infinite coins code:7e1894/99 cheat description:One hit kills on bosses code:7e05d0/00 cartridge sha256:44f0f159e1d56a703baa08d648a0d871c037e18198ec119c07795a3757c9e163 name:Mr. Tuff (Europe) (En,Fr,De,Es,It) (Proto) (1994-12-05) cheat description:Infinite time code:7eeb1c/39 cheat description:Infinite time on item pick-ups and flame-thrower fuel code:7eeb93/27 cheat description:Enable auto-hit code:7eeb79/03 cheat description:Easy bosses (except Octopod) code:7ef4f8/00 cheat description:Jump higher code:7e0421/00 cheat description:Have drill code:7eeaf4/01 cheat description:Have super attack code:7eeaf4/02 cheat description:Have bowling ball code:7eeaf4/03 cheat description:Have fire smash code:7eeaf4/04 cheat description:Have regular punch code:7eeaf4/05 cheat description:Have crescent blast code:7eeaf4/06 cheat description:Have mace code:7eeaf4/07 cheat description:Have jet pack special code:7eeb68/01 cheat description:Have missiles special code:7eeb68/02 cheat description:Have flame thrower special code:7eeb68/03 cartridge sha256:4f172253946ae29ddbf1e8169b48d55fe1aed8d007adafc6fa3e62685ed45de0 name:Mr. Tuff (USA) (En,Fr,De) (Proto) (1994-07-12) cheat description:Invincibility code:7eeb46/fe cheat description:Infinite health code:7ed580/03 cheat description:Infinite lives code:7ed580/03 cheat description:No targets to smash code:7eeb2e/00 cartridge sha256:007735e68a91cab403f1c955d9d562e9311124e660fa5b32e5c5d0a2e052160e name:Ms. Pac-Man (USA) cheat description:Ghosts eatable at start and infinite power pill time code:7e029e/03 cheat description:Infinite Power Pellet time code:7e029e/01 cheat description:Infinite lives code:7e028c/03 cheat description:Level modifier code:7e039e/00 cartridge sha256:f292598ac462fdfcd32ad9b6b35ac01d4bab020391dff92bfe94780ec604289a name:Musya - The Classic Japanese Tale of Horror (USA) cheat description:Invincibility (blinking) code:7e103c/0a cheat description:Infinite health code:7e101a/10 cheat description:Infinite lives code:7e1033/03 cheat description:Infinite Fire magic code:7e102f/04 cheat description:Infinite Heal magic code:7e1032/33 cheat description:Infinite Help magic code:7e1030/33 cheat description:Infinite Lightning magic code:7e102e/04 cheat description:Infinite Web magic code:7e1031/33 cheat description:Have strongest weapon code:7e102c/06 cartridge sha256:a19337da953f63c806754b90af7ff9fbea1bf090618dae732ee3a546882b8700 name:Mystic Ark (Japan) cheat description:999 HP for hero code:7eb004/0f+7eb005/27 cheat description:999 MP for Hero code:7eb008/e7+7eb009/03 cheat description:Have enough gold code:7eb120/ff+7eb121/ff cheat description:Quick gain EXP code:7e0551/ff+7e0552/ff cartridge sha256:c70b812a9d2df7f95b279e4050e03a4b8a68588a370816e645f378296b84e5d1 name:NBA All-Star Challenge (USA) cheat description:P1 can't score in the 1-on-1, free throw or tournament stages code:80e395/6d cheat description:P2 or computer can't score in the 1-on-1, free throw or tournament events code:80e3b9/cd cheat description:P1 can't score in 3-point shootout code:80e155/cd+80e13e/cd cheat description:P2 or computer can't score in 3-point shootout code:80e11e/cd+80e107/cd cheat description:Stop shot clock (1-on-1 and 1-on-1 tournament modes) code:80af85/cd+80af83/80 cheat description:12-second shot clock (1-on-1 and 1-on-1 tournament modes) code:80afe8/01+80afe3/02 cheat description:48-second shot clock - after the 1st shot (1-on-1 and 1-on-1 tournament modes) code:80afe8/04+80afe3/08 cartridge sha256:b257cffb3484e6be051a56268cb99ee888bd6d3e9c0e8d6d0779ff66c411f6ba name:NBA Jam - Tournament Edition (USA) cheat description:Infinite shot clock time code:80ad5a/ad cheat description:Ability to set shot clock option down to 1 code:aa85d5/01 cheat description:Have almost Infinite Turbo - P1 code:81bd93/ad cheat description:Have almost Infinite Turbo - P2 code:a6b587/ad cheat description:Turbo recharges quicker - P1 code:81bdc2/01 cheat description:Turbo recharges quicker - P2 code:a6b5b6/01 cheat description:Twice as much turbo - P1 code:81bdc7/40 cheat description:Twice as much turbo - P2 code:a6b5bb/40 cheat description:Shots worth more - P1 code:00a6d0/38 cheat description:Shots worth more - P2 code:00a8e5/38 cheat description:Player is On Fire after 2 baskets instead of 3 code:9a9d1a/04 cheat description:No turbo (except in tournament mode) - P1 code:91bdbe/a9 cheat description:No turbo (except in tournament mode) - P2 code:a6b5b2/a9 cheat description:Move much faster (except in tournament mode) - all players code:26fd27/00+26fd2c/06 cheat description:Move super fast (except in tournament mode) - all players code:26fd27/00+26fd2c/09 cheat description:Hot spots and Power ups are on in tournament mode automatically (don't select the special features menu) code:26fc59/06 cheat description:Have all secret power-ups except slippery floors on - all players code:8afa7c/00+8afa90/80+4cf078/26 cheat description:Have Power Push, Powered Up 3pts, Infinite Turbo, Always On Fire, Super Dunks, Max Power, Powered Up Goal Tending and Quick Hands - P1 code:82f9c4/ff cheat description:Have Power Block, Powered Up 3pts, Infinite Turbo, Always On Fire, Super Dunks, Max Power, Powered Up Goal Tending and Quick Hands - P2 code:82fa6a/ff cheat description:Have Power Block, Powered Up 3pts, Infinite Turbo, Always On Fire, Super Dunks, Max Power, Powered Up Goal Tending and Quick Hands - P3 code:82fb10/ff cheat description:Have Power Block, Powered Up 3pts, Infinite Turbo, Always On Fire, Super Dunks, Max Power, Powered Up Goal Tending and Quick Hands - P4 code:82fbb6/ff cheat description:Have Power-up offense, Speed Up, block opponent to make both fall, Teleport Pass and High Shots - P1 code:82f9c5/ff cheat description:Have Power-up offense, Speed Up, block opponent to make both fall, Teleport Pass and High Shots - P2 code:82fa6b/ff cheat description:Have Power-up offense, Speed Up, block opponent to make both fall, Teleport Pass and High Shots - P3 code:82fb11/ff cheat description:Have Power-up offense, Speed Up, block opponent to make both fall, Teleport Pass and High Shots - P4 code:82fbb7/ff cheat description:Have all secret power-ups - all players code:8afa7c/00+8afa90/80 cheat description:Have all secret power-ups on - P1 code:82f9c4/ff+82f9c5/ff cheat description:Have all secret power-ups on - P2 code:82fa6a/ff+82fa6b/ff cheat description:Have all secret power-ups on - P3 code:82fb10/ff+82fb11/ff cheat description:Have all secret power-ups on - P4 code:82fbb6/ff+82fbb7/ff cheat description:Have Power Push - P1 code:82f9c4/01 cheat description:Have Powered Up 3 pointers - P1 code:82f9c4/02 cheat description:Have Powered Up 3 pointers - P2 code:82fa6a/02 cheat description:Have Powered Up 3 pointers - P3 code:82fb10/02 cheat description:Have Powered Up 3 pointers - P4 code:82fbb6/02 cheat description:Have Infinite Turbo - P1 code:82f9c4/04 cheat description:Have Infinite Turbo - P2 code:82fa6a/04 cheat description:Have Infinite Turbo - P3 code:82fb10/04 cheat description:Have Infinite Turbo - P4 code:82fbb6/04 cheat description:Always On Fire - P1 code:82f9c4/08 cheat description:Always On Fire - P2 code:82fa6a/08 cheat description:Always On Fire - P3 code:82fb10/08 cheat description:Always On Fire - P4 code:82fbb6/08 cheat description:Have Super Dunks - P1 code:82f9c4/10 cheat description:Have Super Dunks - P2 code:82fa6a/10 cheat description:Have Super Dunks - P3 code:82fb10/10 cheat description:Have Super Dunks - P4 code:82fbb6/10 cheat description:Have Max Power - P1 code:82f9c4/20 cheat description:Have Max Power - P2 code:82fa6a/20 cheat description:Have Max Power - P3 code:82fb10/20 cheat description:Have Max Power - P4 code:82fbb6/20 cheat description:Have Powered Up Goal Tending - P1 code:82f9c4/40 cheat description:Have Powered Up Goal Tending - P2 code:82fa6a/40 cheat description:Have Powered Up Goal Tending - P3 code:82fb10/40 cheat description:Have Powered Up Goal Tending - P4 code:82fbb6/40 cheat description:Have Quick Hands - P1 code:82f9c4/80 cheat description:Have Quick Hands - P2 code:82fa6a/80 cheat description:Have Quick Hands - P3 code:82fb10/80 cheat description:Have Quick Hands - P4 code:82fbb6/80 cheat description:Have Powered Up Offense - P1 code:82f9c5/01 cheat description:Have Powered Up Offense - P2 code:82fa6b/01 cheat description:Have Powered Up Offense - P3 code:82fb11/01 cheat description:Have Powered Up Offense - P4 code:82fbb7/01 cheat description:Move very quickly - P1 code:82f9c5/02 cheat description:Move very quickly - P2 code:82fa6b/02 cheat description:Move very quickly - P3 code:82fb11/02 cheat description:Move very quickly - P4 code:82fbb7/02 cheat description:Knock down both opponents by pushing one - P1 code:82f9c5/04 cheat description:Knock down both opponents by pushing two - P2 code:82fa6b/04 cheat description:Knock down both opponents by pushing three - P3 code:82fb11/04 cheat description:Knock down both opponents by pushing four - P4 code:82fbb7/04 cheat description:Knock down opposite opponent - P1 code:82f9c5/10 cheat description:Knock down opposite opponent - P2 code:82fa6b/10 cheat description:Knock down opposite opponent - P3 code:82fb11/10 cheat description:Knock down opposite opponent - P4 code:82fbb7/10 cheat description:Have High Shots - P1 code:82f9c5/20 cheat description:Have High Shots - P2 code:82fa6b/20 cheat description:Have High Shots - P3 code:82fb11/20 cheat description:Have High Shots - P4 code:82fbb7/20 cheat description:Have Power Block - P2 code:82fa6a/01 cheat description:Have Power Block - P3 code:82fb10/01 cheat description:Have Power Block - P4 code:82fbb6/01 cheat description:Have Teleport Passes - P1 code:82f9c5/08 cheat description:Have Teleport Passes - P2 code:82fa6b/08 cheat description:Have Teleport Passes - P3 code:82fb11/08 cheat description:Have Teleport Passes - P4 code:82fbb7/08 cheat description:Start with 1 point - P1 code:82f843/ee cheat description:Start with 1 point - P2 code:82f84f/ee cartridge sha256:3ef9d4b537ea83c8ba9ec8be7aba37ddac22a71c73d0aec46fe8e5a8f5b34a7c name:NBA Jam (USA) (Rev 1) cheat description:Always On Fire - all players code:8afed6/08 cheat description:Always On Fire (alt) - all players code:8afe51/08 cheat description:Have Infinite Turbo - all players code:8afeec/08 cheat description:Have Infinite Turbo (alt) - all players code:8afe67/08 cheat description:Have Super Dunk ability - all players code:8afebd/0b cheat description:Have Super Dunk ability (alt) - all players code:8afe38/0b cheat description:Have Super Interception ability - all players code:8afe8e/0b cheat description:Have Super Interception ability (alt) - all players code:8afe09/0b cheat description:Juice mode code:8aff02/08 cheat description:Juice mode (alt) code:8afe7d/08 cheat description:Visitor's baskets worth 1 code:00a5a6/99 cheat description:Visitor's baskets worth 2 code:00a5a6/e2 cheat description:Visitor's baskets worth 3 code:00a5a6/e4 cheat description:Visitor's baskets worth 4 code:00a5a6/e5 cheat description:Visitor's baskets worth 5 code:00a5a6/e7 cheat description:Visitor's baskets worth 6 code:00a5a6/e8 cheat description:Visitor's baskets worth 7 code:00a5a6/ea cheat description:Visitor's baskets worth 8 code:00a5a6/ec cheat description:Home's baskets worth 1 code:00a78f/99 cheat description:Home's baskets worth 2 code:00a78f/e2 cheat description:Home's baskets worth 3 code:00a78f/e4 cheat description:Home's baskets worth 4 code:00a78f/e5 cheat description:Home's baskets worth 5 code:00a78f/e7 cheat description:Home's baskets worth 6 code:00a78f/e8 cheat description:Home's baskets worth 7 code:00a78f/ea cheat description:Home's baskets worth 8 code:00a78f/ec cheat description:Shot success percentages displayed for non-dunk shots code:8afea7/08 cheat description:Shot success percentages displayed for non-dunk shots (alt) code:8afe22/08 cheat description:Need 2 baskets to be On Fire code:9a9f03/02+9a9ec4/02 cheat description:Need 4 baskets to be On Fire code:9a9f03/04 cheat description:Need 5 baskets to be On Fire code:9a9f03/05 cheat description:Need 6 baskets to be On Fire code:9a9f03/06 cheat description:Need 7 baskets to be On Fire code:9a9f03/07 cheat description:Need 8 baskets to be On Fire code:9a9f03/08 cheat description:Need 9 baskets to be On Fire code:9a9f03/09 cheat description:Need 10 baskets to be On Fire code:9a9f03/0a cheat description:Need 2 baskets to stay On Fire until an opponent goes On Fire code:9a9f03/02 cheat description:Turbo bar never goes up (until next quarter) code:a7f387/00 cheat description:Turbo bar never goes up (until next quarter) (alt) code:a7f36b/00 cheat description:Turbo bar restores very slowly code:a7f387/0e cheat description:Turbo bar restores very slowly (alt) code:a7f36b/0e cheat description:Turbo bar restores much slower code:a7f387/15 cheat description:Turbo bar restores much slower (alt) code:a7f36b/15 cheat description:Turbo bar restores slower code:a7f387/1d cheat description:Turbo bar restores slower (alt) code:a7f36b/1d cheat description:Turbo bar restores faster code:a7f387/40 cheat description:Turbo bar restores faster (alt) code:a7f36b/40 cheat description:Turbo bar restores much faster code:a7f387/50 cheat description:Turbo bar restores much faster (alt) code:a7f36b/50 cheat description:Turbo bar restores extremely fast code:a7f387/81 cheat description:Turbo bar restores extremely fast (alt) code:a7f36b/81 cheat description:Turbo drains very slowly code:a7f378/04 cheat description:Turbo drains very slowly (alt) code:a7f35c/04 cheat description:Turbo drains slower code:a7f378/08 cheat description:Turbo drains slower (alt) code:a7f35c/08 cheat description:Turbo drains slightly slower code:a7f378/10 cheat description:Turbo drains slightly slower (alt) code:a7f35c/10 cheat description:Turbo drains slightly faster code:a7f378/22 cheat description:Turbo drains slightly faster (alt) code:a7f35c/22 cheat description:Turbo drains faster code:a7f378/2d cheat description:Turbo drains faster (alt) code:a7f35c/2d cheat description:Turbo drains very fast code:a7f378/38 cheat description:Turbo drains very fast (alt) code:a7f35c/38 cheat description:Always On Fire - P1 code:7e0a96/01 cheat description:Always On Fire - P2 code:7e0a96/03 cartridge sha256:0f18c496426bb97fe5e8b91ad5299f0b1c3898ac17047b745c86b167c212ab7a name:NBA Jam (USA) cheat description:Always On Fire - all players code:8afed6/08 cheat description:Always On Fire (alt) - all players code:8afe51/08 cheat description:Have Infinite Turbo - all players code:8afeec/08 cheat description:Have Infinite Turbo (alt) - all players code:8afe67/08 cheat description:Have Super Dunk ability - all players code:8afebd/0b cheat description:Have Super Dunk ability (alt) - all players code:8afe38/0b cheat description:Have Super Interception ability - all players code:8afe8e/0b cheat description:Have Super Interception ability (alt) - all players code:8afe09/0b cheat description:Juice mode code:8aff02/08 cheat description:Juice mode (alt) code:8afe7d/08 cheat description:Visitor's baskets worth 1 code:00a5a6/99 cheat description:Visitor's baskets worth 2 code:00a5a6/e2 cheat description:Visitor's baskets worth 3 code:00a5a6/e4 cheat description:Visitor's baskets worth 4 code:00a5a6/e5 cheat description:Visitor's baskets worth 5 code:00a5a6/e7 cheat description:Visitor's baskets worth 6 code:00a5a6/e8 cheat description:Visitor's baskets worth 7 code:00a5a6/ea cheat description:Visitor's baskets worth 8 code:00a5a6/ec cheat description:Home's baskets worth 1 code:00a78f/99 cheat description:Home's baskets worth 2 code:00a78f/e2 cheat description:Home's baskets worth 3 code:00a78f/e4 cheat description:Home's baskets worth 4 code:00a78f/e5 cheat description:Home's baskets worth 5 code:00a78f/e7 cheat description:Home's baskets worth 6 code:00a78f/e8 cheat description:Home's baskets worth 7 code:00a78f/ea cheat description:Home's baskets worth 8 code:00a78f/ec cheat description:Shot success percentages displayed for non-dunk shots code:8afea7/08 cheat description:Shot success percentages displayed for non-dunk shots (alt) code:8afe22/08 cheat description:Need 2 baskets to be On Fire code:9a9f03/02+9a9ec4/02 cheat description:Need 4 baskets to be On Fire code:9a9f03/04 cheat description:Need 5 baskets to be On Fire code:9a9f03/05 cheat description:Need 6 baskets to be On Fire code:9a9f03/06 cheat description:Need 7 baskets to be On Fire code:9a9f03/07 cheat description:Need 8 baskets to be On Fire code:9a9f03/08 cheat description:Need 9 baskets to be On Fire code:9a9f03/09 cheat description:Need 10 baskets to be On Fire code:9a9f03/0a cheat description:Need 2 baskets to stay On Fire until an opponent goes On Fire code:9a9f03/02 cheat description:Turbo bar never goes up (until next quarter) code:a7f387/00 cheat description:Turbo bar never goes up (until next quarter) (alt) code:a7f36b/00 cheat description:Turbo bar restores very slowly code:a7f387/0e cheat description:Turbo bar restores very slowly (alt) code:a7f36b/0e cheat description:Turbo bar restores much slower code:a7f387/15 cheat description:Turbo bar restores much slower (alt) code:a7f36b/15 cheat description:Turbo bar restores slower code:a7f387/1d cheat description:Turbo bar restores slower (alt) code:a7f36b/1d cheat description:Turbo bar restores faster code:a7f387/40 cheat description:Turbo bar restores faster (alt) code:a7f36b/40 cheat description:Turbo bar restores much faster code:a7f387/50 cheat description:Turbo bar restores much faster (alt) code:a7f36b/50 cheat description:Turbo bar restores extremely fast code:a7f387/81 cheat description:Turbo bar restores extremely fast (alt) code:a7f36b/81 cheat description:Turbo drains very slowly code:a7f378/04 cheat description:Turbo drains very slowly (alt) code:a7f35c/04 cheat description:Turbo drains slower code:a7f378/08 cheat description:Turbo drains slower (alt) code:a7f35c/08 cheat description:Turbo drains slightly slower code:a7f378/10 cheat description:Turbo drains slightly slower (alt) code:a7f35c/10 cheat description:Turbo drains slightly faster code:a7f378/22 cheat description:Turbo drains slightly faster (alt) code:a7f35c/22 cheat description:Turbo drains faster code:a7f378/2d cheat description:Turbo drains faster (alt) code:a7f35c/2d cheat description:Turbo drains very fast code:a7f378/38 cheat description:Turbo drains very fast (alt) code:a7f35c/38 cheat description:Always On Fire - P1 code:7e0a96/01 cheat description:Always On Fire - P2 code:7e0a96/03 cartridge sha256:6a7324734004d99206439430243b51a05fa8c25ffa314dafc7f127235d1a730f name:NBA Showdown (USA) cheat description:Infinite time code:80d823/ad cheat description:Infinite time-outs code:80e156/ad cheat description:No personal fouls - both teams code:82ec9b/ad cheat description:Infinite shot clock - computer code:80d444/ad cheat description:12-sec. shot clock when ball is in-bounded - P1 code:83f1eb/0c+83933c/0c+80e519/0c cheat description:12-sec. shot clock when ball is in-bounded - computer code:83f1eb/0c+828cfc/0c+82b620/0c cheat description:1-min. quarters code:86fb0b/01 cheat description:3 time-outs code:83f162/03 cartridge sha256:8ef5d5c50ffeca1e62e88e4fe2909eaf191e28fbb5a9faf98b7b10bea72c9ed9 name:NCAA Basketball (USA) (Rev 1) cheat description:Infinite time to shoot code:019473/ad cheat description:Infinite timeouts - P1 code:00d624/ad cheat description:Infinite timeouts - P2 code:00d62e/ad cheat description:Shot timer starts at 10 sec. instead of 45 code:019490/10 cheat description:Shot timer starts at 20 sec. code:019490/20 cheat description:Shot timer starts at 30 sec. code:019490/30 cheat description:Shot timer starts at 60 sec. code:019490/60 cheat description:Shot timer starts at 90 sec. code:019490/90 cheat description:3-point shots worth 0 - both players code:00ef2e/00 cheat description:3-point shots worth 1 point code:00ef2e/01 cheat description:3-point shots worth 2 points code:00ef2e/02 cheat description:3-point shots worth 4 points code:00ef2e/04 cheat description:3-point shots worth 5 points code:00ef2e/05 cheat description:3-point shots worth 6 points code:00ef2e/06 cheat description:3-point shots worth 7 points code:00ef2e/07 cheat description:3-point shots worth 8 points code:00ef2e/08 cheat description:3-point shots worth 9 points code:00ef2e/09 cheat description:P1 shots worth 1 extra point (2-pt. shots worth 3, 3-pt. shots worth 4) code:009bc9/38+009e57/38 cheat description:P2 shots worth 1 extra point (2-pt. shots worth 3, 3-pt. shots worth 4) code:009e4b/38+009bbd/38 cheat description:P1 free throws worth 2 instead of 1 code:009d01/38 cheat description:P2 free throws worth 2 code:009cf5/38 cheat description:No 5-second violations code:008c78/ad cartridge sha256:6a59115a9958d4a9fa167095505a2ddf222ca6291209d07618319e39a2be8b61 name:NFL Quarterback Club (USA) cheat description:Cannot be tackled (hold X) code:829c85/2f+829c84/a5+829c86/0a+829c87/10 cartridge sha256:f43f8ec546b8060e9d191fca860c38caf5a43eda86a304f0073647c6fad7b2c9 name:NFL Quarterback Club 96 (USA) cheat description:Cannot be tackled (hold X) code:8289ab/6e+8289aa/a5+8289ac/0a+8289ad/10 cartridge sha256:5132e1c0d466963e6adc09e8a608ebd90619ab94f7fc908d626bbaf6a99dfa19 name:NHL '94 (USA) cheat description:Score from anywhere (hold X) code:9e90af/75+9e90ae/0e+9e90b0/07+9e90b4/0f+9e90b1/10 cartridge sha256:01c0b58d5fd5d5484fea988455a55a71ed9e606538d2b3ce3f216159cc6929b0 name:NHL 95 (USA) cheat description:Score from anywhere (hold X while in the opponent's half of the rink) code:c4444c/45+c44446/c0+c4444b/a6+c44445/a5+c44447/0a+c44448/10 cartridge sha256:d24c0175ee4eafed88e277691c5f5dafd4e197723097e2eb68aa6b40f449fff2 name:NHL 96 (USA) cheat description:Score from anywhere (hold X while in the opponent's half of the rink) code:c643b0/b1+c643af/a5+c643b1/0a+c643b5/0a+c643b2/10 cartridge sha256:2a2dc2ef84efd9a773d1e8231b7e3e57f0de7e4528968670963f2f1f358eef39 name:NHL 97 (USA) cheat description:Score from anywhere (hold X while in the opponent's half of the rink) code:c64424/45+c6441e/b1+c64423/78+c6441d/a5+c6441f/0a+c64420/10 cartridge sha256:8113c2cedafc8fd5a56c8638ae340fb275f263ff5c5e18d04dc6c3ebc5cfffee name:NHL 98 (USA) cheat description:Score from anywhere (hold X while in the opponent's half of the rink) code:c6466d/47+c64667/b1+c6466c/c1+c64666/a5+c64668/0a+c64669/10 cartridge sha256:d44f487d84f5bb761955b7b70a5464b2f094e199875f595f312c88e04ac647ff name:NHL Stanley Cup (USA) (En,Fr) cheat description:Visitor starts with 1 point (exhibition mode) code:808a33/01+808a37/08+808a36/f8 cheat description:Home starts with 1 point (exhibition mode) code:808a33/01+808a37/08+808a36/fa cheat description:Visitor starts with 3 points (exhibition mode) code:808a33/03+808a37/08+808a36/f8 cheat description:Home starts with 3 points (exhibition mode) code:808a33/03+808a37/08+808a36/fa cheat description:Visitor starts with 5 points (exhibition mode) code:808a33/05+808a37/08+808a36/f8 cheat description:Home starts with 5 points (exhibition mode) code:808a33/05+808a37/08+808a36/fa cheat description:Visitor starts with 7 points (exhibition mode) code:808a33/07+808a37/08+808a36/f8 cheat description:Home starts with 7 points (exhibition mode) code:808a33/07+808a37/08+808a36/fa cheat description:Visitor starts with 9 points (exhibition mode) code:808a33/09+808a37/08+808a36/f8 cheat description:Home starts with 9 points (exhibition mode) code:808a33/09+808a37/08+808a36/fa cheat description:Visitor scores 1 point for goals, Home scores 3 code:81c861/69 cheat description:Periods are 1 min (choose 5 minutes from Options) code:80f641/01 cheat description:Periods are 3 min (choose 5 minutes from Options) code:80f641/03 cheat description:Periods are 7 min (choose 5 minutes from Options) code:80f641/07 cheat description:Periods are 9 min (choose 5 minutes from Options) code:80f641/09 cheat description:Periods are 15 min (choose 10 minutes from Options) code:80f60a/52 cheat description:Periods are 30 min (choose 10 minutes from Options) code:80f64e/03 cheat description:Penalty for charging is 1 minute instead of 2 code:81d395/3c cheat description:Penalty for holding is 1 minute instead of 2 code:81d39e/3c cheat description:Penalty for tripping is 1 minute instead of 2 code:81d3a7/3c cheat description:Penalty for high sticking is 1 minute instead of 2 code:81d3b0/3c cheat description:Penalty for elbowing is 1 minute instead of 2 code:81d3b9/3c cheat description:Penalty for hooking is 1 minute instead of 2 code:81d3c2/3c cheat description:Penalty for roughing is 1 minute instead of 2 code:81d3cb/3c cheat description:Penalty for slashing is 1 minute instead of 4 code:81d3d4/3c cheat description:Penalty for spearing is 1 minute instead of 2 code:81d3dd/3c cheat description:Penalty for charging is 30 seconds code:81d395/1e cheat description:Penalty for holding is 30 seconds code:81d39e/1e cheat description:Penalty for tripping is 30 seconds code:81d3a7/1e cheat description:Penalty for high sticking is 30 seconds code:81d3b0/1e cheat description:Penalty for elbowing is 30 seconds code:81d3b9/1e cheat description:Penalty for hooking is 30 seconds code:81d3c2/1e cheat description:Penalty for roughing is 30 seconds code:81d3cb/1e cheat description:Penalty for slashing is 30 seconds code:81d3d4/1e cheat description:Penalty for spearing is 30 seconds code:81d3dd/1e cheat description:Penalty for charging is 3 minutes code:81d395/b4 cheat description:Penalty for holding is 3 minutes code:81d39e/b4 cheat description:Penalty for tripping is 3 minutes code:81d3a7/b4 cheat description:Penalty for high sticking is 3 minutes code:81d3b0/b4 cheat description:Penalty for elbowing is 3 minutes code:81d3b9/b4 cheat description:Penalty for hooking is 3 minutes code:81d3c2/b4 cheat description:Penalty for roughing is 3 minutes code:81d3cb/b4 cheat description:Penalty for slashing is 3 minutes code:81d3d4/b4 cheat description:Penalty for spearing is 3 minutes code:81d3dd/b4 cartridge sha256:55f3432a130085c112d65aa6443c41eb7a8aeec59aad2c2b4b2ac536b604b449 name:NHLPA Hockey 93 (USA) cheat description:Period clock runs faster code:8e804c/16 cheat description:Period clock runs slower code:8e804c/04 cheat description:Period clock runs much faster code:8e804c/40 cheat description:Period clock runs much slower code:8e804c/01 cheat description:Period clock is frozen (no time limit) code:8e8052/ad cheat description:Each period lasts 1 minute instead of 10 minutes code:86fcb1/3c+86fcb2/00 cheat description:Each period lasts 2 minutes code:86fcb1/78+86fcb2/00 cheat description:Each period lasts 3 minutes code:86fcb1/b4+86fcb2/00 cheat description:Each period lasts 4 minutes code:86fcb1/f0+86fcb2/00 cheat description:Each period lasts 15 minutes code:86fcb1/84+86fcb2/03 cheat description:Each period lasts 30 minutes code:86fcb1/08+86fcb2/07 cheat description:Each period lasts 40 minutes code:86fcb1/60+86fcb2/09 cheat description:Each period lasts 60 minutes code:86fcb1/10+86fcb2/0e cheat description:All penalties last 1 minute code:80eb66/01+80eb65/a9 cheat description:All penalties last 2 minutes code:80eb66/02+80eb65/a9 cheat description:All penalties last 3 minutes code:80eb66/03+80eb65/a9 cheat description:All penalties last 4 minutes code:80eb66/04+80eb65/a9 cheat description:All penalties last 5 minutes code:80eb66/05+80eb65/a9 cheat description:All penalties last 7 minutes code:80eb66/07+80eb65/a9 cheat description:All penalties last 9 minutes code:80eb66/09+80eb65/a9 cheat description:CPU Always Pulls Goalie code:7e13f5/ff cartridge sha256:d7ad6f67860da78fe25d9e79dd13af7ac7efaa0c8e0103898a4849ab4af9e438 name:Nickelodeon GUTS (USA) cheat description:Gain lots of points in Slam Dunk / Attack levels code:7e126d/ff cartridge sha256:ce9c819d6496e58901b39d9b04558a89e09ccc3aac33690b8d02bb0406682a57 name:Nigel Mansell's World Championship Racing (USA) cheat description:Almost no tire wear (graphic distortion in the pits) code:818d9d/a5+819862/a5 cheat description:Only 1 lap required on all tracks code:80bf6a/f2 cheat description:Only 3 laps required in South Africa code:878066/02 cheat description:Only 3 laps required in Mexico code:878068/02 cheat description:Only 3 laps required in Brazil code:87806a/02 cheat description:Only 3 laps required in Spain code:87806c/02 cheat description:Only 3 laps required in San Marino code:87806e/02 cheat description:Only 3 laps required in Monaco code:878070/02 cheat description:Only 3 laps required in Canada code:878072/02 cheat description:Only 3 laps required in France code:878074/02 cheat description:Only 3 laps required in Britain code:878076/02 cheat description:Only 3 laps required in Germany code:878078/02 cheat description:Only 3 laps required in Hungary code:87807a/02 cheat description:Only 3 laps required in Belgium code:87807c/02 cheat description:Only 3 laps required in Italy code:87807e/02 cheat description:Only 3 laps required in Portugal code:878080/02 cheat description:Only 3 laps required in Japan code:878082/02 cheat description:Only 3 laps required in Australia code:878084/02 cheat description:Full season ends after South Africa code:1fe1f9/01 cheat description:Full season ends after Mexico code:1fe1f9/02 cheat description:Full season ends after Brazil code:1fe1f9/03 cheat description:Full season ends after Spain code:1fe1f9/04 cheat description:Full season ends after San Marino code:1fe1f9/05 cheat description:Full season ends after Monaco code:1fe1f9/06 cheat description:Full season ends after Canada code:1fe1f9/07 cheat description:Full season ends after France code:1fe1f9/08 cheat description:Full season ends after Britain code:1fe1f9/09 cheat description:Full season ends after Germany code:1fe1f9/0a cheat description:Full season ends after Hungary code:1fe1f9/0b cheat description:Full season ends after Belgium code:1fe1f9/0c cheat description:Full season ends after Italy code:1fe1f9/0d cheat description:Full season ends after Portugal code:1fe1f9/0e cheat description:Full season ends after Japan code:1fe1f9/0f cheat description:Start in Mexico in the Full Season code:1f89d5/01 cheat description:Start in Brazil code:1f89d5/02 cheat description:Start in Spain code:1f89d5/03 cheat description:Start in San Marino code:1f89d5/04 cheat description:Start in Monaco code:1f89d5/05 cheat description:Start in Canada code:1f89d5/06 cheat description:Start in France code:1f89d5/07 cheat description:Start in Britain code:1f89d5/08 cheat description:Start in Germany code:1f89d5/09 cheat description:Start in Hungary code:1f89d5/0a cheat description:Start in Belgium code:1f89d5/0b cheat description:Start in Italy code:1f89d5/0c cheat description:Start in Portugal code:1f89d5/0d cheat description:Start in Japan code:1f89d5/0e cheat description:Start in Australia code:1f89d5/0f cheat description:Start on extra course (stats are for South Africa but the course is different) code:1f89d5/10 cartridge sha256:fccc96af24a2463b1c53253e1c5c8ef63641355fae53c0fb410427f29743262b name:Ninja Gaiden Trilogy (USA) cheat description:(NG) Invincibility code:849f7d/80 cheat description:(NG) Infinite health code:84a3e7/a5 cheat description:(NG) Infinite lives code:84a616/a5 cheat description:(NG) Infinite time code:84bd65/00 cheat description:(NG) Start with very little time code:86afb0/96 cheat description:(NG) Start with lots of time code:86afb0/ff cheat description:(NG) Start with very little health (after first life) code:84a5fb/01 cheat description:(NG) Start with about half health (after first life) code:84a5fb/01 cheat description:(NG) Start with 1 life code:84a870/00 cheat description:(NG) Start with 5 lives code:84a870/03 cheat description:(NG) Start with 9 lives code:84a870/08 cheat description:(NGII) Invincibility code:889220/60 cheat description:(NGII) Infinite health code:889499/a5 cheat description:(NGII) Infinite lives code:888f63/a5 cheat description:(NGII) Infinite time code:888d16/a5 cheat description:(NGII) Start with very little health code:8895e8/01 cheat description:(NGII) Start with about half health code:8895e8/08 cheat description:(NGII) Start every life with two Shadow Ninjas code:88995a/0f cheat description:(NGII) Throwing stars don't use Ninja Power (ignore counter) code:88ad24/01 cheat description:(NGII) Start with 1 life code:8896ea/00 cheat description:(NGIII) Invincibility code:8ccf97/00 cheat description:(NGIII) Infinite health code:8cd2c7/a5 cheat description:(NGIII) Infinite lives code:8c8e51/a9 cheat description:(NGIII) Infinite time code:8cd53f/a5 cheat description:(NGIII) Almost infinite Ninja Power code:8cce3d/a5 cheat description:(NGIII) Start with 99 Ninja Power (ignore the counter) code:8c8ea3/63 cheat description:(NGIII) Start with 1 life code:8c8e96/00 cheat description:(NGIII) Start with 5 lives code:8c8e96/03 cheat description:(NGIII) Start with 9 lives code:8c8e96/08 cheat description:(NGIII) Start with very little health code:8c8eb0/01 cheat description:(NGIII) Start with about half health code:8c8eb0/08 cheat description:(NG) Invincibility after first hit code:7e0093/01 cheat description:(NG) Infinite Ninja Power code:7e0064/63 cheat description:(NG) Auto kill enemies that are close by code:849f92/80+849f9f/80 cheat description:(NGII) Invincibility (alt) code:7e0068/25 cheat description:(NGII) Infinite Ninja Power code:7e00ae/63 cheat description:(NGII) Always have Fireball code:7e007d/02 cheat description:(NGIII) Infinite lives (alt) code:7e00c4/03 cheat description:(NGIII) Infinite Ninja Power code:7e00cd/63 cartridge sha256:3c109e50b91ec6df3bb8509778ae544c99433fb40dda9b801178dfe513053618 name:Ninjawarriors (USA) cheat description:Invincibility code:029c4e/f0+02b701/f0+029c60/d0+029c65/d0+02b70d/d0 cheat description:Infinite health code:029842/ad cheat description:Infinite time code:00ae20/8d cheat description:Infinite specials once you obtain one code:00af9a/af cheat description:One hit kills code:038cbf/a9+038cc0/00+038cc1/00+02a3f0/a9+02a3f1/00+02a3f2/00 cartridge sha256:f099937ac4c8afb38c517c5d85475224985fb8f345dacb44994a617ea05bf4e5 name:No Escape (USA) cheat description:Infinite health code:80dec6/b7 cheat description:Infinite time code:8c962d/a9 cheat description:Infinite lives code:80dc1b/b2 cartridge sha256:7f3d0ebac6ecfb99cfd1d5b13210e989df9e8b2f2319a63c42faef8ad115a964 name:Nolan Ryan's Baseball (USA) cheat description:1 strike and batter is out code:019a10/ce cheat description:Batter never strikes out code:019a10/ad cheat description:1 ball and batter walks code:0199f2/ce cheat description:Batter never walks code:0199f2/ad cheat description:Each run worth 2 - P1 code:01cda2/38 cheat description:Each run worth 2 - P2 code:01cdb8/38 cheat description:Short game (play only odd-numbered innings) code:018e0f/38 cheat description:Increasing a player's power setting does not decrease the power number excess (use to maximize stats for a player) code:02a0bd/00 cheat description:Maximum power for a player is 32 instead of 25 code:029f1f/20 cheat description:Maximum power for a player is 40 instead of 25 code:029f1f/28 cheat description:Maximum power for a player is 48 code:029f1f/30 cartridge sha256:9712829b38f23229d4e3d65da78237659c790235f425c6b12487e4d9e9a37ae9 name:Nosferatu (USA) cheat description:Almost infinite health code:8099c5/a5 cheat description:Infinite time code:80dc32/a6 cheat description:Don't lose crystals when you get hit code:848372/ad cheat description:Start with very little health code:809fd8/01 cheat description:Start with less health code:809fd8/03 cheat description:Start with more health code:809fd8/09 cheat description:Start with a lot more health code:809fd8/0f cheat description:Start with more time code:80a2f3/a9+80a2f4/22+80a2f5/00 cheat description:Start on stage 1-2 code:809fe3/06 cheat description:Start on stage 1-3 code:809fe3/09 cheat description:Start on stage 2 code:809fe3/0a cheat description:Start on stage 2-2 code:809fe3/10 cheat description:Start on stage 2-3 code:809fe3/11 cheat description:Start on stage 2-4 code:809fe3/17 cheat description:Start on stage 3 code:809fe3/18 cheat description:Start on stage 3-2 code:809fe3/20 cheat description:Start on stage 3-3 code:809fe3/24 cheat description:Start on stage 4 code:809fe3/27 cheat description:Start on stage 4-2 code:809fe3/2d cheat description:Start on stage 4-3 code:809fe3/2e cheat description:Start on stage 4-4 code:809fe3/34 cheat description:Start on stage 5 code:809fe3/35 cheat description:Start on stage 5-2 code:809fe3/3b cheat description:Start on stage 5-3 code:809fe3/3c cheat description:Start on stage 5-4 code:809fe3/45 cheat description:Start on stage 6 code:809fe3/46 cheat description:Start on stage 6-2 code:809fe3/4e cheat description:Start on the final stage code:809fe3/54 cheat description:Start on the final stage with more crystals code:809fe3/54+809fe7/8d cheat description:View the ending code:809fe3/56 cartridge sha256:31bc862ab0a8eabf23b5124e13940cb3501e7ecdd3f15e34142248ceb4aa139a name:Obitus (USA) cheat description:Infinite health code:7e1113/20 cheat description:Infinite Stamina code:7e1117/20 cheat description:Infinite Daggers (keep off until you obtain one) code:7f132e/02 cheat description:Infinite Silver Keys (keep off until you obtain one) code:7f0ed8/02 cheat description:Infinite Gold Coins (keep off until you obtain one) code:7f0e8e/63 cartridge sha256:b766c26498d0afd63f44aefdef42642d2483b54f18d2b81a4f1d67a57f641044 name:Ogre Battle - The March of the Black Queen (USA) cheat description:Level up after every battle (even if you run away) code:04db14/00 cheat description:View 'Edit Units' screen to give everyone 2778 max HP (2000 of it won't be visible, and you won't get your HP restored. It will go down to 999 max HP if it tries to update the amount) code:02fb3d/a9+02fb42/9d+02fb43/da+02fb44/0a cheat description:View someone's stats from 'Edit Units' screen to give them max Luck code:068730/a9+068731/ff+068732/ea+068733/9f cheat description:View someone's stats from 'Edit Units' screen to give them max Cha code:06871c/a9+06871d/65+06871e/ea+06871f/9f cheat description:Every hidden thing is visible when you first enter an area code:0583c3/a9+0583c5/a9+0583c6/ff cheat description:Leader's group moves 'Sky High' code:82fd82/00 cheat description:Lans' group moves 'Sky High' code:82fd36/00 cheat description:Judgement tarot card is stronger code:03dd4d/ff cartridge sha256:e153195de7b59dd5b9854952cccca6bb93164e5fdff8292124bee6bbe5dbf16f name:On the Ball (USA) cheat description:Infinite credits code:01ccf6/ad cheat description:Faster timer code:009899/02 cheat description:Stop timer - not lap timer (can still lose time by hitting hazards) code:009899/00 cheat description:Minus blocks and bricks worth 0 (don't combine with other minus codes) code:0098cc/ad cheat description:Minus 2 second block worth 0 code:019d33/00 cheat description:Minus 2 second block worth minus 1 code:019d33/10 cheat description:Minus 2 second block worth minus 3 code:019d33/30 cheat description:Minus 2 second block worth minus 4 code:019d33/40 cheat description:Minus 2 second block worth minus 5 code:019d33/50 cheat description:Minus 2 second block worth minus 6 code:019d33/60 cheat description:Minus 2 second block worth minus 7 code:019d33/70 cheat description:Minus 2 second block worth minus 8 code:019d33/80 cheat description:Minus 2 second block worth minus 9 code:019d33/90 cheat description:Minus 5 second block worth 0 code:019d46/00 cheat description:Minus 5 second block worth minus 1 code:019d46/10 cheat description:Minus 5 second block worth minus 2 code:019d46/20 cheat description:Minus 5 second block worth minus 3 code:019d46/30 cheat description:Minus 5 second block worth minus 4 code:019d46/40 cheat description:Minus 5 second block worth minus 6 code:019d46/60 cheat description:Minus 5 second block worth minus 7 code:019d46/70 cheat description:Minus 5 second block worth minus 8 code:019d46/80 cheat description:Minus 5 second block worth minus 9 code:019d46/90 cheat description:Minus 3 second brick worth 0 code:019d59/00 cheat description:Minus 3 second brick worth minus 1 code:019d59/10 cheat description:Minus 3 second brick worth minus 2 code:019d59/20 cheat description:Minus 3 second brick worth minus 4 code:019d59/40 cheat description:Minus 3 second brick worth minus 5 code:019d59/50 cheat description:Minus 3 second brick worth minus 6 code:019d59/60 cheat description:Minus 3 second brick worth minus 7 code:019d59/70 cheat description:Minus 3 second brick worth minus 8 code:019d59/80 cheat description:Minus 3 second brick worth minus 9 code:019d59/90 cheat description:Plus bricks worth 0 (don't combine with other plus bricks codes) code:0098b7/ad cheat description:Plus 3 bricks worth 0 code:019d93/00 cheat description:Plus 3 bricks worth plus 1 code:019d93/10 cheat description:Plus 3 bricks worth plus 2 code:019d93/20 cheat description:Plus 3 bricks worth plus 4 code:019d93/40 cheat description:Plus 3 bricks worth plus 5 code:019d93/50 cheat description:Plus 3 bricks worth plus 6 code:019d93/60 cheat description:Plus 3 bricks worth plus 7 code:019d93/70 cheat description:Plus 3 bricks worth plus 8 code:019d93/80 cheat description:Plus 3 bricks worth plus 9 code:019d93/90 cheat description:Plus 5 bricks worth 0 code:019da6/00 cheat description:Plus 5 bricks worth plus 1 code:019da6/10 cheat description:Plus 5 bricks worth plus 2 code:019da6/20 cheat description:Plus 5 bricks worth plus 3 code:019da6/30 cheat description:Plus 5 bricks worth plus 4 code:019da6/40 cheat description:Plus 5 bricks worth plus 6 code:019da6/60 cheat description:Plus 5 bricks worth plus 7 code:019da6/70 cheat description:Plus 5 bricks worth plus 8 code:019da6/80 cheat description:Plus 5 bricks worth plus 9 code:019da6/90 cheat description:Start with 2 credits code:018083/01 cheat description:Start with 6 credits code:018083/05 cheat description:Start with 8 credits code:018083/07 cheat description:Start with 10 credits code:018083/09 cartridge sha256:190742792a950a112f893cba0e083eb787cf24293f698967defff929635ba0e7 name:Operation Logic Bomb - The Ultimate Search & Destroy (USA) cheat description:Infinite health code:819070/ad cheat description:Take minimal damage code:80aa8d/ee cheat description:Faster left-to-right movement code:8191d5/fd+8191cd/02 cheat description:Faster up-and-down movement code:819207/fd+8191e7/02 cheat description:Reflecting laser fire travels longer code:8194d8/60 cheat description:Reflecting laser fire travels a lot longer code:8194d8/ff cheat description:Start with 1 continue code:809924/01 cheat description:Start with 6 continues code:809924/06 cheat description:Start with 9 continues code:809924/09 cheat description:Start with tracking missiles code:809902/03+8098f0/20+809904/24 cheat description:Start with reflecting laser code:809902/04+8098f0/20+809904/24 cheat description:Start with flame thrower code:809902/05+8098f0/20+809904/24 cheat description:Start with hologram weapon code:809914/01+809918/9c+80991b/9c cheat description:Start with directional mines code:809914/02+809918/9c+80991b/9c cheat description:Infinite health (alt) code:819070/ad cheat description:Infinite weapons code:03ed4e/01 cheat description:Start with Tracking Missiles (alt) code:8098f0/20+809902/03+809904/24 cheat description:Start with Reflecting Laser (alt) code:8098f0/20+809902/04+809904/24 cheat description:Start with Flame Thrower (alt) code:8098f0/20+809902/05+809904/24 cheat description:Start with Hologram weapon (alt) code:809914/01+809918/9c+80991b/9c cheat description:Start with Directional Mines (alt) code:809914/02+809918/9c+80991b/9c cheat description:Faster left-to-right movement (alt) code:8191cd/02+8191d5/fd cheat description:Faster up-and-down movement (alt) code:8191e7/02+819207/fd cheat description:Reflecting laser fire travels a lot longer (alt) code:8194d8/ff cartridge sha256:2ec71aca4efc3791b6b3e65956df3eafd2a46e223d5ea71aead07d30ca48b6c9 name:Operation Starfi5h (Europe) cheat description:Infinite health code:7efb05/03 cheat description:Infinite lives code:7efb03/03 cartridge sha256:5cbed0401734142184166917427d24f9e5f107a7adea665e2f4b4101491ad54b name:Operation Thunderbolt (USA) cheat description:Infinite health code:7e36ea/63 cheat description:Infinite Bullets code:7e36ed/09 cheat description:Infinite Rockets code:7e36ef/09 cheat description:Infinite Clips code:7e36ee/09 cartridge sha256:0c08e6b817e4d0b333acb910a0bde3d79bd2dc188defc5df9a7c1233fa81c98d name:Oscar (USA) cheat description:Invincibility code:7e0320/03 cheat description:Invincibility (alt) code:7e05b6/ff cheat description:Infinite lives code:7e0322/0a cheat description:All Oscars found code:7e0324/00 cheat description:No Oscars to find code:7e0324/00 cheat description:Multi-jump code:7e0c7e/00+7e0c7f/00 cartridge sha256:db44f8b58a31b640a47aa4390101c3c6a5f613e4e49c636d44786278033dec19 name:Outlander (USA) cheat description:Infinite health while in the car code:808e45/ad+008e45/ad cheat description:Almost infinite health while out of the car (except when you eat poisonous food) code:90908d/a5 cheat description:Infinite handgun ammo code:90885f/00 cheat description:Infinite surface-to-air missiles on pick-up code:81b67c/ad cheat description:Car ammo worth nothing on pick-up code:908a3b/00 cheat description:Car ammo worth more on pick-up code:908a3c/02 cheat description:Water worth nothing on pick-up code:908ae3/00 cheat description:Water worth more on pick-up code:908ae4/01 cheat description:Hand gun ammo worth nothing on pick-up code:908a82/00 cheat description:Food worth nothing on pick-up code:908ac0/00 cheat description:Gas can worth nothing on pick-up code:908a11/00 cheat description:Gas can worth more on pick-up code:908a12/02 cheat description:Start with more car ammo code:81b84f/05 cheat description:Start with less car ammo code:81b84f/00 cheat description:Start with more handgun ammo code:81b854/6c cheat description:Start with less handgun ammo code:81b854/10 cheat description:Start with more fuel code:81b846/02 cartridge sha256:582548dc86598a3557e9e3c27285c81964b006a954affe5c73948da5375ea11c name:Out of this World (USA) cheat description:First three shields are infinite code:7e0d84/e7+7e0d8a/e7+7e0d90/e7 cheat description:Infinite ammo in levels that have guns code:7e0c4e/80+7e0c4f/80 cartridge sha256:54b2f03393109ac7fd36d8c7752f15a44d9607ab0187a371b853191db3592c01 name:Out to Lunch (USA) cheat description:Invincibility code:7e0002/c8 cheat description:Infinite lives code:7e0088/63 cheat description:Infinite time code:7e008a/a9 cheat description:Score modifier code:7e0009/63 cheat description:Start with Net code:7e009e/01 cheat description:Start with Bag Of Flour (choose one) code:7e009f/01 cheat description:Start with hot sauce attack (choose one) code:7e009f/02 cheat description:Start with spoon (choose one) code:7e009f/03 cheat description:Start with Cleats code:7e00a2/01 cheat description:Exit is open code:7e00be/00 cheat description:Hidden warp is open (whenever available) code:7e000b/01 cartridge sha256:10c8abce67b49f8afbe880d2f13e0fd6d5efc162df34d5941e4a94851f23b2ff name:Pac-Attack (USA) cheat description:Fairy bar is always full (normal mode) code:7e160e/ff cartridge sha256:7fe4cb9c294d66589ff78e225774471ecb7db80df25f2b6199ca25671358072b name:Pac-In-Time (USA) cheat description:Infinite health code:7e1533/bf cheat description:Infinite lives code:7e0ad5/02 cheat description:Instant exit code:7e0b03/00 cartridge sha256:4cb52ba751c42d9e12ca429e5d657622a370b608002880a997f64de453f0de20 name:Pac-Man 2 - The New Adventures (USA) cheat description:Infinite power pellets code:82b7b4/ad cheat description:Have Rope-Way and Train Pass code:7e0500/04 cheat description:Have all 3 Power Pellets code:7e0506/03 cheat description:Have all 3 Cartridges code:7e0507/07 cheat description:Have all 3 I.D. Cards code:7e0508/07 cheat description:Have Milk code:7e0509/01 cartridge sha256:46286d0839a4397fc4c067b39783f98d2aefeca870a468bae601a1434f1dde90 name:Paladin's Quest (USA) cheat description:Level 99 after one battle code:018aed/80+018af9/80 cheat description:Infinite health code:019e79/64 cheat description:Spells use up no HP code:01b3f5/64 cheat description:No money needed in toolhouse and weapon shop code:0dbaba/9c cheat description:No money needed in learning center code:07edca/9c cheat description:Spell power increases at 2x normal rate code:0188e9/04 cheat description:Spell power increases at 3x normal rate code:0188e9/06 cheat description:Chezni starts with 255 max HP code:08f691/ff cheat description:Chezni starts with 255 present HP code:08f68f/ff cheat description:Chezni starts with 40 Power, 42 Attack code:08f693/28 cheat description:Chezni starts with 60 Power, 62 Attack code:08f693/3c cheat description:Chezni starts with 42 Defense, 30 Endurance code:08f697/1e cheat description:Chezni starts with 72 Defense, 60 Endurance code:08f697/3c cheat description:Chezni starts with 30 Speed code:08f695/1e cheat description:Chezni starts with 60 Speed code:08f695/3c cheat description:Chezni starts with a bow code:08f2c5/08 cheat description:Chezni starts with a light sword code:08f2c5/0d cheat description:Chezni starts with a mid sword code:08f2c5/10 cheat description:Chezni starts with a Aybro Spear code:08f2c5/1a cheat description:Chezni starts with a heavy sword code:08f2c5/17 cheat description:Chezni starts with a wind sword code:08f2c5/30 cheat description:Chezni starts with HST code:08f2c5/34 cheat description:Chezni starts with Gomutai code:08f2c5/51 cheat description:Chezni starts with a Psych Beam code:08f2c5/72 cheat description:Chezni starts with a flame thrower code:08f2c5/73 cheat description:Chezni starts with light armor code:08f2c6/0b cheat description:Chezni starts with mid armor code:08f2c6/0f cheat description:Chezni starts with heavy armor code:08f2c6/1c cheat description:Chezni starts with storm armor code:08f2c6/31 cheat description:Chezni starts with bib code:08f2c6/33 cheat description:Chezni starts with wood boots code:08f2c7/02 cheat description:Chezni starts with long boots code:08f2c7/1b cheat description:Chezni starts with knife boots code:08f2c7/24 cheat description:Chezni starts with mid boots code:08f2c7/15 cheat description:Chezni starts with sun helm code:08f2c3/32 cheat description:Chezni starts with leather helm code:08f2c3/05 cheat description:Chezni starts with helmet code:08f2c3/0c cheat description:Chezni starts with rage helmet code:08f2c3/2c cheat description:Chezni starts with power helmet code:08f2c3/16 cheat description:Chezni starts with cosmo helmet code:08f2c3/77 cheat description:Chezni starts with gabni shield code:08f2c4/35 cheat description:Chezni starts with leather shield code:08f2c4/36 cheat description:Chezni starts with pick-axe code:08f2c4/09 cheat description:Chezni starts with gauntlet code:08f2c4/14 cheat description:Chezni starts with fire shield code:08f2c4/19 cheat description:Chezni starts with Rft shield code:08f2c4/75 cheat description:No random battles code:7e1868/09 cheat description:Infinite high gold code:7e17c3/0e cheat description:Character 1 - level 99 code:7e15fa/63 cheat description:Character 1 - 9999 current HP code:7e15fe/0f+7e15ff/27 cheat description:Character 1 - 9999 max HP code:7e1600/0f+7e1601/27 cheat description:Character 1 - 999 Power/Attack code:7e1602/e7+7e1603/03 cheat description:Character 1 - 999 SP/Attack SP code:7e1604/e7+7e1605/03 cheat description:Character 1 - 999 Defense/Endurance code:7e1606/e7+7e1607/03 cheat description:Character 1 - 999 Luck code:7e1608/e7+7e1608/03 cheat description:Character 1 - 99 available Magic code:7e160f/63 cheat description:Character 1 - 127 E Spirit code:7e1610/7f cheat description:Character 1 - 127 W Spirit code:7e1611/7f cheat description:Character 1 - 127 F Spirit code:7e1612/7f cheat description:Character 1 - 127 Sk Spirit code:7e1613/7f cheat description:Character 1 - 127 L Spirit code:7e1614/7f cheat description:Character 1 - 127 A Spirit code:7e1615/7f cheat description:Character 1 - 127 MT Spirit code:7e1616/7f cheat description:Character 1 - 127 SP Spirit code:7e1617/7f cheat description:Character 1 - 25 spells code:7e16dd/25 cheat description:Character 2 - level 99 code:7e1620/63 cheat description:Character 2 - 9999 current HP code:7e1624/0f+7e1625/27 cheat description:Character 2 - 9999 max HP code:7e1626/0f+7e1627/27 cheat description:Character 2 - 999 Power/Attack code:7e1628/e7+7e1629/03 cheat description:Character 2 - 999 SP/Attack SP code:7e162a/e7+7e162b/03 cheat description:Character 2 - 999 Defense/Endurance code:7e162c/e7+7e162d/03 cheat description:Character 2 - 999 Luck code:7e162e/e7+7e162e/03 cheat description:Character 2 - 99 available Magic code:7e1635/63 cheat description:Character 2 - 127 E Spirit code:7e1636/7f cheat description:Character 2 - 127 W Spirit code:7e1637/7f cheat description:Character 2 - 127 F Spirit code:7e1638/7f cheat description:Character 2 - 127 Sk Spirit code:7e1639/7f cheat description:Character 2 - 127 L Spirit code:7e163a/7f cheat description:Character 2 - 127 A Spirit code:7e163b/7f cheat description:Character 2 - 127 MT Spirit code:7e163c/7f cheat description:Character 2 - 127 SP Spirit code:7e163d/7f cheat description:Character 2 - 25 spells code:7e1703/25 cheat description:Character 3 - level 99 code:7e1646/63 cheat description:Character 3 - 9999 current HP code:7e164a/0f+7e164b/27 cheat description:Character 3 - 9999 max HP code:7e164c/0f+7e164d/27 cheat description:Character 3 - 999 Power/Attack code:7e164e/e7+7e164f/03 cheat description:Character 3 - 999 SP/Attack SP code:7e1650/e7+7e1651/03 cheat description:Character 3 - 999 Defense/Endurance code:7e1652/e7+7e1653/03 cheat description:Character 3 - 999 Luck code:7e1654/e7+7e1654/03 cheat description:Character 3 - 99 available Magic code:7e165b/63 cheat description:Character 3 - 127 E Spirit code:7e165c/7f cheat description:Character 3 - 127 W Spirit code:7e165d/7f cheat description:Character 3 - 127 F Spirit code:7e165e/7f cheat description:Character 3 - 127 Sk Spirit code:7e165f/7f cheat description:Character 3 - 127 L Spirit code:7e1660/7f cheat description:Character 3 - 127 A Spirit code:7e1661/7f cheat description:Character 3 - 127 MT Spirit code:7e1662/7f cheat description:Character 3 - 127 SP Spirit code:7e1663/7f cheat description:Character 3 - 25 spells code:7e1729/25 cheat description:Character 4 - level 99 code:7e166c/63 cheat description:Character 4 - 9999 current HP code:7e1670/0f+7e1671/27 cheat description:Character 4 - 9999 max HP code:7e1672/0f+7e1673/27 cheat description:Character 4 - 999 Power/Attack code:7e1674/e7+7e1675/03 cheat description:Character 4 - 999 SP/Attack SP code:7e1676/e7+7e1677/03 cheat description:Character 4 - 999 Defense/Endurance code:7e1678/e7+7e1679/03 cheat description:Character 4 - 999 Luck code:7e167a/e7+7e167a/03 cheat description:Character 4 - 99 available Magic code:7e1681/63 cheat description:Character 4 - 127 E Spirit code:7e1682/7f cheat description:Character 4 - 127 W Spirit code:7e1683/7f cheat description:Character 4 - 127 F Spirit code:7e1684/7f cheat description:Character 4 - 127 Sk Spirit code:7e1685/7f cheat description:Character 4 - 127 L Spirit code:7e1686/7f cheat description:Character 4 - 127 A Spirit code:7e1687/7f cheat description:Character 4 - 127 MT Spirit code:7e1688/7f cheat description:Character 4 - 127 SP Spirit code:7e1689/7f cheat description:Character 4 - 25 spells code:7e174f/25 cartridge sha256:7cec4ffc3eda0441561717cf55927901b5fbbd669c254079f78ca74c67c4a17b name:Paperboy 2 (USA) cheat description:Infinite papers code:00b8ba/00 cheat description:Infinite time in training course code:018438/00 cheat description:Infinite lives (game still ends when all subscriptions are canceled) code:009af9/00 cheat description:Paper bundles worth 0 if you have less than 10 code:018206/00 cheat description:Paper bundles worth 5 if you have less than 10 code:018206/05 cheat description:Paper bundles worth 20 if you have less than 10 code:018206/14 cheat description:Paper bundles worth 30 if you have less than 10 code:018206/1e cheat description:Paper bundles worth 40 if you have less than 10 code:018206/28 cheat description:Paper bundles worth 50 if you have less than 10 code:018206/32 cheat description:Continue next life with 1 paper if you had less than 10 code:00a567/01 cheat description:Continue next life with 5 papers if you had less than 10 code:00a567/05 cheat description:Continue next life with 20 papers if you had less than 10 code:00a567/14 cheat description:Continue next life with 30 papers if you had less than 10 code:00a567/1e cheat description:Continue next life with 40 papers if you had less than 10 code:00a567/28 cheat description:Continue next life with 50 papers if you had less than 10 code:00a567/32 cheat description:Start with 79 seconds instead of 39 in Week 1 training course code:0183c3/09 cheat description:Start with 59 seconds in Week 1 training course code:0183c3/07 cheat description:Start with 19 seconds in Week 1 training course code:0183c3/03 cheat description:Start with 25 papers instead of 10 code:00a087/19 cheat description:Start with 50 papers code:00a087/32 cheat description:Start with 99 papers code:00a087/63 cheat description:Start with 1 life instead of 5 - Paperboy code:009f1e/01 cheat description:Start with 3 lives - Paperboy code:009f1e/03 cheat description:Start with 7 lives - Paperboy code:009f1e/07 cheat description:Start with 9 lives - Paperboy code:009f1e/09 cheat description:Start with 25 lives - Paperboy code:009f1e/19 cheat description:Start with 50 lives - Paperboy code:009f1e/32 cheat description:Start with 99 lives - Paperboy code:009f1e/63 cheat description:Start with 1 life instead of 5 - Papergirl code:009f70/01 cheat description:Start with 3 lives - Papergirl code:009f70/03 cheat description:Start with 7 lives - Papergirl code:009f70/07 cheat description:Start with 9 lives - Papergirl code:009f70/09 cheat description:Start with 25 lives - Papergirl code:009f70/19 cheat description:Start with 50 lives - Papergirl code:009f70/32 cheat description:Start with 99 lives - Papergirl code:009f70/63 cartridge sha256:14ad9d2fb8e6bb0f49bc9e53f3c472177653d1c24102169ade308a2fab8a8888 name:Parodius Da! - Shinwa kara Owarai e (Japan) cheat description:Infinite lives code:7e0098/03 cartridge sha256:c414a4084b3d03aba19496d2efdd68fcf826194d8f1308f5c98e3a7af2fcc063 name:Peace Keepers, The (USA) cheat description:Invincibility code:80de55/ad cheat description:Infinite health code:80e063/8f+80e064/94+80e065/06+80e066/7e cheat description:One hit kills code:83daac/64 cheat description:Hit anywhere code:81ca6c/e0+81ca70/7b+81ca6d/00+81ca6e/07+81ca6f/10 cartridge sha256:5c0b5266a191852ca593235f07180e673cb79e3f0b0dd31f65808eef83bf6e90 name:PGA Tour Golf (USA) cheat description:Ball goes in from anywhere code:00b27f/80+00afa0/80 cheat description:Allow 14 clubs for full set instead of 13 code:00ee71/0d+00d4c9/0d cheat description:Allow 15 clubs for full set code:00ee71/0e+00d4c9/0e cheat description:Allow 16 clubs for full set code:00ee71/0f+00d4c9/0f cheat description:No wind code:00aeb0/80 cheat description:Constant wind of 10 mph code:00aeb0/a9+00aeb2/00+00aeb1/0a cheat description:Constant wind direction to the left code:00aec8/9c cheat description:Each round ends after hole 1 code:00cb3d/01 cheat description:Each round ends after hole 2 code:00cb3d/02 cheat description:Each round ends after hole 3 code:00cb3d/03 cheat description:Each round ends after hole 4 code:00cb3d/04 cheat description:Each round ends after hole 5 code:00cb3d/05 cheat description:Each round ends after hole 6 code:00cb3d/06 cheat description:Each round ends after hole 7 code:00cb3d/07 cheat description:Each round ends after hole 8 code:00cb3d/08 cheat description:Each round ends after hole 9 code:00cb3d/09 cheat description:Each round ends after hole 10 code:00cb3d/0a cheat description:Each round ends after hole 11 code:00cb3d/0b cheat description:Each round ends after hole 12 code:00cb3d/0c cheat description:Each round ends after hole 13 code:00cb3d/0d cheat description:Each round ends after hole 14 code:00cb3d/0e cheat description:Each round ends after hole 15 code:00cb3d/0f cheat description:Each round ends after hole 16 code:00cb3d/10 cheat description:Each round ends after hole 17 code:00cb3d/11 cartridge sha256:0663330bc061f4b768fa1806610878ef6e6cf546f36041ae087c8e55703693b8 name:Phalanx (USA) cheat description:Infinite health code:00d761/ea cheat description:Infinite lives code:00d6cb/00 cheat description:Infinite credits code:0088e1/00 cheat description:Hit anywhere code:00e240/ad+00e228/00+00e22d/00+00e219/00+00e21e/00 cheat description:Once power-up has been obtained, it is not lost until you continue (doesn't work for weapon, only power-ups) code:00d85f/ad cheat description:Power capsule restores armor to full strength code:00d6e3/50+00d6e4/83 cheat description:Power capsule has no effect on armor or power-up code:00d6e2/60 cheat description:Start with 1 credit instead of 4 code:1fc9bf/01+1fd109/01 cheat description:Start with 2 credits code:1fc9bf/02+1fd109/02 cheat description:Start with 3 credits code:1fc9bf/03+1fd109/03 cheat description:Start with 5 credits code:1fc9bf/05+1fd109/05 cheat description:Start with 7 credits code:1fc9bf/07+1fd109/07 cheat description:Start with 10 credits code:1fc9bf/10+1fd109/10 cheat description:Start with 1 life code:1fc9b3/01+1fd102/01 cheat description:Start with 2 lives code:1fc9b3/02+1fd102/02 cheat description:Start with 3 lives code:1fc9b3/03+1fd102/03 cheat description:Start with 4 lives code:1fc9b3/04+1fd102/04 cheat description:Start with 6 lives code:1fc9b3/06+1fd102/06 cheat description:Start with 11 lives code:1fc9b3/11+1fd102/11 cheat description:Start with 26 lives code:1fc9b3/26+1fd102/26 cheat description:Start with 51 lives code:1fc9b3/51+1fd102/51 cheat description:Start with 100 lives code:1fc9b3/9a+1fd102/9a cheat description:Start on mission 2 code:1fd110/02+1fc9cb/02 cheat description:Start on mission 3 code:1fd110/03+1fc9cb/03 cheat description:Start on mission 4 code:1fd110/04+1fc9cb/04 cheat description:Start on mission 5 code:1fd110/05+1fc9cb/05 cheat description:Start on mission 6 code:1fd110/06+1fc9cb/06 cheat description:Start on mission 7 code:1fd110/07+1fc9cb/07 cheat description:Start on mission 8 code:1fd110/08+1fc9cb/08 cheat description:After losing a life automatically finish level, gain 99 lives and retain all power-ups code:00d83a/ad cheat description:Infinite lives (alt) code:00d6cb/00 cartridge sha256:be1bf238d76b74bfcc0b86a899b8caedd0a49c105576c659b56045c85512a166 name:Phantom 2040 (USA) (Beta) cheat description:Invincibility after first hit code:81833e/ee cheat description:Infinite lives code:81c614/ad cheat description:Infinite weapon energy code:81c5cb/ad cheat description:Access all weapons (highlight weapon and press X to equip) code:81e798/9d cheat description:Invincibility code:7e0410/dc cheat description:Moonjump code:7e0294/06 cheat description:Have Wave Gun code:7e0cd3/01 cheat description:Have Blank Space code:7e0cd4/01 cheat description:Have Spread code:7e0cd5/01 cheat description:Have Devestator code:7e0cd6/01 cheat description:Have Homing Missile code:7e0cd7/01 cheat description:Have Breaker code:7e0cd8/01 cheat description:Have Boomerang code:7e0cd9/01 cheat description:Have Explosive Pellets code:7e0cda/01 cheat description:Have Super Explosive Pellets code:7e0cdb/01 cheat description:Have Flash Pellets code:7e0cdc/01 cheat description:Have Fire Retardant Pellets code:7e0cdd/01 cheat description:Have Shadow Panther code:7e0cde/01 cheat description:Have Invisibility code:7e0cdf/01 cheat description:Have Armor code:7e0ce0/01 cheat description:Have First Aid Kit code:7e0ce1/01 cheat description:Have Energy Aid Kit code:7e0ce2/01 cartridge sha256:b7291088f5c49e1fc55bf932076ec03f7b39f6e409ae06e884b57024c56cdc87 name:Phantom 2040 (USA) cheat description:Invincibility code:818370/ee+81836b/ee cheat description:Infinite lives code:81c718/8d cheat description:Infinite weapon energy code:81c6d6/ad cheat description:Access all weapons (highlight weapon and press X to equip) code:81e7f4/de cheat description:Invincibility (alt) code:7e0410/dc cheat description:Moonjump code:7e0294/06 cheat description:Have Wave Gun code:7e0fd3/01 cheat description:Have Blank Space code:7e0fd4/01 cheat description:Have Spread code:7e0fd5/01 cheat description:Have Devestator code:7e0fd6/01 cheat description:Have Homing Missile code:7e0fd7/01 cheat description:Have Breaker code:7e0fd8/01 cheat description:Have Boomerang code:7e0fd9/01 cheat description:Have Explosive Pellets code:7e0fda/01 cheat description:Have Super Explosive Pellets code:7e0fdb/01 cheat description:Have Flash Pellets code:7e0fdc/01 cheat description:Have Fire Retardant Pellets code:7e0fdd/01 cheat description:Have Shadow Panther code:7e0fde/01 cheat description:Have Invisibility code:7e0fdf/01 cheat description:Have Armor code:7e0fe0/01 cheat description:Have First Aid Kit code:7e0fe1/01 cheat description:Have Energy Aid Kit code:7e0fe2/01 cartridge sha256:03d0127f5de3237e22ad00de0c20763274da7b71142dde693240ac96d10983a3 name:Pilotwings (USA) cheat description:Infinite fuel code:00bd07/64 cheat description:Infinite time (disable to detach hang glider from plane) code:01bff4/00 cheat description:Reduce gravity code:80f631/20 cheat description:Increase gravity code:80f631/a0 cheat description:Increase rocket pack thrust power 3x code:00f615/fd cartridge sha256:3a52bf09850aa054dca443f7ea74d43f201dffecc40326924ecba9b0f1450e43 name:Pinball Dreams (USA) cheat description:Slow motion code:808be0/a3 cheat description:Ball attracts to the top code:80a650/6e cheat description:Ball attracts to the side code:80a610/6e cheat description:Spastic ball code:80a6a1/9f cartridge sha256:0888d20ab2f834c77b0a2dc2162c43890a1640adc78c6b0bb5892ca8d5008ad3 name:Pinball Fantasies (USA) cheat description:Infinite balls code:7e00b8/03 cartridge sha256:d0f4a5040ecf96dc49aa0084160e291a38f2ee75319750db4d6687ab36828da9 name:Pink Goes to Hollywood (USA) cheat description:Invincibility code:83924f/60+839756/60+839667/60 cheat description:Invincibility (alt) code:7e0201/ff cheat description:Infinite lives code:7e01ff/03 cheat description:Infinite time code:7e0203/09 cheat description:Have 99 tricks code:7e0217/99 cheat description:Have 9 of every token code:7e01b9/09+7e01bb/09+7e01bd/09+7e01bf/09+7e01c1/09 cartridge sha256:fe7b861504886b40207d777cfc0dce76778b5fd8e679a67d04c9ded98cd1e59e name:Pinocchio (Europe) cheat description:Infinite health code:7e03d8/28 cheat description:Infinite lives code:7e03de/03 cartridge sha256:98c51c3bb577600fe79577c323333a791baa30904f37c695890e6e380b75e3c8 name:Pinocchio (USA) cheat description:Infinite health code:7e03d8/50 cheat description:Infinite lives code:7e03de/05 cheat description:Enable level select code:7e201c/ff cartridge sha256:447dfa710e69479159e9d407474fbf5f67d3a3330ab0c7627afd123ded3fdb3a name:Pirates of Dark Water, The (USA) cheat description:Invincibility code:80b89c/ad cheat description:Health refills about every 15 seconds code:80b5df/21+80b5e0/07 cheat description:Infinite health code:80b5db/00 cheat description:Infinite health (alt) code:82df9c/8d+82df9a/a9+82df9b/58 cheat description:Infinite special attacks (no health loss) code:80c570/00 cheat description:Infinite lives code:80b546/ad cheat description:Hit anywhere code:80c24c/24+80c3cd/24+80c22d/8d+80c254/80+80c358/80+80c217/80+80c22e/37+80c22f/07+80c218/14 cheat description:One hit kills code:80c713/ea+80c714/ea+80c715/a9+80c716/7f cheat description:1/2 health after 1st hit (1st life only) code:858d74/20+838ce9/20 cheat description:Start with less health (after 1st life) code:809644/20 cheat description:Start with 6 lives (not when joining in) code:80a8b3/05 cheat description:Start with 2 lives (not when joining in) code:80a8b3/01 cartridge sha256:c2a1a66648a0a0bfe2f201cf4f926d138e410fbf85ecf436ccb9aac70c0df3de name:Pit-Fighter (USA) cheat description:Infinite super powers after gaining one code:01e2dd/00 cheat description:Executioner in match 1 has less health code:00a58c/64 cheat description:Executioner in match 1 has more health code:00a58d/01 cheat description:C.C. has less health in match 2 code:00a59c/64+00a59d/00 cheat description:C.C. has more health in match 2 code:00a59d/02 cheat description:Angel has less health in match 3 code:00a5bc/64 cheat description:Angel has more health in match 3 code:00a5bd/01 cheat description:All opponents have less health code:00bd70/a2+00bd71/00+00a58c/64 cheat description:All opponents have more health code:00bd70/a2+00bd71/00+00a58c/64+00a58d/02 cheat description:Start with more health code:019318/ff cheat description:Start with less health code:019318/32 cheat description:Start with a lot more health code:01931e/02 cheat description:Start with 3 super powers code:0194ee/03 cartridge sha256:e03d117d8b3093b0bbad5224638f85378b254b81eb304e506a732b4338802e0f name:Pitfall - The Mayan Adventure (USA) cheat description:Infinite Stones of Pacal code:81c782/00 cheat description:Infinite Sling Stones code:81c57d/00 cheat description:Infinite Boomerangs code:81c37d/00 cheat description:Walk through walls code:808623/80 cheat description:Jump through ceilings code:8089b4/80 cheat description:Get 2x energy from sacred hearts code:838092/32 cheat description:Get 3x energy from sacred hearts code:838092/4b cheat description:Sling stones do mega-damage code:81c626/32 cheat description:Time keeper power-up lasts longer code:8382a0/f0+8382a1/02 cheat description:20 Stones of Pacal on pick-up code:838101/14 cheat description:Moon-jump code:818a1f/00 cheat description:Reset game to play original Pitfall infinitely code:809575/0e cheat description:Replaces main game with original Pitfall code:83b057/0e cheat description:Start with 10 lives code:818a9b/09+83af88/09 cheat description:Start with 7 lives code:818a9b/06+83af88/06 cheat description:Start with 2 lives code:818a9b/01+83af88/01 cheat description:Invincibility and invisibility code:7e03cd/19 cheat description:Infinite health code:7e10c1/ff cheat description:Infinite lives code:7e00c0/03 cartridge sha256:72b2b3bead3fcd27a1610ad5d4d8be3235efeaff96df2e7858911992a5892d21 name:Pocky & Rocky (USA) cheat description:Infinite health - Pocky code:04ebed/a5 cheat description:Infinite health - Rocky code:04effd/a5 cheat description:Infinite time code:00d404/a9 cheat description:Infinite lives - Pocky code:01cf32/00 cheat description:Infinite lives - Rocky code:01e97e/00 cheat description:Weapons don't deplete when hit - Pocky code:04ebd8/24 cheat description:Weapons don't deplete when hit - Pocky code:04efe4/24 cheat description:Blue ball acts as red ball - Pocky code:04ea14/02 cheat description:Red ball acts as blue ball - Pocky code:04ea0b/01 cheat description:Blue ball acts as red ball - Rocky code:04ee97/02 cheat description:Red ball acts as blue ball - Rocky code:04ee8e/01 cheat description:9 lives stolen from Rocky (must have one life remaining) code:01c3c2/09 cheat description:9 lives stolen from Pocky (must have one life remaining) code:01e4c2/09 cheat description:Start with 1 life - Pocky code:008bdc/01 cheat description:Start with 6 lives - Pocky code:008bdc/06 cheat description:Start with 9 lives - Pocky code:008bdc/09 cheat description:Start with 1 life - Rocky code:008bdd/01 cheat description:Start with 6 lives - Rocky code:008bdd/06 cheat description:Start with 9 lives - Rocky code:008bdd/09 cheat description:Invincibility code:01b67f/d0+01b67d/85 cheat description:Infinite health code:7e0068/08 cheat description:Infinite time (alt) code:7e0f12/9a cheat description:Infinite lives code:7e006a/03 cheat description:Infinite Special code:7e0066/02 cheat description:Infinite Shield code:7e00e4/02 cartridge sha256:cc33ae02114ea18a86592de327b2b4bcc80728b11a5e4c61666dca71480d4169 name:Pocky & Rocky 2 (USA) cheat description:Invincibility code:039731/60+069739/60 cheat description:Infinite time code:7e7064/76 cheat description:Infinite time (alt) code:7e7064/79+7e7062/79+7e7060/79 cheat description:Infinite lives code:7e19f4/03 cheat description:Infinite Keys code:7e05b2/99 cheat description:Max Card code:7e19f6/02 cheat description:Infinite hearts when riding Spirit Dog code:7e19f2/05 cartridge sha256:000f4534a0376958edcc7ae3e6c5a7ea0dd6a775646207f60ad3923e27f110f3 name:Pop'n TwinBee - Rainbow Bell Adventures (Europe) cheat description:Infinite health code:7e02ec/64 cartridge sha256:5e580f220ed16281df8ee9a5f450b553f39f8c4078d3f3048d66bda15f98e19f name:Populous (USA) cheat description:Allows you to select any world from the Conquer screen with the B and X buttons code:00e248/00 cheat description:Your population starts at 10 instead of 3 for battles 0-4 code:0186a5/0a cheat description:Your population starts at 20 for battles 0-4 code:0186a5/14 cheat description:Your population starts at 30 for battles 0-4 code:0186a5/1e cheat description:His population starts at 10 instead of 3 for battles 0-4 code:0186a6/0a cheat description:His population starts at 20 for battles 0-4 code:0186a6/14 cheat description:His population starts at 30 for battles 0-4 code:0186a6/1e cheat description:You have no Supreme Commands available for battles 0-4 code:0186a2/00 cheat description:He has all Supreme Commands available for battles 0-4 code:0186a1/3f cheat description:Your population starts at 10 instead of 3 for battles 5-9 code:0186af/0a cheat description:Your population starts at 20 for battles 5-9 code:0186af/14 cheat description:Your population starts at 30 for battles 5-9 code:0186af/1e cheat description:His population starts at 10 instead of 3 for battles 5-9 code:0186b0/0a cheat description:His population starts at 20 for battles 5-9 code:0186b0/14 cheat description:His population starts at 30 for battles 5-9 code:0186b0/1e cheat description:You have no Supreme Commands available for battles 5-9 code:0186ac/00 cheat description:He has all Supreme Commands available for battles 5-9 code:0186ab/3f cheat description:Your population starts at 10 instead of 2 for battles 10-14 code:0186b9/0a cheat description:Your population starts at 20 for battles 10-14 code:0186b9/14 cheat description:Your population starts at 30 for battles 10-14 code:0186b9/1e cheat description:His population starts at 10 instead of 2 for battles 10-14 code:0186ba/0a cheat description:His population starts at 20 for battles 10-14 code:0186ba/14 cheat description:His population starts at 30 for battles 10-14 code:0186ba/1e cheat description:You have no Supreme Commands available for battles 10-14 code:0186b6/00 cheat description:He has all Supreme Commands available for battles 10-14 code:0186b5/3f cartridge sha256:ee9759fdb590ba908f569c2bb8a63703d282b58b84bd1fe0a472ea47685acdc5 name:Porky Pig's Haunted Holiday (USA) cheat description:Invincibility (blinking) code:02aced/a5 cheat description:Don't flash after geting hit code:02d488/00 cheat description:Don't flash as long after geting hit code:02d488/12 cheat description:Flash longer after geting hit code:02d488/ff cheat description:Cupcakes are worth 0 code:038e14/00 cheat description:Cupcakes are worth 2 code:038e14/02 cheat description:Cupcakes are worth 5 code:038e14/05 cheat description:Cupcakes are worth 10 code:038e14/0a cheat description:Cupcakes are worth 15 code:038e14/0f cheat description:Start with 1 life code:00a087/00 cheat description:Start with 7 lives code:00a087/06 cheat description:Start with 10 lives code:00a087/09 cheat description:Start with 1 heart code:00a08a/01 cheat description:Start with 2 hearts code:00a08a/02 cheat description:Start with 8 hearts code:00a08a/08 cheat description:Start with 10 hearts code:00a08a/0a cheat description:Infinite health code:7e0eaa/04 cheat description:Infinite Cupcakes code:7e0e9f/63 cheat description:Infinite lives code:7e0e9e/09 cartridge sha256:06c8fc466805f97c9147711b2d8370d4f4d05d9fa3a916f17aa1682f73c9a63b name:Power Instinct (USA) cheat description:Hit anywhere - P1 code:c4c7da/e0+c4c7dc/00+c4c7dd/f0+c4c7de/1c cartridge sha256:0288ec049723cd0c7f1148cdc1aef0b6922b8a756affe373c99d5690e0dfceaa name:Power Piggs of the Dark Age (USA) cheat description:Invincibility code:809639/60+809265/80 cheat description:Multi-jump code:808e87/24+82f8c8/07 cheat description:Partial invincibility code:7e06a4/3f cheat description:Infinite health code:7e147e/00 cheat description:Infinite lives code:7e1500/09 cheat description:Infinite Doughnuts code:7e1505/09 cheat description:Start on level Beautiful Downtown Pigg code:7e1874/00 cheat description:Start on level Dark Age Donut code:7e1874/01 cheat description:Start on level North Blowhole Forest code:7e1874/02 cheat description:Start on level Road to Wolff Castle code:7e1874/03 cartridge sha256:982a56e543995ca2221a4a58431cdeb03ac178e2874c2d6ac00be15bddc6eb02 name:Power Soukoban (Japan) cheat description:Invincibility code:81e51c/00 cartridge sha256:8f387d083de1399bb79e5312c31a6f1757f2a536bfa25cecf1aea77bfd77058b name:Prehistorik Man (USA) (En,Fr,Es) cheat description:Invincibility code:7e00b6/03 cheat description:Infinite health code:7e0558/03 cheat description:Infinite lives code:7e0556/03 cheat description:Infinite Shout code:7e056c/0a cheat description:Infinite ammo code:7e0564/99 cheat description:Level modifier (first level must be cleared before the code actually works) code:7e052a/00 cheat description:Lots of bones code:7e0560/99+7e0561/09 cheat description:Have 99 diamonds (disable after you finish the level) code:7e0814/99 cartridge sha256:55376715f243b1bacd9aeecf1092bbc7837fe512592a2c1703d24b0829fc1934 name:Primal Rage (USA) cheat description:Infinite time code:c04f1e/ad cheat description:Press down 3 times then start at the Start/Options screen for a hidden menu code:c0d67a/05 cheat description:Able to select as many credits as you want in the options screen code:c2762f/99 cheat description:Select different times in the options screen code:c06800/10 cheat description:Start with less health code:c0c27e/40 cheat description:Infinite health - P1 code:7e1926/00 cheat description:Infinite health - P2 code:7e1928/00 cheat description:One hit kills - P1 code:7e210c/01 cheat description:One hit kills - P2 code:7e210e/01 cheat description:Infinite fatality time code:7e0270/00+7e02ce/54 cheat description:Freeplay activated code:7e2114/01 cartridge sha256:494190cd6d7fd68882cbe255a6e237d9c4bdaf3988615ede0297a5e285ad5dd9 name:Prince of Persia (USA) cheat description:Invincibility against enemies code:0193c4/ad cheat description:Infinite time code:01e9d7/80+01e9d8/0a cheat description:Non-fatal injuries do no damage code:01cf83/9c cheat description:Non-fatal falls do no damage code:01aa52/2e cheat description:Non-fatal falls do 2 points of damage instead of 1 code:01aa6d/02 cheat description:Falls do no damage except spikes (if you get stuck choose End Game and use a password to start the level over) code:01aa4d/80 cheat description:Walk on air (Can walk over pits. Run to any wall to fall down or walk to the edge of any floor to climb down.) code:01abf0/80 cheat description:All enemies have 1 health point code:018b4d/ad+0180a7/01 cheat description:All enemies have 2 health points code:018b4d/ad+0180a7/02 cheat description:All enemies have 3 health points code:018b4d/ad+0180a7/03 cheat description:All enemies have 4 health points code:018b4d/ad+0180a7/04 cheat description:All enemies have 5 health points code:018b4d/ad+0180a7/05 cheat description:All enemies have 10 health points code:018b4d/ad+0180a7/0a cheat description:Enemies defeated immediately (disable on bosses) code:018b53/9c cheat description:Start with 2 health points instead of 3 code:01ed4b/02 cheat description:Start with 4 health points code:01ed4b/04 cheat description:Start with 5 health points code:01ed4b/05 cheat description:Start with 6 health points code:01ed4b/06 cheat description:Start with 7 health points code:01ed4b/07 cheat description:Start with 8 health points code:01ed4b/08 cheat description:Start with 9 health points code:01ed4b/09 cheat description:Start with 15 health points code:01ed4b/10 cheat description:Start on level 2 code:039c3a/01 cheat description:Start on level 3 code:039c3a/02 cheat description:Start on level 4 code:039c3a/03 cheat description:Start on level 5 code:039c3a/04 cheat description:Start on level 6 code:039c3a/05 cheat description:Start on level 7 code:039c3a/06 cheat description:Start on level 8 code:039c3a/07 cheat description:Start on level 9 code:039c3a/08 cheat description:Start on level 10 code:039c3a/09 cheat description:Start on level 11 code:039c3a/0a cheat description:Start on level 12 code:039c3a/0b cheat description:Start on level 13 code:039c3a/0c cheat description:Start on level 14 code:039c3a/0d cheat description:Start on level 15 code:039c3a/0e cheat description:Start on level 16 code:039c3a/0f cheat description:Start on level 17 code:039c3a/10 cheat description:Start on level 18 code:039c3a/11 cheat description:Start on level 19 code:039c3a/12 cheat description:Start on level 20 code:039c3a/13 cheat description:Cheat menu enabled (Start+Select) code:7e106f/02 cartridge sha256:04ca1a481093c4a7e12f18b33697d6e05e50e30e0f5b1655aa265abd14719bba name:Prince of Persia 2 (USA) cheat description:Infinite health code:7e0957/03 cheat description:Infinite time code:7e0b98/69 cheat description:Hit anywhere code:80f64a/24+80f64f/24+80f642/24+80f66b/24+80f636/24+80f63c/24+80f654/24+80f5c7/24 cheat description:Cheat mode enabled (level skip = Select, kills = X) code:7e0206/01 cartridge sha256:65f7123ab4fc9bad24b1976da8e84976cc6977861626a05d4e2cce132ef3fd42 name:Psycho Dream (Japan) cheat description:Invincibility (blinking) code:c09232/00 cheat description:Infinite time code:c03c19/00 cheat description:Infinite magic code:c094fc/85 cheat description:Hit anywhere code:c8070d/80+c80722/80+c80737/80+c8074c/80 cheat description:Best weapon on pick-up code:c0a03b/a9 cartridge sha256:475c9baa1c2b76a6b3119e47d32814dc1c08e84e23250ae015bb0bccea915637 name:Push-Over (USA) cheat description:Still can complete level even if time runs out code:008695/80 cheat description:Tokens aren't lost when used to undo a push code:008685/ee cheat description:Tokens aren't lost when used to advance when time runs out code:00873b/ee cheat description:Start on level 2 code:008782/a9+008785/8d+008783/01 cheat description:Start on level 3 code:008782/a9+008785/8d+008783/02 cheat description:Start on level 4 code:008782/a9+008785/8d+008783/03 cheat description:Start on level 5 code:008782/a9+008785/8d+008783/04 cheat description:Start on level 6 code:008782/a9+008785/8d+008783/05 cheat description:Start on level 7 code:008782/a9+008785/8d+008783/06 cheat description:Start on level 8 code:008782/a9+008785/8d+008783/07 cheat description:Start on level 9 code:008782/a9+008785/8d+008783/08 cheat description:Start on level 10 code:008782/a9+008785/8d+008783/09 cheat description:Start on level 11 code:008782/a9+008785/8d+008783/0a cheat description:Start on level 12 code:008782/a9+008785/8d+008783/0b cheat description:Start on level 13 code:008782/a9+008785/8d+008783/0c cheat description:Start on level 14 code:008782/a9+008785/8d+008783/0d cheat description:Start on level 15 code:008782/a9+008785/8d+008783/0e cheat description:Start on level 16 code:008782/a9+008785/8d+008783/0f cheat description:Start on level 17 code:008782/a9+008785/8d+008783/10 cheat description:Start on level 18 code:008782/a9+008785/8d+008783/11 cheat description:Start on level 19 code:008782/a9+008785/8d+008783/12 cheat description:Start on level 20 code:008782/a9+008785/8d+008783/13 cheat description:Start on level 21 code:008782/a9+008785/8d+008783/14 cheat description:Start on level 22 code:008782/a9+008785/8d+008783/15 cheat description:Start on level 23 code:008782/a9+008785/8d+008783/16 cheat description:Start on level 24 code:008782/a9+008785/8d+008783/17 cheat description:Start on level 25 code:008782/a9+008785/8d+008783/18 cheat description:Start on level 26 code:008782/a9+008785/8d+008783/19 cheat description:Start on level 27 code:008782/a9+008785/8d+008783/1a cheat description:Start on level 28 code:008782/a9+008785/8d+008783/1b cheat description:Start on level 29 code:008782/a9+008785/8d+008783/1c cheat description:Start on level 30 code:008782/a9+008785/8d+008783/1d cheat description:Start on level 31 code:008782/a9+008785/8d+008783/1e cheat description:Start on level 32 code:008782/a9+008785/8d+008783/1f cheat description:Start on level 33 code:008782/a9+008785/8d+008783/20 cheat description:Start on level 34 code:008782/a9+008785/8d+008783/21 cheat description:Start on level 35 code:008782/a9+008785/8d+008783/22 cheat description:Start on level 36 code:008782/a9+008785/8d+008783/23 cheat description:Start on level 37 code:008782/a9+008785/8d+008783/24 cheat description:Start on level 38 code:008782/a9+008785/8d+008783/25 cheat description:Start on level 39 code:008782/a9+008785/8d+008783/26 cheat description:Start on level 40 code:008782/a9+008785/8d+008783/27 cheat description:Start on level 41 code:008782/a9+008785/8d+008783/28 cheat description:Start on level 42 code:008782/a9+008785/8d+008783/29 cheat description:Start on level 43 code:008782/a9+008785/8d+008783/2a cheat description:Start on level 44 code:008782/a9+008785/8d+008783/2b cheat description:Start on level 45 code:008782/a9+008785/8d+008783/2c cheat description:Start on level 46 code:008782/a9+008785/8d+008783/2d cheat description:Start on level 47 code:008782/a9+008785/8d+008783/2e cheat description:Start on level 48 code:008782/a9+008785/8d+008783/2f cheat description:Start on level 49 code:008782/a9+008785/8d+008783/30 cheat description:Start on level 50 code:008782/a9+008785/8d+008783/31 cheat description:Start on level 51 code:008782/a9+008785/8d+008783/32 cheat description:Start on level 52 code:008782/a9+008785/8d+008783/33 cheat description:Start on level 53 code:008782/a9+008785/8d+008783/34 cheat description:Start on level 54 code:008782/a9+008785/8d+008783/35 cheat description:Start on level 55 code:008782/a9+008785/8d+008783/36 cheat description:Start on level 56 code:008782/a9+008785/8d+008783/37 cheat description:Start on level 57 code:008782/a9+008785/8d+008783/38 cheat description:Start on level 58 code:008782/a9+008785/8d+008783/39 cheat description:Start on level 59 code:008782/a9+008785/8d+008783/3a cheat description:Start on level 60 code:008782/a9+008785/8d+008783/3b cheat description:Start on level 61 code:008782/a9+008785/8d+008783/3c cheat description:Start on level 62 code:008782/a9+008785/8d+008783/3d cheat description:Start on level 63 code:008782/a9+008785/8d+008783/3e cheat description:Start on level 64 code:008782/a9+008785/8d+008783/3f cheat description:Start on level 65 code:008782/a9+008785/8d+008783/40 cheat description:Start on level 66 code:008782/a9+008785/8d+008783/41 cheat description:Start on level 67 code:008782/a9+008785/8d+008783/42 cheat description:Start on level 68 code:008782/a9+008785/8d+008783/43 cheat description:Start on level 69 code:008782/a9+008785/8d+008783/44 cheat description:Start on level 70 code:008782/a9+008785/8d+008783/45 cheat description:Start on level 71 code:008782/a9+008785/8d+008783/46 cheat description:Start on level 72 code:008782/a9+008785/8d+008783/47 cheat description:Start on level 73 code:008782/a9+008785/8d+008783/48 cheat description:Start on level 74 code:008782/a9+008785/8d+008783/49 cheat description:Start on level 75 code:008782/a9+008785/8d+008783/4a cheat description:Start on level 76 code:008782/a9+008785/8d+008783/4b cheat description:Start on level 77 code:008782/a9+008785/8d+008783/4c cheat description:Start on level 78 code:008782/a9+008785/8d+008783/4d cheat description:Start on level 79 code:008782/a9+008785/8d+008783/4e cheat description:Start on level 80 code:008782/a9+008785/8d+008783/4f cheat description:Start on level 81 code:008782/a9+008785/8d+008783/50 cheat description:Start on level 82 code:008782/a9+008785/8d+008783/51 cheat description:Start on level 83 code:008782/a9+008785/8d+008783/52 cheat description:Start on level 84 code:008782/a9+008785/8d+008783/53 cheat description:Start on level 85 code:008782/a9+008785/8d+008783/54 cheat description:Start on level 86 code:008782/a9+008785/8d+008783/55 cheat description:Start on level 87 code:008782/a9+008785/8d+008783/56 cheat description:Start on level 88 code:008782/a9+008785/8d+008783/57 cheat description:Start on level 89 code:008782/a9+008785/8d+008783/58 cheat description:Start on level 90 code:008782/a9+008785/8d+008783/59 cheat description:Start on level 91 code:008782/a9+008785/8d+008783/5a cheat description:Start on level 92 code:008782/a9+008785/8d+008783/5b cheat description:Start on level 93 code:008782/a9+008785/8d+008783/5c cheat description:Start on level 94 code:008782/a9+008785/8d+008783/5d cheat description:Start on level 95 code:008782/a9+008785/8d+008783/5e cheat description:Start on level 96 code:008782/a9+008785/8d+008783/5f cheat description:Start on level 97 code:008782/a9+008785/8d+008783/60 cheat description:Start on level 98 code:008782/a9+008785/8d+008783/61 cheat description:Start on level 99 code:008782/a9+008785/8d+008783/62 cartridge sha256:ba135ad37fef9932c2f840cf6cf82d559c232dfe0f85ba068a34755f3ad5f778 name:Putty Squad (Europe) cheat description:Infinite health code:7e0026/4e cheat description:Infinite lives code:7e0035/99 cheat description:99 Stars code:7e004f/99 cheat description:All Putties saved code:7e0024/00 cartridge sha256:89d57bf308033ef17f770a80080cbeed2d112244635d5b5f860f2016398cd2f6 name:Q-bert 3 (USA) cheat description:Infinite lives code:00a776/ad cheat description:Start with 1 life instead of 5 code:00808c/01 cheat description:Start with 3 lives code:00808c/03 cheat description:Start with 7 lives code:00808c/07 cheat description:Start with 9 lives code:00808c/09 cheat description:Start with 25 lives code:00808c/19 cheat description:Start with 100 lives code:00808c/64 cheat description:Start on level 1-2 code:00806e/01 cheat description:Start on level 1-3 code:00806e/02 cheat description:Start on level 1-4 code:00806e/03 cheat description:Start on level 2-1 code:00806e/04 cheat description:Start on level 2-2 code:00806e/05 cheat description:Start on level 2-3 code:00806e/06 cheat description:Start on level 2-4 code:00806e/07 cheat description:Start on level 3-1 code:00806e/08 cheat description:Start on level 3-2 code:00806e/09 cheat description:Start on level 3-3 code:00806e/0a cheat description:Start on level 3-4 code:00806e/0b cheat description:Start on level 4-1 code:00806e/0c cheat description:Start on level 4-2 code:00806e/0d cheat description:Start on level 4-3 code:00806e/0e cheat description:Start on level 4-4 code:00806e/0f cheat description:Start on level 5-1 code:00806e/10 cheat description:Start on level 5-2 code:00806e/11 cheat description:Start on level 5-3 code:00806e/12 cheat description:Start on level 5-4 code:00806e/13 cheat description:Start on level 6-1 code:00806e/14 cheat description:Start on level 6-2 code:00806e/15 cheat description:Start on level 6-3 code:00806e/16 cheat description:Start on level 6-4 code:00806e/17 cheat description:Start on level 7-1 code:00806e/18 cheat description:Start on level 7-2 code:00806e/19 cheat description:Start on level 7-3 code:00806e/1a cheat description:Start on level 7-4 code:00806e/1b cheat description:Start on level 8-1 code:00806e/1c cheat description:Start on level 8-2 code:00806e/1d cheat description:Start on level 8-3 code:00806e/1e cheat description:Start on level 8-4 code:00806e/1f cheat description:Start on level 9-1 code:00806e/20 cheat description:Start on level 9-2 code:00806e/21 cheat description:Start on level 9-3 code:00806e/22 cheat description:Start on level 9-4 code:00806e/23 cheat description:Start on level 10-1 code:00806e/24 cheat description:Start on level 10-2 code:00806e/25 cheat description:Start on level 10-3 code:00806e/26 cheat description:Start on level 10-4 code:00806e/27 cheat description:Start on level 11-1 code:00806e/28 cheat description:Start on level 11-2 code:00806e/29 cheat description:Start on level 11-3 code:00806e/2a cheat description:Start on level 11-4 code:00806e/2b cheat description:Start on level 12-1 code:00806e/2c cheat description:Start on level 12-2 code:00806e/2d cheat description:Start on level 12-3 code:00806e/2e cheat description:Start on level 12-4 code:00806e/2f cheat description:Start on level 13-1 code:00806e/30 cheat description:Start on level 13-2 code:00806e/31 cheat description:Start on level 13-3 code:00806e/32 cheat description:Start on level 13-4 code:00806e/33 cheat description:Start on level 14-1 code:00806e/34 cheat description:Start on level 14-2 code:00806e/35 cheat description:Start on level 14-3 code:00806e/36 cheat description:Start on level 14-4 code:00806e/37 cheat description:Start on level 15-1 code:00806e/38 cheat description:Start on level 15-2 code:00806e/39 cheat description:Start on level 15-3 code:00806e/3a cheat description:Start on level 15-4 code:00806e/3b cheat description:Start on level 16-1 code:00806e/3c cheat description:Start on level 16-2 code:00806e/3d cheat description:Start on level 16-3 code:00806e/3e cheat description:Start on level 16-4 code:00806e/3f cheat description:Start on level 17-1 code:00806e/40 cheat description:Start on level 17-2 code:00806e/41 cheat description:Start on level 17-3 code:00806e/42 cheat description:Start on level 17-4 code:00806e/43 cheat description:Start on level 18-1 code:00806e/44 cheat description:Start on level 18-2 code:00806e/45 cheat description:Start on level 18-3 code:00806e/46 cheat description:Start on level 18-4 code:00806e/47 cheat description:Start on level 19-1 code:00806e/48 cheat description:Start on level 19-2 code:00806e/49 cheat description:Start on level 19-3 code:00806e/4a cheat description:Start on level 19-4 code:00806e/4b cheat description:Start on level 20-1 code:00806e/4c cheat description:Start on level 20-2 code:00806e/4d cheat description:Start on level 20-3 code:00806e/4e cheat description:Start on level 20-4 code:00806e/4f cheat description:Start on level x1 code:00806e/50 cheat description:Start on level x2 code:00806e/51 cheat description:Start on level x3 code:00806e/52 cheat description:Start on level x4 code:00806e/53 cheat description:Start on level x5 code:00806e/54 cheat description:Start on level x6 code:00806e/55 cheat description:Start on level x7 code:00806e/56 cheat description:Start on level x8 code:00806e/57 cheat description:Start on level x9 code:00806e/58 cheat description:Start on level x10 code:00806e/59 cheat description:Start on level x11 code:00806e/5a cheat description:Start on level x12 code:00806e/5b cheat description:Start on level x13 code:00806e/5c cheat description:Start on level x14 code:00806e/5d cheat description:Start on level x15 code:00806e/5e cheat description:Start on level x16 code:00806e/5f cheat description:Start on level x17 code:00806e/60 cheat description:Start on level x18 code:00806e/61 cheat description:Start on level x19 code:00806e/62 cheat description:Start on level x20 code:00806e/63 cartridge sha256:4d6c7d6d2693d8d43bafaff7582f9a94885362dadd9ee4012bbbdce1ba10c30e name:R-Type III (USA) cheat description:Invincibility code:b083d8/00 cheat description:Infinite lives code:81829c/ad cheat description:Start at speed level 3 code:b0821d/0c cheat description:Start at speed level 4 code:b0821d/10 cheat description:Start at speed level 5 code:b0821d/14 cartridge sha256:edf990e502c646a2fe83fcd1d359ca0ed5003ace06cb4c3de5a51a0c56d6ec54 name:Radical Psycho Machine Racing (USA) cheat description:Sturdy tires are free code:019dba/00 cheat description:4-liter high output engine is free code:019d66/00 cheat description:Sell sturdy tires for $4,910 instead of $10 code:019dc7/49 cheat description:Sell 4-liter high output engine for $9,925 instead of $25 code:019d73/99 cheat description:Start new game with $9,910 instead of $4,910 code:01a896/99 cheat description:Start new game with $49,104,910 code:01a89d/8d cheat description:Start new game with $99,109,910 code:01a896/99+01a89d/8d cartridge sha256:dd0feb78e2d5d81f59241baf3bca5e2edaebbe98f0ac860a4eb6d448718f1ca5 name:Race Drivin' (USA) cheat description:Infinite time code:00818f/cd cheat description:Slow timer code:008188/b4 cheat description:Fast timer code:008188/2d cheat description:Freeze lap timer code:0081af/d9 cheat description:Slow lap timer code:0081b3/65 cartridge sha256:1869c0faf93bf21b7ff965f1925fad4b2924a64b1e48f4837221eebdf741226c name:Radical Rex (USA) cheat description:Infinite health code:819a28/b5 cheat description:Infinite roar code:81bda4/ad+00a85f/ad cheat description:Infinite lives code:84db61/ad cheat description:Don't loose breath level when you die code:8098d1/ad+8098c5/ad cartridge sha256:5fd7666e509f9d3cf1fd6b209dc22f2f3848f74eae7b83239d1090e031fc6df2 name:Raiden Trad (USA) cheat description:Invincibility - both players code:0af515/00 cheat description:Infinite bombs - P1 code:00fabf/f0+00fac0/05+00fac1/ea+00fac3/de cheat description:Infinite bombs - P2 code:00fabf/d0+00fac0/05+00fac1/ea+00fac3/de cheat description:Infinite bombs - both players code:00fac2/ea cheat description:Infinite lives - P1 code:009c00/ea cheat description:Infinite lives - P2 code:009d7a/ea cheat description:Hit anywhere code:0af2b8/22+0af2b7/80+0af2e8/a5 cheat description:Replacement planes carry 0 bombs - P1 code:009c34/af+009c35/8d cheat description:Replacement planes carry 6 bombs - P1 code:009c34/56+009c35/89 cheat description:Replacement planes carry 9 bombs - P1 code:009c34/b1+009c35/8d cheat description:Replacement planes carry 0 bombs - P2 code:009dad/af+009dae/8d cheat description:Replacement planes carry 6 bombs - P2 code:009dad/56+009dae/89 cheat description:Replacement planes carry 9 bombs - P2 code:009dad/b1+009dae/8d cheat description:Start with 1 life - both players code:00940e/98 cheat description:Start with 7 lives - both players code:00940d/b9+00940e/84 cheat description:Start with 9 lives - both players code:00940d/b1+00940e/8d cheat description:Start with 0 bombs - P1 code:00941f/af+009420/8d cheat description:Start with 6 bombs - P1 code:00941f/56+009420/89 cheat description:Start with 9 bombs - P1 code:00941f/b1+009420/8d cheat description:Start with 0 bombs - P2 code:00943c/af+00943d/8d cheat description:Start with 6 bombs - P2 code:00943c/56+00943d/89 cheat description:Start with 9 bombs - P2 code:00943c/b1+00943d/8d cheat description:Start with 3 credits code:009616/02 cheat description:Start with 4 credits code:009616/03 cheat description:Start with 6 credits code:009616/05 cheat description:Start with 8 credits code:009616/07 cheat description:Start with 10 credits code:009616/09 cheat description:Start with 1 credit code:009616/00 cartridge sha256:e19f7d8d5c3e4cefeff5889380d8780495e01f0553d13be4182a15a5d4b615bb name:Rampart (USA) cheat description:Infinite continues code:00bc21/ad cheat description:Infinite cannons code:008c9a/ea cheat description:Start on battlefield 2 code:00c2cc/a9+00c2ce/00+00c2cd/01 cheat description:Start on battlefield 3 code:00c2cc/a9+00c2ce/00+00c2cd/02 cheat description:Start on battlefield 4 code:00c2cc/a9+00c2ce/00+00c2cd/03 cheat description:Start on battlefield 5 code:00c2cc/a9+00c2ce/00+00c2cd/04 cheat description:Start on battlefield 6 code:00c2cc/a9+00c2ce/00+00c2cd/05 cheat description:Start on battlefield 7 code:00c2cc/a9+00c2ce/00+00c2cd/06 cartridge sha256:32d32ef56af83887cdc2c04b3da4be1cd82a473988deaa2e7dd50d38ef79c3a1 name:Ranma 1-2 - Hard Battle (USA) cheat description:Invincibility - P1 code:c0237c/80 cheat description:Invincibility - P2 code:c023df/80 cheat description:Hit anywhere - P1 code:c023df/80+c023e0/12 cheat description:Hit anywhere - P2 code:c0237c/80+c0237d/12 cheat description:Ranma moves faster code:019523/03+019518/fc cheat description:Ranma jumps faster code:01953c/fb+01953e/04 cheat description:Ranma's diagonal jumps are higher code:01953e/f6 cheat description:Ranma's diagonal kicks are harder code:019332/18 cheat description:Ranma's dragon blast kills with 1 hit code:019468/60 cheat description:Genma moves faster code:01be10/03+01bc04/fc cheat description:Genma's paternal anger (running at enemy) is faster code:01bea0/f2 cheat description:Genma's verbal punishment is stronger code:01bd5a/28 cheat description:Genma's verbal punishment kills with 1 hit code:01bd5a/60 cheat description:Ryoga moves faster code:01b26e/fc+01927a/03 cheat description:Ryoga jumps faster code:01b292/fc+01b29e/03 cheat description:Ryoga's bandana throw kills with 1 hit code:7f0cb1/60 cheat description:Shampoo moves faster code:01ac5e/fc+01ac6a/03 cheat description:Shampoo's dragon sky kick is faster code:01ad1e/f5 cheat description:Shampoo's super fury charge goes farther code:01acfa/f5 cheat description:Shampoo's fury charge 1 hit kill code:01ab9b/60 cheat description:Shampoo's kick is faster code:01aa7c/26 cheat description:Akane moves faster code:01b828/fc+01b834/03 cheat description:Akane jumps faster code:01b84c/fb+01b25e/04 cheat description:Akane's 2-step whip kick is faster code:01b8f4/f8 cheat description:Akane's 2-step whip kick is stronger code:01b692/26 cheat description:Akane's 2-step whip kick kills with 1 hit code:01b692/60 cheat description:Akane's dust devil uppercut is faster code:01b8c6/ef+01b8c9/ff cheat description:Gosunkugi moves faster code:01a678/fa+01a684/04 cheat description:Gosunkugi jumps faster code:01a69c/fb+01a6a8/04 cheat description:Gosunkugi's straw man throw does more damage code:7f0cb1/24 cheat description:Gosunkugi's straw man throw kills with 1 hit code:7f0cb1/60 cheat description:Ukkyo moves faster code:019ab8/fa+019ac4/04 cheat description:Ukkyo jumps faster code:019adc/fb+019ae8/04 cheat description:Mousse's flying egg bombs are faster code:01a174/f9 cheat description:Mousse's eagle claw strike - 1 hit kill code:019f66/60 cheat description:Mousse's claw strike is quicker code:01a16a/08 cheat description:Every move kills every opponent with 1 hit code:c00e39/00 cheat description:No knock back when opponent is cornered code:01809d/00 cartridge sha256:097cbe9720903bc14599158b80e0cc314ef2fe8a585d6d0a8962eb1626031492 name:Realm (USA) cheat description:Infinite ammo code:80ff23/a5 cheat description:Hit anywhere (if a platform is missing go back and come back) code:80ad95/46+80ae99/64+80ad94/d0+80ade7/bd+80ade8/1c cheat description:Invincibility code:7e007d/4f cheat description:Invincibility after first hit code:80dcb3/a5+80dd00/a5 cheat description:Almost invincible + enable stage skip (press Start + Select to skip) (enable code before title screen) code:98868c/f0 cheat description:Almost invincible + enable stage skip (press Start + Select to skip) (enable code before title screen) (alt) code:7e0224/ff cheat description:Infinite health code:89fc95/ad cheat description:Infinite health (alt) code:7e132b/06 cheat description:Infinite lives code:87ed80/ad cheat description:Infinite lives (alt) code:7e1334/03 cheat description:Infinite ammo (alt) code:7e00f5/09 cartridge sha256:549f2e5b17f685cad25ba71ce7bc6e004e7bfd09e6be12a827af9a9a26556fff name:Redline F-1 Racer (USA) cheat description:Always in 1st place code:00b6f4/a5 cheat description:Infinite special fuel code:00cbc5/ea cheat description:Instant 255 mph speed (best to get into 6th gear before activating this code, then you can go 357 mph) code:00a47d/a9+00a47f/ff cheat description:No speed loss when you get off accelerator button code:00b6a5/a5 cheat description:No speed loss on grass code:009905/a5 cartridge sha256:71e7083cfcf32b738f60f5eeffd4f9d1fd9250afbde0c56e22a4b97abac377a1 name:Ren & Stimpy Show, The - Fire Dogs (USA) cheat description:Invincibility code:7e257e/05 cheat description:Infinite health code:7e00e3/30 cheat description:Infinite lives code:7e0002/09 cheat description:Infinite time (disable on bonus stages) code:7e00f5/3b cheat description:Max money code:7e0004/e7+7e0005/03 cheat description:Infinite Dalmation Paint meter code:7e0055/ee cheat description:Infinite Fire Extinguisher meter code:7e0059/ee cheat description:Have Boots code:7e2584/01 cheat description:Have Bucket code:7e2586/01 cheat description:Have Fire Coat code:7e2590/01 cheat description:Have Fire Hat code:7e258c/01 cheat description:Have Fire Hose code:7e2582/01 cheat description:Have Fire Extinguisher code:7e2590/01 cheat description:Have Socks code:7e258a/01 cheat description:Have Trampoline code:7e2588/01 cheat description:Have 99 sacks of Gritty Kitty (On The Job stages) code:7e2550/63 cheat description:Skip to bonus level (On The Job stages) code:7e07ae/93+7e07af/20 cartridge sha256:ad7dd4efb8836d4009f6c76bd21865d8f5dcf9c3cbd8fa7bb32d686488847120 name:Ren & Stimpy Show, The - Time Warp (USA) cheat description:Infinite health code:82f000/bd cheat description:Infinite lives code:82996b/ea cheat description:Don't have to charge special attack code:829cfa/a9+829cfc/80+829cfe/00+829cff/8d cheat description:Flash longer after you die code:83e5e6/ff cheat description:Don't flash after you die code:83e5e6/ff cheat description:Health never goes back up code:82f3c8/bd cheat description:1 kitty gritty gives 99 code:82f419/a9+82f41a/63+82f41c/ea+82f41d/ea cheat description:Start with 1 lives code:83e5c3/00 cheat description:Start with 5 lives code:83e5c3/04 cheat description:Start with 10 lives code:83e5c3/09 cheat description:Have 99 kitty gritty code:7e0583/63 cartridge sha256:ba54d715abf100b94fee801351986fa818e4309730cefbacf9b4fad36e284c1c name:Ren & Stimpy Show, The - Veediots! (USA) cheat description:Infinite health code:01a107/ad cheat description:Infinite lives code:01a17a/ad cheat description:Infinite time code:01a41f/ad cheat description:Powdered Toast Shield lasts 85x longer code:02f2b0/ff cheat description:"Socks" power-up lasts 200x longer code:02f41f/ff cheat description:Stimpy's mouth won't close code:01a574/ad cheat description:Money is worth 10x more code:019ea3/fa+01cc93/fa cartridge sha256:82a9ee11b5640409c67772363f1148517b26127cef13aa2a8ffc2480b487d81f name:Rendering Ranger R2 (Japan) cheat description:Invincibility code:7e06ae/03 cheat description:Infinite health code:7e06bc/05 cheat description:Infinite lives code:7e0515/09 cheat description:Infinite Bombs code:7e06c1/03 cheat description:Deactivate shield code:7e06b8/00 cheat description:Have Pods (ship stages) code:7e06b5/01 cheat description:Have Blue weapon (press A to switch weapons) code:7e0aa2/00 cheat description:Have Green weapon (press A to switch weapons) code:7e0aa3/00 cheat description:Have Yellow weapon (press A to switch weapons) code:7e0aa4/00 cheat description:Best Red weapon code:7e0a9d/04 cheat description:Best Blue weapon code:7e0a9e/04 cheat description:Best Green weapon code:7e0a9f/04 cheat description:Best Yellow weapon code:7e0aa0/04 cartridge sha256:b61addb0abd36ebd29e5c2988ae642b174bfec18a899cfe40866000dc934f658 name:Return of Double Dragon (Japan) cheat description:Invincibility (blinking) code:7e1f92/01 cartridge sha256:5fb072c3c2e9d8e7f84bea9c4bf2253e6868eb2b1f13e35a7d75fdf05896d873 name:Revolution X (USA) cheat description:Infinite CDs - both players code:80c040/a9 cheat description:Infinite health - P1 code:7e022b/ff cheat description:Infinite CDs - P1 code:7e0088/ff cartridge sha256:f44482e2cccd9fcfd5875d84ff700f6e783f3bd8abd1ac4d939074cd6ad3fe65 name:Rex Ronan - Experimental Surgeon (USA) (En,Es) cheat description:Infinite health code:7e03c4/ff cartridge sha256:38be8013bbe07b2020ba30031fb0a2c77bad8a3eb61fac8217adfe82d6c402af name:Rise of the Robots (USA) cheat description:Infinite time code:c0cdae/00 cheat description:Hit anywhere - both players code:c0ac6c/00+c0ac72/00+c0ac93/00 cheat description:One hit kills - both players code:c0e52d/a9 cheat description:No jumping allowed code:c0cbd8/a9+c0cbd9/00 cheat description:Win one round to advance code:c035bf/01 cheat description:Every hit does more damage code:c0e52e/20+c0af3b/ea+c0e52f/00 cartridge sha256:3f59cc687d22cd1b23cc33ae6e4518234c9da813c01f79f4c43716e12d32a12d name:Rival Turf! (USA) cheat description:Invincibility code:1e9413/ad cheat description:Infinite health code:028870/a5 cheat description:Infinite lives code:0289a3/a5 cheat description:Infinite continues code:00a1e5/ad cheat description:Full health from all food code:018bc2/00 cheat description:No score lost when special attack is used code:0283df/00 cheat description:Hit anywhere (might make some enemies invisible) code:1f9287/80+1f9288/15 cheat description:Start with more health code:f80b0e/00+028a2a/ff+008deb/ff+018bbf/ff cheat description:Start with less health code:00a522/1f+028a2a/1f+008deb/1f+018bbf/1f cheat description:Start with 1 life code:009c3b/00 cheat description:Start with 8 lives code:009c3b/07 cheat description:Start with 9 continues code:009c45/09 cheat description:Start with 1 continue code:009c45/01 cheat description:Invincibility - P1 code:7e0208/ff cheat description:Invincibility - P2 code:7e02d8/ff cheat description:Infinite health - P1 code:7e0217/ff cheat description:Infinite health - P2 code:7e02e7/ff cheat description:Infinite lives - P1 code:7e023f/09 cheat description:Infinite lives - P2 code:7e030f/09 cheat description:Infinite continues (alt) code:7e10f5/05 cheat description:Always angry - P1 code:7e024f/03 cheat description:Always angry - P2 code:7e031f/03 cheat description:One hit kills code:7e0487/00+7e0557/00+7e024f/00+7e03b7/00 cheat description:Infinite points - P1 code:7e0224/70 cheat description:Infinite points - P2 code:7e02f4/70 cheat description:Start on stage 2 - L.A. City Stadium code:7e0120/01 cheat description:Start on stage 3 - Things Are Looking Up code:7e0120/02 cheat description:Start on stage 4 - South Of The Border code:7e0120/03 cheat description:Start on stage 5 - Dockyard Brawl code:7e0120/04 cheat description:Start on stage 6 - Fight to the Finish code:7e0120/05 cheat description:Start on stage - Welcome To The Warp Room code:7e0120/06 cartridge sha256:864aa9068fb23cd20022a9ac36fb9082299278ea0cb07a20deec2b6a1c6cbc70 name:Road Riot 4WD (USA) cheat description:Races are 1 lap instead of 3 code:00951c/00 cheat description:Races are 2 laps instead of 3 code:00951c/01 cheat description:Races are 4 laps instead of 3 code:00951c/03 cheat description:Races are 5 laps instead of 3 code:00951c/04 cheat description:Races are 6 laps instead of 3 code:00951c/05 cheat description:Races are 7 laps instead of 3 code:00951c/06 cheat description:Beginner track has an extra lap code:009523/ea cartridge sha256:2e8203e421f97cf165f03a5d4f69dadf0bcca18c42c6a1dfe79c8705c522cc54 name:Road Runner's Death Valley Rally (USA) cheat description:Protection against most hazards code:80c7aa/ad+86ade3/ad cheat description:Infinite lives code:8098d2/00 cheat description:Infinite time code:809c9a/00 cheat description:Stay invincible longer after getting hit (Road Runner blinks) code:80b2a8/ff cheat description:Stay invincible for less time after getting hit (Road Runner blinks) code:80b2a8/40 cheat description:Stay invincible after getting hit until you fall and die (Road Runner blinks) code:80a67f/ad cheat description:Stay invincible after getting hit until you fall and die (Road Runner does not blink) code:80a67d/80 cheat description:Eating birdseed restores turbo speed meter to maximum code:80db89/30 cheat description:Eating birdseed does nothing code:80db89/00 cheat description:Using turbo speed does not use up bird seed code:80af82/00 cheat description:Hearts worth nothing code:80de5d/ad cheat description:1-up worth nothing code:80e0e0/00 cheat description:1-up worth 2 code:80e0e0/02 cheat description:1-up worth 3 code:80e0e0/03 cheat description:1-up worth 4 code:80e0e0/04 cheat description:1-up worth 5 code:80e0e0/05 cheat description:Bogus jump code:80b0ec/30 cheat description:Better jump code:80b0ec/10 cheat description:Super-jump code:80b0ec/0a cheat description:Mega-jump code:80b0ec/05 cheat description:Start with more birdseed on the turbo speed meter code:809c08/30 cheat description:Start with less birdseed on the turbo speed meter code:809c08/10 cheat description:Start timer at 3:00 instead of 5:00 code:80974a/03 cheat description:Start timer at 7:00 code:80974a/07 cheat description:Start timer at 9:00 code:80974a/09 cheat description:Start with 2 lives code:809ba4/01 cheat description:Start with 4 lives code:809ba4/03 cheat description:Start with 6 lives code:809ba4/05 cheat description:Start with 8 lives code:809ba4/07 cheat description:Start with 10 lives code:809ba4/09 cheat description:Start with 21 lives code:809ba4/20 cheat description:Start with 51 lives code:809ba4/50 cheat description:Start with 76 lives code:809ba4/75 cheat description:Start with 100 lives code:809ba4/99 cheat description:Start on level 1, sub-level 2 code:809b97/1e+809b96/e1+809b94/01 cheat description:Start on level 1, sub-level 3 code:809b97/1e+809b96/e1+809b94/02 cheat description:Start on level 1, sub-level 4 code:809b97/1e+809b96/e1+809b94/03 cheat description:Start on level 2, sub-level 1 code:809b97/1e+809b96/e1+809b94/04 cheat description:Start on level 2, sub-level 2 code:809b97/1e+809b96/e1+809b94/05 cheat description:Start on level 2, sub-level 3 code:809b97/1e+809b96/e1+809b94/06 cheat description:Start on level 2, sub-level 4 code:809b97/1e+809b96/e1+809b94/07 cheat description:Start on level 3, sub-level 1 code:809b97/1e+809b96/e1+809b94/08 cheat description:Start on level 3, sub-level 2 code:809b97/1e+809b96/e1+809b94/09 cheat description:Start on level 3, sub-level 3 code:809b97/1e+809b96/e1+809b94/0a cheat description:Start on level 3, sub-level 4 code:809b97/1e+809b96/e1+809b94/0b cheat description:Start on level 4, sub-level 1 code:809b97/1e+809b96/e1+809b94/0c cheat description:Start on level 4, sub-level 2 code:809b97/1e+809b96/e1+809b94/0d cheat description:Start on level 4, sub-level 3 code:809b97/1e+809b96/e1+809b94/0e cheat description:Start on level 4, sub-level 4 code:809b97/1e+809b96/e1+809b94/0f cheat description:Start on level 5, sub-level 1 code:809b97/1e+809b96/e1+809b94/10 cheat description:Start on level 5, sub-level 2 code:809b97/1e+809b96/e1+809b94/11 cheat description:Start on level 5, sub-level 3 code:809b97/1e+809b96/e1+809b94/12 cheat description:Start on level 5, sub-level 4 code:809b97/1e+809b96/e1+809b94/13 cartridge sha256:a2115e7576dec06e0de613efb89de861815a78ef72e78a3784be09fb7541928f name:RoboCop versus The Terminator (USA) cheat description:Infinite lives code:019df1/00 cheat description:Super-jump code:80ee38/00 cheat description:Rockets do more damage code:8182ea/0f cheat description:Normal pistol does more damage code:81804a/0f cheat description:Plasma Rifle does massive damage code:818185/30 cheat description:Only 10 Terminators to kill on the 3-D Stage code:80842a/10 cheat description:Only 30 Terminators to kill on the 3-D Stage code:80842a/30 cheat description:Start with 1 life code:8092e1/01 cheat description:Start with 9 lives code:8092e1/09 cheat description:Start with 15 lives (ignore counter) code:8092e1/0f cheat description:Infinite health code:7e10c5/0a cheat description:Infinite lives (alt) code:019df1/00 cheat description:Super-jump (alt) code:80ee38/00 cheat description:Normal pistol does more damage (alt) code:81804a/0f cartridge sha256:055d9c6311a663af7c899a6f76a419c274c57baada3ef64c52fadb1c676b1446 name:RoboCop 3 (USA) cheat description:Infinite lives code:0082f4/2c cheat description:Slower timer code:008651/70 cheat description:Faster timer code:008651/1f cheat description:Infinite ammo (except flame thrower) code:00ab3f/00 cheat description:Ammo pick-ups worth more code:00fca2/01+00fca4/02 cheat description:Ammo pick-ups worth less code:00fca1/30+00fca4/00+00fca3/30 cheat description:Faster Robocop - except on stages 3 and 5 code:00a238/02+00a253/fe cheat description:Start with 1 life code:0080dc/00 cheat description:Start with 6 lives code:0080dc/05 cheat description:Start on stage 2 code:00ea3b/01 cheat description:Start on stage 3 code:00ea3b/02 cheat description:Start on stage 4 code:00ea3b/03 cheat description:Start on stage 5 code:00ea3b/04 cheat description:Infinite health code:7e0477/38 cheat description:Infinite lives (alt) code:7e1854/05 cheat description:Infinite ammo code:7e1848/99 cheat description:Infinite time code:7e030c/12+7e030d/04 cheat description:Have all weapons code:7e046f/04 cartridge sha256:1e2ded7b1e350449b7a99b7ec414525e4b9b086c416deeee5eb3e48e032c46bd name:Robotrek (USA) cheat description:Infinite battle bonus time code:84c7c0/ea cheat description:Infinite robot points code:8babf0/80 cheat description:Infinite vanish time code:8bef27/ad cheat description:Everything is free code:88eea2/ad cheat description:Get 9900 gold when you look into the robot book code:8c9050/99 cheat description:More energy for robot energy code:8bf582/90 cheat description:Mean robot code:85f596/a9+85f597/99+85f598/00+85f599/ea cheat description:One-hit kills code:8bf2dc/a9 cheat description:Start at level 3 code:88ef20/a9+88ef21/03 cheat description:Start at level 10 code:88ef20/a9+88ef21/0a cheat description:Start at level 20 code:88ef20/a9+88ef21/14 cheat description:Start at level 50 code:88ef20/a9+88ef21/32 cheat description:Start at level 50 (alt) code:88ef20/a9+88ef21/32 cheat description:Infinite GP code:7e06e6/99+7e06e7/99+7e06e8/09 cheat description:Max Program Points code:7e0688/73+7e0689/05 cheat description:Max HP - First Robot code:7e068a/ff cartridge sha256:9d721753301278325c851f1843d669a697aed757dcf6495a31fc31ddf664b182 name:Rock n' Roll Racing (USA) cheat description:Infinite forward weapons code:80941e/ad cheat description:Infinite power charges code:809917/ad cheat description:No damage from hitting other cars code:80fe72/ea cheat description:No damage from most mines code:80df88/00 cheat description:No points needed to advance to any level code:81ae9a/9c cheat description:Buy items for free if you have enough money code:81b6a6/ad+81b69b/ad cheat description:More damage from mines code:80df88/06 cheat description:Red Cross packages worth nothing code:80e085/00 cheat description:Red Cross packages can blow up code:80e085/10 cheat description:Start with $50,000 code:81ae10/05 cheat description:Start with $100,000 code:81ae10/10 cheat description:Start with $500,000 code:81ae10/50 cheat description:Start with $990,000 code:81ae10/99 cheat description:Start with $5,020,000 code:81ae11/05 cartridge sha256:b072fd9b08042e3262446fdf418a41848251072a32bd7f8335cc03543c4ae6c8 name:Rocketeer, The (USA) cheat description:Protection against guns (only partly against grenades) (only in hangar) code:00b1b7/a5 cheat description:Protection against Armored Flying Tank code:00b4a1/a5 cheat description:Protection against enemy rocketmen on the Zeppelin code:00c749/a5 cheat description:Invincibility in the skies code:008224/a5 cheat description:Infinite Super Shots on pick-up code:008f6e/a5 cheat description:Infinite chances code:008d47/bd cheat description:Automatically win first race at Bigelow code:0086df/00 cheat description:Automatically win second race at Bigelow code:0086e0/00 cheat description:Automatically win third race at Bigelow code:0086e1/00 cheat description:First race at Bigelow is 1 lap instead of 10 code:0086df/01 cheat description:First race at Bigelow is 5 laps code:0086df/05 cheat description:First race at Bigelow is 15 laps code:0086df/0f cheat description:First race at Bigelow is 25 laps code:0086df/19 cheat description:First race at Bigelow is 50 laps code:0086df/32 cheat description:First race at Bigelow is 99 laps code:0086df/63 cheat description:Second race at Bigelow is 1 lap code:0086e0/01 cheat description:Second race at Bigelow is 5 laps code:0086e0/05 cheat description:Second race at Bigelow is 10 laps code:0086e0/0a cheat description:Second race at Bigelow is 25 laps code:0086e0/19 cheat description:Second race at Bigelow is 50 laps code:0086e0/32 cheat description:Second race at Bigelow is 99 laps code:0086e0/63 cheat description:Third race at Bigelow is 1 lap instead of 10 code:0086e1/01 cheat description:Third race at Bigelow is 5 laps code:0086e1/05 cheat description:Third race at Bigelow is 25 laps code:0086e1/19 cheat description:Third race at Bigelow is 50 laps code:0086e1/32 cheat description:Third race at Bigelow is 99 laps code:0086e1/63 cheat description:Cliff starts with 2/3 normal energy in hangar code:008708/4a cheat description:Cliff starts with 1/3 normal energy in hangar code:008708/25 cheat description:Enemies start with 2/3 normal energy in hangar code:00870f/4a cheat description:Enemies start with 1/3 normal energy in hangar code:00870f/25 cheat description:Super Shots worth nothing on pick-up instead of 3 code:00849e/00 cheat description:Super Shots worth 6 on pick-up (cannot gain over 29) code:00849e/06 cheat description:Super Shots worth 9 on pick-up (cannot gain over 29) code:00849e/09 cheat description:Super Shots worth 12 on pick-up (cannot gain over 29) code:00849e/0c cheat description:Easily defeat enemy rocketmen on the Zeppelin code:00c4b4/64 cheat description:Start with 1 chance instead of 3 code:0085af/01 cheat description:Start with 2 chances code:0085af/02 cheat description:Start with 4 chances code:0085af/04 cheat description:Start with 5 chances code:0085af/05 cheat description:Start with 6 chances code:0085af/06 cheat description:Start with 7 chances code:0085af/07 cheat description:Start with 8 chances code:0085af/08 cheat description:Start with 9 chances code:0085af/09 cartridge sha256:4fc2832e7aa01d105ca67977b38840ec1188869b5e74d20e58613c1cd127d78f name:Rockman & Forte (Japan) cheat description:Invincibility against enemies code:c345b7/6b cheat description:Invincibility against fire code:c13411/6b cheat description:Invincibility against pits code:c12cb8/60 cheat description:Invincibility against spikes code:c133e9/6b cheat description:One hit kills code:c34585/24 cheat description:Multi-jump - Megaman code:c11c95/60+c11c96/7f+c17f60/20+c17f61/fd+c17f62/3a+c17f63/20+c17f64/e9+c17f65/31+c17f66/60 cheat description:Multi-jump - Bass code:c12662/fd cheat description:Invincibility code:7e0c30/30 cheat description:Infinite health code:7e0c2f/1c cheat description:Infinite sliding time code:7e0c54/01 cheat description:Infinite Beat code:7e0b94/9c cheat description:Infinite Eddie code:7e0b96/9c cheat description:Infinite Bolts code:7e0b9c/e7+7e0b9d/03 cheat description:Infinite Mines code:7e0b86/9f cheat description:Infinite T. Blade code:7e0b8e/9f cheat description:Infinite Ice Wall code:7e0b8c/9f cheat description:Infinite W. Burner code:7e0b88/9f cheat description:Infinite S. Drill code:7e0b82/9f cheat description:Infinite L. Bolt code:7e0b84/9f cheat description:Infinite C. Vision code:7e0b90/9f cheat description:Infinite M. Cards code:7e0b8a/9f cheat description:Infinite Gospel Booster/Rush Search code:7e0b92/9f cheat description:Have all items code:7e0b97/ff+7e0b98/ff+7e0b99/ff cheat description:Have CD Sparkle info code:7e0b98/ff cheat description:Have first 5 Units code:7e0b97/ff cheat description:Have all CDs code:306049/ff+30604a/ff+30604b/ff+30604c/1f+306040/fe+306041/ff+306042/ff+306043/ff+306044/ff+306045/ff+306046/ff+306047/ff+306048/ff cheat description:One hit kills (alt) code:7e1a2f/01 cheat description:Last area open code:7e0b79/ff cheat description:Last area, last level code:7e0b7b/03 cartridge sha256:7c0f915b581796e5b6dd384ecdc0dad8af4d956492fbcedec628c8845d911d7e name:Rocky Rodent (USA) cheat description:Infinite lives code:80cc03/ea cheat description:Keep hairdo after you die code:81afe0/ad cheat description:Start with red hairdo code:80c9bc/02 cheat description:Start with purple hairdo code:80c9bc/04 cheat description:Start with corkscrew hairdo code:80c9bc/06 cheat description:Start with green ponytail hairdo code:80c9bc/08 cheat description:Start with birdnest hairdo code:80c9bc/0a cheat description:Invincibility code:7e0054/72 cartridge sha256:f7e3c3012af2dbad350646b6ef3470f0b4c42e4a2873109f7aa6c81d7157c887 name:Roger Clemens' MVP Baseball (USA) (Rev 1) cheat description:Batter never walks code:00d207/ad cheat description:Batter never strikes out code:00d232/ad cheat description:1 ball per walk code:00d20e/01 cheat description:2 balls per walk code:00d20e/02 cheat description:3 balls per walk code:00d20e/03 cheat description:5 balls per walk code:00d20e/05 cheat description:6 balls per walk code:00d20e/06 cheat description:7 balls per walk code:00d20e/07 cheat description:1 strike per out code:00d239/01 cheat description:2 strikes per out code:00d239/02 cheat description:4 strikes per out code:00d239/04 cheat description:5 strikes per out code:00d239/05 cheat description:Each run counts as 2 code:018974/38+018955/38 cheat description:1 out per inning per team code:00951c/01 cheat description:2 outs per inning per team code:00951c/02 cartridge sha256:815bfcf4fd6eb23a20c2e50dde023c210b273ffb6cd86a93909d803c3643ce46 name:Romance of the Three Kingdoms II (USA) cheat description:Scenario 1 - Start with 30,000 gold pieces code:01ff3a/30+01ff3b/75 cheat description:Scenario 1 - Start with 30,000 rice code:01ff3e/30+01ff3d/75 cheat description:Scenario 1 - Start with 30,000 population code:01ff3e/30+01ff3f/75 cheat description:Scenario 2 - Start with 30,000 gold pieces code:028339/30+02830a/75 cheat description:Scenario 2 - Start with 30,000 rice code:02833b/30+02830c/75 cheat description:Scenario 2 - Start with 30,000 population code:02833d/30+02830e/75 cheat description:Scenario 3 - Start with 30,000 gold pieces code:02873c/30+02873d/75 cheat description:Scenario 3 - Start with 30,000 rice code:02873e/30+02873f/75 cheat description:Scenario 3 - Start with 30,000 population code:028740/30+028741/75 cheat description:Scenario 4 - Start with 30,000 gold pieces code:028b3d/30+028b3e/75 cheat description:Scenario 4 - Start with 30,000 rice code:028b3f/30+028b40/75 cheat description:Scenario 4 - Start with 30,000 population code:028b41/30+028b42/75 cheat description:Scenario 5 - Start with 30,000 gold pieces code:02909c/30+02909d/75 cheat description:Scenario 5 - Start with 30,000 rice code:02909e/30+02909f/75 cheat description:Scenario 5 - Start with 30,000 population code:0290a0/30+0290a1/75 cheat description:Scenario 6 - Start with 30,000 gold pieces code:02925e/30+02925f/75 cheat description:Scenario 6 - Start with 30,000 rice code:029260/30+029261/75 cheat description:Scenario 6 - Start with 30,000 population code:029262/30+029263/75 cartridge sha256:4158e3e8890a52f0b12dc9ad5a29276058a247ff41e9f1d22897ebde1eb11269 name:Run Saber (USA) cheat description:Almost invincible - P1 (disable if you fall into a pit) code:809a53/ad cheat description:Almost invincible - P2 (disable if you fall into a pit) code:809a6b/ad cheat description:Almost invincible - both players (disable if you fall into a pit) code:809a4b/6b cheat description:Infinite lives - P1 code:80d566/00 cheat description:Infinite lives - P2 code:80d586/00 cheat description:Infinite Super Bombs - P1 code:9ffb27/00 cheat description:Infinite Super Bombs - P2 code:9ffb10/00 cheat description:Infinite continues code:9ff43c/ad cheat description:Level select and 9 lives selectable on the option menu code:0ceac9/01 cheat description:Hit anywhere - male character code:86fc7f/80+86fc80/15 cheat description:Bomb power-ups give no Super Bombs code:85fc6a/00 cheat description:Bomb power-ups give 2 Super Bombs code:85fc6a/02 cheat description:Start with no Super Bombs code:0cd958/00 cheat description:Start with 1 Super Bomb code:0cd958/01 cheat description:Start with 5 Super Bombs code:0cd958/05 cheat description:Start with 9 Super Bombs code:0cd958/09 cheat description:Start with 1 health code:0cd972/01 cheat description:Start with 4 health code:0cd972/04+0ce959/04 cheat description:Start with 5 health code:0cd972/05+0ce959/05 cheat description:Start with 8 health code:0cd972/08+0ce959/08 cheat description:Start with no continues code:0cbbe2/01 cheat description:Start with 1 continue code:0cbbe2/02 cheat description:Start with 5 continues code:0cbbe2/06 cheat description:Start with 9 continues code:0cbbe2/0a cartridge sha256:00e78318926e5cae79bce0535fddd3dccaa732f5c70e43acefc2769a9899eaed name:Rushing Beat Shura (Japan) cheat description:Invincibility code:80ddc0/ad cheat description:One hit kills code:83dab0/64 cheat description:Choose Dick to play as Super Dick code:7e060a/16+7e060b/04 cartridge sha256:0aa16d6b588ba05ab00936201e68a694746fc5e1b2e4f2dbf7cda09265a81379 name:Sailormoon (France) cheat description:Infinite HP - P2 code:7e07c0/50 cheat description:Infinite Bombs code:7e0759/09 cheat description:Full charge meter code:7e0756/20 cartridge sha256:5db804171fca42486485ed85e4afe45b29e6d01304bdf75d520bfc42429739e3 name:Samurai Shodown (USA) cheat description:Hit anywhere - both players code:c042e4/00 cheat description:Max POW meter after one hit code:c0f26e/01 cheat description:Start with 1/2 health code:c15829/40 cheat description:Start with 1/4 health code:c15829/20 cheat description:Start with 33 seconds code:c078eb/21 cheat description:Infinite health - P1 code:7e6214/80 cheat description:Infinite health - P2 code:7e6614/80 cheat description:Infinite time code:7ebe9b/63 cheat description:Max POW meter - P1 code:7e623d/20 cheat description:Max POW meter - P2 code:7e663d/20 cheat description:One hit kills - P1 code:7e6614/01 cheat description:One hit kills - P2 code:7e6214/01 cartridge sha256:c894d0d3b99ebbc54910c1d65ceae4272c959c8693a87c58e040bc5a5f74f129 name:Sanrio World Smash Ball! (Japan) cheat description:Always have Strong Smash - P1 code:7e0070/a0 cheat description:Always have Strong Smash - P2 code:7e0086/a0 cheat description:Never have Strong Smash - P1 code:7e0070/00 cheat description:Never have Strong Smash - P2 code:7e0086/00 cartridge sha256:34e1af0642c85148c5a3dc3c7ab4bcbda13a9fea190934b5526c555fff035651 name:Saturday Night Slam Masters (USA) cheat description:Able to pick the same characters code:c03b54/60+c03b39/60 cheat description:Stingray becomes Biff code:80a666/00 cheat description:Stingray becomes Gunloc code:80a666/01 cheat description:Stingray becomes Oni code:80a666/02 cheat description:Stingray becomes Titan code:80a666/03 cheat description:Stingray becomes Haggar code:80a666/05 cheat description:Stingray becomes Grater code:80a666/06 cheat description:Stingray becomes Rasta code:80a666/07 cheat description:Stingray becomes Jumbo code:80a666/08 cheat description:Stingray becomes Scorpion code:80a666/09 cheat description:Biff becomes Gunloc code:80a662/01 cheat description:Biff becomes Oni code:80a662/02 cheat description:Biff becomes Titan code:80a662/03 cheat description:Biff becomes Stingray code:80a662/04 cheat description:Biff becomes Haggar code:80a662/05 cheat description:Biff becomes Grater code:80a662/06 cheat description:Biff becomes Rasta code:80a662/07 cheat description:Biff becomes Jumbo code:80a662/08 cheat description:Biff becomes Scorpion code:80a662/09 cheat description:14-second count outside ring code:c10991/0e cheat description:10-second count outside ring code:c10991/0a cheat description:9-second count for pin code:c10980/09 cheat description:6-second count for pin code:c10980/06 cheat description:1-second count for pin code:c10980/01 cheat description:Faster timer code:c06215/1e cheat description:Slower timer code:c06215/60 cheat description:Stingray has faster jalepeno comet code:c1dd0e/06+c1dd15/f9 cheat description:Quicker 'pattycake slap' for Grater code:80bdec/4a+80bdf6/03 cheat description:Quicker 'sonic fist' for Gunloc code:80bde7/4a+80bdf1/03 cheat description:Quicker 'sonic fist' for Biff code:80bde6/4a+80bdf1/03 cheat description:Quicker 'jungle fever' for Rasta code:80bded/4a+80bdf7/02 cheat description:Infinite time code:7e1a70/01 cartridge sha256:7fb5236d10852125f0f37c2188b907d636647400a57bccbdb2f63098ffae8b2d name:Scooby-Doo Mystery (USA) cheat description:Infinite health code:81fb05/00 cheat description:Infinite lives code:809313/ad cheat description:Most enemies are more frightening code:81fb05/ff cheat description:Scooby snacks do nothing code:818d04/ad cheat description:Scooby snacks reduce more fright code:818d20/ff cheat description:Start with 1 life code:808d4a/00 cheat description:Start with 5 lives code:808d4a/04 cheat description:Start with 7 lives code:808d4a/06 cheat description:Start with 10 lives code:808d4a/09 cartridge sha256:39c69dfbba31086cee0c6a034186148c46e1e6c86fcb8e990fb5364a8845fbcd name:SD Kidou Senshi Gundam - V Sakusen Shidou (Japan) cheat description:Invincibility code:0182b7/60+01831c/60 cartridge sha256:8cd9eea0f01e2442727e4624199afaa42dceeb05b9084a4358cadbe4e5a04577 name:SD The Great Battle - Aratanaru Chousen (Japan) cheat description:Invincibility code:00af7c/60+00a964/a5 cheat description:Infinite lives code:0086bf/a5 cartridge sha256:a4ab8cfad2f236675b1c0124f8484688e149f38e8628a3b38e9ec14d491ec07e name:SeaQuest DSV (USA) cheat description:Infinite weapons / items code:84a3a5/bf+84a4b8/bf cheat description:Start with 99 Darwin's Aqua Lungs code:81f2a9/63 cheat description:Start with 99 HR Probes code:81f2b1/63 cheat description:Start with 99 Sea Trucks code:81f2af/63 cheat description:Start with 99 Sea Speeders code:81f2ab/63 cheat description:Start with 99 Crabs code:81f2a7/63 cheat description:Start with 99 Stingers code:81f2ad/63 cartridge sha256:17c864a76d498feb6479eee8e7d6807b951c66225033228622bb66754baab1db name:Secret of Evermore (USA) cheat description:Everyone is invincible, including enemies code:8fc241/ad+908498/bd+908461/0d cheat description:Infinite Alchemy ingredients code:91ce25/bf+91cdf8/bf cheat description:Alchemy levels up on every use code:91cd5c/00 cheat description:View Boy's stats to get 131,074 Talons (don't use if you already have more than that) code:8da323/a9+8da324/02+8da325/00+8da328/8d cheat description:Your dog starts with 99 HP code:8c9517/63 cheat description:Your dog starts with 255 HP code:8c9517/ff cheat description:Start with 99 attack points code:8c935b/57 cheat description:Start with a lot of attack points code:8c935b/ff cheat description:Start with 99 defense points code:8c927d/63 cheat description:Start with a lot of defense points code:8c927d/ff cheat description:Start with 99 magic defense points code:8c9439/63 cheat description:Start with a lot of magic defense points code:8c9439/ff cheat description:Start with 50 evade % points code:8c8e27/32 cheat description:Start with 99 evade % points code:8c8e27/63 cheat description:Start with 50 hit % points code:8c8f05/32 cheat description:Start with 99 hit % points code:8c8f05/63 cheat description:Start with 99 HP code:8eb687/63+8c919f/63 cheat description:Start with 255 HP code:8eb687/ff+8c919f/ff cheat description:Have all weapons code:7e22da/ff+7e22db/ff cartridge sha256:4c15013131351e694e05f22e38bb1b3e4031dedac77ec75abecebe8520d82d5f name:Secret of Mana (USA) cheat description:999 health - P1 code:7ee182/e7+7ee183/03 cheat description:999 health - P2 code:7ee382/e7+7ee383/03 cheat description:999 health - P3 code:7ee582/e7+7ee583/03 cheat description:999 Max health - P1 code:7ee184/e7+7ee185/03 cheat description:999 Max health - P2 code:7ee384/e7+7ee385/03 cheat description:999 Max health - P3 code:7ee584/e7+7ee585/03 cheat description:Infinite MP code:7ee386/63+7ee586/63 cheat description:Infinite GP code:7ecc6a/7f+7ecc6b/96+7ecc6c/98 cheat description:Protection from most hits (disable to kill enemies) code:c040be/bd cheat description:Enemies die instantly code:c03cf2/a0+c03cf3/00+c03cf4/00 cheat description:Hit anywhere code:01ce3e/24+01d1a6/24 cheat description:Level 99 after first enemy code:c04486/98+c039b6/00 cheat description:Max weapon damage code:c049c9/9c+c049c8/a9 cheat description:Change screens to max out Strength, Agility, Constitution, Intelligence and Wisdom code:c04be1/00 cheat description:Weapon bar never decreases code:02c24a/bd+00f944/bd cheat description:Walk through walls code:01bb7c/00+01ba7b/00 cheat description:Strength for level 16 is 90 code:d0428b/5a cheat description:Agility for level 16 is 90 code:d0428c/5a cheat description:Constitution for level 16 is 90 code:d0428d/5a cheat description:Intelligence for level 16 is 90 code:d0428e/5a cheat description:Wisdom for level 16 is 90 code:d0428f/5a cheat description:Chest in elder's basement in Potos gives you 65360 GP code:ca8e9f/ff cheat description:Staying at the inn in Potos is free if you have enough money code:c03a2e/ad+c03a33/ad cheat description:Items in the shop at Potos are free if you have enough money code:c07d1e/af cheat description:Candy costs nothing code:d8fb9c/00 cheat description:Overalls costs nothing code:d8fbe0/00 cheat description:Bandanna costs nothing code:d8fbb6/00 cheat description:Cup Of Wishes costs nothing code:d8fba6/00 cheat description:Medical Herb costs nothing code:d8fba4/00 cheat description:Wristband costs nothing code:d8fc30/00 cheat description:Hair Ribbon costs nothing code:d8fbb8/00 cheat description:Rabite Cap costs nothing code:d8fbba/00 cheat description:Faerie Walnut costs nothing code:d8fba2/00+d8fba3/00 cheat description:Royal Jam costs nothing code:d8fba0/00 cheat description:Chocolate costs nothing code:d8fb9e/00 cheat description:Staying at Neko's costs nothing instead of 30 code:c9cf9d/00 cheat description:Start with 255 GP code:c0d7b3/ff cheat description:Start with 32,768 GP code:c0d7b4/80 cheat description:Start with 65,280 GP code:c0d7b4/ff cheat description:Start at Level 16 code:c04e5d/81 cartridge sha256:ab3d724f3032337300c0cc10259447b173793b9dc25f1f250baf785e9c16bb7d name:Shadow, The (USA) (Proto) (Alt 1) cheat description:Infinite health code:7e1e31/ff cheat description:Infinite dash code:7e1876/ff cheat description:Infinite time code:7e1b76/09 cheat description:Enemy 1 has 0 health code:7e1b4a/00 cheat description:Enemy 2 has 0 health code:7e1b4b/00 cheat description:Enemy 3 has 0 health code:7e1b4c/00 cheat description:Start on level 2 - Empire State code:7e1e28/01 cheat description:Start on level 3 - Amusement Park code:7e1e28/02 cheat description:Start on level 4 - The Museum code:7e1e28/03 cheat description:Start on level 5 - The Federal Buildings code:7e1e28/04 cheat description:Start on level 6 - The Bike Chase code:7e1e28/05 cheat description:Start on level 7 - Maritech Labs code:7e1e28/06 cheat description:Start on level 8 - China Town code:7e1e28/07 cheat description:Start on level 9 - Hotel Monolith code:7e1e28/08 cartridge sha256:85092f4c566b4d34bd4bd70be55df92bfbda40f0030e63a15bafbb8f760c1519 name:Shadow, The (USA) (Proto) cheat description:Infinite health code:7e1e31/ff cheat description:Infinite dash code:7e1876/ff cheat description:Infinite time code:7e1b76/09 cheat description:Enemy 1 has 0 health code:7e1b4a/00 cheat description:Enemy 2 has 0 health code:7e1b4b/00 cheat description:Enemy 3 has 0 health code:7e1b4c/00 cheat description:Start on level 2 - Empire State code:7e1e28/01 cheat description:Start on level 3 - Amusement Park code:7e1e28/02 cheat description:Start on level 4 - The Museum code:7e1e28/03 cheat description:Start on level 5 - The Federal Buildings code:7e1e28/04 cheat description:Start on level 6 - The Bike Chase code:7e1e28/05 cheat description:Start on level 7 - Maritech Labs code:7e1e28/06 cheat description:Start on level 8 - China Town code:7e1e28/07 cheat description:Start on level 9 - Hotel Monolith code:7e1e28/08 cartridge sha256:e6bc0a595d5c7c4bc0bbb61ffe35a70288a77eb78544ed74682d489a9e6f07f4 name:Shadowrun (USA) cheat description:Infinite health in the Matrix code:81b17f/ad cheat description:Everything is free code:80ccf7/80+80ccf8/11 cheat description:Karma not subtracted for spells/skills (must have enough to advance) code:80f010/af cheat description:Karma not subtracted for shooting people (ignore message saying you lost karma) code:80880f/af cheat description:Spell points not subtracted (works for all spell casters) (casting spells you aren't allowed to raises your spell points) code:808b53/bf cheat description:Walk through walls code:81860d/80 cheat description:Going up 1 body point adds 20 stamina instead of 10 code:80f164/14 cheat description:Going up 1 body point adds 30 stamina instead of 10 code:80f164/1e cheat description:Add 65,000 nuyen (if less than 65,000) code:8095af/01+8095b1/0f+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Add about 131,000 nuyen (if less than 65,000) code:8095af/02+8095b1/0f+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Add about 524,000 nuyen (if less than 65,000) code:8095af/08+8095b1/0f+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Set stamina to 100 code:8095af/64+8095b1/00+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Set stamina to 200 code:8095af/c8+8095b1/00+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Set magic total possible to 10 (and spell points to 100) code:8095af/0a+8095b1/fc+8095b2/3b+8095b0/8f+8095b3/7e cheat description:Set total possible magic to 20 (and spell points to 200) code:8095af/14+8095b1/fc+8095b2/3b+8095b0/8f+8095b3/7e cheat description:Set total possible magic to 25 (and spell points to 250) code:8095af/19+8095b1/fc+8095b2/3b+8095b0/8f+8095b3/7e cheat description:Set strength to 6 code:8095af/06+8095b1/fd+8095b2/3b+8095b0/8f+8095b3/7e cheat description:Set charisma to 6 code:8095af/06+8095b1/ff+8095b2/3b+8095b0/8f+8095b3/7e cheat description:Set karma to 10 (if karma is less than 32) code:8095af/50+8095b1/11+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Set karma to 20 (if karma is less than 32) code:8095af/a0+8095b1/11+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Set karma to 31 (if karma is less than 32) code:8095af/ff+8095b1/11+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Add 32 karma (if karma is less than 32) code:8095af/01+8095b1/12+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Add 64 karma (if karma is less than 32) code:8095af/02+8095b1/12+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Add 96 karma (if karma is less than 32) code:8095af/03+8095b1/12+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Add 192 karma (if karma is less than 32) code:8095af/06+8095b1/12+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn powerball spell, level 6 code:8095af/06+8095b1/07+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn heal spell, level 6 code:8095af/06+8095b1/08+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn invisibility spell, level 6 code:8095af/06+8095b1/09+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn armor spell, level 6 code:8095af/06+8095b1/0a+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn summon spirit spell, level 6 code:8095af/06+8095b1/0b+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn freeze spell, level 6 code:8095af/06+8095b1/0c+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn firearms skill, level 5 code:8095af/05+8095b1/01+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn firearms skill, level 10 code:8095af/0a+8095b1/01+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn firearms skill, level 15 code:8095af/0f+8095b1/01+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn computer skill, level 6 code:8095af/06+8095b1/04+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn leadership skill, level 6 code:8095af/06+8095b1/05+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn armed combat skill, level 6 code:8095af/06+8095b1/03+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn unarmed combat skill, level 6 code:8095af/06+8095b1/02+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Learn negotiation skill, level 6 code:8095af/06+8095b1/06+8095b2/3c+8095b0/8f+8095b3/7e cheat description:Start with computer, firearms skills at level 2 code:8098f3/02 cheat description:Start with computer, firearms skills at level 3 code:8098f3/03 cheat description:Start with computer, firearms skills at level 4 code:8098f3/04 cheat description:Start with computer, firearms skills at level 5 code:8098f3/05 cheat description:Start with computer, firearms skills at level 6 code:8098f3/06 cheat description:Start with 2 strength and charisma code:8098a9/02 cheat description:Start with 4 strength and charisma code:8098a9/04 cheat description:Start with 5 strength and charisma code:8098a9/05 cheat description:Start with 6 strength and charisma code:8098a9/06 cheat description:Start with 50 stamina code:8098b3/32 cheat description:Start with 100 stamina code:8098b3/64 cheat description:Lots of Nuyen code:7e3c0d/7f+7e3c0e/96+7e3c0f/98 cheat description:Infinite / max HP code:7e33de/c8+7e3c00/c8+7e3c01/01 cheat description:Debug room accessible code:7e3bd3/ff+7e3bd4/ff cartridge sha256:b0fcef5b3e74ac20ac76720723e1affa5e0d4e3e864d09731ce7fe6f16b7fd28 name:Shadowrun (USA) (Beta) cheat description:Debug room accessible code:7e3bce/ff+7e3bcf/ff cartridge sha256:c73757eea258e169e506eaef989227a59918060f94117917f338183db14c50b6 name:Shaq-Fu (USA) cheat description:Invincibility - P1 code:c0b290/40+c0b292/d0+c0b28f/e0+c0b291/20 cheat description:Hit anywhere - P1 code:c0b27c/40+c0b27b/e0+c0b27d/20+c0b282/00+c0b281/1c cheat description:Infinite continues - Duel Mode code:c08355/ad cheat description:Blood enabled code:c0958f/00+c094ea/00 cheat description:Start with no continues code:c0cd81/00 cheat description:Start with 1 continues code:c0cd81/01 cheat description:Start with 5 continues code:c0cd81/05 cheat description:Start with 9 continues code:c0cd81/09 cheat description:Start with 15 continues code:c0cd81/0f cartridge sha256:dd94308d822636c6ddf73c5e2644c84f2eb8fb4d9201150fc5f37d44d6f423f1 name:Shin Kidou Senki Gundam W - Endless Duel (Japan) cheat description:Hit anywhere - P1 code:049ad4/47+049ad0/c0+049ad1/00+049ad2/00 cartridge sha256:40e25763288521509b2201f5b4e53f3e3bcdfa92e37cf5eeee4f00d8935d534a name:Shin Nekketsu Kouha - Kunio-tachi no Banka (Japan) cheat description:Invincibility code:82d19a/ad cheat description:Invincibility (alt) code:7e1202/02 cheat description:Infinite health - Kunio code:7e0094/ff cheat description:Infinite health - Riki code:7e0096/ff cheat description:Infinite health - Misako code:7e0098/ff cheat description:Infinite health - Kyouko code:7e009a/ff cheat description:One hit kills code:7e009c/00+7e009e/00+7e00a0/00+7e00a2/00 cheat description:Play as Kunio - Jail Outfit (Safe To Use) code:7e11dc/00 cheat description:Play as Riki - Jail Outfit (Safe To Use) code:7e11dc/01 cheat description:Play as Takayama code:7e11dc/03 cheat description:Play as Cop code:7e11dc/04 cheat description:Play as Gouji code:7e11dc/05 cheat description:Play as Tooru code:7e11dc/06 cheat description:Play as Gouji Henchman code:7e11dc/07 cheat description:Play as Kunio - School Outfit (Safe To Use) code:7e11dc/08 cheat description:Play as Riki - School Outfit (Safe To Use) code:7e11dc/09 cheat description:Play as Misako (Safe To Use) code:7e11dc/0a cheat description:Play as Kyouko (Safe To Use) code:7e11dc/0b cheat description:Play as Daiki Stage 2, Ryuuta Stage 3 code:7e11dc/0c cheat description:Play as Henchman Stage 2 + code:7e11dc/0e+7e11dc/11+7e11dc/14 cheat description:Play as Shingi Henchman code:7e11dc/17 cheat description:Play as Shingi code:7e11dc/1a cheat description:Play as Lisa code:7e11dc/1b cheat description:Play as Sabu code:7e11dc/1e cheat description:Play as Kinji code:7e11dc/1f cheat description:Play as Ken code:7e11dc/20 cheat description:Play as Misuzu code:7e11dc/21 cheat description:Play as Yakuza 1 code:7e11dc/23 cheat description:Play as Yakuza 2 code:7e11dc/25 cheat description:Play as Joe code:7e11dc/2c cheat description:Character color becomes White code:7e0084/00 cheat description:Character color becomes Blue code:7e0084/01 cheat description:Character color becomes Green code:7e0084/02 cheat description:Character color becomes Light Blue code:7e0084/03 cartridge sha256:de2d5a952096c5f50368b9270d342aa6e7a39007ffbec27117e182e30ef4cf32 name:Sid Meier's Civilization (USA) cheat description:Get a new skill every turn code:c0e84b/00 cheat description:Have 42.0 moves until you specify no orders code:c0d9b3/a9+c0d9b4/7e cheat description:Start with more money code:cc4b24/99+cc4b25/99 cheat description:Start with a lot more money code:cc4b24/ff+cc4b25/ff cheat description:Infinite time code:7e75d7/00 cheat description:Max income code:7e7630/ff cartridge sha256:d09ca5adaee65cfd686742482bc55b1a3ce9bc5ebed61f24c5631555151a7fc7 name:Side Pocket (USA) cheat description:Infinite shots code:7e1094/0a cheat description:Infinite shots (alt) code:7e1094/10 cheat description:Gain lots of bonus shots for every ball you get in code:7e1097/03 cheat description:Always advance to the next level code:7e10a2/e7+7e10a3/03 cartridge sha256:c0bd1b378337c32047a6b7122a3813beb646e496fbdb1fa5c87ab9856271e4c5 name:SimAnt - The Electronic Ant Colony (USA) cheat description:Always have maximum energy code:03b1b1/00 cheat description:Yellow ant always wins code:03c639/00 cartridge sha256:e9c0bc05511e05a0d7c3e7cc42e761e1e8e532d46f59b9854b6902e1a2e9dd0a name:SimCity (USA) cheat description:Money doesn't decrease for most types of spending code:01bbc2/ad cheat description:Time goes faster code:038037/00 cheat description:Time goes slower code:038037/0f cheat description:Start easy game with $40,000 code:03c691/40+03c692/9c cheat description:Start easy game with $60,000 code:03c691/60+03c692/ea cheat description:Start easy game with $3,000 code:03c691/b8+03c692/0b cheat description:Cheat menu at game exit code:0188e7/a9+0188e8/80+0188e9/f0 cheat description:Infinite Gift Houses code:7e03f5/01 cheat description:Infinite Gift Banks code:7e03f5/02 cheat description:Infinite Gift Amusement Parks code:7e03f5/03 cheat description:Infinite Gift Zoos code:7e03f5/04 cheat description:Infinite Gift Casinos code:7e03f5/05 cheat description:Infinite Gift Landfill code:7e03f5/06 cheat description:Infinite Gift Police HQs code:7e03f5/07 cheat description:Infinite Gift Fire Stations code:7e03f5/08 cheat description:Infinite Gift Fountains code:7e03f5/09 cheat description:Infinite Gift Mario Statue code:7e03f5/0a cheat description:Infinite Gift Expo code:7e03f5/0b cheat description:Infinite Gift Windmills code:7e03f5/0c cheat description:Infinite Gift Libraries code:7e03f5/0d cheat description:Infinite Gift Large Parks code:7e03f5/0e cheat description:Infinite Gift Train Stations code:7e03f5/0f cartridge sha256:bf74c58e4190faca2f3a967dc190fe529d13887d1262b72e057b5353e43cf67f name:SimCity 2000 - The Ultimate City Simulator (USA) cheat description:Start with $99,999,999 on all the maps except the Land Of Freedom code:c112ed/ff+c112ee/e0+c112f2/f5+c112f3/05 cheat description:Start with $99,999,999 on the Land Of Freedom code:c112e1/ff+c112e2/e0+c112e6/f5+c112e7/05 cartridge sha256:446a1036d036986fdea7906c83832d3ba79ef63a6ed8c4e88b89ab9cb25daded name:SimEarth - The Living Planet (USA) cheat description:Infinite Omega energy code:7f9cd9/00 cartridge sha256:f0d98e9061d0f6a193bb856de8a592f336dada97c41966e8d03119ba97465413 name:Simpsons, The - Bart's Nightmare (USA) cheat description:Infinite lives (Bartman and Itchy and Scratchy sub-games) code:1f92f3/ad cheat description:Infinite Z's (main game) code:15aee7/ad+15aeea/ad cheat description:Start with 2 bubbles code:1588cf/02 cheat description:Start with 9 bubbles code:1588cf/09 cheat description:Infinite life code:7e0938/0a cheat description:Infinite hits code:7e0514/0b cheat description:Infinite 99 Watermelon Seeds left code:7e0137/63 cheat description:Infinite 99 Gum left code:7e013d/63 cheat description:Infinite Bubbles and Seeds code:15ac96/b5 cheat description:All Pages code:7e013f/08 cheat description:No Pages code:7e013f/00 cartridge sha256:70008efe51185eb0a2f8d8d8ac2bdbb99bd3dfcc169dcc474962f82692998051 name:Sink or Swim (USA) cheat description:Infinite lives code:7e0972/09 cheat description:0 left code:7e164a/00 cheat description:0 to rescue code:7e1650/00 cheat description:9 saved code:7e164c/09 cartridge sha256:e10070f01845505ae8bfdf7b5b492e7209c2ae876f169fb6ff420dea269f4da3 name:Skuljagger - Revolt of the Westicans (USA) cheat description:Invincibility code:00aba8/60 cheat description:Infinite Red Jemeralds code:00ab9c/02 cheat description:Don't lose Green Jemeralds when you fall and die code:019a97/ad cheat description:Infinite time code:008c95/00 cheat description:Infinite lives code:00abc1/00+019a92/00 cheat description:Die when touched (regardless of Jemeralds) code:00ab99/80+00aba8/80 cheat description:No enemies or Jemeralds (good for exploring, disable to advance) code:01c690/b9 cheat description:Red jemeralds set to 10 after being hit (must have at least 1) code:00ab9c/11 cheat description:Slower timer code:008c87/70 cheat description:Faster timer code:008c87/1e cheat description:Time goes by 2x as fast code:008c95/02 cheat description:Time goes by 4x as fast code:008c95/04 cheat description:Green Jemeralds worth 3 code:00aadd/03 cheat description:Green Jemeralds worth 9 code:00aadd/09 cheat description:Green Jemeralds worth 19 code:00aadd/19 cheat description:Green Jemeralds worth 25 (extra life on each one) code:00aadd/25 cheat description:10 Green Jemeralds gives an extra life code:00aae3/10 cheat description:50 Green Jemeralds gives an extra life code:00aae3/50 cheat description:1 Green Jemerald gives an extra life code:00aae5/00 cheat description:Start with 1 life instead of 5 code:01bcee/01 cheat description:Start with 3 lives code:01bcee/03 cheat description:Start with 9 lives code:01bcee/09 cheat description:Start with 19 lives code:01bcee/19 cheat description:Start with 50 lives code:01bcee/50 cheat description:Start with 99 lives code:01bcee/99 cheat description:Invincibility (alt) code:7e1a02/08 cheat description:Infinite time (alt) code:7e02be/ff cartridge sha256:a4ba1483db79c3f6278082387bce216d8f3e3b11ca32d49516d27f5ac07135a5 name:Skyblazer (USA) cheat description:Invincibility code:7e0065/9e cheat description:Infinite health code:7ef801/04 cheat description:Infinite special power code:7e1f0d/08 cheat description:Infinite Warrior Force code:7e0089/ff cheat description:Hit anywhere code:018c1e/00+018be8/80 cheat description:Get items from anywhere code:02b7e4/80 cheat description:One hit kills code:01fe7b/00 cheat description:Enemies die automatically code:018b8d/80+018c1e/00+018be8/80+01fe7b/00 cheat description:All enemies frozen code:7efa60/8d+7efa61/8d+7efa62/8d+7efa63/8d+7efa64/8d+7efa65/8d+7efa66/8d+7efa67/8d+7efa68/8d+7efa69/8d+7efa6a/8d+7efa6b/8d+7efa6c/8d+7efa6d/8d+7efa6e/8d+7efa6f/8d+7efa70/8d+7efa71/8d+7efa72/8d+7efa73/8d+7efa74/8d+7efa75/8d+7efa76/8d+7efa77/8d+7efa78/8d+7efa79/8d+7efa7a/8d+7efa7b/8d+7efa7c/8d+7efa7d/8d+7efa7e/8d+7efa7f/8d cheat description:Have 99 gems code:7e1f0e/63 cheat description:Have Aura Attack code:7e1f0b/01 cheat description:Have Comet Flash code:7e1f0b/02 cheat description:Have Lightning Strike code:7e1f0b/03 cheat description:Have Time Stop code:7e1f0b/04 cheat description:Have Star Fire code:7e1f0b/05 cheat description:Have Warrior Force code:7e1f0b/06 cheat description:Have Heal code:7e1f0b/07 cheat description:Have Fiery Phoenix code:7e1f0b/08 cartridge sha256:cbca00fa5dfd6c72db2f21d010255657c33f7ac48de2554262035ead11bdf314 name:Smart Ball (USA) cheat description:Infinite lives code:009155/ad cheat description:Protection from most enemies (lose no hearts) code:009ffa/ad cheat description:Infinite red balls on pick-up - until continue code:008d8b/ad cheat description:Go to any level code:0081d9/33+0081d7/0f cheat description:Super-jump code:00a0e6/fa cheat description:Mega-jump code:00a0e6/f6 cheat description:Start with 1 life instead of 3 code:00820e/01 cheat description:Start with 5 lives code:00820e/05 cheat description:Start with 10 lives code:00820e/0a cheat description:Start with 25 lives code:00820e/19 cheat description:Start with 50 lives code:00820e/32 cheat description:Start with 99 lives code:00820e/63 cartridge sha256:6fe7c8d39fcfab7f0a18e837a7ee0dd162e0557d6989c6e0d10c81616d3a0b8b name:Soldiers of Fortune (USA) cheat description:Infinite lives code:c0a76a/a9 cheat description:Smaller food power-ups heal twice as much code:c0f24f/0a cheat description:Smaller food power-ups heal four times as much code:c0f24f/14 cheat description:Large food power-ups heal twice as much code:c0f254/1e cheat description:Large food power-ups heal four times as much code:c0f254/3c cheat description:Only 3 special powers can be stored instead of 6 (handicap) code:c0f290/04 cheat description:Special power power-ups are worth 6 (always fill meter) code:c0f291/80 cheat description:Special powers aren't used up code:c0a28d/ea cheat description:Mercenary starts with much more health code:cd2df8/60 cheat description:Brigand starts with much more health code:cd2e2f/60 cheat description:Gentleman starts with much more health code:cd2e66/60 cheat description:Navvie starts with much more health code:cd2e9d/60 cheat description:Thug starts with much more health code:cd2ed4/60 cheat description:Scientist starts with much more health code:cd2f0b/60 cheat description:Extra lives cost 244 instead of 500 code:cd1181/00 cheat description:Skill power-ups cost 44 instead of 300 code:cd1183/00 cheat description:Health power-ups cost 1 instead of 75 code:cd1184/01 cheat description:Health power-ups cost 25 instead of 75 code:cd1184/19 cheat description:Speed power-ups cost 1 instead of 250 code:cd1186/01 cheat description:Speed power-ups cost 100 instead of 250 code:cd1186/64 cheat description:Wisdom power-ups cost 1 instead of 80 code:cd1188/01 cheat description:Wisdom power-ups cost 25 instead of 80 code:cd1188/19 cheat description:Special powers cost 1 instead of 150 code:cd118a/01 cheat description:Special powers cost 50 instead of 150 code:cd118a/32 cheat description:Weapon power-ups cost 1 instead of 250 code:cd118e/01 cheat description:Weapon power-ups cost 100 instead of 250 code:cd118e/64 cheat description:??? (New Special powers costs 44 instead of 300) code:cd118d/00 cheat description:Brigand starts with Bomb special power code:cd2f40/01 cheat description:Mercenary starts with Bomb special power code:cd2f44/01 cheat description:Gentleman starts with Bomb special power code:cd2f48/01 cheat description:Navvie starts with Bomb special power code:cd2f4c/01 cheat description:Thug starts with Bomb special power code:cd2f50/01 cheat description:Scientist starts with Bomb special power code:cd2f54/01 cheat description:Brigand starts with Shot Burst special power code:cd2f40/02 cheat description:Mercenary starts with Shot Burst special power code:cd2f44/02 cheat description:Gentleman starts with Shot Burst special power code:cd2f48/02 cheat description:Navvie starts with Shot Burst special power code:cd2f4c/02 cheat description:Thug starts with Shot Burst special power code:cd2f50/02 cheat description:Scientist starts with Shot Burst special power code:cd2f54/02 cheat description:Brigand starts with Map special power (must still destroy nodes special power) code:cd2f40/03 cheat description:Mercenary starts with Map special power (must still destroy nodes special power) code:cd2f44/03 cheat description:Gentleman starts with Map special power (must still destroy nodes special power) code:cd2f48/03 cheat description:Navvie starts with Map special power (must still destroy nodes special power) code:cd2f4c/03 cheat description:Thug starts with Map special power (must still destroy nodes special power) code:cd2f50/03 cheat description:Scientist starts with Map special power (must still destroy nodes special power) code:cd2f54/03 cheat description:Brigand starts with Destroy Nodes special power code:cd2f40/04 cheat description:Mercenary starts with Destroy Nodes special power code:cd2f44/04 cheat description:Gentleman starts with Destroy Nodes special power code:cd2f48/04 cheat description:Navvie starts with Destroy Nodes special power code:cd2f4c/04 cheat description:Thug starts with Destroy Nodes special power code:cd2f50/04 cheat description:Scientist starts with Destroy Nodes special power code:cd2f54/04 cheat description:Brigand starts with Repel Monster special power code:cd2f40/05 cheat description:Mercenary starts with Repel Monster special power code:cd2f44/05 cheat description:Gentleman starts with Repel Monster special power code:cd2f48/05 cheat description:Navvie starts with Repel Monster special power code:cd2f4c/05 cheat description:Thug starts with Repel Monster special power code:cd2f50/05 cheat description:Scientist starts with Repel Monster special power code:cd2f54/05 cheat description:Brigand starts with First Aid special power code:cd2f40/06 cheat description:Mercenary starts with First Aid special power code:cd2f44/06 cheat description:Gentleman starts with First Aid special power code:cd2f48/06 cheat description:Navvie starts with First Aid special power code:cd2f4c/06 cheat description:Thug starts with First Aid special power code:cd2f50/06 cheat description:Scientist starts with First Aid special power code:cd2f54/06 cheat description:Brigand starts with Freeze Monster special power code:cd2f40/07 cheat description:Mercenary starts with Freeze Monster special power code:cd2f44/07 cheat description:Gentleman starts with Freeze Monster special power code:cd2f48/07 cheat description:Navvie starts with Freeze Monster special power code:cd2f4c/07 cheat description:Thug starts with Freeze Monster special power code:cd2f50/07 cheat description:Scientist starts with Freeze Monster special power code:cd2f54/07 cheat description:Brigand starts with Shield special power code:cd2f40/08 cheat description:Mercenary starts with Shield special power code:cd2f44/08 cheat description:Gentleman starts with Shield special power code:cd2f48/08 cheat description:Navvie starts with Shield special power code:cd2f4c/08 cheat description:Thug starts with Shield special power code:cd2f50/08 cheat description:Scientists starts with Shield special power code:cd2f54/08 cheat description:Brigand starts with Party Power special power code:cd2f40/09 cheat description:Mercenary starts with Party Power special power code:cd2f44/09 cheat description:Gentleman starts with Party Power special power code:cd2f48/09 cheat description:Navvie starts with Party Power special power code:cd2f4c/09 cheat description:Thug starts with Party Power special power code:cd2f50/09 cheat description:Scientist starts with Party Power special power code:cd2f54/09 cheat description:Brigand starts with Air Burst special power code:cd2f40/0a cheat description:Mercenary starts with Air Burst special power code:cd2f44/0a cheat description:Gentleman starts with Air Burst special power code:cd2f48/0a cheat description:Navvie starts with Air Burst special power code:cd2f4c/0a cheat description:Thug starts with Air Burst special power code:cd2f50/0a cheat description:Scientist starts with Air Burst special power code:cd2f54/0a cheat description:Brigand starts with Distract Monster special power code:cd2f40/0b cheat description:Mercenary starts with Distract Monster special power code:cd2f44/0b cheat description:Gentleman starts with Distract Monster special power code:cd2f48/0b cheat description:Navvie starts with Distract Monster special power code:cd2f4c/0b cheat description:Thug starts with Distract Monster special power code:cd2f50/0b cheat description:Scientist starts with Distract Monster special power code:cd2f54/0b cheat description:Brigand starts with Molotov special power code:cd2f40/0c cheat description:Mercenary starts with Molotov special power code:cd2f44/0c cheat description:Gentleman starts with Molotov special power code:cd2f48/0c cheat description:Navvie starts with Molotov special power code:cd2f4c/0c cheat description:Thug starts with Molotov special power code:cd2f50/0c cheat description:Scientist starts with Molotov special power code:cd2f54/0c cheat description:Brigand starts with Ground Mine special power code:cd2f40/0d cheat description:Mercenary starts with Ground Mine special power code:cd2f44/0d cheat description:Gentleman starts with Ground Mine special power code:cd2f48/0d cheat description:Navvie starts with Ground Mine special power code:cd2f4c/0d cheat description:Thug starts with Ground Mine special power code:cd2f50/0d cheat description:Scientist starts with Ground Mine special power code:cd2f54/0d cheat description:Brigand starts with Dynamite special power code:cd2f40/0e cheat description:Mercenary starts with Dynamite special power code:cd2f44/0e cheat description:Gentleman starts with Dynamite special power code:cd2f48/0e cheat description:Navvie starts with Dynamite special power code:cd2f4c/0e cheat description:Thug starts with Dynamite special power code:cd2f50/0e cheat description:Scientist starts with Dynamite special power code:cd2f54/0e cheat description:Brigand gets Party Power as a 4th special power code:cd2f43/09 cheat description:Mercenary gets Party Power as a 4th special power code:cd2f47/09 cheat description:Navvie gets Party Power as a 3rd special power code:cd2f4e/09 cheat description:Thug gets Party Power as a 3rd special power code:cd2f52/09 cheat description:Infinite health - P1 code:7e40f0/64 cheat description:Infinite health - P2 or computer partner code:7e4165/64 cheat description:Infinite lives - P1 code:7e0090/04 cheat description:Infinite lives - P2 or computer partner code:7e0092/04 cheat description:Infinite special attacks - P1 code:7e40ff/06 cheat description:Infinite special attacks - P2 or computer partner code:7e4174/06 cartridge sha256:75a7b5b8ad0329dc828d3201089e125fd55fdfc99d4cec704ffcd7e3036c2410 name:Sonic Blast Man (USA) cheat description:Invincibility code:00addf/d0 cheat description:Infinite health code:00c15b/ad cheat description:Infinite health against most enemy hits code:00c15b/ad cheat description:Infinite health against hits on the head when you're being held code:00a1e3/ad cheat description:Infinite special code:00a9ea/ad cheat description:Infinite Dynamite Punches code:00a9ea/ad cheat description:Infinite lives code:01c276/00 cheat description:Infinite lives (alt) code:01c278/ad cheat description:Infinite credits code:00cbab/ad cheat description:Hit anywhere code:00c18f/23+00c18e/80 cheat description:Super glove worth nothing code:00c556/ad cheat description:Hamburger worth nothing code:00c52d/00 cheat description:Hamburger fully restores health code:00c52d/50 cheat description:Apple worth nothing code:00c519/00 cheat description:Apple fully restores health code:00c519/50 cheat description:Continue with 3/4 health code:009f79/3c cheat description:Continue with 1/2 health code:009f79/28 cheat description:Continue with 1/4 health code:009f79/14 cheat description:Start with 11 lives code:00809a/03 cheat description:Start with 0 dynamite punches code:00c700/00 cheat description:Start with 5 dynamite punches code:00c700/05 cheat description:Start with 7 dynamite punches code:00c700/07 cheat description:Start with 9 dynamite punches code:00c700/09 cheat description:Start with 3/4 health code:009d50/3c cheat description:Start with 1/2 health code:009d50/28 cheat description:Start with 1/4 health code:009d50/14 cheat description:Start on stage 2 code:0095a5/ee cheat description:Start on stage 3 code:0095a2/a9+0095a4/ea+0095a5/8d+0095a3/02 cheat description:Start on stage 4 code:0095a2/a9+0095a4/ea+0095a5/8d+0095a3/03 cheat description:Start on stage 5 code:0095a2/a9+0095a4/ea+0095a5/8d+0095a3/04 cartridge sha256:efe78f6fc68ddd0f6ef0ad9e0223d9417c14fcadece987dc8f50423fd6723b27 name:Sonic Blast Man II (USA) cheat description:Invincibility code:c04986/ad cheat description:Infinite health code:c04f97/ad cheat description:Infinite lives code:c05476/ad cheat description:Infinite health - P1 code:7e0da5/ff cheat description:Infinite health - P2 code:7e1da7/ff cheat description:Infinite Specials - P1 code:7e0dad/63 cheat description:Infinite Specials - P2 code:7e1daf/63 cheat description:Infinite lives - P1 code:7e0da9/32 cheat description:Infinite lives - P2 code:7e0dab/32 cheat description:One hit kills on most enemies and bosses code:7e1377/00+7e1393/00+7e1395/00+7e1391/00+7e138f/00 cheat description:Play as Sonic Blast Man - P1 code:7e0d8d/00 cheat description:Play as Sonic Blast Man - P2 code:7e0d8f/00 cheat description:Play as Sonia - P1 code:7e0d8d/01 cheat description:Play as Sonia - P2 code:7e0d8f/01 cheat description:Play as Captain Choyear - P1 code:7e0d8d/02 cheat description:Play as Captain Choyear - P2 code:7e0d8f/02 cartridge sha256:8438da09de8ce9aded3bb08644543f7b60fb60cffc68ce2d67d6a0643f2ecfc2 name:Soul Blazer (USA) cheat description:Invincibility code:008ef3/ad+00dde1/ad cheat description:Have all spirits after obtaining the first one code:03a7ec/1f cheat description:Get max level code:04f699/00 cheat description:Gems set to 999,999 every time one is obtained code:04f6ba/00 cheat description:10 EXP required instead of 100 for level 2 code:01fbbe/10+01fbbf/00 cheat description:180 EXP required instead of 280 for level 3 code:01fbc3/01 cheat description:380 EXP required instead of 580 for level 4 code:01fbc7/03 cheat description:600 EXP required instead of 1,000 for level 5 code:01fbcb/06 cheat description:1,200 EXP required instead of 2,000 for level 6 code:01fbcf/12 cheat description:2,400 EXP required instead of 3,200 for level 7 code:01fbd3/24 cheat description:3,500 EXP required instead of 4,500 for level 8 code:01fbd7/35 cheat description:4,800 EXP required instead of 5,800 for level 9 code:01fbdb/48 cheat description:6,600 EXP required instead of 7,600 for level 10 code:01fbdf/66 cheat description:8,600 EXP required instead of 9,600 for level 11 code:01fbe3/86 cheat description:10,000 EXP required instead of 12,400 for level 12 code:01fbe7/00 cheat description:13,000 EXP required instead of 15,000 for level 13 code:01fbeb/30 cheat description:15,000 EXP required instead of 19,000 for level 14 code:01fbef/50 cheat description:Start with 4 HP code:04f986/04 cheat description:Start with 15 HP code:04f986/0f cheat description:Start with 25 HP code:04f986/19 cheat description:Start with 50 HP code:04f986/32 cheat description:Start with 75 HP code:04f986/4b cheat description:Start with 100 HP code:04f986/64 cheat description:Start with 127 HP code:04f986/7f cheat description:Infinite and max HP code:7e1b88/64+7e1b8a/64 cheat description:Level up more quickly code:7e1b78/ff cartridge sha256:24f3f22949f36ebf8ab4beaa8cba22db107efe7a7585f749343f2860bf041fe1 name:Space Football - One on One (USA) cheat description:Infinite energy code:00945f/ad cheat description:Instant acceleration code:00df8c/69 cheat description:No pushback on firing code:00a45a/ad cheat description:Push forward on firing code:00a457/69 cartridge sha256:dc5353ddc350816619230f25f8c51bddabf7438e6dfba21662eb1c4794856735 name:Space Invaders (USA) cheat description:Infinite lives code:81871f/a9 cheat description:Enemies never move code:7e03d5/00 cheat description:Infinite credits code:7e03bf/02 cartridge sha256:f5b7418c00ccac44615cfc57c7e17d57533837056886f6d733e6b714c36dec1f name:Space Megaforce (USA) cheat description:Protection against enemy hits, and weapon level goes to 2 when hit code:0288bb/a9+0288bc/06 cheat description:Protection against enemy hits, and weapon level goes to 6 when hit code:0288bb/a9+0288bc/06+0288c8/06 cheat description:Infinite bombs code:028777/00 cheat description:Infinite ships code:02890f/00 cheat description:Hit anywhere code:01aa01/60+01aa03/d0+01aa04/2c+01aa00/ad+01aa02/0d cheat description:Power shots (weapon type 6) last until you pick up another weapon or get hit code:02b7f6/bd cheat description:Weapon capsules give you weapon type 1 code:02a125/a9+02a126/00 cheat description:Weapon capsules give you weapon type 2 code:02a125/a9+02a126/01 cheat description:Weapon capsules give you weapon type 3 code:02a125/a9+02a126/02 cheat description:Weapon capsules give you weapon type 4 code:02a125/a9+02a126/03 cheat description:Weapon capsules give you weapon type 5 code:02a125/a9+02a126/04 cheat description:Weapon capsules give you weapon type 6 code:02a125/a9+02a126/05 cheat description:Bomb capsules worth 0 code:02a0f8/00 cheat description:Bomb capsules worth 2 code:02a0f8/02 cheat description:Bomb capsules worth 4 code:02a0f8/04 cheat description:Bomb capsules worth 6 code:02a0f8/06 cheat description:Start with 0 bombs instead of 3 code:02a051/00 cheat description:Start with 7 bombs code:02a051/07 cheat description:Start with 10 bombs code:02a051/10 cheat description:Start with 25 bombs code:02a051/25 cheat description:Start with 50 bombs code:02a051/50 cheat description:Start with 99 bombs code:02a051/99 cheat description:Start with 2 ships code:029ffb/01 cheat description:Start with 8 ships code:029ffb/07 cheat description:Start with 11 ships code:029ffb/10 cheat description:Start with 26 ships code:029ffb/25 cheat description:Start with 51 ships code:029ffb/50 cheat description:Start with 76 ships code:029ffb/75 cheat description:Start with 100 ships code:029ffb/99 cheat description:Start in area 2 code:0081c1/a9+0081c2/02 cheat description:Start in area 3 code:0081c1/a9+0081c2/03 cheat description:Start in area 4 code:0081c1/a9+0081c2/04 cheat description:Start in area 5 code:0081c1/a9+0081c2/05 cheat description:Start in area 6 code:0081c1/a9+0081c2/06 cheat description:Start in area 7 code:0081c1/a9+0081c2/07 cheat description:Start in area 8 code:0081c1/a9+0081c2/08 cheat description:Start in area 9 code:0081c1/a9+0081c2/09 cheat description:Start in area 10 code:0081c1/a9+0081c2/0a cheat description:Start in area 11 code:0081c1/a9+0081c2/0b cheat description:Start in area 12 code:0081c1/a9+0081c2/0c cartridge sha256:14dc44687c8da35aec63b9edadbaac21bf7293f5171646f614139192e82ab071 name:Spanky's Quest (USA) cheat description:Infinite lives code:02cca5/24 cheat description:Start with 1 life code:00e367/00 cheat description:Start with 6 lives code:00e367/05 cheat description:Start with 10 lives code:00e367/09 cheat description:Start with 1 key in all areas after 1-1 code:00e514/a9+00e515/01 cheat description:Start on area 2-1 code:00e37f/a9+00e380/01 cheat description:Start on area 3-1 code:00e37f/a9+00e380/02 cheat description:Start on area 4-1 code:00e37f/a9+00e380/03 cheat description:Start on area 5-1 code:00e37f/a9+00e380/04 cartridge sha256:eaa06470734ea57eff9b888137aa468fcb7bb149a0870a85e68c9db123de4670 name:Sparkster (USA) cheat description:Invincibility code:82d234/00 cheat description:Invincibility (blinking) code:82d233/a9+82d234/04 cheat description:Infinite health code:82edff/ea+82d1f8/ea cheat description:Infinite health (alt) code:7e0691/0e cheat description:Infinite lives (alt) code:7e0168/09 cheat description:Hit anywhere code:80e34a/80+8482cd/a5+80e325/00 cheat description:1 Jewel needed for 1-up code:7e016a/63 cartridge sha256:fe2371bed45f5e244ce3ef8585894c0ffa4272e3f58c2f4795ef91fb1ee54b15 name:Spectre (USA) cheat description:Infinite ammo code:00a0b8/ad cheat description:Infinite lives code:00b019/f4 cheat description:Infinite health code:00ae6d/f4 cheat description:Infinite hyperspace code:00a440/ad cheat description:Freeze bonus timer code:00ebd3/ad cheat description:Infinite custom shield code:7e1b42/0a cheat description:Infinite custom speed code:7e1b44/0a cheat description:Infinite custom ammo code:7e1b46/0a cartridge sha256:68a51b7a06b6a9e7100a89521e52b5c467c46c828c0f6504bee677beac2aa6fd name:Speedy Gonzales - Los Gatos Bandidos (USA) (Rev 1) cheat description:Infinite health code:809227/ad cheat description:Infinite time code:80c25e/ea cheat description:Infinite continues code:81888b/ad cheat description:Start with 99 lives code:8080a8/63 cheat description:Invincibility after first hit code:7e099e/ff cheat description:Infinite health (alt) code:7e08cc/05 cheat description:Infinite lives code:7e0935/03 cheat description:Infinite time code:7e0934/00 cheat description:Have 5 hearts code:7e08ce/05 cheat description:Hyper Speedy Gonzalez code:7e0052/00 cheat description:Keep Speedy Shoes until end of stage on pick-up code:7e08b0/ff cheat description:Start on Sleepy Rock Part 1 code:7e0098/00 cheat description:Start on Ancient Keep Part 1 code:7e0098/02 cheat description:Start on Snowy Cabins Part 1 code:7e0098/04 cheat description:Start on Galactical Galazies Part 1 code:7e0098/06 cheat description:Start on Surely Wood Part 1 code:7e0098/08 cheat description:Start on Snowy Cabins Part 2 code:7e0098/0a cheat description:Start on Fiesta City Part 1 code:7e0098/0c cheat description:Start on Ye Olde Bounty Part 1 code:7e0098/0e cheat description:Start on Fiesta City Part 2 code:7e0098/10 cheat description:Start on Ancient Keep Part 2 code:7e0098/12 cheat description:Start on Ye Olde Bounty Part 2 code:7e0098/14 cheat description:Start on Ye Olde Bounty Part 3 code:7e0098/16 cheat description:Start on Surely Wood Part 2 code:7e0098/18 cheat description:Start on Sleepy Rock Part 2 code:7e0098/1a cheat description:Start on Surely Wood Part 3 code:7e0098/1c cheat description:Start on Surely Wood? Cat Boss code:7e0098/1e cheat description:Start on Ship Cat Boss code:7e0098/20 cheat description:Start on Galactical Galazies? Cat Boss code:7e0098/22 cheat description:Start on Galactical Galazies Part 2 code:7e0098/24 cheat description:Start on Ye Olde Bounty Part 5 code:7e0098/26 cartridge sha256:df02d0f4f40e2732138309d38e91b48aef482490979007ecb63359a35115dfd4 name:Speedy Gonzales - Los Gatos Bandidos (USA) cheat description:Invincibility after first hit code:7e099e/ff cheat description:Infinite health code:7e08cc/05 cheat description:Infinite lives code:7e0935/03 cheat description:Infinite time code:7e0934/00 cheat description:Have 5 hearts code:7e08ce/05 cheat description:Hyper Speedy Gonzalez code:7e0052/00 cheat description:Keep Speedy Shoes until end of stage on pick-up code:7e08b0/ff cheat description:Start on Sleepy Rock Part 1 code:7e0098/00 cheat description:Start on Ancient Keep Part 1 code:7e0098/02 cheat description:Start on Snowy Cabins Part 1 code:7e0098/04 cheat description:Start on Galactical Galazies Part 1 code:7e0098/06 cheat description:Start on Surely Wood Part 1 code:7e0098/08 cheat description:Start on Snowy Cabins Part 2 code:7e0098/0a cheat description:Start on Fiesta City Part 1 code:7e0098/0c cheat description:Start on Ye Olde Bounty Part 1 code:7e0098/0e cheat description:Start on Fiesta City Part 2 code:7e0098/10 cheat description:Start on Ancient Keep Part 2 code:7e0098/12 cheat description:Start on Ye Olde Bounty Part 2 code:7e0098/14 cheat description:Start on Ye Olde Bounty Part 3 code:7e0098/16 cheat description:Start on Surely Wood Part 2 code:7e0098/18 cheat description:Start on Sleepy Rock Part 2 code:7e0098/1a cheat description:Start on Surely Wood Part 3 code:7e0098/1c cheat description:Start on Surely Wood? Cat Boss code:7e0098/1e cheat description:Start on Ship Cat Boss code:7e0098/20 cheat description:Start on Galactical Galazies? Cat Boss code:7e0098/22 cheat description:Start on Galactical Galazies Part 2 code:7e0098/24 cheat description:Start on Ye Olde Bounty Part 5 code:7e0098/26 cartridge sha256:2701e94631ae1c43ca0ccef2b50bc0341a4111b31b885fa372ab5b4a49b06942 name:SpellCraft - Aspects of Valor (USA) (Proto) cheat description:Infinite health code:7e018d/99 cheat description:Quick enemy death code:7e0193/00 cheat description:Fast level up code:7e00fd/ff cheat description:Infinite Stones code:7e0296/09 cheat description:Infinite Jewels code:7e0298/09 cheat description:Infinite Candles code:7e029a/09 cheat description:Infinite Powders code:7e029c/09 cartridge sha256:f05d777e3de69aab18d336cac0af07f794f8d00090d085f86cebaed3679cabad name:Spider-Man (USA) cheat description:Stay invincible after death code:80a21d/ad cheat description:Infinite health code:829f90/a5 cheat description:Infinite lives code:829f6a/ad cheat description:Infinite webbing code:80a5c6/ae+80acab/ad+80a5a7/ae+80ac1d/ad cheat description:Gain webbing instead of losing it code:80a5c6/ee+80acab/ee+80a5a7/ee+80ac1d/ee cheat description:Hit anywhere code:80ec57/80+80ec0e/80+80ec4f/00+80ec46/00 cheat description:Increase diagnol webbing with R button code:80a5c6/ee cheat description:Increase straight webbing with X button code:80acab/ee cartridge sha256:964d21996e385e032b5d18baf716692ba1db780245cd71956c212045c1b8eb9a name:Spider-Man-Venom - Maximum Carnage (USA) cheat description:Invincibility code:818224/ad cheat description:Infinite health code:81c965/ad cheat description:Infinite lives code:819992/ad cheat description:Infinite hero icons on pick-up code:82d44f/bd cheat description:Jump higher code:81bb46/30 cheat description:Hit anywhere code:8183d3/00 cheat description:One hit kills code:81c08e/80 cheat description:Get health pick-up from anywhere code:82cdee/80+82cdef/33 cheat description:Super punch code:85cd8c/09 cheat description:Power hit lasts longer code:8184c5/04 cheat description:Start with 2x health code:81a2aa/60 cheat description:Start with 3x health code:81a2aa/90 cheat description:Start with 1 life code:81a2b0/01 cheat description:Start with 6 lives code:81a2b0/06 cheat description:Start with 9 lives code:81a2b0/09 cheat description:Start with 9 continues code:81a2b6/09 cheat description:Start with 6 continues code:81a2b6/06 cheat description:Infinite health (alt) code:7e0b7c/2c cheat description:Infinite lives (alt) code:7e0990/05 cheat description:Infinite accuracy code:7e1cca/58 cheat description:Have 7 Black Cats with infinite usage code:7e0b18/07 cheat description:Have 7 Cloaks with infinite usage code:7e0b1a/07 cheat description:Have 7 Dagger with infinite usage code:7e0b1c/07 cheat description:Have 7 Morbius with infinite usage code:7e0b1e/07 cheat description:Have 7 Firestar with infinite usage code:7e0b20/07 cheat description:Have 7 Captain Americas with infinite usage code:7e0b22/07 cheat description:Have 7 Iron Fist with infinite usage code:7e0b24/07 cheat description:Have 7 Deathlok with infinite usage code:7e0b26/07 cheat description:Have 7 Venom With Sonic Gun with infinite usage code:7e0b28/07 cartridge sha256:63210a91573fa8e19592f2e6c746a400831d804c00453739447d2df32e731df7 name:Spider-Man-X-Men - Arcade's Revenge (USA) cheat description:Invincibility after first hit (blinking) - Spider-Man code:188b60/ad cheat description:Infinite health against most hits - Spider-Man code:18aa98/00 cheat description:Protects Spider-Man from ground hazard (looks like silver weeds) code:18afa5/ad cheat description:Infinite lives - Spider-Man code:18808d/ad cheat description:Infinite lives - Gambit code:138105/ad cheat description:Infinite lives - Wolverine, Cyclops, Storm code:00acde/ad cheat description:Spider-Man jumps higher (if you jump too high in some places you die) code:188d57/a9+188d58/f8 cheat description:Start with 1 life instead of 3 code:0082ba/00 cheat description:Start with 5 lives code:0082ba/04 cheat description:Start with 7 lives code:0082ba/06 cheat description:Start with 10 lives code:0082ba/09 cheat description:Start with 26 lives code:0082ba/19 cheat description:Start with 51 lives code:0082ba/32 cheat description:Start with 100 lives code:0082ba/63 cheat description:Invincibility - Spider-Man code:7e10f6/ff cheat description:Infinite health - Spider-Man code:7e10f8/ff cheat description:Infinite health - Wolverine, Cyclops, Storm code:7e0b29/64 cheat description:Infinite health - Gambit code:7e119e/96 cheat description:Infinite lives - Everyone code:7e0100/09 cheat description:Infinite multibolt - Storm code:7e14f2/01 cheat description:99 stars - Gambit code:7e11aa/63 cheat description:Infinite cards - Gambit code:7e11a0/32 cheat description:Infinite joker wild cards - Gambit code:7e11a2/09 cheat description:Stop giant spiked wheel in first stage - Gambit code:7e11f9/ff cartridge sha256:fe10238ae42ed9eb4d906a81dd50ebe585140982cdfe266308ce1f16e78e6903 name:Spindizzy Worlds (USA) cheat description:Faster G.E.R.A.L.D. code:008214/02 cheat description:Slower timer code:009608/04 cheat description:More fuel lost from falling off landscape code:008ca4/20 cheat description:Less fuel lost from falling off landscape code:008ca4/05 cheat description:Almost zero fuel lost from falling off landscape code:008ca4/00 cheat description:Don't lose fuel from anything code:00f8a3/2c cartridge sha256:e0196201e432fa33d46a2681f84fe6a0b5f952ba43f8e4dc325f892bb4a0b39b name:Spirou (Europe) (En,Fr,De,Es) cheat description:Infinite lives code:7e064c/03 cartridge sha256:3857b5294ea8f7468849437bb2d8271564e8a0ff30774622e9c872bcbd53a84d name:Star Fox (USA) cheat description:Invincible right wing code:7e0402/05 cheat description:Invincible left wing code:7e03cc/05 cheat description:Infinite Shield code:7e0396/35 cheat description:Infinite Shield (alt) code:7e0396/28 cheat description:Infinite Shield (alt 2) code:7e0396/35 cheat description:Infinite Shield - Slippy code:7e18a2/40 cheat description:Infinite Shield - Falco code:7e18a1/40 cheat description:Infinite Shield - Peppy code:7e18a0/40 cheat description:Infinite Nova Bombs out code:7e1528/01 cheat description:Infinite Bombs code:7e15af/05 cheat description:Infinite Bombs (alt) code:7e15af/05 cheat description:Infinite lives code:7e16ee/09 cheat description:Infinite lives (alt) code:7e16ee/0a cheat description:All views available in all stages code:7e14de/05 cheat description:Have Double Blaster code:7e14da/12+7e14d9/01 cheat description:Have Double Blaster (alt) code:7e14da/12 cheat description:Have Double Blaster B and infinite Shield code:7e14d9/03 cartridge sha256:2c0bac12a7866fad1cb306da768a201c12f2520332df1ef51cba1576db21ff06 name:Star Fox - Super Weekend (USA) cheat description:Infinite Shield code:7e0396/28 cheat description:Infinite Bombs code:7e15af/04 cheat description:Infinite time (minutes) code:7ef0da/09 cheat description:Infinite time (seconds tens) code:7ef0dc/09 cheat description:Infinite time (seconds ones) code:7ef0db/09 cheat description:Have Double Blaster code:7e14d9/01 cartridge sha256:82e39dfbb3e4fe5c28044e80878392070c618b298dd5a267e5ea53c8f72cc548 name:Star Fox (USA) (Rev 2) cheat description:Infinite Shield code:7e0396/35 cheat description:Infinite Shield (alt) code:7e0396/28 cheat description:Infinite Shield - Slippy code:7e18a2/40 cheat description:Infinite Shield - Falco code:7e18a1/40 cheat description:Infinite Shield - Peppy code:7e18a0/40 cheat description:Infinite Shield (alt 2) code:7e0396/35 cartridge sha256:efae37be832d0ea1490784d57bef00761a8bf0b5bcef9c23f558e063441c3876 name:Star Ocean (Japan) cheat description:No random battles code:c27006/80 cheat description:Fight one battle for max level / EXP code:c16ff8/00 cheat description:Fight one battle for max Fol code:c16f1a/00 cheat description:View status screen for max strength, constitution, agility and stamina (These affect the base stat, making it savable. Stamina won't appear updated until you turn the codes off and re-enter that character's status screen) code:c825ba/00+c820ec/5b+c82137/61+c821e2/6d+c821c7/da cheat description:Infinite items when using item creation skills code:cad2ee/bf cartridge sha256:3a16ad45ae3d89b13c9e53e21c2a4c725ff7cec7fbe7896d538d163f92cb4aac name:Star Trek - Deep Space Nine - Crossroads of Time (USA) cheat description:Invincibility code:19edf5/ea+19edf6/ea cheat description:Invincibility after first hit code:19edf7/ad cheat description:Infinite energy code:19eeac/ad cheat description:Sisko looks like O'brien code:009512/04 cheat description:Start with 1/4 energy code:009915/10+00951e/10 cheat description:Start with 1/2 energy code:009915/1d+00951e/1d cheat description:Start with 3/4 energy code:009915/27+00951e/27 cartridge sha256:22c907b56ac6f414365801ed375c3fbf75696ce7f34ec89e1724628dc5622957 name:Star Trek - The Next Generation - Future's Past (USA) cheat description:Away Team - Medical packs aren't used up code:82b46c/00+82b4b0/00 cheat description:Away Team - Start each away mission with 1 medical pack code:80ddc0/01 cheat description:Away Team - Start each away mission with 2 medical packs code:80ddc0/02 cheat description:Away Team - Start each away mission with 4 medical packs (only 3 shown) code:80ddc0/04 cheat description:Away Team - Start each away mission with 5 medical packs (only 3 shown) code:80ddc0/05 cheat description:Away Team - Phaser power doesn't go down code:82c81a/00 cheat description:Away Team - Start away missions with phasers at 1/2 power code:80ddca/18 cheat description:Away Team - Start away missions with phasers at 3/4 power code:80ddca/24 cheat description:Away Team - Start away missions with phasers at 1/4 power code:80ddca/0c cheat description:Away Team - Medical packs heal more code:82b487/80 cheat description:Away Team - Medical packs heal twice as much code:82b488/02 cheat description:Away Team - Medical packs heal completely code:82b488/03 cheat description:Away Team - Crew members are immune to enemy fire code:82c024/bf cheat description:Space Combat - Forward torpedoes reload much faster code:849dd0/01 cheat description:Space Combat - Forward torpedoes reload faster code:849dd0/02 cheat description:Space Combat - Aft torpedoes reload much faster code:849db4/01 cheat description:Space Combat - Aft torpedoes reload faster code:849db4/02 cheat description:Space Combat - Forward torpedoes don't require recharging code:8483a4/ad cheat description:Space Combat - Aft torpedoes don't require recharging code:84833b/ad cheat description:Space Combat - Enemy shields regenerate at half speed code:849d27/08 cheat description:Space Combat - Enemy shields regenerate at 1/4 speed code:849d27/04 cheat description:Space Combat - Enemy shields don't regenerate code:849d27/00 cheat description:Space Combat - Enemy shields regenerate faster code:849d27/18 cheat description:Space Combat - Forward phasers never lose power code:8485c8/ea cheat description:Space Combat - Forward phasers don't recharge code:849ce2/ad cheat description:Space Combat - Aft phasers never lose power code:84855e/ea cheat description:Space Combat - Aft phasers don't recharge code:849cf8/ad cheat description:Space Combat - Torpedoes do half damage code:848923/03 cheat description:Space Combat - Torpedoes do less damage code:848923/04 cheat description:Space Combat - Torpedoes do slightly more damage code:848923/07 cheat description:Space Combat - Torpedoes do more damage code:848923/08 cheat description:Space Combat - Torpedoes do much more damage code:848923/09 cheat description:Space Combat - Torpedoes do double damage code:848923/0c cartridge sha256:91f938b4989215b1cd39635797f23b59b9d7b6d36e583f9eb69d022abe537bfc name:Steel Talons (USA) cheat description:Infinite Rockets code:7e025c/09 cheat description:Infinite fuel and no damage code:7e0262/50 cheat description:Always finish mission in 10 seconds code:7e0258/0a cartridge sha256:dad9c116283322d5a13fd659874c681582abdff3df182cc4c90511d33fb7110a name:Stone Protectors (USA) cheat description:Invincibility (blinking) code:009d85/a9+009d86/05+009d87/9d+00d8de/24 cheat description:Don't lose health from special moves code:00bd62/bd cheat description:Infinite lives - P1 code:00bc6a/ad cheat description:Infinite health - P1 code:7e13cc/b2 cartridge sha256:910a29f834199c63c22beddc749baba746da9922196a553255deade59f4fc127 name:Street Fighter Alpha 2 (USA) cheat description:Invincibility (except throws and Akuma's special moves) code:c0a180/ea+c0a181/e0+c0a182/80+c0a183/09+c0b046/e0+c0b047/00+c0b048/07 cheat description:Hit anywhere (except projectiles) - P1 code:c0a231/e0+c0a232/80+c0a234/90+c0a233/09 cartridge sha256:2b34161e96ef3f0f48cecd67e531a9bb94310652d8686f301bac426e4ab97e77 name:Street Fighter II (USA) cheat description:Invincibility (except against throws) - P1 code:00da3d/80+00da3e/01+00e25d/24 cheat description:Win 1 bout to win the match instead of 2 out of 3 (disable before fighting M. Bison) code:00bb42/01 cheat description:Hit anywhere (except projectiles) - P1 code:00df5b/e0+00df5e/b0+00df5c/00+00df5d/0e cheat description:Dizziness wears off very quickly code:0195f5/f0 cheat description:Dizziness lasts longer (on harder levels, won't work on computer) code:0195f3/a5 cheat description:Championship mode on code:07aa89/20 cheat description:Advance to next level when you continue (disable before you continue on M. Bison's stage) code:00a81e/80+00a81f/11 cheat description:High throw and grab damage code:00cc22/ea+00cc24/1f cheat description:Minimum throw and grab damage code:00cc22/ea+00cc24/ff cheat description:Die after 2 hits - both players code:00e5f8/74 cheat description:Round number does not advance (can't fight to a draw) code:00a7ac/ad cheat description:1 draw ends fight in VS. battle code:00bb6d/01 cheat description:Most punches and kicks do no damage code:00e5f8/b5 cheat description:Players move faster code:018075/6a cheat description:Some special moves are faster code:018075/05 cheat description:Can do special moves in the air - both players code:018663/00 cheat description:Dragon punch does not go as high code:01c076/3e cheat description:Dragon punch goes higher code:01c076/dc cheat description:Some special moves are easier to perform (E Honda's Sumo Head Butt, Blanka's Rolling Attack, Guile's Flash Kick and Sonic Boom, Chun Li's Whirlwind Kick) code:01b821/00 cheat description:No pause after throwing a Fireball code:01c043/01+01c044/c0 cheat description:Players can hit each other no matter where they are code:00df7a/80+00df7b/81 cheat description:Do special moves by just pressing buttons (may make Fireballs lower) code:019bbe/0c cheat description:Fireballs are lower to the ground code:079bb0/00 cheat description:Fireballs are higher off the ground code:079bb0/60 cheat description:Fireballs, Sonic Booms and Yoga Fires always go to the right (thrown to the left, they go backwards) code:01f8e5/00 cheat description:Light Fireballs, Sonic Booms and Yoga Fires are slower code:079bbd/ff cheat description:Light Fireballs, Sonic Booms and Yoga Fires are faster code:079bbd/f9 cheat description:Light Fireballs, Sonic Booms and Yoga Fires are super fast code:079bbd/f0 cheat description:Medium Fireballs, Sonic Booms and Yoga Fires are slower code:079bbf/ff cheat description:Medium Fireballs, Sonic Booms and Yoga Fires are faster code:079bbf/f9 cheat description:Medium Fireballs, Sonic Booms and Yoga Fires are super fast code:079bbf/f0 cheat description:Hard Fireballs, Sonic Booms and Yoga Fires are slower code:079bc1/ff cheat description:Hard Fireballs, Sonic Booms and Yoga Fires are faster code:079bc1/f9 cheat description:Hard Fireballs, Sonic Booms and Yoga Fires are super fast code:079bc1/f0 cheat description:Light Sumo Head Butts and Rolling Attacks are slower code:079868/00+07986e/ff cheat description:Light Sumo Head Butts and Rolling Attacks are faster code:079868/09+07986e/f9 cheat description:Light Sumo Head Butts and Rolling Attacks are super fast code:079868/15+07986e/f0 cheat description:Medium Sumo Head Butts and Rolling Attacks are slower code:07986a/00+079870/ff cheat description:Medium Sumo Head Butts and Rolling Attacks are faster code:07986a/0a+079870/f7 cheat description:Medium Sumo Head Butts and Rolling Attacks are super fast code:07986a/16+079870/ee cheat description:Hard Sumo Head Butts and Rolling Attacks are slower code:07986c/00+079872/ff cheat description:Hard Sumo Head Butts and Rolling Attacks are faster code:07986c/0b+079872/f5 cheat description:Hard Sumo Head Butts and Rolling Attacks are super fast code:07986c/17+079872/ed cheat description:Most special moves disabled (computer can still do them, Zangief can still do Spinning Clothesline) code:00ce2d/80 cheat description:Invisible Fireballs, Sonic Booms, Yoga Fires and Yoga Flames code:00896f/a9 cheat description:No Fireballs, Sonic Booms or Yoga Fires, makes Yoga Flame invisible code:0289b2/6b cheat description:Always fight Ryu code:00cb46/a9+00cb47/ff cheat description:Always fight Honda code:00cb46/a9+00cb47/00 cheat description:Always fight Blanka code:00cb46/a9+00cb47/01 cheat description:Always fight Guile code:00cb46/a9+00cb47/02 cheat description:Always fight Ken code:00cb46/a9+00cb47/03 cheat description:Always fight Chun-Li code:00cb46/a9+00cb47/04 cheat description:Always fight Zangief code:00cb46/a9+00cb47/05 cheat description:Always fight Dhalsim code:00cb46/a9+00cb47/06 cheat description:Always fight Balrog code:00cb46/a9+00cb47/09 cheat description:Always fight Vega code:00cb46/a9+00cb47/0a cheat description:Always fight Sagat code:00cb46/a9+00cb47/08 cheat description:Fight M. Bison code:00cb45/95 cheat description:Always fight on bonus stage 1 code:00cb29/00+00cb2e/80 cheat description:Always fight on bonus stage 2 code:00cb35/00+00cb3b/00 cheat description:90 seconds per round instead of 99 code:0782df/90 cheat description:80 seconds per round code:0782df/80 cheat description:70 seconds per round code:0782df/70 cheat description:60 seconds per round code:0782df/60 cheat description:50 seconds per round code:0782df/50 cheat description:40 seconds per round code:0782df/40 cheat description:30 seconds per round code:0782df/30 cheat description:20 seconds per round code:0782df/20 cheat description:10 seconds per round code:0782df/10 cheat description:99 seconds in 1st bonus round instead of 40 code:0782e3/99 cheat description:90 seconds in 1st bonus round code:0782e3/90 cheat description:80 seconds in 1st bonus round code:0782e3/80 cheat description:70 seconds in 1st bonus round code:0782e3/70 cheat description:60 seconds in 1st bonus round code:0782e3/60 cheat description:50 seconds in 1st bonus round code:0782e3/50 cheat description:30 seconds in 1st bonus round code:0782e3/30 cheat description:20 seconds in 1st bonus round code:0782e3/20 cheat description:10 seconds in 1st bonus round code:0782e3/10 cheat description:Start with no health - both players code:00cba4/00 cheat description:Start with no health - P1 code:00cba6/00 cheat description:Start with 3/4 health (1/4 damage) - both players code:00cba4/84 cheat description:Start with 1/2 health (1/2 damage) - both players code:00cba4/58 cheat description:Start with 1/4 health (3/4 damage) - both players code:00cba4/2c cartridge sha256:3e487f8ba48c0b5e31744e3281d6bce375089db6075c8eb3d9a929376b817381 name:Street Fighter II Turbo (USA) cheat description:Invincibility (except against throws) - P1 code:c055e8/80+c055e9/01+c05d5e/a9+c05d5f/00+c05d60/09+c05d61/24+c05d63/ea cheat description:Infinite time code:c04875/00 cheat description:Hit anywhere (except projectiles) - P1 code:c05abd/e0+c05ac0/b0+c05abe/00+c05abf/07 cheat description:Some special moves can be performed in the air (Don't perform Vega's wall leap) code:c11062/00 cheat description:Most attacks do no damage (throws still work) code:c0621b/b5 cheat description:Throws do no damage code:c1ec29/a3 cheat description:1st throws do more damage (if you have enough health), others do less damage code:c1ec29/14 cheat description:Players can walk through each other code:c0e317/00 cheat description:1st hit of any kind defeats opponent code:c061bd/00 cheat description:Winner of 2nd round wins the battle code:c04523/01 cheat description:Enable 10 star turbo mode code:c013a9/c0+c013aa/15 cheat description:No charging required for special moves (except Balrog's turn punch power) code:c1336a/04 cheat description:Hard special moves become light code:c1327a/00 cheat description:Hard special moves become medium code:c13a7a/02 cheat description:Hard special moves become disabled code:c3367a/08 cheat description:Invisible players code:c106df/bf cheat description:Most special moves go nowhere code:c1e4e3/a5 cheat description:Fireballs go nowhere code:c19cbf/a5 cheat description:Hard Hurricane Kicks go faster and farther (to the right only) code:80e15b/04 cheat description:Ryu's hard Dragon Punch doesn't go as far code:80e143/01 cheat description:Ryu's hard Dragon Punch goes farther code:80e143/08 cheat description:Ryu's medium Dragon Punch doesn't go as far code:80e141/01 cheat description:Ryu's medium Dragon Punch goes farther code:80e141/08 cheat description:Ryu's light Dragon Punch goes farther code:80e13f/08 cheat description:Ryu jumps backward farther code:80d583/07 cheat description:Ryu jumps forward farther code:80d57b/f7 cheat description:Ken jumps backward farther code:80d603/07 cheat description:Ken jumps forward farther code:80d5fb/f7 cheat description:Ken's hard Dragon Punch doesn't go as far code:80e14f/01 cheat description:Ken's hard Dragon Punch goes farther code:80e14f/0e cheat description:Ken's medium Dragon Punch doesn't go as far code:80e14d/01 cheat description:Ken's medium Dragon Punch goes farther code:80e14d/0b cheat description:Ken's light Dragon Punch goes farther code:80e14b/08 cheat description:Hard projectiles go faster (except tiger shots) code:80e36f/ef cheat description:Hard projectiles go slower (except tiger shots) code:80e36f/ff cheat description:Medium projectiles go faster (except tiger shots) code:80e36d/ef cheat description:Medium projectiles go slower (except tiger shots) code:80e36d/ff cheat description:Light projectiles go faster (except tiger shots) code:80e36b/ef cheat description:Light projectiles go slower (except tiger shots) code:80e36b/ff cheat description:Edmond Honda's hard Sumo Head Butts are faster code:80e177/0f cheat description:Edmond Honda's hard Sumo Head Butts are slower code:80e177/01 cheat description:Edmond Honda's medium Sumo Head Butts are faster code:80e175/0f cheat description:Edmond Honda's medium Sumo Head Butts are slower code:80e175/01 cheat description:Edmond Honda's light Sumo Head Butts are faster code:80e173/0f cheat description:Edmond Honda's light Sumo Head Butts are slower code:80e173/01 cheat description:Edmond Honda's hard Sumo Smashes are faster code:80e180/12 cheat description:Edmond Honda's medium Sumo Smashes are faster code:80e17e/12 cheat description:Edmond Honda's light Sumo Smashes are faster code:80e17c/12 cheat description:Sagat's hard Tiger Uppercut goes farther code:80e29d/08 cheat description:Sagat's medium Tiger Uppercut goes farther code:80e29b/08 cheat description:Sagat's light Tiger Uppercut goes farther code:80e299/08 cheat description:Sagat's high Tiger Shots are disabled (you can still do the move but no projectile comes out) code:80e359/02 cheat description:Sagat's hard Tiger Knee goes farther code:80e2b5/0b cheat description:Sagat's medium Tiger Knee goes farther code:80e2ad/0b cheat description:Sagat's light Tiger Knee goes farther code:80e2a5/0b cheat description:M. Bison's hard Psycho Crusher goes slower code:80e259/01 cheat description:M. Bison's hard Psycho Crusher goes faster code:80e259/0a cheat description:M. Bison's medium Psycho Crusher goes slower code:80e257/01 cheat description:M. Bison's medium Psycho Crusher goes faster code:80e257/0a cheat description:M. Bison's light Psycho Crusher goes slower code:80e255/01 cheat description:M. Bison's light Psycho Crusher goes faster code:80e255/0a cheat description:M. Bison's hard Scissor Kick goes slower (not in normal mode) code:80e262/01 cheat description:M. Bison's hard Scissor Kick goes faster (not in normal mode) code:80e262/0a cheat description:M. Bison's medium Scissor Kick goes slower (not in normal mode) code:80e260/01 cheat description:M. Bison's medium Scissor Kick goes faster (not in normal mode) code:80e260/0a cheat description:M. Bison's light Scissor Kick goes slower (not in normal mode) code:80e25e/01 cheat description:M. Bison's light Scissor Kick goes faster (not in normal mode) code:80e25e/0a cheat description:Balrog's first Dash Punch goes slower code:c18850/01 cheat description:Balrog's first Dash Punch goes faster code:c18850/0b cheat description:Balrog's first Turn Punch goes slower (and a little backward) code:80e2d5/02 cheat description:Balrog's first Turn Punch goes faster code:80e2d5/0a cheat description:Chun Li's hard Whirlwind Kick goes farther code:80e1b6/0a cheat description:Chun Li's medium Whirlwind Kick doesn't go as far code:80e1b4/01 cheat description:Chun Li's medium Whirlwind Kick goes farther code:80e1b4/0a cheat description:Chun Li's light Whirlwind Kick doesn't go as far code:80e1b2/01 cheat description:Chun Li's light Whirlwind Kick goes farther code:80e1b2/0a cheat description:Blanka's hard Rolling Attack goes slower code:80e198/01 cheat description:Blanka's hard Rolling Attack goes faster code:80e198/0a cheat description:Blanka's medium Rolling Attack goes slower code:80e196/01 cheat description:Blanka's medium Rolling Attack goes faster code:80e196/0a cheat description:Blanka's light Rolling Attack goes slower code:80e194/01 cheat description:Blanka's light Rolling Attack goes faster code:80e194/0a cheat description:Blanka's hard Vertical Rolling Attack doesn't go as far code:80e1a1/01 cheat description:Blanka's hard Vertical Rolling Attack goes out farther code:80e1a1/0c cheat description:Blanka's medium Vertical Rolling Attack doesn't go as far code:80e19f/01 cheat description:Blanka's medium Vertical Rolling Attack goes out farther code:80e19f/0c cheat description:Blanka's light Vertical Rolling Attack doesn't go as far code:80e19d/01 cheat description:Blanka's light Vertical Rolling Attack goes out farther code:80e19d/0c cheat description:Start with 90 seconds code:80c1ee/90 cheat description:Start with 70 seconds code:80c1ee/70 cheat description:Start with 50 seconds code:80c1ee/50 cheat description:Start with 30 seconds code:80c1ee/30 cheat description:Start with 10 seconds code:80c1ee/10 cheat description:Start with 3/4 health code:c0536e/84 cheat description:Start with 1/2 health code:c0536e/58 cheat description:Start with 1/4 health code:c0536e/2c cheat description:1st bonus round is 99 seconds code:80c1f0/99 cheat description:1st bonus round is 80 seconds code:80c1f0/80 cheat description:1st bonus round is 60 seconds code:80c1f0/60 cheat description:1st bonus round is 20 seconds code:80c1f0/20 cheat description:2nd bonus round is 99 seconds code:80c1f2/99 cheat description:2nd bonus round is 80 seconds code:80c1f2/80 cheat description:2nd bonus round is 60 seconds code:80c1f2/60 cheat description:2nd bonus round is 20 seconds code:80c1f2/20 cheat description:Infinite health - P1 code:7e0530/63 cheat description:No health (disable during match) - P2 code:7e0730/00 cheat description:Infinite time (alt) code:7e18f3/99 cheat description:Select same character - both players code:7e1848/20 cheat description:Enable 10 star turbo mode (alt) code:7e1c87/32 cheat description:Dizzy from every knockdown - P1 code:7e05b3/01 cheat description:Dizzy from every knockdown - P2 code:7e07b3/01 cartridge sha256:d1f61b6bb4bb6879a4fbd2c82d77390c546ee7f821edddc884fb9cc7463ad79b name:Street Racer (USA) cheat description:Infinite time code:7e1833/00 cheat description:Secret tracks code:7e53b4/01 cheat description:P1 Infinite health code:7e1821/00 cheat description:P1 Infinite health (alt) code:7e5382/00 cheat description:P2 Infinite health code:7e1823/00 cheat description:P2 Infinite health (alt) code:7e5384/00 cheat description:P3 Infinite health code:7e1825/00 cheat description:P3 Infinite health (alt) code:7e5386/00 cheat description:P4 Infinite health code:7e1827/00 cheat description:P4 Infinite health (alt) code:7e5388/00 cheat description:P1 Infinite Nitros code:7e16f1/63 cheat description:P1 No Nitros code:7e16f1/00 cheat description:P2 Infinite Nitros code:7e16f3/63 cheat description:P2 No Nitros code:7e16f3/00 cheat description:P3 Infinite Nitros code:7e16f5/63 cheat description:P3 No Nitros code:7e16f5/00 cheat description:P4 Infinite Nitros code:7e16f7/63 cheat description:P4 No Nitros code:7e16f7/00 cheat description:P1 Infinite credits code:7e1d2a/03 cheat description:P2 Infinite credits code:7e1d2c/03 cheat description:P3 Infinite credits code:7e1d2e/03 cheat description:P4 Infinite credits code:7e1d30/03 cheat description:P1 No weapons code:7e5372/00 cheat description:P2 No weapons code:7e5374/00 cheat description:P3 No weapons code:7e5376/00 cheat description:P4 No weapons code:7e5378/00 cheat description:P1 No fighting code:7e537a/00 cheat description:P2 No fighting code:7e537c/00 cheat description:P3 No fighting code:7e537e/00 cheat description:P4 No fighting code:7e5380/00 cheat description:P1 No collisions code:7e538a/00 cheat description:P2 No collisions code:7e538c/00 cheat description:P3 No collisions code:7e538e/00 cheat description:P4 No collisions code:7e5390/00 cheat description:P1 On last lap code:7e1bcf/05 cheat description:P2 On last lap code:7e1bd1/05 cheat description:P3 On last lap code:7e1bd3/05 cheat description:P4 On last lap code:7e1bd5/05 cartridge sha256:05f14e6ed3394d9273e2397769a8acf1a9db646be6066e82269521e8eec53562 name:Strike Gunner S.T.G (USA) cheat description:Infinite lives - P1 code:00952e/ad cheat description:Infinite lives - P2 code:0095ba/ad cheat description:Infinite continues code:1e80d7/ad cheat description:Infinite special weapon energy - P1 code:00f0ca/ad cheat description:Infinite special weapon energy - P2 code:00f123/ad cheat description:Hit anywhere - main weapon code:00d46a/24+00d46f/24+00e7fb/24+00e7e8/80+00e7e0/80 cheat description:Start on stage 2 code:008059/a9+00805a/01+00805b/ea cheat description:Start on stage 3 code:008059/a9+00805a/02+00805b/ea cheat description:Start on stage 4 code:008059/a9+00805a/03+00805b/ea cheat description:Start on stage 5 code:008059/a9+00805a/04+00805b/ea cheat description:Start on stage 6 code:008059/a9+00805a/05+00805b/ea cheat description:Invincibility after first life - P1 code:7e024e/05 cheat description:Invincibility after first life - P2 code:7e024f/05 cartridge sha256:c04d80b84514202ff319384ca20641eb0189e975eed5612915bd9c224b2ab30a name:Stunt Race FX (USA) (Rev 1) cheat description:Always first place code:07ddfc/6b cheat description:Choose any car code:0bc7f0/d0 cheat description:Infinite lives code:7e0df8/09 cheat description:Infinite boost - P1 code:7e0e05/48+7e0e06/48 cheat description:Infinte time - minutes code:7e0e66/00 cheat description:Infinite time - seconds code:7e0e64/00 cheat description:Infinite time extended code:7e19ee/99 cheat description:Have all stars collected code:7e19ec/64 cheat description:Remove car body code:7e2005/5c cartridge sha256:e9c406d4f773697b9b671e7ddf2207c9d0ab242d7f23e502cdd453fbb264d392 name:Sunset Riders (USA) cheat description:Invincibility code:818682/ee cheat description:Infinite lives code:80e7d1/bd cheat description:Start a new game for stage select and sound test code:80887b/14 cartridge sha256:190999122aacc2cff20c5677b3f60ed938d8a36b696d16cc1bf416705efe151e name:Super Adventure Island (USA) cheat description:Infinite lives code:0090ea/ad cheat description:Infinite credits code:00a105/ad cheat description:Fruit restores full time code:0498f5/a9+0498f6/10 cheat description:Super-jump (don't use the game's super-jump feature) code:00b0a5/35 cheat description:Mega-jump (don't use the game's super-jump feature) code:00b0a5/24 cheat description:Hit anywhere code:03b6eb/d0+03b6ea/80+03b6e9/a5+00d161/00+03b6ec/1e cheat description:Multi-jump code:00fd26/05+00fd27/a9+00fd28/00+00fd29/fa+00fd2a/95+00fd2b/1a+00fd2c/68+00fd2d/60+00b2a8/20+00b2a9/20+00b2aa/fd+00fd20/ad+00fd21/f8+00fd22/0b+00fd23/48+00fd24/0a+00fd25/10 cheat description:Don't lose all weapon power when you die (may give you unusual weapons) code:00a34c/35+00a388/35 cheat description:Start with 1 life instead of 3 code:0086ca/00 cheat description:Start with 5 lives code:0086ca/04 cheat description:Start with 10 lives code:0086ca/09 cheat description:Start with 15 lives code:0086ca/0e cheat description:Start with 25 lives code:0086ca/18 cheat description:Start with 50 lives code:0086ca/31 cheat description:Start with 99 lives code:0086ca/62 cheat description:Start with 1 credit code:0086cf/00 cheat description:Start with 6 credits code:0086cf/05 cheat description:Start in area 1, stage 2 code:008d84/03 cheat description:Start in area 1 bonus round code:008d84/05 cheat description:Start in area 1, stage 3 code:008d84/07 cheat description:Start in area 2, stage 1 code:008d84/0a cheat description:Start in area 2, stage 2 code:008d84/0c cheat description:Start in area 2 bonus round code:008d84/0e cheat description:Start in area 2, stage 3 code:008d84/11 cheat description:Start in area 3, stage 1 code:008d84/14 cheat description:Start in area 3, stage 2 code:008d84/18 cheat description:Start in area 3, stage 3 code:008d84/1a cheat description:Start in area 4, stage 1 code:008d84/1d cheat description:Start in area 4, stage 2 code:008d84/1f cheat description:Start in area 4 bonus round code:008d84/20 cheat description:Start in area 4, stage 3 code:008d84/24 cheat description:Start in area 5, stage 1 code:008d84/27 cheat description:Start in area 5, stage 2 code:008d84/29 cheat description:Start in area 5, stage 3 code:008d84/2b cheat description:Start in area 5, bonus round code:008d84/2d cheat description:Invincibility and Infinite time code:7e0d6b/ff cheat description:Invincibility and always have Skateboard (disable at end of level) code:7e0d6f/01 cheat description:Infinite time (disable at end of level) code:7e0d6c/11 cheat description:Infinite lives (alt) code:7e030d/03 cheat description:Have Boomerang after obtaining any weapon icon code:7e0d75/01 cheat description:Have Fireball after obtaining any weapon icon code:7e0d75/02 cheat description:Have Boomerang Fireball after obtaining any weapon icon code:7e0d75/03 cheat description:Have Hammer after obtaining any weapon icon code:7e0d75/04 cheat description:Start on last boss code:008d84/30 cartridge sha256:eaf1b83e95d8a04f9a84d4960cf87cc182fc60ef07be35eb8929c4033d6fef67 name:Super Adventure Island II (USA) cheat description:Infinite health code:c05795/ad cheat description:Almost invincible after one hit code:c20687/ad cheat description:Stacks of cash code:c02372/a9 cheat description:Small potions don't restore health code:cf9c22/ad cheat description:Fall slowly code:c2146d/01 cheat description:Don't fall at all (disable to touch the ground again) code:c2146d/00 cheat description:Have no Weapon code:7e044d/01 cheat description:Have Silver Sword code:7e044e/01 cheat description:Have Fire Sword code:7e044f/01 cheat description:Have Ice Sword code:7e0450/01 cheat description:Have Thunder Sword code:7e0451/01 cheat description:Have Crystal Sword code:7e0452/01 cheat description:Have Power Sword code:7e0453/01 cheat description:Have Light Sword code:7e0454/01 cheat description:Have Dagger code:7e0455/01 cheat description:Have Fireballs code:7e0456/01 cheat description:Have Boomerang code:7e0457/01 cheat description:Have Ax code:7e0458/01 cheat description:Have Shovel code:7e0459/01 cheat description:Have no Armor code:7e045a/01 cheat description:Have Fire Armor code:7e045b/01 cheat description:Have Ice Armor code:7e045c/01 cheat description:Have Aqua Armor code:7e045d/01 cheat description:Have Light Armor code:7e045e/01 cheat description:Have no Shield code:7e045f/01 cheat description:Have Fire Shield code:7e0460/01 cheat description:Have Ice Shield code:7e0461/01 cheat description:Have Aqua Shield code:7e0462/01 cheat description:Have Light Shield code:7e0463/01 cheat description:Have no Equipment code:7e0465/01 cheat description:Have Magic Wand code:7e0464/01 cheat description:Have Ice Bell code:7e0466/01 cheat description:Have Sun Ring code:7e0467/01 cheat description:Have Power Fan code:7e0468/01 cheat description:Have Elven Flute code:7e0469/01 cheat description:Have Sky Bell code:7e046a/01 cheat description:Have Light Stone code:7e046b/01 cheat description:Have Sun Stone code:7e046c/01 cheat description:Have Star Stone code:7e046d/01 cheat description:Have Aqua Stone code:7e046e/01 cheat description:Have Moon Stone code:7e046f/01 cheat description:Have Thunder Spell code:7e0470/01 cheat description:Have Star Spell code:7e0471/01 cheat description:Have Sun Spell code:7e0472/01 cheat description:Have Aqua Spell code:7e0473/01 cheat description:Have Moon Spell code:7e0474/01 cheat description:Have Shove code:7e047d/01 cheat description:Have Up Jab code:7e047e/01 cheat description:Have Down Jab code:7e047f/01 cheat description:Light Gate down code:7e0131/01 cheat description:Sun Gate down code:7e0132/01 cheat description:Star Gate down code:7e0133/01 cheat description:Aqua Gate down code:7e0134/01 cheat description:Moon Gate down code:7e0135/01 cartridge sha256:0deb7a91fbe5848f1733ce668daaa49b0dad3d821bacc0791837c1ba15e60d7c name:Super Alfred Chicken (USA) cheat description:Infinite time code:81ac23/ad cheat description:Infinite lives code:819fa4/ad cheat description:Infinite lives (alt) code:7e0012/04 cheat description:Infinite time (alt) code:7e0017/09 cheat description:Infinite balloons code:81a4e1/ad cartridge sha256:e57aa265b2fbfb7ee7f5488a3df06ae771db202d59ebbd13df8fc2db80a856f3 name:Super Back to the Future Part II (Japan) cheat description:Invincibility code:7e1401/ff cheat description:Infinite health code:7e009a/03 cartridge sha256:1622371a5a4001fff9690323e89b7a8d449cdc3cae6dcd1249f0c7dc8c651d33 name:Super Baseball Simulator 1.000 (USA) cheat description:Infinite added points code:02aa0a/00 cheat description:Fewer "HR" points to distribute - standard game code:02e8f6/3b cheat description:Fewer "R" points to distribute - standard game code:02e8f8/50 cheat description:Fewer "F" points to distribute - standard game code:02e8fa/14 cheat description:More "AV" points to distribute - moderate game code:02e91d/09 cheat description:More "HR" points to distribute - moderate game code:02e91f/01+02e91e/90 cheat description:More "R" points to distribute - moderate game code:02e920/68+02e921/01 cheat description:More "F" points to distribute - moderate game code:02e922/64 cartridge sha256:a8239355631d303ecebfd43fc14e80f148e4ac9937234e29cc87d6f939b033a0 name:Super Bases Loaded (USA) cheat description:Game lasts 1 inning code:00c36a/00+00c34e/01+00f246/01 cheat description:Game lasts 2 innings code:00c36a/02+00c34e/03+00f246/03 cheat description:Game lasts 3 innings code:00c36a/04+00c34e/05+00f246/05 cheat description:Game lasts 5 innings code:00c36a/08+00c34e/09+00f246/09 cheat description:Game lasts 7 innings code:00c36a/0c+00c34e/0d+00f246/0d cheat description:1 strike and batter is out code:00ce16/01+00cddc/00 cheat description:2 strikes and batter is out code:00ce16/02+00cddc/01 cheat description:4 strikes and batter is out code:00ce16/04+00cddc/03 cheat description:5 strikes and batter is out code:00ce16/05+00cddc/04 cheat description:7 strikes and batter is out code:00ce16/07+00cddc/06 cheat description:9 strikes and batter is out code:00ce16/09+00cddc/08 cheat description:Batter never strikes out code:00f0b5/ad cheat description:Batter walks on 1 ball code:00ce75/01+00ce3e/00 cheat description:Batter walks on 2 balls code:00ce75/02+00ce3e/01 cheat description:Batter walks on 3 balls code:00ce75/03+00ce3e/02 cheat description:Batter walks on 5 balls code:00ce75/05+00ce3e/04 cheat description:Batter walks on 6 balls code:00ce75/06+00ce3e/05 cheat description:Batter walks on 9 balls code:00ce75/09+00ce3e/08 cheat description:Batter never walks code:00f0c9/ad cheat description:1 out per inning code:00f13f/00 cheat description:2 outs per inning code:00f13f/01 cheat description:4 outs per inning code:00f13f/03 cheat description:5 outs per inning code:00f13f/04 cheat description:7 outs per inning code:00f13f/06 cheat description:9 outs per inning code:00f13f/08 cartridge sha256:b21a161fed748920e54cd72c54095416b1d999636e0388d7d147884779c52833 name:Super Bases Loaded 3 - License to Steal (USA) cheat description:No strikes code:8188f1/ad cheat description:One strike to strike out code:8188f8/01 cheat description:Ten strikes to strike out code:8188f8/0a cheat description:Infinite strikes gives P1 a homerun code:8188f2/77 cheat description:Infinite strikes gives opponent a homerun code:8188f2/78 cheat description:Walk on one ball code:818a1a/01 cheat description:Walk on ten balls code:818a1a/0a cheat description:Infinite balls gives P1 a homerun code:818a14/77 cheat description:Infinite balls gives opponent a homerun code:818a14/78 cartridge sha256:165938810948f3226f7446978fa36ae8bc781616d95b39cd126d5c8afbf6e2ee name:Super Batter Up (USA) cheat description:Batter never walks code:0391d2/ad cheat description:Batter never strikes out code:039208/ad cheat description:1 ball per walk code:0391d9/01 cheat description:2 balls per walk code:0391d9/02 cheat description:3 balls per walk code:0391d9/03 cheat description:5 balls per walk code:0391d9/05 cheat description:6 balls per walk code:0391d9/06 cheat description:7 balls per walk code:0391d9/07 cheat description:1 strike per out code:03920f/01 cheat description:2 strikes per out code:03920f/02 cheat description:4 strikes per out code:03920f/04 cheat description:5 strikes per out code:03920f/05 cartridge sha256:b68e865b0b5fe6af421a171e94fb1cb0006ae3e412b6361f6f858c44adaa304b name:Super Battletank 2 (USA) cheat description:Infinite hits code:7e00ad/00 cheat description:Infinite health in 3rd person mode code:7e0a2a/00 cheat description:Infinite 120mm bullets code:7e10e3/09 cheat description:Infinite 120mm bullets in 3rd person mmode code:7e0a10/09 cheat description:Infinite 7.62mm bullets code:7e10e7/09 cheat description:Infinite 7.62mm bullets in 3rd person mode code:7e0a0e/09 cheat description:Infinite Phalanx code:7e10e8/09 cheat description:Infinite Scope code:7e10e9/09 cheat description:Infinite Smoke code:7e10e6/09 cheat description:Infinite LGM code:7e10e5/09 cheat description:Infinite Patriot code:7e10e4/09 cartridge sha256:4efab3f49cbe91ec77b6cba747ddfedfdc0b080c755a8b6ba51234f0676c000f name:Super Bomberman (USA) cheat description:Invincibility (normal game) code:c414ac/b5 cheat description:Infinite lives (normal game) code:c419fe/b5 cheat description:Invincibility - P1 code:7e0d79/80 cheat description:Invincibility - P2 code:7e0db9/80 cheat description:Invincibility - P3 code:7e0df9/80 cheat description:Invincibility - P4 code:7e0e39/80 cheat description:Invincibility, Kick Bomb, Punch Glove, Bomb Walk, Brick Walk - P1 code:7e0d79/e3 cheat description:Invincibility, Kick Bomb, Punch Glove, Bomb Walk, Brick Walk - P2 code:7e0db9/e3 cheat description:Invincibility, Kick Bomb, Punch Glove, Bomb Walk, Brick Walk - P3 code:7e0df9/e3 cheat description:Invincibility, Kick Bomb, Punch Glove, Bomb Walk, Brick Walk - P4 code:7e0e39/e3 cheat description:Infinite time code:7e0d3b/ff cheat description:Infinite lives - P1 code:7e0d7d/09 cheat description:Infinite lives - P2 code:7e0dbd/09 cheat description:Hit anywhere code:c60c0f/40+c60c0b/66+c60c0a/ad+c60c0c/0d cheat description:Remove all blocks code:c61aa9/01 cheat description:Max bomb power - P1 code:7e0d71/09 cheat description:Max bomb power - P2 code:7e0db1/09 cheat description:Max bomb power - P3 code:7e0df1/09 cheat description:Max bomb power - P4 code:7e0e31/09 cheat description:Max bomb quantity - P1 code:7e0d70/09 cheat description:Max bomb quantity - P2 code:7e0db0/09 cheat description:Max bomb quantity - P3 code:7e0df0/09 cheat description:Max bomb quantity - P4 code:7e0e30/09 cheat description:Max speed - P1 code:7e0d72/09 cheat description:Max speed - P2 code:7e0db2/09 cheat description:Max speed - P3 code:7e0df2/09 cheat description:Max speed - P4 code:7e0e32/09 cheat description:Have Detonator - P1 code:7e0d73/09 cheat description:Have Detonator - P2 code:7e0db3/09 cheat description:Have Detonator - P3 code:7e0df3/09 cheat description:Have Detonator - P4 code:7e0e33/09 cheat description:Have red bombs - P1 code:7e0d78/09 cheat description:Have red bombs - P2 code:7e0db8/09 cheat description:Have red bombs - P3 code:7e0df8/09 cheat description:Have red bombs - P4 code:7e0e38/09 cheat description:Have 9,000,000 points - P1 code:7e0d5b/09 cheat description:Have 9,000,000 points - P2 code:7e0d9b/09 cartridge sha256:0a4b4a783a7faf6ada3e1326ecf85de77e8c2a171659b42a78a1fae43f806ca6 name:Super Bomberman 2 (USA) cheat description:Invincibility - P1 code:7e80ef/01 cheat description:Invincibility - P2 code:7e81ef/01 cheat description:Invincibility - P3 code:7e82ef/01 cheat description:Invincibility - P4 code:7e83ef/01 cheat description:Infinite time code:7e5e12/3b cheat description:Infinite lives code:7e1c6c/09 cheat description:Hit anywhere code:c150d4/40+c150d6/d0+c150d3/29+c150d0/c4+c150cf/a5 cheat description:Walk through chests code:c0b3f4/97 cheat description:Move fast code:7e80f0/02 cheat description:Move faster code:7e80f0/03 cheat description:Move fastest code:7e80f0/04 cheat description:Max bomb power - P1 code:7e80f2/09 cheat description:Max bomb power - P2 code:7e81f2/09 cheat description:Max bomb power - P3 code:7e82f2/09 cheat description:Max bomb power - P4 code:7e83f2/09 cheat description:Max bomb quantity - P1 code:7e80f1/09 cheat description:Max bomb quantity - P2 code:7e81f1/09 cheat description:Max bomb quantity - P3 code:7e82f1/09 cheat description:Max bomb quantity - P4 code:7e83f1/09 cheat description:Max speed - P1 code:7e80f0/06 cheat description:Max speed - P2 code:7e81f0/06 cheat description:Max speed - P3 code:7e82f0/06 cheat description:Max speed - P4 code:7e83f0/06 cheat description:Have Detonator - P1 code:7e80f3/01 cheat description:Have Detonator - P2 code:7e81f3/01 cheat description:Have Detonator - P3 code:7e82f3/01 cheat description:Have Detonator - P4 code:7e83f3/01 cheat description:Have Power Bombs - P1 code:7e80f3/02 cheat description:Have Power Bombs - P2 code:7e81f3/02 cheat description:Have Power Bombs - P3 code:7e82f3/02 cheat description:Have Power Bombs - P4 code:7e83f3/02 cheat description:Have Super Bombs - P1 code:7e80f3/04 cheat description:Have Super Bombs - P2 code:7e81f3/04 cheat description:Have Super Bombs - P3 code:7e82f3/04 cheat description:Have Super Bombs - P4 code:7e83f3/04 cheat description:Have Gel Bombs - P1 code:7e80f3/08 cheat description:Have Gel Bombs - P2 code:7e81f3/08 cheat description:Have Gel Bombs - P3 code:7e82f3/08 cheat description:Have Gel Bombs - P4 code:7e83f3/08 cheat description:Have Punch Glove - P1 code:7e80fe/01 cheat description:Have Punch Glove - P2 code:7e81fe/01 cheat description:Have Punch Glove - P3 code:7e82fe/01 cheat description:Have Punch Glove - P4 code:7e83fe/01 cheat description:Have Kick Bomb - P1 code:7e80ff/01 cheat description:Have Kick Bomb - P2 code:7e81ff/01 cheat description:Have Kick Bomb - P3 code:7e82ff/01 cheat description:Have Kick Bomb - P4 code:7e83ff/01 cheat description:Have Bomb Walk - P1 code:7e80fa/01 cheat description:Have Bomb Walk - P2 code:7e81fa/01 cheat description:Have Bomb Walk - P3 code:7e82fa/01 cheat description:Have Bomb Walk - P4 code:7e83fa/01 cheat description:Have Brick Walk - P1 code:7e80fb/01 cheat description:Have Brick Walk - P2 code:7e81fb/01 cheat description:Have Brick Walk - P3 code:7e82fb/01 cheat description:Have Brick Walk - P4 code:7e83fb/01 cheat description:Have Poison Status - P1 code:7e80f5/01 cheat description:Have Poison Status - P2 code:7e81f5/01 cheat description:Have Poison Status - P3 code:7e82f5/01 cheat description:Have Poison Status - P4 code:7e83f5/01 cheat description:Have 4,000,000 points - P1 code:7e5def/a7 cheat description:Have 9,000,000 points - P2 code:7e0d9b/09 cheat description:Jump ability in battle-mode - all players code:7e1c00/02+efff04/32 cartridge sha256:21d4a72461d8680cf75cf3b8eba42e13127815bc17b6249d89a5e39beb3f1406 name:Super Bonk (USA) cheat description:Invincibility code:82c3af/60+819378/80+819353/80 cheat description:Infinite lives code:82f82f/ad cheat description:Infinite max life code:7e101c/1e cheat description:Max life code:7e101d/1e cheat description:Always have 99 lives code:7e101e/63 cheat description:Always have 99 Smileys code:7e1022/63 cheat description:Press up to fly on any level code:82ec65/a9+82ec67/ea cheat description:Hit anywhere code:8191ee/80+88a589/00 cartridge sha256:946de556b4f877e54e16b5c828db89c038e50349cfd0ddf8ea96b6541f9d70fa name:Super Bowling (USA) cheat description:No spin on ball code:00a9ca/2c cheat description:Faster spin meter code:00a073/06 cheat description:Slower spin meter code:00a073/02 cheat description:Really slow spin meter code:00a073/01 cheat description:Faster power meter code:00a078/06 cheat description:Slower power meter code:00a078/02 cheat description:Really slow power meter code:00a078/01 cartridge sha256:dc233b2805f7f73b454b53e45eef50df18932a1753fc0b7bc846bbd70a8993c3 name:Super Buster Bros. (USA) (Rev 1) cheat description:Extra credit after 2 food items instead of 10 code:01d39c/02 cheat description:Extra credit after 4 food items code:01d39c/04 cheat description:Extra credit after 6 food items code:01d39c/06 cheat description:Extra credit after 8 food items code:01d39c/08 cheat description:Food items never earn extra credit code:01d39a/ea cheat description:Invincibility code:7e0100/05 cheat description:Shield always on code:7e0134/02 cheat description:Normal shot code:7e0131/00 cheat description:Double shot code:7e0131/02 cheat description:Grappling shot code:7e0131/04 cheat description:Gun shot code:7e0131/06 cartridge sha256:5965bde449ff775c1a0d9fd3cf2fb8c51a86b44ad1942dfb5c14a91f103be030 name:Super Buster Bros. (USA) cheat description:Infinite lives code:0099df/00 cheat description:Infinite credits code:009a51/a5 cheat description:Clock runs faster code:00b9e2/19 cheat description:Clock runs slower code:00b9e2/64 cheat description:Clock runs much slower code:00b9e2/c8 cheat description:Clock is frozen (no time limit) code:00b9ed/00 cheat description:Food items never earn extra credit code:01d39a/ea cheat description:Double harpoon pick-up gives you machine gun code:02bf23/06 cheat description:Retain weapon after dying or advancing thru stages code:0282f4/a5 cheat description:Panic mode has 2 levels instead of 99 code:00b840/03+00b865/03 cheat description:Panic mode has 5 levels code:00b840/06+00b865/06 cheat description:Panic mode has 10 levels code:00b840/0b+00b865/0b cheat description:Panic mode has 20 levels code:00b840/15+00b865/15 cheat description:Extra credit after 2 food items instead of 10 code:01d39c/02 cheat description:Extra credit after 4 food items code:01d39c/04 cheat description:Extra credit after 6 food items code:01d39c/06 cheat description:Extra credit after 8 food items code:01d39c/08 cheat description:1 credit code:038161/00 cheat description:2 credits code:038161/01 cheat description:3 credits code:038161/02 cheat description:4 credits code:038161/03 cheat description:6 credits code:038161/05 cheat description:8 credits code:038161/07 cheat description:No credits code:038161/ff cheat description:Start with 2 lives code:038160/01 cheat description:Start with 3 lives code:038160/02 cheat description:Start with 5 lives code:038160/04 cheat description:Start with 6 lives code:038160/05 cheat description:Start with 8 lives code:038160/07 cheat description:Start with 10 lives code:038160/09 cheat description:Start with 1 life code:038160/00 cheat description:Invincibility code:7e0100/05 cheat description:Shield always on code:7e0134/02 cheat description:Normal shot code:7e0131/00 cheat description:Double shot code:7e0131/02 cheat description:Grappling shot code:7e0131/04 cheat description:Gun shot code:7e0131/06 cartridge sha256:d42f8c7969b4c434f9ca04ce0080d897877a5e71c2926d309ef5dae93ba25548 name:Super Caesars Palace (USA) cheat description:Infinite 999 gold chips code:7e188e/e7+7e188f/03 cheat description:Access all high roller areas code:7e0c30/0f cartridge sha256:0ef6f4cce5a2273fa49fe1ce724e0048a8e39c91da6b00dbb693fe1ba909177d name:Super Castlevania IV (USA) cheat description:Invincibility code:00da9e/d0+00a80e/d0 cheat description:Invincibility (blinking) code:06b4fc/84+00daa0/a5 cheat description:Infinite health code:00dd1c/ad cheat description:Infinite health against most enemies code:00dd1c/0d cheat description:Infinite lives (disable to get password) code:0280a2/00 cheat description:Infinite time code:028005/80 cheat description:Infinite lives code:0280a4/a5 cheat description:Infinite shots for most weapons code:00bd54/c8 cheat description:Hit anywhere (cannot use whip to grab onto things, press Y to moon jump instead) code:00dbb7/92+00dbb8/a3+00dbae/00+00db4f/80+00db66/80 cheat description:Fully powered whip with first power-up code:00df24/00 cheat description:Increase heart capacity 2.5 times code:00de93/ff+00de78/1a+00de8e/ff cheat description:Max hearts on pick-up code:00de91/00 cheat description:Double Shot gives you a Triple Shot code:00df9e/ff cheat description:Slower timer code:028003/7f cheat description:Faster timer code:028003/1f cheat description:Super-jump code:00a978/10 cheat description:Mega-jump code:00a978/20 cheat description:Multi-jump code:028000/6b+00b7ca/ad+00a211/6b+00da91/28+00da92/0a+00da93/90+00da94/04+00da95/22+00da96/92+00da97/a3+00da98/00+00da99/ea cheat description:Start with and always keep Dagger code:00c6c3/a9+00c6c4/01+00c6c6/85 cheat description:Start with and always keep Axe code:00c6c3/a9+00c6c4/02+00c6c6/85 cheat description:Start with and always keep Holy Water code:00c6c3/a9+00c6c4/03+00c6c6/85 cheat description:Start with and always keep Boomerang code:00c6c3/a9+00c6c4/04+00c6c6/85 cheat description:Start with and always keep Stopwatch code:00c6c3/a9+00c6c4/05+00c6c6/85 cheat description:Start with 99 hearts - first life only code:0094e9/99 cheat description:Start with 50 hearts - first life only code:0094e9/50 cheat description:Start with 10 lives - first game only code:0094db/10 cheat description:Start with 1 life - first game only code:0094db/01 cheat description:Invincibility (blinking) (alt) code:7e00bc/0a cheat description:Infinite health (alt) code:7e13f4/10 cheat description:Infinite time (alt) code:7e13f0/99 cheat description:Infinite hearts code:7e13f2/99 cheat description:Have best whip code:7e0092/02 cheat description:Have Dagger code:7e008e/01 cheat description:Have Axe code:7e008e/02 cheat description:Have Cross code:7e008e/04 cheat description:Have Dagger code:7e008e/01 cheat description:Have Holy Water code:7e008e/03 cheat description:Have Stopwatch code:7e008e/05 cheat description:Have Triple Shot code:7e0090/02 cheat description:Start on second playthrough difficulty level code:7e0088/01 cartridge sha256:b839253b878821ff00847491d11452e933baaf303f49dd39d22e3a524ea1ff81 name:Super Chase H.Q. (USA) cheat description:Infinite health code:7e127c/ff cheat description:Infinite nitro code:7e1267/03 cheat description:Infinite time code:7e127b/89 cartridge sha256:48afb82875ed4309f871f6b14021aa82c026fb14dc8acdbcf35f71ee605771b5 name:Super Donkey Kong 2 - Dixie & Diddy (Japan) cheat description:Invincibility code:b8d0d9/24 cartridge sha256:bcced1be76ef920b562a555696bcb4583d1c8cea4d4b057cab6e0e09be8ef8c4 name:Super Double Dragon (USA) cheat description:Invincibility - both players code:02811e/60 cheat description:Invincibility - P1 code:028130/ad cheat description:Infinite lives - P1 code:01be85/ad cheat description:Infinite lives - P1 (alt) code:01be85/2c cheat description:Dragon power increases faster code:059bec/00 cheat description:Prolonged maximum dragon power code:059fde/03 cheat description:1 extra credit - 2P game A code:02b5ad/01 cheat description:9 lives - 1P game code:02b58d/09 cheat description:6 lives - 1P game code:02b58d/06 cheat description:1 life - 1P game code:02b58d/01 cheat description:9 lives - 2P game A code:02b5b2/09 cheat description:6 lives - 2P game A code:02b5b2/06 cheat description:1 life - 2P game A code:02b5b2/01 cheat description:Start on Mission 2 (enable on Mode Seclect screen, then disable) code:7e001c/14 cheat description:Start on Mission 3 (enable on Mode Seclect screen, then disable) code:7e001c/17 cheat description:Start on Mission 4 (enable on Mode Seclect screen, then disable) code:7e001c/1c cheat description:Start on Mission 5 (enable on Mode Seclect screen, then disable) code:7e001c/1d cheat description:Start on Mission 6 (enable on Mode Seclect screen, then disable) code:7e001c/1f cheat description:Start on Mission 7 (enable on Mode Seclect screen, then disable) code:7e001c/20 cartridge sha256:4decfd480780d91f70f01c70552abd25a8ac0f8f6ceb49d1a5e72ba486203afc name:Super Fire Pro Wrestling X Premium (Japan) cheat description:Infinite attribute points in wrestler edit (ignore display) code:7e16be/00 cartridge sha256:7468c271d7240cf4e0d08c16e9969a1b1b1caf5adc0e5adc568d93c92651a057 name:Super Ghouls'n Ghosts (USA) cheat description:Invincibility (disable at end of first two stages of level 3, so you can trigger the hidden end of stage marker) code:7e0276/02 cheat description:Invincibility (alt) code:01d164/00 cheat description:Never lose Armor code:7e044a/01+7e14ba/01 cheat description:Infinite time code:01b985/cd cheat description:Infinite lives code:01ab61/cd cheat description:Infinite double-jumps code:01cf7b/ad cheat description:Infinite shield hits code:02ff3a/80 cheat description:Infinite continues code:04968c/00 cheat description:Hit anywhere code:02fd1d/60+02fc7d/ad+02fbc9/ad cheat description:Very few Zombies appear code:01939a/a5 cheat description:Most Zombies carry a basket code:028c77/01+069f05/a9 cheat description:Slower timer code:01b981/5e cheat description:Faster timer code:01b981/1f cheat description:Start with 9 minutes code:01adea/09 cheat description:Start with 1 continue code:01ab49/01 cheat description:Start with 9 continues code:01ab49/09 cheat description:Invincibility (alt 2) code:7e0276/02 cheat description:Never lose Armor (alt) code:7e044a/01+7e14ba/01 cheat description:Infinite time (alt) code:7e02a9/01 cheat description:Infinite lives (alt) code:7e02a4/02 cheat description:Infinite double-jumps (alt) code:7e14bc/00 cheat description:Super-jump code:7e0458/0f cheat description:Run faster code:7e0453/02 cheat description:900,000 points code:7e0295/09 cheat description:Have no Armor code:7e14ba/00 cheat description:Have regular Armor code:7e14ba/01 cheat description:Have Green Armor code:7e14ba/02 cheat description:Have Gold Armor code:7e14ba/04 cheat description:Have Javelin code:7e14d3/00 cheat description:Have Blue Fire Javelin code:7e14d3/01 cheat description:Have Quick Dagger code:7e14d3/02 cheat description:Have Laser Dagger code:7e14d3/03 cheat description:Have Crossbow code:7e14d3/04 cheat description:Have Crossbow with Homing Arrows code:7e14d3/05 cheat description:Have Scythe code:7e14d3/06 cheat description:Have Scythe level 2 code:7e14d3/07 cheat description:Have Torch code:7e14d3/08 cheat description:Have Torch level 2 code:7e14d3/09 cheat description:Have Axe code:7e14d3/0a cheat description:Have Double Edge Axe code:7e14d3/0b cheat description:Have Dagger with L-shaped path code:7e14d3/0c cheat description:Have Shuriken with L-shaped path code:7e14d3/0d cheat description:Have Goddess Ring code:7e14d3/0e cheat description:Stage select enabled (in options menu) code:7e02b9/32+7e02ba/16 cartridge sha256:33dda5838264c93341ef865512e4b86e16fd4a0387eda04e331517bfaecf1c0b name:Super Godzilla (USA) cheat description:Infinite health - Battle code:268d20/ad cheat description:Infinite health - Map code:01d407/ad cheat description:Infinite time code:01d2ff/ae cartridge sha256:3f8efb19eae68f24feb42c018b7dc7a819bfd8d993ab36899681caa7ee94b06e name:Super James Pond (USA) cheat description:Infinite health code:7eb130/03 cheat description:Infinite lives code:7eb12e/03 cartridge sha256:a9e3e57d591e995e8e0dd228b619b6aed42205eaf55316fa8ff33f236b3a32b3 name:Super Mario All-Stars (USA) cheat description:SMB - Invincibility (Starman effect) code:03de9c/d5 cheat description:SMB - Invincibility does not last as long code:03de13/08 cheat description:SMB - Invincibility lasts longer code:03de13/50 cheat description:SMB - Infinite lives code:03a06b/ad cheat description:SMB - Infinite time code:03b825/80 cheat description:SMB - Fireballs hit anywhere code:03dcb8/24 cheat description:SMB - Fireballs can kill Bullet Bill code:03dd7f/24 cheat description:SMB - Fireballs can kill Buzzy Beetle code:03dcf2/80 cheat description:SMB - Run without holding the dash button code:03b5a1/80 cheat description:SMB - 1-up worth nothing code:048596/ad cheat description:SMB - Jump lower (disable if you get stuck) code:03b561/a9+03b562/fd+03b563/ea cheat description:SMB - Super-jump code:03b561/a9+03b562/fa+03b563/ea cheat description:SMB - Mega-jump code:03b561/a9+03b562/f8+03b563/ea cheat description:SMB - Multi-jump code:03b4fc/d0 cheat description:SMB - Allows you to select any world for File A code:700010/07 cheat description:SMB - Start File A game with 2 lives code:700013/01 cheat description:SMB - Start File A game with 10 lives code:700013/09 cheat description:SMB - Start File A game with 50 lives code:700013/31 cheat description:SMB - Start File A game with 100 lives code:700013/63 cheat description:SMB - Invincibility (Starman) code:7e07af/0f cheat description:SMB - Infinite lives (alt) code:7e075a/05 cheat description:LL - Invincible against most enemies code:0dddca/d5 cheat description:LL - Invincibility (get a power-up when an enemy touches you) code:0dddc2/b5 cheat description:LL - Infinite time code:0db5b5/60 cheat description:LL - Multi-jump code:0db286/00 cheat description:LL - Run without holding the dash button code:0db348/80 cheat description:LL - Death Mushrooms are 1-Ups code:0dbd59/af cheat description:LL - There are no Death Mushrooms code:0dbd59/ad cheat description:LL - All breakable bricks are coins when you're small code:0dbd6d/ad cheat description:LL - Allows you to select any world or level for File A code:700019/0c+70001a/03 cheat description:LL - Start File A game with 2 lives code:70001c/01 cheat description:LL - Start File A game with 10 lives code:70001c/09 cheat description:LL - Start File A game with 50 lives code:70001c/31 cheat description:LL - Start File A game with 100 lives code:70001c/63 cheat description:LL - Invincibility (blinking) code:7e07ae/0f cheat description:LL - Invincibility (Star effect) code:7e07af/0f cheat description:LL - Always Fiery Mario code:7e0756/02 cheat description:LL - Coins are worth 10 code:7e07df/09 cheat description:SMB2 - Infinite lives code:1280ff/ad cheat description:SMB2 - Infinite hearts code:12e2d6/00 cheat description:SMB2 - Hit anywhere code:12df40/43+12df3d/e0+12df3e/00 cheat description:SMB2 - Multi-jump - all characters code:12828a/05 cheat description:SMB2 - Float - all characters code:12833f/8d cheat description:SMB2 - Jumping in place charges super jump code:128346/3c cheat description:SMB2 - Run without holding the dash button code:128449/00+12845b/00 cheat description:SMB2 - Allows you to select any world for File A code:700021/06 cheat description:SMB2 - 1 life after continue code:11816c/01 cheat description:SMB2 - 9 lives after continue code:11816c/09 cheat description:SMB2 - 25 lives after continue code:11816c/19 cheat description:SMB2 - 50 lives after continue code:11816c/32 cheat description:SMB2 - 99 lives after continue code:11816c/63 cheat description:SMB2 - Continue with 3 hearts instead of 2 code:118b97/01 cheat description:SMB2 - Continue with 4 hearts code:118b97/02 cheat description:SMB2 - Invincibility code:7e0085/3b cheat description:SMB2 - Infinite float time - all characters code:7e04ca/ff cheat description:SMB2 - Always big code:7e04c3/1f cheat description:SMB2 - Always small code:7e04c3/0f cheat description:SMB3 - Infinite lives code:20919a/bd cheat description:SMB3 - Infinite time code:29e601/80 cheat description:SMB3 - Infinite items code:29dd18/ad cheat description:SMB3 - Infinite flying time code:23cb26/ff cheat description:SMB3 - Fly at any time (run meter always full) code:23cb1f/00 cheat description:SMB3 - Fireballs hit anywhere code:27b8ec/24+27b90c/24 cheat description:SMB3 - Fireballs can kill most enemies code:27b926/24 cheat description:SMB3 - Tail hits anywhere code:27a62b/24 cheat description:SMB3 - Multi-jump code:23cacd/24 cheat description:SMB3 - Multi-jump (alt) code:23cac9/80 cheat description:SMB3 - Power-jump code:21eafd/c0 cheat description:SMB3 - Super-jump code:21eafd/b8 cheat description:SMB3 - Mega-jump code:21eafd/b0 cheat description:SMB3 - Ultra power-jump code:21eafd/a8 cheat description:SMB3 - Mega power-jump code:23cb51/00 cheat description:SMB3 - Change to Big Mario whenever you go to the map code:208f59/a9+208f5a/01 cheat description:SMB3 - Change to Fire Mario whenever you go to the map code:208f59/a9+208f5a/02 cheat description:SMB3 - Change to Raccoon Mario whenever you go to the map code:208f59/a9+208f5a/03 cheat description:SMB3 - Change to Frog Mario whenever you go to the map code:208f59/a9+208f5a/04 cheat description:SMB3 - Change to Tanooki Mario whenever you go to the map code:208f59/a9+208f5a/05 cheat description:SMB3 - Change to Sledgehammer Mario when you go to the map code:208f59/a9+208f5a/06 cheat description:SMB3 - All power-ups turn you into Shoe Mario code:23c269/04+23c0e1/f6 cheat description:SMB3 - Collisions turn you into Big Mario code:23c2bb/02 cheat description:SMB3 - Collisions turn you into Fiery Mario code:23c2bb/03 cheat description:SMB3 - Collisions turn you into Raccoon Mario code:23c2bb/04 cheat description:SMB3 - Collisions turn you into Frog Mario code:23c2bb/05 cheat description:SMB3 - Collisions turn you into Tanooki Mario code:23c2bb/06 cheat description:SMB3 - Collisions turn you into Sledgehammer Mario code:23c2bb/07 cheat description:SMB3 - After getting star, invincible until end of level (may have to disable to jump) code:20e29d/ad cheat description:SMB3 - 1 life after continue code:209497/01 cheat description:SMB3 - 10 lives after continue code:209497/09 cheat description:SMB3 - 26 lives after continue code:209497/19 cheat description:SMB3 - 51 lives after continue code:209497/32 cheat description:SMB3 - 100 lives after continue code:209497/63 cheat description:SMB3 - Gain lots of lives with each 5 coins code:29e6f8/05 cheat description:SMB3 - 5 coins needed for an extra life code:29e6fd/05 cheat description:SMB3 - 10 coins needed for an extra life code:29e6fd/0a cheat description:SMB3 - 25 coins needed for an extra life code:29e6fd/19 cheat description:SMB3 - 50 coins needed for an extra life code:29e6fd/32 cheat description:SMB3 - Move anywhere on the world map code:238e5e/80+238ab0/80 cheat description:SMB3 - Re-enter already beaten levels code:218ce3/00 cheat description:SMB3 - Re-enter already beaten fortresses code:218ce2/60 cheat description:SMB3 - Re-enter already beaten mushroom houses and special levels code:218ce1/40 cheat description:SMB3 - Select any world for File A game code:70002a/07 cheat description:SMB3 - Start and continue as Big Mario code:23c0e1/f6 cheat description:SMB3 - Enable debug mode (in game) code:7e0160/80 cheat description:SMB3 - Invincibility code:7e0552/80 cheat description:SMB3 - Invincibility (Starman) code:7e0553/ff cheat description:SMB3 - Always Small Mario code:7e00bb/00 cheat description:SMB3 - Always Big Mario code:7e00bb/01 cheat description:SMB3 - Always Fiery Mario code:7e00bb/02 cheat description:SMB3 - Always Raccoon Mario code:7e00bb/03 cheat description:SMB3 - Always Frog Mario code:7e00bb/04 cheat description:SMB3 - Always Tanooki Mario code:7e00bb/05 cheat description:SMB3 - Always Hammer Bros. Mario code:7e00bb/06 cheat description:SMB3 - Have Magic Whistle code:7e1d80/0c cheat description:SMB3 - Raccoon and Tanooki have P-Wing code:7e056e/ff cheat description:SMB3 - Fly for an unlimited amount of time code:23cb26/ff cartridge sha256:a8806bfe07cd3c9945d9fd3fcea932ae1cd671cab5cae12bb7a2ae726cbf9175 name:Super Mario All-Stars + Super Mario World (USA) cheat description:SMB - Invincibility (Starman effect) code:03de9c/d5 cheat description:SMB - Invincibility does not last as long code:03de13/08 cheat description:SMB - Invincibility lasts longer code:03de13/50 cheat description:SMB - Infinite lives code:03a06b/ad cheat description:SMB - Infinite time code:03b825/80 cheat description:SMB - Fireballs hit anywhere code:03dcb8/24 cheat description:SMB - Fireballs can kill Bullet Bill code:03dd7f/24 cheat description:SMB - Fireballs can kill Buzzy Beetle code:03dcf2/80 cheat description:SMB - Run without holding the dash button code:03b5a1/80 cheat description:SMB - 1-up worth nothing code:048596/ad cheat description:SMB - Jump lower (disable if you get stuck) code:03b561/a9+03b562/fd+03b563/ea cheat description:SMB - Super-jump code:03b561/a9+03b562/fa+03b563/ea cheat description:SMB - Mega-jump code:03b561/a9+03b562/f8+03b563/ea cheat description:SMB - Multi-jump code:03b4fc/d0 cheat description:SMB - Allows you to select any world for File A code:700010/07 cheat description:SMB - Start File A game with 2 lives code:700013/01 cheat description:SMB - Start File A game with 10 lives code:700013/09 cheat description:SMB - Start File A game with 50 lives code:700013/31 cheat description:SMB - Start File A game with 100 lives code:700013/63 cheat description:SMB - Invincibility (Starman) code:7e07af/0f cheat description:SMB - Infinite lives (alt) code:7e075a/05 cheat description:LL - Invincible against most enemies code:0dddca/d5 cheat description:LL - Invincibility (get a power-up when an enemy touches you) code:0dddc2/b5 cheat description:LL - Infinite time code:0db5b5/60 cheat description:LL - Multi-jump code:0db286/00 cheat description:LL - Run without holding the dash button code:0db348/80 cheat description:LL - Death Mushrooms are 1-Ups code:0dbd59/af cheat description:LL - There are no Death Mushrooms code:0dbd59/ad cheat description:LL - All breakable bricks are coins when you're small code:0dbd6d/ad cheat description:LL - Allows you to select any world or level for File A code:700019/0c+70001a/03 cheat description:LL - Start File A game with 2 lives code:70001c/01 cheat description:LL - Start File A game with 10 lives code:70001c/09 cheat description:LL - Start File A game with 50 lives code:70001c/31 cheat description:LL - Start File A game with 100 lives code:70001c/63 cheat description:LL - Invincibility (blinking) code:7e07ae/0f cheat description:LL - Invincibility (Star effect) code:7e07af/0f cheat description:LL - Always Fiery Mario code:7e0756/02 cheat description:LL - Coins are worth 10 code:7e07df/09 cheat description:SMB2 - Infinite lives code:1280ff/ad cheat description:SMB2 - Infinite hearts code:12e2d6/00 cheat description:SMB2 - Hit anywhere code:12df40/43+12df3d/e0+12df3e/00 cheat description:SMB2 - Multi-jump - all characters code:12828a/05 cheat description:SMB2 - Float - all characters code:12833f/8d cheat description:SMB2 - Jumping in place charges super jump code:128346/3c cheat description:SMB2 - Run without holding the dash button code:128449/00+12845b/00 cheat description:SMB2 - Allows you to select any world for File A code:700021/06 cheat description:SMB2 - 1 life after continue code:11816c/01 cheat description:SMB2 - 9 lives after continue code:11816c/09 cheat description:SMB2 - 25 lives after continue code:11816c/19 cheat description:SMB2 - 50 lives after continue code:11816c/32 cheat description:SMB2 - 99 lives after continue code:11816c/63 cheat description:SMB2 - Continue with 3 hearts instead of 2 code:118b97/01 cheat description:SMB2 - Continue with 4 hearts code:118b97/02 cheat description:SMB2 - Invincibility code:7e0085/3b cheat description:SMB2 - Infinite float time - all characters code:7e04ca/ff cheat description:SMB2 - Always big code:7e04c3/1f cheat description:SMB2 - Always small code:7e04c3/0f cheat description:SMB3 - Infinite lives code:20919a/bd cheat description:SMB3 - Infinite time code:29e601/80 cheat description:SMB3 - Infinite items code:29dd18/ad cheat description:SMB3 - Infinite flying time code:23cb26/ff cheat description:SMB3 - Fly at any time (run meter always full) code:23cb1f/00 cheat description:SMB3 - Fireballs hit anywhere code:27b8ec/24+27b90c/24 cheat description:SMB3 - Fireballs can kill most enemies code:27b926/24 cheat description:SMB3 - Tail hits anywhere code:27a62b/24 cheat description:SMB3 - Multi-jump code:23cacd/24 cheat description:SMB3 - Multi-jump (alt) code:23cac9/80 cheat description:SMB3 - Power-jump code:21eafd/c0 cheat description:SMB3 - Super-jump code:21eafd/b8 cheat description:SMB3 - Mega-jump code:21eafd/b0 cheat description:SMB3 - Ultra power-jump code:21eafd/a8 cheat description:SMB3 - Mega power-jump code:23cb51/00 cheat description:SMB3 - Change to Big Mario whenever you go to the map code:208f59/a9+208f5a/01 cheat description:SMB3 - Change to Fire Mario whenever you go to the map code:208f59/a9+208f5a/02 cheat description:SMB3 - Change to Raccoon Mario whenever you go to the map code:208f59/a9+208f5a/03 cheat description:SMB3 - Change to Frog Mario whenever you go to the map code:208f59/a9+208f5a/04 cheat description:SMB3 - Change to Tanooki Mario whenever you go to the map code:208f59/a9+208f5a/05 cheat description:SMB3 - Change to Sledgehammer Mario when you go to the map code:208f59/a9+208f5a/06 cheat description:SMB3 - All power-ups turn you into Shoe Mario code:23c269/04+23c0e1/f6 cheat description:SMB3 - Collisions turn you into Big Mario code:23c2bb/02 cheat description:SMB3 - Collisions turn you into Fiery Mario code:23c2bb/03 cheat description:SMB3 - Collisions turn you into Raccoon Mario code:23c2bb/04 cheat description:SMB3 - Collisions turn you into Frog Mario code:23c2bb/05 cheat description:SMB3 - Collisions turn you into Tanooki Mario code:23c2bb/06 cheat description:SMB3 - Collisions turn you into Sledgehammer Mario code:23c2bb/07 cheat description:SMB3 - After getting star, invincible until end of level (may have to disable to jump) code:20e29d/ad cheat description:SMB3 - 1 life after continue code:209497/01 cheat description:SMB3 - 10 lives after continue code:209497/09 cheat description:SMB3 - 26 lives after continue code:209497/19 cheat description:SMB3 - 51 lives after continue code:209497/32 cheat description:SMB3 - 100 lives after continue code:209497/63 cheat description:SMB3 - Gain lots of lives with each 5 coins code:29e6f8/05 cheat description:SMB3 - 5 coins needed for an extra life code:29e6fd/05 cheat description:SMB3 - 10 coins needed for an extra life code:29e6fd/0a cheat description:SMB3 - 25 coins needed for an extra life code:29e6fd/19 cheat description:SMB3 - 50 coins needed for an extra life code:29e6fd/32 cheat description:SMB3 - Move anywhere on the world map code:238e5e/80+238ab0/80 cheat description:SMB3 - Re-enter already beaten levels code:218ce3/00 cheat description:SMB3 - Re-enter already beaten fortresses code:218ce2/60 cheat description:SMB3 - Re-enter already beaten mushroom houses and special levels code:218ce1/40 cheat description:SMB3 - Select any world for File A game code:70002a/07 cheat description:SMB3 - Start and continue as Big Mario code:23c0e1/f6 cheat description:SMB3 - Enable debug mode (in game) code:7e0160/80 cheat description:SMB3 - Invincibility code:7e0552/80 cheat description:SMB3 - Invincibility (Starman) code:7e0553/ff cheat description:SMB3 - Always Small Mario code:7e00bb/00 cheat description:SMB3 - Always Big Mario code:7e00bb/01 cheat description:SMB3 - Always Fiery Mario code:7e00bb/02 cheat description:SMB3 - Always Raccoon Mario code:7e00bb/03 cheat description:SMB3 - Always Frog Mario code:7e00bb/04 cheat description:SMB3 - Always Tanooki Mario code:7e00bb/05 cheat description:SMB3 - Always Hammer Bros. Mario code:7e00bb/06 cheat description:SMB3 - Have Magic Whistle code:7e1d80/0c cheat description:SMB3 - Raccoon and Tanooki have P-Wing code:7e056e/ff cheat description:SMB3 - Fly for an unlimited amount of time code:23cb26/ff cheat description:SMW - Infinite flying time for Yoshi code:01f1ad/ad cheat description:SMW - Nintendo's debug code:00cc85/00 cheat description:SMW - Invincibility code:7e1497/ff cheat description:SMW - Invincible (Starman) code:7e1490/ff cheat description:SMW - Always Small Mario code:7e0019/00 cheat description:SMW - Always Big Mario code:7e0019/01 cheat description:SMW - Always Caped Mario code:7e0019/02 cheat description:SMW - Always Fiery Mario code:7e0019/03 cheat description:SMW - Always have Yoshi code:7e0dc1/01 cheat description:SMW - Infinite time code:7e0f31/09+7e0f32/09+7e0f33/09 cheat description:SMW - Infinite P-Balloon time code:7e1891/ff cheat description:SMW - Multi-jump and float down (disable in water and to get on Yoshi) code:7e1471/01 cheat description:SMW - Jump to automatically fly code:7e13e4/70 cheat description:SMW - Activate yellow blocks (deactivate before entering the Yellow Switch Palace) code:7e1f28/01 cheat description:SMW - Activate blue blocks (deactivate before entering the Blue Switch Palace) code:7e1f29/01 cheat description:SMW - Activate red blocks (deactivate before entering the Red Switch Palace) code:7e1f2a/01 cheat description:SMW - Automatically finish level code:7e1493/01 cheat description:SMW - 8000 points for each enemy stomped code:7e1697/06 cartridge sha256:2ada8919688087be60a6a48cace8f877add60c45d2e5d09e2442faa55be62a49 name:Super Mario Kart (USA) cheat description:Invincibility code:80eaf3/6c cheat description:All karts except yours do not move code:80b048/55 cheat description:Drive through walls code:80fa93/21 cheat description:Drive through opponents code:80c283/53 cheat description:Invincibility and have a Red Shell code:7e0d70/28 cheat description:Always have Red Shell code:7e0d70/05 cheat description:Always have item code:7e0d71/c0 cheat description:Drive anywhere code:80fa93/20 cheat description:Mud and other land doesn't effect driving code:759dc8/b4 cheat description:Special Cup enabled (1P time trial and 2P match race) code:7e1d29/03 cartridge sha256:740646f3535bfb365ca44e70d46ab433467b142bd84010393070bd0b141af853 name:Super Mario RPG - Legend of the Seven Stars (USA) cheat description:Infinite tries in action sequences code:c0bcfd/c5 cheat description:Infinite HP - Character 1 code:7efa91/ff cheat description:Infinite HP - Character 2 code:7efb11/ff cheat description:Infinite HP - Character 3 code:7efb91/ff cheat description:Max HP - Character 1 code:7efa93/ff cheat description:Max HP - Character 2 code:7efb13/ff cheat description:Max HP - Character 3 code:7efb93/ff cheat description:Max Flower Points code:7efa0d/63 cheat description:Infinite Flower Points (In Battle) code:7efa0d/63+7efa0c/63 cheat description:Infinite Coins code:7ff8af/e7+7ff8b0/03 cheat description:Infinite Frog Coins code:7ff8b3/e7+7ff8b4/03 cheat description:255 EXP per battle (disable before going to the World Map or using the menu button) code:7efa02/ff cheat description:Always Mario's turn code:7e0702/00 cheat description:Mario consecutive super jumps modifier code:7ff8c0/64 cheat description:Walk through walls code:c97a55/80+c97a79/80+c97a1f/80+c979f7/80 cheat description:Mario - Level 30 code:7ff800/1e cheat description:Mario - 999 HP code:7ff801/e7+7ff802/03 cheat description:Mario - 999 Max HP code:7ff803/e7+7ff804/03 cheat description:Mario - Max Speed code:7ff805/ff cheat description:Mario - Max Attack code:7ff806/ff cheat description:Mario - Max Defense code:7ff807/ff cheat description:Mario - Max Magic Attack code:7ff808/ff cheat description:Mario - Max Magic Defense code:7ff809/ff cheat description:Mario - Max Experience code:7ff80a/0f+7ff80b/27 cheat description:Mario - Equipped Weapon code:7ff80c/1c cheat description:Mario - Equipped Armor code:7ff80d/46 cheat description:Mario - Equipped Accessory code:7ff80e/5e cheat description:Mario - Has all 'Correct' Spells code:7ff810/3f cheat description:Mallow - Level 30 code:7ff850/1e cheat description:Mallow - 999 HP code:7ff851/e7+7ff852/03 cheat description:Mallow - 999 Max HP code:7ff853/e7+7ff854/03 cheat description:Mallow - Max Speed code:7ff855/ff cheat description:Mallow - Max Attack code:7ff856/ff cheat description:Mallow - Max Defense code:7ff857/ff cheat description:Mallow - Max Magic Attack code:7ff858/ff cheat description:Mallow - Max Magic Defense code:7ff859/ff cheat description:Mallow - Max Experience code:7ff85a/0f+7ff85b/27 cheat description:Mallow - Equipped Weapon code:7ff85c/20 cheat description:Mallow - Equipped Armor code:7ff85d/46 cheat description:Mallow - Equipped Accessory code:7ff85e/5e cheat description:Mallow - has all 'correct' spells code:7ff862/e0+7ff863/07 cheat description:Geno - Level 30 code:7ff83c/1e cheat description:Geno - 999 HP code:7ff83d/e7+7ff83e/03 cheat description:Geno - 999 Max HP code:7ff83f/e7+7ff840/03 cheat description:Geno - Max Speed code:7ff841/ff cheat description:Geno - Max Attack code:7ff842/ff cheat description:Geno - Max Defense code:7ff843/ff cheat description:Geno - Max Magic Attack code:7ff844/ff cheat description:Geno - Max Magic Defense code:7ff845/ff cheat description:Geno - Max Experience code:7ff846/0f+7ff847/27 cheat description:Geno - Equipped Weapon code:7ff848/1f cheat description:Geno - Equipped Armor code:7ff849/46 cheat description:Geno - Equipped Accessory code:7ff84a/5e cheat description:Geno - Has all 'correct' spells code:7ff84e/1f cheat description:Bowser - Level 30 code:7ff828/1e cheat description:Bowser - 999 HP code:7ff829/e7+7ff82a/03 cheat description:Bowser - 999 Max HP code:7ff82b/e7+7ff82c/03 cheat description:Bowser - Max Speed code:7ff82d/ff cheat description:Bowser - Max Attack code:7ff82e/ff cheat description:Bowser - Max Defense code:7ff82f/ff cheat description:Bowser - Max Magic Attack code:7ff830/ff cheat description:Bowser - Max Magic Defense code:7ff831/ff cheat description:Bowser - Max Experience code:7ff832/0f+7ff833/27 cheat description:Bowser - Equipped Weapon code:7ff834/1e cheat description:Bowser - Equipped Armor code:7ff835/46 cheat description:Bowser - Equipped Accessory code:7ff836/5e cheat description:Bowser - Has all 'correct' spells code:7ff839/f0 cheat description:Princess - Level 30 code:7ff814/1e cheat description:Princess - 999 HP code:7ff815/e7+7ff816/03 cheat description:Princess - 999 Max HP code:7ff817/e7+7ff818/03 cheat description:Princess - Max Speed code:7ff819/ff cheat description:Princess - Max Attack code:7ff81a/ff cheat description:Princess - Max Defense code:7ff81b/ff cheat description:Princess - Max Magic Attack code:7ff81c/ff cheat description:Princess - Max Magic Defense code:7ff81d/ff cheat description:Princess - Max Experience code:7ff81e/0f+7ff81f/27 cheat description:Princess - Equipped Weapon code:7ff820/22 cheat description:Princess - Equipped Armor code:7ff821/46 cheat description:Princess - Equipped Accessory code:7ff822/5e cheat description:Princess - Has all 'correct' spells code:7ff824/c0+7ff825/0f cartridge sha256:0838e531fe22c077528febe14cb3ff7c492f1f5fa8de354192bdff7137c27f5b name:Super Mario World (USA) cheat description:Start and stay invincible most of the time code:00e2d3/00 cheat description:Invincibility - Yoshi code:01f724/b5+02a488/b5 cheat description:Infinite flying time - Yoshi code:01f1ad/ad cheat description:Infinite time (disable for puzzles that use the timer) code:008e28/ad cheat description:Infinite lives code:00d0d8/ad cheat description:Cape hits anywhere code:0293f2/24 cheat description:Fireballs hit anywhere code:02a0df/24 cheat description:Fireballs shoot straight code:00fec5/00+029fd4/00 cheat description:Fireballs turn most enemies into Flowers code:02a12a/75 cheat description:Fireballs turn most enemies into 1-Up Mushrooms code:02a12a/78 cheat description:Fireballs turn most enemies into Starmen code:02a12a/76 cheat description:Multi-jump code:00d5f4/80 cheat description:Spin jump in mid-air (hold to float down) code:00ee1e/17+00ee1f/00 cheat description:Low jump code:00d7a6/04 cheat description:Super-jump code:00d7a6/02 cheat description:Mega-jump code:00d7a6/01 cheat description:Swim in every level code:00f2c3/a9 cheat description:Press R to scroll through items in the items box code:00ce14/63+00ce1a/60+00ce17/8d+00ce0f/c2+00ce0c/c2+00ce18/c2+00ce15/a9+00ce12/06+00ce0d/0d+00ce19/0d+00ce10/0d+00ce16/01 cheat description:Little Yoshi grows after eating 1 enemy instead of 5 code:01a2fb/01 cheat description:Little Yoshi grows after eating 2 enemies code:01a2fb/02 cheat description:Little Yoshi grows after eating 3 enemies code:01a2fb/03 cheat description:Little Yoshi grows after eating 4 enemies code:01a2fb/04 cheat description:1-Up at 5 coins instead of 100 code:008f2c/05+008f37/05 cheat description:1-Up at 10 coins code:008f2c/0a+008f37/0a cheat description:1-Up at 20 coins code:008f2c/14+008f37/14 cheat description:1-Up at 50 coins code:008f2c/32+008f37/32 cheat description:1-Up at 1 dragon coin instead of 5 code:00f37f/0d cheat description:Start as Super Mario code:009e35/e6 cheat description:Start as Cape Mario code:009e32/a9+009e33/02+009e34/ea+009e35/85 cheat description:Start as Fire Mario code:009e32/a9+009e33/03+009e34/ea+009e35/85 cheat description:Start with 1 life instead of 5 code:009e25/00 cheat description:Start with 9 lives code:009e25/08 cheat description:Start with 15 lives code:009e25/0e cheat description:Start with 25 lives code:009e25/18 cheat description:Start with 50 lives code:009e25/31 cheat description:Start with 99 lives code:009e25/62 cheat description:Nintendo's Debug code:00a268/00+00a273/00 cheat description:Nintendo's Debug 2 code:00cc85/00 cheat description:Invincibility code:7e1497/ff cheat description:Invincibility (Starman) code:7e1490/ff cheat description:Infinite P-Balloon time code:7e1891/ff cheat description:Always Small Mario code:7e0019/00 cheat description:Always Big Mario code:7e0019/01 cheat description:Always Caped Mario code:7e0019/02 cheat description:Always Fiery Mario code:7e0019/03 cheat description:Always have Yoshi code:7e0dc1/01 cheat description:Always have 100 bonus points code:7e0f48/64 cheat description:Multi-jump and float down (disable in water and to get on Yoshi) code:7e1471/01 cheat description:Activate green blocks (disable before entering the Green Switch Palace) code:7e1f27/01 cheat description:Activate yellow blocks (disable before entering the Yellow Switch Palace) code:7e1f28/01 cheat description:Activate red blocks (disable before entering the Red Switch Palace) code:7e1f2a/01 cheat description:Activate blue blocks (disable before entering the Blue Switch Palace) code:7e1f29/01 cheat description:8000 points for each enemy stomped code:7e1697/06 cheat description:Reznor already defeated in all four fortresses code:7e1520/01+7e1521/01+7e1522/01+7e1523/01 cartridge sha256:bd763c1a56365c244be92e6cffefd318780a2a19eda7d5baf1c6d5bd6c1b3e06 name:Super Mario World 2 - Yoshi's Island (USA) (Rev 1) cheat description:Infinite lives code:04f6f9/ad cheat description:All levels are completed with 100 points code:108152/a9+108153/e4 cheat description:Always score 100 points code:01bec8/a9+01bec9/64+01beca/ea cheat description:Power-ups don't get used up code:01db87/60 cheat description:Mario's crying disabled code:06c64f/22 cheat description:Horizontal one-way pinball doors open from both sides code:0d9e85/80 cheat description:Infinite lives/Start at Middle Ring (when you die) code:04f6fa/ad cheat description:After using the magnifying glass, red coins and hidden items are always revealed code:01afba/ad cheat description:Red switches stay on for over twice as long code:0eb7c4/05 cheat description:Red switches stay on for over four times as long code:0eb7c4/09 cheat description:Red switches stay on for a very, very long time code:0eb7c4/7f cheat description:Disable autoscroll code:03d848/ad cheat description:Don't get crushed code:04ac9f/6b cheat description:Multi-jump code:06d06c/8e+06d06d/ab+06d06e/60+06d063/72+06d064/60+06d065/29+06d066/00+06d067/80+06d068/f0+06d069/05+06d06a/a2+06d06b/fb cheat description:Star timer doesn't decrease when hit code:7e0391/01+7e0392/00 cheat description:Mario's crying disabled (alt) code:06c64f/22 cheat description:Infinite red switch time code:7e0cec/66 cheat description:Hold B to float code:7e0945/00 cheat description:Unlock items in boss fights code:7e0b48/00 cheat description:Have Stars +10 code:7e0357/01 cheat description:Have Stars +20 code:7e0358/02 cheat description:Have POW Block code:7e0359/03 cheat description:Have full Eggs code:7e035a/04 cheat description:Have Magnifying Glass code:7e035b/05 cheat description:Have Winged Cloud code:7e035c/06 cheat description:Have Green Watermelon code:7e035d/07 cheat description:Have Blue Watermelon code:7e035e/08 cheat description:Have Red Watermelon code:7e035f/09 cheat description:Have Pink Yoshi code:7e0383/01 cheat description:Have Orange Yoshi code:7e0383/02 cheat description:Have Light Blue Yoshi code:7e0383/03 cheat description:Have Purple Yoshi code:7e0383/04 cheat description:Have Brown Yoshi code:7e0383/05 cheat description:Have Red Yoshi code:7e0383/06 cheat description:Have Dark Blue Yoshi code:7e0383/07 cheat description:Have Glow Red Yoshi code:7e0383/08 cheat description:Have Shadow Yoshi code:7e0383/09 cartridge sha256:9b4957466798bbdb5b43a450bbb60b2591ae81d95b891430f62d53ca62e8bc7b name:Super Mario World 2 - Yoshi's Island (USA) cheat description:Infinite lives code:04f6f9/ad cheat description:Infinite lives and start at middle ring when you die code:04f6fa/ad cheat description:All levels are completed with 100 points code:108152/a9+108153/e4 cheat description:Always score 100 points code:01bec8/a9+01bec9/64+01beca/ea cheat description:Power-ups don't get used up code:01db87/60 cheat description:Mario's crying disabled code:06c64f/22 cheat description:Horizontal one-way pinball doors open from both sides code:0d9e85/80 cheat description:After using the magnifying glass, red coins and hidden items are always revealed code:01afba/ad cheat description:Red switches stay on for over twice as long code:0eb7c4/05 cheat description:Red switches stay on for over four times as long code:0eb7c4/09 cheat description:Disable autoscroll code:03d848/ad cheat description:Don't get crushed code:04ac9f/6b cheat description:Multi-jump code:06d06c/8e+06d06d/ab+06d06e/60+06d063/72+06d064/60+06d065/29+06d066/00+06d067/80+06d068/f0+06d069/05+06d06a/a2+06d06b/fb cheat description:Continue with 5 lives code:10e189/0a cheat description:Continue with 10 lives code:10e189/19 cheat description:Continue with 25 lives code:10e189/32 cheat description:Continue with 50 lives code:10e189/63 cheat description:Continue with 99 lives code:10e189/63 cheat description:Start with 5 lives code:179933/05 cheat description:Start with 10 lives code:179933/0a cheat description:Start with 25 lives code:179933/19 cheat description:Start with 50 lives code:179933/32 cheat description:Start with 99 lives code:179933/63 cheat description:Star timer doesn't decrease when hit code:7e0391/01+7e0392/00 cheat description:Hold B to float code:7e0945/00 cheat description:Unlock items in boss fights code:7e0b48/00 cheat description:Infinite red switch time code:7e0cec/66 cheat description:Mario's crying disabled (alt) code:06c64f/22 cheat description:Have Stars +10 code:7e0357/01 cheat description:Have Stars +20 code:7e0358/02 cheat description:Have POW Block code:7e0359/03 cheat description:Have full Eggs code:7e035a/04 cheat description:Have Magnifying Glass code:7e035b/05 cheat description:Have Winged Cloud code:7e035c/06 cheat description:Have Green Watermelon code:7e035d/07 cheat description:Have Blue Watermelon code:7e035e/08 cheat description:Have Red Watermelon code:7e035f/09 cheat description:Have Pink Yoshi code:7e0383/01 cheat description:Have Orange Yoshi code:7e0383/02 cheat description:Have Light Blue Yoshi code:7e0383/03 cheat description:Have Purple Yoshi code:7e0383/04 cheat description:Have Brown Yoshi code:7e0383/05 cheat description:Have Red Yoshi code:7e0383/06 cheat description:Have Dark Blue Yoshi code:7e0383/07 cheat description:Have Glow Red Yoshi code:7e0383/08 cheat description:Have Shadow Yoshi code:7e0383/09 cartridge sha256:12b77c4bc9c1832cee8881244659065ee1d84c70c3d29e6eaf92e6798cc2ca72 name:Super Metroid (Japan, USA) (En,Ja) cheat description:Invincibility (except for acid and when bosses grab you) code:7e18a8/01 cheat description:Infinite energy (except for acid) code:91df71/ad cheat description:Infinite Missiles code:90bebf/ad cheat description:Infinite Super Missiles code:90bec4/ad cheat description:Infinite Power Bombs code:90c02d/ea cheat description:Infinite Power Bombs (alt) code:7e09ce/63 cheat description:Hit anywhere code:a0a1bc/24+a0976a/80+a0a1d4/80 cheat description:Super-jumps don't drain energy code:90d0ce/ad cheat description:Enemies die on contact (Speed Booster effect) code:a0a4b8/80+a0a4a4/80 cheat description:Skip intro and start on Planet Zebes on new game code:82eebb/00 cheat description:Select area when loading saved game A (press right on map screen) code:81a81a/00+81a8af/80 cheat description:Switching areas fills the map code:808597/af+80859a/03 cheat description:Automatically collect secret and/or special items in current room (Missiles, Energy Tanks, ect) code:84df92/24+84dff4/24 cheat description:Can access Tourain from sunken statues room code:7ed820/c1+7ed821/1f cheat description:Full movement in Maridia sand code:84b518/80+90981d/00 cheat description:Multi-jump (when using button A) code:90eee7/a5+90eee8/8e+90eee9/0a+90eeea/90+90eeeb/04+90eeec/22+90eeed/bc+90eeee/98+90eeef/90 cheat description:Multi-jump (when using button B) code:90eee7/a5+90eee8/8f+90eee9/0a+90eeea/90+90eeeb/04+90eeec/22+90eeed/bc+90eeee/98+90eeef/90 cheat description:Metroids can be killed without being frozen first code:a3ef1c/24+a3ef27/80 cheat description:Display entire map code:82947f/80+8294ef/80+8085ae/a9 cheat description:0 hours played code:70004e/00 cheat description:Brinstar mapped code:7ed909/ff cheat description:Crateria mapped code:7ed908/ff cheat description:Maridia mapped code:7ed90c/ff cheat description:Norfair mapped code:7ed90a/ff cheat description:Tourain mapped code:7ed90d/ff cheat description:Wrecked Ship mapped code:7ed90b/ff cheat description:Maximum 99 Power Bombs code:7e09d0/63 cheat description:Maximum 99 Super Missiles code:7e09cc/63 cheat description:Maximum Missiles=10 code:700036/0a cheat description:Maximum Missiles=100 code:700036/64 cheat description:Maximum Missiles=125 code:700036/7d cheat description:Maximum Missiles=150 code:700036/96 cheat description:Maximum Missiles=175 code:700036/af cheat description:Maximum Missiles=200 code:700036/c8 cheat description:Maximum Missiles=25 code:700036/19 cheat description:Maximum Missiles=50 code:700036/32 cheat description:Maximum Missiles=75 code:700036/4b cheat description:Maximum Power Bombs=10 code:70003e/0a cheat description:Maximum Power Bombs=25 code:70003e/19 cheat description:Maximum Power Bombs=5 code:70003e/05 cheat description:Maximum Power Bombs=50 code:70003e/32 cheat description:Maximum Super Missiles=10 code:70003a/0a cheat description:Maximum Super Missiles=25 code:70003a/19 cheat description:Maximum Super Missiles=5 code:70003a/05 cheat description:Maximum Super Missiles=50 code:70003a/32 cheat description:Start with about 500 Energy Tanks on saved game A code:700033/f3+700032/01 cheat description:Start with about 700 Energy Tanks on saved game A code:700033/bb+700032/02 cheat description:Start with about 1000 Energy Tanks on saved game A code:700033/e7+700032/03 cheat description:Start with about 1200 Energy Tanks on saved game A code:700033/af+700032/04 cheat description:Start with about 1500 Energy Tanks on saved game A code:700033/db+700032/05 cheat description:Invincibility (except for acid and when bosses grab you) (alt) code:7e18a8/4c cheat description:Infinite energy (can combine with invincibility code) code:7e09c2/63 cheat description:Kill most enemies on contact code:7e0a6e/0f cheat description:Infinite Missiles (alt) code:7e09c6/e7 cheat description:Infinite Missiles (alt 2) code:7e09c6/e7+7e09c7/03 cheat description:Maximum 999 Missiles code:7e09c8/e7+7e09c9/03 cheat description:Infinite Super Missiles (alt) code:7e09ca/50 cheat description:Infinite Power Bombs (alt) code:7e09ce/50 cheat description:Have all Guns except Charge Beam code:7e09a8/ff cheat description:Have Charge Beam code:7e09a9/ff cheat description:Have all suits and misc items (except Bombs) code:7e09a4/ff cheat description:Have all boots and regular Bombs code:7e09a5/ff cheat description:Have Missiles and Power Bombs code:7e09ce/50 cheat description:Infinite time to escape ship code:7e0945/00+7e0946/00+7e0947/01 cheat description:Full movement in Maridia sand (alt) code:84b518/80+90981d/00 cheat description:Moon-jump code:7e0b2d/44+7e0b2e/01 cheat description:0 hours played (alt) code:7e09e0/00 cheat description:Brinstar mapped (alt) code:7ed909/ff cheat description:Crateria mapped (alt) code:7ed908/ff cheat description:Maridia mapped (alt) code:7ed90c/ff cheat description:Norfair mapped (alt) code:70015a/ff cheat description:Tourian mapped (alt) code:7ed90d/ff cheat description:Wrecked Ship mapped (alt) code:7ed90b/ff cheat description:Start with Missiles code:7e09c8/01 cheat description:Start with Super Missiles code:7e09cc/01 cheat description:Start with Power Bombs code:7e09d0/01 cartridge sha256:40b46bb29785fb431b325f22377faa8b099be4d77aecc1f03000b8a4cb589b63 name:Super Ninja Boy (USA) cheat description:Protection from most hazards (makes some side-view enemies invincible) code:05d1fe/bd cheat description:Don't subtract money (must have enough to buy) code:02c018/60 cheat description:All stats are 20 (attack, defense, energy, max HP, max NP) code:02db1d/a9+02db1f/ea+02db1e/14 cheat description:All stats for every level are 50 code:02db1d/a9+02db1f/ea+02db1e/32 cheat description:All stats for every level are 100 code:02db1d/a9+02db1f/ea+02db1e/64 cheat description:All stats for every level are 255 code:02db1d/a9+02db1f/ea+02db1e/ff cheat description:1 experience point required for level 2 code:02db2b/01 cheat description:1 experience point required for level 3 code:02db2e/01 cheat description:1 experience point required for level 4 code:02db31/01 cheat description:1 experience point required for level 5 code:02db34/01 cheat description:Don't subtract M's for ninja cyclone attack code:058c6f/00 cheat description:Don't subtract M's for mighty balls attack code:05c97b/00 cheat description:Skulls subtract 2 M's code:05e23b/02 cheat description:Skulls don't subtract an M code:05e23b/00 cheat description:M power-ups worth nothing (handicap) code:05e24f/00 cheat description:M power-ups worth 2 code:05e24f/02 cheat description:M power-ups worth 3 code:05e24f/03 cheat description:M power-ups worth 4 code:05e24f/04 cheat description:M power-ups worth 5 code:05e24f/05 cheat description:M power-ups set to 15 code:05e24f/15 cheat description:Start with 250 cash code:01b766/fa cheat description:Start with 40,960 cash code:01b768/85 cartridge sha256:a8acbbd6f8afbf289a6b837da6cd8bd109a00cd38625c956ab8ff739732d9e4f name:Super Nova (USA) cheat description:Invincibility code:80be2b/4c+80be2c/35+80be2d/be cheat description:Infinite lives code:8a80bd/cd cheat description:Hit anywhere code:80cd53/80+89b930/00+80cc74/00 cheat description:Keep main weapon after dying code:8a80a8/ad cheat description:Start with strongest main weapon code:8aa124/8d cartridge sha256:24b687f95bb9737d223738f13c00aeaa7d697fa9e2fd50597b81d0cfa2160daa name:Super Off Road (USA) cheat description:Infinite nitros code:00953f/02+009544/dd cheat description:Infinite cash - P1 code:00aecd/d9 cheat description:Infinite cash - P2 code:00b020/d9 cheat description:Start with $500,000 code:00b631/05 cheat description:Start with $900,000 code:00b631/09 cartridge sha256:16f9c90d75bd23d0620be00ecf818fcb25c5935d4ee26b1fe17b926f8987aa65 name:Super Off Road - The Baja (USA) cheat description:Infinite nitros code:80c642/ea cheat description:Indestructible engine code:80bfe8/ad cheat description:Indestructible shocks code:80bfc2/ad cheat description:Indestructible tires code:80bfa0/ad cheat description:Vehicle can take only about 60% damage code:80bf6c/60 cheat description:Vehicle can take only about 35% damage code:80bf6c/30 cheat description:$9,000 for brakes code:809584/09 cheat description:$2,000 for brakes code:809584/02 cheat description:$9,000 for tires code:809586/09 cheat description:$2,000 for tires code:809586/02 cheat description:$2,000 for shocks code:809588/02 cheat description:$9,000 for shocks code:809588/09 cheat description:$2,000 for lights code:80958a/02 cheat description:$9,000 for lights code:80958a/09 cheat description:$2,000 for engine code:80958c/02 cheat description:$4,000 for engine code:80958c/04 cartridge sha256:5a4b0c89606f71182fa5552ac476cc3bbda5ddc7d44e33f9184114aaea38020d name:Super Play Action Football (USA) cheat description:One timeout each team code:009c38/01 cheat description:No timeouts - P1 code:009c39/64 cheat description:No timeouts - P2 code:009c3b/64 cheat description:Infinite time to select play code:008234/24 cheat description:Less time to select play code:008231/1e cheat description:More time to select play code:008231/70 cartridge sha256:a3d803b8c6b0b6ac55085671040b840f993543915c7f802e14fb651beabe9b63 name:Super Punch-Out!! (USA) cheat description:Infinite health against most punches code:00c824/ad cheat description:Gain max health after connecting a hit - both players code:00c803/05 cheat description:Infinite time code:00f2e8/a5 cheat description:Opponent has no health code:00f0aa/9c cheat description:Most opponents stay down for the count code:00c394/01 cheat description:Opponent does almost nothing code:018064/80 cheat description:Some special attacks don't damage as much code:00c494/ad cheat description:Super Punch anytime code:00cf6e/00 cheat description:Max power after one hit code:00ef21/a9+00ef22/1b+00ef23/ea cheat description:Infinite rematches code:019ebb/ad cheat description:No rematches code:00993d/00 cheat description:Fix game genied world circuit code:00bc23/a9+00bc24/00 cheat description:Start with 5 rematches code:00993d/06 cheat description:Start with 8 rematches code:00993d/09 cheat description:Start with half health - both players code:0096a6/25 cheat description:Start with very little health - both players code:0096a6/01 cheat description:Start on world circuit code:01b8cb/09+01b8cc/02+01b8cd/ea cheat description:Infinite health code:7e088f/50+7e089f/50 cheat description:Infinite time (alt) code:7e0b27/03 cheat description:Infinite health (alt) code:7e088f/50+7e089f/50 cheat description:Opponent has no health (alt) code:7e099f/01 cheat description:Always cause dizziness code:7e0938/8f cheat description:All hits cause super dizziness code:7e092b/b0 cheat description:Max power (Super and Rapid Punch) code:7e0899/00+7e089a/00+7e089b/00+7e089c/1b cheat description:TKO after only one knockdown code:7e099d/03 cartridge sha256:05c7f6461209020785fba33007e1830820aa44ada4b1a6f991d936bf2335b15b name:Super R-Type (USA) cheat description:Start with Invincibility (blinking) code:01a8d6/bd cheat description:Infinite lives code:00a631/ad cheat description:Infinite FORCE once obtained code:018738/ad cheat description:One hit kills code:009e15/80 cheat description:Hit anywhere code:009d6a/24+009d78/24+009d7f/24+009d71/24+009d86/24 cheat description:Always fire charged shots (hold B) code:01b934/3d+01b932/00 cheat description:Spiral motion gun takes less time to power up code:01ba40/80+01ba41/00 cheat description:Spiral motion gun takes much less time to power up code:01ba43/00 cheat description:Spiral motion gun can't get over-charged code:01ba25/80 cheat description:All FORCE satellites have 1 unit of power (but can't exceed 1 unit) code:0286b0/00+0286af/a9+0286b2/30 cheat description:All FORCE satellites have 2 units of power (but can't exceed 2 units) code:0286b0/01+0286af/a9+0286b2/30 cheat description:All FORCE satellites have 3 units of power code:0286b0/02+0286af/a9+0286b2/30 cheat description:Start with 1 life instead of 3 code:018185/01+018184/a9+018186/00 cheat description:Start with 2 lives code:018185/02+018184/a9+018186/00 cheat description:Start with 4 lives code:018185/04+018184/a9+018186/00 cheat description:Start with 5 lives code:018185/05+018184/a9+018186/00 cheat description:Start with 7 lives code:018185/07+018184/a9+018186/00 cheat description:Start with 9 lives code:018185/09+018184/a9+018186/00 cheat description:Continue with 1 life instead of 3 code:0187ad/01+0187ac/a9+0187ae/00 cheat description:Continue with 2 lives code:0187ad/02+0187ac/a9+0187ae/00 cheat description:Continue with 4 lives code:0187ad/04+0187ac/a9+0187ae/00 cheat description:Continue with 5 lives code:0187ad/05+0187ac/a9+0187ae/00 cheat description:Continue with 7 lives code:0187ad/07+0187ac/a9+0187ae/00 cheat description:Continue with 9 lives code:0187ad/09+0187ac/a9+0187ae/00 cheat description:Stage select enabled (Pause, A+R+Select) code:7e16f5/ff+7e16f6/ff cheat description:Start with Invincibility (blinking) (alt) code:7e15bd/00 cartridge sha256:7a8ffaf8bb549b400ec2f0bda9f3c0dbf5852c38618cdb21cd783c368383e2c7 name:Super Scope 6 (USA) cheat description:Add 1 bullets at a time (Blastris A) code:10a98c/01 cheat description:Add 3 bullets at a time (Blastris A) code:10a98c/03 cheat description:Add 5 bullets at a time (Blastris A) code:10a98c/05 cheat description:Add 7 bullets at a time (Blastris A) code:10a98c/07 cheat description:Add 9 bullets at a time (Blastris A) code:10a98c/09 cheat description:Infinite bullets (Blastris A) code:10a4da/a5 cheat description:Clear 1 line instead of 5 to advance to next level (Blastris A) code:10a55e/01 cheat description:Clear 2 lines to advance to next level (Blastris A) code:10a55e/02 cheat description:Clear 3 lines to advance to next level (Blastris A) code:10a55e/03 cheat description:Clear 4 lines to advance to next level (Blastris A) code:10a55e/04 cheat description:Select low mode to start on level 5 (Blastris B, Type B) code:1180b9/05 cheat description:Select low mode to start on level 15 (Blastris B, Type B) code:1180b9/0f cheat description:Select low mode to start on level 25 (Blastris B, Type B) code:1180b9/19 cheat description:Select low mode to start on level 30 (Blastris B, Type B) code:1180b9/1e cheat description:Select low mode to start on level 35 (Blastris B, Type B) code:1180b9/23 cheat description:Select low mode to start on level 40 (Blastris B, Type B) code:1180b9/28 cheat description:Clear stage after 1 Molian is hit (Mole Patrol, Stage Mode) code:10c188/9c cheat description:Take no damage (LazerBlazer, Type A) code:018adb/bd cheat description:Take no damage (LazerBlazer Game, Type B) code:02964d/ea cheat description:Take no damage (LazerBlazer Game, Type C) code:038e5c/ad cartridge sha256:72268d692f03f9c012844edac1febe0b77932268b3b37ad55d6ccf631cda8483 name:Super Shadow of the Beast (USA) (Proto) cheat description:Invincibility code:008917/ad+0088f3/8d+008902/d0 cheat description:Infinite health code:008921/c5 cheat description:Infinite lives code:008921/a5 cheat description:Infinite credits code:00817a/c5 cheat description:Moon-jump code:009e42/ad+008e97/ad cartridge sha256:8b75ab4bb1b63c45a56e7a4c5a37c0864f14375ab3131edc33489764426ad888 name:Super Smash T.V. (USA) cheat description:Invincibility on mobile force field pick-up code:038a79/80+038a7a/01 cheat description:Weapons gauge doesn't lose power until you die (don't combine with don't lose weapon power code) code:00beec/bd cheat description:Don't lose weapon power after death (don't combine with weapons gauge doesn't lose power code) code:0098b9/80+0098ba/01 cheat description:Infinite credits (if continue timer runs out and player starts, a credit gets used) code:0ed4ee/ad cheat description:Infinite lives code:009891/bd cheat description:Bonus life worth nothing code:03bb25/bd cheat description:Join in with 2 lives - P1 code:00981f/ff cheat description:Join in with 3 lives - P1 code:00981f/00 cheat description:Join in with 4 lives - P1 code:00981f/01 cheat description:Join in with 5 lives - P1 code:00981f/02 cheat description:Join in with 7 lives - P1 code:00981f/04 cheat description:Join in with 8 lives - P1 code:00981f/05 cheat description:Join in with 9 lives - P1 code:00981f/06 cheat description:2 lives after continue - P1 code:00986f/ff cheat description:3 lives after continue - P1 code:00986f/00 cheat description:4 lives after continue - P1 code:00986f/01 cheat description:5 lives after continue - P1 code:00986f/02 cheat description:7 lives after continue - P1 code:00986f/04 cheat description:8 lives after continue - P1 code:00986f/05 cheat description:9 lives after continue - P1 code:00986f/06 cheat description:10 lives after continue - P1 code:00986f/07 cheat description:2 lives after continue - P2 code:009843/ff cheat description:3 lives after continue - P2 code:009843/00 cheat description:4 lives after continue - P2 code:009843/01 cheat description:5 lives after continue - P2 code:009843/02 cheat description:7 lives after continue - P2 code:009843/04 cheat description:8 lives after continue - P2 code:009843/05 cheat description:9 lives after continue - P2 code:009843/06 cheat description:10 lives after continue - P2 code:009843/07 cheat description:Start with 0 continues code:0081d5/00 cheat description:Start with 1 continue code:0081d5/01 cheat description:Start with 2 continues code:0081d5/02 cheat description:Start with 3 continues code:0081d5/03 cheat description:Start with 5 continues code:0081d5/05 cheat description:Start with 6 continues code:0081d5/06 cheat description:Start with 7 continues code:0081d5/07 cheat description:Start with 8 continues code:0081d5/08 cheat description:Start with 9 continues code:0081d5/09 cheat description:Start with 3 lives code:0081de/00 cheat description:Start with 4 lives code:0081de/01 cheat description:Start with 5 lives code:0081de/02 cheat description:Start with 7 lives code:0081de/04 cheat description:Start with 8 lives code:0081de/05 cheat description:Start with 9 lives code:0081de/06 cheat description:Start with 10 lives code:0081de/07 cheat description:Invincibility - P1 code:7e18a5/00 cheat description:Invincibility - P2 code:7e18a6/00 cheat description:Infinite Shield - P1 code:7e18a9/01 cheat description:Infinite Shield - P2 code:7e18aa/01 cheat description:Infinite lives - P1 code:7e0531/09 cheat description:Infinite lives - P2 code:7e0532/09 cheat description:Max weapon gauge - P1 code:7e1899/06 cheat description:Max weapon gauge - P2 code:7e189a/06 cheat description:Have Rapid Fire - P1 code:7e18b0/04 cheat description:Have Rapid Fire - P2 code:7e18b1/04 cheat description:Have normal weapon - P1 code:7e1897/00 cheat description:Have normal weapon - P2 code:7e1898/00 cheat description:Have Spread weapon - P1 code:7e1897/01 cheat description:Have Spread weapon - P2 code:7e1898/01 cheat description:Have Rockets - P1 code:7e1897/02 cheat description:Have Rockets - P2 code:7e1898/02 cheat description:Have Grenade Launcher - P1 code:7e1897/03 cheat description:Have Grenade Launcher - P2 code:7e1898/03 cheat description:Have Grenade Lobber (glitchy) - P1 code:7e1897/04 cheat description:Have Grenade Lobber (glitchy) - P2 code:7e1898/04 cheat description:Have Speed Shoes - P1 code:7e18ad/ff cheat description:Have Speed Shoes - P2 code:7e18ae/fa cheat description:Have 10 Keys code:7e05b1/0a cheat description:Turbo mode on code:7e052e/01 cheat description:Circuit warp on code:7e020e/01 cheat description:Infinite credits (alt) code:7e0533/09 cartridge sha256:694ad2b34ab808bd8a1aa9dda359594cfd3a5fd9d95d4cf262ccaa0eb57eef67 name:Super Soccer (USA) cheat description:Each goal worth 2 - P1 code:01ddc6/1a+01ddc7/ea cheat description:Each goal worth 3 - P1 code:01ddc6/1a+01ddc7/1a cheat description:Each goal worth 4 - P1 code:01ddc6/69+01ddc7/03 cheat description:Each goal worth 5 - P1 code:01ddc6/69+01ddc7/04 cheat description:Each goal worth 6 - P1 code:01ddc6/69+01ddc7/05 cheat description:Each goal worth 7 - P1 code:01ddc6/69+01ddc7/06 cheat description:Each goal worth 8 - P1 code:01ddc6/69+01ddc7/07 cheat description:Each goal worth 9 - P1 code:01ddc6/69+01ddc7/08 cheat description:Each goal worth 2 - P2 code:01ddda/1a+01dddb/ea cheat description:Each goal worth 3 - P2 code:01ddda/1a+01dddb/1a cheat description:Each goal worth 4 - P2 code:01ddda/69+01dddb/03 cheat description:Each goal worth 5 - P2 code:01ddda/69+01dddb/04 cheat description:Each goal worth 6 - P2 code:01ddda/69+01dddb/05 cheat description:Each goal worth 7 - P2 code:01ddda/69+01dddb/06 cheat description:Each goal worth 8 - P2 code:01ddda/69+01dddb/07 cheat description:Each goal worth 9 - P2 code:01ddda/69+01dddb/08 cheat description:Timer continues to count when it is normally stopped (pause can still stop time) code:01c980/00 cartridge sha256:5eb9736d66b3ac730ebbfdd19ef2397282b5f1a62dc0048093e041e23b807741 name:Super Soccer Champ (USA) cheat description:Faster timer code:01d099/1e cheat description:Slower timer code:01d099/70 cheat description:Faster Brazil strikers code:0cf633/02 cheat description:Faster USA strikers code:0cf643/02 cheat description:Faster England strikers code:0cf603/02 cheat description:Faster Germany strikers code:0cf5e3/02 cheat description:Faster Italy strikers code:0cf613/02 cheat description:Faster Holland strikers code:0cf623/02 cheat description:Faster Argentina strikers code:0cf5f3/02 cheat description:Faster France strikers code:0cf653/02 cartridge sha256:5985cdad45958a5b8c5967ad39efe51569f560bf237a4e9864f21111082a8500 name:Super Solitaire (USA) (En,Fr,De,Es,It) cheat description:Move cards to any pile - Klondike code:80b4ae/80+80b3cb/00+80b3b1/00 cheat description:Move cards to any pile - Free Cell code:80b81b/80 cartridge sha256:5670ad514d086359e28f41d79a05ae93309b382d6d56d42a6a0e493e6107111b name:Super Soukoban (Japan) cheat description:Infinite steps code:02a6ab/ad cheat description:Walk through walls code:02b0bb/00+02b0bd/00 cartridge sha256:298b643fec4208f33d02a7afbb05c6f757b0086be533f8ca739466cbe96ae918 name:Super Star Wars (USA) (Rev 1) cheat description:Protection against most damage code:80ea2d/60 cheat description:Infinite lives code:80e9d8/ad+808fae/a9 cheat description:Infinite continues code:81dd68/2c cheat description:Blaster power-ups remain after dying code:80e9ce/77 cheat description:Hit anywhere - Side-scrolling levels code:80bd59/60+80bd58/d0+80bd55/c0+80bd63/00+80bd56/00+80bd57/00 cheat description:Invincibility + hit anywhere code:80a5a3/e0+80a5a6/30+80a5a5/00+80a5a4/1d cheat description:Only 1 Jawa needed to pass landspeeder levels code:808437/01+808442/01 cheat description:Only 5 Jawas needed to pass landspeeder levels code:808437/05+808442/05 cheat description:Only 10 Jawas needed to pass landspeeder levels code:808437/0a+808442/0a cheat description:25 Jawas needed to pass landspeeder levels code:808437/19+808442/19 cheat description:50 Jawas needed to pass landspeeder levels code:808437/32+808442/32 cheat description:No fuel maximum for fuel power-ups code:80c871/80 cheat description:Fuel power-ups completely refill the landspeeder code:80c86c/24 cheat description:Small hearts restore 1/2 health (easy level) code:81e295/02 cheat description:Small hearts restore 1/2 health (brave level) code:81e297/01 cheat description:Small hearts restore 1/2 health (Jedi level) code:81e299/01 cheat description:Small hearts restore 2x health (easy level) code:81e295/06 cheat description:Small hearts restore 2x health (brave level) code:81e297/04 cheat description:Small hearts restore 2x health (Jedi level) code:81e299/04 cheat description:Small hearts restore 4x health (easy level) code:81e295/0c cheat description:Small hearts restore 4x health (brave level) code:81e297/08 cheat description:Small hearts restore 4x health (Jedi level) code:81e299/08 cheat description:Han Solo and Chewbacca start with a blaster code:81bfbf/00 cheat description:Han Solo and Chewbacca start with a seeker gun code:81bfbf/02 cheat description:Han Solo and Chewbacca start with a rapid ion gun code:81bfbf/03 cheat description:Han Solo and Chewbacca start with a plasma gun code:81bfbf/04 cheat description:Have character select menu on a new game code:809e56/00 cheat description:Have Lightsaber on a new game code:809e4e/00 cheat description:Start with 1/2 fuel on landspeeder levels code:808431/12 cheat description:Start with 2x fuel on landspeeder levels code:808431/48 cheat description:Start with 2 lives code:81e273/01 cheat description:Start with 6 lives code:81e273/05 cheat description:Start with 8 lives code:81e273/07 cheat description:Start with 11 lives code:81e273/0a cheat description:Start with 16 lives code:81e273/0f cheat description:Start with 26 lives code:81e273/19 cheat description:Start with 51 lives code:81e273/32 cheat description:Start with 100 lives code:81e273/63 cheat description:Start with no continues code:81e29e/00 cheat description:Start with 5 continues code:81e29e/05 cheat description:Start with 7 continues code:81e29e/07 cheat description:Start with 10 continues code:81e29e/0a cheat description:Start with 15 continues code:81e29e/0f cheat description:Start with 25 continues code:81e29e/19 cheat description:Start with 50 continues code:81e29e/32 cheat description:Start with 99 continues code:81e29e/63 cheat description:Start with 1/2 health (easy level) code:81e277/12 cheat description:Start with 1/2 health (brave level) code:81e279/10 cheat description:Start with 1/2 health (Jedi level) code:81e27b/0e cheat description:Start with 2x health (easy level) code:81e277/48 cheat description:Start with 2x health (brave level) code:81e279/40 cheat description:Start with 2x health (Jedi level) code:81e27b/38 cheat description:Infinite health code:7e0a79/ff cheat description:Infinite time code:7e096f/0f cheat description:Infinite Shields code:7e0988/01 cheat description:Infinite lives code:7e08fb/03 cheat description:Infinite Thermal Detonators code:7e0978/06 cheat description:Infinite Fighter Life code:7e0876/64 cheat description:Infinite Torpedoes code:7e0878/63 cheat description:Always have Plasma Gun code:7e0985/04 cheat description:Always have Rapid Ion code:7e0985/03 cheat description:Always have Seeker Gun code:7e0985/02 cheat description:Have Lightsaber and character select menu on a new game code:7e0110/c0 cartridge sha256:c6bd7239cb2074ff1c471d14535bead6290bba2d7c75b4f03209cb114877b4c8 name:Super Star Wars (USA) cheat description:Hit anywhere - Side-scrolling levels code:80bd9a/60+80bd99/d0+80bd96/c0+80bd98/00+80bd97/00+80bda4/00 cheat description:Infinite health code:7e0a79/ff cheat description:Infinite time code:7e096f/0f cheat description:Infinite Shields code:7e0988/01 cheat description:Infinite lives code:7e08fb/03 cheat description:Infinite Thermal Detonators code:7e0978/06 cheat description:Infinite Fighter Life code:7e0876/64 cheat description:Infinite Torpedoes code:7e0878/63 cheat description:Always have Plasma Gun code:7e0985/04 cheat description:Always have Rapid Ion code:7e0985/03 cheat description:Always have Seeker Gun code:7e0985/02 cheat description:Have Lightsaber and character select menu on a new game code:7e0110/c0 cartridge sha256:f7df5cd16ce6624567d1a24e9b9c0b9050ea9b6a9fe5a7973484589637756596 name:Super Star Wars - Return of the Jedi (USA) (Rev 1) cheat description:Infinite lives code:80e645/ad cheat description:Infinite Force power when you use the Force Saber code:83e32b/ad cheat description:Always have shield code:8088fd/a9 cheat description:Once you have thermal detonator you keep it (disable to use force power) code:81d7de/ad cheat description:Infinite Force power when you use the Freeze Force code:85b762/ad cheat description:Finish the first level almost instantly code:839a0d/69+839a0e/ff+839a0f/ff cheat description:Start with 1 life code:85bade/00 cheat description:Start with 5 lives code:85bade/04 cheat description:Start with 10 lives code:85bade/09 cheat description:Start with 25 lives code:85bade/18 cheat description:Start with very little health code:85bbf3/a9+85bbf4/01+85bbf5/00 cheat description:Start with about 1/4 health code:85bbf3/a9+85bbf4/0f+85bbf5/00 cheat description:Start with about 1/2 health code:85bbf3/a9+85bbf4/10+85bbf5/00 cheat description:Start with about 3/4 health code:85bbf3/a9+85bbf4/1f+85bbf5/00 cartridge sha256:46370b3bd6ff9ee04c425eef0f482f521f3b61bd4b058f2f4e9d322253d7b5de name:Super Star Wars - The Empire Strikes Back (USA) (Rev 1) cheat description:Almost invincible - except spikes (works for enemy too) code:80e71e/2b cheat description:Infinite lives code:80e6bd/ad cheat description:Infinite continues code:81d850/ad cheat description:Infinite thermal detonators code:80f45f/80 cheat description:Elevation and Freeze don't drain force bar code:85d558/ad cheat description:Saber control doesn't drain force bar code:83a1a0/00 cheat description:Mind control, Slow, Deflect and Invisible don't drain force bar code:85d61c/ad cheat description:Keep gun power-ups after dying code:80e6b2/ad cheat description:Shield power-ups don't last as long code:80bb60/00 cheat description:Shield power-ups last longer code:80bb60/02 cheat description:Shield power-ups last much longer code:80bb60/03 cheat description:Shield power-ups last a very long time code:80bb60/0f cheat description:Health sword power-ups add 1/2 as much code:80bb2f/02 cheat description:Health sword power-ups add 2x as much code:80bb2f/08 cheat description:Health sword power-ups add 4x as much code:80bb2f/10 cheat description:Force orbs add 1/2 as much code:80bb9e/18 cheat description:Force orbs add 2x as much code:80bb9e/60 cheat description:Force orbs fill force bar code:80bb9e/ff cheat description:Small hearts heal less on Easy code:81de9a/01 cheat description:Small hearts heal 2x as much on Easy code:81de9a/06 cheat description:Small hearts heal 4x as much on Easy code:81de9a/0c cheat description:Small hearts heal very much on Easy code:81de9a/20 cheat description:Small hearts heal completely on Easy code:81de9a/44 cheat description:Small hearts heal less on Brave level code:81de9c/01 cheat description:Small hearts heal 2x as much on Brave code:81de9c/04 cheat description:Small hearts heal 4x as much on Brave code:81de9c/08 cheat description:Small hearts heal very much on Brave code:81de9c/20 cheat description:Small hearts heal completely on Brave code:81de9c/44 cheat description:Small hearts heal less on Jedi level code:81de9e/01 cheat description:Small hearts heal 2x as much on Jedi code:81de9e/04 cheat description:Small hearts heal 4x as much on Jedi code:81de9e/08 cheat description:Small hearts heal very much on Jedi code:81de9e/20 cheat description:Small hearts heal completely on Jedi code:81de9e/44 cheat description:Big hearts heal 1/2 your health instead of 1/4 code:80bb01/ea cheat description:Big hearts heal completely code:80bb01/0a cheat description:Continue with 2 lives on Easy code:81de6a/01 cheat description:Continue with 6 lives on Easy code:81de6a/05 cheat description:Continue with 21 lives on Easy code:81de6a/14 cheat description:Continue with 51 lives on Easy code:81de6a/32 cheat description:Continue with 2 lives on Jedi code:81de6e/01 cheat description:Continue with 6 lives on Jedi code:81de6e/05 cheat description:Continue with 21 lives on Jedi code:81de6e/14 cheat description:Continue with 100 lives on Jedi code:81de6e/63 cheat description:Tauntaun starts with 1/2 usual health code:84d647/20 cheat description:Tauntaun starts with 3/4 usual health code:84d647/30 cheat description:Tauntaun starts with a little more health than usual code:84d647/44 cheat description:Start with all force abilities code:85d4ec/80 cheat description:Start with Flame gun - 1st life only code:81d0ac/8d cheat description:Start with 2 lives on Brave code:81de6c/01 cheat description:Start with 6 lives on Brave code:81de6c/05 cheat description:Start with 21 lives on Brave code:81de6c/14 cheat description:Start with 100 lives on Brave code:81de6c/63 cheat description:Start with 1 continue code:81dea3/01 cheat description:Start with 5 continues code:81dea3/05 cheat description:Start with 9 continues code:81dea3/09 cheat description:Start with 1/2 as much health on Easy code:81de70/12 cheat description:Start with 3/4 as much health on Easy code:81de70/18 cheat description:Start with more health on Easy code:81de70/2a cheat description:Start with much more health on Easy code:81de70/30 cheat description:Start with maximum health on Easy code:81de70/44 cheat description:Start with 1/2 as much health on Brave code:81de72/10 cheat description:Start with 3/4 as much health on Brave code:81de72/18 cheat description:Start with more health on Brave code:81de72/2a cheat description:Start with much more health on Brave code:81de72/30 cheat description:Start with maximum health on Brave code:81de72/44 cheat description:Start with half as much health on Jedi code:81de74/0e cheat description:Start with 3/4 as much health on Jedi code:81de74/15 cheat description:Start with no continues code:81dea3/00 cheat description:Start on level 1-2 code:808d5d/02 cheat description:Start on level 1-3 code:808d5d/06 cheat description:Start on level 1-4 code:808d5d/03 cheat description:Start on level 1-5 code:808d5d/05 cheat description:Start on level 1-6 code:808d5d/04 cheat description:Start on level 1-7 code:808d5d/09 cheat description:Start on level 1-8 code:808d5d/15 cheat description:Start on level 1-10 code:808d5d/07 cheat description:Start on Hoth 3D level code:808d5c/0e+808d5d/0a cheat description:Start on level 1-11 code:808d5d/08 cheat description:Start on Asteroids level code:808d5c/12+808d5d/00 cheat description:Start on level 3-1 code:808d5d/0c cheat description:Start on level 3-2 code:808d5d/0d cheat description:Start on level 3-3 code:808d5d/0e cheat description:Start on Cloud City 3D level code:808d5c/0e+808d5d/1a cheat description:Start on level 4-2 code:808d5d/0f cheat description:Start on level 4-3 code:808d5d/13 cheat description:Start on level 4-4 code:808d5d/12 cheat description:Start on level 4-5 code:808d5d/10 cheat description:Start on level 4-6 code:808d5d/17 cheat description:Start on level 4-7 code:808d5d/18 cheat description:Start on Darth Vader level code:808d5d/16 cartridge sha256:d17cb5c73174060fcbd9cba6c705643f19c3b8be24d0f7ee43aee674ff1ea38e name:Super Street Fighter II (USA) cheat description:Invincibility (except against throws, projectiles don't work) - P1 code:c05ea2/80+c05ea3/01+c1ce64/80+c1ce65/02+c1cc19/80+c1cc1a/02 cheat description:Infinite health - P1 code:c05080/a9+c05081/b0+c05082/8d+c05083/31+c05084/05 cheat description:Don't take damage except from throws or grabs - both players code:c06c4a/ea+c06c4b/ea cheat description:Hit anywhere (except projectiles) - P1 code:c06500/e0+c06503/b0+c06501/40+c06502/07 cheat description:1st normal hit wins - except throws or grabs code:c06c4d/00 cheat description:No charging required for some special moves code:c14fd0/04 cheat description:Some special moves can be done in the air code:c12a30/00 cheat description:Dizziness doesn't last code:c13836/64 cheat description:Every hit sets opponent on fire code:c06237/a9+c06238/30 cheat description:Every hit sets the opponent on fire and knocks him down code:c06237/a9+c06238/18 cheat description:Every hit zaps the opponent and knocks him down code:c06237/a9+c06238/1a cheat description:Every hit knocks the opponent down code:c06237/a9+c06238/1c cheat description:Every hit is a "hard hit" - opponent almost never gets knocked down code:c06237/a9+c06238/0a cheat description:Players jump slower (not functional for CPU) code:c13b56/a9+c13b57/07 cheat description:Players jump faster (not functional for CPU) code:c13b56/a9+c13b57/0b cheat description:Each battle lasts only 1 round code:c0bb69/01 cheat description:Speed up timer code:c040a4/1f cheat description:Slow down timer code:c040a4/5a cheat description:P2 starts right in front of P1 code:c1d3de/16 cheat description:Start with 1/4 health - both players code:c054a4/2c cheat description:Start with 1/2 health - both players code:c054a4/58 cheat description:Start with 3/4 health - both players code:c054a4/84 cheat description:Balrog - Fierce charging punch, does heavy damage code:c583c5/8f cheat description:Balrog - Roundhouse charging uppercut, does heavy damage code:c583dd/8f cheat description:Balrog - Fierce shoulder butt, does heavy damage code:c5855d/8f cheat description:Balrog - Faster turn punch - roundhouse code:c1bca8/06 cheat description:Balrog - Superfast turn punch - roundhouse code:c1bca8/09 cheat description:Blanka - Fierce forward ball, does heavy damage code:c563af/8f cheat description:Blanka - Beast leap, does heavy damage code:c56493/8f cheat description:Blanka - Jab zap, does heavy damage code:c56373/8f cheat description:Cammy - Fierce spin knuckle, does heavy damage code:c591e7/8f cheat description:Cammy - Roundhouse front kick, does heavy damage code:c5919f/8f cheat description:Cammy - Roundhouse cannon drill, from far away, does heavy damage code:c5911b/8f cheat description:Cammy - Erratic cannon drill code:c193ff/06 cheat description:Cammy - Superfast cannon drill code:c193fe/00 cheat description:Cammy - Superfast front kick - fierce code:87d14c/08 cheat description:Cammy - Superfast front kick - strong code:87d149/08 cheat description:Cammy - Superfast front kick - jab code:87d148/08 cheat description:Chun-Li - Fierce fireball, does heavy damage code:c57003/8f cheat description:Chun-Li - Down step, does heavy damage code:c56d4b/0f cheat description:Chun-Li - Short lightning kick, does heavy damage code:c56e6b/8f cheat description:Chun Li - Faster whirlwind kick - roundhouse code:c172f6/06 cheat description:Chun Li - Superfast whirlwind kick - roundhouse code:c172f6/09 cheat description:Dee Jay - Fierce hyper fist (1st hit), does heavy damage code:c5a775/8f cheat description:Dee Jay - Fierce Max Out, does heavy damage code:c5a811/8f cheat description:Dee Jay - Roundhouse dread kick, does heavy damage code:c5a6e5/8f cheat description:Dee Jay - Dread kick is faster - fierce code:87d1ed/09 cheat description:Dee Jay - Dread kick is faster - strong code:87d1e5/09 cheat description:Dhalsim - Yoga spear, does heavy damage code:c576ff/0f cheat description:Dhalsim - Strong yoga flame (solid hit), does heavy damage code:c577fb/8f cheat description:Dhalsim - Fierce yoga fire, does heavy damage code:c577bf/8f cheat description:E Honda - Jab hundred-hand slap, does heavy damage code:c55e5d/8f cheat description:E Honda - Fierce torpedo, does heavy damage code:c55f89/8f cheat description:E Honda - Fierce sumo splash, does heavy damage code:c55fdd/8f cheat description:Fei Long - Fierce slide punch (1st hit), does heavy damage code:c5a137/8f cheat description:Fei Long - Fierce slide punch (2nd hit), does heavy damage code:c5a143/8f cheat description:Fei Long - Fierce slide punch (3rd hit), does heavy damage code:c5a14f/8f cheat description:Fei Long - Roundhouse dragon kick, does heavy damage code:c5a0fb/8f cheat description:Fei Long - Superfast rekka-ken - strong code:87d1b3/07 cheat description:Fei Long - Superfast rekka-ken - fierce code:87d137/08 cheat description:Guile - Fierce sonic boom, does heavy damage code:c56989/8f cheat description:Guile - Roundhouse sonic kick, extremely close range, does heavy damage code:c568f9/8f cheat description:Hawk - The Hawk, does heavy damage code:c599e5/8f cheat description:Ken - Fierce dragon punch, close to opponent, does heavy damage code:c55a8f/8f cheat description:Ken - Fierce fireballs, close to opponent, does heavy damage code:c55ad7/8f cheat description:Ken - Roundhouse hurricane kick while on the ground, does heavy damage code:c559cf/8f cheat description:Ken - No delay after throwing fireball code:c18d5f/e6 cheat description:Ken - Hurricane kicks rise higher when done in mid-air code:c18f49/64 cheat description:Ken - Faster hurricane kicks - roundhouse code:87c152/06 cheat description:Ken - Super fast hurricane kicks - roundhouse code:87c152/09 cheat description:M. Bison - Super fast psycho crusher - fierce code:87d211/09 cheat description:M. Bison - Psycho crusher in one place - fierce code:c1b181/64 cheat description:Ryu - Jab dragon punch, close to opponent, does heavy damage code:c5560f/8f cheat description:Ryu - Fierce red fireballs from far away, does heavy damage code:c5579b/8f cheat description:Ryu - Roundhouse hurricane kick in the air, does heavy damage code:c5570b/8f cheat description:Ryu - No delay after throwing fireball code:c18d5f/e6 cheat description:Ryu - Hurricane kicks rise higher when done in mid-air code:c18f49/64 cheat description:Ryu - Faster hurricane kicks - roundhouse code:87c152/06 cheat description:Ryu - Super fast hurricane kicks - roundhouse code:87c152/09 cheat description:Sagat - Roundhouse low tiger, from far away, does heavy damage code:c58127/8f cheat description:Sagat - Fierce high tiger, from far away, does heavy damage code:c580df/8f cheat description:Sagat - Short tiger knee, does heavy damage code:c57fe3/8f cheat description:Sagat - Jab projectiles move slower for everyone but Sagat, does heavy damage code:87dc3d/ff cheat description:Sagat - Jab projectiles move slower for Sagat, does heavy damage code:87dc43/ff cheat description:Sagat - Fierce projectiles move faster for everyone but Sagat, does heavy damage code:87dc41/fa cheat description:Sagat - Fierce projectiles move faster for Sagat, does heavy damage code:87dc47/f7 cheat description:Vega - Fierce claw dive, does heavy damage code:c58ac9/cf cheat description:Vega - Rolling claw attack, does heavy damage code:c58ad5/8f cheat description:Vega - Claw thrust, does heavy damage code:c58bf5/8f cheat description:Vega - Superfast claw roll code:c171e5/07 cheat description:Vega - Claw roll in one place code:c171ee/64 cheat description:Zangief - Double spinning lariat (only certain hits), does heavy damage code:c57365/8f cheat description:Zangief - Spinning clothesline, does heavy damage code:c57311/8f cheat description:Infinite health - P1 (alt) code:7e0531/b0 cheat description:Instant win - P1 code:7e0771/ff cheat description:Infinite time code:7e1929/99 cartridge sha256:830c900083cccc6ded74c167c4e257db34df4786ecd6e2f053de454db7d31fe5 name:Super Strike Eagle (USA) cheat description:Infinite fuel code:80980f/a5 cheat description:Infinite ammo - air-to-air mode code:80dbc2/00 cheat description:Infinite Maverick Missiles code:80af04/bd cheat description:Infinite Sidewinder Missiles code:80dc1b/a5 cheat description:Infinite Chaff code:80dccd/ea cheat description:Infinite Flares code:80dc84/ea cheat description:Use up ammo faster - air-to-air mode code:80dbc2/0a cheat description:Start with 0 Chaff instead of 12 code:01e916/00 cheat description:Start with 6 Chaff code:01e916/06 cheat description:Start with 50 Chaff code:01e916/32 cheat description:Start with 99 Chaff code:01e916/63 cheat description:Start with 0 Flares instead of 12 code:01e91b/00 cheat description:Start with 6 Flares code:01e91b/06 cheat description:Start with 50 Flares code:01e91b/32 cheat description:Start with 99 Flares code:01e91b/63 cheat description:Start with 2 Sidewinder missiles instead of 12 code:01e939/02 cheat description:Start with 25 Sidewinder Missiles code:01e939/19 cheat description:Start with 50 Sidewinder Missiles code:01e939/32 cheat description:Start with 99 Sidewinder Missiles code:01e939/63 cheat description:Start with less fuel code:01e90d/40 cartridge sha256:6e45a80ea148654514cb4e8604a0ffcbc726946e70f9e0b9860e36c0f3fa4877 name:Super Tennis (USA) cheat description:Super speed - Matt code:008747/04+008767/03+01dd2f/00 cheat description:Super speed - Amy code:008747/04+008767/03+01df2f/00 cheat description:Super speed - Brian code:008747/04+008767/03+01dd3f/00 cheat description:Super speed - Ki code:008747/04+008767/03+01df3f/00 cheat description:Super speed - Phil code:008747/04+008767/03+01dd4f/00 cheat description:Super speed - Lisa code:008747/04+008767/03+01df4f/00 cheat description:Super speed - John code:008747/04+008767/03+01dd5f/00 cheat description:Super speed - Erin code:008747/04+008767/03+01df5f/00 cheat description:Super speed - Meyer code:008747/04+008767/03+01dd6f/00 cheat description:Super speed - Donna code:008747/04+008767/03+01df6f/00 cheat description:Super speed - Rich code:008747/04+008767/03+01dd7f/00 cheat description:Super speed - Debbie code:008747/04+008767/03+01df7f/00 cheat description:Super speed - Hiro code:008747/04+008767/03+01dd8f/00 cheat description:Super speed - Colette code:008747/04+008767/03+01df8f/00 cheat description:Super speed - Steve code:008747/04+008767/03+01dd9f/00 cheat description:Super speed - Nancy code:008747/04+008767/03+01df9f/00 cheat description:Super speed - Rob code:008747/04+008767/03+01ddaf/00 cheat description:Super speed - Yuka code:008747/04+008767/03+01dfaf/00 cheat description:Super speed - Mar code:008747/04+008767/03+01ddbf/00 cheat description:Super speed - Barb code:008747/04+008767/03+01dfbf/00 cheat description:Play as Don J (Boss player) - P1 code:7e0802/40 cheat description:Play as Don J (Boss player) - P2 code:7e0842/40 cheat description:Play as Don J (Boss player) - P3 code:7e0882/40 cheat description:Play as Don J (Boss player) - P4 code:7e08c2/40 cheat description:CPU can't hit the ball code:7e00ef/00 cheat description:CPU scared of the ball code:7e00ec/00 cartridge sha256:8dda3b0888a32005041f2feb9be4e14807d40291f951a4612461cf41dac9cb78 name:Super Tetris 2 + Bombliss (Japan) cheat description:Drop pieces on left side of the board to clear that line code:009e28/01 cartridge sha256:02cb7f1ed21ed6bfb9eaa0e91df2adb063a9bf4cbd6feb6cd024d676829e227e name:Super Troll Islands (USA) cheat description:Infinite health (except spikes) code:7e215a/04 cheat description:Max score code:7e2009/99+7e200a/99+7e200b/99+7e200c/09 cheat description:Infinite whirlwinds code:7e2074/09 cheat description:Infinite cupcakes code:7e20f7/99 cheat description:Die after one hit code:7e215a/00 cartridge sha256:056ac8160363d577e3ffc2f593801b8bb3d024fe4f3a3331b711dc556204949d name:Super Turrican (USA) cheat description:Invincibility code:00d880/ad cheat description:Infinite time code:00d7b0/80 cheat description:Infinite lives code:00d700/ad cheat description:Infinite continues code:008482/ad cheat description:Infinite wheel time code:00d909/ad cheat description:Infinite Smart Lines code:00d88d/ad cheat description:Hit anywhere code:00b9ad/78+00b9ac/80+00ba4c/ad cheat description:Don't decrease weapon power after dying code:00d6d9/80+00d6da/16 cheat description:Never change weapon type code:00b3d5/2c cheat description:Start with blue weapon code:00b2e1/01 cheat description:Start with yellow weapon code:00b2e1/02 cheat description:Start with all weapons at maximum power (4 power-ups) code:00b2e1/04+00b2ec/9c cheat description:Start with 1 life - Normal/Hard only code:008261/00 cheat description:Start with 2 lives - Normal/Hard only code:008261/01 cheat description:Start with 5 lives - Normal/Hard only code:008261/04 cheat description:Start with 10 lives - Normal/Hard only code:008261/09 cheat description:Start with 25 lives - Normal/Hard only code:008261/18 cheat description:Start with 50 lives - Normal/Hard only code:008261/31 cheat description:Start with 99 lives - Normal/Hard only code:008261/62 cheat description:Start with 1 continue - Easy/Normal only code:008210/01 cheat description:Start with 2 continues - Easy/Normal only code:008210/02 cheat description:Start with 5 continues - Easy/Normal only code:008210/05 cheat description:Start with 10 continues - Easy/Normal only code:008210/0a cheat description:Start with 25 continues - Easy/Normal only code:008210/19 cheat description:Start with 50 continues - Easy/Normal only code:008210/32 cheat description:Start with 99 continues - Easy/Normal only code:008210/63 cheat description:Start with no Smart Lines code:00b2f0/00 cheat description:Start with 1 Smart Line code:00b2f0/01 cheat description:Start with 2 Smart Lines code:00b2f0/02 cheat description:Start with 4 Smart Lines - only 3 shown at once code:00b2f0/04 cheat description:Start with 5 Smart Lines - only 3 shown at once code:00b2f0/05 cheat description:Start with 10 Smart Lines - only 3 shown at once code:00b2f0/0a cheat description:Start with 25 Smart Lines - only 3 shown at once code:00b2f0/19 cheat description:Start with 50 Smart Lines - only 3 shown at once code:00b2f0/32 cheat description:Start with 99 Smart Lines - only 3 shown at once code:00b2f0/63 cheat description:Start on level 2 code:008208/02 cheat description:Start on level 3 code:008208/03 cheat description:Start on level 4 code:008208/04 cheat description:Start on level 5 code:008208/05 cheat description:Start on level 6 code:008208/06 cheat description:Start on level 7 code:008208/07 cheat description:Start on level 8 code:008208/08 cheat description:Start on level 9 code:008208/09 cheat description:Start on level 10 code:008208/0a cheat description:Start on level 11 code:008208/0b cheat description:Start on level 12 code:008208/0c cheat description:Start on level 13 code:7e049e/0d cheat description:Infinite health code:7e04ff/0c cheat description:Infinite time (alt) code:7e056c/23 cheat description:Infinite Bombs code:7e050a/04 cartridge sha256:96da3512a1aa05a40f1e5d61c48932b0d55d9f136d6418b848153a9fecab06de name:Super Turrican 2 (USA) cheat description:Infinite time code:7e0aea/03+7e0aeb/55 cheat description:Infinite lives code:7e0af2/02 cheat description:Infinite Bombs code:7e0af4/03 cheat description:Have Missile sub-weapon code:7e034a/01 cheat description:Max Spread Shot level code:7e033c/04 cheat description:Max Rebound level code:7e033e/04 cheat description:Max Laser level code:7e0340/04 cheat description:Max Flamethrower level code:7e0342/04 cheat description:Start with Spread Shot code:7e0336/00 cheat description:Start with Rebound code:7e0336/10 cheat description:Start with Laser code:7e0336/16 cheat description:Start with Flamethrower code:7e0336/02 cheat description:Start on level 2 code:7e007e/02 cheat description:Start on level 3 code:7e007e/03 cheat description:Start on level 4 code:7e007e/04 cheat description:Start on level 5 code:7e007e/05 cheat description:Start on level 6 code:7e007e/06 cheat description:Start on level 7 code:7e007e/07 cheat description:Start on level 8 code:7e007e/08 cheat description:Start on level 9 code:7e007e/09 cheat description:Start on level 10 code:7e007e/0a cheat description:Start on level 11 code:7e007e/0b cheat description:Start on level 12 code:7e007e/0c cheat description:Start on level 13 code:7e007e/0e cheat description:Start on level 14 code:7e007e/0f cheat description:Start on level 15 code:7e007e/10 cheat description:Start on level 16 code:7e007e/11 cheat description:Start on level 17 code:7e007e/12 cartridge sha256:fddc6634f727899152a5b8b1ca3b8938a4e4ccdd5a6adb9e1579363e3b676f20 name:Super Uno (Japan) cheat description:Place any card on the stack regardless of color code:01a092/80 cartridge sha256:792e615a34ceae5a1b9a4f54c5a5d9b53e39299332fece83e4bceca2c22efb21 name:Super Valis IV (USA) cheat description:Allows you to select easy mode on the options screen code:00dfa0/42 cheat description:Infinite usage for all special attacks code:008f8f/00 cheat description:Protection from most enemy attacks code:00c5c3/ad cheat description:Infinite hits on armor code:00c5c7/ad cheat description:Hit anywhere code:00b001/00+00c498/00 cheat description:Get items from anywhere code:00bfc6/80 cheat description:Heart worth more code:00b125/18 cheat description:Heart worth much more code:00b125/28 cheat description:Selecting an item does not remove it from the menu of available items code:008f1a/bd cheat description:Enables level select code:00cea9/ea cheat description:Get any score for maximum score code:00ac9f/00 cheat description:Item is always search code:008ede/a9+008edf/03 cheat description:Item is always three-way beam code:008ede/a9+008edf/01 cheat description:Item is always bomber code:008ede/a9+008edf/02 cheat description:Item is always homing code:008ede/a9+008edf/04 cheat description:Item is always heart code:008ede/a9+008edf/05 cheat description:Item is always armor code:008ede/a9+008edf/06 cheat description:Infinite max health code:7e0fb5/40 cheat description:Highest max health code:7e0fb6/40 cheat description:Infinite item use code:7e0fae/09 cheat description:Have all items code:7e0fa7/01+7e0fa8/02+7e0fa9/03+7e0faa/04+7e0fab/05+7e0fac/06 cartridge sha256:62d3d650e956f23f3b221f83c5c5bd204afd0e4f4d9c47a3251962323de96089 name:Super Widget (USA) cheat description:Invincibility code:009155/00 cheat description:Infinite lives code:0083b4/ad cheat description:Infinite time code:008292/ad cheat description:1 W gives 1 life code:009cc8/03 cartridge sha256:d802715fb4f09d7e499b5b3e577af641598a723dae7cedeaa93943bb53c6edbb name:SWAT Kats - The Radical Squadron (USA) cheat description:Invincibility after first hit code:c05313/bd cheat description:Invincible while flying the jet code:c1f594/6b+c1f5d7/6b+c1f60b/6b cheat description:Almost infinite health code:c0cc5a/34 cheat description:Gain levels quickly code:c13d60/69 cheat description:World 5 - Dark Kat always enabled code:c0ecd6/05 cartridge sha256:c2015d03dd3db08069b2a6ea1ed6b3e1ac1e3a5f804b02295c3cd3717add91ef name:Syndicate (USA) cheat description:Start with Mega-cash code:80a1e4/30+80a1e5/30 cheat description:All agents have infinite ammo for pistols code:81ca91/a9 cartridge sha256:365f10f9d9f68cc59e769eeb451c417e1ff7415022a625de9976a3b924c0bd61 name:T2 - The Arcade Game (USA) cheat description:Infinite health (alt) - P1 code:82e0ec/80 cheat description:Infinite health (alt) - P2 code:82e113/80 cheat description:Infinite gunpower - P1 code:809d39/a5 cheat description:Infinite gunpower - P2 code:809d5c/a5 cheat description:Infinite missiles - P1 code:82d4ce/00 cheat description:Infinite missiles - P2 code:82d4f0/00 cheat description:Shields lasts longer code:80dc3b/7f cheat description:Plasma Pulse Energizer lasts longer - P1 code:80dc96/08 cheat description:Plasma Pulse Energizer lasts longer - P2 code:80dcbc/08 cheat description:Keep P.P.E. for that level once picked up - P1 code:818c3f/ad cheat description:Keep P.P.E. for that level once picked up - P2 code:818c4e/ad cheat description:Get 6 missiles for each 1 - P1 code:80dc0d/06 cheat description:Get 9 missiles for each 1 - P1 code:80dc0d/09 cheat description:Get 9 missiles for each 1 - P2 code:80dc22/06 cheat description:Get 6 missiles for each 1 - P2 code:80dc22/09 cheat description:Gunpower replenishes slower - P1 code:8094ee/10 cheat description:Gunpower replenishes slower - P2 code:809545/10 cheat description:10 credits code:83eaff/10 cheat description:15 credits code:83eaff/15 cheat description:20 credits code:83eaff/20 cheat description:P.P.E. does extra damage - P1 code:80dc9b/06 cheat description:P.P.E. does massive damage - P1 code:80dc9b/12 cheat description:Infinite health - P1 code:7e007f/7f cheat description:Infinite health - P2 code:7e0081/7f cartridge sha256:1711fe9010232b41ec406900e5b4ef528dd2beaa97b27d94ed7eef57d63904a0 name:Taz-Mania (USA) (Rev 1) cheat description:Infinite health code:99e072/a5 cheat description:Infinite time code:99e292/00 cheat description:Infinite continues (don't combine with start on act codes) code:99e1b8/ad cheat description:Advance to next level after getting 1 kiwi code:96bb59/84 cheat description:Faster timer code:99e27c/04 cheat description:1 minute to complete act 1, level 1 code:99802a/01 cheat description:5 minutes to complete act 1, level 1 code:99802a/05 cheat description:Kiwi's worth 2 code:96bb59/fe cheat description:Kiwi's worth 4 code:96bb59/fc cheat description:Kiwi's worth 5 code:96bb59/fb cheat description:Kiwi's worth 7 code:96bb59/f9 cheat description:Red bird worth 0 seconds instead of 10 code:99e245/00 cheat description:Red bird worth 20 seconds code:99e245/02 cheat description:Red bird worth 30 seconds code:99e245/03 cheat description:Red bird worth 40 seconds code:99e245/04 cheat description:Red bird worth 50 seconds code:99e245/05 cheat description:Start with 1/4 normal health code:99dfdc/07 cheat description:Start with 1/2 normal health code:99dfdc/0f cheat description:Start with 3/4 normal health code:99dfdc/15 cheat description:Start with 1 continue (don't combine with start on act codes) code:99e11e/01 cheat description:Start with 5 continues (don't combine with start on act codes) code:99e11e/05 cheat description:Start with 7 continues (don't combine with start on act codes) code:99e11e/07 cheat description:Start with 9 continues (don't combine with start on act codes) code:99e11e/09 cheat description:Start with 50 continues (don't combine with start on act codes) code:99e11e/32 cheat description:Start with 99 continues (don't combine with start on act codes) code:99e11e/63 cheat description:Start on act 1, level 2 code:99e188/2c+99e189/30+99e11e/01 cheat description:Start on act 1, level 3 code:99e188/2c+99e189/30+99e11e/02 cheat description:Start on act 1 bonus level code:99e188/2c+99e189/30 cheat description:Start on act 2, level 1 code:99e188/2c+99e189/30+99e11e/04 cheat description:Start on act 2, level 2 code:99e188/2c+99e189/30+99e11e/05 cheat description:Start on act 2, level 3 code:99e188/2c+99e189/30+99e11e/06 cheat description:Start on act 2 bonus level code:99e188/2c+99e189/30+99e11e/07 cheat description:Start on act 3, level 1 code:99e188/2c+99e189/30+99e11e/08 cheat description:Start on act 3, level 2 code:99e188/2c+99e189/30+99e11e/09 cheat description:Start on act 3, level 3 code:99e188/2c+99e189/30+99e11e/0a cheat description:Start on act 3 bonus level code:99e188/2c+99e189/30+99e11e/0b cheat description:Start on act 4, level 1 code:99e188/2c+99e189/30+99e11e/0c cheat description:Start on act 4, level 2 code:99e188/2c+99e189/30+99e11e/0d cheat description:Start on act 4, level 3 code:99e188/2c+99e189/30+99e11e/0e cheat description:Start on act 4 bonus level code:99e188/2c+99e189/30+99e11e/0f cheat description:Start on act 5, level 1 code:99e188/2c+99e189/30+99e11e/10 cheat description:Start on act 5, level 2 code:99e188/2c+99e189/30+99e11e/11 cheat description:Start on act 5, level 3 code:99e188/2c+99e189/30+99e11e/12 cheat description:Infinite health (alt) code:7e0096/1d cheat description:Infinite time (alt) code:7e0098/99 cartridge sha256:e3bd2296b860a547bb8594485048d3e1326a416405ed9e91139c75f8927acfe3 name:Taz-Mania (USA) cheat description:Infinite health code:99e072/a5 cheat description:Infinite time code:99e292/00 cheat description:Infinite continues (don't combine with start on act codes) code:99e1b8/ad cheat description:Advance to next level after getting 1 kiwi code:96bb59/84 cheat description:Faster timer code:99e27c/04 cheat description:1 minute to complete act 1, level 1 code:99802a/01 cheat description:5 minutes to complete act 1, level 1 code:99802a/05 cheat description:Kiwi's worth 2 code:96bb59/fe cheat description:Kiwi's worth 4 code:96bb59/fc cheat description:Kiwi's worth 5 code:96bb59/fb cheat description:Kiwi's worth 7 code:96bb59/f9 cheat description:Red bird worth 0 seconds instead of 10 code:99e245/00 cheat description:Red bird worth 20 seconds code:99e245/02 cheat description:Red bird worth 30 seconds code:99e245/03 cheat description:Red bird worth 40 seconds code:99e245/04 cheat description:Red bird worth 50 seconds code:99e245/05 cheat description:Start with 1/4 normal health code:99dfdc/07 cheat description:Start with 1/2 normal health code:99dfdc/0f cheat description:Start with 3/4 normal health code:99dfdc/15 cheat description:Start with 1 continue (don't combine with start on act codes) code:99e11e/01 cheat description:Start with 5 continues (don't combine with start on act codes) code:99e11e/05 cheat description:Start with 7 continues (don't combine with start on act codes) code:99e11e/07 cheat description:Start with 9 continues (don't combine with start on act codes) code:99e11e/09 cheat description:Start with 50 continues (don't combine with start on act codes) code:99e11e/32 cheat description:Start with 99 continues (don't combine with start on act codes) code:99e11e/63 cheat description:Start on act 1, level 2 code:99e188/2c+99e189/30+99e11e/01 cheat description:Start on act 1, level 3 code:99e188/2c+99e189/30+99e11e/02 cheat description:Start on act 1 bonus level code:99e188/2c+99e189/30 cheat description:Start on act 2, level 1 code:99e188/2c+99e189/30+99e11e/04 cheat description:Start on act 2, level 2 code:99e188/2c+99e189/30+99e11e/05 cheat description:Start on act 2, level 3 code:99e188/2c+99e189/30+99e11e/06 cheat description:Start on act 2 bonus level code:99e188/2c+99e189/30+99e11e/07 cheat description:Start on act 3, level 1 code:99e188/2c+99e189/30+99e11e/08 cheat description:Start on act 3, level 2 code:99e188/2c+99e189/30+99e11e/09 cheat description:Start on act 3, level 3 code:99e188/2c+99e189/30+99e11e/0a cheat description:Start on act 3 bonus level code:99e188/2c+99e189/30+99e11e/0b cheat description:Start on act 4, level 1 code:99e188/2c+99e189/30+99e11e/0c cheat description:Start on act 4, level 2 code:99e188/2c+99e189/30+99e11e/0d cheat description:Start on act 4, level 3 code:99e188/2c+99e189/30+99e11e/0e cheat description:Start on act 4 bonus level code:99e188/2c+99e189/30+99e11e/0f cheat description:Start on act 5, level 1 code:99e188/2c+99e189/30+99e11e/10 cheat description:Start on act 5, level 2 code:99e188/2c+99e189/30+99e11e/11 cheat description:Start on act 5, level 3 code:99e188/2c+99e189/30+99e11e/12 cheat description:Infinite health (alt) code:7e0096/1d cheat description:Infinite time (alt) code:7e0098/99 cartridge sha256:35dd020cf57fc402417ab6e4a6c49866c5a86bba25218c0aaf7ce85cb134bcf8 name:Tecmo Super Bowl (USA) cheat description:Always 1st down code:8299c8/a5 cheat description:1 play to get a 1st down code:8299cd/01 cheat description:2 plays to get a 1st down code:8299cd/02 cheat description:3 plays to get a 1st down code:8299cd/03 cheat description:5 plays to get a 1st down code:8299cd/05 cheat description:7 plays to get a 1st down code:8299cd/07 cheat description:Extra points worth 0 points - P1 code:828b68/00 cheat description:Extra points worth 3 points - P1 code:828b68/03 cheat description:Extra points worth 5 points - P1 code:828b68/05 cheat description:Extra points worth 9 points - P1 code:828b68/09 cheat description:Extra points worth 0 points - P2 code:82977b/00 cheat description:Extra points worth 3 points - P2 code:82977b/03 cheat description:Extra points worth 5 points - P2 code:82977b/05 cheat description:Extra points worth 9 points - P2 code:82977b/09 cheat description:Field goals worth 0 points - P1 code:8287ef/00 cheat description:Field goals worth 1 points - P1 code:8287ef/01 cheat description:Field goals worth 5 points - P1 code:8287ef/05 cheat description:Field goals worth 9 points - P1 code:8287ef/09 cheat description:Field goals worth 0 points - P2 code:829400/00 cheat description:Field goals worth 1 points - P2 code:829400/01 cheat description:Field goals worth 5 points - P2 code:829400/05 cheat description:Field goals worth 9 points - P2 code:829400/09 cheat description:Safeties worth 0 points - P1 code:82954f/00 cheat description:Safeties worth 1 points - P1 code:82954f/01 cheat description:Safeties worth 5 points - P1 code:82954f/05 cheat description:Safeties worth 9 points - P1 code:82954f/09 cheat description:Safeties worth 0 points - P2 code:82893c/00 cheat description:Safeties worth 1 points - P2 code:82893c/01 cheat description:Safeties worth 5 points - P2 code:82893c/05 cheat description:Safeties worth 9 points - P2 code:82893c/09 cheat description:Touchdowns worth 0 points - P1 code:82898b/00 cheat description:Touchdowns worth 3 points - P1 code:82898b/03 cheat description:Touchdowns worth 5 points - P1 code:82898b/05 cheat description:Touchdowns worth 8 points - P1 code:82898b/08 cheat description:Touchdowns worth 0 points - P2 code:82affb/00+82959e/00 cheat description:Touchdowns worth 3 points - P2 code:82affb/03+82959e/03 cheat description:Touchdowns worth 5 points - P2 code:82affb/05+82959e/05 cheat description:Touchdowns worth 9 points - P2 code:82affb/09+82959e/09 cheat description:0 timeouts for the first half - both players code:84c177/00 cheat description:2 timeouts for the first half - both players code:84c177/02 cheat description:7 timeouts for the first half - both players code:84c177/07 cheat description:9 timeouts for the first half - both players code:84c177/09 cheat description:0 timeouts for the first half - P1 code:84c178/64 cheat description:0 timeouts for the first half - P2 code:84c17a/64 cheat description:0 timeouts for the second half - both players code:84c1c8/00 cheat description:2 timeouts for the second half - both players code:84c1c8/02 cheat description:7 timeouts for the second half - both players code:84c1c8/07 cheat description:9 timeouts for the second half - both players code:84c1c8/09 cheat description:0 timeouts for the second half - P1 code:84c1c9/64 cheat description:0 timeouts for the second half - P2 code:84c1cb/64 cheat description:Timeouts are not reset at half-time - P1 code:84c1c9/a5 cheat description:Timeouts are not reset at half-time - P2 code:84c1cb/a5 cheat description:Quarters start at 2 minutes 30 seconds code:819eed/30+819eee/02 cartridge sha256:8cfd4c5525f4bd4bba5af7e2323f1e61f27ce97c6d5617cfa685c9276fbf6407 name:Tecmo Super Bowl III - Final Edition (USA) cheat description:Infinite ability points in the edit menu code:bce2b5/ea cartridge sha256:14bce564f976d1431127259edbcb23c52c79361fed9814d307d627c4650e800e name:Tecmo Super NBA Basketball (USA) cheat description:Never miss a shot (hold Y and press the shot button) code:8c8e53/30+8c8e50/ad+8c8e51/0b+8c8e52/0a+8c8e54/11 cartridge sha256:5b82cdd6f2da56f43680d6a5021faebe2e06036d30602c1a7917aa414cf8b5f4 name:Teenage Mutant Ninja Turtles IV - Turtles in Time (USA) cheat description:Invincibility code:00b98e/ea+00b992/95+00b98f/a9+00b990/02+00b991/00 cheat description:Infinite health code:00dd10/b5 cheat description:Infinite lives code:00cea6/00 cheat description:One hit kills (disable during Shredder's first fight) code:0485a7/80 cheat description:Hit anywhere - P1 code:03828f/fc cheat description:Hit anywhere - P2 code:03829f/fc cheat description:Start with 1 life instead of 3 code:01d6bc/00 cheat description:Start with 5 lives code:01d6bc/04 cheat description:Start with 10 lives code:01d6bc/09 cheat description:Start with 25 lives code:01d6bc/24 cheat description:Start with 50 lives code:01d6bc/49 cheat description:Start with 75 lives code:01d6bc/74 cheat description:Start with 100 lives code:01d6bc/99 cheat description:Start on level 2 code:0497bb/85+0497bc/81+0497bd/00+0497ba/01 cheat description:Start on level 4 code:0497bb/85+0497bc/81+0497bd/00+0497ba/03 cheat description:Start on level 5 code:0497bb/85+0497bc/81+0497bd/00+0497ba/04 cheat description:Start on level 6 code:0497bb/85+0497bc/81+0497bd/00+0497ba/05 cheat description:Start on level 7 code:0497bb/85+0497bc/81+0497bd/00+0497ba/06 cheat description:Start on level 8 code:0497bb/85+0497bc/81+0497bd/00+0497ba/07 cheat description:Start on level 9 code:0497bb/85+0497bc/81+0497bd/00+0497ba/08 cheat description:Start on level 10 code:0497bb/85+0497bc/81+0497bd/00+0497ba/09 cheat description:Infinite health (alt) (enable after level starts) code:7e044a/56 cartridge sha256:849141370f164d6db3e5709da670726f958ce13ffef69319564db3fb0b12c69d name:Teenage Mutant Ninja Turtles - Tournament Fighters (USA) cheat description:Health doesn't decrease over time code:83a961/00 cheat description:Automatic and infinite continues code:80c887/bd cheat description:Hit anywhere - P1 code:848559/80 cheat description:Hit anywhere - P2 code:8485f5/80 cheat description:Leonardo is replaced by Rat King code:81adc9/0a cheat description:Leonardo is replaced by Karai code:81adc9/0b cheat description:Raphael is replaced by Rat King code:81adcb/0a cheat description:Raphael is replaced by Karai code:81adcb/0b cheat description:Donatello is replaced by Rat King code:81adcd/0a cheat description:Donatello is replaced by Karai code:81adcd/0b cheat description:Matches are 10 seconds long (leave menu option on 60) code:81b085/10 cheat description:Matches are 15 seconds long (leave menu option on 60) code:81b085/15 cheat description:Matches are 20 seconds long (leave menu option on 60) code:81b085/20 cheat description:Matches are 75 seconds long (leave menu option on 60) code:81b085/75 cheat description:Ultimate attack can be done any time code:83a8cb/01 cheat description:Ultimate attack can be done with about 1/4 health code:83a8cb/14 cheat description:Ultimate attack can be done with about 1/2 health code:83a8cb/28 cheat description:Ultimate attack can be done with about 3/4 health code:83a8cb/3c cheat description:Health decreases twice as fast code:83a961/02 cheat description:After doing an ultimate attack, health bar goes to about 1/4 code:83a8ea/14 cheat description:After doing an ultimate attack, health bar goes to about 1/2 code:83a8ea/28 cheat description:After doing an ultimate attack, health bar goes to about 3/4 code:83a8ea/3c cheat description:Start with 1/4 health - both players code:85ff53/18 cheat description:Start with 1/2 health - both players code:85ff53/30 cheat description:Start with 3/4 health - both players code:85ff53/48 cheat description:Start with no continues (leave menu option on 3) code:819266/00 cheat description:Start with 1 continue code:819266/02 cheat description:Start with 3 continues code:819266/04 cheat description:Start with 5 continues code:819266/06 cheat description:Start with 7 continues code:819266/08 cheat description:Infinite health code:7e0ee4/60 cheat description:Full power bar code:7e1ac0/60 cheat description:Empty power bar - opponent code:7e1b10/00 cheat description:Opponent dizzy after every knockdown code:7e0fc2/10 cheat description:Win one round to win match code:7e1950/02 cartridge sha256:8620203da71d32d017bb21f542864c1d90705b87eb67815d06b43f09120318aa name:Tengai Makyou Zero (Japan) cheat description:No random battles code:7e1659/08 cheat description:Infinite HP - character 1 code:7e1694/e7+7e1695/03 cheat description:Infinite HP - character 2 code:7e1696/e7+7e1697/03 cheat description:Infinite HP - character 3 code:7e1698/e7+7e1699/03 cheat description:Infinite MP - character 1 code:7e16c8/e7+7e16c9/03 cheat description:Infinite MP - character 2 code:7e16ca/e7+7e16cb/03 cheat description:Infinite MP - character 3 code:7e16cc/e7+7e16cd/03 cheat description:Fast level gain code:7e1950/ff+7e1951/ff cartridge sha256:bd7074ef4a05d790646abe145ffd2587fb48044e4b730286d807abe102841177 name:Terminator, The (USA) cheat description:Infinite lives (not on car stages) code:80b18c/ad cheat description:Infinite Grenades code:06c1e5/2c cheat description:Infinite Missiles code:06cd71/ad cheat description:10 Grenades on pick-up code:06cb9c/0a cheat description:2 Grenades on pick-up code:06cb9c/02 cheat description:Longer invulnerability after being hit code:06b961/ff cheat description:Shorter invulnerability after being hit code:06b961/1f cheat description:Don't lose Grenades on dying code:06c158/2c cheat description:Don't lose Missiles on dying code:06c155/2c cheat description:Get Rapid Fire on dying code:06c151/03 cheat description:Start with Rapid Fire code:808237/03 cheat description:Start with 9 lives code:80c6db/09 cheat description:Start with 1 life code:80c6db/01 cartridge sha256:06db3be569a587d79b51bfc684fd2ebdea977863875aedec88218fbb4169c21b name:Terminator 2 - Judgment Day (USA) cheat description:Infinite energy code:7e1407/c8 cheat description:Infinite health - John code:7e1452/64 cheat description:Infinite health - Sarah code:7e149d/64 cheat description:Infinte ammo code:7e1407/ff cartridge sha256:3cdebbd8adc4bb6773a7995f542fdac49adefca71cba583255a1c1bf37ac3946 name:Tetris & Dr. Mario (USA) cheat description:Tetris - Level never increases code:819d26/80 cheat description:Tetris - After the first level your level increases every line code:819d29/01 cheat description:Tetris - The same piece always drops code:81923a/a9+81923b/02+81923c/00 cheat description:Tetris - Always at high speed code:8197d3/a9+8197d4/0a+8197d5/ea cheat description:Dr. Mario - The same piece always drops until you hit the change button code:82a05a/a9+82a05b/0a+82a05c/ea cheat description:Dr. Mario - The same piece always drops code:828b3c/a9+828b3d/0a+828b3e/ea cheat description:Tetris 2 - Select any round - 1P (at round select meter, keep pressing right) code:849b00/50 cheat description:Tetris 2 - Tile speed always at 0 code:82a874/a9+82a875/00+82a876/00 cheat description:Tetris 2 - Tile speed always at 255 code:82a874/a9+82a875/ff+82a876/00 cheat description:Tetris 2 - More time to place the blocks where you want them, even after they hit the ground (left and right only) code:82976a/80 cartridge sha256:70dea29a928c1625def31c862dc74960e39e587e416b45829efc21f13ebd9630 name:Tetris 2 (USA) (Rev 1) cheat description:Select any round code:849b00/50 cheat description:Tile speed always at 0 code:82a874/a9+82a875/00+82a876/00 cheat description:Tile speed always at 255 code:82a874/a9+82a875/ff+82a876/00 cheat description:More time to place the blocks where you want them code:82976a/80 cartridge sha256:accc836c3adabadc810fbe35702c6a64d50a09f4c672d2734fa58b251d7a20aa name:Tetris 2 (USA) cheat description:Select any round code:849b00/50 cheat description:Tile speed always at 0 code:82a874/a9+82a875/00+82a876/00 cheat description:Tile speed always at 255 code:82a874/a9+82a875/ff+82a876/00 cheat description:More time to place the blocks where you want them code:82976a/80 cartridge sha256:4aee5b05ae11643fc6cb7ed32dfd4e82bbb52d03b12aabb080af35e2df6f562f name:Tetsuwan Atom (Japan) cheat description:Invincibility code:9c8271/d0 cheat description:Infinite health code:81a812/ad cheat description:Infinite lives code:81a569/ad cartridge sha256:d50aaa41e153ca356eee16a9deccb1a763ee56ebbe6c80cd28c5ad1db66a5316 name:Thunder Spirits (USA) cheat description:Infinite lives code:00ada9/a9 cheat description:Infinite lives (alt) code:c0ada9/ad cheat description:Infinite credits code:00c6ac/ea cheat description:Infinite credits (alt) code:c0c6b1/ad cheat description:Hit anywhere code:00ae70/24+00ae89/24+00ae57/24+00aea2/24+00ae1e/24 cheat description:Keep captured weapon until game ends (except claw and shield) code:00adb9/ad+00adbe/ad cheat description:Continue with 1 life code:00c700/9c cheat description:Continue with 2 lives code:00c6fd/00+00c6fc/a9 cheat description:Continue with 5 lives code:00c6fd/03+00c6fc/a9 cheat description:Continue with 7 lives code:00c6fd/05+00c6fc/a9 cheat description:Continue with 9 lives code:00c6fd/07+00c6fc/a9 cheat description:Start with 1 credit code:009113/a3 cheat description:Start with 2 credits code:009113/b2 cheat description:Start with 3 credits code:009113/92 cheat description:Start with 5 credits code:009113/9f cheat description:Start with 8 credits code:009112/8b+009113/a2 cheat description:Start with 12 credits code:009112/04+009113/ae cheat description:Start with 1 life code:0090e1/ff+0090e0/a9 cheat description:Start with 2 lives code:0090e1/00+0090e0/a9 cheat description:Start with 5 lives code:0090e1/03+0090e0/a9 cheat description:Start with 7 lives code:0090e1/05+0090e0/a9 cheat description:Start with 9 lives code:0090e1/07+0090e0/a9 cheat description:Start with 25 lives code:0090e1/17+0090e0/a9 cheat description:Start with 50 lives code:0090e1/30+0090e0/a9 cheat description:Start with 100 lives code:0090e1/62+0090e0/a9 cheat description:Stage modifier code:7e1a98/00 cheat description:Start on stage 2 code:008a7c/01+008a7b/a9+008a7d/00+008a7e/ea cheat description:Start on stage 3 code:008a7c/02+008a7b/a9+008a7d/00+008a7e/ea cheat description:Start on stage 4 code:008a7c/03+008a7b/a9+008a7d/00+008a7e/ea cheat description:Start on stage 5 code:008a7c/04+008a7b/a9+008a7d/00+008a7e/ea cheat description:Start on stage 6 code:008a7c/05+008a7b/a9+008a7d/00+008a7e/ea cheat description:Start on stage 7 code:008a7c/06+008a7b/a9+008a7d/00+008a7e/ea cheat description:Start on stage 8 code:008a7c/07+008a7b/a9+008a7d/00+008a7e/ea cheat description:Invincibility code:7e0418/7b cheat description:Invincibility (alt) code:00ad90/77 cartridge sha256:eb958801fd1f08771e5a0933f7701d633262efbfe8d47de21dda18e3b77670de name:Tick, The (USA) cheat description:Infinite lives code:80a536/00 cheat description:Most kicks are stronger code:bf8549/0c cheat description:Most kicks kill most enemies code:bf8549/1f cartridge sha256:8e82f98d2e62bc1e5fcf2386c2b5ca54998398220efcedd67858aaaa92289a42 name:Time Slip (USA) cheat description:Invincibility code:01a4de/ea cheat description:Infinite health code:019230/ad cheat description:Infinite lives code:00ddfb/ad cheat description:Infinite ammo code:01a3e4/ad cheat description:Infinite TGS meter code:01b729/ad cheat description:Hit anywhere code:00955f/80+009560/16+009594/ad+00959e/ad cheat description:Keep gun power-ups after dying code:00de2f/a0+00de2a/a0 cheat description:Flash 2x longer when hit code:01923a/80 cheat description:Barely flash at all when hit code:01923a/10 cheat description:Fewer enemies code:018a14/ad+0189af/ad+018b10/ad+0189a7/ad cheat description:Start with all weapons and 9 rounds code:0082b1/09 cheat description:Start with 16 lives code:00829d/ff cheat description:Start with 4 health bars - after 1st life code:00ddf6/0f cheat description:Start with 3 health bars - after 1st life code:00ddf6/07 cheat description:Start with 4 health bars - 1st life code:0082a5/0f cheat description:Start with 3 health bars - 1st life code:0082a5/07 cheat description:Start on stage - Cretaceous code:00dc2d/a9+00dc2f/00+00dc30/8d+00dc2e/01 cheat description:Start on stage - Egypt code:00dc2d/a9+00dc2f/00+00dc30/8d+00dc2e/02 cheat description:Start on stage - Rome code:00dc2d/a9+00dc2f/00+00dc30/8d+00dc2e/03 cheat description:Start on stage - Invasion 2147 code:00dc2d/a9+00dc2f/00+00dc30/8d+00dc2e/04 cheat description:Start on stage - Tirmat code:00dc2d/a9+00dc2f/00+00dc30/8d+00dc2e/05 cartridge sha256:fa7e2b40093f0cc7233cc77e95bbbea2144c8183dec10446590396fffd7cda37 name:Time Trax (USA) cheat description:Infinite health code:81f1b6/ad cheat description:Infinite lives code:81f314/ad cheat description:Invincibility code:84e948/ff+8187ff/ff cheat description:Infinite health (alt) code:7e14b5/06 cheat description:Infinite Time Stall code:7e14b9/30 cartridge sha256:16fb965130e57f37dda2466f23820f091f8b96758aa7e30ba4fd63cb618e5ddb name:Timecop (USA) cheat description:Invincibility code:809ec8/00 cheat description:Don't flash when invincible code:809ed1/80 cheat description:Infinite health code:7e06f3/99 cheat description:Infinite Gun code:7e06f5/99 cheat description:Infinite Bombs code:7e06f7/99 cheat description:Infinite time code:7e0638/63 cartridge sha256:271a67b32b3bb00ceb0f4e7d81494888d0d821635f0f936d481dfbe671567c08 name:Timon & Pumbaa's Jungle Games (USA) cheat description:Infinite ammo/balls code:7e00dc/09 cartridge sha256:0503cd93b4d211a825acd47ff3813668b4ce68890c8be2fbfe5ac2b46882dfcf name:Tin Star (USA) cheat description:Infinite health code:7e09c8/a0 cheat description:Infinite lives code:7e0928/09 cheat description:Bosses die automatically code:7e0b78/00 cheat description:Gain money much faster code:7e182a/50+7e182b/c3 cheat description:Max money code:7e07dd/09+7e07dc/09+7e07db/09+7e07da/09+7e07d9/09+7e07d8/09 cheat description:Have $9,000,000 code:7e07d8/09 cartridge sha256:5b8a7309910ae040b6301bdc0ad09fa1991b2b7210a6b76931cd91ce0c82c424 name:Tinhead (Europe) (Proto) cheat description:Infinite health code:009803/ad cheat description:Infinite lives code:0087f6/ad cheat description:Infinite Bombs code:0097f0/ad cartridge sha256:71de4dec6a8e8be685627b6e929317f7cefb836997059bbd3b438ccc07a60044 name:Tintin - Prisoners of the Sun (Europe) (En,Fr,De,Es) cheat description:Invincibility code:80823c/d0+828591/d0 cheat description:Infinite health code:82bb5e/cd cheat description:Infinite time code:82be5b/af cheat description:Infinite lives code:82bb7f/cd cheat description:Infinite health (alt) code:7e059b/04 cheat description:Infinite time (alt) code:7f5b7f/63 cartridge sha256:da8b8bccebf51b70213adecda37387d1bdb55aeb7bc0805bb1be1cd9b514daf6 name:Tintin in Tibet (Europe) (En,Fr,De,Nl) cheat description:Invincibility (after first hit) code:7e050f/2c cheat description:Infinite health code:7e05c9/04 cheat description:Infinite lives code:7e05cb/03 cheat description:Infinite time code:7f59ae/06 cartridge sha256:ba679a11264e9695895a6c17358a41e8459be06166d056811df9c2738fef3d0d name:Tiny Toon Adventures - Buster Busts Loose! (USA) cheat description:Infinite health (when hit, a fake empty heart appears) code:8ff05a/ea cheat description:Infinite lives (except football level) code:80ef2c/00 cheat description:Infinite lives (football level) code:80af45/00 cheat description:Infinite dash meter code:80d03f/a5 cheat description:Five heart maximum on challenge level code:81ba2b/06 cheat description:1-up gives 2-up (not on mystery weight challenge level, or by collecting stars) code:808697/02 cheat description:Small star worth 2 code:8feefa/02 cheat description:Small star worth 5 code:8feefa/05 cheat description:Small star worth 10 code:8feefa/10 cheat description:Gold Gogo Dodo Trophy lasts 1/2 as long code:83812b/01 cheat description:Gold Gogo Dodo Trophy lasts 2x as long code:83812b/04 cheat description:Choose bonus level after completing a level code:80a5f5/a5 cheat description:Passwords work on any difficulty level (not just Children level) code:91ea81/34 cheat description:Continue with 1 life code:80a647/01 cheat description:Continue with 5 lives code:80a647/05 cheat description:Continue with 10 lives code:80a647/10 cheat description:Continue with 25 lives code:80a647/25 cheat description:Continue with 50 lives code:80a647/50 cheat description:Continue with 99 lives code:80a647/99 cheat description:Start with 1 life code:808518/01 cheat description:Start with 5 lives code:808518/05 cheat description:Start with 10 lives code:808518/10 cheat description:Start with 25 lives code:808518/25 cheat description:Start with 50 lives code:808518/50 cheat description:Start with 99 lives code:808518/99 cheat description:Start with no continues on normal level - handicap code:81800c/00 cheat description:Start with 7 continues on normal level code:81800c/07 cheat description:Start with 9 continues on normal level code:81800c/09 cheat description:Start with no continues on challenge level code:81800d/00 cheat description:Start with 5 continues on challenge level code:81800d/05 cheat description:Start with 7 continues on challenge level code:81800d/07 cheat description:Start with 9 continues on challenge level code:81800d/09 cheat description:Start with 1 heart on Children or Normal difficulty levels (don't pick challenge level) code:80a407/01 cheat description:Start with 4 hearts on Children or Normal difficulty levels, 2 on Challenge code:80a407/04 cheat description:Start with 5 hearts on Children or Normal difficulty levels, 3 on Challenge code:80a407/05 cartridge sha256:08d808e9c5851e4301a38a56b350a20ea9e3adbef51546e87e1785d691d0f2d5 name:TKO Super Championship Boxing (USA) cheat description:Infinite punch meters - both players code:01b3b5/24 cheat description:Infinite punch meter - P1 code:009118/24 cheat description:Infinite punch meter - P2 code:00914e/24 cheat description:9 minutes per round code:008b4c/09 cheat description:6 minutes per round code:008b4c/06 cheat description:1 minute per round code:008b4c/01 cheat description:Allowed only 3 punches in punch meter - P1 code:009122/03+008b7e/03 cheat description:Allowed only 3 punches in punch meter - P2 code:009158/03+008b7e/03 cartridge sha256:32d0f1ca5b91fd9b2caf81422fb9e8fb30bc091f0b2a429b9269dd307fcba4fd name:Todd McFarlane's Spawn - The Video Game (USA) cheat description:Invincibility after one hit (invisible) code:c14ae8/ad cheat description:Almost invincible (blinking) code:c14ae6/ea cheat description:Infinite health code:c14abc/ad cheat description:Infinite special moves code:c13a0d/ad cheat description:Hit anywhere code:c512ba/24 cheat description:Don't blink after getting hit code:c50596/10 cheat description:Falling doesn't use life points code:c11824/ad cheat description:Special moves don't use life points code:c13a0d/ad cheat description:Some bullets do 2x damage code:c50237/08 cheat description:Some bullets do no damage code:c50237/00 cheat description:Some bullets kill you code:c50237/ff cheat description:Some enemy punches electrocute you code:c532ba/09 cheat description:Some enemy punches do no damage code:c532ba/00 cheat description:Some enemy punches kill you code:c532ba/ff cheat description:Guys with pipes do 2x damage code:c39b47/09+c3aa1e/09 cheat description:Guys with pipes do no damage code:c39b47/00+c3aa1e/00 cheat description:Guys with pipes kill code:c39b47/ff+c3aa1e/ff cheat description:Flaming bottles do 2x damage code:c52890/09+c527e8/09 cheat description:Flaming bottles do no damage code:c52890/00+c527e8/00 cheat description:Flaming bottles kill code:c52890/ff+c527e8/ff cheat description:Start with 1/4 health code:c29748/10 cheat description:Start with 1/2 health code:c29748/2a cheat description:Start with 3/4 health code:c29748/3e cheat description:Invincibility code:7e1f56/1f cheat description:Infinite health (alt) code:7e1f00/63 cartridge sha256:4f500da19dbb1557a7bc0ce14437098c1402478d573fb569303b81c011f86fbf name:Tom and Jerry (USA) cheat description:Invincibility code:7e14c8/33 cheat description:Infinite hearts code:7e1242/04 cheat description:Infinite lives code:7e14fc/09 cheat description:Infinite time code:7e157a/63 cheat description:Infinite Cheese Bits code:7e155e/63 cartridge sha256:ca9889f17f184b3d99a2eaaa82af73e366f03ed00313fdd369e5e023b208e788 name:Top Gear (USA) cheat description:Always finish first code:00a1f2/18 cheat description:Infinite fuel - P1 code:05d67b/ad cheat description:Infinite fuel - P2 code:05dee1/ad cheat description:Infinite nitro boosts - P1 code:00ba22/ea cheat description:Infinite nitro boosts - P2 code:00ba8b/ea cheat description:Nitro boost lasts until end of race - P1 code:00ba47/ad cheat description:Nitro boost lasts until end of race - P2 code:00bab0/ad cheat description:Race in any country code:0f9337/80 cheat description:Don't slow down offroad code:05d858/ad cheat description:Don't slow down against obstacles code:05d6e9/00 cheat description:Don't slow down against cars code:05e4bc/00+05e4b7/00 cheat description:Start with 1/2 fuel code:00d996/53 cheat description:Start with 3/4 fuel code:00d996/7c cheat description:Start with no nitro boosts instead of 3 code:0082e0/00 cheat description:Start with 1 nitro boost code:0082e0/01 cheat description:Start with 2 nitro boosts code:0082e0/02 cheat description:Start with 6 nitro boosts code:0082e0/06 cheat description:Start with 9 nitro boosts code:0082e0/09 cartridge sha256:76b2702c4be8b668c1017f2817c280283c275eaa41535bf6ffa2b8d2220b68c6 name:Top Gear 2 (USA) cheat description:Infinite nitro code:808e31/cd cheat description:Infinite nitros - P1 code:808e31/ad cheat description:Infinite nitros - P2 code:80a695/ad cheat description:Infinite fuel code:809a39/ad cheat description:Infinite money code:9fac27/bd cheat description:Fuel never runs out code:809905/a5 cheat description:Always finish first code:80defe/8e cheat description:1st place gives $50,000 instead of $10,000 code:9fef46/32 cheat description:2nd place gives $50,000 instead of $6,000 code:9fef48/32 cheat description:3rd place gives $50,000 instead of $4,000 code:9fef4a/32 cheat description:4th place gives $50,000 instead of $3,000 code:9fef4c/32 cheat description:5th place gives $50,000 instead of $2,000 code:9fef4e/32 cheat description:6th place gives $50,000 instead of $1,000 code:9fef50/32 cheat description:7th place gives $50,000 instead of $0 code:9fef52/32 cheat description:8th place gives $50,000 instead of $0 code:9fef54/32 cheat description:9th place gives $50,000 instead of $0 code:9fef56/32 cheat description:10th place gives $50,000 instead of $0 code:9fef58/32 cheat description:1st place is worth 20 points instead of 10 code:9fe35d/14 cheat description:2nd place is worth 20 points instead of 6 code:9fe35f/14 cheat description:3rd place is worth 20 points instead of 4 code:9fe361/14 cheat description:4th place is worth 20 points instead of 3 code:9fe363/14 cheat description:5th place is worth 20 points instead of 2 code:9fe365/14 cheat description:6th place is worth 20 points instead of 1 code:9fe367/14 cheat description:7th place is worth 20 points instead of 0 code:9fe369/14 cheat description:8th place is worth 20 points instead of 0 code:9fe36b/14 cheat description:9th place is worth 20 points instead of 0 code:9fe36d/14 cheat description:10th place is worth 20 points instead of 0 code:9fe36f/14 cheat description:Everything is free (must have enough to buy) code:9fac27/49+9fabe2/7d cheat description:2nd engine costs $1K instead of $30K code:9fac71/01 cheat description:2nd engine costs $15K instead of $30K code:9fac71/0f cheat description:3rd engine costs $1K instead of $50K code:9fac73/01 cheat description:3rd engine costs $25K instead of $50K code:9fac73/19 cheat description:4th engine costs $1K instead of $80K code:9fac75/01 cheat description:4th engine costs $40K instead of $80K code:9fac75/28 cheat description:2nd wet tires are free code:9fac79/00 cheat description:3rd wet tires are free code:9fac7b/00 cheat description:4th wet tires are free code:9fac7d/00 cheat description:2nd dry tires are free code:9fac81/00 cheat description:3rd dry tires are free code:9fac83/00 cheat description:4th dry tires are free code:9fac85/00 cheat description:2nd gear box costs $1K instead of $10K code:9fac89/01 cheat description:2nd gear box costs $5K instead of $10K code:9fac89/05 cheat description:3rd gear box costs $1K instead of $30K code:9fac8b/01 cheat description:3rd gear box costs $15K instead of $30K code:9fac8b/0f cheat description:4th gear box costs $1K instead of $50K code:9fac8d/01 cheat description:4th gear box costs $25K instead of $50K code:9fac8d/19 cheat description:2nd nitro costs $1K instead of $5K code:9fac91/01 cheat description:2nd nitro costs $2K instead of $5K code:9fac91/02 cheat description:3rd nitro costs $1K instead of $15K code:9fac93/01 cheat description:3rd nitro costs $7K instead of $15K code:9fac93/07 cheat description:4th nitro costs $1K instead of $30K code:9fac95/01 cheat description:4th nitro costs $15K instead of $30K code:9fac95/0f cheat description:2nd side armor costs $1K instead of $5K code:9faca1/01 cheat description:2nd side armor costs $2K instead of $5K code:9faca1/02 cheat description:3rd side armor costs $1K instead of $10K code:9faca3/01 cheat description:3rd side armor costs $5K instead of $10K code:9faca3/05 cheat description:4th side armor costs $1K instead of $20K code:9faca5/01 cheat description:4th side armor costs $10K instead of $20K code:9faca5/0a cheat description:2nd rear armor costs $1K instead of $5K code:9faca9/01 cheat description:2nd rear armor costs $2K instead of $5K code:9faca9/02 cheat description:3rd rear armor costs $1K instead of $10K code:9facab/01 cheat description:3rd rear armor costs $5K instead of $10K code:9facab/05 cheat description:4th rear armor costs $1K instead of $20K code:9facad/01 cheat description:4th rear armor costs $10K instead of $20K code:9facad/0a cheat description:2nd front armor costs $1K instead of $5K code:9facb1/01 cheat description:2nd front armor costs $2K instead of $5K code:9facb1/02 cheat description:3rd front armor costs $1K instead of $10K code:9facb3/01 cheat description:3rd front armor costs $5K instead of $10K code:9facb3/05 cheat description:4th front armor costs $1K instead of $20K code:9facb5/01 cheat description:4th front armor costs $10K instead of $20K code:9facb5/0a cheat description:Start with 0 nitros code:80d0c2/00 cheat description:Start with 2 nitros code:80d0c2/02 cheat description:Start with 4 nitros code:80d0c2/04 cheat description:Start with 8 nitros code:80d0c2/08 cheat description:Start with 10 nitros code:80d0c2/0a cartridge sha256:6be49983976564f1fd9eff2f14f5bb41d3a0ff48573e39318088ecce286aca62 name:Top Gear 3000 (USA) cheat description:Always finish first code:81f1ad/ae cheat description:Infinite fuel code:83ed82/a5 cheat description:Infinite Nitro code:83eb4a/c5 cheat description:Infinite time code:7e005b/00 cheat description:Infinite money code:7e0390/75+7e038f/30 cartridge sha256:9bf884be5627d38f060ad7f3a61ea1fea1474d416e1d037d33014ca9d5205c1d name:Total Carnage (USA) cheat description:Invincibility code:8bdc39/80 cheat description:Infinite lives code:8befd9/a5 cheat description:Infinite Time Bombs code:8bd755/24 cheat description:Shields last longer code:809aee/08 cheat description:Shields don't last last as long code:809aee/00 cheat description:Weapons don't run out until you die or change weapons code:8be040/a5 cheat description:Join in with 2 lives and 3 Time Bombs code:8098ac/01 cheat description:Join in with 10 lives and 9 Time Bombs code:8098ac/09 cheat description:Start with 2 lives code:83a4e8/01 cheat description:Start with 10 lives code:83a4e8/09 cheat description:Start with 1 Time Bomb code:83a500/01+809970/24 cheat description:Start with 9 Time Bombs code:83a500/09 cheat description:Invincibility (alt) code:8bdc39/80 cheat description:Infinite Shield - P1 code:7e0463/01 cheat description:Infinite Shield - P2 code:7e04ab/01 cheat description:Infinite lives - P1 code:7e0480/09 cheat description:Infinite lives - P2 code:7e04c8/09 cheat description:Infinite Time Bombs - P1 code:7e0481/09 cheat description:Infinite Time Bombs - P2 code:7e04c9/09 cheat description:Rapid Fire - P1 code:7e0477/03 cheat description:Rapid Fire - P2 code:7e04bf/03 cheat description:Always have Speed Shoes - P1 code:7e045e/01+7e0468/01 cheat description:Always have Speed Shoes - P2 code:7e04a6/01+7e04b0/01 cheat description:Have normal Gun - P1 code:7e0476/00 cheat description:Have normal Gun - P2 code:7e04be/00 cheat description:Have Gatling Ball Gun - P1 code:7e0476/0f cheat description:Have Gatling Ball Gun - P2 code:7e04be/0f cheat description:Have 3-way Gun - P1 code:7e0476/1e cheat description:Have 3-way Gun - P2 code:7e04be/1e cheat description:Have Rocket Launcher - P1 code:7e0476/2d cheat description:Have Rocket Launcher - P2 code:7e04be/2d cheat description:Have Blue Flame Thrower - P1 code:7e0476/4c cheat description:Have Blue Flame Thrower - P2 code:7e04be/4c cheat description:Have Ball Launcher - P1 code:7e0476/5a cheat description:Have Ball Launcher - P2 code:7e04be/5a cheat description:Have 150 Keys - P1 code:7e0485/96 cheat description:Have 150 Keys - P2 code:7e04cd/96 cheat description:Disable hurry up timer code:7e00af/00+7e00b0/00 cartridge sha256:345e795000e74f51704774edfc8049473461761a65eb47cab710caa29e09897b name:Toy Story (USA) cheat description:Invincibility code:989b35/ad cheat description:Infinite lives code:989b55/af cheat description:Start with 5 more lives than usual code:87e20e/08 cheat description:Start with 10 more lives than usual code:87e20e/0f cheat description:Start with 25 more lives than usual code:87e20e/1e cheat description:Start with 50 more lives than usual code:87e20e/37 cheat description:Start on level 2 code:88cb82/01 cheat description:Start on level 3 code:88cb82/02 cheat description:Start on level 4 code:88cb82/03 cheat description:Start on level 5 code:88cb82/04 cheat description:Start on level 6 code:88cb82/05 cheat description:Start on level 7 code:88cb82/06 cheat description:Start on level 8 code:88cb82/07 cheat description:Start on level 9 code:88cb82/08 cheat description:Start on level 10 code:88cb82/09 cheat description:Start on level 11 code:88cb82/0a cheat description:Start on level 12 code:88cb82/0b cheat description:Start on level 13 code:88cb82/0c cheat description:Start on level 14 code:88cb82/0d cheat description:Start on level 15 code:88cb82/0e cheat description:Start on level 16 code:88cb82/0f cheat description:Start on level 17 code:88cb82/10 cartridge sha256:7a6e5da46b026900fba4584a32ad40d940b9ecf9fccfb11f96a205a914014784 name:Toys - Let the Toy Wars begin! (USA) cheat description:Infinite lives code:8e8760/ad cheat description:Protection against most hazards code:8e9b85/ad+8ecb26/ad cheat description:Fewer toys gained from floor boxes code:88b873/0a cheat description:More toys gained from floor boxes code:889873/6f+809479/ff cheat description:Lots more toys gained from floor boxes code:88b873/35+809479/ff cheat description:Fewer toys gained from carousel code:888e54/0a cheat description:More toys gained from carousel code:888e54/35 cheat description:Lots more toys gained from carousel code:888e54/6f cheat description:Start with 1 life code:82db0f/01 cheat description:Start with 9 lives code:82db0f/09 cartridge sha256:683f5755fdce9c073561d5907f9182884eb203d4e52f84488440dd8dd8223005 name:Treasure Hunter G (Japan) cheat description:Quick level up code:90a123/a9+90a125/ea cheat description:Always win frog race code:878d79/a9+878d7a/34 cheat description:C.1 Full Element Set code:83da0d/0f cheat description:C.2 Full Element Set code:83da26/0f cheat description:C.3 Full Element Set code:83da3f/0f cheat description:C.4 Full Element Set code:83da58/0f cheat description:Instant win battles code:81a48e/9c cheat description:Instant win Frog Dodgeball, Fly Catching code:879b25/80 cheat description:Defeat one enemy to win battle code:90dab3/9c cheat description:Walk through walls - towns/dungeons code:8196b6/00 cheat description:Walk through walls - world map code:84c1c4/00+84c16d/80+84c0b9/80+84c110/00 cartridge sha256:4070a7702dc506a1ceb6f65b5c330b3a162df6f01735c8f206934fd47b810ed4 name:Troddlers (USA) cheat description:Infinite time code:008a5a/ad cartridge sha256:5c7b28bb24bad697156ad444ff23bd15ad6744dbf9899b3cccf2aa36d559d825 name:True Golf Classics - Pebble Beach Golf Links (USA) cheat description:All holes are par 4 code:03887e/af cheat description:Course is generally harder (par goes down randomly for some holes) code:03887f/b8+03d1b8/03 cartridge sha256:72088194a65fc057f2910945a33d9f071682a4cecac8996f0bdabcdb5ef39962 name:True Golf Classics - Waialae Country Club (USA) cheat description:Most holes have new par values code:0186cc/6a+03b16a/04 cheat description:All holes are par 5 code:0186cb/af cheat description:All holes are par 4 code:0186cb/af+0186cc/6c cartridge sha256:47dd8ea2d12a6bb2a9774de1d492259fc4fb9f8ec7976383bbfd922532671f6b name:True Lies (USA) cheat description:Infinite health code:7e2d38/17 cheat description:Infinite lives code:7e1a57/05 cheat description:Infinite Aircraft Missiles code:7e1a61/06 cheat description:Infinite Big Gun ammo code:7e00a9/73 cheat description:Infinite Flamethrower fuel code:7e00af/63 cheat description:Infinite Grenades code:7e00ab/09 cheat description:Infinite Mines code:7e00ad/09 cheat description:Infinite Pistol ammo code:7e00a5/0f cheat description:Infinite Shotgun Shells code:7e00a7/63 cheat description:Infinite Uzi ammo code:7e00aa/0a cheat description:Have all weapons code:7e1a55/ff cheat description:No civilian kill limit (warning on first two deaths) code:7e1a2a/00 cartridge sha256:8f62d014f513a7dcbca5aa76cbe476c3e4526100f34913af831bc05dab029bd1 name:Tuff E Nuff (USA) cheat description:Invincibility code:8181cb/80 cheat description:One hit kills code:818537/a9+818539/ff cheat description:Allows you to select same player vs. same player in a 1P vs. 2P game (must select 2nd player using right button) code:81cef3/00 cheat description:Allows you to select any character in a vs. computer game code:81caef/ff cheat description:Syoh and Zazi's High Fist Thrust does more damage code:a7d8f0/18 cheat description:Syoh and Zazi's Sliding Heel Kick does more damage code:a7db24/24 cheat description:Syoh and Zazi's Big Head Thrust Punch does more damage - from close up only code:a7dd10/24 cheat description:Syoh and Zazi's Big Head Thrust Punch does no damage code:a7dd10/00 cheat description:Syoh and Zazi's Flying Side Kick does more damage - from close up only code:a7de4a/24 cheat description:Syoh and Zazi's Ball of Energy does more damage code:a7e145/24 cheat description:Syoh and Zazi's Palm Hit Drop does more damage code:a7ddf7/2a cheat description:Zazi's Blue Thunder Punch and Syoh's Dragon Blade does more damage code:a7e308/24 cheat description:Kotono's Straight Line Slash does more damage code:a8dfd1/1e cheat description:Kotono's Sweeping Knee Kick does more damage code:a8dee9/18 cheat description:Kotono's Flying Swallow Double Drop does more damage code:a8eb51/1e cheat description:Kotono's Flying Side Kick does more damage code:a8df2b/18 cheat description:Kotono's Flying Swallow Point Break does more damage code:a8ebd4/1e cheat description:Kotono's Drawn Sword Mist Slash does more damage code:a8e5fb/1e cheat description:Kotono's Double Edge does more damage code:a8ebe5/18 cheat description:Kotono's Special Kick does more damage code:a8e790/24 cheat description:Vortz's Middle Kick does more damage code:a9e496/2a cheat description:Vortz's Low Kick does more damage code:a9e444/18 cheat description:Vortz's Low Aerial Drop Kick does more damage code:a9e3af/2a cheat description:Vortz's Big Double Sledge Hammer does more damage code:a9e265/24 cheat description:Vortz's Diving Knee Pad does more damage code:a9e30b/1e cheat description:Vortz's Diving Elbow does more damage code:a9e297/2a cheat description:Vortz's Lightning Tackle does more damage code:a9e54e/2a cheat description:Each round is 80 seconds code:808978/80 cheat description:Each round is 60 seconds code:808978/60 cheat description:Each round is 40 seconds code:808978/40 cheat description:Each round is 20 seconds code:808978/20 cheat description:Start with 1/4 health - P1 code:81a5f4/16 cheat description:Start with 1/2 health - P1 code:81a5f4/2c cheat description:Start with 3/4 health - P1 code:81a5f4/42 cheat description:Play stage 2 in story (brings you back to level 1) code:80848a/04 cheat description:Play stage 3 in story (brings you back to level 1) code:80848a/06 cheat description:Play stage 4 in story (brings you back to level 1) code:80848a/08 cheat description:Play stage 5 in story (brings you back to level 1) code:80848a/0a cheat description:Play stage 6 in story (brings you back to level 1) code:80848a/0c cheat description:Play stage 7 in story (brings you back to level 1) code:80848a/0e cheat description:Play stage 8 in story (brings you back to level 1) code:80848a/10 cheat description:Play stage 9 in story (brings you back to level 1) code:80848a/12 cheat description:Play final stage in story (brings you back to level 1) code:80848a/14 cheat description:Infinite health - P1 code:7e0fb7/58 cheat description:Infinite health - P2 code:7e1010/58 cheat description:Infinite time code:7e0b27/99 cheat description:Powered moves - P1 code:7e0fb8/06 cheat description:Powered moves - P2 code:7e1011/06 cartridge sha256:dbf11d4c77b9aa3416f687201d57d71a23bb8fb0b8fe5e9e8212db3fac036631 name:Turbo Toons (Europe) cheat description:Start at Final Tournament (press Select at title screen, then in the topmost menu select the trophy) code:7e1e44/04 cheat description:Infinite Turbo - Hong Kong Phooey code:7e0c9e/e0 cartridge sha256:e4343c0fadc00ffdc3dc31345068d751eea5d639f826731f08cb81673d508c40 name:Turn and Burn - No-Fly Zone (USA) cheat description:Infinite health code:7e10db/38 cheat description:Infinite fuel code:7e1ac4/99+7e1ac5/74 cheat description:Infinite AIM-7 code:7e05e9/ff cheat description:Infinite AIM-9 code:7e05e7/ff cheat description:Infinite AIM-54 code:7e05eb/bf cheat description:Infinite M-61 code:7e05e5/ff cartridge sha256:c8187417a27a2f14ce2be35eebd0f112bd413b57d3589ae6d40b333bc21ba694 name:TwinBee - Rainbow Bell Adventure (Japan) cheat description:Invincibility code:7e1994/0a cheat description:Infinite health code:7e02ec/03 cheat description:Infinite time code:7e02ce/00 cartridge sha256:259c25d4613f97f5fa7992900fb583625d7fb912c7ae09fa9def2e682834dc9f name:Twisted Tales of Spike McFang, The (USA) cheat description:Invincibility code:80c778/af cheat description:Infinite money code:82834e/ad cheat description:Infinite HP code:7e4ce0/ff+7e4ce1/4f cheat description:Infinite money (alt) code:7e0a57/e7+7e0a58/03 cheat description:Start with max hit level code:7e4da0/30 cartridge sha256:0c169bbb4e6dcb3b23e7b3b05e3bddd590f45cecd803a4e5a7118fd606158b23 name:U.F.O. Kamen Yakisoban - Kettler no Kuroi Inbou (Japan) cheat description:Infinite health code:7e0175/28 cheat description:Infinite lives code:7e0176/07 cheat description:Infinite time code:7e0af3/b0 cartridge sha256:0b155a54b6134601fc0791252a63ca73efd522667c3d6fd7a44f5b3c500039d7 name:U.N. Squadron (USA) cheat description:Invincibility code:00e43e/00+04e52c/80 cheat description:Infinite lives code:00d4e0/c5+00d4e2/c5 cheat description:Infinite continues code:00d5a1/c0 cheat description:Infinite shots for all weapons code:04e7bf/dd cheat description:Infinite money code:00b9fc/c5 cheat description:Hit anywhere code:04e74d/6b+00e37b/e2+00e310/e2+00e37c/20+00e311/20 cheat description:Shoot without stopping code:04e56e/a5 cheat description:Max power on first pellet pick-up code:04fb7d/00 cheat description:Start with no money code:00b143/00 cheat description:Start with $9,000 code:00b143/90 cheat description:Start with 1 life and 1 continue code:00b159/01 cheat description:Start with 5 lives and 5 continues code:00b159/05 cheat description:Start with 9 lives and 9 continues code:00b159/09 cheat description:Invincibility (alt) code:7e00f7/01 cheat description:Infinite health code:7e1008/08 cheat description:Infinite shots for all weapons (alt) code:04e7bf/dd cheat description:Infinite money (alt) code:00b9fc/c5 cheat description:Infinite lives (alt) code:00d4e0/c5+00d4e2/c5 cheat description:Infinite continues (alt) code:7e00f3/03 cheat description:Enable all 6 jets selectable for free code:7e00f6/3f cheat description:Loads of money - P1 code:7e00d9/01 cheat description:Infinite Conventional Bombs code:7e00dd/31 cheat description:Infinite Mega Crush Weapons code:7e00dd/02 cheat description:Infinite Thunder Laser code:7e00dd/14 cartridge sha256:094555d5720158ee60c9d5ab9a13110192db5ebf0f6cf69abbb59a00bc470345 name:Ultima - Runes of Virtue II (USA) cheat description:Infinite energy - makes enemies invincible too (Shamino in easy mode) code:80acef/ad cheat description:Stars never recharge (Shamino in easy mode) code:80e99a/a9 cheat description:Almost infinite stars (Shamino in easy mode) code:808b3e/a9 cheat description:Start with a stronger armor (Shamino in easy mode) code:828ca2/a9+828ca3/2c cheat description:Start with less stars (Shamino in easy mode) code:828c54/01 cheat description:Start with Crossbow instead of the Axe (Shamino in easy mode) code:828c4c/33 cheat description:Start with Longbow instead of the Axe (Shamino in easy mode) code:828c4c/34 cheat description:Start with Fireball wand instead of the Axe (Shamino in easy mode) code:828c4c/37 cheat description:Start with Boomerang instead of the Axe (Shamino in easy mode) code:828c4c/38 cheat description:Start with Shuriken instead of the Axe (Shamino in easy mode) code:828c4c/2f cheat description:Start with 30 intelligence (Shamino in easy mode) code:828c4e/30 cheat description:Start with 5 intelligence (Shamino in easy mode) code:828c4e/05 cartridge sha256:11659bd8dd620d50400d16042aeb2d0ddb00c7183fc1ecb95b1a34f07db0431b name:Ultima - The False Prophet (USA) cheat description:Infinite time code:00a0be/b5 cheat description:Infinite Gold code:7e014b/ff+7e014c/ff cheat description:Max Karma code:7e014a/64 cheat description:Infinite Energy (Avatar) code:7e8603/f0 cheat description:Infinite Energy (Shamino) code:7e8607/f0 cheat description:Infinite Energy (Iolo) code:7e8609/f0 cheat description:Infinite Energy (Dupre) code:7e8605/f0 cheat description:Infinite MP (Avatar) code:7e8c02/3c cheat description:Infinite MP (Shamino) code:7e8c06/3c cheat description:Infinite MP (Iolo) code:7e8c08/3c cheat description:Infinite MP (Dupre) code:7e8c04/3c cheat description:Infinite Energy (Jaana) code:7e867d/f0 cheat description:Infinite Energy (Gwenno) code:7e8685/f0 cheat description:Infinite Energy (Seggal) code:7e8741/f0 cheat description:Infinite Energy (Katrina) code:7e86c3/f0 cheat description:Infinite Energy (Sentri) code:7e874d/f0 cheat description:Infinite Energy (Leodon) code:7e86e3/f0 cheat description:Infinite Energy (Gorn) code:7e8757/f0 cheat description:Infinite Energy (Leonna) code:7e86e5/f0 cheat description:Infinite Energy (Blaine) code:7e870f/f0 cheat description:Infinite Energy (Beh Lem) code:7e875d/f0 cheat description:Infinite Energy (Julia) code:7e8687/f0 cheat description:Infinite MP (Gwenno) code:7e8c84/3c cheat description:Infinite MP (Jaana) code:7e8c7c/3c cheat description:Infinite MP (Julia) code:7e8c86/3c cheat description:Infinite MP (Katrina) code:7e8cc2/3c cheat description:Infinite MP (Seggal) code:7e8d40/3c cheat description:Infinite MP (Sentri) code:7e8d4c/3c cheat description:Infinite MP (Gorn) code:7e8d56/3c cheat description:Infinite MP (Leodon) code:7e8ce2/3c cheat description:Infinite MP (Leonna) code:7e8ce4/3c cheat description:Infinite MP (Blaine) code:7e8d0e/3c cheat description:Infinite MP (Beh Lem) code:7e8d5c/3c cheat description:Max Experience (Gwenno) code:7e8884/0f+7e8885/27 cheat description:Max Experience (Seggal) code:7e8940/0f+7e8941/27 cheat description:Max Experience (Sentri) code:7e894c/0f+7e894d/27 cheat description:Max Experience (Julia) code:7e8886/0f+7e8887/27 cheat description:Max Experience (Katrina) code:7e88c2/0f+7e88c3/27 cheat description:Max Experience (Jaana) code:7e887c/0f+7e887d/27 cheat description:Max Experience (Blaine) code:7e890e/0f+7e890f/27 cheat description:Max Experience (Beh Lem) code:7e895c/0f+7e895d/27 cheat description:Max Experience (Gorn) code:7e8956/0f+7e8957/27 cheat description:Max Experience (Leonna) code:7e88e4/0f+7e88e5/27 cheat description:Max Experience (Leodon) code:7e88e2/0f+7e88e3/27 cheat description:Max Experience (Avatar) code:7e8802/0f+7e8803/27 cheat description:Max Experience (Dupre) code:7e8804/0f+7e8805/27 cheat description:Max Experience (Shamino) code:7e8806/0f+7e8807/27 cheat description:Max Experience (Iolo) code:7e8808/0f+7e8809/27 cartridge sha256:a31af0e39afb55bbc92a5543b504327fbe7e8cd0a5e08626976bed7b65376737 name:Ultima - The Black Gate (USA) cheat description:Infinite health code:7e1cfa/e4 cheat description:Infinite Keys code:7e1cfc/63 cheat description:65,000 Exp code:7e1d00/e8+7e1d01/fd cheat description:65,000 Gold code:7e1ce6/e8+7e1ce7/fd cartridge sha256:78bf82963cded9162e25035053c8b1a9f760748ff0beacc230d005204992737d name:Ultimate Fighter (USA) cheat description:Invincibility (except projectiles) - P1 code:86b72b/00 cheat description:Invincibility (except projectiles) - P2 code:86b53e/00 cheat description:Infinite health code:7e1402/c8 cheat description:Hit anywhere (except projectiles) - P1 code:86b53d/80 cheat description:Hit anywhere (except projectiles) - P2 code:86b72a/80 cheat description:Infinite lives - story mode code:7e09c9/63 cheat description:Start with 60,000 score code:7e09b9/60+7e09ba/ea cartridge sha256:cb2fdfce61858063bf4c9da4228381c3ec3abe423f4d378cddd174ae4adb261e name:Ultimate Mortal Kombat 3 (USA) cheat description:Invincibility (throws damage CPU) code:84e6ad/e0+84e7e2/80+84e6b0/30+84e6ae/01+84e6b1/f6 cheat description:Infinite health - P1 code:7e36d4/a6 cheat description:Infinite health - P2 code:7e3898/a6 cheat description:Infinite run - P1 code:7e36d8/30 cheat description:Infinite run - P2 code:7e389c/30 cheat description:Max fatality time code:7e3be0/01 cheat description:Hit anywhere - P1 code:84ff92/00+84ff94/03+84ff93/f0+84e6aa/ff+84ff95/4c+84ff98/4c+84ff9a/e6+84ff97/e7+84ff90/e0+84ff96/28+84ff99/b2+84e6a9/90+84ff91/02 cheat description:Blank versus screen code:83e635/ff cheat description:Scrambled backgrounds code:849566/ad cheat description:Black background (wait for title screen to appear before proceeding) code:849584/ad cheat description:First round / one button fatalities code:7e3be3/01 cartridge sha256:e9fae4c2e171a1fc4f2bd800abd9e42750aaf7a4db9e40c5b9142e15029500bd name:Ultraman (USA) cheat description:Infinite health code:0096cc/2c cheat description:Infinite health - P1 code:7e07ee/53 cheat description:No health - P2 code:7e084e/00 cheat description:Infinite chances code:00de27/24 cheat description:Infinite time (seconds) code:7e00a3/63 cheat description:Infinite time (minutes) code:7e00a4/09 cheat description:Quicker health replenishment code:00b015/00 cheat description:Less health replenishment for enemies code:00b040/ea cheat description:Weaker punch code:03ccae/01 cheat description:Weaker kick code:03ccb0/01 cheat description:9 minutes per stage code:009022/09 cheat description:6 minutes per stage code:009022/06 cheat description:2 minutes per stage code:009022/02 cheat description:Start with 1 chance code:008daa/00 cheat description:Start with 6 chances code:008daa/05 cheat description:Start with 9 chances code:008daa/09 cheat description:Start on stage 1 - Gudis code:7e00f8/00 cheat description:Start on stage 2 - Bogun code:7e00f8/01 cheat description:Start on stage 3 - Degola code:7e00f8/02 cheat description:Start on stage 4 - Barrangas code:7e00f8/03 cheat description:Start on stage 5 - Gudis II code:7e00f8/04 cheat description:Start on stage 6 - Zebokon code:7e00f8/05 cheat description:Start on stage 7 - Majaba code:7e00f8/06 cheat description:Start on stage 8 - Kodalar code:7e00f8/07 cheat description:Start on final stage - Kilazee code:7e00f8/08 cartridge sha256:794152fc6f55cb15a0b203fa645ac9fa314a293da999d8ec8b3dda080434d175 name:Uncharted Waters (USA) cheat description:Start with 65,000 Gold code:01fc1c/fd cartridge sha256:64bc4707f422661a66618088887e2363a5f896ea683c58984fffd96dd21ab5f0 name:New Horizons (USA) cheat description:Joao starts with 156 Leadership instead of 78 code:c8820f/9c cheat description:Joao starts with 250 Leadership instead of 78 code:c8820f/fa cheat description:Joao starts with 150 Seamanship instead of 75 code:c88210/96 cheat description:Joao starts with 250 Seamanship instead of 75 code:c88210/fa cheat description:Joao starts with 146 Knowledge instead of 73 code:c88211/92 cheat description:Joao starts with 250 Knowledge instead of 73 code:c88211/fa cheat description:Joao starts with 170 Intuition instead of 85 code:c88212/aa cheat description:Joao starts with 250 Intuition instead of 85 code:c88212/fa cheat description:Joao starts with 164 Courage instead of 82 code:c88213/a4 cheat description:Joao starts with 250 Courage instead of 82 code:c88213/fa cheat description:Joao starts with 164 Dueling Skill instead of 82 code:c88214/a4 cheat description:Joao starts with 250 Dueling Skill instead of 82 code:c88214/fa cheat description:Joao starts with 178 Likability (Charm) instead of 89 code:c88215/b2 cheat description:Joao starts with 250 Likability (Charm) instead of 89 code:c88215/fa cheat description:Catalina starts with 24 Sail Level instead of 8 code:c88249/18 cheat description:Catalina starts with 80 Sail Level instead of 8 code:c88249/50 cheat description:Catalina starts with 30 Battle Level instead of 10 code:c8824a/1e cheat description:Catalina starts with 100 Battle Level instead of 10 code:c8824a/64 cheat description:Catalina starts with 160 Leadership instead of 80 code:c88241/a0 cheat description:Catalina starts with 250 Leadership instead of 80 code:c88241/fa cheat description:Catalina starts with 158 Seamanship instead of 79 code:c88242/9e cheat description:Catalina starts with 250 Seamanship instead of 79 code:c88242/fa cheat description:Catalina starts with 130 Knowledge instead of 65 code:c88243/82 cheat description:Catalina starts with 250 Knowledge instead of 65 code:c88243/fa cheat description:Catalina starts with 104 Intuition instead of 52 code:c88244/68 cheat description:Catalina starts with 250 Intuition instead of 52 code:c88244/fa cheat description:Catalina starts with 172 Courage instead of 86 code:c88245/ac cheat description:Catalina starts with 250 Courage instead of 86 code:c88245/fa cheat description:Catalina starts with 184 Dueling Skill instead of 92 code:c88246/b8 cheat description:Catalina starts with 250 Dueling Skill instead of 92 code:c88246/fa cheat description:Catalina starts with 190 Likability instead of 95 code:c88247/be cheat description:Catalina starts with 250 Likability instead of 95 code:c88247/fa cheat description:Ali Vezas starts with 160 Leadership (instead of 80) code:c88309/a0 cheat description:Ali Vezas starts with 250 Leadership (instead of 80) code:c88309/fa cheat description:Ali Vezas starts with 172 Seamanship (instead of 86) code:c8830a/ac cheat description:Ali Vezas starts with 250 Seamanship (instead of 86) code:c8830a/fa cheat description:Ali Vezas starts with 168 Knowledge (instead of 84) code:c8830b/a8 cheat description:Ali Vezas starts with 250 Knowledge (instead of 84) code:c8830b/fa cheat description:Ali Vezas starts with 130 Intuition (instead of 65) code:c8830c/82 cheat description:Ali Vezas starts with 250 Intuition (instead of 65) code:c8830c/fa cheat description:Ali Vezas starts with 106 Courage (instead of 53) code:c8830d/6a cheat description:Ali Vezas starts with 250 Courage (instead of 53) code:c8830d/fa cheat description:Ali Vezas starts with 84 Dueling Skill (instead of 42) code:c8830e/54 cheat description:Ali Vezas starts with 250 Dueling Skill (instead of 42) code:c8830e/fa cheat description:Ali Vezas starts with 160 Likability (instead of 80) code:c8830f/a0 cheat description:Ali Vezas starts with 250 Likability (instead of 80) code:c8830f/fa cheat description:Start a new game with $250 Gold code:c881eb/fa cheat description:Start a new game with $1,024 Gold code:c881ec/04 cheat description:Start a new game with $9,984 Gold code:c881ec/27 cheat description:Start a new game with $64,000 Gold code:c881ec/fa cheat description:Start a new game with $196,608 Gold code:c881ed/03 cheat description:Start a new game with over one Million Gold code:c881ed/10 cheat description:No Storms code:7e201b/80 cheat description:1 D.a.s., No Scurvy code:7e415e/00 cheat description:Joao's Steering Power code:7e2620/ff cheat description:Joao's Battle Power code:7e2621/ff cheat description:Ali's Steering Power code:7e271a/ff cheat description:Ali's Battle Power code:7e271b/ff cheat description:Pietro's Steering Power code:7e26e8/ff cheat description:Pietro's Battle Power code:7e26e9/ff cheat description:Max Adventure For Joao code:7e25a4/50+7e25a5/c3 cheat description:100% Popular In Portugal code:7e25a6/c8 cheat description:100% Popular In Spain code:7e25a7/c8 cheat description:100% Popular In Turkey code:7e25a8/c8 cheat description:100% Popular In England code:7e25a9/c8 cheat description:100% Popular In Italy code:7e25aa/c8 cheat description:100% Popular In Holland code:7e25ab/c8 cheat description:S.1 Infinite Water code:7e661a/7f cheat description:S.2 Infinite Water code:7e6638/7f cheat description:S.3 Infinite Water code:7e6656/7f cheat description:S.4 Infinite Water code:7e6674/7f cheat description:S.5 Infinite Water code:7e6692/7f cheat description:S.6 Infinite Water code:7e66b0/7f cheat description:S.7 Infinite Water code:7e66ce/7f cheat description:S.8 Infinite Water code:7e66ec/7f cheat description:S.9 Infinite Water code:7e670a/7f cheat description:S.10 Infinite Water code:7e6728/7f cheat description:S.11 Infinite Water code:7e6746/7f cheat description:S.12 Infinite Water code:7e6764/7f cheat description:S.13 Infinite Water code:7e6782/7f cheat description:S.14 Infinite Water code:7e67a0/7f cheat description:S.15 Infinite Water code:7e67be/7f cheat description:S.16 Infinite Water code:7e67dc/7f cheat description:S.17 Infinite Water code:7e67fa/7f cheat description:S.1 Infinite Food code:7e661c/7f cheat description:S.2 Infinite Food code:7e663a/7f cheat description:S.3 Infinite Food code:7e6658/7f cheat description:S.4 Infinite Food code:7e6676/7f cheat description:S.5 Infinite Food code:7e6694/7f cheat description:S.6 Infinite Food code:7e66b2/7f cheat description:S.7 Infinite Food code:7e66d0/7f cheat description:S.8 Infinite Food code:7e66ee/7f cheat description:S.9 Infinite Food code:7e670c/7f cheat description:S.10 Infinite Food code:7e672a/7f cheat description:S.11 Infinite Food code:7e6748/7f cheat description:S.12 Infinite Food code:7e6766/7f cheat description:S.13 Infinite Food code:7e6784/7f cheat description:S.14 Infinite Food code:7e67a2/7f cheat description:S.15 Infinite Food code:7e67c0/7f cheat description:S.16 Infinite Food code:7e67d7/7f cheat description:S.17 Infinite Food code:7e67fc/7f cheat description:S.1 Infinite Crew (Ship HP) code:7e41e7/22 cheat description:S.2 Infinite Crew (Ship HP) code:7e41f0/22 cheat description:S.3 Infinite Crew (Ship HP) code:7e41f9/22 cheat description:S.4 Infinite Crew (Ship HP) code:7e4202/22 cheat description:S.5 Infinite Crew (Ship HP) code:7e420b/22 cheat description:S.6 Infinite Crew (Ship HP) code:7e4214/22 cheat description:S.7 Infinite Crew (Ship HP) code:7e421d/22 cheat description:S.8 Infinite Crew (Ship HP) code:7e4226/22 cheat description:S.9 Infinite Crew (Ship HP) code:7e422f/22 cheat description:S.10 Infinite Crew (Ship HP) code:7e4238/22 cheat description:S.11 Infinite Crew (Ship HP) code:7e4241/22 cheat description:S.12 Infinite Crew (Ship HP) code:7e424a/22 cheat description:S.13 Infinite Crew (Ship HP) code:7e4253/22 cheat description:S.14 Infinite Crew (Ship HP) code:7e425c/22 cheat description:S.15 Infinite Crew (Ship HP) code:7e4265/22 cheat description:S.16 Infinite Crew (Ship HP) code:7e426e/22 cheat description:S.17 Infinite Crew (Ship HP) code:7e4277/22 cheat description:S.1 Speedy code:7e41eb/ff cheat description:S.2 Speedy code:7e41f4/ff cheat description:S.3 Speedy code:7e41fd/ff cheat description:S.4 Speedy code:7e4206/ff cheat description:S.5 Speedy code:7e420f/ff cheat description:S.6 Speedy code:7e4218/ff cheat description:S.7 Speedy code:7e4221/ff cheat description:S.8 Speedy code:7e422a/ff cheat description:S.9 Speedy code:7e4233/ff cheat description:S.10 Speedy code:7e423c/ff cheat description:S.11 Speedy code:7e4245/ff cheat description:S.12 Speedy code:7e424e/ff cheat description:S.13 Speedy code:7e4257/ff cheat description:S.14 Speedy code:7e4260/ff cheat description:S.15 Speedy code:7e4269/ff cartridge sha256:cb8073cf95eace56ba4324a2106164fa540900c2de083aff490c4afe91ae95f7 name:Undercover Cops (Japan) cheat description:Infinite health code:c08d8c/ad cheat description:Infinite lives code:c0fcef/ad cheat description:Infinite time code:c10a26/ad cheat description:Infinite continues code:c14beb/ad cheat description:Hit anywhere code:c0d4fd/80+c0d4fe/3e cheat description:one hit kils code:c0d54a/00 cheat description:Infinite health (alt) code:7e0c36/e8+7e0d36/e8 cheat description:Infinite lives (alt) code:7e0110/0a cheat description:Infinite time (alt) code:7e016c/64 cheat description:Infinite continues (alt) code:7e0112/09 cartridge sha256:859ec99fdc25dd9b239d9085bf656e4f49c93a32faa5bb248da83efd68ebd478 name:Uniracers (USA) cheat description:No timer in almost every race code:81c726/ea cheat description:No timer in almost every race (alt) code:81c726/ea cartridge sha256:cf587d72123277f72f658829f1efdb4f52f3bec012a316c1fea25e1f9c292575 name:Universal Soldier (USA) (Proto) cheat description:Infinite health code:00f5e6/ad cheat description:Infinite lines code:018505/ad cartridge sha256:ecefb4117a6aae117e033c8cc07f0db2797d6be93dd5cdcefc23692a21fae02e name:Untouchables, The (USA) cheat description:Infinite lives code:7e1b86/09 cheat description:Infinite ammo code:7e1b89/63 cartridge sha256:8b3ff3a0ca1c85facb71f42886291dfa916ca74245702c79ca8ae635f28bc864 name:Ushio to Tora (Japan) cheat description:Invincibility code:7e0222/26 cheat description:Infinite health code:7e021e/40 cheat description:Infinite lives code:7e0608/63 cartridge sha256:2500d6c846c78bcb729f15535bf2b852a120411891cabaaaa6fc407906d0214e name:Utopia - The Creation of a Nation (USA) cheat description:1-day buildings code:009691/00 cheat description:Have 655360000 cash (enable while on map then disable) code:00a5e9/a9+00a5ec/85+00a5ed/71 cartridge sha256:78bf9d79fb2ff3f9d03ecc1176d070e53ddaca2c6b0cda69e74c19a4e50b195b name:Vegas Stakes (USA) cheat description:Only $34,464 needed for highroller status (glitchy) code:00c34b/00 cheat description:Only $38,527 needed to win the game instead of $10 million code:00c2b9/00 cheat description:Only $5,019,263 needed to win the game code:00c2b9/4c cheat description:Player wins pushes in Blackjack code:0eb93b/00 cheat description:Dealer wins pushes in Blackjack code:0eb93b/01 cheat description:Start with $488 - P1 code:00bf68/01 cheat description:Start with $488 - P2 code:00bf95/01 cheat description:Start with $488 - P3 code:00bfc2/01 cheat description:Start with $488 - P4 code:00bfef/01 cheat description:Start with $2280 - P1 code:00bf68/08 cheat description:Start with $2280 - P2 code:00bf95/08 cheat description:Start with $2280 - P3 code:00bfc2/08 cheat description:Start with $2280 - P4 code:00bfef/08 cheat description:Start with $9960 - P1 code:00bf68/26 cheat description:Start with $9960 - P2 code:00bf95/26 cheat description:Start with $9960 - P3 code:00bfc2/26 cheat description:Start with $9960 - P4 code:00bfef/26 cheat description:Start with $132,072 (highroller status) - P1 code:00bf6d/02 cheat description:Start with $132,072 - P2 code:00bf9a/02 cheat description:Start with $132,072 - P3 code:00bfc7/02 cheat description:Start with $132,072 - P4 code:00bff4/02 cartridge sha256:b72fbbfe737eff49f59dcef9f13b963e50c5bc322d7eb0e7b4c25f3a71aa0815 name:Venom-Spider-Man - Separation Anxiety (USA) cheat description:Infinite health - P1 code:82e174/b5 cheat description:Infinite lives - P1 code:81a554/79 cheat description:Infinite health - P2 code:7e0a5a/99 cheat description:Infinite lives - P2 code:7e1a8b/06 cheat description:Infinite Captain America hero icons code:7e1bc5/05 cheat description:Infinite Ghost Rider hero icons code:7e1bc7/05 cheat description:Infinite Daredevil hero icons code:7e1bc9/05 cheat description:Infinite Hawkeye hero icons code:7e1bcb/05 cheat description:Infinite Vault Guardsman hero icon code:7e1bcd/05 cheat description:Use helpers multiple times code:7e1bc4/00 cheat description:Hard mode enabled code:7e1c3c/ff cheat description:Stage select enabled code:7e1c40/ff cheat description:Hit anywhere code:82ab25/24 cheat description:One hit kills for most enemies and some bosses code:7e0ad3/00+7e0b4c/00+7e0bc5/00+7e0c3e/00+7e0cb7/00 cartridge sha256:29c28188234ddbb0b72fc84253dcd3514e23034779c773db8097b073b73390c8 name:Virtual Bart (USA) cheat description:Infinite time code:80e75f/ad cheat description:Infinite health and Tomatoes (Baby Bart takes damage when he walks on grass) code:80e8fb/47 cheat description:Infinite continues code:80e8bb/ad cheat description:Infinite lives code:80e8ad/ad cartridge sha256:41b5561de9e4984276e52987ea46c5f4fa8526d8141c70c738875a9eb9fe9d70 name:Vortex (USA) (En,Es) cheat description:Infinite health code:7e039a/3d+7e118b/32 cheat description:Infinite lives code:7e120e/0a cheat description:Infinite Missiles code:7e1de4/63 cheat description:Infinite Rockets code:7e1de5/63 cheat description:Infinite Cannon code:7e1de6/63 cheat description:Infinite Blasts code:7e121a/63 cartridge sha256:8579dd352d20589072ed5c026bde7adadd6229d18a022e7cb47cf5602b54015e name:Warlock (USA) cheat description:Invincibility code:009ff8/a9+00a8a2/ee cheat description:Infinite items on pick-up code:02887a/ea cheat description:Enter the password GRKKL to go to the final battle code:04c4a3/31 cheat description:Enter the password GRKKL to go to the ending code:04c4a3/32 cartridge sha256:0fadb3b67bfb7d750d873e7601dd5ffdfd33b8ebda833a18a3c999c7f8aa9e15 name:Waterworld (Europe) cheat description:Invincibility underwater code:81a69f/00 cheat description:Infinite health underwater code:81933b/ad cheat description:Infinite health - Overworld code:7e0288/7f cheat description:Hit anywhere code:80c17d/80+80c17e/2a+80c1ac/60 cheat description:Get items from anywhere code:81e283/80+81e284/18 cartridge sha256:56ba3d585bf6b701e342d86a0bd164ab0a97dfbd5df46b3a964506842633459c name:Wayne's World (USA) cheat description:Infinite Worthiness code:069caf/ad cheat description:Infinite lives code:00b91d/ad cheat description:Worthiness item worth nothing on pick-up code:06997a/ad cheat description:Schwing item worth nothing on pick-up code:06994a/ad cheat description:Infinite Schwings if you have at least 1 code:068552/ad cheat description:Invincibility lasts longer after getting hit code:069ce5/ff cheat description:Invincibility does not last as long after getting hit code:069ce5/10 cheat description:Invincibility lasts forever after getting hit (Wayne blinks) code:069d94/bd cheat description:Invincibility (Wayne doesn't blink) code:069c9b/80 cheat description:Amp power-up worth nothing on pick-up code:06989a/00 cheat description:Amp power-up gives you Distortion-type chords code:06989a/04 cheat description:Amp power-up gives you Mega-Amp-type chords code:06989a/02 cheat description:Amp power-up gives you Chorus-type chords code:06989a/03 cheat description:Amp power-up gives you Homer-type chords code:06989a/05 cheat description:Distortion power-up worth nothing on pick-up code:069900/00 cheat description:Distortion power-up gives you Amp-type chords code:069900/01 cheat description:Distortion power-up gives you Mega-Amp-type chords code:069900/02 cheat description:Distortion power-up gives you Chorus-type-chords code:069900/03 cheat description:Distortion power-up gives you Homer-type-chords code:069900/05 cheat description:Heart item worth nothing code:06999d/ad cheat description:Start with 1 life code:00cbce/01 cheat description:Start with 3 lives code:00cbce/03 cheat description:Start with 7 lives code:00cbce/07 cheat description:Start with 9 lives code:00cbce/09 cheat description:Start with 1 Worthiness point code:00b93e/01 cheat description:Start with 3 Worthiness points code:00b93e/03 cheat description:Start with 7 Worthiness points code:00b93e/07 cheat description:Start with 9 Worthiness points code:00b93e/09 cartridge sha256:0b1ba31ae95b61d7d9a0f5509b5836fff84f60915802e3b3ba1170a5c50a4b71 name:WeaponLord (USA) cheat description:Infinite health - P1 code:ea64c7/7a cheat description:Infinite health - both players code:ea64c6/ad cheat description:Infinite time code:e94d22/ad cheat description:Hit anywhere - both players code:e973c6/80+e97409/80+e973c2/00+e97403/00 cheat description:Play as Zarak in story mode code:eae5a1/06 cartridge sha256:e931c3c08f20f78e3a43ad92d16eb472be619abaa17c2d8e2b0fcd5d05dbd74d name:We're Back! - A Dinosaur's Story (USA) cheat description:Infinite health code:9a96dc/ad cheat description:Infinite lives code:9a847a/ad cheat description:Infinite Vorb on pick-up for the rest of the stage code:9aae88/ad cheat description:Infinite Elsa on pick-up for the rest of the stage code:9aa761/ad cheat description:Infinite Dweebs on pick-up for the rest of the stage code:9aac73/ad cheat description:Infinite Woog on pick-up code:9aa964/ad cheat description:Super-jump code:9a9a68/1f cheat description:Mega-jump code:9a9a68/2f cheat description:Less grain to get for tail swipe code:9a8909/03 cheat description:Less grain to get for stomp code:9a8903/09 cheat description:Start with less health code:99b299/02+9a8886/02 cheat description:Start with 9 lives code:99b293/09 cheat description:Start with 6 lives code:99b293/06 cheat description:Start with 1 life code:99b293/01 cheat description:Start on Manhattan - Zone 2 code:99b17f/a9+99b180/02+99b181/00 cheat description:Start on the Subway code:99b17f/a9+99b180/03+99b181/00 cheat description:Start on Crazy Crane code:99b17f/a9+99b180/04+99b181/00 cheat description:Start on Construction in the City code:99b17f/a9+99b180/06+99b181/00 cheat description:Start on Thanksgiving - Zone 1 code:99b17f/a9+99b180/07+99b181/00 cheat description:Start on Thanksgiving - Zone 2 code:99b17f/a9+99b180/08+99b181/00 cheat description:Start on Balloon Blow-out code:99b17f/a9+99b180/09+99b181/00 cheat description:Start on Central Park - Zone 1 code:99b17f/a9+99b180/0b+99b181/00 cheat description:Start on Central Park - Zone 2 code:99b17f/a9+99b180/0c+99b181/00 cheat description:Start on the Zoo code:99b17f/a9+99b180/0d+99b181/00 cheat description:Start on Prehistoric Panic code:99b17f/a9+99b180/0e+99b181/00 cheat description:Start on Outside the Circus code:99b17f/a9+99b180/10+99b181/00 cheat description:Start on Circus - Zone 1 code:99b17f/a9+99b180/11+99b181/00 cheat description:Start on Circus - Zone 2 code:99b17f/a9+99b180/12+99b181/00 cheat description:Start on Jack in the Box code:99b17f/a9+99b180/13+99b181/00 cheat description:Start on Empire State Building code:99b17f/a9+99b180/15+99b181/00 cheat description:Start on Spaceship - Zone 1 code:99b17f/a9+99b180/16+99b181/00 cheat description:Start on Spaceship - Zone 2 code:99b17f/a9+99b180/17+99b181/00 cheat description:Infinite health (alt) code:9a96dc/ad cheat description:Infinite lives (alt) code:9a847a/ad cheat description:Super-jump (alt) code:9a9a68/1f cheat description:Mega-jump (alt) code:9a9a68/2f cartridge sha256:12abf1ba063c120c1a98495a1c85e67a0007aff771ef92adcb94b4a0a2fd5adb name:Wheel of Fortune (USA) cheat description:Infinite time to choose code:008425/ad cheat description:Don't lose money when landing on bankrupt code:0094f4/ad cheat description:3/4 of normal time to choose code:009866/1e cheat description:1/2 of normal time to choose code:009866/14 cheat description:1/4 of normal time to choose code:009866/0a cheat description:Vowels are free is you have at least $250 code:008cd5/00 cheat description:Vowels cost $50 if you have at least $250 code:008cd5/32 cheat description:Vowels cost $100 if you have at least $250 code:008cd5/64 cheat description:Vowels cost $150 if you have at least $250 code:008cd5/96 cheat description:Vowels cost $200 if you have at least $250 code:008cd5/c8 cartridge sha256:0a52dc1e7820f5541f53ce0e1e96144fe079af0efe3dae5c2c89d86365feb8b1 name:Whizz (USA) cheat description:Infinite health code:80a1a4/a5 cheat description:Infinite time code:80874f/ad cheat description:Infinite lives code:80ab7c/ad cheat description:Infinite time (alt) code:7e03a4/63 cartridge sha256:c8f159e2625ac8078535c06857ea28475706da45df494de8e46f50888272cf71 name:Wild Guns (USA) cheat description:Invincibility code:038067/24 cheat description:Hit anywhere code:009520/24+00952d/24+009537/24+039301/24+009516/24+0094f0/80 cheat description:Infinite specials code:7e1fa0/05 cheat description:Infinite lives code:7e1fb2/04 cartridge sha256:2167fc7c5447b2287668d2f3e4ef1a285361b2292ecc8a4cbd9f966a460ad7a2 name:Wing Commander (USA) cheat description:Increase front shield on Hornet code:8b9bad/3c cheat description:Increase rear shield on Hornet code:8b9c21/3c cheat description:Increase front armor on Hornet code:8b9c95/40 cheat description:Increase rear armor on Hornet code:8b9d09/40 cheat description:Increase left side armor on Hornet code:8b9df1/40 cheat description:Increase right side armor on Hornet code:8b9d7d/40 cheat description:Increase front shield on Scimitar code:8b9bb1/63 cheat description:Increase rear shield on Scimitar code:8b9c25/63 cheat description:Increase front armor on Scimitar code:8b9c99/63 cheat description:Increase rear armor on Scimitar code:8b9d0d/63 cheat description:Increase left side armor on Scimitar code:8b9df5/63 cheat description:Increase right side armor on Scimitar code:8b9d81/63 cheat description:Mega front shields on Hornet code:8b9bae/ff cheat description:Mega rear shields on Hornet code:8b9c22/ff cheat description:Mega front shields on Scimitar code:8b9bb2/55 cheat description:Mega rear shields on Scimitar code:8b9c26/55 cartridge sha256:132ca0b6a4888edf7de785d48f4417fac28522646e6c7514f80c5e9ff1438d5f name:Wing Commander - The Secret Missions (USA) cheat description:Infinite blaster power code:80c081/ad cheat description:Infinite fuel code:80a1bb/ad cheat description:Infinite missiles code:818a8f/ea cheat description:Start on mission 4 code:8386b9/04 cheat description:Start on mission 8 code:8386b9/08 cartridge sha256:c3bcd5c716f96e6359ebcfd85c3e9b07b46c5124bf4010d89ceef5b6f2f868f6 name:Wings 2 - Aces High (USA) cheat description:Infinite lives - all pilots (you can still get fired) code:02b5c9/bd cheat description:Infinite power-ups code:02ac80/ad cartridge sha256:025dd3047c474d879e69b91a3918add9cdabedf4182e1c1e10e5f0c13a124bf9 name:Wizard of Oz, The (USA) cheat description:Invincibility code:01bd0f/d0 cheat description:Infinite health code:02e3a2/bd cheat description:Infinite lives code:00e4f3/dd cheat description:Infinite health - Dorthy code:7e01e5/00 cheat description:Infinite health - Scarecrow code:7e01e7/00 cheat description:Infinite health - Tinman code:7e01e9/00 cheat description:Infinite health - Lion code:7e01eb/00 cheat description:Infinite Star Shot - Dorthy code:7e01db/09 cheat description:Infinite Throwing Rocks - all code:7e01d1/09 cheat description:Have Flight Shoes code:7e01d3/01 cartridge sha256:621180a73a5552899ff2a437e84f2891ec078e9883f25f6671b620ab4db24270 name:Wizardry VI - Kindan no Mahitsu (Japan) cheat description:The whole party doesn't take damage from normal enemy attacks (doesn't protect from poison or certain magic spells) code:05bbb9/bd cheat description:Create a character and he has a lot of gold code:049c13/20 cartridge sha256:e0165bafeb8d65be08a5a4079f8651104471f450c60794b761b1255853ca2d98 name:Wolfchild (USA) cheat description:Infinite health code:00c4e7/ea cheat description:Infinite health (alt) code:7e0636/14 cheat description:Infinite continues code:00f2a7/ad cheat description:Infinite lives code:00c38b/a5 cheat description:Infinite lives (alt) code:7e029a/99 cheat description:Infinite Bombs code:00c4e1/a5 cheat description:Infinite Bombs (alt) code:7e0298/99 cheat description:Infinite Projectiles code:7e0296/99 cheat description:Stay in wolf form until next continue code:00c3f8/ad+00c3fb/ad cheat description:Start with 254 lives and 255 Bombs code:00888f/fe cheat description:Start at final boss code:008887/0b cartridge sha256:9c2b458e8fda5cb437a4c6d28fb430e45c4cfef98420c40546b8e08563a4fc7d name:Wolfenstein 3-D (USA) cheat description:Infinite health code:c0a9a2/ad cheat description:Infinite ammo code:c0b401/ad cheat description:Infinite lives code:c0dbbc/ad cheat description:Infinite ammo for special weapon 1 after first life code:c0b45c/ad cheat description:Infinite ammo for special weapon 2 after first life code:c0b618/ad cheat description:Start with 1 life code:c0da78/01 cheat description:Start with 6 lives code:c0da78/06 cheat description:Start with 9 lives code:c0da78/09 cheat description:Start with more ammo code:c0da5d/63+c0d8b8/63 cheat description:Start with chain gun code:c0d8ae/8d cheat description:Start with machine gun code:c0d8ab/8d cheat description:Start with special weapon 1 (super machine gun) and ammo after first life code:c0d8c0/8d+c0d8a3/04 cheat description:Start with special weapon 2 (rocket launcher) and ammo after first life code:c0d8bd/8d+c0d4a3/05 cartridge sha256:44428a3d1c796fbd41da7620e321c45f11cd80a0e5f4ab8c48177106cb960d77 name:Wolverine - Adamantium Rage (USA) cheat description:Infinite health code:80f707/a5 cheat description:Infinite time code:b1cfb3/d0 cheat description:No enemies code:b8f751/85 cheat description:Hit anywhere + one hit kills code:808349/24+808342/24+80836c/24+808360/24+808322/24+80832e/24+80837f/24+808359/24+808352/24 cheat description:One hit kills code:80837f/24 cheat description:Invincibility code:7e00b8/ff cheat description:Infinite health (alt) code:7e1027/64 cartridge sha256:ea76cfdbb2a555a7b6eff8b466a879f9a9189639416e8c2fb45bf074e695105f name:World Heroes (USA) cheat description:Infinite health - P1 code:c046b7/24 cheat description:Hit anywhere - P1 code:c010fe/30+c010fa/c0+c010fb/00+c010fc/10 cheat description:Always win - P1 code:c0ba8b/39 cheat description:Win a draw - P1 code:c04a55/02 cheat description:Win a draw - P2 code:c04a55/07 cheat description:Slow timer down by half code:c0463b/a0 cheat description:3 hits to win round - either player code:c048a2/19+c0489f/00 cheat description:2 hits to win round - either player code:c048a2/31+c0489f/00 cheat description:1 hit to win (sudden death) - either player code:c048a2/61+c0489f/00 cheat description:Start with more health - P1 code:c02a5c/7e cheat description:Start with 1/2 health - P1 code:c02a5c/30 cheat description:Start with very little health - P1 code:c02a5c/01 cheat description:Start with more health - P2/CPU code:c02ac6/7e cheat description:Start with half health - P2/CPU code:c02ac6/30 cheat description:Start with very little health - P2/CPU code:c02ac6/01 cartridge sha256:159d5341d13d6801324e8271f7191c0223617c9d30984676319b2df7937c78c0 name:World Heroes 2 (USA) cheat description:Invincibility - P1 code:00b3d6/60+00b9e6/60 cheat description:Invincibility - P2 code:00b1d1/60+00b821/60 cheat description:Hit anywhere - P1 code:00b1cc/80+00b81c/80 cheat description:Hit anywhere - P2 code:00b3d1/80+00b9e1/80 cheat description:Infinite health - P1 code:7e0574/80 cheat description:No health - P2 code:7e0576/00 cheat description:Infinite time code:7e052c/99 cheat description:One win wins the match - P1 code:7e0570/02 cartridge sha256:d4d9f1b41dad7e7a126a9adbe8d86c4b339e120c866156796de1cb0c9a214189 name:World League Soccer (USA) cheat description:Score from anywhere (hold X and kick to the goal line and out of bounds) code:038d65/a5+038d67/0a+038d69/44+038d68/30+038d66/33 cheat description:Each goal worth 2 - P1 code:03cba3/02 cheat description:Each goal worth 3 - P1 code:03cba3/03 cheat description:Each goal worth 4 - P1 code:03cba3/04 cheat description:Each goal worth 5 - P1 code:03cba3/05 cheat description:Each goal worth 6 - P1 code:03cba3/06 cheat description:Each goal worth 7 - P1 code:03cba3/07 cheat description:Each goal worth 8 - P1 code:03cba3/08 cheat description:Each goal worth 9 - P1 code:03cba3/09 cheat description:Each goal worth 2 - P2 code:03cc0c/02 cheat description:Each goal worth 3 - P2 code:03cc0c/03 cheat description:Each goal worth 4 - P2 code:03cc0c/04 cheat description:Each goal worth 5 - P2 code:03cc0c/05 cheat description:Each goal worth 6 - P2 code:03cc0c/06 cheat description:Each goal worth 7 - P2 code:03cc0c/07 cheat description:Each goal worth 8 - P2 code:03cc0c/08 cheat description:Each goal worth 9 - P2 code:03cc0c/09 cartridge sha256:2143bbd87ea1c5cfe5eaf46ae39e3ebb11a2e929d05cbb929904037f4d72acfe name:World Soccer 94 - Road to Glory (USA) cheat description:Score from anywhere (press and hold A, kick to the goal line and out of bounds) code:80f20f/ad+80f210/a5+80f211/0d+80f213/55 cartridge sha256:0af7b0d3022acd24a1fb15865a076519f7f56e7a4b33f12b6d851b3a91e5388c name:WWF Raw (USA) cheat description:Start with half health code:acf108/03 cheat description:Nobody gets hurt code:afeb63/ad cheat description:No out of ring timer code:affae1/ad cheat description:Infinite health - P1 code:7e0a78/a0 cheat description:Two punch knockouts code:7e0f44/01 cheat description:Max grapple meter - P1 code:7e0b44/be+7e0b45/02+7e0b46/00 cartridge sha256:51c53e36ed0b959b0695fc6ef036fa7302d1c995eca35c28261d6f3cb77df0ca name:WWF Royal Rumble (USA) cheat description:Max grapple meter - P1 code:7e06de/ff+7e06df/02+7e06e0/00 cheat description:Two punch knockouts code:7e092c/01 cartridge sha256:0b9abf2fc25a5f07c71f9d8efbb0d0e616c1494060138fbb63f7398e9c26198e name:WWF Super WrestleMania (USA) cheat description:Punches and kicks (except flying drop kick) do no damage code:009c65/00 cheat description:Punches and kicks (except flying drop kick) do more damage code:009c65/03 cheat description:Punches and kicks (except flying drop kick) do a lot more damage code:009c65/06 cheat description:Stomps do no damage code:009d47/00 cheat description:Stomps do more damage code:009d47/03 cheat description:Stomps do a lot more damage code:009d47/06 cheat description:Elbow drops do no damage code:05f8f5/00 cheat description:Elbow drops do more damage code:05f8f5/05 cheat description:Elbow drops do a lot more damage code:05f8f5/08 cheat description:Flying elbow drops do no damage code:05f8f7/00 cheat description:Flying elbow drops do more damage code:05f8f7/07 cheat description:Flying elbow drops do a lot more damage code:05f8f7/0a cheat description:Headbutts do no damage code:009d99/00 cheat description:Headbutts do more damage code:009d99/06 cheat description:Headbutts do a lot more damage code:009d99/09 cheat description:Start with 1/4 health - both players code:00a284/0c cheat description:Start with 1/2 health - both players code:00a284/18 cheat description:Start with 3/4 health - both players code:00a284/24 cartridge sha256:67faa6ed3406a5ab0d7224b811c0960bb36560040ee959bb3304c9293ceaa093 name:WWF WrestleMania - The Arcade Game (USA) cheat description:Infinite time code:e51845/ea cheat description:Do mega damage and don't die code:c302d4/a5 cheat description:Max combo meter code:c31e48/a9+c31e4b/80 cheat description:Start with 1/4 health code:c30041/20+c300d9/20 cheat description:Start with 1/2 health code:7e0000/00+c300d9/4f cheat description:Start with 3/4 health code:c30041/78+c300d9/78 cheat description:Start with 1/4 health - opponent code:c30012/20 cheat description:Start with 1/2 health - opponent code:c30012/4f cheat description:Start with 3/4 health - opponent code:c30012/78 cartridge sha256:71b69490c78d0bbaf47da25217c5dae295190311aa5df75653c3fac0a1b45358 name:Xardion (USA) cheat description:Immune to most collisions code:04d976/2c cheat description:Immune to most bullets code:04e260/2c cheat description:Start characters at level 12 code:08f1de/00 cartridge sha256:dc3792e9fe7ef7aaea4ac675a48ad06129dd3ebdd4b96a513bc8241549cbd579 name:X-Kaliber 2097 (USA) cheat description:Infinite time code:008c4e/ad cheat description:Infinite lives code:0083ae/ea cheat description:Soda Cans give 50% life back code:1080ee/5a cheat description:Infinite health - P1 code:7e0a18/90 cheat description:Infinite lives - P1 code:7e0a3e/09 cheat description:Infinite continues - P1 code:7e0a46/09 cheat description:Infinite time (alt) code:7e0a21/5a cartridge sha256:65fe17fd6b297f52df6ce9812ecb02c3bb1bfda3ebc05a19c4a8decbf9a446ae name:X-Men - Mutant Apocalypse (USA) cheat description:Infinite health code:c00f99/ee cheat description:Infinite health (alt) code:7e008b/41+7e0c35/41 cheat description:Infinite lives - training mode code:c00e66/ad cheat description:Infinite lives - mission mode code:c00936/ad cheat description:Hit anywhere code:c2f1ee/24+c2f218/80 cheat description:Easy specials (press X) code:c12b2d/ee cheat description:Walk through walls code:c02e38/ad+c106df/b5+c02e45/ad cheat description:Invincibility code:7e0c4c/21 cheat description:Infinite lives - Wolverine code:7e0b7e/08 cheat description:Infinite lives - Cyclops code:7e0b7f/08 cheat description:Infinite lives - Beast code:7e0b82/08 cheat description:Infinite lives - Psylocke code:7e0b80/08 cheat description:Infinite lives - Gambit code:7e0b81/08 cheat description:Use 1 button specials from practice mode in mission mode code:7e0b89/01 cheat description:Lava stops flowing code:7e1685/db cartridge sha256:363c60f924257bf6465efc32093c7749a0e69ea7234e47ebd4f070e7b0e7035d name:Yogi Bear (Japan) cheat description:Infinite health code:7e021e/06 cheat description:Infinite lives code:7e021c/09 cheat description:Super-jump code:7e0ab0/00 cheat description:Start on Snow Business Stage 1 code:7e009f/23 cheat description:Start on Snow Business Stage 2 code:7e009f/28 cheat description:Start on Snow Business Stage 3 code:7e009f/2d cheat description:Start on Snow Business Stage 4 code:7e009f/32 cheat description:Start on Cave Capers Stage 1 code:7e009f/37 cheat description:Start on Cave Capers Stage 2 code:7e009f/3c cheat description:Start on Cave Capers Stage 3 code:7e009f/41 cheat description:Start on Cave Capers Stage 4 code:7e009f/46 cheat description:Start on Redwood Rendevous Stage 1 code:7e009f/4b cheat description:Start on Redwood Rendevous Stage 2 code:7e009f/50 cheat description:Start on Redwood Rendevous Stage 3 code:7e009f/55 cheat description:Start on Redwood Rendevous Stage 4 code:7e009f/5a cheat description:Start on Water Palaver Stage 1 code:7e009f/5f cheat description:Start on Water Palaver Stage 2 code:7e009f/64 cheat description:Start on Water Palaver Stage 3 code:7e009f/69 cheat description:Start on Water Palaver Stage 4 code:7e009f/6e cheat description:Start on Construction Site Shenanigans Stage 1 code:7e009f/73 cheat description:Start on Construction Site Shenanigans Stage 2 code:7e009f/78 cheat description:Start on Construction Site Shenanigans Stage 3 code:7e009f/7d cheat description:Start on Construction Site Shenanigans Stage 4 code:7e009f/82 cartridge sha256:163399c955e6d813056826e53fc1a7d21d8958e3d11c6384854cc284412caffb name:Yogi Bear's Cartoon Capers (Europe) cheat description:Infinite health code:7e021e/06 cheat description:Infinite lives code:7e021c/09 cheat description:Start on Snow Business Stage 1 code:7e009f/23 cheat description:Start on Snow Business Stage 2 code:7e009f/28 cheat description:Start on Snow Business Stage 3 code:7e009f/2d cheat description:Start on Snow Business Stage 4 code:7e009f/32 cheat description:Start on Cave Capers Stage 1 code:7e009f/37 cheat description:Start on Cave Capers Stage 2 code:7e009f/3c cheat description:Start on Cave Capers Stage 3 code:7e009f/41 cheat description:Start on Cave Capers Stage 4 code:7e009f/46 cheat description:Start on Redwood Rendevous Stage 1 code:7e009f/4b cheat description:Start on Redwood Rendevous Stage 2 code:7e009f/50 cheat description:Start on Redwood Rendevous Stage 3 code:7e009f/55 cheat description:Start on Redwood Rendevous Stage 4 code:7e009f/5a cheat description:Start on Water Palaver Stage 1 code:7e009f/5f cheat description:Start on Water Palaver Stage 2 code:7e009f/64 cheat description:Start on Water Palaver Stage 3 code:7e009f/69 cheat description:Start on Water Palaver Stage 4 code:7e009f/6e cheat description:Start on Construction Site Shenanigans Stage 1 code:7e009f/73 cheat description:Start on Construction Site Shenanigans Stage 2 code:7e009f/78 cheat description:Start on Construction Site Shenanigans Stage 3 code:7e009f/7d cheat description:Start on Construction Site Shenanigans Stage 4 code:7e009f/82 cartridge sha256:90ad69a489194aca7ef7b7fd1d30e0105da4934a81ac8b0333ea20f9248df92d name:Yoshi's Cookie (USA) cheat description:In action mode, passing a stage advances to the next round code:0ab417/80 cheat description:Immediately complete current Action level whenever effects switch is turned on (keep switch off to play) code:0ab303/02 cheat description:All 99 Action rounds available without the secret code code:0aa18b/62 cheat description:In VS mode, only 1 win is required instead of 3. P2 always wins the set (2P only) code:0abb8d/01 cheat description:In VS mode, the fuses don't count down code:0acc44/ad cheat description:In VS mode, play against tougher opponents without the secret code code:02b37e/08+02b386/00 cheat description:In Puzzle mode, passing a stage advances to the next round code:0aeeaf/00 cheat description:Unlimited moves in puzzle mode (turn effects switch off to use up moves if the level becomes impossible) code:0af6cd/ad cartridge sha256:12fba2aff04c8e39968e828629ebd16caa314bca397a9418d35fdaffe8188e20 name:Yoshi's Safari (USA) cheat description:Almost infinite health code:90d16a/ad+83bce7/ad cheat description:Infinite power code:818191/00+90d58b/00 cheat description:Infinite time code:83fc5c/ad cheat description:Infinite lives code:80d3be/ad cheat description:Don't lose coins when you miss a jump code:83b711/ad cheat description:1 minute for stage 1 instead of 4 code:8fa456/01 cheat description:9 minutes for stage 1 code:8fa456/09 cheat description:1 minute for stage 2 instead of 4 code:8fa458/01 cheat description:9 minutes for stage 2 code:8fa458/09 cheat description:Lose power more quickly code:818192/01+90d58c/01 cheat description:Lose power more slowly code:818191/05+90d58b/05 cheat description:Gain power more quickly code:8181aa/01+90d59e/01 cheat description:Gain power more slowly code:8181a9/20+90d59d/20 cheat description:1-up with every coin after you get 10 code:83fd12/09 cheat description:1-up with every coin after you get 30 code:83fd12/1e cheat description:1-up with every coin after you get 99 code:83fd12/62 cheat description:Start with 1 life code:8d8131/00 cheat description:Start with 5 lives code:8d8131/04 cheat description:Start with 10 lives code:8d8131/09 cartridge sha256:fbe8926fc0149d3e8e2aec20f15640ea6814f4f4b01c3960f3c477f5f17e890f name:Young Merlin (USA) cheat description:Faster Merlin code:859538/05 cheat description:Slower mine cart code:998193/02 cheat description:2 hearts from rainbow water bottle code:80a642/02 cheat description:3 hearts from rainbow water bottle code:80a642/03 cheat description:Start with 6 heart containers (new game) code:91ba88/06 cheat description:Start with 8 heart containers (new game) code:91ba88/08 cheat description:Infinite health code:7eedde/02 cartridge sha256:b0e74f0fe8d1e7fe2fe404341fea7c68e28f3a0ab78552d5092d413f2ecec417 name:Ys III - Wanderers from Ys (USA) cheat description:Invincibility code:7e1afc/08 cheat description:Infinite health code:1794e1/ad cheat description:Infinite Amulet shots code:7e1fe9/03 cheat description:Items are free if you have enough money code:00f49a/80+00f49b/0a cheat description:One hit kills on bosses (except final boss) code:7e17e1/00 cheat description:Gain experience quicker code:179799/a9 cheat description:Gain experience much quicker code:179799/a9+17979a/35 cheat description:Start with 100 hit points instead of 20 code:17bddb/64 cheat description:Start with 200 hit points code:17bddb/c8 cheat description:Start with 488 Gold instead of 1,000 code:17bdf2/01 cheat description:Start with 2,024 Gold code:17bdf2/07 cheat description:Start with 9,704 Gold code:17bdf2/25 cheat description:Start with 20,200 Gold code:17bdf2/4e cheat description:Start with 40,168 Gold code:17bdf2/9c cheat description:Start with 65,512 Gold code:17bdf2/ff cheat description:Invincibility (alt) code:7e1afc/08 cheat description:Infinite Gold code:7e1297/ff+7e1298/ff cheat description:255 Max HP code:7e1295/ff cheat description:Max Exp code:7e1299/ff+7e129a/ff cheat description:255 Ring code:7e1296/ff cheat description:255 STR code:7e129d/ff cheat description:255 DEF code:7e129e/ff cheat description:1 Exp point to gain next level code:7e129b/01 cheat description:Have all equipment code:7e12a9/ff+7e12aa/ff+7e12ab/ff+7e12b3/ff+7e12ac/ff+7e12ad/ff+7e12ae/ff+7e12af/ff+7e12b0/ff+7e12b1/ff+7e12b2/ff+7e12a0/ff+7e12a1/ff+7e12a2/ff+7e12a3/ff+7e12a4/ff+7e12a5/ff+7e12a6/ff+7e12a7/ff+7e12a8/ff cheat description:Have all inventory items code:7e12c2/ff+7e12c3/ff+7e12c4/ff+7e12b9/ff+7e12ba/ff+7e12bb/ff+7e12bc/ff+7e12bd/ff+7e12be/ff+7e12bf/ff+7e12c0/ff+7e12c1/ff cheat description:Have all statues code:7e12c5/ff+7e12c6/ff+7e12c7/ff+7e12c8/ff cartridge sha256:10d94f1acd8108552eaefe9e26069e5d83e8fc3e847df7af318c2e25b53d39c3 name:Ys IV - Mask of the Sun (Japan) cheat description:Infinite HP code:7e0973/ff cheat description:Infinite GP code:7e0983/ff+7e0984/ff cheat description:Max EXP code:7e097b/ff+7e097c/ff cartridge sha256:d8d14c9f599cf915127440ba22fcbb7c33814f5688c9ae4f8855ed1f6ed42128 name:Yu Yu Hakusho Final - Makai Saikyou Retsuden (Japan) cheat description:Infinite health code:7e0a38/50 cheat description:Infinite power code:7e0a3c/50 cheat description:One hit kills code:7e0f38/00 cheat description:Opponent has no power code:7e0f3c/00 cartridge sha256:9b2cb155b270a78d122c46c44287f4973064dc96f75b0471c0843ca6a54bf41d name:Zen-Nihon GT Senshuken (Japan) cheat description:Disable timer code:7e16dc/00 cheat description:Always 1st code:7e0cdc/00 cheat description:Lap modifier code:7e149c/00 cartridge sha256:7d414b7f5941f1eddc35259a22accbbbd7b47c517dfcf8bad86c4dcfa9e50b1e name:Zero the Kamikaze Squirrel (USA) cheat description:Jump higher code:838542/f4+838a45/f4 cheat description:Invincibility code:7e0e2c/02 cheat description:Infinite health code:7e1674/04 cheat description:Infinite lives code:7e1672/06 cheat description:Infinite Shurikens code:7e1676/99 cartridge sha256:25414de02c6805ca62574cfb39c23bf292b3d8c4ff33eb8f212ccdbcd61c5ae3 name:Zool - Ninja of the 'Nth' Dimension (USA) cheat description:Invincibility (blinking) code:7e1d8b/49 cheat description:Invincibility code:7e05dc/ff cheat description:Infinite health code:7e1cf1/fa cheat description:Infinite lives code:7e020c/63 cheat description:Infinite time code:7e1cef/09 cheat description:Infinite continues code:7e020c/63 cheat description:Hit anywhere code:009de0/80+009de1/1a cheat description:Multi-jump code:00e031/80 cartridge sha256:b27e2e957fa760f4f483e2af30e03062034a6c0066984f2e284cc2cb430b2059 name:Zombies Ate My Neighbors (USA) cheat description:Invincibility, hit anywhere, get items from anywhere (do not use martian gun) - both players code:80f9a8/80+80d01e/00+80bf0c/00+80befe/00 cheat description:Invincibility - both players code:80d01e/00 cheat description:Infinite health - both players code:80d041/ea cheat description:Infinite weapons - both players code:80ed47/00 cheat description:Infinite Keys on pick-up code:80e910/00 cheat description:Infinite special items (except Keys and random Potions) code:80eb58/00 cheat description:Infinite lives - both players code:80cec5/bd cheat description:Victims are invincible code:83a3ac/6b cheat description:Package of 99 Squirtgun shots worth 999 code:80f8ad/09 cheat description:Package of 20 Soda Pop Cans worth 99 code:80f8b8/99 cheat description:Package of 20 Tomatoes worth 99 code:80f8ba/99 cheat description:Package of 5 Bazookas worth 999 code:80f8b7/99 cheat description:Each First Aid Kit worth 9 on pick-up code:80f915/09 cheat description:Each Key worth 9 on pick-up code:80f907/09 cheat description:Only 1 victim to rescue per level (no bonus for rescuing all victims, game is over if Zombie eats a victim) code:8085e8/01 cheat description:Can advance to next level after getting 1 victim (no bonus for rescuing all victims, game is over if Zombie eats a victim) code:80c86b/9c cheat description:Walk through walls code:80e4cc/80+80e50b/80 cheat description:Continue with 1/2 health code:80d960/05 cheat description:Start with 1/2 health code:80887a/05 cheat description:Start with 10 lives code:808880/09 cheat description:Start with 7 lives code:808880/06 cheat description:Start with 1 life code:808880/00 cheat description:Start with 50 shots in Squirtgun code:808893/00 cheat description:Start with 100 shots in Squirtgun code:808892/00 cheat description:Start with 550 shots in Squirtgun code:808893/05 cheat description:Start with 950 shots in Squirtgun code:808893/09 cheat description:Start with Soda Pop Cans instead of Squirtguns (Press B or Y to get item) code:80889d/d8 cheat description:Start with Bazookas (Press B or Y to get item) code:80889d/d6 cheat description:Start with Tomatoes (Press B or Y to get item) code:80889d/da cheat description:Start with Fire Extinguishers (Press B or Y to get item) code:80889d/ce cheat description:Start with Ice Pops (Press B or Y to get item) code:80889d/dc cheat description:Start with Peppers (Press B or Y to get item) code:80889d/de cheat description:Start with Martian Bubble Guns (Press B or Y to get item) code:80889d/d0 cheat description:Start with Weed-eaters (Press B or Y to get item) code:80889d/d2 cheat description:Start with Ancient Artifacts (Press B or Y to get item) code:80889d/d4 cheat description:Start with Plates (Press B or Y to get item) code:80889d/e0 cheat description:Start with Silverware (Press B or Y to get item) code:80889d/e2 cheat description:Start with Footballs (Press B or Y to get item) code:80889d/e4 cheat description:Start with 9 First Aid Kits instead of 1 code:808895/09 cheat description:Start with Speed Shoes instead of First Aid Kit (Press B or Y to get item) code:8088a0/0e cheat description:Start with a Monster Potion (Press B or Y to get item) code:8088a0/10 cheat description:Start with a Ghost Potion (Press B or Y to get item) code:8088a0/12 cheat description:Start with a Random Potion (Press B or Y to get item) code:8088a0/14 cheat description:Start with a Pandora's box (Press B or Y to get item) code:8088a0/1c cheat description:Start with a Skeleton key (Press B or Y to get item) code:8088a0/1e cheat description:Start with a Decoy (Press B or Y to get item) code:8088a0/20 cheat description:Start on level 2 code:8085f1/02 cheat description:Start on level 3 code:8085f1/03 cheat description:Start on level 4 code:8085f1/04 cheat description:Start on level 5 code:8085f1/05 cheat description:Start on level 6 code:8085f1/06 cheat description:Start on level 7 code:8085f1/07 cheat description:Start on level 8 code:8085f1/08 cheat description:Start on level 9 code:8085f1/09 cheat description:Start on level 10 code:8085f1/0a cheat description:Start on level 11 code:8085f1/0b cheat description:Start on level 12 code:8085f1/0c cheat description:Start on level 13 code:8085f1/0d cheat description:Start on level 14 code:8085f1/0e cheat description:Start on level 15 code:8085f1/0f cheat description:Start on level 16 code:8085f1/10 cheat description:Start on level 17 code:8085f1/11 cheat description:Start on level 18 code:8085f1/12 cheat description:Start on level 19 code:8085f1/13 cheat description:Start on level 20 code:8085f1/14 cheat description:Start on level 21 code:8085f1/15 cheat description:Start on level 22 code:8085f1/16 cheat description:Start on level 23 code:8085f1/17 cheat description:Start on level 24 code:8085f1/18 cheat description:Start on level 25 code:8085f1/19 cheat description:Start on level 26 code:8085f1/1a cheat description:Start on level 27 code:8085f1/1b cheat description:Start on level 28 code:8085f1/1c cheat description:Start on level 29 code:8085f1/1d cheat description:Start on level 30 code:8085f1/1e cheat description:Start on level 31 code:8085f1/1f cheat description:Start on level 32 code:8085f1/20 cheat description:Start on level 33 code:8085f1/21 cheat description:Start on level 34 code:8085f1/22 cheat description:Start on level 35 code:8085f1/23 cheat description:Start on level 36 code:8085f1/24 cheat description:Start on level 37 code:8085f1/25 cheat description:Start on level 38 code:8085f1/26 cheat description:Start on level 39 code:8085f1/27 cheat description:Start on level 40 code:8085f1/28 cheat description:Start on level 41 code:8085f1/29 cheat description:Start on level 42 code:8085f1/2a cheat description:Start on level 43 code:8085f1/2b cheat description:Start on level 44 code:8085f1/2c cheat description:Start on level 45 code:8085f1/2d cheat description:Start on level 46 code:8085f1/2e cheat description:Start on level 47 code:8085f1/2f cheat description:Start on level 48 code:8085f1/30 cheat description:Start on bonus level Son of Dr. Tongue code:8085f1/32 cheat description:Start on bonus level Day of the Tentacle code:8085f1/33 cheat description:Start on bonus level Someplace Very Warm code:8085f1/34 cheat description:Start on bonus level Curse of the Pharaohs code:8085f1/35 cheat description:Start on bonus level Mushroom Men code:8085f1/36 cheat description:Start on bonus level Cheerleaders vs. the Monsters code:8085f1/37 cheat description:Start on credit level Monsters Among Us code:8085f1/31 cheat description:Infinite health - P1 code:7e1cb8/0a cheat description:Infinite health - P2 code:7e1cba/0a cheat description:Infinite lives - P1 code:7e1d4c/03 cheat description:Infinite lives - P2 code:7e1d4e/03 cheat description:Skip Konami and LucasArts intro screens code:7e0c7c/01 cheat description:Only 1 victim to rescue to advance code:7e1d52/01 cheat description:Always have Shoes effect - P1 code:7e0155/ff cheat description:Always have Shoes effect - P2 code:7e02d5/ff cheat description:Infinite Bazooka - P1 code:7e1cd6/50 cheat description:Infinite Bazooka - P2 code:7e1cf6/50 cheat description:Infinite Berries - P1 code:7e1cda/50 cheat description:Infinite Berries - P2 code:7e1cfa/50 cheat description:Infinite Cold Potion - P1 code:7e1d12/09 cheat description:Infinite Cold Potion - P2 code:7e1d32/09 cheat description:Infinite Dummy Clown - P1 code:7e1d20/09 cheat description:Infinite Dummy Clown - P2 code:7e1d40/09 cheat description:Infinite Extinguisher - P1 code:7e1cce/50 cheat description:Infinite Extinguisher - P2 code:7e1cee/50 cheat description:Infinite Flamethrower - P1 code:7e1ce6/50 cheat description:Infinite Flamethrower - P2 code:7e1d06/50 cheat description:Infinite Footballs - P1 code:7e1ce4/50 cheat description:Infinite Footballs - P2 code:7e1d04/50 cheat description:Infinite Holy Cross - P1 code:7e1cd4/50 cheat description:Infinite Holy Cross - P2 code:7e1cf4/50 cheat description:Infinite Keys - P1 code:7e1d0c/09 cheat description:Infinite Keys - P2 code:7e1d2c/09 cheat description:Infinite Martian Gun - P1 code:7e1cd0/50 cheat description:Infinite Martian Gun - P2 code:7e1cf0/50 cheat description:Infinite Medical Kit - P1 code:7e1d1a/09 cheat description:Infinite Medical Kit - P2 code:7e1d3a/09 cheat description:Infinite Monster Potion - P1 code:7e1d10/09 cheat description:Infinite Monster Potion - P2 code:7e1d30/09 cheat description:Infinite Pandoras Box - P1 code:7e1d1c/09 cheat description:Infinite Pandoras Box - P2 code:7e1d3c/09 cheat description:Infinite Plates - P1 code:7e1ce0/50 cheat description:Infinite Plates - P2 code:7e1d00/50 cheat description:Infinite Popsicles - P1 code:7e1cdc/50 cheat description:Infinite Popsicles - P2 code:7e1cfc/50 cheat description:Infinite Random A Potion - P1 code:7e1d14/09 cheat description:Infinite Random A Potion - P2 code:7e1d34/09 cheat description:Infinite Random B Potion - P1 code:7e1d16/09 cheat description:Infinite Random B Potion - P2 code:7e1d36/09 cheat description:Infinite Shoes - P1 code:7e1d0e/09 cheat description:Infinite Shoes - P2 code:7e1d2e/09 cheat description:Infinite Silverware - P1 code:7e1ce2/50 cheat description:Infinite Silverware - P2 code:7e1d02/50 cheat description:Infinite Skeleton Key - P1 code:7e1d1e/09 cheat description:Infinite Skeleton Key - P2 code:7e1d3e/09 cheat description:Infinite Soda Bombs - P1 code:7e1cd8/50 cheat description:Infinite Soda Bombs - P2 code:7e1cf8/50 cheat description:Infinite Squirt Gun - P1 code:7e1ccc/50 cheat description:Infinite Squirt Gun - P2 code:7e1cec/50 cheat description:Infinite Weed Wacker - P1 code:7e1cd2/50 cheat description:Infinite Weed Wacker - P2 code:7e1cf2/50 cartridge sha256:c8497ee7a25d1eb7cf4ef1604b2fd7836a64c5c30e8334f7a48f1ed2a27b5cc1 name:1942 (USA, Europe) cheat description:Invincibility code:2c8b/28/18+18c5/28/18 cheat description:Hit anywhere code:19ec/26/00+19f5/1b/c9 cartridge sha256:da5eb5a56ab97f7b6779fa70b894cb94abf351aaf0c9430bd775156528a334a0 name:4-in-1 Fun Pak (USA, Europe) cheat description:Chess - move anywhere code:5ed0/be/77+5ed1/28/18 cheat description:Checkers - move anywhere code:54bc/28/18+54cd/20/18+539c/28/18 cartridge sha256:d16375478a455270b758eb61f9c9fb380fbf5187e32a8fe3fc93ba4f4a330959 name:4-in-1 Fun Pak Volume II (USA, Europe) cheat description:Solitaire - move cards anywhere code:48e3/16/00+4559/7d/00 cartridge sha256:f66a6c521c706bf3bf4536731becacf1336a711bd40658d853646cd6b20fdb2b name:720 Degrees (USA, Europe) cheat description:Jump to get 1000 points code:7da4/0c/00 cartridge sha256:52ee7edb02d42bfc7a9a5a52df082424cd8d9b3cbd2aa47fc84bd32f79cd059a name:A-mazing Tater (USA) cheat description:Walk anywhere code:0f68/1d/00 cartridge sha256:fa9fe020c07a5194dcd61ab33be44779ce5c9de4074fac3eb68bae9311d7c2f6 name:Action Man - Search for Base X (USA, Europe) cheat description:Invincibility code:66d8/ea/fa cheat description:Hit anywhere code:673a/24/00 cartridge sha256:18746d4607424feca05aee056c3ed5f840195c792409881e9145d4bd96800dbd name:Addams Family, The - Pugsley's Scavenger Hunt (USA, Europe) cheat description:Invincibility code:3915/35/c9 cheat description:Infinite health code:3915/35/be cheat description:Infinite hearts code:3911/c1/00 cheat description:Infinite lives code:0428/ea/fa cheat description:Infinite lives (alt) code:0427/3d/be cheat description:When game begins, go through any door, enter secret bonus room, disable to exit room code:13de/e6/af+13df/1f/3c+13e1/7f/7d cheat description:Lose 1 heart to become invincible code:0adc/ea/fa cheat description:Start each life with 1 heart code:7fe9/03/01 cheat description:Start each life with 5 hearts code:7fe9/03/05 cheat description:Start with 1 life code:0217/05/01 cheat description:Start with 10 lives code:0217/05/0a cartridge sha256:f267738e785f43a09c92511bcbb7f16d2e8acbe43b36f75bee35ff3fb0c21621 name:Addams Family, The (USA) cheat description:Invincibility code:4ada/ea/be+09d7/ea/c9 cheat description:Infinite health code:1f35/35/be cheat description:Infinite lives code:5dce/35/be cheat description:Infinite weapon code:7868/35/be cheat description:Hit anywhere code:49fd/08/00 cartridge sha256:7771919d5f5a114fb8685345eab290be22e99c59d8798ed9c5f29e3079c11c56 name:Adventure Island (USA, Europe) cheat description:Invincibility code:1653/ea/be cheat description:Infinite time code:1690/35/be cheat description:Infinite lives code:7ac8/35/be cheat description:Hit anywhere code:20e1/f6/00+2102/28/18 cartridge sha256:bbb38ee1e9877404dd999ef7067aa238a1039ca603b987f8adeff4488e318331 name:Adventure Island II - Aliens in Paradise (USA, Europe) cheat description:Invincibility code:1ad8/ea/c9 cheat description:Infinite time code:0e2c/ea/c9 cheat description:Infinite lives code:46dd/01/00 cheat description:Infinite lives (alt) code:46dc/d6/be cheat description:Hit anywhere code:1ca1/c8/c9+1922/d2/c3 cheat description:No gradual loss of energy, but can still be drained by obstacles and enemies code:0e28/01/00 cheat description:Once you collect any non-throwable object, you can't lose it from menu code:5d51/01/00 cheat description:Start with 1 of each power-up code:4037/af/3c cheat description:Start with 1 life code:406d/03/00 cheat description:Start with 6 lives code:406d/03/05 cheat description:Start with 9 lives code:406d/03/08 cheat description:Start on level 1-4 code:4057/01/08 cartridge sha256:4c156c4d826b9cba5741feb621de60c6294adb36553fc43971794bd2a4ffb34a name:Adventures of Lolo (Europe) (SGB Enhanced) cheat description:Walk anywhere code:4928/06/00 cartridge sha256:50c3a2193005c9134699ab00de16510fb946db10cdbc33bfacd8a3132926b72e name:Adventures of Pinocchio, The (USA) (Proto) cheat description:Invincibility code:14c0/e0/c9 cartridge sha256:ee582fc5f302c430556703c553c3a49db8e05847ba9b13d0f6bc018657ac8593 name:Adventures of Rocky and Bullwinkle and Friends, The (USA) cheat description:Invincibility code:144c/c0/c9 cheat description:Invincibility after first hit code:1428/ea/fa cheat description:Infinite energy code:1496/ea/fa cheat description:Die in one hit code:1453/78/01 cheat description:Start with 1 life code:515c/02/00 cheat description:Start with 10 lives code:515c/02/09 cheat description:Start with 15 lives code:515c/02/0e cheat description:Start with 1 mooseberry - 1st life code:5161/03/00 cheat description:Start with 5 mooseberries - 1st life code:5161/03/04 cheat description:Start with 10 mooseberries - 1st life code:5161/03/09 cheat description:Start with 1 mooseberry - 2nd life code:14bc/03/00 cheat description:Start with 5 mooseberries - 2nd life code:14bc/03/04 cheat description:Start with 10 mooseberries - 2nd life code:14bc/03/09 cartridge sha256:e946c9e9c819cb9ba37eb1718903aa3cd5ea101d5890e27681b370a44fe0f1d8 name:Adventures of Star Saver, The (USA, Europe) cheat description:Invincibility (blinking) code:1bd9/ea/c9 cheat description:Infinite lives code:11a7/35/be cheat description:Infinite life ropes code:2389/c6/00 cheat description:Infinite shields on pick-up code:2163/c6/00+1bb7/c6/00+1bdb/c6/00 cheat description:Hit anywhere code:1dc4/38/18+1db7/38/18 cheat description:49 life ropes on pick-up code:1c94/34/75 cheat description:Start with all power-ups (except shields) - 1st life only code:117f/af/3c cheat description:Start with 2 lives code:1199/03/02 cheat description:Start with 4 lives code:1199/03/04 cheat description:Start with 6 lives code:1199/03/06 cartridge sha256:29a39e0ccf66a1eb5d456e027b2c1abcd9d2ea8bbf6b6d19d86fff61a493e008 name:Adventures of the Smurfs, The (Europe) (En,Fr,De,Es,It,Nl) cheat description:Infinite health code:1b9f/09/00 cartridge sha256:cb1d45fca310ef4b7013d094663bddcd209362f272bb3e54ce10540828c8c212 name:Aerostar (USA, Europe) cheat description:Invincibility code:2aad/d2/03+2aae/30/17+1707/3e/f0 cheat description:Infinite lives code:16f1/e0/f0 cheat description:Infinite jump code:1870/e0/be cheat description:Hit anywhere code:2e93/c0/c9+2fe0/2f/3e+2fdf/30/18 cartridge sha256:efee40857f6310f5437732198d998779711f86d80673e72cfc93a3378ca26303 name:AirForce Delta (USA) cheat description:Invincibility code:7568/38/18 cartridge sha256:8e45c7d6b5498d4048653e92b2a792bb2eea00b2897a7711fb7be1b6bed0534f name:Akumajou Dracula - Shikkoku Taru Zensoukyoku - Dark Night Prelude (Japan) (SGB Enhanced) cheat description:Fast walk left code:4df3/c5/11 cheat description:Fast walk right code:4dcc/c5/11 cheat description:Fast jump left code:542c/c5/11 cheat description:Fast jump right code:540b/c5/11 cartridge sha256:4940bf228fb2095daa6b382d84ebd0cf05cd81fc2e6e5244a03ab458593e53f5 name:Aladdin (USA) (SGB Enhanced) cheat description:Infinite health code:0dca/90/be cheat description:Infinite lives code:1ce5/3d/be cheat description:Infinite Apples code:216d/3d/be cheat description:Hit anywhere - Sword code:5c54/c0/00+5c4a/d8/00 cartridge sha256:944df9d20c715099ef6bf0e418d928684b284d4a4562391a661a7978fa7f5417 name:Alfred Chicken (USA) cheat description:Invincibility code:1546/e0/be cheat description:Infinite time code:1bc2/ce/be cheat description:Infinite lives code:1be9/93/be cartridge sha256:4790f55d0917f4418c63d29c5c528362b1c7ae39546f6fc3ae94e867d1e9f270 name:Alien 3 (USA, Europe) cheat description:Almost infinite health code:1768/ea/fa cheat description:Infinite tries code:1692/ea/fa cheat description:Infinite shots per clip on pick-up code:2f9c/c3/00 cheat description:Infinite magazine clips on pick-up code:2b45/ea/fa cheat description:50 shots per magazine clip code:5a3c/3c/32 cheat description:75 shots per magazine clip code:5a3c/3c/4b cheat description:100 shots per magazine clip code:5a3c/3c/64 cheat description:Start with 1/2 health code:2442/ff/8e cheat description:Start with 4 tries code:1b27/03/04 cheat description:Start with 6 tries code:1b27/03/06 cheat description:Start with 10 tries code:1b27/03/0a cartridge sha256:073f82f8bf4ab9d15569b5a7a4aa152351c177b9072a9481563b26562215f55b name:Alien Olympics (Europe) cheat description:Meter never decreases code:4d7d/9a/c9 cheat description:Hyper velocity code:4d7a/93/be cheat description:Freeze time code:5c6d/3c/be cartridge sha256:e1a71b44a1c5dcacfe90e76907766fd48518482950531bee34208114d4a03e53 name:Alien vs Predator - The Last of His Clan (USA) cheat description:Infinite lives code:2fd4/35/be cheat description:Infinite energy code:04ef/3d/be cheat description:Infinite HP code:3bba/ea/be cartridge sha256:ed8070e011713527bdc03e2b9cec9f9c4a7e3aaa00e57e8786a186b265da1bb2 name:Alleyway (World) cheat description:Infinite lives code:07ee/3d/be cheat description:Hit anywhere - Paddle code:0cd1/0f/00 cartridge sha256:04c5507efe0beb40ea1a887538bd8a04acc70622bf9ef800951a71f4804c9cbc name:All-Star Baseball 99 (USA) cheat description:Infinite time code:665e/01/00 cheat description:Computer's 3-pt. shots worth 25 points code:211f/03/19 cheat description:Computer's 3-pt. shots worth 17 points code:211f/03/11+2118/c1/11 cheat description:Computer makes almost all shots code:2ef7/fe/36+26f8/04/09 cheat description:Computer can't score against you code:2115/36/34+2116/c1/00 cheat description:Shot clock for human player is 9 seconds - 1-on-1 game code:65fb/24/09+233d/24/09+65c4/24/09 cartridge sha256:21d507b3ee6acbde8427d8e5cc5de1083eec03df8bd55745e4384ee0be14460e name:All-Star Baseball 2000 (USA, Europe) cheat description:Balls are considered strikes code:53f8/0c/00+53ea/1a/00+53dc/28/00 cartridge sha256:c0bd16cfe156f36a0bcbf70c537a172ad4780641da6e23eacf47cc5f155d2640 name:All-Star Baseball 2001 (USA) cheat description:Balls are considered strikes code:53f7/30/3e+53ea/1a/00+53dc/28/00 cartridge sha256:995dc210efdf7c12ae7d4c731e2ea0ae758554fc7f545dae72aa97a99dd10ed7 name:Alone in the Dark - The New Nightmare (USA) (En,Fr,Es) cheat description:Invincibility code:43d5/38/18 cartridge sha256:4f6450321ee163d5fd8a942816b10af1ce41bbcad62185a550c97b16cac125a1 name:Altered Space - A 3-D Alien Adventure (USA) cheat description:Infinite energy (air) code:14f1/d6/3a cartridge sha256:db4e590899aab75bceb31e84a2ec77c34b561838a61fd9dc9fda004a0507a01c name:Amazing Penguin (USA, Europe) cheat description:Invincibility code:119f/c0/c9 cheat description:Infinite lives code:2228/3d/be cheat description:Infinite time code:16c4/35/be cartridge sha256:a52b036d637b59950749de679208785480b8ad2d5e95c0ea2a6f638750cc645e name:Amazing Spider-Man, The (USA, Europe) cheat description:Hit anywhere code:28ea/d8/00+288c/65/00 cartridge sha256:c4eb652e47d458b8faba7fd753a3eff8e875658f2b4cee0ae6194dc8cb0783e7 name:Amida (Japan) cheat description:Invincibility code:03eb/06/00+05e2/20/18 cartridge sha256:4d2cca30eb8804ed6fffa07da2dea1992ff1ce12bded2195d05cf912b879b951 name:Animaniacs (USA) (SGB Enhanced) cheat description:Multi-jump code:4a0e/c0/00+4a0b/c0/00 cheat description:Get Stars from anywhere code:4060/40/00 cartridge sha256:23b432a52aefcca6731fccace793f58ee5cac030b27ad18ac8d354430a388f01 name:Arcade Classics - Battlezone & Super Breakout (USA, Europe) (SGB Enhanced) cheat description:Paddle hits ball anywhere code:0f6d/79/00+0f70/38/18 cartridge sha256:7cebe1e446c56061f71e94b99cf6dfb7267cac0e21cb37b0f9a8118d5a127eb0 name:Arcade Classic No. 2 - Centipede & Millipede (USA, Europe) (SGB Enhanced) cheat description:Centipede - Invincibility code:5628/d2/c3 cheat description:Millipede - Invincibility code:7543/ea/fa+7573/b8/37 cartridge sha256:c504be420e7bfdcf9905fc4d6674fd4b7466e832976a7a48660b901086536d1f name:Army Men (USA, Europe) (En,Fr,De) cheat description:Invincibility code:7d00/38/18 cheat description:Infinite health code:0c33/c0/c9 cheat description:Infinite ammo - all weapons code:0cd1/35/00 cheat description:Get items from anywhere code:3345/d2/fa+332c/d2/fa cartridge sha256:6da0357c4b00a1b8393f4e9fb5dbbe620e9b1680a7c4032303a058178fa245b7 name:Army Men 2 (USA, Europe) (En,Fr,De) cheat description:Invincibility code:796a/20/18 cheat description:Infinite health code:772a/c0/c9 cheat description:Infinite ammo - all weapons code:0cda/35/00 cartridge sha256:801660458dc65c29701f21985943ba84c1f55cf57c9be3527b17548c33be260d name:Asterix - Search for Dogmatix (Europe) (En,Fr,De,Es,It,Nl) cheat description:Invincibility code:1043/28/3e+47b2/c8/c9 cheat description:Hit anywhere code:1d14/d2/fa cartridge sha256:3f0688ed9219c44ce133647f0668cde50fdcba7ed8f04c34c3a0fc5ce596bfe5 name:Asteroids (USA, Europe) cheat description:Infinite lives code:0383/35/00 cheat description:No extra rocks as you go up levels code:2a7e/34/00 cheat description:Rocks go thru you unless you move from the middle code:2cb4/07/01+039c/35/00 cheat description:Start with 1 life code:0315/03/01 cheat description:Start with 5 lives code:0315/03/05 cheat description:Start with 9 lives code:0315/03/09 cartridge sha256:3f0688ed9219c44ce133647f0668cde50fdcba7ed8f04c34c3a0fc5ce596bfe5 name:Asteroids (USA, Europe) cheat description:Invincibility code:5549/d0/c9 cartridge sha256:d5306853c8dc7d402808cc340064fdf48d930bbc5a531c8ece3661bfa7f7ff55 name:Atlantis - The Lost Empire (USA, Europe) cheat description:Infinite energy code:52ac/ea/fa cheat description:Infinite lives code:1c3a/ea/fa cheat description:Start with 9 lives code:343e/03/09 cartridge sha256:2df8eb5d48a204d9609e0c12fed81304cc0b23421c5015ab2296d51ffc8b36ad name:Atomic Punk (USA) cheat description:Invincibility and infinite time code:025e/47/09+025d/94/75+0976/ff/91 cheat description:Hit anywhere - Mode A code:1672/38/20+1671/10/3d+1670/fe/8b+166f/1a/f0 cheat description:Hit anywhere - Mode B code:57ee/d8/c8+57ed/10/00+57ea/4a/c3+57e9/48/00+57e8/cd/21 cartridge sha256:ac3656cb5b86c13ad67a486d11d21643fdec306500d989fbd770b5939bab22f0 name:Attack of the Killer Tomatoes (USA, Europe) cheat description:Infinite health code:0adb/35/00 cheat description:Infinite lives code:3945/ea/fa cartridge sha256:0d80b2ad776053f50c3eb0e0e32c675f24acf94923bf3ac4c156c7c28bc76a6e name:Avenging Spirit (USA, Europe) cheat description:Invincibility except against spikes code:3592/fa/c9+2e82/c0/c9 cheat description:Invincibility against spikes code:554d/c0/c9 cheat description:Infinite health except if weapon is used against you code:35af/ea/fa+2ec2/ea/fa cheat description:Infinite L health except against spikes code:2eb5/ea/fa cheat description:Hit anywhere code:2d4d/ea/fa+2d30/33/00 cheat description:Get items from anywhere code:6550/ca/fa cheat description:Multi-jump code:4fa6/d8/00 cheat description:Start with 1/2 health code:332b/14/0a cheat description:Start with 1/4 health code:332b/14/05 cheat description:Start with 3/4 health code:332b/14/0f cheat description:Start on level 2 (brings you back to level 2) code:39b9/01/02 cheat description:Start on level 4 (brings you back to level 2) code:39b9/01/04 cheat description:Start on level 6 (brings you back to level 2) code:39b9/01/06 cartridge sha256:6340ba86bf9500ece66d8acbcca90c4ab8c42de26804fde393311d62eaab3b61 name:B.C. Kid 2 (Europe) (SGB Enhanced) cheat description:Invincibility code:5aab/12/00+4f26/20/18 cheat description:Hit anywhere code:5dce/28/18+5c08/cd/fa cartridge sha256:1b48b454bb421836c33c2d572c61f69145a077ebcecbf8194dfb05fc6581ff82 name:Balloon Kid (USA, Europe) cheat description:Invincibility against fire code:5604/09/00 cartridge sha256:c71663c9172c69b3daded65aaaa3735d1f50379a471af345e8421a6a6c9aaa98 name:Barbie - Game Girl (USA, Europe) cheat description:Infinite HP code:3aa5/ea/fa cheat description:Infinite continues code:6b95/ea/fa cheat description:1 continue code:27ad/03/01 cheat description:4 continues code:27ad/03/04 cheat description:8 continues code:27ad/03/08 cheat description:Start with 2 HP code:277a/05/02 cheat description:Start with 4 HP code:277a/05/04 cheat description:Start with 8 HP code:277a/05/08 cartridge sha256:86e5b7037d7c61248adfdc316d61b5c58fe46c5d3fe376bcdfeda9d6538b197d name:Bart Simpson's Escape from Camp Deadly (USA, Europe) cheat description:Infinite health code:07fa/ea/fa cartridge sha256:debc4ac9d7587166f4754d99955c8ed8c5ae014bb10e91764fe9e632cdbcb3fc name:Baseball (World) cheat description:Balls are counted as strikes code:6047/d8/00 cartridge sha256:0eedbdd6530f30adcc8ee88b32e852b7983de8bba8122ddd2c1adaf2805a454c name:Bases Loaded for Game Boy (USA) cheat description:No walks code:4c63/3c/00 cheat description:1 ball and you walk code:4c66/04/00 cheat description:2 balls and you walk code:4c66/04/02 cheat description:3 balls and you walk code:4c66/04/03 cheat description:5 balls and you walk code:4c66/04/04 cheat description:Outs aren't counted (base runners will still be taken out) code:4c77/3c/00 cheat description:Number of outs to retire the side varies code:738f/03/00 cheat description:Strikes aren't counted code:4c43/34/00 cheat description:1 strike and you're out code:4c46/03/01 cheat description:2 strikes and you're out code:4c46/03/02 cheat description:5 strikes and you're out code:4c46/03/05 cheat description:No scoring - disable to score code:081f/01/00+0811/01/00 cartridge sha256:2eb0708771791f2e126bd97e672a365c70c3d7064ecc391433545352133dad60 name:Battle Crusher (Japan) (SGB Enhanced) cheat description:Hit anywhere - P1 code:53de/05/00 cheat description:Invincibility (except throws) - P1 code:53cc/28/18 cheat description:Blocking disabled - both players code:23cb/01/00 cartridge sha256:ea30dd015164e6895547d518a96cee60a17767f985b68c50d07ca560c80956ae name:Battle of Olympus, The (Europe) (En,Fr,De,Es,It) cheat description:Hit anywhere code:2a7b/b7/37 cheat description:Get items from anywhere (press down) code:61a6/11/00 cartridge sha256:c38fc7e54ed27bd82c9829a6535f5be0d2ff81822863ab9c088bf345ab01b734 name:BattleCity (Japan) cheat description:Invincibility code:3668/da/c3 cheat description:Invincibility - Base code:3e99/01/00 cartridge sha256:9ac1f4a299d32ba21cf65f67ab210afeb4c629adbd8e5779f76b6667ca3a0a4a name:Batman - The Animated Series (USA, Europe) cheat description:Almost invincible - disable if you get stuck code:2592/cd/21 cheat description:Infinite energy code:25ef/77/00 cheat description:Infinite batarangs code:2ba3/35/00 cheat description:One hit kills on most enemies code:1615/91/af cheat description:Each batarang pick-up is worth 9 code:4a70/05/09 cheat description:Most enemies don't die code:1616/77/00 cheat description:Most enemies are harder to kill code:4fcd/02/0a cheat description:Start with 7 batarangs code:2496/af/00+249a/ea/fa cheat description:Start with very little energy code:248e/07/01 cheat description:Start with about half energy code:248e/07/04 cheat description:Start with about 2x energy code:248e/07/0e cartridge sha256:d0e4ff010ab013e519abd9950ab465f3369c76e23d82927c0f39b5e259d4febf name:Batman - The Video Game (World) cheat description:Invincibility code:018d/ff/a1 cheat description:Infinite health code:4ec1/ea/fa cheat description:Infinite health (alt) code:0104/c0/c8 cheat description:Infinite lives code:095d/ea/fa cheat description:Infinite lives (alt) code:0103/c0/c7 cheat description:Hit anywhere code:4275/54/00+2e16/30/18+2e17/12/23 cheat description:Hit anywhere - Bosses code:2eca/25/28+2ec9/38/18 cheat description:Multi-jump code:375b/28/18 cartridge sha256:152fc252bba7130e786d408eed310b3009b8e05834f8003dfbf514ec804cbaea name:Batman - Return of the Joker (USA, Europe) cheat description:Invincibile against enemies code:54ad/11/00+54b2/e6/c6 cheat description:Infinite batarangs on pick-up code:1996/3d/00 cheat description:Infinite continues code:2ab5/c7/00 cheat description:Select any weapon from menu code:56bc/e6/00 cheat description:Hit anywhere code:26b5/6c/00+26ac/75/00 cheat description:Multi-jump code:1f4b/28/18+2003/ca/c3+1a34/22/00 cheat description:5 Batarangs on pick-up code:4da0/0a/05 cheat description:20 Batarangs on pick-up code:4da0/0a/14 cheat description:40 Batarangs on pick-up code:4da0/0a/28 cheat description:1 continue code:0207/05/02 cheat description:9 continues code:0207/05/0a cheat description:Start with max of 3 HP code:f000/ba/00 cheat description:Start with max of 8 HP code:0201/0a/10 cartridge sha256:bfb324176949811c6e116cb8e3d434b4937634d95b4f9bdfb54e0157c612dea0 name:Batman Beyond - Return of the Joker (USA) cheat description:Hit anywhere code:4e67/d0/00 cartridge sha256:519ca6523e54b67a4b4dcc7f525d56df986e0d77c84699dcf9e022f0ae6fbd0e name:Battle Arena Toshinden (USA) (SGB Enhanced) cheat description:Hit anywhere - both players code:4e01/ca/fa cheat description:Blocking disabled - both players code:6a8f/02/00 cartridge sha256:b9909506f566ea7998d6170e9610bad62dbda7d38e42830cd187592e262acfed name:Battle Unit Zeoth (USA, Europe) cheat description:Infinite health code:1233/e0/f0 cartridge sha256:dfa8ec0354c2c364398686cac91545dd2729ab4e0784e6f0b3a23cfe2f7d253b name:Battletoads (USA, Europe) cheat description:Invincibility code:277d/01/04+277c/28/36 cheat description:Infinite lives and energy code:0cca/ea/fa+17b0/c6/00 cheat description:Infinite continues code:17c2/35/00 cheat description:One hit kills code:2e9a/15/00 cheat description:Keep axe after dying code:7d91/ea/fa cheat description:Big arms that hack at you from caves in level 1 do not move code:1542/01/00 cheat description:1 continue code:77f2/03/01 cheat description:5 continues code:77f2/03/05 cheat description:10 continues code:77f2/03/0a cheat description:Start with 1 life code:77ed/03/00 cheat description:Start with 6 lives code:f000/ba/00 cheat description:Start with 10 lives code:77ed/03/09 cheat description:Start with 2 extra HP - after 1st life code:7e38/0c/0e cheat description:Start 1st life with 2 extra HP code:0326/0c/0e cheat description:Start 1st life with 1/2 energy code:0326/0c/06 cheat description:Start with only 1/2 energy - after 1st life code:7e38/0c/06 cartridge sha256:e10716e26a1b4edddc8c8fbf24cdad4decd054e555c77a6c0cd64fe283fa2287 name:Battletoads in Ragnarok's World (USA) cheat description:Invincibility - beat'em up levels code:2cfd/fa/ea cheat description:Infinite health code:0871/ea/fa cheat description:Infinite lives code:1a31/35/7e cartridge sha256:ffb240c74aac4527af2c268e1d7cf4f1b44229ff624d22966b5679e301617465 name:Beast Fighter (Asia) (Unl) cheat description:Invincibility code:57f6/c8/00+5800/c0/00+57ff/00/01+57fe/fe/3e cheat description:Infinite time code:2db6/c8/c9 cheat description:One hit kills on bosses code:46fa/02/00 cartridge sha256:1cbdbf760d84d62933f1b66410a80dda4185b138d964e6ec51780d391d09143d name:Beauty and the Beast - A Board Game Adventure (USA) (SGB Enhanced) cheat description:Access credits in options menu code:6915/03/04 cartridge sha256:436918dc75ffe606f458206caad6c063369ecbf650afcf96499eb98b2b85a72f name:Beetlejuice (USA) cheat description:Infinite health code:37e4/ea/fa cheat description:Infinite lives code:37ef/ea/fa cartridge sha256:0e825ec2c23a16fac1f33cdfd7402f218e3813961e95ddb4ca9fed19bfd79d04 name:Bill & Ted's Excellent Game Boy Adventure (USA, Europe) cheat description:Invincibility code:2eb7/28/18 cartridge sha256:378435aa66290a4d8a930e000eddf08dcb7b00fd36341991b0abedc488bb8c5d name:Bill Elliott's NASCAR Fast Tracks (USA) cheat description:Start with burst of speed code:f000/ba/00 cheat description:Infinite fuel code:5465/35/00 cheat description:Collisons with cars don't affect speed code:4d46/35/00 cheat description:Collisions barely affect speed code:43c5/77/00+523f/77/00+50bd/3d/00 cheat description:Start with 1 lap - ignore lap timer and counter code:4731/57/1e+4732/13/02 cheat description:Start with 3 laps - ignore lap timer and counter code:4731/57/1e+4732/13/04 cheat description:Start with 9 laps - ignore lap timer and counter code:4731/57/1e+4732/13/0a cartridge sha256:692e62d9e0048350256ee124d55c6ef225dc2bb54e0808fd882312d4dcaf0f28 name:Bionic Commando (USA) cheat description:Infinite energy code:4e6e/ea/fa cheat description:Infinite lives code:160a/df/00 cheat description:Infinite continues code:1404/df/00 cheat description:2 continues code:7481/03/02 cheat description:4 continues code:7481/03/04 cheat description:6 continues code:7481/03/06 cheat description:Start with 8 energy code:15e0/af/84 cheat description:Start with 2 lives code:140e/03/02 cheat description:Start with 4 lives code:140e/03/04 cheat description:Start with 6 lives code:140e/03/06 cartridge sha256:9338af642104f7f286687b2e6e55759917c0db35bc89ef398a92c18570bff681 name:Blades of Steel (USA) cheat description:Set length of game to 1:00 code:4165/20/01 cheat description:Set length of game to 3:00 code:4165/20/03 cheat description:Set length of game to 9:00 code:4165/20/09 cheat description:Opponent's energy doesn't go up again and yours does code:7793/3c/00 cheat description:Invincible in fights code:779f/ea/fa cheat description:3 penalty shots in shoot-out code:55b6/05/03 cheat description:5 penalty shots in shoot-out code:55b6/05/05 cheat description:9 penalty shots in shoot-out code:55b6/05/09 cartridge sha256:e0258871c84d18cb0b4cf9a41e1be2ad010c04fad45d97b23baca7746edcfa76 name:Blaster Master - Enemy Below (USA, Europe) (SGB Enhanced) cheat description:Invincibility code:0ef3/c0/c9+1681/c0/c9 cheat description:Invincibility when falling from very high (on foot) code:1682/21/c9 cheat description:Hit anywhere code:6dd5/cd/fa+6dbe/28/18 cheat description:Get items from anywhere code:6c3b/28/18 cheat description:Multi-jump (vehical) code:4605/28/18+45ff/28/3e cheat description:Multi-jump (on foot) code:4d05/c0/00 cheat description:Infinite POW meter - Vehicle code:0140/c1/24 cheat description:Infinite POW meter - Jason code:0140/c1/25 cheat description:Infinite HOV meter - Vehicle code:0140/c1/26 cheat description:Infinite Gun meter - Jason code:0140/c1/27 cheat description:Infinite Homing Missiles code:0163/c1/28 cheat description:Infinite Thunderbolts code:0163/c1/29 cheat description:Infinite 3-Way Missiles code:0163/c1/2a cheat description:All vehicle upgrades code:01ff/c1/06+01ff/c1/07 cartridge sha256:01bb3527ea235380895b8df07a864829b2ad9e399f8cd90bb816110e2bfb1693 name:Blaster Master Boy (USA) cheat description:Invincibility code:2d06/24/10+2d05/28/18 cheat description:Hit anywhere code:159b/af/7b cheat description:One hit kills - normal enemies code:37cb/3d/af cheat description:One hit kills - bosses code:3849/30/3e cartridge sha256:04aeb80ff35bd863c3922ad9b8cac7ee379e78feac4ce3cef2d58ccca142fc03 name:Blues Brothers, The (USA, Europe) cheat description:Infinite energy code:6af2/77/00 cheat description:Infinite encores code:0805/ea/fa cheat description:Start with 3 encores (continues) code:037c/02/03 cheat description:Start with 7 encores code:037c/02/07 cheat description:Start with 9 encores code:039c/02/09 cheat description:Start with 5 lives code:4015/02/05 cheat description:Start with 7 lives code:4015/02/07 cheat description:Start with 9 lives code:4015/02/09 cartridge sha256:9053443a6c786a54bebc2fa9c10acd3875887134c953e5bdf0a07dc554721fb6 name:Bo Jackson - Two Games in One (USA) cheat description:Baseball - 1 ball and you walk code:3f13/04/01 cheat description:Baseball - 2 balls and you walk code:3f13/04/02 cheat description:Baseball - 5 balls and you walk code:3f13/04/05 cheat description:Baseball - Strikes aren't counted - ignore message, you need 4 balls to walk code:3ec5/34/00 cheat description:Baseball - Outs aren't counted code:73e8/34/00 cheat description:Baseball - 1 strike and you're out code:3e87/03/01 cheat description:Baseball - 2 strikes and you're out code:3e87/03/02 cheat description:Baseball - No scoring - disable to score code:783c/34/00+7826/34/00 cheat description:Football - Infinite time code:356e/e0/f0 cheat description:Football - Infinite timeouts code:5012/35/00 cheat description:Football - Always 1st down code:47d0/e0/f0 cheat description:Football - Start with 1 timeout code:4068/03/01 cheat description:Football - Start with 2 timeouts code:4068/03/02 cheat description:Football - Start with 10 timeouts code:4068/03/0a cartridge sha256:195f5a9e97bfec6f071bfd6b82a39ffa25185b687a26a1f2937f9718c4d4d16e name:Boggle Plus (USA) cheat description:Infinite time code:25af/01/00 cheat description:1-minute game code:26bc/03/01 cheat description:5-minute game code:26bc/03/05 cheat description:9-minute game code:26bc/03/09 cheat description:Can re-use shaded letters code:5882/c2/d4 cheat description:Can select any letter on the board - letters don't have to be next to each other code:5ea9/28/30 cheat description:Boggle - 1 and 2 letter words allowed code:5b4c/03/01 cheat description:Boggle - Minimum word length 4 letters code:5b4c/03/04 cheat description:Big Boggle - 1 to 3 letter words allowed code:5b8f/04/01 cheat description:Big Boggle - Minimum word length 5 letters code:5b8f/04/05 cartridge sha256:beca58b71a27884d2c2820da0c7eb806fa945b2fab66da271588281e03153900 name:Bomb Jack (Europe) cheat description:Infinite lives code:0479/e0/f0 cartridge sha256:604db636c45af3cd1fec52e206701a8969a8a3e610df281f7461769bd86729ea name:Bomber Man GB 3 (Japan) (SGB Enhanced) cheat description:Invincibility code:4cae/01/02 cheat description:Infinite lives code:1517/3d/00 cheat description:Freeze timer code:29e0/3d/00 cheat description:Maximum Bombs placable code:7515/20/18 cheat description:Maximum blast range code:7523/20/18 cartridge sha256:16d6a4650566ede0ec9e3e23a85544737faab4154d6381668e8547047340eee6 name:Bomberman GB (USA, Europe) (SGB Enhanced) cheat description:Hit anywhere (press B) code:73c0/00/3d+73c1/cd/3d+73bf/00/a1+73c2/03/c9+73be/01/f0 cheat description:Bombs can break any block code:76c2/05/00 cartridge sha256:27d2eb237362b5647b020d0b22a08b079b40e50347dacc43b732830b9519a852 name:Bomberman Max - Blue Champion (USA) cheat description:Invincibility code:51b9/ff/00+52eb/ca/c3 cheat description:Hit anywhere code:35e2/22/f2+35e3/c6/c2 cheat description:Walk anywhere code:4b16/ea/fa cheat description:Infinite health code:0102/c3/04 cheat description:Infinite lives code:010a/c2/f7 cheat description:Infinite time code:01ff/c3/01 cheat description:Max Bombs code:0109/c2/f3 cheat description:Max Explosion code:0109/c2/f4 cheat description:All enemies frozen code:0100/c2/ff cartridge sha256:5f7c1cdf6adbe6d6dcef488bd37d0da82fa356b79fd579b2022a149e983abc39 name:Bomberman Max - Red Challenger (USA) cheat description:Invincibility code:52ea/a7/af+519d/38/18 cheat description:Hit anywhere code:35f1/c6/c2+35f0/22/f2 cheat description:Walk anywhere code:4b15/01/00 cheat description:Infinite health code:0102/c3/04 cheat description:Infinite lives code:010a/c2/f7 cheat description:Infinite time code:01ff/c3/01 cheat description:Max Bombs code:0109/c2/f3 cheat description:Max Explosion code:0109/c2/f4 cheat description:All enemies frozen code:0100/c2/ff cartridge sha256:6081309e7f5b63e4f6694965060c68baf82a775eb18e667c2c89898096e6e3d8 name:Bonk's Adventure (USA) cheat description:Infinite energy code:4513/c5/00 cheat description:Infinite lives code:2799/cd/00 cheat description:Start with 3 lives, 1st life as Mad Bonk code:01af/03/02+01b3/af/00 cheat description:Start 1st life as Turtle Bonk code:01af/03/02+01b3/af/00 cheat description:Start with 8 lives code:01af/03/07 cheat description:Start with 10 lives code:01af/03/09 cartridge sha256:6ac93cc5186a2e92e13260fd61951c1b28f0df2278b9003b2bcb1ddcbf51543c name:Boomer's Adventure in ASMIK World (USA) cheat description:Always have key code:23c7/c8/00 cartridge sha256:c2fdb7f5887132d1d5ba4081f1332d347089dd73bf1e30a47af21bacc314e601 name:Brain Drain (USA) (SGB Enhanced) cheat description:Clear level automatically code:22a5/28/18 cheat description:Clear level automatically - Race Mode code:2bf3/28/18 cartridge sha256:b164bafab4da7f92a33a2cdfce706b35407f3aa0ac379cd770fe2f78447bdf7a name:Bram Stoker's Dracula (USA, Europe) cheat description:Invincibility code:0672/19/00 cheat description:Infinite time code:2d50/ea/fa cheat description:Infinite ammo code:1121/ea/fa cartridge sha256:5ffda4ca9e2712e2ecc44e75bfd8c7307f4ed5fbcbb82a0f5cd9ad19e3bac6c2 name:Brave Saga - Shinshou Astaria (Japan) cheat description:No random battles code:42cf/c8/c9 cartridge sha256:c5ddbb08e8509633853346c5f35850cc3abe5afaabb0d0ee294b40e804253b7f name:Bubble Bobble (USA, Europe) cheat description:Hit anywhere code:1d22/08/00+1d29/38/18 cheat description:Hit anywhere - Bosses (except final boss) code:4c05/d0/00+4bfc/d0/00 cheat description:Get items from anywhere code:2c02/d0/00+2c0b/d0/00+2d56/d0/00+458f/21/37+2d5f/d0/37+4590/1d/c9 cheat description:One hit kill - final boss code:48b7/3d/af cartridge sha256:29f17b604be580c0132a6d0bd7a966c82930069ca82f83798c955d532c6b4694 name:Bubble Bobble Part 2 (USA, Europe) cheat description:Infinite hearts code:1bce/ea/fa cheat description:Defeat one enemy to go to next level code:5e33/3d/af cheat description:Hit anywhere code:25d5/04/11+24d8/d2/fa+24c7/da/fa cheat description:One hit kills - bosses code:24fb/38/18 cheat description:No big bubbles appear code:178a/03/c9 cheat description:Run into 1 enemy and you remain invincible for the rest of the game code:1558/ea/fa+1b46/ea/fa+1b63/ea/fa cheat description:Start with 1 heart code:155c/03/01 cheat description:Start with 6 hearts code:155c/03/06 cheat description:Start with 9 hearts code:155c/03/09 cheat description:Start on round 20 code:0839/fa/3e+083a/0d/13+083b/c1/00 cheat description:Start on round 40 code:0839/fa/3e+083a/0d/27+083b/c1/00 cheat description:Start on round 60 code:0839/fa/3e+083a/0d/3b+083b/c1/00 cartridge sha256:106d5443e092df3dc53035930766061f1ae4eae670470a93d648dc1adcda01c0 name:Bubble Ghost (USA, Europe) cheat description:Bubble is invincible code:24aa/3e/c9+2ddf/3e/c9+3653/3e/c9 cartridge sha256:6c8a53796be79a934f1393c668057cad38e857922cd552bc52fdf8f3ebdd2cc6 name:Bugs Bunny & Lola Bunny - Operation Carrots (Europe) (En,Fr,De,Es,It,Nl) cheat description:Stage skip (pause, press Select to skip to the next stage) code:7af5/13/00 cartridge sha256:a0bd5d25545de941e719437f7829f4edf32b3a140a399387f96dda2f8059fe4e name:Bugs Bunny Crazy Castle, The (USA, Europe) cheat description:Invincibility code:36cc/38/18 cheat description:Get carrots from anywhere (entire level) code:2ce2/09/00+2cdd/0e/00 cheat description:Get carrots from anywhere (horizontal position) code:2cdd/0e/00 cartridge sha256:cf1a8d9c9d4fc9e58740f6e008e5280ff2831c099aecab642e64e5195c0ad0bc name:Bugs Bunny Crazy Castle 2, The (USA) cheat description:Invincibility code:6289/ea/c9 cheat description:Infinite lives code:1600/3d/be cheat description:Get keys from anywhere (except from the ones inside of doors) code:5fd5/01/16+5fd4/28/18 cartridge sha256:89e43fdc94ec1d2a67aaab39d72afa50dd01df4323df7bf3d0909247cc490c24 name:Bugs Bunny - Crazy Castle 3 (USA, Europe) cheat description:Invincibility code:6197/c0/c9 cheat description:Get Keys from anywhere code:6069/33/00+606e/2e/00 cheat description:Open locked doors without having 8 Keys code:4c65/28/18 cheat description:Enter any door to clear level code:1ab6/07/05 cartridge sha256:e5abce2a219fe38e53d1a572d371008f3b6d70be4607c1722139a9ea95fa7422 name:Bug's Life, A (USA) (SGB Enhanced) cheat description:Invincibility (can still drown) code:10ee/fa/00 cheat description:Infinite lives code:262f/35/00 cartridge sha256:2f4254faaa4bda89486c4820c601917cd034c7965eae075ba81acef4295fa8bd name:BurgerTime Deluxe (World) cheat description:Invincibility code:2e98/36/c9 cheat description:Infinite lives code:15ca/d6/fe cheat description:Infinite weapon code:2b76/d6/fe cheat description:Touch Burgers from anywhere code:20c0/3a/00 cartridge sha256:2fbf14a5bffb070e183537c3ff4cd8e05626a94b3949785ed240b28642d0a259 name:Bust-A-Move Millennium (USA, Europe) cheat description:Hit one bubble to clear level - Challenge Mode code:433a/3d/af+42ee/ba/c2 cheat description:Hit one bubble to clear level - Puzzle Mode code:5469/28/18 cheat description:Win automatically - Story Mode code:45ab/0a/07+45aa/28/18+4593/04/06 cartridge sha256:2223993b7a91a5f2ccca1f43652df0062528e3fb37128f61a0ec8a779bcf65a1 name:Buster Bros. (USA) cheat description:Hit anywhere - main weapon code:2559/d1/5b+2531/d2/fa cartridge sha256:ce892641c500ddd0ccb804208556113ad4b9736f89cc94c6822f863508eb81f0 name:Buzz Lightyear of Star Command (USA, Europe) cheat description:Infinite health code:0164/cc/da cheat description:Always have five coins code:0105/cc/c8 cartridge sha256:f0b147eb3429b1b480424a31eb2d800b5676d01a701b494b2c9e9d2de63d31c5 name:Captain America and the Avengers (USA) cheat description:Infinite energy code:15cc/77/00 cheat description:Enemy bullets do very little damage code:7774/0c/01 cheat description:Enemy bullets do more damage code:7774/0c/19 cheat description:Enemy bullets do much more damage code:7774/0c/33 cheat description:Start with energy at 153 code:0a29/64/99 cheat description:Start with energy at 255 code:0a29/64/ff cheat description:Start with energy at 34 code:0a29/64/22 cheat description:Start with 1 lives code:01dd/03/01 cheat description:Start with 10 lives code:01dd/03/0a cheat description:Start on stage 1-2 code:03a8/1e/3e+03a9/00/01+03aa/f0/e0 cheat description:Start on stage 1-3 code:03a8/1e/3e+03a9/00/02+03aa/f0/e0 cheat description:Start on stage 1-4 code:03a8/1e/3e+03a9/00/03+03aa/f0/e0 cheat description:Start on stage 1-5 code:03a8/1e/3e+03a9/00/04+03aa/f0/e0 cheat description:Start on stage 1-6 code:03a8/1e/3e+03a9/00/05+03aa/f0/e0 cheat description:Start on stage 2-1 code:03a8/1e/3e+03a9/00/06+03aa/f0/e0 cheat description:Start on stage 2-2 code:03a8/1e/3e+03a9/00/07+03aa/f0/e0 cheat description:Start on stage 2-3 code:03a8/1e/3e+03a9/00/08+03aa/f0/e0 cheat description:Start on stage 2-4 code:03a8/1e/3e+03a9/00/09+03aa/f0/e0 cheat description:Start on stage 2-5 code:03a8/1e/3e+03a9/00/0a+03aa/f0/e0 cheat description:Start on stage 2-6 code:03a8/1e/3e+03a9/00/0b+03aa/f0/e0 cheat description:Start on stage 3-1 code:03a8/1e/3e+03a9/00/0c+03aa/f0/e0 cheat description:Start on stage 3-2 code:03a8/1e/3e+03a9/00/0d+03aa/f0/e0 cheat description:Start on stage 3-3 code:03a8/1e/3e+03a9/00/0e+03aa/f0/e0 cheat description:Start on stage 3-4 code:03a8/1e/3e+03a9/00/0f+03aa/f0/e0 cheat description:Start on stage 3-5 code:03a8/1e/3e+03a9/00/10+03aa/f0/e0 cheat description:Start on stage 4-1 code:03a8/1e/3e+03a9/00/11+03aa/f0/e0 cheat description:Start on stage 4-2 code:03a8/1e/3e+03a9/00/12+03aa/f0/e0 cheat description:Start on stage 4-3 code:03a8/1e/3e+03a9/00/13+03aa/f0/e0 cheat description:Start on stage 4-4 code:03a8/1e/3e+03a9/00/14+03aa/f0/e0 cheat description:Start on stage 4-5 code:03a8/1e/3e+03a9/00/15+03aa/f0/e0 cheat description:Start on stage 4-6 code:03a8/1e/3e+03a9/00/16+03aa/f0/e0 cheat description:Start on stage 5-1 code:03a8/1e/3e+03a9/00/17+03aa/f0/e0 cheat description:Start on stage 5-2 code:03a8/1e/3e+03a9/00/18+03aa/f0/e0 cheat description:Start on stage 5-3 code:03a8/1e/3e+03a9/00/19+03aa/f0/e0 cheat description:Start on stage 5-4 code:03a8/1e/3e+03a9/00/1a+03aa/f0/e0 cheat description:Start on stage 5-5 code:03a8/1e/3e+03a9/00/1b+03aa/f0/e0 cheat description:Start on stage 5-6 code:03a8/1e/3e+03a9/00/1c+03aa/f0/e0 cartridge sha256:1ff537c010391d6b865b5113d03a9c6601e43659f341f5db2bfc5cc501b6aa04 name:Casper (USA) cheat description:Infinite Brass Keys code:0163/c1/a9 cheat description:Infinite Iron Keys code:0163/c1/a8 cheat description:Infinite Weights code:0163/c1/ab cartridge sha256:1bedb523a9612d48adafe8d70c88408f35e1fc84d0e70031649f3d113d5d9d09 name:Casper (USA) cheat description:Return Books from anywhere code:66b2/c0/00 cheat description:Invincibility - Platform mini-game code:5d5f/30/18 cheat description:Hit anywhere - Shooting mini-game code:5701/dc/cd cartridge sha256:17570ceec1b22153604622c4412d048dd8f7ccb4626daf9ddea96de8a062dbf2 name:Castlevania II - Belmont's Revenge (USA, Europe) cheat description:Invincibility code:4586/fa/ea cheat description:Hit anywhere code:3936/09/00 cheat description:Multi-jump code:4294/02/87+4295/c0/c8+4296/3d/e6+4297/ca/10+4298/d4/20+4299/43/15+0d47/d8/c9 cartridge sha256:edb101e924f22149bdcbcfe6603801fdb4ec0139a40493d700fa0205f6dab30c name:Castlevania - The Adventure (USA) cheat description:Infinite energy code:7af2/77/00 cheat description:Infinite time - disable at end of stages code:0407/77/00 cheat description:Infinite lives code:0694/77/00 cheat description:Hit anywhere code:2261/12/00+2271/02/00 cheat description:Multi-jump code:17e3/18/00+00eb/ff/18+00e8/ff/1a+00ea/ff/23+00e7/ff/32+00ec/ff/c9+00e6/ff/cd+00e9/ff/cd+17e2/23/e6 cheat description:Slightly improves speed - new games only code:173c/c0/ff cheat description:Don't lose weapon after being hit code:7acf/77/00 cheat description:Start with 5 lives code:085e/02/04 cheat description:Start with 7 lives code:085e/02/06 cheat description:Start with 2 energy bars code:055c/0a/02 cheat description:Start with 4 energy bars code:055c/0a/04 cheat description:Start with 6 energy bars code:055c/0a/06 cheat description:Start with timer at 2:15 for first stage code:09b3/13/02 cheat description:Start with timer at 4:15 for first stage code:09b3/13/04 cheat description:Start with timer at 7:15 for first stage code:09b3/13/07 cartridge sha256:56d3dee063b8801704a284bd1bc229b94f15a3a448f485d347f04283d9bd16d7 name:Castlevania Legends (USA, Europe) (SGB Enhanced) cheat description:Invincibility code:573b/cb/c9 cheat description:Infinite lives code:4345/ea/da cheat description:Infinite time code:2d85/22/c9 cheat description:Disable death traps code:545c/cd/c9 cheat description:Fast walk left code:4c9d/c5/11 cheat description:Fast walk right code:4c76/c5/11 cheat description:Fast jump left code:52d6/c5/11 cheat description:Fast jump right code:52b5/c5/11 cheat description:Hit anywhere code:2349/5a/4b+545c/cd/c9 cheat description:Multi-jump code:5733/37/03+5732/fa/28+5736/02/51+572e/18/55+5735/fe/59+5731/c0/67+5737/c8/c9+1fe4/d0/c9+5730/b7/cb+5734/c7/cd+5170/ea/fa cartridge sha256:7e483524aa104928149e4e56f01b7e98c6eed70dcd30ac5d65cd9d2387cde5ff name:Chessmaster, The (USA) cheat description:Move pieces anywhere code:19d8/28/18+1a12/28/18+1a00/d9/00 cartridge sha256:0a44d1f127436d73fc2f64201da0e0fd40793a414e533bba0a08e02dfb51cb10 name:Chessmaster, The (USA) (Rev A) cheat description:Move pieces anywhere code:1ab6/28/18+1af8/28/18+1ae6/d1/00 cartridge sha256:781b31deb923c544b42b2116d973a103fd5c21b3cf25e920968ef392a5df917b name:Chessmaster (USA, Europe) cheat description:Move pieces anywhere code:2783/d1/00+2795/28/18+2753/28/18 cartridge sha256:50a6ddd98a515f530ca031f86e5491c8d77d16b0694c0d1054bcc964991eba41 name:Chicken Run (USA, Europe) (En,Fr,De,Es,It) cheat description:Invisibility code:16cd/c0/c9 cheat description:Infinite Feed code:1bfb/20/18 cheat description:Infinite Time code:4495/c0/c9 cheat description:Walk through walls code:1b02/02/00 cheat description:Stage skip (pause, press Select to skip to the next stage) code:60f7/20/18 cartridge sha256:2eb1ab19a19e688ebc047497922b17218da3cb673084846999bd81a4dd73eba4 name:Chiki Chiki Tengoku (Japan) cheat description:Clear level automatically code:3afe/30/3e+3b17/03/00+3b0a/20/3e cartridge sha256:53199f624a81f566104c143b835ca648ee9bbccc2c10efa21a3f4b3f5b5e7ea7 name:College Slam (USA) cheat description:Dunk and layup from anywhere code:6c09/13/00 cartridge sha256:d8e44a2c2aa67f9afa49365f62802160842aef48d2003a69daeb109813f6f20c name:Contra - The Alien Wars (USA) (SGB Enhanced) cheat description:Invincibility code:4b81/28/3e cheat description:Infinite smart bombs code:37e2/3d/00 cheat description:Hit anywhere code:1377/55/00+137c/50/00+1382/4a/00+1387/45/00+13c3/36/00 cheat description:Get 5 smart bombs after you die code:42b1/01/05 cheat description:Get 9 smart bombs after you die code:42b1/01/09 cheat description:Don't flash after getting hit code:406f/64/01 cheat description:Longer invincibility after getting hit code:406f/64/ff cheat description:Start with Flame Thrower code:4797/00/01 cheat description:Start with Crush Gun code:4797/00/07 cheat description:Start with Homing shot code:4797/00/08 cheat description:Start with Spread shot code:4797/00/09 cartridge sha256:8e765a4e381462a29632b7a3c5421080be3e8445e5913d7e904a8e80d688ca81 name:Contra (Japan) cheat description:Invincibility code:3b3a/fe/be+3aa3/fe/be+1a0f/fe/be cheat description:Hit anywhere code:3ad0/1c/00+3aea/dc/c3+3afb/fe/c6 cheat description:Multi-jump code:558c/55/00+00e6/ff/26+00e9/ff/46+00e7/ff/52+00ea/ff/55+00eb/ff/c9+00e5/ff/cd+00e8/ff/cd+558b/46/e5 cartridge sha256:830e46d203dee9775b76849a3aa259b530e6bf5ea17cf8c79cc19549d61bce37 name:Cool Ball (USA) cheat description:All items worth 99 code:0c66/fe/3e+0c67/64/63 cheat description:Complete levels automatically code:1393/38/18+13ad/20/3e cartridge sha256:aa993ef6fd692435f869c63add9d49bf08db6fc8d6ee7baa9b406982d7b38c7c name:Cool Bricks (Europe) (En,Fr,De,Es,It) cheat description:Paddle hits ball anywhere code:1858/2b/00+1855/2e/00 cartridge sha256:805c18920e01f4b5746827c201e9a88554f085a8c297ed45f119700fe54da52e name:Cool Spot (USA) cheat description:Hit anywhere code:1bd8/49/00+1867/d2/fa cartridge sha256:e0dafd8b66cc6c19c3b64471d198e1dc87f3e5e1000c4fd8d71122a004fea5ae name:Cosmo Tank (USA) cheat description:Invincibility code:599f/38/18 cheat description:Hit anywhere code:4d4f/12/00 cartridge sha256:5437ce255372eca79a5e33cfca4158e70c7a9d46fd93c6a38ed1e1a13cab4b73 name:Croc (USA, Europe) cheat description:Invincibility code:6114/c0/c9 cheat description:Enemies die on contact code:5bd9/28/18 cartridge sha256:002ad8e22b4d846d3185c2e42af284dcb5f9b040bb174c9b5e9670de4df79278 name:Croc 2 (USA, Europe) cheat description:Invincibility code:55c9/c0/c9+5595/c0/c9 cheat description:Enemies die on contact code:5580/20/18 cheat description:Walk over pits code:4731/fa/c9 cartridge sha256:3c86f30b11442c93b011287310dfea0a9c23a182527d8447769226e52ef29d5e name:Crystal Quest (USA) cheat description:Invincibility (allows you to exit the level at anytime) code:1000/c8/c9+0d79/30/18 cheat description:Hit anywhere code:08b9/77/00+0863/30/3e cartridge sha256:d5a1c0e7af970859449c47fcc80a5f4dfa4f456b20fdfcd49e753ce46f2dc3da name:Cyraid (USA) cheat description:Infinite lives code:4d8c/01/00 cheat description:1st nasty on bottom level of stage 1 is removed from the game code:6072/01/00 cheat description:Collect only 1 energy capsule and all enemy robots are destroyed-can proceed to next room code:1a4e/3d/af cheat description:Skip to 3rd room after completing 1st code:0e8a/28/3e+0e8b/05/03 cheat description:Skip to 5rd room after completing 1st code:0e8a/28/3e+0e8b/05/05 cheat description:Skip to 8rd room after completing 1st code:0e8a/28/3e+0e8b/05/08 cheat description:Start with 4 lives code:1e7c/05/04 cheat description:Start with 6 lives code:1e7c/05/06 cheat description:Start with 9 lives code:1e7c/05/09 cartridge sha256:06d2f49483cf16f00580ba227d86174fdb9f72e555d9a9afea6aebcbfff012e4 name:Daedalian Opus (USA) cheat description:Infinite time code:2d62/34/00 cheat description:Place any piece to clear level code:1115/d0/1b cheat description:Get password to select any level after completing level 1 code:019a/fe/3e+019b/24/0a cheat description:Start on level 5 or 6 after completing level 1 code:019c/30/3e+019d/05/05 cartridge sha256:30faf530573519d690d066093e9fae3b461d79df37c025a9ec9115f5fc5786e4 name:Daffy Duck (USA) cheat description:Infinite jet pack code:3401/3c/af cheat description:Infinite jet pack + hit anywhere code:3401/3c/af+3df2/c2/c3+3dd5/20/18+3deb/da/fa+3eb2/da/fa cartridge sha256:e4a40a4c961f937950a69da5a9de654a121ebffe307d3ad9e834731b68d4e347 name:Daikatana (Europe) (En,Fr,It) cheat description:Invincibilities against enemies code:522b/da/c3 cheat description:Infinite ammo - sub-weapons code:6a3b/ea/fa cheat description:Hit anywhere code:52d5/da/18+52d6/72/1e cheat description:Hit anywhere - sub-weapons code:4f04/c5/29+4f03/da/18 cheat description:Get items from anywhere code:6f18/da/18+6f19/b3/20 cheat description:Multi-jump code:6b7c/51/00 cartridge sha256:b482f9a96a292dea1fcc94bdeae24b664a3222c9eb820795388aab274eebdaf0 name:Darkman (USA, Europe) cheat description:Infinite energy code:050f/fa/ba cheat description:Infinite lives code:04dd/c0/01 cheat description:Infinite time code:0597/01/00 cheat description:Start 1st life with mega-energy code:3f91/1c/63 cheat description:Start 1st life with 1/2 energy code:3f91/1c/0a cheat description:Start rest of lives with mega-energy code:2640/1c/63 cheat description:Start with 9 minutes code:59ac/40/90 cheat description:Start with 1 life code:024d/03/00 cheat description:Start with 8 lives code:024d/03/07 cartridge sha256:122a1d3bd99c87a337f770fbdef2b7cf8538673df1595585af6684d4d4807614 name:Darkwing Duck (USA) cheat description:Infinite lives code:0a0b/c9/01 cheat description:Infinite ammo on pick-up code:7d39/ea/fa cheat description:Hit anywhere code:40ce/30/3e cheat description:One hit kills code:4102/28/18 cheat description:Invincibility time lasts 4 seconds code:4064/50/aa cheat description:Invincibility time lasts 6 seconds code:4064/50/ff cheat description:1 touch by an enemy kills you code:406f/50/01 cheat description:Start with 1 pt. of energy and 1 life - 1st game code:0184/04/01 cheat description:Start with 5 pts. of energy on 1st life and 5 lives - 1st game code:0184/04/05 cheat description:Start with 9 pts. of energy on 1st life and 9 lives - 1st game code:0184/04/09 cheat description:Start with 1 pt. of energy after 1st life code:09f0/04/01 cheat description:Start with 5 pts. of energy after 1st life code:09f0/04/05 cheat description:Start with 9 pts. of energy after 1st life code:09f0/04/09 cartridge sha256:61d632a2e17526cc55cc8e107abaf9aa11830cd4dd94c0b0f94d10a12a0c9f71 name:David Crane's The Rescue of Princess Blobette Starring A Boy and His Blob (USA) cheat description:Infinite jellybeans code:2056/01/00 cheat description:Infinite lives code:2d4f/35/00 cheat description:Start with 2 honeys code:7c0e/03/02 cheat description:Start with 4 honeys code:7c0e/03/04 cheat description:Start with 8 honeys code:7c0e/03/08 cheat description:Start with 2 root beers code:7c0c/00/02 cheat description:Start with 4 root beers code:7c0c/00/04 cheat description:Start with 2 tangerines code:7c0a/06/02 cheat description:Start with 4 tangerines code:7c0a/06/04 cheat description:Start with 2 vanillas code:7c08/05/02 cheat description:Start with 4 vanillas code:7c08/05/04 cheat description:Start with 2 limes code:7c06/00/02 cheat description:Start with 4 limes code:7c06/00/04 cheat description:Start with 2 apples code:7c04/01/02 cheat description:Start with 4 apples code:7c04/01/04 cheat description:Start with 2 bananas code:7c02/00/02 cheat description:Start with 4 bananas code:7c02/00/04 cheat description:Start with 2 colas code:7c00/00/02 cheat description:Start with 4 colas code:7c00/00/04 cheat description:Start with 2 coconuts code:7bfe/03/02 cheat description:Start with 4 coconuts code:7bfe/03/04 cheat description:Start with 2 strawberries code:7bfc/00/02 cheat description:Start with 4 strawberries code:7bfc/00/04 cheat description:Start with 2 licorices code:7bfa/02/02 cheat description:Start with 4 licorices code:7bfa/02/04 cheat description:Start with 2 ketchups code:7c10/01/02 cheat description:Start with 4 ketchups code:7c10/01/04 cheat description:Start with 2 punches code:7c12/00/02 cheat description:Start with 4 punches code:7c12/00/04 cheat description:Start with 2 mints code:7c14/00/02 cheat description:Start with 4 mints code:7c14/00/04 cheat description:Start with 2 lives code:7bca/05/02 cheat description:Start with 4 lives code:7bca/05/04 cheat description:Start with 8 lives code:7bca/05/08 cartridge sha256:1a62bbcaff8d12b752826472beac346e5fce9d8640f7ae23c6e390b79e55346d name:Days of Thunder (USA, Europe) cheat description:Infinite time in pits code:6e7b/ea/fa cheat description:Infinite fuel code:7294/72/00 cheat description:Car takes no damage code:169c/77/00 cheat description:Tires take no damage code:272f/34/c9 cartridge sha256:d534102be843dc15a465709164e09e82c6bdf6df2ac440930af2e34c2f0e01ce name:Dead Heat Scramble (USA) cheat description:Infinite time code:0405/3d/00 cheat description:Start on stage 2 code:7b0c/01/02 cheat description:Start on stage 3 code:7b0c/01/03 cheat description:Start on stage 4 code:7b0c/01/04 cheat description:Start on stage 5 code:7b0c/01/05 cheat description:Start on stage 6 code:7b0c/01/06 cheat description:Start on stage 7 code:7b0c/01/07 cheat description:Start on stage 8 code:7b0c/01/08 cheat description:Start on stage 9 code:7b0c/01/09 cheat description:Start on stage 10 code:7b0c/01/0a cartridge sha256:a089bea1d6eec0e99f03276744aea293fe3fe3a2889791ab8f3a00b83e2cf58b name:Deer Hunter (USA) cheat description:Infinite time code:041f/3c/00 cartridge sha256:2d8fb80ece07198260fb47b6a2e8d0097e2d6ca27fb21bc3c439f90d7880317d name:Dig Dug (USA) cheat description:Invincibility code:23c1/ea/fa cheat description:Infinite lives code:481b/3d/00 cheat description:When Pookas are partially inflated, they don't shrink code:3450/35/00 cheat description:1 pump kills monster instantly code:36d9/01/04+239e/01/04+478e/01/04 cheat description:Start with 6 lives code:5bac/03/06 cheat description:Start with 9 lives code:5bac/03/09 cheat description:Start with 2 lives code:5bac/03/02 cheat description:Start on level 4 (display still says level 1) code:5cd9/38/3e+5cda/02/04 cheat description:Start on level 2 (display still says level 1) code:5cd9/38/3e+5cda/02/02 cheat description:Start on level 9 (display still says level 1) code:23ec/1c/00+5cda/02/09 cartridge sha256:0ee26b1a12c91560ab852510a792b13d7391c2fcebf4c0c0a1d8323194eb473a name:Donald Duck - Goin' Quackers (USA) (En,Fr,De,Es,It) cheat description:Get blue items from anywhere code:74a2/28/3e cartridge sha256:2781f6b1014336e3318073f162cadd970329c8148fc62b5e795441cd6fd57051 name:Donkey Kong (Japan) (En) (SGB Enhanced) cheat description:Infinite lives code:094d/35/00 cheat description:Infinite time code:0c34/01/00 cheat description:Timer is 2x faster code:0c34/01/02 cheat description:Practice stage XX - level indicator doesn't work, can't go on to next level code:24f3/fa/3e+f000/ba/00+24f5/c8/00 cheat description:Start with 36 lives code:0264/04/88 cartridge sha256:b490c89efe718633b07381def66ce0ed58a5075aabe40c6e644baf2b408a76f4 name:Donkey Kong (World) (Rev A) (SGB Enhanced) cheat description:Invincibility code:53b4/36/c9+544d/72/c9+5546/36/c9 cheat description:Invincibility (alt) code:51f5/c2/fa cartridge sha256:eaf831ddd75e7cbc9990e478a139ac162034c03377670fdb79615a9aa2cc570d name:Donkey Kong Land (USA, Europe) (SGB Enhanced) cheat description:Invincibility code:4081/28/3e cheat description:Infinite lives code:4d9d/35/00+4da0/c2/21 cheat description:Multi-jump code:55b5/0d/00+55aa/0c/01+55ac/17/1f+55b1/c6/29+55b2/fe/2d+55ad/38/30+55b3/06/36+55b0/0b/bd+55ab/c6/ca+55af/fa/cd+55b4/30/f6 cheat description:Always save game at end of level, regardless if you have KONG letters or not code:40cb/ca/c3 cheat description:Lose all your lives when you die code:4da0/c2/c3 cheat description:If you get hit you don't change characters until you are back at the map screen code:4dfd/ea/c9 cheat description:Each banana gives you mega lives (disable when you have enough lives) code:44c6/35/00+44c0/36/3e cheat description:Change soundtrack code:421f/35/00 cheat description:Start with 1 life code:6e89/05/00+7e95/05/00 cheat description:Start with 9 lives code:6e89/05/08+7e95/05/08 cheat description:Start with 15 lives code:6e89/05/0e+7e95/05/0e cheat description:Start with 99 lives code:6e89/05/63+7e95/05/63 cartridge sha256:75f902ab8674c3cd379438fbd54cfe7e87ca3ddf9727679547261d1b77db720b name:Double Dragon (USA, Europe) cheat description:Infinite health code:012f/c4/98 cheat description:Infinite lives code:0104/c4/99 cheat description:Hit anywhere code:6e97/21/18+6e98/84/4c cheat description:One hit kills (bosses die after three hits) code:6ada/28/00+6b62/04/00 cheat description:Start on Mission 1 (slum) (disable code to advance to next stage) code:0100/c6/50 cheat description:Start on Mission 1 (area with boxes) (disable code to advance to next stage) code:0101/c6/50 cheat description:Start on Mission 1 (boss) (disable code to advance to next stage) code:0102/c6/50 cheat description:Start on Mission 2 (disable code to advance to next stage) code:0103/c6/50 cheat description:Start on Mission 3 (woods) (disable code to advance to next stage) code:0104/c6/50 cheat description:Start on Mission 3 (cave) (disable code to advance to next stage) code:0105/c6/50 cheat description:Start on Mission 4 (outside enemy's base) (disable code to advance to next stage) code:0106/c6/50 cheat description:Start on Mission 4 (enemy's base) (disable code to advance to next stage) code:0107/c6/50 cheat description:Start on Ending (disable code to advance to next stage) code:0108/c6/50 cartridge sha256:21639689078496d4c2d000b120d493b69e7df603e5c2b5cd337974665e597878 name:Double Dragon II (USA, Europe) cheat description:Invincibility code:34e6/21/c9 cheat description:Hit anywhere code:339f/fa/18+33a0/50/23 cheat description:One hit kills code:56f2/0d/00+5772/0c/00+57a3/04/00+56f4/04/01 cartridge sha256:ba60449b8e57d1288e78a2cb69c6df46e1443cc611d139d27f4c5d5fad307fd3 name:Double Dragon 3 - The Arcade Game (USA, Europe) cheat description:Infinite lives code:700e/3d/00 cheat description:Infinite coins code:0f1b/01/00 cheat description:Start with 4 lives code:009f/06/03 cheat description:Start with 10 lives code:009f/06/09 cheat description:Start with 13 lives code:009f/06/0c cheat description:Start with 5 coins code:7949/01/04 cheat description:Start with 10 coins code:7949/01/09 cheat description:Start with 20 coins code:7949/01/19 cheat description:Start 1st life with 5 energy points code:0097/bf/50 cheat description:Start 1st life with 15 energy points code:0097/bf/f0 cheat description:Start with 5 points of energy - after 1st life code:7013/bf/50 cheat description:Start with 15 points of energy - after 1st life code:7013/bf/f0 cartridge sha256:936df4d0f74620c784129259a22fc3216eea04f70c10cab6005457a0f681e313 name:Double Dribble - 5 on 5 (USA) cheat description:Infinite time code:0b8c/01/00 cheat description:No computer scoring code:0d64/22/00 cheat description:Game lasts only 1 quarter, goes straight to 4th quarter code:0ce2/01/04 cheat description:When selecting skill level, keep pressing down. Bleeping will continue, and computer will become more and more skillful. code:1a0b/03/ff cartridge sha256:15fecc6e3d9f72e9cf3f5af7c1f034cc94a2007d29ea0a204976adcc0ff9a52e name:Dragon's Lair - The Legend (USA) cheat description:Have all Life Stones code:0101/c3/43+0109/c3/44+0104/c3/45 cartridge sha256:8dab48cc81d14bcee7c73274df09cf5c4dd44c3b93d10a5a3175e04fead25dee name:Dragon Ball Z - Legendary Super Warriors (USA) cheat description:Opponent doesn't attack code:68fc/fa/c9 cartridge sha256:34f11935cb3c23102462aab9d96c09e25b81b35eef91f5e5456b2c3665734f0e name:Dragon Warrior III (USA) cheat description:Enemies only attack themselves code:5add/14/04+5adc/28/f6 cheat description:Quick level gain code:457f/2a/01+4580/46/ff+4581/4f/ff cheat description:HP set to approx 198 every move code:5f5e/79/7c cartridge sha256:64d791cadae2500ddd7dfd3ebedc48a182fdc0e027f9bfd74c8ff65b56371dbf name:Druaga no Tou (Japan) cheat description:Reset to see ending code:016f/08 cartridge sha256:4d754abe2502f79396790f04963468f5c614eb4768e2b3f9b5c79c8e28b55dcb name:Elevator Action EX (Europe) (En,Fr,De,Es,It) cheat description:Invincibility code:5ee8/38/18+59fa/c2/c3 cheat description:Hit anywhere code:4c83/28/3e+4bc7/28/3e cheat description:Don't get crushed by elevators code:5eaf/28/18+472d/28/18 cartridge sha256:9eee3454a1198c01c7adb9562507f2eb5791888c63885bea2e933948f66f6321 name:Extra Bases! (USA) cheat description:Outs aren't counted code:100b/34/00 cheat description:Strikes aren't counted code:407a/34/00 cheat description:Balls aren't counted code:408b/34/00 cheat description:Opponents can't score (disable when you're batting so you can score) code:5b91/3c/00 cheat description:One strike and you're out code:0fd6/03/01 cheat description:2 strikes and you're out code:0fd6/03/02 cheat description:1 out and side is retired code:0ff0/03/01 cheat description:2 outs and side is retired code:0ff0/03/02 cheat description:1 ball and you walk code:0fc0/04/01 cheat description:2 balls and you walk code:0fc0/04/02 cartridge sha256:571e45610cae528b3c50304c42c946f307d71797fc2029e9ca1978045dd5186d name:F-15 Strike Eagle (USA, Europe) cheat description:Infinite bullets code:2a52/ea/fa cheat description:Infinite sidewinders code:08ee/ea/fa cheat description:Infinite mavericks code:08ab/ea/fa cheat description:Infinite E.C.M. code:085b/ea/fa cheat description:Fly very slowly code:33bc/02/01 cheat description:Fly at supersonic speed code:33bc/02/09 cheat description:Start with 10 sidewinders code:3388/1e/0a cheat description:Start with 50 sidewinders code:3388/1e/32 cheat description:Start with 90 sidewinders code:3388/1e/5a cheat description:Start with 10 mavericks code:338d/0f/0a cheat description:Start with 50 mavericks code:338d/0f/32 cheat description:Start with 90 mavericks code:338d/0f/5a cheat description:Start with 10 E.C.M. code:3392/18/0a cheat description:Start with 50 E.C.M. code:3392/18/32 cheat description:Start with 90 E.C.M. code:3392/18/5a cheat description:Start with 513 bullets code:339b/03/02+339a/20/01 cheat description:Start with 2049 bullets code:339b/03/08+339a/20/01 cheat description:Start with 4097 bullets code:339b/03/10+339a/20/01 cartridge sha256:ece080d17963acfb7f9b2c28272881edd2a17bc93fcd65bb649810b5e8ed513a name:Fastest Lap (Japan, USA) cheat description:Quick laps code:1fd8/da/fa+1fd1/d2/fa cartridge sha256:db506cb639b6336bf17c993c597da3990398ec01e235e0d9236e9df87ab0439e name:Ferrari Grand Prix Challenge (USA, Europe) cheat description:Don't lose speed when touching side of track in qualifying round or race. Hitting sign will slow you down (if you accelerate fully, release A and position car in middle of track, it will steer itself). code:3458/3d/00 cheat description:When you crash with another car, your speed won't drop to 0 code:3022/c8/00 cheat description:No qualifying timer code:4a39/01/00+4a1a/01/00 cartridge sha256:9b72e7d44d1cb31a06cf4e630c83abc61fb7218e3d55d7dc6aa1ecbf9e490cf0 name:Fighting Simulator 2 in 1 (USA, Europe) cheat description:Infinite energy code:173c/3c/3d cheat description:Infinite lives code:18d7/3d/00 cheat description:Start with 5 lives code:1724/03/05 cheat description:Start with 9 lives code:1724/03/09 cheat description:Start with 15 lives code:1724/03/0f cartridge sha256:5a462f1bbb4e75823c04c7a0b2a7497cbe7e709a425854c71c1fc4d60f16f445 name:Final Fantasy Adventure (USA) cheat description:Most items are free code:5606/01/40 cheat description:Start with 255 of each ability code:6e6b/02/ff cheat description:Start with 65,330 GP code:6ecc/ff cartridge sha256:e5b1d116a8fb01b7a7213f906b3ef1bcc91a18f6826b01ee1bccd89429a0d906 name:Final Fantasy Legend, The (USA) cheat description:Human male - Start with 1 strength point code:7123/08/01 cheat description:Human male - 5 strength points code:7123/08/05 cheat description:Human male - 2 defense points code:7124/01/02 cheat description:Human male - 6 defense points code:7124/01/06 cheat description:Human male - 3 agility points code:7125/04/03 cheat description:Human male - 7 agility points code:7125/04/07 cheat description:Human male - 4 mana points code:7126/00/04 cheat description:Human male - 8 mana points code:7126/00/08 cheat description:Human male - 1 HP code:7258/3c/01 cheat description:Human male - Start with 5 HP code:7258/3c/05 cartridge sha256:2d89231f9e264a024d634bcf7d00de5a66d8a45f6f4ca33e1fc1602a35b9840b name:Final Fantasy Legend II (USA) cheat description:Infinite HP (don't heal or stay and Inn) code:4064/11/b9 cheat description:0 HP - enemies code:448c/7c/af+4489/7d/af cheat description:Infinite item usage code:5d28/35/00+41f0/12/00 cheat description:Items are free code:655b/30/00+655c/cd/fa cheat description:Get extra GP and Meat code:4d23/30/c9 cheat description:Get tons of GP after every battle code:4d23/30/00 cheat description:Engage in a fight every second code:2fc5/35/37 cheat description:Start with 15,163 HP (shows only 999) - All characters code:0596/78/00+059c/78/00 cheat description:Start with 9 HP code:78e2/3b/09 cheat description:Start with 9 defense points code:78e6/03/09 cheat description:Start with 9 mana points code:78e7/03/09 cheat description:Start with 9 agility points code:78e5/05/09 cheat description:Start with 9 strength points code:78e4/06/09 cheat description:Start with 9 swords (if your character can start with swords) code:7e81/32/09 cartridge sha256:5ed87f65225b72a74c3c04a4e5d67683fb5cc33e5f1266157350828ab973fc1d name:Final Fantasy Legend III (USA) cheat description:Set initial power to mega-power code:7a92/00/ff+7891/32/ff+7893/32/ff cheat description:Always strike first code:6aa0/76/ff cheat description:Able to run from every battle, even bosses code:4ab4/52/ff cheat description:Gain extra EXP and GP code:57ca/37/d7 cheat description:Defeating leftmost or upper-left enemy defeats all enemies on screen code:54ca/37/02 cheat description:Gain a level after every battle on a new game - Character 1 (Hero - Arthur) code:7a87/01/ff cheat description:Gain a level after every battle on a new game - Character 2 (Boy - Curtis) code:7ae7/01/ff cheat description:Gain a level after every battle on a new game - Character 3 (Girl - Gloria) code:7b47/00/ff cheat description:Gain a level after every battle on a new game - Character 4 (Heroine - Sharon) code:7ba7/00/ff cartridge sha256:8327ed0d686d223995f86c267eeaf5f450c0d16a9bf9b6925dcb52cd1481f0e1 name:Fish Dude (USA) cheat description:Infinite lives code:02a8/35/00 cheat description:No timer code:0525/fa/21 cheat description:Start with 1 life code:023d/02/00 cheat description:Start with 5 lives code:023d/02/04 cheat description:Start with 9 lives code:023d/02/08 cheat description:Start with 15 lives (ignore counter for first 5 lives) code:023d/02/0e cartridge sha256:da62ce2133b788e88605fad8f8d15582457d2a08de88124f231ef943ffba8805 name:Fist of the North Star (USA) cheat description:Almost invincible code:0e9f/ea/21 cheat description:No energy loss from weapons thrown code:0fa5/ea/21 cheat description:Hit anywhere - both players code:10d0/06/00+10d5/30/18 cheat description:One hit kills code:0e10/09/00 cheat description:Start on level 5 code:1bcc/01/05 cheat description:Start on level 9 code:1bcc/01/09 cheat description:Start with 25% energy code:1ff7/ff/40 cheat description:Start with 50% energy code:14f7/ff/7f cheat description:Start with 75% energy code:14f7/ff/c4 cartridge sha256:eededd0318cc5b80a2aa019a9a7eb3dfb9cb9ac11d974d24d704d7d4cf771a94 name:Flash, The (USA, Europe) cheat description:Infinite energy (except against exploding bombs) code:0a85/c1/00 cheat description:Infinite lives code:03a8/c0/00 cheat description:Infinite time (disable at end of each stage) code:3db6/35/00 cheat description:Start with 1 life code:059c/03/01 cheat description:Start with 6 lives code:059c/03/06 cheat description:Start with 1/2 surge power code:05a1/8f/4c cheat description:Start with 1/2 energy code:05a6/48/24 cartridge sha256:23fe1e88229645354f665908eb0dcd39cd8f3fbbeebec4bd93d11f7740a478e4 name:Flipull (USA) cheat description:Any block can clear an entire row or column code:22df/20/3e+2177/20/3e cartridge sha256:44bd5dd98b6ca3730435197d5af7f4fb6fa0f86fecf9b74005d5a76c28870f88 name:Foreman for Real (USA, Europe) cheat description:Enable everyone for tournament mode code:0c9b/01/00+0ca0/0f/13 cartridge sha256:06643cffc888b1c0c80ccae3cef66babb9b878ee594c29de8c9216bddd48287f name:Fortified Zone (USA, Europe) cheat description:Hit anywhere code:6317/fe/18+6318/ff/14 cartridge sha256:f07e6f63023d997a83066b422024242d6a7b61cee1af0c1fc41e6fbf4b54b65b name:Frogger (USA) cheat description:Invincibility code:0d14/ea/fa+0a7f/ea/fa cheat description:Infinite lives code:0b6d/ea/fa cheat description:Infinite time code:0e84/77/00 cartridge sha256:1f60f516020ef685d353dcbff810e4d93d09a4bcf6f6e87803768ea776c85929 name:Frogger (USA) cheat description:Invincibility code:0d12/3e/c9+0a7b/20/18 cheat description:Infinite time code:0e71/c0/c9 cartridge sha256:8c144ddebdc63631949ba0f946ae4a745be4aaf1082736676cb1af61887ab7a2 name:Frogger 2 (USA) cheat description:Invincibility code:0e5f/3e/c9+0e3d/3e/c9 cheat description:Infinite time code:036d/34/00 cartridge sha256:d96da0c0c17a164c398b2d5b02cbe92e7eafbfa755fee649d159b46e61814dc6 name:Galaga - Destination Earth (USA) cheat description:Invincibility code:51b2/28/18+764c/30/18 cheat description:Hit anywhere code:5a5a/d2/fa+5a8b/d2/fa+5a71/da/fa cartridge sha256:af4fda51b28e426f6cab8b48037cf2cbc18ad6c1f02311ad901365aa52c918b7 name:Ganso!! Yancha Maru (Japan) cheat description:Invincibility (the second code kills enemies on contact) code:4776/07/00+477b/01/00 cheat description:Infinite Shurikens on pick-up code:0b8d/03/01 cheat description:999 coins on pick-up code:0c5f/d0/00 cheat description:Infinite time code:0bb9/77/00 cartridge sha256:ad6f9fe97a40418279d3b834a64d9c6c52c0da209f430718f2bd02611892326f name:Gargoyle's Quest (USA, Europe) cheat description:Invincibility code:6e17/c8/c9 cheat description:Hit anywhere code:7bb0/30/3e+7ba6/30/3e cartridge sha256:b7774eb039d335d8870b28e05ff7bc0869c46d0accc0d7f467affd71bbae8871 name:Gauntlet II (USA, Europe) cheat description:Invincibility code:432d/d2/c3 cartridge sha256:4bbf52ae46599bed5e08c6ea97f05220a4a5244f35519003d9b66e9d77328fe1 name:Gekitou Power Modeller (Japan) (SGB Enhanced) cheat description:Invincibility against normal attacks - P1 code:790e/28/18 cheat description:Hit anywhere code:7878/7e/0b+7874/ae/84 cartridge sha256:78d35816612a521315e0b0618886e4b9e1005c58e459248c7e7585d8c04e71ac name:George Foreman's KO Boxing (USA, Europe) cheat description:Infinite health (display still decreases) code:19cb/28/3e cheat description:Infinite time code:1189/01/00 cheat description:Infinite super punch code:17ee/38/3e cartridge sha256:ca9d168e068492644cf054a2e35f0bccc31af5899e54c05a2cbc740247014a51 name:Gex - Enter the Gecko (USA, Europe) cheat description:Invincibility code:06bf/cd/c9 cheat description:Hit anywhere code:51bf/d0/00+51c9/d0/00 cheat description:Get Skulls from anywhere (the ones that are not dropped by enemies) code:6516/0d/00+650c/17/00 cheat description:Moon jump code:4279/20/02+4277/d2/d5+4276/09/9f cartridge sha256:af1c1c11d7039fbf03932b17629b8ad17c275d1cb638fdb2e00dab5084919cb9 name:Gex 3 - Deep Pocket Gecko (USA) cheat description:Invincibility code:4f94/35/77+4f92/28/3e cheat description:Hit anywhere code:5566/fd/94+5565/c2/c3 cheat description:Get Butterflies from anywhere (the ones that are not dropped by enemies) code:61c9/0a/00+61bf/14/00 cheat description:Moon jump code:48c0/66/4e+48be/d8/da+48bd/05/d7 cartridge sha256:895524c63a57b94718e63cd8f71db21617e1692788659cd7cec8e3470b7921f2 name:Ghosts'n Goblins (USA, Europe) cheat description:Invincibility code:3335/f0/c9 cheat description:Hit anywhere code:21d8/3b/00 cartridge sha256:1d47b7e1d6654747e41bd38bf2f6064c23537e9bcea280634f263cdccc6ec5e4 name:Ghostbusters II (USA, Europe) cheat description:Get visible ghosts from anywhere (press B) code:4795/28/3e+4772/29/00 cartridge sha256:dc898d66af6c2ada73946f1cb68f1539c16240060f72e31da5bee2ba2655fcbc name:Goal! (USA) cheat description:Infinite time code:19ef/01/00 cheat description:Select time of up to 99 minutes per half code:43ec/2d/63 cheat description:No goals scored against you by computer code:4ada/3c/00 cheat description:Some teammates have a mega-kick code:555b/0b/22 cheat description:Player 2 is fastest on the pitch code:555a/09/ff+555b/0b/ff+555c/09/ff cartridge sha256:185f092bbebd5fa29a82ffb7d18c8242f75d6f8fee968cf6dee00b32a879febb name:God Medicine - Hukkoku Ban (Japan) (SGB Enhanced) cheat description:Sell an item to get maximum cash code:5f60/03/00 cheat description:Gain maximum EXP after each battle code:460c/d8/00 cheat description:No random battles code:3294/c8/c9 cheat description:Enemies have no HP code:404a/1a/af+4052/1a/af cheat description:Final boss has no HP code:75d6/03/00 cartridge sha256:0f129d30e71c578d737cc9ca6be57abe68d8ba12a934da7d90a3949e192b0dfb name:Gold and Glory - The Road to El Dorado (USA) cheat description:Invincibility code:5603/1b/00+55f9/d6/3e cheat description:Hit anywhere code:6dd9/f0/c9+6dd8/47/37 cheat description:Multi-jump code:53e3/ec/e0+53e1/20/00+53b5/20/18+53a2/5f/00 cartridge sha256:896d9ffbdfe35c802cdcb66b5a6ce84a4ad6bc356c85067904883944a621cbb4 name:Golf (World) cheat description:Wind power is 10 mph code:1d87/38/3e+1d88/09/5e cartridge sha256:4c4397870b96a88e3232f7437945ba122ab2e951b3fe2bb7775d99843d1d6aa5 name:Grandia - Parallel Trippers (Japan) cheat description:Walk anywhere code:4c57/ea/fa+4c65/ea/fa cheat description:Skip battles code:69c8/ea/fa+6a34/30/18 cartridge sha256:2ed249eb86d4fd01e10efd1787a545f4921c19dc0e00b5c516b8bbdfe4c4aedc name:Gradius - The Interstellar Assault (USA) cheat description:Invincibility code:5118/fa/c9 cheat description:Hit anywhere code:4a57/64/59+5a95/01/05+4a4a/d0/00+4a39/d0/00 cartridge sha256:77e9ab506b0995d958fa4b320b9076ee3408de063f76140663c01ae6c32ae3aa name:Grand Theft Auto (USA) cheat description:Infinite ammo code:46fb/35/00 cheat description:Jesus mode code:1b4d/28/c9 cartridge sha256:da9bbcdbd8baba652599419c3d828697c206fb9290b9e008c2ed9ca6103561e8 name:Great Greed (USA) cheat description:No random battles code:4934/46/00 cheat description:One hit kills code:4c1f/9f/7c cheat description:Enemies don't attack code:466f/28/18 cheat description:Walk through walls code:4e60/55/00 cartridge sha256:c1b7a9c2c3df31292b70824159e8c102045f23ac38b263b23ef17a96d8b60c44 name:HAL Wrestling (USA) cheat description:CPU loses all health with one hit code:2eaa/30/3e cheat description:CPU can't recover health code:58a4/ea/fa cartridge sha256:6281ee9af82cbd882250de4802465876a630239b1bc27c1c58b2b3c4ac6fa5d3 name:Hatris (Japan, USA) cheat description:Eliminate a stack with two hats code:31e6/20/3e+320b/d2/c3 cartridge sha256:bfbed25beef74dec194a7330e3f4864a4b82f28927121cf03d9b871965553420 name:Heavyweight Championship Boxing (USA) cheat description:No ring timer code:1ba4/01/00 cheat description:No round increase code:46e1/3d/af cheat description:Juggle your power - can alter power settings and give full power in all categories code:18b2/3d/00 cheat description:Start with punch, life and speed at 1 code:0478/03/01 cheat description:Start with punch, life and speed at 2 code:0478/03/02 cheat description:Start with punch, life and speed at 3 code:0478/03/03 cheat description:Start with punch, life and speed at 4 code:0478/03/04 cheat description:Start with punch, life and speed at 5 code:0478/03/05 cheat description:Start with punch, life and speed at 6 code:0478/03/06 cheat description:Start with punch, life and speed at 7 code:0478/03/07 cheat description:Start with punch, life and speed at 8 code:0478/03/08 cheat description:Start with punch, life and speed at 9 code:0478/03/09 cheat description:Start with super power code:0478/03/99 cartridge sha256:6bf16580b0047f7b0dbaf2bf9a2d34095e057efe70414feeda48de8dcf8952fd name:High Stakes (USA) cheat description:Once you've collected an item from Shady, you can't lose it - blackjack mission 1 only code:4cad/35/00+566b/35/00 cheat description:Betting and cheat tokens cost 0 code:1bb1/12/00 cheat description:No limit to how much you can buy of each item from Shady code:1003/78/00+40b2/c2/00 cheat description:Start with 1/2 money (display will show $50,000) code:08d8/c3/62 cheat description:Start with over $65,000 (display will show $50,000) code:08d8/c3/ff cartridge sha256:f6bdf9f2c4148ce7da23986524781ee844729f360ff9ef27d695ecf0886ff9e0 name:Hit the Ice - VHL - The Official Video Hockey League (USA, Europe) cheat description:Infinite timer code:1a54/01/00 cheat description:Faster timer code:1a54/01/02 cheat description:Infinite super shots code:2297/34/00 cheat description:Only 1 super shot allowed code:2299/0a/01 cheat description:5 super shots allowed code:2299/0a/05 cheat description:10 super shots allowed code:2299/0a/0a cheat description:1-minute periods - vs. mode code:41f6/05/01 cheat description:2-minute periods - vs. mode code:41f6/05/02 cheat description:10-minute periods - vs. mode code:41f6/05/0a cheat description:Neither team can score code:4439/01/00 cheat description:10 seconds in short race after the first shot of 20 seconds code:1197/20/0a cheat description:15 seconds in short race after the first shot of 20 seconds code:1197/20/0f cheat description:5 seconds in short race after the first shot of 20 seconds code:1197/20/05 cartridge sha256:2449307e540566135734977b01ca488a3feb2ce9d887f69a275a308b5a78cc3f name:Home Alone (USA, Europe) cheat description:Invincibility code:2abd/d0/c9 cheat description:Infinite hit points code:2b5a/3d/00 cheat description:Hit anywhere code:2cb6/d2/fa+2cc7/d2/fa cheat description:No enemies code:0434/fa/21 cheat description:Multi-jump code:1933/3e/00 cheat description:Need 1 treasure to finish level 1 code:23e5/24/01 cheat description:Start with 1 hit point code:23ad/03/01 cheat description:Start with 6 hit points code:23ad/03/06 cheat description:Start with 9 hit points code:23ad/03/09 cartridge sha256:f1506c97b36e776a8839187b278efacdfacaa6bb5cf0b3f18e04ced31d0d4a01 name:Home Alone 2 - Lost In New York (USA, Europe) cheat description:Infinite lives code:1782/3d/00 cheat description:Infinite hits unless picked up by shoulders code:17e9/3d/00 cheat description:Get 111,111 points instantly code:1675/78/00 cheat description:Start with 5 lives code:166f/03/05 cheat description:Start with 6 lives code:166f/03/06 cartridge sha256:0dc2278500feb3844ba0ceabee289be011da1084903ab1c3fd681c83e7191118 name:Hook (USA) cheat description:Infinite lives code:2cfd/35/3d cartridge sha256:a04db245f19a55cd3ff43e2b3fc51cc747fc048a551c4e18639fef4af77553e1 name:Humans, The (USA) cheat description:Infinite humans code:03e9/ea/fa cheat description:Infinite time code:39b7/ea/fa cheat description:Start with 6 humans code:6d60/0c/06 cheat description:Start with 9 humans code:6d60/0c/09 cheat description:Start with 15 humans code:6d60/0c/0f cartridge sha256:690f7b634282d9e8d0ba74f32164f08be45eab1f213bd2c4f02f2b75e22b1773 name:Ikari no Yousai 2 (Japan) cheat description:Invincibility code:14bb/28/3e cheat description:Hit anywhere code:0caf/d8/00+0cb1/d0/00+0ccc/d8/00+0ad3/ea/fa+0cce/d0/00 cartridge sha256:ef563c4a4b063ea045d71b435dd078c19d0738f85079928803167cee8f34a4ec name:Incredible Crash Dummies, The (USA, Europe) cheat description:Infinite time code:313e/01/00 cheat description:Faster timer code:913e/01/02 cheat description:Don't lose money when you go through fire code:5b00/ff/00 cheat description:More cash for each hit code:3149/83/85 cheat description:Start with 2 lives code:02a9/05/02 cheat description:Start with 4 lives code:02a9/05/04 cheat description:Start with 8 lives code:02a9/05/08 cartridge sha256:a900ffcc69fa1fa94dc99584b94914de46d2fa9f1a38c8c303c493a5ee008fec name:In Your Face (USA) cheat description:Computer can't score - when it scores, you get the points code:14e9/23/00 cheat description:Opponents are frozen - 2-on-2 game code:08aa/c2/c3 cheat description:5-second game code:1a08/59/05 cheat description:10-second game code:1a08/59/0a cheat description:20-second game code:1a08/59/20 cartridge sha256:616202e0c2bea4898268c9b3a4eb22e198f1b559e29406057e039dded3db9637 name:Jeep Jamboree (USA) cheat description:Always finish in 1st place code:1c62/80/3e+1c63/3c/01 cheat description:Mega speed - stay at constant high speed even when off course and hitting rocks code:69d4/7d/79+69d7/7c/79 cheat description:Race 1 lap shorter code:5bf0/01/02 cheat description:Race 2 laps shorter code:5bf0/01/03 cheat description:Race 3 laps shorter code:5bf0/01/04 cartridge sha256:7459baee09bf535b8a5402c4c9f9ffc91642a473b7a0ef6085f1df47a35354a0 name:Jeopardy! (USA) cheat description:Always correct (even if you enter nothing) code:124c/c8/00+1252/28/18 cartridge sha256:5eaa028521fbff19dd87cd65a89a1a964ab098e343f4df6a94acae0d24b65e7d name:Jeopardy! - Sports Edition (USA) cheat description:Always correct (even if you enter nothing) code:1263/28/18+125d/c8/00 cartridge sha256:9f8a2dec7c3faa1ca2c12dd819cb36dc331a0ff7c2bb1b49786568e9df016357 name:Jeopardy! - Teen Tournament (USA) (SGB Enhanced) cheat description:Always correct (even if you enter nothing) code:1289/28/18+1283/c8/00 cartridge sha256:873d813fc51b735571c721c12922e85f200ee66f0cb742a60e4a9a63aea74944 name:Jetsons, The - Robot Panic (USA, Europe) cheat description:Infinite lives code:0fc7/01/00 cheat description:Infinite health - some robots can't be killed (disable to fight them) code:7908/77/00 cheat description:Max collectible health code:3f1e/05/09 cheat description:Capped robots on first Elroy stage take 1 hit to kill code:42a7/02/01 cheat description:Capped robots on first Elroy stage take 8 hits to kill code:42a7/02/08 cheat description:Start with 4 lives code:3f16/03/04 cheat description:Start with 7 lives code:3f16/03/07 cheat description:Start with 9 lives code:3f16/03/09 cartridge sha256:bbc006dcf175f1fec822c533bed6abc136a98bcb3b6f8d726cc87c8e17c62e1f name:Joe & Mac (USA) cheat description:Infinite lives code:2237/01/00 cheat description:Infinite health code:3be9/ea/fa cheat description:Take one hit and lose life code:3be8/91/af cheat description:No extra energy from pick-ups code:3bd8/77/00 cheat description:Start with 1 life code:0a81/03/01 cheat description:Start with 6 lives code:0a81/03/06 cheat description:Start with 9 lives code:0a81/03/09 cheat description:Start on level 3 code:0a89/e0/3e+0a8a/e5/02+0a8b/f0/e0 cheat description:Start on level 6 code:0a89/e0/3e+0a8a/e5/05+0a8b/f0/e0 cheat description:Start on level 9 code:0a89/e0/3e+0a8a/e5/08+0a8b/f0/e0 cartridge sha256:63a7bfef616b1f9c19c90fdbbea1a096fd1ab6aad16f67d619b07842b0ad04c1 name:Jordan vs Bird - One on One (USA, Europe) cheat description:Infinite time of possession-1-on-1 game code:2706/01/00 cheat description:8 seconds of possession-1-on-1 game code:8dd6/24/08 cheat description:10 seconds of possession-1-on-1 game code:8de6/24/0a cheat description:15 seconds of possession-1-on-1 game code:8dd6/24/0f cheat description:No timer code:2748/01/00 cheat description:5 points on 3-point shots code:2672/02/05+2681/02/05 cheat description:8 points on 3-point shots code:2672/02/08+2681/02/08 cheat description:12 points on 3-point shots code:2672/02/0c+2681/02/0c cheat description:5 points on 2-point shots code:26a1/01/05+26ad/02/05 cheat description:8 points on 2-point shots code:26a1/01/08+26ad/02/08 cheat description:12 points on 2-point shots code:26a1/01/0c+26ad/02/0c cartridge sha256:6b13a664a3c74e6e61b019f4024f65b3fb301ee5518a9cf9e2a27dc41bbdd561 name:Jurassic Park (USA) cheat description:Infinite hearts code:1c46/3d/00 cheat description:Infinite lives code:1c11/01/00 cheat description:Remove All Objects (Disable this code to collect eggs, enable it to avoid the dinosaurs) code:4c55/3c/9b+3075/49/f8+4642/8e/00 cheat description:Only need 1 card to open the gate code:43c9/27/af cheat description:Canメt collect any energy code:43dc/3c/00 cheat description:First Aid gives you mega energy code:43dc/3c/af cheat description:Get max energy from collecting energy code:43da/28/3e+43db/05/03 cheat description:Die after one hit code:1c46/3d/af cheat description:Start with 1 lives code:039e/03/01 cheat description:Start with 5 lives code:039e/03/05 cheat description:Start with 7 lives code:039e/03/07 cheat description:Start with 9 lives code:039e/03/09 cheat description:Start with 1 heart - after 1st life code:1c06/04/01 cheat description:Start with 9 hearts - after 1st life code:1c06/04/09 cheat description:Start with 1 heart - 1st life code:039b/04/01 cheat description:Start with 9 hearts - 1st life code:039b/04/09 cartridge sha256:5b3e8b6b22662607933bac74e03059ceb7274b6ed3dc2c8752cab45472584a3a name:Karate Joe (Europe) (Unl) cheat description:Invincibility code:1e82/35/77+1e80/28/3e cheat description:Hit anywhere code:0fc1/d2/fa+0fbb/da/fa+0fa2/d2/fa+0f9c/da/fa cheat description:Hit anywhere - Boss code:10e6/d2/fa+10e0/da/fa+10c7/d2/fa+10c1/da/fa cartridge sha256:5759871de43dd530b6e54bbd8025018576c0e5f97a2aa7128c091df33554ea91 name:Ken Griffey Jr.'s Slugfest (USA) cheat description:Balls are considered strikes code:6802/20/18 cartridge sha256:b0a1019b6199c923a6a764c15e7bf6d1bb0bef8a042c383f3e3ead74ab171ede name:Kid Dracula (USA, Europe) cheat description:Invincibility code:0813/77/00 cheat description:Infinite lives code:5bf5/ea/fa cheat description:Hit anywhere code:3a9d/d0/00+3aae/d0/00 cheat description:One hit kills code:3bac/28/18 cheat description:Start with 1 energy heart code:0543/03/01 cheat description:Start with 5 energy hearts code:0543/03/05 cheat description:Start with 1 life code:054b/02/00 cheat description:Start with 5 lives code:054b/02/04 cheat description:Start with 10 lives code:054b/02/09 cheat description:Start on level 3 code:70cd/01/03 cheat description:Start on level 5 code:70cd/01/05 cartridge sha256:92c1fbf422abb8f09ca7fdbb563d1284108cc042e60e1222422986d9a59f9d97 name:Kid Icarus - Of Myths and Monsters (USA, Europe) cheat description:Hit anywhere code:48b8/af/00 cheat description:Run into enemies to get Hearts code:4567/28/18 cheat description:Collected hammers seem to count towards your enemy kill number code:7ad1/79/c9+7ab4/c0/7a cheat description:Maximum kills after killing first enemy code:0cca/d0/00 cartridge sha256:4a091956a579de541aa2eef831e6d0c07d8324255cff7cc889c8ed9b70847769 name:Killer Instinct (USA, Europe) (SGB Enhanced) cheat description:Invincibility - P1 code:50d1/c0/c9+4b4c/d2/c3 cheat description:Hit anywhere - P1 code:4b01/27/22+4b00/d2/c3 cheat description:Disable blocking - P2 code:4518/ca/c3+501c/ca/c3 cheat description:Infinite health code:47b0/ea/fa cheat description:Infinite time code:6219/3d/00 cheat description:Round starts with 10 seconds code:231c/99/10 cheat description:Round starts with 30 seconds code:231c/99/30 cheat description:Round starts with 50 seconds code:231c/99/50 cheat description:Round starts with 75 seconds code:231c/99/75 cheat description:Fierce tiger fury does no damage code:7b42/22/00 cheat description:Fierce tiger fury does more damage code:7b42/22/88 cheat description:Fierce tiger fury kills code:7b42/22/ff cheat description:Fierce wind kick does no damage code:7b69/1f/00 cheat description:Fierce wind kick does more damage code:7b69/1f/88 cheat description:Fierce wind kick kills code:7b69/1f/ff cheat description:Fierce laser blade does no damage code:7b83/1d/00 cheat description:Fierce laser blade does more damage code:7b83/1d/88 cheat description:Fierce laser blade kills code:7b83/1d/ff cheat description:Freeze everything except timer code:2038/14/d9 cheat description:Start with very little energy code:22ea/dc/01 cheat description:Start with 1/4 energy code:22ea/dc/4b cheat description:Start with 1/2 energy code:22ea/dc/88 cheat description:Start with 3/4 energy code:22ea/dc/b4 cartridge sha256:0eac0600e7d9b243c5c648fc3d9f8b5d9962e3634d6ff0d6f1873281d31e8ff7 name:King of Fighters '95, The (USA) (SGB Enhanced) cheat description:Hit anywhere - P1 code:482d/13/00+4778/0e/00 cheat description:Blocking disabled - both players code:2c57/de/9e cartridge sha256:0b5f1ddb0b40b34735c1adf42b46651526d1e55c14c13969659cf04fc2173e16 name:Kirby's Block Ball (USA, Europe) (SGB Enhanced) cheat description:Paddle hits Kirby from anywhere code:54a6/6d/01+54a5/d2/18 cartridge sha256:0f6dba94fae248d419083001c42c02a78be6bd3dff679c895517559e72c98d58 name:Kirby's Dream Land (USA, Europe) cheat description:Infinite lives code:46db/ea/fa cheat description:Infinite lives and gain points when hit code:500c/fd/00+2ff1/e0/b1 cheat description:Infinite vitality bars except against end of stage boss code:4463/ea/fa cheat description:Hit anywhere code:43e1/05/00 cheat description:Inhale from anywhere code:4853/39/00+4867/25/00 cheat description:Start with 2 lives code:01bb/05/02 cheat description:Start with 5 lives code:01bb/05/05 cheat description:Start with 9 lives code:01bb/05/09 cheat description:Start with 2 vitality bars code:01c0/06/02 cheat description:Start with 5 vitality bars code:01c0/06/05 cheat description:Start with 9 vitality bars code:01c0/06/09 cartridge sha256:08ddc36709d551b6c2b768e8280e0213ebe89a5088b34e1cc6c0e14977b8e312 name:Kirby's Dream Land 2 (USA, Europe) (SGB Enhanced) cheat description:Invincibility after one hit code:7383/3d/00 cheat description:Don't flash at all after getting hit code:52bf/60/01 cheat description:Don't flash as long after getting hit code:52bf/60/20 cheat description:Infinite energy code:27cb/ea/fa cheat description:Infinite lives code:41c4/ea/fa cheat description:Hit anywhere code:26e5/20/00+2704/30/18 cheat description:Inhale from anywhere code:25be/3d/00+25df/1c/00 cheat description:Get items from anywhere code:7b89/38/18 cheat description:One hit and you die code:3a9e/90/af cheat description:Each star worth an extra life code:7cde/07/01 cheat description:Can't get extra lives from stars code:7cdc/3c/00 cheat description:Each star takes away a life code:7cde/07/01+7c87/3c/3d cheat description:Start with 1 life code:6d58/02/00 cheat description:Start with 5 lives code:6d58/02/04 cheat description:Start with 7 lives code:6d58/02/06 cheat description:Start with 10 lives code:6d58/02/09 cartridge sha256:43bbc3111fe66b5d87940da810a1a0839ab7d48b50c327807538026241b40295 name:Kirby's Pinball Land (USA, Europe) cheat description:Infinite bonus room time - disable to exit code:5f1a/ea/fa cheat description:Infinite balls code:4534/c0/00 cheat description:Infinite M-Tomato code:43f6/c8/74 cheat description:30 seconds allowed in Wispy-Woods bonus room code:60b9/60/30 cheat description:99 seconds allowed in Wispy-Woods bonus room code:60b9/60/99 cheat description:Go straight to end of level bosses code:6ecf/f0/3e+6ed0/d2/01 cheat description:Go straight to bonus games code:6ecf/f0/3e+6ed0/d2/02 cheat description:DeDeDe takes 1 hit code:4d1d/17/01 cheat description:Start with 5 balls code:047c/03/05 cheat description:Start with 1 ball code:047c/03/01 cheat description:Start with 9 balls code:047c/03/09 cartridge sha256:e497ee2ed48507c32bb3a0c89f449d6f3e3e6b3850534f6af814aaa6d5dcefbd name:Kirby's Star Stacker (USA, Europe) (SGB Enhanced) cheat description:Clear most blocks with any pair code:6f75/0b/00+6f6d/13/00+6fa6/cc/cd+6f77/28/18 cartridge sha256:841bb9ea4b253145b2ed2225e6e81d396ddc4260a7ef6b42d54f0a7e25fef90d name:Kizuchida Quiz da Gen-san da! (Japan) cheat description:Infinite time to answer code:352d/34/00 cheat description:Always correct code:3751/5d/53 cartridge sha256:214710311150029f87ab0c8d67713ac446f3b75057cbebdc8960455acb1824eb name:Knockout Kings (USA, Europe) cheat description:Invincibility code:5794/c2/c3 cheat description:Hit anywhere code:582e/c2/fa+580c/c2/fa+581a/ca/fa+4f6d/ca/fa+57ff/c2/fa cartridge sha256:7c7fb68ae4693ee68fa67e6ac0aef20554b697411d859c30da778290be7b9280 name:Koushien Pocket (Japan) (SGB Enhanced) cheat description:Balls are considered strikes code:6657/13/00 cartridge sha256:cca2e1e06b50869a16b0b7bcef0095ff7d53af926419808da2b82fbab3762750 name:Krusty's Fun House (USA, Europe) cheat description:Infinite lives code:03ac/ea/fa cheat description:Infinite pies code:46eb/ea/fa cheat description:Start with 2 pies code:025d/0a/02 cheat description:Start with 7 pies code:025d/0a/07 cheat description:Start with 15 pies (only shows 10) code:025d/0a/0f cheat description:Start with 2 lives code:0243/03/02+0258/03/02 cheat description:Start with 6 lives code:0243/03/06+0258/03/06 cheat description:Start with 9 lives code:0243/03/09+0258/03/09 cartridge sha256:dff23b973c6c5e85da109dfb346ee396625fa7f934bc7c4b853ce4f237dfa42a name:Kung-Fu Master (USA, Europe) cheat description:Mostly invincible code:09ff/35/00+0a42/90/00 cheat description:Infinite time (disable to complete level) code:5c8e/35/00 cheat description:Hit anywhere code:138d/02/00 cheat description:Touch weak enemies to defeat them code:09e6/06/00 cartridge sha256:e1340810c6dd12f55ab5928f08fbec92975f2303bda68e2a4b94cd8bc5ddec33 name:Kwirk - He's A-maze-ing! (USA, Europe) cheat description:Walk through walls code:11d6/28/18+11d7/6f/1e cartridge sha256:4804741a60591a637103a54a6e3a5611bd775097c457fdf85775d74da93ab600 name:Kyoro-chan Land (Japan) cheat description:Invincibility code:29ee/38/3e cartridge sha256:dbcecd9ed9ee70e8f3a231eb0bda95c882ff0e9697d52fe919a02f076962de91 name:Lamborghini American Challenge (USA, Europe) cheat description:Infinite money code:328a/9e/00 cheat description:Infinite turbos code:7931/35/00 cheat description:Increased money code:1d1a/00/99 cheat description:No Loss Of Speed On Collisions code:61c3/60/00 cheat description:No Loss Of Speed When Off Track code:6a18/04/00 cheat description:Start With 2 Turbos code:1d27/01/01 cheat description:Start With 6 Turbos code:1d27/01/05 cheat description:Start With 10 Turbos code:1d27/01/09 cartridge sha256:2451d61085652f25d36e35f1fa50dc7e6b51c6e20a50120decc33efcf1c91109 name:Last Action Hero (USA, Europe) cheat description:Level select (# = level 1-9 or A for ending credits) code:f000/ba/00 cartridge sha256:26c7fd748c4f34b6c091870ebaa0d4798216df6389642493681deb644752508c name:Lawnmower Man, The (Europe) cheat description:Invincibility - Sidescrolling levels code:4037/c4/fa+4030/c4/fa cheat description:Invincibility - Cyber Tube code:429e/da/c3 cheat description:Invincibility - Virtual World code:5f1f/30/18+6409/30/18 cheat description:Infinite lives code:46fd/ea/fa+5a6d/ea/fa+4315/35/00+0faf/ea/fa+4554/ea/fa cartridge sha256:96db9c11cff58dd637efbdc11416580d1a05bb6cc119d9efa0b17bfb0d0f80ad name:Lazlos' Leap (USA) cheat description:Move one piece to clear level (move a piece over another) code:1fa0/06/07 cartridge sha256:7fcf3eec2ce487e804115b814b8ddc3f833bdae8d7e01df8975a1af029edefcd name:Legend (Japan) cheat description:No random battles code:3eef/d0/c9 cartridge sha256:21f712e213f43f9efb93ca039a5190fc09325d5d932af1fb2f8e90b4f9fd169f name:Legend of Zelda, The - Link's Awakening (USA, Europe) cheat description:Infinite health code:f000/04/00 cheat description:Infinite rupees (rupees aren't deducted for purchases you can afford) code:5fbd/ea/fa+5fb2/ea/fa cheat description:All items you get start at max power. When you get an item, you must have a space open (either A or B). code:4c56/01/09+5c74/01/09 cheat description:Get 5 rupees for each single rupee code:64ee/01/05 cheat description:Get 50 rupees for each single rupee code:64ee/01/32 cheat description:Get 255 rupees for each single rupee code:64ee/01/ff cheat description:Hookshot attaches to anything code:7c9e/a0/9f+7ca3/77/ea+7ca4/a7/9f+7ca5/c9/c2 cheat description:Walk through walls. Can walk past the edge of walls and objects, but not through people. Be careful of entering doors from the wrong side. If you get stuck on the edge of a screen, try diagonal and straight movement in all directions. Works from locations in the water. Doesn't work for underground passages. code:7716/b6/af cartridge sha256:5373296324b1ad40716f707239d42cfec8a1ee44ba6f0aa3e1809463747bf767 name:Legend of Zelda, The - Link's Awakening (USA, Europe) (Rev A) cheat description:Hookshot attaches to anything code:7c9c/a0/9f+7ca0/77/ea+7ca1/a7/9f+7ca2/c9/c2 cartridge sha256:c95dd3d9cb798e86c28e3269554e458d434bf3277b96cadf5bc81cfacfb5ee60 name:Legend of Zelda, The - Link's Awakening DX (USA, Europe) (SGB Enhanced) cheat description:Invincibility code:6d73/fa/c9 cheat description:Walk through walls. Be careful of entering doors from the wrong side. If you get stuck on the edge of a screen, try diagonal and straight movement in all directions to free yourself. Allows you to go through walls starting from locations in the water. Doesn't work for underground passages. code:745b/b6/af cartridge sha256:6285ba6201f17bc8595c600ebc2477d52561f0aff29b11f7fc3343bacb2e230b name:Legend of Zelda, The - Link's Awakening DX (USA, Europe) (Rev A) (SGB Enhanced) cheat description:Invincibility code:6d68/fa/c9 cheat description:Hit anywhere code:6e8d/d2/fa+6e6d/d2/fa+5a03/d0/90+6323/d0/90 cheat description:One hit kills code:72ad/7e/00 cheat description:Shop items are free code:7a2c/30/18 cheat description:Revive infinite times code:63c9/55/04+63c8/28/18 cheat description:Throw more than one Boomerang at a time code:4462/01/00 cheat description:Multi-jump code:14d4/c0/00 cheat description:Walk over water, holes, etc code:762f/ea/c9 cheat description:Can place up to 14 bombs at once code:66a9/34/00 cheat description:Cut down almost anything with your sword code:1633/c0/00+1616/ca/fa+1621/28/18 cheat description:Horse pieces always land standing code:7691/04/00+7690/01/00 cheat description:Easier Wing Egg puzzle code:7a90/07/0d+7a8e/be/02+7a8c/19/79+7a8d/79/fe cartridge sha256:5dee5816ed9b46cfc4a2d94f275e555dd3c5080eca00ded975a41a881a6d4c06 name:Legend of Zelda, The - Link's Awakening DX (USA, Europe) (Rev B) (SGB Enhanced) cheat description:Invincibility code:6d68/fa/c9 cheat description:Hit anywhere code:6e8d/d2/fa+6e6d/d2/fa+5a03/d0/90+6323/d0/90 cheat description:Shop items are free code:7a2c/30/18 cheat description:Revive infinite times code:63c9/55/04+63c8/28/18 cheat description:Cut down almost anything with your sword code:1633/c0/00+1616/ca/fa+1621/28/18 cheat description:Horse pieces always land standing code:7691/04/00+7690/01/00 cheat description:Easier Wing Egg puzzle code:7a90/07/0d+7a8e/be/02+7a8c/19/79+7a8d/79/fe cartridge sha256:0b56b78a9e45452e98c33edd111234931f1e034dc097f6f23082eb8db6055474 name:Legend of Zelda, The - Oracle of Ages (USA) cheat description:Invincibility code:47df/7b/c9 cheat description:Infinite Seed/Bomb use on pick-up code:17d3/01/00 cheat description:Hit anywhere code:44e4/be/fe+533c/fd/fc+42b5/da/c3+6ec7/af/00 cheat description:Get items from anywhere code:4214/d0/00+4b7b/d0/00 cheat description:Moon-jump code:5328/20/18+5329/28/06 cheat description:Defeat 1 enemy for fully grown Gashas/Maple meeting code:0246/c0/00 cheat description:Each Seed/Gasha/Bomb worth 99 code:4592/02/00 cheat description:Cut down almost anything with your sword code:78e1/3a/01+7936/1c/3a+4751/d0/00+4762/c8/00 cheat description:Walk through walls. It's not hard to get stuck, so save where it's safe. code:5da5/1a/af cheat description:Always win shooting gallery mini-game code:5085/20/18 cheat description:Never miss in Goron Dance code:7908/28/18+7909/1d/1a cheat description:Mermaid Suite - hold down button instead of continuously pressing code:5910/2a/29 cartridge sha256:862a51368fb30539279d336b3fe193b43876d2cb15c87a36f5da517804ab3971 name:Legend of Zelda, The - Oracle of Seasons (USA) cheat description:Invincibility code:47c7/7b/c9 cheat description:Infinite Seed/Bomb use on pick-up code:17ac/01/00 cheat description:Hit anywhere code:5a32/eb/00+448e/34/30+7780/d0/00+44cc/be/fe+429d/da/c3+6749/3d/00+6e3f/d0/00+463f/62/c9 cheat description:Get items from anywhere code:420d/d0/00+4221/d0/00 cheat description:Moon-jump code:515d/20/18+515e/31/06+5182/02/00 cheat description:Defeat 1 enemy for fully grown Gashas/Maple meeting code:0246/c0/00 cheat description:Each Seed/Gasha/Bomb worth 99 code:4598/02/00 cheat description:Cut down almost anything with your sword code:4437/3d/56+774c/e1/01+4741/c8/00+4730/d0/00 cheat description:Walk through walls. It's not hard to get stuck, so save where it's safe. code:5c96/1a/af cheat description:Touch any button to enter desert with pirate ship code:6014/07/00 cheat description:Lost woods - no need to change seasons to move on (Noble Sword direction - L, L, L, L. Level 6 direction - L, D, R, U.) code:5e0c/03/00 cartridge sha256:68e708010f14daa6013370d43b9ee00a2305b1a95285e7daafa6642a0677b8c2 name:Lethal Weapon (USA, Europe) cheat description:Infinite weapon energy code:1601/ea/fa cheat description:Infinite life energy (except falling down holes) code:2a1d/ea/fa+2aa5/ea/fa cheat description:No enemies code:445b/ff/00 cheat description:Start with weapon energy on 1/2 code:19ce/40/1e cheat description:Start with life energy on 1/2 code:19c3/40/23 cartridge sha256:c24d7fdc7706cf0e01cbdb8c67ce4fb8079015e2b533a731a520844126073d77 name:Little Magic (Japan) cheat description:Invincibility code:44cb/fa/ea cheat description:Stairs always open code:5b4d/c2/fa cheat description:Walk anywhere code:4721/08/00+4704/08/00+475b/08/00+473e/08/00 cartridge sha256:f15722ebebdae93e08bd6642d642614114f2d128778d6a131748c9855603e052 name:Little Mermaid, The (USA) cheat description:Infinite energy code:1822/35/c9 cheat description:Infinite lives code:0c79/35/00 cheat description:Start with 2 lives code:07f1/03/01 cheat description:Start with 6 lives code:07f1/03/05 cheat description:Start with 10 lives code:07f1/03/09 cheat description:Start with 1 energy pt code:0896/03/01 cheat description:Start with 5 energy pts code:0896/03/05 cheat description:Start with 8 energy pts code:0896/03/08 cheat description:Start on level 2 code:0807/ff/01 cheat description:Start on level 3 code:0807/ff/02 cheat description:Start on level 4 code:0807/ff/03 cheat description:Start on level 5 code:0807/ff/04 cheat description:Start on level 6 code:0807/ff/05 cheat description:See end of game credits code:0807/ff/06 cartridge sha256:0d6c56da2fdb6b27d388912604ad97c2f71729604a075d76c1fcd923f29e6915 name:Lock'n Chase (World) cheat description:Invincibility code:1764/28/3e cheat description:Press A to clear level (except final level) code:255e/ae/b6+2560/a7/3d cartridge sha256:17b55c1a46af87f5dae066b0fdbe2b7cac05c29c3d86800e0717ed4c6325af3e name:Looney Tunes (USA) cheat description:Infinite time code:0890/3c/00 cheat description:Hit anywhere code:7845/d2/fa+780a/d2/fa+7800/d2/fa cheat description:Multi-jump code:4480/03/00 cheat description:Start with 99 lives code:01ec/02/99 cartridge sha256:a62f8d94d9eb0633c03d6a67100b354ffee92bee2fff26c0de8c35796a544a53 name:Looney Tunes (USA, Europe) cheat description:Infinite time code:0890/3c/00 cheat description:Hit anywhere code:7845/d2/fa+7809/bd/37+77ff/bc/37 cheat description:Multi-jump code:4481/c2/fa cartridge sha256:53c29bbf5a96a600e4879374215c3bc840df0343bce7ef37a2b7f043b383cb1c name:Looney Tunes - Carrot Crazy (USA) (En,Fr,Es) cheat description:Invincibility code:17e0/e0/f0 cheat description:Invincible from high falls code:28bb/20/18 cheat description:Hit anywhere code:78cc/30/3e+78f6/20/3e+790e/38/3e+7908/20/3e cartridge sha256:59971b1b4a49e14b4870dd500682ece31f1654ce2f34a3799e5dcdeda5f5e73e name:Looney Tunes Collector - Martian Revenge! (Europe) (En,Fr,De,Es,It,Nl) cheat description:Invincibility code:3eee/c0/c9 cheat description:Hit anywhere code:0ab7/0c/9b cheat description:Infinite ammo code:5db3/77/00 cheat description:Get items from anywhere code:569e/c8/00+5a80/c8/00 cheat description:Walk over space code:519b/c8/c9 cartridge sha256:ff9b75f13d25595ebf286d284f6bb951648f3d67f0fd043947d3c48132441c7f name:Lucky Luke (USA) (En,Fr,De,Es) cheat description:Invincibility code:7647/e0/f0+32c7/e0/f0 cheat description:Infinite ammo code:1916/77/00 cartridge sha256:4231fd9f25a5729208475d2d6aa6c2a6e53b1e918e7731a1eee3ce532993301b name:Lufia - The Legend Returns (USA) cheat description:0 HP - Enemies code:674b/2a/af+674c/46/47 cheat description:No random battles code:4034/3c/af cheat description:Enemies always miss code:7295/f5/c9 cheat description:Walk anywhere code:55e6/ca/c3+55dd/01/00 cartridge sha256:2e102efe39e0825933f1fbf4b0b8cc2dbef42f3df809311a5c8a8c1d84899bf7 name:M&M's Minis Madness (USA) cheat description:Multi-jump code:65d0/ca/fa cartridge sha256:bf4cae27bd0dfdede3838d50f92d03cb7cd183a15091bd2a76c7b3fc7b3e718b name:Madden '95 (USA, Europe) (SGB Enhanced) cheat description:Infinite play clock code:1c3b/3d/00 cheat description:Infinite game time code:1c62/3d/00+3933/e0/f0 cheat description:Start on second down code:288e/01/02 cheat description:Start on third down code:288e/01/03 cheat description:Start on fourth down code:288e/01/04 cheat description:Down never increases code:25de/3c/00+3ef0/ea/fa cartridge sha256:eabe2a1c9116871837ddb1d39d643621dc144c18490b5673bd8eedc88b8ceff9 name:Malibu Beach Volleyball (USA) cheat description:Easier to score code:4daa/04/03 cheat description:Computer can't score a point. If score is 0-0, makes you change court a lot. code:5f0c/c1/00 cheat description:You always serve code:5d0e/01/00+5de0/01/00 cartridge sha256:0d479d68a4ac800ab9fde8b3db016af718c13a979163b3eb34b00af96550cd3e name:Mario's Picross (USA, Europe) (SGB Enhanced) cheat description:Infinite time code:7b11/3d/00 cheat description:Mistakes don't decrease time code:7c8f/91/00 cartridge sha256:2c45623446cf82896830712223079e9be5e79b3e5faf550c07f92f082bef419e name:Maru's Mission (USA) cheat description:Infinite health code:397c/91/00+3980/98/00 cartridge sha256:3fe6e53d0a44081f90a91004aa2ea4253a5a5933fff940c22e30e84029e4b2ef name:Max (Europe) cheat description:Infinite Rockets code:08dd/ea/fa cheat description:Hit anywhere code:551a/38/18+550d/38/18+54b5/38/18+54a8/38/18 cartridge sha256:550995df4740397fccdc70d480c9a595260afb59bfcea0b0ec50cb5d55cfe9b0 name:McDonaldland (Europe) cheat description:Invincibility code:2639/28/3e cheat description:Hit anywhere - Throwing and pickup up blocks code:3aaa/d2/fa cheat description:Multi-jump code:3fa6/28/3e cartridge sha256:33d16365318411f063edd9100c79458aabb7ea71bb1873e30f38b93814f0ec6e name:Mega Man - Dr. Wily's Revenge (USA) cheat description:Invincibility code:55fa/01/00+683f/be/41 cheat description:Infinite weapons except Flash code:4209/12/00+515a/ea/fa+4964/ea/fa cheat description:Hit anywhere code:5861/fe/01+2a3d/13/15+2b47/7d/52+281a/af/00+2b5a/21/00+10d2/38/18+10d3/0c/11 cheat description:Multi-jump code:6b24/21/fa+6b25/4a/3f+6b27/7e/e6+6b28/b7/01+6b2b/35/00+6cce/34/1c+6ccf/28/18 cheat description:One hit kills code:2b62/01/00+4c87/01/00 cheat description:Moon jump code:6b2a/4d/00+6b49/12/18+6b4a/af/18+6b4b/ea/2c cartridge sha256:be3fc7ab2d7eb79a9e2538b090bdecc2694740f3beda933f34cb1e4059b10a11 name:Mega Man II (USA) cheat description:Invincibility code:35ce/c0/c9 cheat description:Infinite weapons code:3a14/90/00 cheat description:Multi-jump code:00f0/ff/cd+00f1/ff/d4+00f2/ff/0f+00f3/ff/c9+1226/fa/cd+1227/6f/f0+1228/cf/00+122a/28/18+1244/20/00+1245/00/01 cartridge sha256:7344a36fcfc8151098238529218762e44c5a1546fab7e7fd5d32927e06cbf5a8 name:Mega Man III (USA) cheat description:Infinite energy code:6c09/77/00 cheat description:Infinite weapons code:4235/12/00+5488/ea/fa+58a9/ea/fa cheat description:One hit kills code:296e/01/00+0f25/01/00 cheat description:Laser barriers appear and explode immediately on Sparkman stage code:3977/01/00 cheat description:Takes 1 hit to kill Merciless Matt code:3953/07/01 cheat description:Takes 15 hits to kill Merciless Matt code:3953/07/0f cheat description:Multi-jump code:6e3f/21/fa+6e40/4a/3f+6e42/7e/e6+6e43/b7/01+6e46/35/00+7002/34/1c+7003/28/18 cheat description:Start with 2 lives code:0b17/03/02 cheat description:Start with 6 lives code:0b17/03/06 cheat description:Start with 9 lives code:0b17/03/09 cartridge sha256:4d980ca46a83cd127312dbc445ed1a83e97ed7a8026dce6fdd22a01b1895781b name:Mega Man IV (USA) cheat description:Invincibility code:5fea/c2/21 cheat description:Infinite energy code:61ce/77/00 cheat description:Infinite lives code:0c45/df/01 cheat description:Shoot more than 3 shots at a time code:4567/d0/00 cheat description:Start with 1/4 energy code:09f6/98/26 cheat description:Start with 1/2 energy code:09f6/98/4b cheat description:Start with 3/4 energy code:09f6/98/70 cheat description:Start with 1 lives code:0cae/03/01 cheat description:Start with 5 lives code:0cae/03/05 cheat description:Start with 9 lives code:0cae/03/09 cartridge sha256:7a108770a7c1ad592b52d0c46d7ead422d0a20961abaafca3d40086e3f2f588f name:Mega Man V (USA) (SGB Enhanced) cheat description:Invincibility code:6226/c2/21 cheat description:Infinite lives code:0b75/df/01 cheat description:Infinite energy code:641d/77/00 cheat description:Walk through enemies (can still take damage from projectiles) code:12cd/00 cheat description:Hit anywhere code:11fa/0c/11+11f9/38/18+7a0e/0c/11+7a0d/38/18 cheat description:Multi-jump code:6682/21/fa+6683/52/40+6685/7e/e6+6686/b7/01+6689/35/00+6871/08/1c+6879/34/1c cheat description:One hit kills code:1185/01/00+290e/01/00+7a4e/01/00 cheat description:Start with 1 lives code:0bea/03/01 cheat description:Start with 5 lives code:0bea/03/05 cheat description:Start with 9 lives code:0bea/03/09 cheat description:Start with about 1/4 energy code:0944/98/26 cheat description:Start with about 1/2 energy code:0944/98/4b cheat description:Start with about 3/4 energy code:0944/98/70 cartridge sha256:638225d961484c8749ff8ceba1c865d267a5401b0d37a3a84cac7a6fb6bd8b9a name:Mega Man Xtreme (USA, Europe) cheat description:Invincibility code:2d0e/28/18 cheat description:Infinite secondary weapons code:6844/35/00 cheat description:Hit anywhere code:2d62/77/0b+2d63/2d/2f cheat description:Get items from anywhere code:7bd4/77/0b+7bd5/2d/2f cartridge sha256:e37a14a8e61bd64f2226dacc26a7ee75dd90abfcf88c5016eb97b76ecda0ddca name:Mega Man Xtreme 2 (USA, Europe) cheat description:Invincibility code:285e/28/18 cheat description:Infinite secondary weapons code:66a9/77/00 cheat description:Hit anywhere code:28b5/28/2a+28b4/cb/9d cheat description:get items from anywhere code:75f3/09/00 cartridge sha256:bed7986ba7428470bf946a174810db1a49494f05a0985270a7c6d1ab6fe86f2b name:Megalit (USA, Europe) cheat description:Infinite lives code:026a/ea/fa cheat description:Infinite time - Quest mode code:2d31/ea/fa cheat description:Blocks don't break code:2f7f/34/00 cartridge sha256:0430cbbcdd56b693d40ab7b424603c639d98d5ec97e91e17ce1ede766104e765 name:Merlin (Europe) (En,Fr,De,Es,It,Nl) cheat description:Level select (below Options at title screen) code:6285/03/04 cartridge sha256:56a69d19ba26941a25adad8bdf17c7baba12245097e901999f4c897eec877ddb name:Metal Gear Solid (USA) cheat description:Infinite ammo for all weapons code:6318/3d/00 cheat description:Enemies don't see you code:74a8/b7/c9+64e8/fa/c9 cheat description:Cameras don't see you (normal game and VR training) code:7369/c8/c9 cartridge sha256:58130b462d7760624fa150938f5e3958f9185ef827644855acdef38ff6d55749 name:Metal Walker (USA) cheat description:1 HP - enemies code:4e2b/79/3c+4e24/78/af cheat description:No random battles code:523e/c0/c9 cartridge sha256:3080bcc2eb9965de463f5f4e02f0dabbb13b060e1654a18da8b50948c10af4a6 name:Metroid II - Return of Samus (World) cheat description:Invincibility against enemies code:2ee8/c0/c9 cheat description:Infinite energy code:2f6d/27/80 cheat description:Infinite missiles code:4f36/01/00 cheat description:Hit anywhere code:3270/36/0d+326f/30/18+52e3/30/18 cheat description:Multi-jump code:0d46/13/14+0d45/9d/98+0d44/c2/cd+1430/ea/fa+1461/ea/fa cartridge sha256:7c96841877908473f7873c91373b06bfd3749b341b4c4180c8fd2cc8b8308b68 name:Mickey Mouse (Europe) cheat description:Invincibility code:625e/20/18 cheat description:Can open locked doors without 8 Keys code:48ab/c2/fa cartridge sha256:bc14dac53de625535cc2825efa3d2399bf0c8c661f8a9417c4b97414a630cd0e name:Mickey Mouse - Magic Wand (USA, Europe) (SGB Enhanced) cheat description:Invincibility code:0e92/c8/3e cartridge sha256:fedb0c8100987cb466c116a3ac3a6572675b6aa721a7a8930cec1ae39f677bc6 name:Mickey's Dangerous Chase (USA) cheat description:Invincibility after first hit code:11a8/01/00 cheat description:Infinite health code:1da0/ea/fa cheat description:Infinite lives code:05e2/ea/fa cheat description:Start with 99 lives code:04b6/03/63 cartridge sha256:573798e5dfa80c13f2c7f77795fa3460c0c41ffbc49ab3b830fb4bf30c89f179 name:Mighty Morphin Power Rangers (USA, Europe) (SGB Enhanced) cheat description:Invincibility code:2cb9/e0/c9+2d1e/21/c9+2c9f/f0/c9 cheat description:Hit anywhere code:2e1e/30/3e+2e2a/38/18 cheat description:One hit kills - bosses code:2e4a/28/18 cheat description:Multi-jump code:26c9/38/00+2535/20/3e cartridge sha256:67f16ea0f0afdb20fa75cc988466c0726203412a57a36e0f866eb341ede5d311 name:Mighty Morphin Power Rangers - The Movie (USA, Europe) (SGB Enhanced) cheat description:Invincibility code:4c7b/d0/c9 cheat description:Hit anywhere code:4041/03/00 cheat description:Can always use power code:486d/c0/00 cartridge sha256:70124937963d44c034d73e3e3c7ecf9c3440cdb934cd1a8b6fd4629381343d02 name:Milon's Secret Castle (USA, Europe) cheat description:Protection against most hazards code:7d36/ea/fa cheat description:Infinite money on pick-up code:678f/ea/fa cheat description:Each $ box is worth 99 code:7713/fa/3e+7714/cf/62+7715/df/00 cheat description:Start with and keep double shot and shield code:7cfd/ea/fa+5ca8/af/3c cheat description:Start with 3 energy bars code:76ea/05/03 cheat description:Start with 6 energy bars code:76ea/05/06 cheat description:Start with 9 energy bars code:76ea/05/09 cartridge sha256:b136c40a4ca52d6567e7f71790690b1e71ddad3b9df8d1ee98135ac46a2e7637 name:Minesweeper - Soukaitei (Japan) cheat description:Never miss code:306b/28/18+3140/28/18 cartridge sha256:d74962fe1750b3918c6b5e34dd30851df50e33eaeb27659097d52090c9803705 name:Miner 2049er Starring Bounty Bob (USA) cheat description:Invincibility code:5239/d2/c3+52dd/d2/c3+4ca4/ea/fa cheat description:Infinite time code:6223/01/00 cheat description:Infinite lives code:423d/01/00 cheat description:Take 1 step to complete level code:3f26/d2/fa cheat description:Nasties are invincible code:09ca/00/03 cheat description:Start with 2 lives code:269e/03/02 cheat description:Start with 4 lives code:269e/03/04 cheat description:Start with 8 lives code:269e/03/08 cartridge sha256:f6d779c4882e032919903b4874dec1b6f06716911f77eb9f8acd1727215eb791 name:Missile Command (USA, Europe) cheat description:Infinite missiles code:129a/3d/00+124b/3d/00+1ffd/0f/20 cheat description:Invincible bases code:26bb/fe/ff cheat description:Hit anywhere code:1f4d/da/c3+1fa8/af/37 cheat description:New York code:1f28/00/02 cheat description:London code:1f28/00/04 cheat description:Sydney code:1f28/00/06 cheat description:Paris code:1f28/00/08 cheat description:Moscow code:1f28/00/0a cheat description:San Francisco code:1f28/00/18 cartridge sha256:0b3e5a9611551cc135cebfa67fe3f9aa1a54ef9855c0888b715351035908e126 name:Missile Command (USA) cheat description:Hit anywhere code:1f4d/da/c3+1fa8/af/37 cheat description:Infinite Missiles code:124c/ea/fa+129b/ea/fa cartridge sha256:3b0aaea526447c2d682139c9494eec82045b36e5e684cc56132391ba9a2ef689 name:Momotarou Dengeki (Japan) cheat description:Hit anywhere code:5184/c2/fa+51d8/c2/fa+51b1/c2/fa+5157/c2/fa cheat description:Multi-jump code:2112/23/29+20a1/c2/fa cartridge sha256:f1bf118bd383a91ecf81f7ee759ce702b85cfee9f8cf11d8365cb243d555c607 name:Momotarou Dengeki 2 (Japan) (SGB Enhanced) cheat description:Hit anywhere code:5333/38/18+5382/38/18+5341/38/18+538f/38/18 cheat description:Multi-jump code:4113/c2/fa+419e/2b/1d cartridge sha256:003097c7a363da268fa2853262c1924ee72fe23fc546834b247c359f69a684aa name:Montezuma's Return! (USA) (En,Es) cheat description:Invincibility against enemies code:5580/c0/c9+490d/30/18 cheat description:Invincibility against fire code:49e0/28/18 cheat description:Invincibility against high falls code:4a2f/28/18 cartridge sha256:84686cd3c77c533926fc2c56783613ecc5781de1bff7065e00112a69d17a5e69 name:Mortal Kombat (USA, Europe) cheat description:Infinite health - P1 code:3594/d6/00 cheat description:Infinite time code:1cb5/35/00 cheat description:Infinite continues code:2296/d6/00 cheat description:Infinite fatality time code:0a11/c2/c3 cheat description:One button fatality - Sonya (Press back, close but not close to opponent) code:38c9/00/ff cheat description:One button fatality - Rayden (Press back) code:3879/00/ff cheat description:One button fatality - Kano (Press down) code:3889/00/ff cheat description:One button fatality - Liu Kang (Press foward) code:3899/00/ff cheat description:One button fatality - Scorpion (Press forward, Halfway distance) code:38aa/01/ff cheat description:One button fatality - Sub Zero (Press forward) code:38b9/00/ff cheat description:Foot sweep does less damage code:39c7/41/10 cheat description:Foot sweep does more damage code:39c7/41/ff cheat description:Punches do less damage code:39af/21/10 cheat description:Punches do more damage code:39af/21/ff cheat description:Knees do less damage code:39bf/41/10 cheat description:Knees do more damage code:39bf/41/ff cheat description:Uppercuts do less damage code:39a7/82/10 cheat description:Uppercuts do more damage code:39a7/82/ff cheat description:Kicks to stomach do less damage code:39cf/41/10 cheat description:Kicks to stomach do more damage code:39cf/41/ff cheat description:Kicks to face do less damage code:39b7/62/10 cheat description:Kicks to face do more damage code:39b7/62/ff cheat description:Shoulder throws do less damage code:3a17/41/10 cheat description:Shoulder throws do more damage code:3a17/41/ff cheat description:Sub-Zero's slide does less damage code:3a07/51/10 cheat description:Sub-Zero's slide does more damage code:3a07/51/ff cheat description:Sonya's leg grab does less damage code:3a27/61/10 cheat description:Sonya's leg grab does more damage code:3a27/61/ff cheat description:Kano's cannonball does less damage code:3a1f/61/10 cheat description:Kano's cannonball does more damage code:3a1f/61/ff cheat description:Rayden's lightning does less damage code:3a5f/e7/10 cheat description:Rayden's lightning does more damage code:3a5f/e7/ff cheat description:1 continue code:4014/06/01 cheat description:5 continues code:4014/06/05 cheat description:10 continues code:4014/06/0a cartridge sha256:29d69e0f71b692f348a0954cc3aaa86dcd9a32d8a7268ce6b76ba26b0c0e4629 name:Mortal Kombat II (USA, Europe) cheat description:Infinite health code:4948/dd/00 cheat description:Infinite continues code:0dab/35/00 cheat description:Infinite time code:4c55/01/00 cheat description:No continues code:0157/06/00 cheat description:1 continue code:0157/06/01 cheat description:3 continues code:0157/06/03 cheat description:9 continues code:0157/06/09 cheat description:15 continues code:0157/06/0f cheat description:Much faster timer code:4c55/01/02 cheat description:Timer starts at 30 code:2339/9a/2c cheat description:Timer starts at 40 code:2339/9a/3c cheat description:Timer starts at 50 code:2339/9a/4c cheat description:Timer starts at 60 code:2339/9a/5c cheat description:Player can't move from floor code:462e/77/00+501f/77/00 cheat description:Complete round 1 and go to round 3 (disable after end of round) code:1179/28/3e+117a/10/03+117b/f0/e0 cheat description:Complete round 1 and go to round 4 (disable after end of round) code:1179/28/3e+117a/10/04+117b/f0/e0 cheat description:Computer can't move from floor code:6327/3d/00+6324/3d/00 cheat description:Normal punches do more damage code:60e8/31/f4 cheat description:Uppercuts do less damage code:6100/f4/31 cheat description:Back throws do less damage code:613a/c0/31 cheat description:Special moves (projectiles) do more damage code:615a/82/f4 cartridge sha256:6c2733c0a57bbfe5075bec42e0735c685c934780db45b33f899f62dfea549f69 name:Mortal Kombat 3 (USA) cheat description:Invincibility except for throws and projectiles code:1a25/fa/00+1a26/e7/00+1a27/c0/7d+1a29/0f/14+1a2a/c0/c8+1d57/c8/c9 cheat description:Hit anywhere - P1 code:1d30/04/00 cartridge sha256:cd999acce90fb40bb1231fda253fa8a0db9e26517ed4723353429aedf4ddf5db name:Mortal Kombat 4 (USA, Europe) (SGB Enhanced) cheat description:Invincibility - normal attacks code:1ce0/c8/c9 cheat description:Hit anywhere - normal attacks code:1ccb/0f/00 cartridge sha256:abc725f10251ae954a23c46b7e33b101bc52203fed4ffad49018858d82361964 name:Motocross Maniacs (USA) cheat description:Infinite tires on pick-up code:1dcd/ea/fa cheat description:Infinite jet on pick-up code:1dc7/ea/fa cheat description:Infinite time code:2d22/01/00 cheat description:Faster timer code:2d22/01/02 cheat description:Start with 7 nitros code:09e4/04/07 cheat description:Super fast bike code:201e/ea/fa+1988/96/00 cartridge sha256:e493b87e119d61268af2f97c9e16e65daab3c8223c15261214656667108cc817 name:Mouse Trap Hotel (USA) cheat description:Infinite lives code:220c/ea/fa cheat description:Collect cookie for invincibility against balls, etc. code:06e9/ea/fa+06da/ea/fa cheat description:Start with 4 lives code:0338/02/04 cheat description:Start with 6 lives code:0338/02/06 cheat description:Start with 8 lives code:0338/02/08 cartridge sha256:6e4876c4e6516d8f3325a7341bea05a275d91de178af080e174d697a4e3d5921 name:Mr. Chin's Gourmet Paradise (USA) cheat description:Can eat momos without zapping them code:1c51/ca/fa+1d4d/ca/fa+1cf9/ca/fa+1ca5/ca/fa cartridge sha256:c19f7ec9ff29fa438d7ef189f81711dcaedaa55c86b192d6d9020f5f7dc22702 name:Mr. Do! (USA) cheat description:Invincibility code:1c39/30/18 cheat description:Infinite lives code:3728/ea/fa cheat description:Only 1 Cherry needed to complete level code:3e35/3d/af cheat description:Keep 1 map layout thru game (still will progress from map to map, but layout stays the same) code:182c/fe/3e+182d/0a/09+182e/20/18 cheat description:Start new game from level you died on code:356a/22/23+2478/ea/21 cheat description:Start with 1 life code:15b2/03/01 cheat description:Start with 6 lives code:15b2/03/06 cheat description:Start with 9 lives code:15b2/03/09 cartridge sha256:ccf89ab34bbea5c54cf8da205bd5db9364c1e81136a8ffd009fa0f822d0373a8 name:Mr. Driller (USA) cheat description:Invincibility code:2504/28/18 cheat description:Infinite air code:264e/ea/fa cheat description:Break brown blocks faster code:7e03/20/3e+273e/c5/c9 cheat description:Dig faster (hold A) code:2489/1b/1a cartridge sha256:46c4a36696d1594ffa3441db352d80c8e4927794373d9d2712dcd425664936fe name:Mr Nutz (Europe) (En,Fr,De,Es,It,Nl) cheat description:Invincibility code:4cee/cb/3e cheat description:Hit anywhere - Nuts code:4e01/01/44+4e00/30/18 cheat description:Hit anywhere - Tail code:4d3b/93/61+4d3a/c2/18 cheat description:One hit kills - Bosses code:4963/38/18 cheat description:Always have Nuts code:1ee5/06/11+1ee4/28/18 cheat description:Moon jump code:1f54/20/00+1f4c/20/3e cartridge sha256:d3148649d39fc4f5a8ca3624e022a6c92afbb82b335a3b568b514c60894bfd6b name:Mr Nutz (USA) (En,Fr,Es) cheat description:Press Select to refill your health, nutz and lives. Hold Select and press Start to skip to the next stage. code:397a/25/00 cartridge sha256:21db857936d7eff3d57d576f0a01a52e012d0dcf5dc8f2a6cdb0e92a131a72b6 name:Ms. Pac-Man (USA) cheat description:Invincibility code:1906/02/00 cheat description:Get fruit from anywhere code:1b21/0f/00 cartridge sha256:8e556307f484b3451429f695391820e896202b1046312473911abb72222acee3 name:Ms. Pac-Man - Special Color Edition (USA) (SGB Enhanced) cheat description:Ms. Pac-Man - Invincibility code:521e/30/18 cheat description:Ms. Pac-Man - Infinite lives code:67d1/ea/fa cheat description:Ms. Pac-Man - Get fruits from anywhere code:36cd/30/3e cheat description:Super Pac - Invincibility code:69c0/ca/c3 cheat description:Super Pac - Infinite lives code:6a23/ea/fa cheat description:Super Pac - After eating a power pellet, ghosts stay vulnerable until eaten code:559f/0b/00 cartridge sha256:ba1afcea3239c1acc9af228cebe6872f5547ad04480e71652e2e56dcd4e2f08e name:Mysterium (USA) cheat description:Invincibility code:37f8/c0/c9 cheat description:Infinite lives code:3398/ea/fa cheat description:Max energy in battle. Works for enemies, disable to defeat them. code:3878/80/af cheat description:Start with 1/2 energy code:7db3/00/3a cheat description:Start with 1 life code:7d00/03/01 cheat description:Start with 5 lives code:7d00/03/05 cheat description:Start with 9 lives code:7d00/03/09 cartridge sha256:220915c980318a194273d11d7a22836734ae6365ea2d8658956c3be374fc89f0 name:Mystical Ninja Starring Goemon (USA) (SGB Enhanced) cheat description:Invincibility code:41cf/c0/c9 cheat description:Hit anywhere - main weapon code:422b/7f/da+4219/c8/00 cheat description:Hit anywhere - ninja stars code:4255/c8/3c+4241/c8/00 cheat description:Walk over water and pits code:45e9/20/18 cartridge sha256:424ca9fc4d842444a01c4dbf7375558035f4cb04a7d7056a4c1a1a18b769643d name:Nail'n Scale (USA, Europe) cheat description:Infinite lives code:0b7e/c3/00 cheat description:Can always use power-ups (press select) code:214c/77/00+136e/20/18 cheat description:Can use power-ups in boss levels code:132f/c3/00 cheat description:Start with 1 life code:04b5/04/00 cheat description:Start with 9 lives code:04b5/04/08 cartridge sha256:24797d8f8f74f56fd619f346db92b1829b2262c979a0dca58875ae86d93abe66 name:NBA Jam (USA, Europe) cheat description:Dunk and layup from anywhere code:3642/da/c3+3623/22/00+4466/cd/fa+361b/c8/00 cartridge sha256:e807eef2018cb12c73a5395a47936ce0b24b1e8876c10e3dff6b2d30873e52f3 name:Nemesis (Europe) cheat description:Hit anywhere - Default weapon code:28a7/d0/00+28b8/d0/00 cheat description:Hit anywhere - Laser code:295f/d0/00+2970/d0/00 cheat description:Hit anywhere - Missiles code:29cb/d0/00+29dc/d0/00 cheat description:Get items from anywhere code:2768/d0/00 cartridge sha256:58c4da647070388c9e77ddf1a0fce6777c63ff96efcd804d0917f555c3e02369 name:Nemesis (USA) cheat description:Hit anywhere - normal weapon code:28a5/d0/00+2894/d0/00 cheat description:Hit anywhere - Laser code:295d/d0/00+294c/d0/00 cheat description:Hit anywhere - Missiles code:29c9/d0/00+29b8/d0/00 cheat description:Get items from anywhere code:2755/d0/00 cartridge sha256:9ee539f631e964cb0fbf3564de53f8261b55ad61ca4b022ee423bfc8367f5002 name:Nettou Garou Densetsu 2 (Japan) (SGB Enhanced) cheat description:Invincibility - P1 code:4054/28/18+40b5/28/18 cheat description:Hit anywhere (except projectiles) code:40a5/05/00 cartridge sha256:e8b4326469231ba798657cfa8032bc6c2000c0a61e11fbad8406711642a184eb name:NFL Football (USA) cheat description:No game timer code:5934/01/00 cheat description:Computer can't score on its possessions code:11ed/83/af cheat description:Touchdown worth 1 point code:0f59/06/01 cheat description:Touchdown worth 5 points code:0f59/06/05 cheat description:Touchdown worth 8 points code:0f59/06/08 cartridge sha256:d50625512f089c7a8c6ce3a44de7357466d61a2ef91ae0a0b87afce2a2e9621c name:NFL Quarterback Club (USA, Europe) cheat description:Final time is always under one second(speed and mobility) code:2588/7c/af cartridge sha256:f513d07ace08618cb2d8a39471b617982f23e0b4f7814a62809b9969ff41635b name:Ninja Boy (USA, Europe) cheat description:Hit anywhere (can get items from anywhere by punching) code:6e27/4a/00 cartridge sha256:efc3b14064153fd16b690034c078188d7d1f424ad210b585aaa4e7b0f7f171ee name:Ninja Gaiden Shadow (USA) cheat description:Invincibility code:669c/c0/c9 cheat description:Invincibility (alt) code:22c1/fa/c9 cheat description:Infinite health code:231d/3d/00 cheat description:Infinite lives code:131c/3d/00 cheat description:Hit anywhere code:2730/1b/00+271d/dc/cd cheat description:One hit kills - bosses code:0100/c4/11 cheat description:Start each new life with 5 firewheel markers code:0b01/01/05+0b29/01/05 cheat description:Start at stage 1 boss (Spider) code:0ae6/00/02 cheat description:Start at beginning of stage 2 code:0ae6/00/04 cheat description:Start at stage 2 boss (Jack & Gregory) code:0ae6/00/07 cheat description:Start at beginning of stage 3 code:0ae6/00/08 cheat description:Start at stage 3 boss (Colonel Allen) code:0ae6/00/0b cheat description:Start at beginning of stage 4 code:0ae6/00/0c cheat description:Start at stage 4 boss (Evil Nobleman Who-kisai) code:0ae6/00/0f cheat description:Start at beginning of stage 5 code:0ae6/00/10 cartridge sha256:58ce4e32820b1313d86c96555abcc53220c9c221ae785338b0ebcf360eb5aaa7 name:Ninja Taro (USA) cheat description:Infinite health code:0109/ff/97 cartridge sha256:ea284fad45e612ab2fcd721152ab815fe8e58062155ab6e182195f637d7b6da4 name:Nintendo World Cup (USA, Europe) cheat description:Computer can't score code:7e2d/3c/00 cheat description:No timer code:7d2c/01/00 cheat description:1:59 each half code:7cdd/03/01 cheat description:4:59 each half code:7cdd/03/04 cheat description:6:59 each half code:7cdd/03/06 cheat description:9:59 each half code:7cdd/03/09 cartridge sha256:79b35e46b8258cccf8a858b6d66caf16855399fdc54bb1c0a5342e409908363f name:Nobunaga's Ambition (USA) cheat description:Train samurais once and they have 100% skill level (must be Oda Nobunaga) code:4f9f/fe/3e cheat description:Start with 75 loyalty pts (must be Oda Nobunaga) code:515a/32/4b cheat description:Start with 100 loyalty pts (must be Oda Nobunaga) code:515a/32/64 cheat description:Start with 50 town value pts (must be Oda Nobunaga) code:5156/19/32 cheat description:Start with 75 town value pts (must be Oda Nobunaga) code:5156/19/4b cheat description:Start with 100 town value pts (must be Oda Nobunaga) code:5156/19/64 cheat description:Start with 50 castle defense pts (must be Oda Nobunaga) code:515c/0f/32 cheat description:Start with 75 castle defense pts (must be Oda Nobunaga) code:515c/0f/4b cheat description:Start with 100 castle defense pts (must be Oda Nobunaga) code:515c/0f/64 cheat description:Start with flood control level at 75 (must be Oda Nobunaga) code:515b/32/4b cheat description:Start with flood control level at 100 (must be Oda Nobunaga) code:515b/32/64 cheat description:Start with 2580 rice pts (must be Oda Nobunaga) code:4eb6/14/0a+4eb9/00/0a cheat description:Start with 788 rice pts (must be Oda Nobunaga) code:4eb6/14/03+4eb9/00/03 cheat description:Start with 276 rice pts (must be Oda Nobunaga) code:4eb6/14/01+4eb9/00/01 cheat description:Start with 999 gold (must be Oda Nobunaga) code:4eb6/0f/0a+4eb7/00/0a cheat description:Attributes for Oda Nobunaga are 100% (will show original values, answer no when asked if this is OK, then attributes will be 100%) code:557e/fe/3e cartridge sha256:52ad82cb79d557d37c4fd92a9782c594f49340d493f007900b901b3aa232bb9e name:Oddworld Adventures (USA, Europe) cheat description:Invincibility code:7afa/ca/c3 cartridge sha256:0b6670e44cc2edc6fbf32fc78f499e774cf0802019480f2bf7bdb836ee15c433 name:Operation C (USA) cheat description:Invincibility code:5abf/cb/af+5ac0/4e/77 cheat description:Hit anywhere code:3aca/1c/00+3ae4/dc/c3+3af5/fe/c6 cheat description:Multi-jump code:55c0/55/00+00e6/ff/5a+00e7/ff/52+00ea/ff/55+00e9/ff/7a+00e5/ff/cd+00e8/ff/cd+00eb/ff/c9+55bf/7a/e5 cartridge sha256:efcce0d4264fbfff4b1b3a0843a681194b2d7a597e842d2895c2eadcfc6998c3 name:Out of Gas (USA) cheat description:Infinite lives code:05dd/ea/fa cheat description:Collect only 1 canister to complete each stage code:18ec/fe/af cheat description:Start with 2 lives code:01ac/03/02 cheat description:Start with 4 lives code:01ac/03/04 cheat description:Start with 8 lives code:01ac/03/08 cartridge sha256:d07986785d76db33e96ccbbe840ac962542f1c359e5b896e6478afd5cf9586b3 name:Pac-Man (USA) cheat description:Invincibility code:177d/d0/c9 cheat description:Get fruit from anywhere code:1922/c0/00+1928/c0/00 cartridge sha256:dcbbc8f8128940a35c9b09624a9987a80cecb2edc8db8e48605de30b4887a3a9 name:Pac-Man - Special Color Edition (USA) (SGB Enhanced) cheat description:Invincibility code:5627/d0/c9 cheat description:Infinite lives code:4c89/35/00 cheat description:Get fruits from anywhere code:57d2/c0/00+57cc/c0/00 cartridge sha256:8b81c75dd11e24ba5e1d2f439a6fabf7313024829df397409a20dd37995122cb name:Pagemaster, The (USA) (SGB Enhanced) cheat description:Invincibility code:4836/3d/00 cheat description:Infinite Help Books code:7f34/3d/00 cheat description:Don't flash at all when you start a new stage code:4095/3c/00 cheat description:Flash longer when you start a new stage code:4095/3c/ff cheat description:Get a Help Book for every Gold Token code:1fd1/1e/01 cheat description:Get a Help Book for every 2 Gold Tokens code:1fd1/1e/02 cheat description:Get a Help Book for every 10 Gold Tokens code:1fd1/1e/0a cheat description:Get a Help Book for every 50 Gold Tokens code:1fd1/1e/32 cheat description:Get a Help Book for every 99 Gold Tokens code:1fd1/1e/63 cheat description:Start in the Adventure World with 1 life code:01bf/05/01+01c3/af/00 cheat description:Start in the Fantasy World with 2 lives code:01bf/05/02+01c3/af/00 cheat description:Start with 1 life code:01bf/05/01 cheat description:Start with 3 lives code:01bf/05/03 cheat description:Start with 7 lives code:01bf/05/07 cheat description:Start with 10 lives code:01bf/05/0a cheat description:Start with 15 lives code:01bf/05/0f cheat description:Start with 11,111,111 points code:01cd/af/3c cartridge sha256:b36e2bb2642a385ce67c059e8fb2a1cc4f63ccff56c023a3f211d81ebd4a8a77 name:Paperboy (USA, Europe) cheat description:Invincibility (except for training courses) code:618c/cd/c9+62dc/d5/c9 cartridge sha256:5c357df199e755eae719588a3424d49bc5212289922f11968e47954276941d6a name:Paperboy 2 (USA, Europe) cheat description:Infinite papers code:64c0/35/00 cheat description:Infinite lives code:4691/35/00 cheat description:Go on to next day after completing Monday code:470c/06/00 cheat description:Start with 15 papers - 1st life only code:3cc6/0a/0f cheat description:Start with 20 papers - 1st life only code:3cc6/0a/14 cheat description:Start with 10 lives - Paperboy code:3ae6/05/0a cheat description:Start with 20 lives - Paperboy code:3ae6/05/14 cartridge sha256:3bcf1b2fe43907d96e58b9aca893a9124bfb3c35774926279f9368a975665086 name:Parodius (Europe) cheat description:Invincibility code:7a20/c0/c9 cheat description:Infinite lives code:33c6/ea/fa cheat description:Infinite super shields once collected code:7b5d/ea/fa cheat description:Start with super shields and triple firing code:2bd3/00/ff+2bd6/00/ff cheat description:Start with 5 lives code:2a93/03/05 cheat description:Start with 8 lives code:2a93/03/08 cheat description:Start with 11 lives code:2a93/03/0b cartridge sha256:b5c0c1e3bc4ee2f1ca3cba1bed9483707f4ab72b87e517ca80f1bbb612fd86cd name:Penguin Land (Japan) cheat description:Infinite time code:200a/ea/fa cartridge sha256:d84a2382b358d83a0891d40b2de65494f060d8be1a048d5aa8721282218b04b6 name:Pinball - Revenge of the 'Gator (USA, Europe) cheat description:Infinite supply of balls code:07e1/35/00 cheat description:Disable left flipper code:2f24/cd/21 cheat description:Disable right flipper code:2f2a/e6/c9 cheat description:Start with 1 ball code:06ed/03/01 cheat description:Start with 9 balls code:06ed/03/09 cartridge sha256:ec2420a8d1b129379435e9a217ef8e6be7fcece10a17d72affa8b1b2449888cb name:Pinball Dreams (USA, Europe) cheat description:Infinite balls code:0818/34/00 cheat description:Start with 5x bonus, lose it if you collect any other bonus code:0bed/ea/3e+0bee/6b/04+0bef/d1/00 cheat description:No tilt - shake the table as much as you want code:34ba/28/00+34bb/16/00 cheat description:Collect 2x bonus and get 6x bonus code:24c7/02/05 cheat description:Start with 1 ball code:081b/03/01 cheat description:Start with 4 balls code:081b/03/04 cheat description:Start with 7 balls code:081b/03/07 cheat description:Start with 9 balls code:081b/03/09 cartridge sha256:fddf9b0ebdc5294554339b59dd9b949286e5281bf81f05bc4c1759844effc0a9 name:Pinocchio (USA) cheat description:Infinite health code:0b59/35/36 cartridge sha256:11347375400080c6e2bfac1ae908d571b91bd4a5406b823c912eb9df1bd3d014 name:Pitfall - Beyond the Jungle (USA, Europe) cheat description:Invincibility code:719d/c0/c9 cheat description:Hit anywhere code:6733/c2/fa+67ab/c2/fa+6764/c2/fa+67ed/c2/fa cheat description:Walk on air code:1f6e/3e/c9 cartridge sha256:634c932dafbc56bdf9b88c02cd69540b327523c2b1d21edcb672884c9a06ef68 name:Planet of the Apes (USA) (En,Fr,De,Es,It,Nl) cheat description:Infinite health code:6563/c0/c9 cheat description:Start with all weapons code:5e4b/1c/00 cartridge sha256:027a8bb2843c3f96373ca60830f58fbc2fcf15d51756649e002b87a97f438a41 name:Play Action Football (USA) cheat description:Always kick at full power code:35df/20/3e+35e0/e8/40+35e5/3d/00 cheat description:Infinite time code:2a6b/3d/00 cheat description:Infinite downs code:632a/c0/01 cheat description:Only get 2 downs code:1b84/04/02 cheat description:Only need 5 yards for 1st down code:6341/0a/05 cartridge sha256:d6702e353dcbe2d2c69183046c878ef13a0dae4006e8cdff521cca83dd1582fe name:Pokemon - Crystal Version (USA, Europe) cheat description:One hit kills code:5d49/30/3e cheat description:Opponent doesn't attack code:46de/cd/c9 cheat description:No random battles code:60ea/30/18 cheat description:Skip trainer battles code:682c/1b/00 cartridge sha256:fdcc3c8c43813cf8731fc037d2a6d191bac75439c34b24ba1c27526e6acdc8a2 name:Pokemon - Crystal Version (USA, Europe) (Rev A) cheat description:One hit kills code:5d49/30/3e cheat description:Opponent doesn't attack code:46de/cd/c9 cheat description:No random battles code:60ea/30/18 cheat description:Skip trainer battles code:682c/1b/00 cartridge sha256:fb0016d27b1e5374e1ec9fcad60e6628d8646103b5313ca683417f52b97e7e4e name:Pokemon - Gold Version (USA, Europe) (SGB Enhanced) cheat description:One hit kills code:5e86/0e/00 cheat description:Opponent doesn't attack code:4686/cd/c9 cheat description:No random battles code:6646/30/18 cheat description:Skip trainer battles code:676b/1b/00 cartridge sha256:72b190859a59623cbef6c49d601f8de52c1d2331b4f08a8d2acc17274fc19a8c name:Pokemon - Silver Version (USA, Europe) (SGB Enhanced) cheat description:One hit kills code:5e85/30/3e cheat description:Opponent doesn't attack code:4686/cd/c9 cheat description:No random battles code:6646/30/18 cheat description:Skip trainer battles (the only way to fight them is to talk to them) code:676b/1b/00 cartridge sha256:a54515bb6b3e364964d3c0226f5a6b0c8c0f7318c9296ef2e321df0bbb8541ce name:Pokemon Trading Card Game (USA) (SGB Enhanced) cheat description:Always your turn code:67be/e0/c9 cheat description:Attack without energy cards code:474f/30/18 cartridge sha256:952660d14941a2ab77810c3fe36658c8e8dd490e2c4e744fb3d41ce2eb31e703 name:Pocket Bomberman (USA, Europe) (SGB Enhanced) cheat description:Invincibility code:458a/01/00+2c54/05/00 cheat description:Bomb hits anywhere when placed on the ground code:40c2/07/00 cartridge sha256:2f74f1a512d862372e0bccf09260ffb91a676cdb2391fd91f2f6bc8487d75974 name:Pong - The Next Level (USA, Europe) cheat description:Right side player cannot hit ball code:48fc/20/28+48fd/20/df+48fb/02/03 cartridge sha256:cfff247d91c3c448d3588a5c5fc3ee4c19b0031e45679022bdbdadae6d545802 name:Pop'n TwinBee (Europe) cheat description:Invincibility code:3a52/30/18+3e8d/d2/c3 cheat description:Hit anywhere - normal enemies code:32dd/30/3e+32ce/30/3e cheat description:Hit anywhere - bosses code:60d0/30/3e+60c3/30/3e cartridge sha256:4a1c9750f77deffb8e003b8938d2ffe5f520fb43143aedd309909b8a9907856d name:Popeye 2 (USA) cheat description:Invincibility after first hit until end of level code:4e83/3d/00 cheat description:Infinite Pows code:63c5/ea/fa cheat description:Infinite lives code:03af/ea/fa cheat description:Infinite time - disable to advance in some areas code:4202/12/2a cheat description:Infinite continues code:5a1a/3d/00 cheat description:Super code - more lives and power code:4b68/03/88 cheat description:Start with 1 Pow after 1st life code:03a7/03/01 cheat description:Start with 7 Pows after 1st life code:03a7/03/07 cheat description:Start with no continues code:53f7/05/00 cheat description:Start with 2 continues code:53f7/05/02 cheat description:Start with 9 continues code:53f7/05/09 cartridge sha256:584f8fcfde1ae9f262747be425df0ed4d1a7421d24b8d62af05b075875b1cb35 name:Project S-11 (USA) cheat description:Invincibility code:46bb/c2/c3 cheat description:Hit anywhere - normal enemies code:45b0/30/3e+45a4/38/3e+45b5/38/3e+459f/30/3e cheat description:Hit anywhere - bosses code:465d/38/3e+466e/38/3e+4669/30/3e+4658/30/3e cheat description:One hit kills - normal enemies code:45e2/38/18 cheat description:One hit kills - bosses code:4687/30/3e cartridge sha256:e1b69e85caebf764bfa6cece5c1d33b67b370cf055480f309644b937e4a7ebdb name:Prophecy - The Viking Child (USA) cheat description:Infinite lives code:3e04/ea/fa cheat description:Infinite energy code:3df5/ea/fa cheat description:Each coin gives lots of money code:2d9b/7c/00 cheat description:Start with 25 energy - 1st life code:04a5/63/19 cheat description:Start with 50 energy - 1st life code:04a5/63/32 cheat description:Start with 4 lives code:04a0/01/03 cheat description:Start with 7 lives code:04a0/01/06 cheat description:Start with 10 lives code:04a0/01/09 cartridge sha256:459ccbbab8580bd93a2a0d5d66ca4ae42c8f664f3106687ffc31c7aef7dd677b name:Puzzle Boy II (Japan) cheat description:Walk anywhere code:0f67/20/3e cartridge sha256:cfc6560d1385808cfd5c242a9f3aa38892c6ab2cb242d0767115144c633708b6 name:Puzzled (USA) cheat description:Clear level automatically code:424a/ca/c3+4296/c2/fa cartridge sha256:567aef8ea27486a4fa38ef4a4ae6ebae2a9138dc8a6a675d155895936e1318d8 name:Pyramids of Ra (USA) cheat description:Energy bar doesn't go down when you make a move code:458e/ea/fa cheat description:Only 1 pt. of energy per move on first attempt at each level (instead of 3) code:7ac4/a1/a2+7ac6/7c/3c+7ac3/ea/fa cheat description:Start on level 100 code:b1ab/01/64+01ac/00/00 cheat description:Start on level 300 code:01ab/01/2c+01ac/00/01 cheat description:Start on level 500 code:01ab/01/f4+01ac/00/01 cartridge sha256:4e624ad741077f574c1d0b57cbc45171ed4ca9f23fa89dfd8f282897aa53ab9a name:Q Billion (USA) cheat description:Pressing Select in Game B once gives you 246 seconds code:1b9f/0a/00 cheat description:Infinite timer code:1755/3d/00 cheat description:Level select - Game A code:0b61/38/3e+0b62/15/0d+0b63/79/00 cartridge sha256:878a21de57986965bf2c68774119180d21dbd5111eef4a9a70ffd0f9f6bdbf7b name:Q-bert (USA) cheat description:Invincibility code:3e61/da/fa cheat description:Step on one cube to clear level code:482c/ca/c3 cartridge sha256:ed110933b5a41ed89d2b980e6e984733833fa6b2c15e5235eff1f5df54175df4 name:QIX (World) cheat description:Invincibility code:3edb/b7/af cheat description:Create any shape to clear level code:409a/04/00 cartridge sha256:0ccfd1166f7e6158c8d4189e5dc9a11724fce01f375f2a78f54ed4a41d7beb0c name:QIX Adventure (Europe) cheat description:Invincibility code:49bd/ea/fa+738d/c2/c3 cheat description:Create any shape to clear level code:5533/20/3e+5538/38/3e cartridge sha256:7d8e122f6f70f6ca49521f2c24fd987e91f621977da2912702285735438be901 name:Quarth (USA, Europe) cheat description:Select up to level 5 code:549e/03/05 cheat description:Super turbo ship code:2b31/79/00 cheat description:Blocks don't drop (push Up to bring blocks down) code:1632/90/af cheat description:Blocks drop faster code:162b/fa/3e+162c/70/50+162d/c4/00 cheat description:Blocks drop super fast code:162b/fa/3e+162c/70/80+162d/c4/00 cartridge sha256:3f6cdd669637c8a3aaaf02c9ae833e820a3e7f9e882e5cbb246bda5aa616ff87 name:Quest - Fantasy Challenge (USA) (SGB Enhanced) cheat description:Invincibility code:627d/d2/c3+5e92/3e/c9 cheat description:Hit anywhere code:53ba/28/18+53a7/30/18+539a/30/18 cartridge sha256:6242b49e85e9652c278ceae22fd5c888495222b4ba78c0a82bb925f2acf66ac1 name:Quest RPG - Brian's Journey (USA) cheat description:Invincibility code:46f6/cd/fa+4616/c0/c9 cheat description:One hit kills code:518f/da/c3+519c/da/c3 cartridge sha256:b3f2838cb64dfa12f93ab4767c3b0786cba0993015fefe1f592146f9d8f47d40 name:Radar Mission (USA, Europe) cheat description:Game B - Infinite money code:2333/35/00 cheat description:Game B - Move in 1 direction only code:53cc/35/00 cheat description:Game B - Destroyed fleet disappears from radar screen but game doesn't end code:5cc6/35/00 cheat description:Game B - Start with 1 money bag code:21e0/03/01 cheat description:Game B - Start with 1 extra money bag code:21e0/03/04 cartridge sha256:9e30f9c36cfa1bc1fd6f111fa38a43f3c5907c26d81a65309279eec54a3d05d6 name:Raging Fighter (USA, Europe) cheat description:Infinite energy code:44e0/c1/00+171a/77/00 cheat description:Infinite time code:491f/12/00 cheat description:4th difficulty level - go to options, set difficulty, press Left 3 times (won't show anything), then exit code:51f2/28/3e+51f3/02/04+51f4/34/77 cheat description:Start on level 4 - 1P tournament only code:2e5b/ea/3e+2e5c/68/03+2e5d/c2/00 cheat description:Start on final level - 1P tournament only code:2e5b/ea/3e+2e5c/68/07+2e5d/c2/00 cheat description:Start each fight with 10 seconds code:5a9a/99/10 cheat description:Start with 1/2 time code:5a9a/99/50 cheat description:Start with 3/4 time code:5a9a/99/75 cartridge sha256:1a8bfa0e55e89241a9843e440e8e2a93dae906c654378e8b27df27e360de826c name:Rampage - World Tour (USA, Europe) cheat description:Invincibility code:7a06/01/00 cheat description:Knock down buildings with one punch code:5abc/30/3e+5aba/28/3e cartridge sha256:ff3915dab21e648cc8f30b28702db6d6784c8e01792d9a5c17a50a9f5994e48c name:Rampage 2 - Universal Tour (USA, Europe) cheat description:Invincibility code:478a/38/18+7c7d/01/00+7c28/01/00 cheat description:Knock down buildings with one punch code:6127/30/3e cartridge sha256:ad5d681fa599b6cf9dae135c304317ac41f33bee0a5a583d7fa2a178ca66506f name:Rampart (USA, Europe) cheat description:Infinite time - levels don't end, enable at game play screen, disable after battle mode, enable to rebuild castle, disable to go on code:039c/35/00 cheat description:Infinite lives code:470e/c4/01 cheat description:Infinite cannons code:4eb3/c4/01 cheat description:Have 6 seconds to rebuild castle walls code:4029/fa/3e+402a/e7/09+402b/c5/00 cheat description:Have 66 seconds to rebuild castle walls code:4029/fa/3e+402a/e7/44+402b/c5/00 cheat description:Have 118 seconds to rebuild castle walls code:4029/fa/3e+402a/e7/77+402b/c5/00 cheat description:Levels last 10 seconds code:4040/fa/3e+4041/16/1a+4042/c6/00 cheat description:Levels last 25 seconds code:4040/fa/3e+4041/16/2a+4042/c6/00 cheat description:Levels last 50 seconds code:4040/fa/3e+4041/16/43+4042/c6/00 cartridge sha256:9ca5b01d04985e0c83c68d5b434f322d2e7ee494fffed08cd747e8ade1569b0a name:Rayman (USA) (En,Fr,De,Es,It,Nl) cheat description:Get items from anywhere code:4aad/07/00+6fa0/20/18 cartridge sha256:46cfbba977f7d4cb8df51d5cb51f00dc0a4d9c129868a1ed88f2b0fa97454905 name:Ren & Stimpy Show, The - Space Cadet Adventures (USA) cheat description:Infinite lives code:1754/e0/f0 cheat description:Infinite energy except when you fall into pits code:1733/e0/f0 cheat description:Start with 2 life code:5d2e/02/01 cheat description:Start with 6 lives code:5d2e/02/05 cheat description:Start with 9 lives code:5d2e/02/08 cheat description:Start with 5 energy - 1st life only code:5d32/03/04 cheat description:Start with 6 energy - 1st life only code:5d32/03/05 cheat description:Start with 7 energy - 1st life only code:5d32/03/06 cheat description:Start with 4 energy - after 1st life code:175c/03/04 cheat description:Start with 5 energy - after 1st life code:175c/03/05 cheat description:Start with 6 energy - after 1st life code:175c/03/06 cartridge sha256:9a97678cbd8da02c8763e977674e17f460c06ea8b73bad35c52fe6817f506d44 name:Resident Evil Gaiden (USA) cheat description:Invincibility code:4b18/04/00+4b12/26/00 cheat description:Infinite ammo on pick-up code:4426/c3/00 cheat description:Infinite Herbs code:74e8/35/00 cheat description:All Herbs cure poison code:7490/c8/00 cheat description:Rapid fire code:456b/02/00+41d0/cc/cb cartridge sha256:ebe140f2c6dcd4e99192d5676b4cfe443a071daa9ff243a23a26ae98a53fead8 name:Return of the Ninja (USA) cheat description:Invincibility code:284d/f5/c9 cheat description:Hit anywhere code:48a1/d2/fa+4891/d2/fa cheat description:Hit anywhere on bosses code:1c29/30/3e+1c19/30/3e cheat description:Cannot be detected by enemies code:47ed/30/18 cheat description:Can always use special attack code:1d4f/3c/04 cartridge sha256:5d7efe8f937eda0f42836482b728db9be2a5caf95d95b7985387e95b5448e3d3 name:Rhino Rumble (USA, Europe) cheat description:Infinite lives code:4942/1d/00 cartridge sha256:c6d02170734d6b533d4599b6fca10ac83141e5ffe4902c4a98001aa61c00dffc name:RoboCop 2 (USA, Europe) cheat description:Infinite health on scrolling levels code:159c/c8/c9 cheat description:Infinite health on ED-209 (tm) levels code:54d9/77/af cheat description:Infinite lives code:20c2/35/b6 cheat description:Infinite time - except stages 3 and 8 code:1548/c8/c9 cheat description:Start with 2 lives code:1ae8/04/02 cheat description:Start with 5 lives code:1ae8/04/05 cartridge sha256:9fb0e41e4c8afe737a688dbdc1b6f7019874f7e9ef4c0a27cba2b8be329ce45b name:RoboCop vs. The Terminator (USA) cheat description:Infinite energy code:4e67/ea/fa cheat description:Start on level 2 code:2d7d/00/01 cheat description:Start on level 3 code:2d7d/00/02 cheat description:Start on level 4 code:2d7d/00/03 cheat description:Start on level 5 code:2d7d/00/04 cheat description:Start on level 6 code:2d7d/00/05 cheat description:Start with 01010101 points code:2d5d/2c/01 cheat description:Start with very little energy - 1st life code:2d58/07/01 cheat description:Start with more energy - 1st life code:2d58/07/15 cheat description:Start with very little energy - 2nd life code:4ee0/07/01 cheat description:Start with more energy - 2nd life code:4ee0/07/15 cartridge sha256:92e8d1acd4d2d3297a961409d4bb0ed49c784be4a6e91cfceabd05ab11894f3d name:Roger Clemens' MVP Baseball (USA) cheat description:Balls are counted as strikes code:4fe2/90/00+5113/d0/00+5110/d8/00 cheat description:No walks code:5468/c5/01 cheat description:No strikeouts code:5487/c5/01 cheat description:Infinite outs (except strikeouts, base runners will still be taken out) code:36b4/c5/01 cheat description:No outs are called, except strikeouts code:36af/03/01+3b87/03/01 cheat description:No scoring - disable to score runs code:4946/77/00+4961/77/00 cartridge sha256:e3d0b1ddea8b4ada14c3bb5e990171e6b2e26935d9dbc15e5de90fb5f7f9595d name:Rolan's Curse (USA) cheat description:Infinite energy code:3c96/e0/f0 cheat description:Start with 2 energy pts code:15f5/04/02 cheat description:Start with 6 energy pts code:15f5/04/06 cartridge sha256:cf3f8f41498cdd32f5b3ee0cdccde1901b073798f3edac1a7d9ccc0141cb16be name:Rolan's Curse II (USA) cheat description:Infinite HP code:f000/79/00 cheat description:Infinite magic code:0e01/e0/f0 cheat description:Takes 9 MP to use Electric ball code:5459/01/09 cheat description:Takes 2 MP to use Electric ball code:5459/01/02 cheat description:Starts you from a new place with power-ups code:1372/af/3c cartridge sha256:8cebc4b128b79dd1b53a5b5a99450bb2783b86840ec61b22e70245dd6df8c39b name:R-Type (USA, Europe) cheat description:Invincibility code:1e07/fa/c9 cheat description:Hit anywhere code:2b40/6b/01+2ada/30/18+2adb/2b/29+2b49/79/af cheat description:One hit kills code:079f/38/18+48c1/c2/fa cartridge sha256:3d20b3fef48771f0d3ea2cdcf80812b02122a0a04dee0e8c8ae8e3e027f36741 name:R-Type DX (USA, Europe) cheat description:De Souza mode accessible (press left on the game selection screen) code:413c/04/05 cartridge sha256:2b059983d79efc5a4f77b41a4efbad68c65ae259715dc008f20a3c11226a943b name:R-Type II (Europe) cheat description:Invincibility code:1f3f/fa/c9 cartridge sha256:e0a07f84198e062c9ba8d617ef15679ba044f96510e5c62309ea1f743499a2c9 name:Samurai Shodown (USA, Europe) (SGB Enhanced) cheat description:Computer takes all damage, even when you get hit code:2b60/e6/3e cheat description:Infinite time code:2246/ea/fa cheat description:Hit anywhere - both players code:16c3/20/18 cheat description:Blocking disabled - both players code:4045/c2/fa cheat description:Start timer at 30 seconds code:1f80/4f/3e+1f81/79/1e cheat description:Start timer at 46 seconds code:1f80/4f/3e+1f81/79/2e cheat description:Start timer at 62 seconds code:1f80/4f/3e+1f81/79/3e cheat description:Start timer at 78 seconds code:1f80/4f/3e+1f81/79/4e cheat description:Start timer at 94 seconds code:1f80/4f/3e+1f81/79/5e cheat description:Start timer at 110 seconds code:1f80/4f/3e+1f81/79/6e cheat description:Start timer at 126 seconds code:1f80/4f/3e+1f81/79/7e cheat description:Start timer at 142 seconds code:1f80/4f/3e+1f81/79/8e cheat description:Start timer at 158 seconds code:1f80/4f/3e+1f81/79/9e cheat description:Both players start with 1/3 energy code:1f86/37/11 cheat description:Both players start with 2/3 energy code:1f86/37/21 cheat description:Both players start with more energy code:1f86/37/ff cheat description:Always fight Genan Shiranui code:689a/30/3e+689b/0d/00+689c/f0/e0 cheat description:Always fight Galford code:689a/30/3e+689b/0d/01+689c/f0/e0 cheat description:Always fight Haohmaru code:689a/30/3e+689b/0d/02+689c/f0/e0 cheat description:Always fight Ukyo Tachibana code:689a/30/3e+689b/0d/03+689c/f0/e0 cheat description:Always fight Charlotte code:689a/30/3e+689b/0d/04+689c/f0/e0 cheat description:Always fight Tam Tam code:689a/30/3e+689b/0d/05+689c/f0/e0 cheat description:Always fight Earthquake code:689a/30/3e+689b/0d/06+689c/f0/e0 cheat description:Always fight Nakoruru code:689a/30/3e+689b/0d/07+689c/f0/e0 cheat description:Always fight Wan Fan code:689a/30/3e+689b/0d/08+689c/f0/e0 cheat description:Always fight Jubei Yagyo code:689a/30/3e+689b/0d/09+689c/f0/e0 cheat description:Always fight Hanzo Hattori code:689a/30/3e+689b/0d/0a+689c/f0/e0 cheat description:Always fight Kyoshiro Senryo code:689a/30/3e+689b/0d/0b+689c/f0/e0 cartridge sha256:384885e8eb8c7396a8c7df08729f61022cc740b3234a8d35bebe17cc7aef3c71 name:SeaQuest DSV (USA, Europe) (SGB Enhanced) cheat description:Invincibility code:4e04/3d/00 cheat description:Infinite lives code:71eb/01/00 cheat description:Lose most energy after first hit code:4e04/3d/af cheat description:Start with super score code:2b37/00/03 cheat description:Start with very little hull energy code:31fc/0a/01 cheat description:Start with 1/2 hull energy code:31fc/0a/05 cheat description:Start with 3/4 hull energy code:31fc/0a/07 cheat description:Start with 2 lives code:2b2d/04/01 cheat description:Start with 5 lives code:2b2d/04/04 cheat description:Start with 10 lives code:2b2d/04/09 cheat description:Start with 15 lives code:2b2d/04/0e cartridge sha256:52924262f2c60fc1c387a92bfdb43835c84968daf4ba465e7cc6627774e7b8a5 name:Serpent (USA) cheat description:Infinite missiles on pick-up code:1fb0/c0/00 cheat description:Win immediately code:03b9/c2/c3+050d/d2/fa cheat description:Start with 5 missiles code:27c9/00/05 cheat description:Start with 8 missiles code:27c9/00/08 cheat description:Start with 15 missiles code:27c9/00/0f cheat description:Start with smaller tail code:27c6/28/15 cheat description:Start with longer tail code:27c6/28/40 cartridge sha256:c8979ad731912452dabedff2c9fb23b19aa68cfdedbf5e99fec902547ce1bb76 name:Simpsons, The - Bart & the Beanstalk (USA, Europe) cheat description:Invincibility code:372c/c0/c9 cheat description:Infinite energy code:3742/ea/fa cheat description:Infinite lives code:1283/01/00 cheat description:Infinite fire crackers code:7a60/3d/00 cheat description:Start with 1 life code:01ad/03/00 cheat description:Start with 5 lives code:01ad/03/04 cheat description:Start with 10 lives code:01ad/03/09 cheat description:Start with 1/4 energy code:1637/5f/10 cheat description:Start with 1/2 energy code:1637/5f/30 cheat description:Start with 3/4 energy code:1637/5f/45 cartridge sha256:6ecab90879e06226ed6b2f6bdeb2d3ffa0736ee77c2132891083671465dd6934 name:Simpsons, The - Bart vs. the Juggernauts (USA, Europe) cheat description:Infinite time on all games code:08a6/77/00 cheat description:Always qualify with enough money code:66eb/2a/0a cheat description:See end sequence code:635b/07/04 cheat description:Start on week 2 code:635b/07/02 cheat description:Start on week 3 code:635b/07/03 cheat description:Capt. Lance Murdock's Skateboard Bash & Crash - Infinite lives code:6f82/ea/fa cheat description:Capt. Lance Murdock's Skateboard Bash & Crash - Start with 1 life code:6ea8/07/01 cheat description:Capt. Lance Murdock's Skateboard Bash & Crash - Start with 2 lives code:6ea8/07/02 cheat description:Springfield Nuclear Power Plant Bop 'till You Drop - No hits against you code:78f3/ea/fa cheat description:Herman's Military Minefield Mayhem - Infinite hits code:7bf2/ea/fa cheat description:Herman's Military Minefield Mayhem - Infinite runs code:7284/ea/fa cheat description:Kwik-E-Mart Doggie Dodge - Infinite chances code:6227/ea/fa cheat description:Kwik-E-Mart Doggie Dodge - Start with 3 lives code:5d89/1f/03 cheat description:Kwik-E-Mart Doggie Dodge - Start with 6 lives code:5d89/1f/06 cheat description:Kwik-E-Mart Doggie Dodge - Start with 9 lives code:5d89/1f/09 cartridge sha256:534478ebd2558ab6a871540062fadbb0ea27808d7f6860942b2e6805fd15e87b name:Simpsons Itchy & Scratchy, The - Miniature Golf Madness (USA, Europe) cheat description:Invincibility code:5a07/c8/00 cheat description:Invincible after getting hit code:5a24/35/00 cheat description:Infinite lives code:2a24/01/00 cheat description:Always get a hole in one code:690e/01/00 cheat description:Start with 1 life code:607d/09/00 cheat description:Start with 5 lives code:607d/09/04 cheat description:Start with 15 lives code:607d/09/0e cartridge sha256:28b2b87a43285afb3e55a96136f71c6a858b0bbe25caaa59f4ef3a6e6d5f64e8 name:Smurfs, The (Europe) (En,Fr,De,Es) cheat description:Invincibility code:56b1/20/18 cheat description:Multi-jump (don't jump off screen) code:6067/20/18+6068/26/0a+605e/8a/8b cartridge sha256:5d9c9ce079923b92034c7c2d172b5abfad9ec37332102cb247ea849393db9a99 name:Smurfs, The (USA, Europe) (En,Fr,De) (Rev A) (SGB Enhanced) cheat description:Invincibility code:57c3/20/18 cheat description:Multi-jump (don't jump off screen) code:6146/26/0a+6145/20/18+613c/8a/8b cartridge sha256:a1e0c6d8385ab8c39569217f28cb335ccac8c85d31e01c9a2343c79494164478 name:Snoopy - Magic Show (USA, Europe) cheat description:Invincibility code:43d6/20/18 cheat description:Start on level 2 code:273f/ea/3e+2740/7b/02+2741/c3/00 cheat description:Start on level 5 code:273f/ea/3e+2740/7b/05+2741/c3/00 cheat description:Start on level 9 code:273f/ea/3e+2740/7b/09+2741/c3/00 cheat description:Start with 22 seconds code:5849/40/10 cheat description:Start with 63 seconds code:5849/40/3f cheat description:Start with 100 seconds code:5849/40/64 cartridge sha256:fece5b09e599c1f8116602fcabd558cc8dbbfe1c6c253853c5e871b0d732c11c name:SolarStriker (World) cheat description:Infinite lives code:0cd6/35/00 cheat description:When you pick up a power-up, go straight to max power code:1f65/fe/3e+1f66/05/04 cheat description:Bullets are mega-powerful, almost invisible, when you pick up a power-up code:1f65/fe/3e+1f66/05/0b cheat description:No loss of power-ups on dying code:1645/ca/00 cheat description:Stay on same level code:0dee/34/00 cheat description:Start with 2 lives code:05d0/02/01 cheat description:Start with 6 lives code:05d0/02/05 cheat description:Start with 10 lives code:05d0/02/09 cheat description:Start on stage 2 code:050a/01/02 cheat description:Start on stage 3 code:050a/01/03 cheat description:Start on stage 4 code:050a/01/04 cheat description:Start on stage 5 code:050a/01/05 cheat description:Start on stage 6 code:050a/01/06 cartridge sha256:b876faa05d3fa8c9e6d2812a7e17cbc8be83463e1d1536f13e9719ba0e7108b5 name:Solomon's Club (USA) cheat description:Invincibility code:072a/20/18 cheat description:Hit anywhere - fireball code:0663/38/14+0662/30/18 cheat description:Always have fireball code:422a/de/08+4229/20/18 cheat description:Items are free code:1f70/fa/09+1f6f/da/18 cartridge sha256:3d6fd2f730d66266215b06c7d40ebd060aca9a48f8117d25a4411fa5d644ff57 name:Solitaire FunPak (USA, Europe) cheat description:Klondike - Move cards to any stack code:4cd2/20/18+4bb3/20/18+4bb4/09/34+4cf2/cd/fa+4cf1/1d/00 cheat description:Freecell - Move cards to any stack code:4b35/70/6d+4b34/ca/c3+49fe/25/00 cartridge sha256:b9b4ee32ab8b74ffd90d7606715893f4b6bd2a3b97c14b2ac2fc6683cfbe1986 name:Soukoban (Japan) cheat description:Walk through walls code:071a/ca/fa cartridge sha256:ed0ab3bfcbc6ac96cc1c8eebb9cdabf0c52e1a562d115eefe47b2078746bc691 name:Soukoban 2 (Japan) cheat description:Walk through walls code:0827/c2/fa+0803/01/ff cartridge sha256:c84accad1cc05913a034ff54bc936a908438c84b0dddce5138d79c11006c9cf2 name:Space Marauder (USA) cheat description:Infinite lives code:17be/01/00 cheat description:Start with 99 lives code:0ec2/02/99 cartridge sha256:6ffe31b21d429801b8e5a460e58bd857e41aef888d19297fc558cf25def0d10d name:Spanky's Quest (USA) cheat description:Infinite lives code:1060/3d/00 cheat description:Mega ball power-ups - hit it with your head once for full power code:241e/00/07 cheat description:Start with 1 life code:2b96/02/00 cheat description:Start with 6 lives code:2b96/02/05 cheat description:Start with 9 lives code:2b96/02/08 cheat description:Start on tower 1, stage 5 (disable after starting stage) code:2d68/cb/3e+2d69/37/04 cheat description:Start on tower 1, stage 10 (disable after starting stage) code:2d68/cb/3e+2d69/37/09 cheat description:Start on tower 1, last stage (disable after starting stage) code:2d68/cb/3e+2d69/37/0f cartridge sha256:7b96653450c5fb4522a77d46ecfa50d479b3dac28bafb1a13e416e43c42caae3 name:Speedball 2 - Brutal Deluxe (USA, Europe) cheat description:Get lots of money code:4dcd/04/99 cheat description:Infinite money code:3ae4/ea/fa cheat description:No timer code:6ed9/35/00 cheat description:Opponents can't score any points except from bounced stones code:0c30/78/00 cartridge sha256:5bfae99484fe74c42b55a0dd8835861cfeb7d05590882aab8f4253e4e7138b92 name:Speedy Gonzales (USA, Europe) cheat description:Infinite lives code:4ca9/ea/fa cheat description:Infinite time code:4940/ea/fa cheat description:Start 1st game with 1 life code:7a8a/03/00 cheat description:Start 1st game with 7 lives code:7a8a/03/06 cheat description:Start 1st game with 10 lives code:7a8a/03/09 cheat description:Start in Forest Zone after entering password 500999 code:645a/06/02+645b/90/00 cheat description:Start in Desert Zone after entering password 500999 code:645a/06/03+645b/90/00 cheat description:Start in County Zone after entering password 500999 code:645a/06/04+645b/90/00 cheat description:Start in Cheese Island Zone after entering password 500999 code:645a/06/05+645b/90/00 cheat description:Start continued games with 1 life code:4d87/03/00 cheat description:Start continued games with 7 lives code:4d87/03/06 cheat description:Start continued games with 10 lives code:4d87/03/09 cheat description:Start with 1/2 time code:3ef6/09/05 cheat description:Start with 3/4 time code:3ef6/09/07 cartridge sha256:290f9d2ebd3221142873aa9650dc3276b577f1cfaf4ea2bc407f66a1ae110139 name:Speedy Gonzales - Aztec Adventure (USA, Europe) cheat description:Invincibility code:06cd/c0/c9 cheat description:Walk on air code:1ecf/28/3e cartridge sha256:89c4151a31f00dc0f20133ee5ec8f71f3023331de93e017e97d66dc497eb2aa9 name:Spider-Man 2 (USA, Europe) cheat description:Infinite lives code:16fb/ea/fa cheat description:Infinite energy code:16c4/ea/fa cheat description:Infinite web power code:1df6/ea/fa cheat description:1 energy point after life lost code:16ee/ff/01 cheat description:Start with 1 life code:1f78/03/00 cheat description:Start with 5 lives code:1f78/03/04 cheat description:Start with 10 lives code:1f78/03/09 cheat description:Start with 1 energy point code:1f5b/ff/01 cheat description:Start with 4 web points - 1st life only code:1f73/14/04 cheat description:Start with 5 web points - 1st life only code:1f73/14/05 cheat description:Start with 9 web points - 1st life only code:1f73/14/09 cartridge sha256:664dae41e2d08070ead51e76c2d6865e52a122566cf79203b7c6c496968ded6e name:Spider-Man 3 - Invasion of the Spider-Slayers (USA, Europe) cheat description:Infinite energy code:17ec/ea/fa cheat description:Infinite lives code:1825/ea/fa cheat description:Need to shoot 1 enemy to clear level 1-1 code:2e3a/14/01 cheat description:Start 1st life with 1/2 energy code:23ab/ff/72 cheat description:Start lives after 1st with 1/2 energy code:1818/ff/72 cheat description:Start 1st level with 1/2 time code:476f/ea/fa cheat description:Start 1st level with 255 seconds on timer code:2e2d/96/ff cartridge sha256:7275c3af129971c53ce901321f6ca85b414ebd84574c420d66c38aa87c219fe3 name:Spot - The Cool Adventure (USA) cheat description:Infinite energy (hearts) except when you fall off screen code:390a/ea/fa cheat description:Start with 4 lives code:2576/04/04 cheat description:Start with 6 lives code:2576/04/06 cheat description:Start with 9 lives code:2576/04/09 cheat description:Start with 15 lives code:2576/04/0f cheat description:Start with 25 bonus discs code:2580/00/25 cheat description:Start with 59 bonus discs code:2580/00/50 cheat description:Start with 5 energy (easy level) code:42f7/05/05 cheat description:Start with 8 energy (easy level) code:42f7/05/08 cheat description:Start with 10 energy (easy level) code:42f7/05/08 cheat description:Start with 5 energy (hard level) code:257b/03/05 cheat description:Start with 8 energy (hard level) code:257b/03/08 cheat description:Start with 10 energy (hard level) code:227b/03/08 cartridge sha256:966883149824ad2542a03a6402278d1397cdf0cbc0a7ba8410265410426ebfb9 name:Spud's Adventure (USA) cheat description:Infinite lives code:1267/3d/00 cheat description:Begin each new screen with a key-except 1st screen code:175f/af/00 cheat description:1 EXP pt. for killing a bad guy code:11d1/f0/3e+11d2/df/01 cheat description:5 EXP pts. for killing a bad guy code:11d1/f0/3e+11d2/df/05 cheat description:9 EXP pts. for killing a bad guy code:11d1/f0/3e+11d2/df/09 cheat description:Start with 2 life code:13c8/02/01 cheat description:Start with 6 lives code:13c8/02/05 cheat description:Start with 10 lives code:13c8/02/09 cartridge sha256:f0f1f547332965963ae2f8b3f3b5fd62203e0690cc0299d38e1a3aa56f6a263b name:Spy vs Spy - Operation Boobytrap (USA) cheat description:Infinite time code:52d2/35/00 cheat description:Both spies start with 4 energy code:169e/0a/04 cheat description:Both spies start with 6 energy code:169e/0a/06 cheat description:Both spies start with 8 energy code:169e/0a/08 cheat description:After death, start with 4 energy - white spy code:4d84/0a/04 cheat description:After death, start with full energy - white spy code:4d84/16/08 cheat description:No loss of energy during fight - both spies code:4514/35/00 cheat description:Other spy's punches do not affect your energy code:4503/18/00 cheat description:Walking over floor flowers doesn't affect your energy code:505c/ea/fa cheat description:Traps do not affect energy - white spy code:4a76/02/00 cartridge sha256:5b6bdf85e9083f328449b1316f5dd9c2789f4a57bdac5b16d74fe10bbea1b03c name:Square Deal - The Game of Two-Dimensional Poker (USA) cheat description:Infinite time on pause counter code:1da0/c4/01 cheat description:Timer starts at 30 code:1c83/3c/1e cheat description:No time on pause counter code:1c83/3c/00 cheat description:Select up to level 10 in level select code:24d8/05/0a cheat description:Start with 1 replay code:23af/09/3e+23b0/7e/01 cheat description:Start with 3 replays code:23af/09/3e+23b0/7e/03 cheat description:Start with 9 replays code:23af/09/3e+23b0/7e/09 cartridge sha256:2cdf2edac4e6230e063c867c60f92d5bb5f37969a19a32fb65c33fe9fafaa378 name:Stargate (USA, Europe) cheat description:Tile counter doesn't work code:4822/01/00 cheat description:Tiles all look blank but aren't code:2274/c8/c9 cheat description:The bottom of the tiles are always tile one code:497d/19/0e+497e/4e/01 cheat description:The bottom of the tiles are always tile two code:497d/19/0e+497e/4e/02 cheat description:The bottom of the tiles are always tile three code:497d/19/0e+497e/4e/03 cheat description:The bottom of the tiles are always tile four code:497d/19/0e+497e/4e/04 cheat description:The bottom of the tiles are always tile five code:497d/19/0e+497e/4e/05 cheat description:The bottom of the tiles are always tile six code:497d/19/0e+497e/4e/06 cheat description:The bottom of the tiles are always tile seven code:497d/19/0e+497e/4e/07 cheat description:The bottom of the tiles are always tile eight code:497d/19/0e+497e/4e/08 cheat description:The bottom of the tiles are always tile nine code:497d/19/0e+497e/4e/09 cheat description:The bottom of the tiles are always tile ten code:497d/19/0e+497e/4e/0a cheat description:The bottom of the tiles are always tile eleven code:497d/19/0e+497e/4e/0b cheat description:The bottom of the tiles are always tile twelve code:497d/19/0e+497e/4e/0c cheat description:The bottom of the tiles are always smart bomb tiles code:497d/19/0e+497e/4e/0d cheat description:The bottom of the tiles are always digger tiles code:497d/19/0e+497e/4e/0e cheat description:The bottom of the tiles are always tile wildcard tiles code:497d/19/0e+497e/4e/0f cartridge sha256:3123e4bcd304d84819c589775db3bf4a2b4fa6d23209b3da691ea7eda6045037 name:Star Hawk (Europe) cheat description:Infinite lives code:0a2c/ea/fa cheat description:Impenetrable shield code:08c0/3d/00 cheat description:Infinite continues code:0692/c5/00 cheat description:Keep power-ups when you die code:0f15/ea/fa cheat description:Start with 8 lives code:01c1/03/08 cheat description:Start with 10 lives code:01c1/03/0a cheat description:Start with 12 lives code:01c1/03/0c cartridge sha256:2085a11062131fd64c2bc836200a6e203c0bd45909d193c8ad82c0f79f2c025b name:Star Trek Generations - Beyond the Nexus (USA) (SGB Enhanced) cheat description:Almost infinite phasers and shields code:2256/30/18 cheat description:Infinite attempts in sub game code:73d4/db/01 cheat description:Start with very little phasers and shields code:73f7/64/01 cheat description:Start with 1/4 phasers and shields code:73f7/64/22 cheat description:Start with 1/2 phasers and shields code:73f7/64/3f cheat description:Start with 3/4 phasers and shields code:73f7/64/4f cartridge sha256:9c08d6bdf045668d64934c7cc773bb2353ec15e9dc3e3f5d8ea2e02f2a22be40 name:Star Trek - The Next Generation (USA, Europe) cheat description:Infinite shields code:2427/ea/fa cheat description:Damage isn't repaired code:2113/34/00 cheat description:Damage repaired immediately code:2115/63/00 cheat description:Life support starts at 25% power code:6e16/64/19 cheat description:Life support starts at 50% power code:6e16/64/32 cheat description:Life support starts at 75% power code:6e16/64/4b cheat description:Warp drive starts at 25% power code:6e1a/64/19 cheat description:Warp drive starts at 50% power code:6e1a/64/32 cheat description:Warp drive starts at 75% power code:6e1a/64/4b cheat description:Impulse drive starts at 25% power code:6e1e/64/19 cheat description:Impulse drive starts at 50% power code:6e1e/64/32 cheat description:Impulse drive starts at 75% power code:6e1e/64/4b cheat description:Shields start at 25% power code:6e22/64/19 cheat description:Shields start at 50% power code:6e22/64/32 cheat description:Shields start at 75% power code:6e22/64/4b cheat description:Phasers start at 25% power code:6e26/64/19 cheat description:Phasers start at 50% power code:6e26/64/32 cheat description:Phasers start at 75% power code:6e26/64/4b cheat description:Photon Torpedoes start at 25% power code:6e2a/64/19 cheat description:Photon Torpedoes start at 50% power code:6e2a/64/32 cheat description:Photon Torpedoes start at 75% power code:6e2a/64/4b cheat description:Sensors start at 25% power code:6e2e/64/19 cheat description:Sensors start at 50% power code:6e2e/64/32 cheat description:Sensors start at 75% power code:6e2e/64/4b cheat description:Transporter starts at 25% power code:6e32/64/19 cheat description:Transporter starts at 50% power code:6e32/64/32 cheat description:Transporter starts at 75% power code:6e32/64/4b cartridge sha256:9cf6aa2b4d6a4bb877d33bb6131562c9f41deb369d08c5b60266941bb276561f name:Star Wars (USA) cheat description:Infinite energy code:3b5c/35/c9 cheat description:Infinite lives code:3b6a/ff/00 cheat description:Infinite continues code:12f6/ea/fa cheat description:No continues code:03a2/0a/00 cheat description:20 continues code:03a2/0a/14 cheat description:More energy - 1st life only code:10b7/08/99 cheat description:Start with 1/2 energy on all lives except 1st code:3c12/08/04 cheat description:Start with 1 life code:03b7/03/01 cheat description:Start with 6 lives code:03b7/03/06 cheat description:Start with 9 lives code:03b7/03/09 cartridge sha256:a62719fa767547a11ac20e0ad5d1fd43b68f92908a5c81dd3aba95f921458c51 name:Star Wars - The Empire Strikes Back (USA) cheat description:Infinite continues code:0ea1/3d/00 cheat description:Start with all force abilities in inventory - still need to get force power to activate code:01d7/00/01+01cf/af/00 cartridge sha256:5393db89f3763c973438d8a6abd4ff83c404fe6cd58a8041adf2cd6d85535835 name:Street Fighter Alpha - Warriors' Dreams (USA) cheat description:Hit anywhere - both players code:6f26/c8/00+67e1/c8/00 cartridge sha256:8730c69cb2aa82260ac07257e0e29d61f598de2f8fa3e65da1d694790fa5db16 name:Street Fighter II (USA, Europe) (Rev A) (SGB Enhanced) cheat description:Invincibility code:2a8e/28/18+2a9f/28/18+2ad2/28/18 cheat description:Hit anywhere - P1 code:2ab1/05/00 cheat description:Hit anywhere - P2 code:2a8f/05/00 cheat description:Fireball kills code:7583/15/88 cheat description:Nobody takes damage from anything but throws/grabs code:6924/77/00 cheat description:Opponent can't win any normal rounds code:7b93/c1/00 cheat description:Allows you to select a higher skill level code:5385/06/09 cheat description:Fireball doesn't do any damage code:7583/15/00 cheat description:Fireball does more damage code:7583/15/40 cheat description:Player one starts with very little energy code:63f8/70/01 cheat description:Player one starts with 1/4 energy code:63f8/70/1f cheat description:Player one starts with 1/2 energy code:63f8/70/3a cheat description:Player one starts with 3/4 energy code:63f8/70/52 cheat description:Player one starts with more energy code:63f8/70/ff cheat description:Player two starts with very little energy code:63ff/70/01 cheat description:Player two starts with 1/4 energy code:63ff/70/1f cheat description:Player two starts with 1/2 energy code:63ff/70/3a cheat description:Player two starts with 3/4 energy code:63ff/70/52 cheat description:Player two starts with more energy code:63ff/70/ff cheat description:Start with seconds on the timer code:6461/63/88 cheat description:Ryu - Foot sweep doesn't do any damage code:750b/10/00 cheat description:Ryu - Foot sweep does more damage code:750b/10/40 cheat description:Ryu - Foot sweep kills code:750b/10/88 cheat description:Ryu - Crouch punch doesn't do any damage code:74f7/10/00 cheat description:Ryu - Crouch punch does more damage code:74f7/10/40 cheat description:Ryu - Crouch punch kills code:74f7/10/88 cheat description:Ryu - Normal upper cut doesn't do any damage code:74a7/10/00 cheat description:Ryu - Normal upper cut does more damage code:74a7/10/40 cheat description:Ryu - Normal upper cut kills code:74a7/10/88 cheat description:Ryu - Straight punch doesn't do any damage code:74cf/10/00 cheat description:Ryu - Straight punch does more damage code:74cf/10/40 cheat description:Ryu - Straight punch kills code:74cf/10/88 cheat description:Ryu - Standong hack kick doesn't do any damage code:74bb/0a/00 cheat description:Ryu - Standong hack kick does more damage code:74bb/0a/40 cheat description:Ryu - Standong hack kick kills code:74bb/0a/88 cheat description:Ryu - Rolling throw doesn't do any damage code:75b5/12/00 cheat description:Ryu - Rolling throw does more damage code:75b5/12/40 cheat description:Ryu - Rolling throw kills code:75b5/12/88 cheat description:Ryu - Jumping straight up and kicking doesn't do any damage code:7533/11/00 cheat description:Ryu - Jumping straight up and kicking does more damage code:7533/11/40 cheat description:Ryu - Jumping straight up and kicking kills code:7533/11/88 cheat description:Ryu - Standing short kick doesn't do any damage code:74d9/08/00 cheat description:Ryu - Standing short kick does more damage code:74d9/08/40 cheat description:Ryu - Standing short kick kills code:74d9/08/88 cartridge sha256:201aec9eb615f1434100e0db39d6039e3f80670a680b8af9df15915315c170b1 name:Sumo Fighter (USA) cheat description:Infinite energy code:5ec8/ea/fa cheat description:At easy or hard level screen, press down three times then A for super hard mode (makes display look weird) code:0206/05/09 cheat description:Start with 2 energy bars code:5baf/03/02 cheat description:Start with 5 energy bars code:5baf/03/05 cheat description:Start with 8 energy bars code:5baf/03/08 cheat description:Start with 2 lives code:020b/02/01 cheat description:Start with 5 lives code:020b/02/04 cheat description:Start with 8 lives code:020b/02/07 cartridge sha256:79da9658fdd3b92910f0a63ba6c7a45fb680b0e0ebe03ad1ed982d3dc92edae1 name:Super Battletank - War in the Gulf (USA) cheat description:Infinite damage code:3b00/f0/e0 cheat description:Infinite ammo code:3595/35/00 cheat description:Infinite fuel code:2de1/f0/c9 cheat description:Start with 5 shells code:2e42/32/05 cheat description:Start with 99 shells code:2e42/32/63 cheat description:Start with 5 laser shots code:2e4d/01/05 cheat description:Start with 99 laser shots code:2e4d/01/63 cheat description:Start with 5 smoke shots code:2e58/01/05 cheat description:Start with 99 smoke shots code:2e58/01/63 cheat description:Start with 5 bullets code:2e63/96/05 cheat description:Start with 99 bullets code:2e63/96/63 cheat description:Start with very little fuel code:2e72/ff/15 cartridge sha256:fbd32fe43df00f5821f290e0b2010b9944e46fd687eabf34cf78451e4a62be68 name:Super Bombliss (Japan) (SGB Enhanced) cheat description:Drop one piece to clear level code:4b69/20/3e+4aa2/00/01 cartridge sha256:f607ad68fdfd8cbaabe554fea2075050a7055f0fafef9a0fd2825a67b2fd038a name:Super Breakout (USA) cheat description:Paddle hits ball from anywhere (ball goes down the screen at times) code:0736/d5/3c+0735/da/c3 cartridge sha256:be805b8c607bbf1fdaade6345f244da20ba6ca8ac587402445b8f272a0d708d7 name:Super Breakout! (USA) cheat description:Paddle hits ball from anywhere (ball goes down the screen at times) code:0736/d5/3c+0735/da/c3 cartridge sha256:dab87fd694aa1358278b4850371ff1303dea2295b7b7cc14842c969014a73fb1 name:Super Chase H.Q. (USA, Europe) cheat description:Infinite time code:1678/01/00 cheat description:Infinite turbos code:1767/3d/00 cheat description:Turbo boosts last half as long code:1747/fa/77 cheat description:Turbo boosts lasts very short code:1747/fa/15 cheat description:Turbo boosts lasts forever. Disable to fire a turbo boost then enable while turbo boost is going. code:1714/c4/00 cheat description:Start with lots of points code:4990/f2/f5 cheat description:Start with 1 turbo boost code:50e5/03/01+4908/03/01 cheat description:Start with 2 turbo boosts code:50e5/03/02+4908/03/02 cheat description:Start with 5 turbo boosts code:50e5/03/05+4908/03/05 cheat description:Start with 9 turbo boosts code:50e5/03/09+4908/03/09 cartridge sha256:1a3841dfc6ccf87167d7b1f0ce17f3bbf9fd64445611e249f5902e8824e17483 name:Super Chinese Land (Japan) cheat description:Invincibility (blinking) code:14be/c9/00 cheat description:Infinite health code:450a/1a/7c+450b/77/12 cheat description:Infinite lives code:555a/c9/47 cartridge sha256:af5a78f29f7e5e70bfe4d0122bdb99d5d0e38a3e8912ff49c2630c7d6be7db67 name:Super Mario Bros. Deluxe (USA, Europe) cheat description:Invincibility - Star effect code:01ff/c1/da+01ff/c1/db cheat description:Fireballs hit anywhere code:40bb/28/18+40cb/28/18+2301/da/fa+230f/da/fa cheat description:Fireballs go through all enemies and obstacles code:40bb/28/18+40cb/28/18 cheat description:Blocks that contain coins also give a Starman code:48a3/00/02+4752/40/48+4751/00/b5 cartridge sha256:db81dd4acbd0c7a3b9004f169ee278450c764c842ae777abd28073fbedf4078b name:Super Mario Bros. Deluxe (USA, Europe) (Rev A) cheat description:Invincibility - Star effect code:01ff/c1/da+01ff/c1/db cheat description:Fireballs hit anywhere code:40bb/28/18+40cb/28/18+2301/da/fa+230f/da/fa cheat description:Fireballs go through all enemies and obstacles code:40bb/28/18+40cb/28/18 cheat description:Blocks that contain coins also give a Starman code:48a3/00/02+4752/40/48+4751/00/b5 cartridge sha256:c06af1a1c2a804e4169fd9bfd6eee7073545d88c97febc96c345dd10efd77547 name:Super Mario Bros. Deluxe (USA, Europe) (Rev B) cheat description:Invincibility - Star effect code:01FFDAC1+01FFDBC1 cheat description:Fireballs go through all enemies and obstacles code:40bb/28/18+40cb/28/18 cheat description:Blocks that contain coins also give a Starman code:48a3/00/02+4752/40/48+4751/00/b5 cartridge sha256:49fbd2f61f953d5ef28cab73e357e524c3009ad19fcf30f6a9ee0ae273be41dc name:Super Mario Land (World) (Rev A) cheat description:Enable level select code:04d3/45/00+04aa/d2/c3 cheat description:Infinite time (disable at end of stage) code:5860/01/00 cheat description:Always have superballs code:4a17/c8/00 cheat description:Multi-jump code:49c2/f2/00+49c9/eb/00+49d8/19/00+49e4/08/00+49ae/20/18+4b75/d8/c9+49e7/ea/fa cheat description:Disable music code:6cc3/c8/c9 cheat description:Clear level automatically code:02a7/06/0c+02a6/27/40+02c0/76/40+02c1/23/0c cartridge sha256:470d6c45c9bcf7f0397d00c1ae6de727c63dd471049c8eedbefdc540ceea80b4 name:Super Mario Land (World) cheat description:Enable level select code:04d3/45/00+04aa/d2/c3 cheat description:Superballs hit anywhere code:204b/2d/00+2048/d2/00+2049/2d/e1+204a/2d/e5 cheat description:Multi-jump code:49c2/f2/00+49c9/eb/00+49d8/19/00+49e4/08/00+49ae/20/18+4b75/d8/c9+49e7/ea/fa cheat description:Disable music code:6dbd/c8/c9 cartridge sha256:42045a1642f77b568534ab85b9db93c8a33d2b95c38ae84c987f497e8d52f97f name:Super Mario Land 2 - 6 Golden Coins (USA, Europe) (Rev B) cheat description:Infinite time code:5d8d/01/00 cheat description:Always have fireballs code:32ce/c0/00 cheat description:Fireballs hit anywhere code:304c/7f/4e+3062/7f/64 cartridge sha256:30d3316d06710cb94c529c477975cae3b051312b88aca9392888614b1c4b3894 name:Super Mario Land 2 - 6 Golden Coins (USA, Europe) (Rev A) cheat description:Infinite lives code:3140/01/00 cheat description:Infinite time code:5d8d/01/00 cheat description:Timer counts down by 2 code:5d8d/01/02 cheat description:Mushroom turns you into Bunny Mario code:345b/01/02 cheat description:Mushroom turns you into Fire Mario code:345b/01/03 cheat description:Stay as Super Mario when hit code:31b9/ea/fa cheat description:Stay as Fire or Bunny Mario when hit code:31c8/ea/fa cheat description:Hearts (extra life) worth nothing code:34bb/3c/00 cheat description:Play 30 coin game of chance for free code:745f/30/00 cheat description:Play 50 coin game of chance for free code:7428/50/00 cheat description:Play 200 coin game of chance for free code:73f2/02/00 cheat description:Play 999 coin game of chance for free code:73bb/09/00+73ba/99/00 cheat description:Each coin worth 101 code:1d92/00/01+592b/00/01 cheat description:Each coin worth 0 code:5922/3c/00+1d89/3c/00 cheat description:Each defeated enemy worth 2 code:7321/01/02 cheat description:Each defeated enemy worth 5 code:7321/01/05 cheat description:Can re-enter boss levels code:418d/28/18 cheat description:Always have fireballs code:32cb/c0/00 cheat description:Start new game with 1 life instead of 6 code:4241/05/00 cheat description:Start new game with 10 lives instead of 6 code:4241/05/09 cheat description:Start new game with 25 lives instead of 6 code:4241/05/24 cheat description:Start new game with 50 lives instead of 6 code:4241/05/49 cheat description:Start new game with 75 lives instead of 6 code:4241/05/74 cheat description:Start new game with 100 lives instead of 6 code:4241/05/99 cartridge sha256:5450dce1bd0c073964c374b5b5b5729dce8d00f2e807892c34af32b8bce1392e name:Super Mario Land 2 - 6 Golden Coins (USA, Europe) cheat description:Infinite lives code:3140/01/00 cheat description:Infinite time code:5d8d/01/00 cheat description:Fireballs hit anywhere code:3049/7c/4b+305f/7c/61 cheat description:Always have fireballs code:32cb/c0/00 cartridge sha256:91bd1f24827bde4dbb58ead76a8b4e5a507431ec9b6bbc7ef9473b852538a4d5 name:Super Off Road (USA, Europe) cheat description:Infinite money code:4da2/ea/fa cheat description:Infinite tires, nitros, etc. when you buy them code:233a/35/00 cheat description:Start with 2 credits code:0b87/03/02 cheat description:Start with 4 credits code:0b87/03/04 cheat description:Start with 8 credits code:0b87/03/08 cartridge sha256:f522c83d9dc77825a8bd5933e0877173fcb260fe72c5b032ef38b109250a63e9 name:Swamp Thing (USA, Europe) cheat description:Invincibility code:1285/90/c9 cheat description:Infinite lives code:038f/ea/fa cheat description:Infinite environmental meter code:6fcf/ea/fa cheat description:Start with half energy code:055a/40/20 cheat description:Start with 1/2 environmental meter code:0555/20/10 cartridge sha256:3e7a15c930db627b82b83f1e2a499436b0419e4d05b85bdfeb2a475e6a07c9b1 name:Sword of Hope, The (USA) cheat description:Infinite HP code:4172/c7/00 cheat description:Start with 11 dexterity points code:2abf/05/09 cheat description:12 stamina points code:2ac4/05/09 cheat description:Shaman is free code:34a0/e0/f0 cheat description:Forest shop is free code:3a3c/e0/f0 cartridge sha256:f55e542cc82dc5fbefc0fc5f42e95e882fba7895e73a8ff084ce7aa8408bdd85 name:T2 - The Arcade Game (USA, Europe) cheat description:Infinite energy code:2c9d/e0/f0 cheat description:Infinite lives code:2cab/e0/f0 cheat description:Infinite rockets code:14b8/ea/fa cheat description:Infinite continues code:1d5c/ea/fa cheat description:Start with 2 lives code:0346/05/02 cheat description:Start with 4 lives code:0346/05/04 cheat description:Start with 8 lives code:0346/05/08 cartridge sha256:351a3b24efa68f60009bc7e05d554034c8dc3d360d51d7399c80e65370899679 name:Tail 'Gator (USA, Europe) cheat description:Invincibility code:1baf/28/3e+222d/c2/fa cheat description:Hit anywhere code:51b0/34/00+5234/ca/fa cartridge sha256:596787d9f1dfeef0151b20ce330ef78220e041d0a360b34dea75ce21c7cbb889 name:Taz-Mania (USA, Europe) cheat description:Invincibility code:7365/c0/00 cheat description:Infinite spins code:6c51/ea/fa cheat description:Infinite hearts code:373c/ea/fa cheat description:Infinite time code:76aa/ea/fa cheat description:Infinite credits code:2a48/ea/fa cheat description:Don't flash after getting hit code:6a96/80/00 cheat description:Don't flash as long after getting hit code:6a96/80/11 cheat description:Flash longer after getting hit code:6a96/80/f1 cheat description:Start with 1 heart - 1st life code:076e/03/01 cheat description:Start with 5 hearts - 1st life code:076e/03/05 cheat description:Start with 10 hearts - 1st life code:076e/03/0a cheat description:Start timer at 58 seconds code:7840/19/3e+7841/2a/05 cheat description:Start timer at 1 minute 48 seconds code:7840/19/3e+7841/2a/0a cartridge sha256:8b5f65da035664baedd19c55ddfe06682e2dd7d45970bcb10917078c855aa19c name:Taz-Mania 2 (USA) cheat description:Invincibility code:0108/dc/49 cheat description:Infinite health code:0100/db/60 cheat description:Infinite attack code:0128/d3/ba cheat description:Infinite time code:0138/d3/7d cartridge sha256:1f3c9ff627b0445e57a7425bc433c0476a0eeafe25ea5c6522b102d1ef8f875e name:Tecmo Bowl (USA) cheat description:Infinite time code:5dc9/35/00 cheat description:Have 49 downs code:44d6/04/49 cheat description:Have 5 downs code:44d6/04/05 cheat description:8 minutes 30 seconds per quarter code:44ef/01/08 cheat description:6 minutes 30 seconds per quarter code:44ef/01/06 cheat description:1 minutes 30 seconds per quarter code:44ef/01/01 cartridge sha256:f4ef2ca5506f493f48833c16dff5eaa2b18ba488c352ed5bc03059d150e46620 name:Teenage Mutant Ninja Turtles - Fall of the Foot Clan (USA) cheat description:Infinite health code:0109/c9/81 cheat description:Hit anywhere code:3de2/a1/b8+3e26/a1/b8+3ddf/0e/3e+3e23/0e/3e cartridge sha256:b2588721a1a298cfbd1f2fca465ac70f0b2aa488fab8eed1b7f49cac592ac438 name:Teenage Mutant Ninja Turtles II - Back from the Sewers (USA) cheat description:Invincibility code:564c/30/18+56b4/d0/c9 cheat description:Hit anywhere code:56f1/d0/00 cartridge sha256:95c804c1a851b502c15a3418eef75e491aec9371e2fb2a34e4aaa27b37e02023 name:Teenage Mutant Ninja Turtles III - Radical Rescue (USA) cheat description:Invincibility code:233b/d0/c9+4884/21/c9 cheat description:Hit anywhere code:2247/d0/00+2264/d0/00+22de/d0/00+22fb/d0/00 cartridge sha256:cdcb6ba23ea2c32a2af47abb267d8bd065a8bc10777b435de6a9be421e5bf919 name:Tennis (World) cheat description:Neither player scores points - disable to score code:21da/34/00 cheat description:1 game needed to win set code:209c/07/01 cheat description:2 games needed to win set code:209c/07/02 cheat description:3 games needed to win set code:209c/07/03 cheat description:4 games needed to win set code:209c/07/04 cheat description:1st point takes you to 40 points code:219a/03/01 cheat description:2nd point takes you to 40 points code:219a/03/02 cheat description:Neither player can win game code:2099/34/00+2074/e3/e0+207e/e3/e0 cartridge sha256:5fa11359e8147b295bebd1e5631c7b96908c649d9d33fdc45a2dd3de8d69ca73 name:Terminator 2 - Judgment Day (USA, Europe) cheat description:Almost infinite energy code:1500/ea/c9 cheat description:Infinite time in reprogramming stage code:4103/3d/00 cheat description:20 shots kill end of level 1 boss code:4854/28/14 cheat description:10 shots kill end of level 1 boss code:4854/28/0a cheat description:5 shots kill end of level 1 boss code:4854/28/05 cheat description:Start with 1/2 energy code:2e59/e0/70 cartridge sha256:7fde11dd4e594a6905deccd57943d2909ecb37665a030741c42155aeb346323b name:Tetris (Japan) (En) cheat description:Drop a piece on the far left side of the board to clear the section code:21b9/f7/00 cartridge sha256:0d6535aef23969c7e5af2b077acaddb4a445b3d0df7bf34c8acef07b51b015c3 name:Tetris (World) (Rev A) cheat description:Drop a piece on the far left side of the board to clear the section code:215e/f7/00 cheat description:Keep stack displayed while paused code:1c30/cb/ce cheat description:Keep current and next pieces displayed while paused code:1c53/cd/d9 cheat description:Only piece 1 will appear code:2063/e0/00+2064/ae/3e+2065/7b/00 cheat description:Only piece 2 will appear code:2063/e0/00+2064/ae/3e+2065/7b/04 cheat description:Only piece 3 will appear code:2063/e0/00+2064/ae/3e+2065/7b/08 cheat description:Only piece 4 will appear code:2063/e0/00+2064/ae/3e+2065/7b/0c cheat description:Only piece 5 will appear code:2063/e0/00+2064/ae/3e+2065/7b/10 cheat description:Only piece 6 will appear code:2063/e0/00+2064/ae/3e+2065/7b/14 cheat description:Only piece 7 will appear code:2063/e0/00+2064/ae/3e+2065/7b/18 cartridge sha256:d349dc93423c6abcd775d3b6a8797df715a44a42ec837afb21bf17ae43b40a9e name:Tetris DX (World) (SGB Enhanced) cheat description:Drop pieces on the left side of the board to clear lines code:5a8b/f7/00 cheat description:Score increases a lot code:53c9/86/1f cheat description:Swap over next shape to current shape by pressing A code:57c5/fa/c3+57c6/82/b6+57c7/af/58 cheat description:Swap over next shape to current shape by pressing B code:581e/fa/c3+581f/82/b6+5820/af/58 cheat description:Swap over next shape to current shape by pressing select code:5876/fa/18+5877/87/3e cartridge sha256:771d24adf7dd11ff166fc43d3f2be66dd7a24251b8920e813956c62514813051 name:Tetris 2 (USA) cheat description:Drop one piece to clear level code:5df6/06/00 cheat description:No next piece screen code:58e9/fa/c9 cheat description:Blocks come down fast code:6d64/c6/10+6d62/fa/00+6d63/96/3e cheat description:Blocks come down very fast code:6d64/c6/70+6d62/fa/00+6d63/96/3e cheat description:Blocks come down super fast code:6d64/c6/20+6d62/fa/00+6d63/96/3e cheat description:Can select round above 30 on options screen code:5a4b/d0/00 cheat description:In versus mode, no blocks added to top of screen code:78cb/ea/fa cartridge sha256:2c3bc48a4ec9b6c640b83ce6524570f472db329d4a96d0b527b34abd42b7d695 name:Tetris 2 (USA, Europe) (SGB Enhanced) cheat description:Drop one piece to clear level code:5f67/06/00 cartridge sha256:b8765e752153310f835e10d6ceaee80b0e0913cdadf832b9516af8bf974e9666 name:Tetris Attack (USA) (SGB Enhanced) cheat description:Rows clear automatically (except in Puzzle Mode) code:4734/d9/00 cartridge sha256:252e9981ba15054b5b8e2eeab22ccbae7ac3cbe9d7cd7a895c75fb35054717f9 name:Tetris Attack (USA, Europe) (Rev A) (SGB Enhanced) cheat description:Rows clear automatically (except in Puzzle Mode) code:4732/d9/00 cartridge sha256:379f9034b2702f06247e1dd4a6e21d51a76aff84d12ff851e4e962b105094d10 name:Tiny Toon Adventures 2 - Montana's Movie Madness (USA, Europe) cheat description:Invincibility code:2cda/c2/c3 cheat description:Infinite health code:2d5c/3d/00 cheat description:Infinite time code:4614/3d/00 cheat description:Infinite lives code:2a5e/01/00 cheat description:One hit and you die code:2d53/e0/00 cheat description:Don't flash as long after getting hit code:2d53/e0/3f cheat description:Start with 1 heart code:1966/04/02 cheat description:Start with 2 hearts code:1966/04/03 cheat description:Start with 1 life code:6e1e/02/00 cheat description:Start with 5 lives code:6e1e/02/04 cheat description:Start with 10 lives code:6e1e/02/09 cheat description:Start with mega points code:6e22/af/00 cheat description:Start with 100 seconds on the clock code:6e31/05/01 cheat description:Start with 300 seconds on the clock code:6e31/05/03 cheat description:Start with 700 seconds on the clock code:6e31/05/07 cheat description:Start with 900 seconds on the clock code:6e31/05/09 cartridge sha256:fe2f3a9c8af3702b53398fea579951634effbeafaea10865aac8b07d7458e9b1 name:Tiny Toon Adventures 2 (Japan) cheat description:Invincibility code:2cda/c2/c3 cheat description:Infinite health code:2d5c/3d/00 cheat description:Infinite time code:4614/3d/00 cheat description:Infinite lives code:2a5e/01/00 cheat description:One hit and you die code:2d53/e0/00 cheat description:Don't flash as long after getting hit code:2d53/e0/3f cheat description:Start with 1 heart code:1966/04/02 cheat description:Start with 2 hearts code:1966/04/03 cheat description:Start with 1 life code:6e1e/02/00 cheat description:Start with 5 lives code:6e1e/02/04 cheat description:Start with 10 lives code:6e1e/02/09 cheat description:Start with mega points code:6e22/af/00 cheat description:Start with 100 seconds on the clock code:6e31/05/01 cheat description:Start with 300 seconds on the clock code:6e31/05/03 cheat description:Start with 700 seconds on the clock code:6e31/05/07 cheat description:Start with 900 seconds on the clock code:6e31/05/09 cartridge sha256:4d078174031509ca7b63c237e176e9f5c0aed88b42352ad23aee98a777d3a0d7 name:Titus the Fox to Marrakech and Back (USA, Europe) cheat description:Infinite energy until level 3 code:6e7d/35/00 cheat description:Infinite energy from level 3 on code:6273/35/00 cheat description:Infinite lives code:696a/35/00 cheat description:Start 1st life with 1 energy unit code:53d0/05/01 cheat description:Start 1st life with 9 energy units code:53d0/05/09 cheat description:Start with 1 energy unit after 1st life code:21cf/05/01 cheat description:Start with 9 energy units after 1st life code:21cf/05/09 cheat description:Start 1st level with 100-pt. bonus code:53dc/00/64 cheat description:Start 1st level with 250-pt. bonus code:53dc/00/fa cheat description:Start with 1 life code:53d5/03/01 cheat description:Start with 6 lives code:53d5/03/06 cheat description:Start with 9 lives code:53d5/03/09 cheat description:Start on level 1, part 2 code:03ba/af/00 cartridge sha256:17e1629cd8a95ef8d09643d62f7336efa7c0983f03ceda5038632d2125885fa6 name:Toki Tori (USA, Europe) (En,Ja,Fr,De,Es) cheat description:Get eggs from anywhere code:40ce/27/33+40cd/38/18 cartridge sha256:597f70c8d600427fee6f3a3714115bad30b24402dd830c36dc010a7b3a92a7a3 name:Tom & Jerry (USA, Europe) cheat description:Invincibility code:455c/fa/ea+455a/20/3e cheat description:Infinite lives code:2854/d5/00 cheat description:Infinite balls once collected code:4684/ea/fa cheat description:Infinite energy (may have to die once first) code:2d47/34/00 cheat description:Infinite time code:1c3f/ea/fa+1c43/ea/fa cheat description:Moon jump code:40da/28/3e cheat description:Every time you collect one cheese you get 11 (can't go over 100) code:4067/01/11 cheat description:Start with 1 life code:4f7b/03/01 cheat description:Start with 5 lives code:4f7b/03/05 cartridge sha256:bcd52c83f3662165baaeff2527fd221c04b734214d5dacb8cdda6fbcb95fbc3b name:Tom and Jerry - Frantic Antics! (USA, Europe) cheat description:Infinite lives code:1e39/d3/01 cheat description:Infinite lives code:4ce4/35/00 cheat description:Infinite time code:3143/01/00+3151/01/00 cheat description:Don't flash after getting hit code:7333/78/01 cheat description:Flash longer after getting hit code:7333/78/fa cheat description:Start with 1 life code:390c/03/01 cheat description:Start with 5 lives code:390c/03/05 cheat description:Start with 10 lives code:390c/03/0a cheat description:Start with 1 minutes on the timer code:30de/05/01 cheat description:Start with 10 minutes on the timer code:30de/05/0a cheat description:Start with 15 minutes on the timer - ignore counter code:30de/05/0f cartridge sha256:ebcba74ab890e56676a4c1720f89719a489b73c7c688d1fd0c6a98074dc7afeb name:Tomb Raider (USA, Europe) (En,Fr,De,Es,It) cheat description:Invincibility against enemies code:40f3/28/3e+40f5/35/77 cheat description:Hit anywhere code:5927/65/00 cartridge sha256:a75109b2730df5bef628f05660d670f07a1be6c6249d73f7f88375061c3f3bbb name:Tomb Raider - Curse of the Sword (USA, Europe) cheat description:Invincibility code:41bc/35/77+41ba/28/3e cheat description:Hit anywhere (only when standing and not against a wall) code:5de8/6b/00 cheat description:One hit kills code:5615/77/fe+5614/90/cb cartridge sha256:1878a9fa68e052362b0fbb13421db1ae822ffd74b69db34217455f9e43ce61dd name:Top Gear Pocket (USA) cheat description:No slowdown (except for drifting) code:1f7c/21/c9+1ef2/da/c3 cartridge sha256:976b837a48218903e55ae86b943db2a3bf49c1aba0e5d6e135cb2e775416382e name:Top Gear Pocket 2 (USA) cheat description:All cars unlocked code:4092/c2/c3 cheat description:All tracks unlocked code:11a7/c2/c3 cartridge sha256:bb2f56c5035b47183c55b197bc380ea02df00dd733ce732d062f7c7695bd330f name:Top Gun - Guts & Glory (USA, Europe) cheat description:Infinite missiles code:6424/ea/fa cheat description:Infinite lives code:6859/c4/00 cheat description:Start with 1 life (do not alter mission on the first menu screen) code:2be4/03/01 cheat description:Start with 5 lives (do not alter mission on the first menu screen) code:2be4/03/05 cheat description:Start with 10 lives (do not alter mission on the first menu screen) code:2be4/03/0a cheat description:Start on mission 10 (do not alter mission on the first menu screen) code:6485/ea/00+6486/99/3e+6487/c5/0a cartridge sha256:13a6106b5548261764b0f0d676b07265e6ed37b4cf2f85fc763b05dde749eb64 name:Total Carnage (USA, Europe) cheat description:Infinite grenades code:2228/ea/fa cheat description:Infinite lives code:21ad/3d/00 cheat description:Start with very little energy after 1st life code:21b1/06/02 cheat description:Start with mega energy after 1st life code:21b1/06/99 cheat description:Don't take damage from some enemies after getting hit code:1355/3d/00 cheat description:Start with very little energy-1st life code:4054/06/02 cheat description:Start with mega energy-1st life code:4054/06/99 cheat description:Start with 1 life code:404f/03/00 cheat description:Start with 9 lives code:404f/03/08 cheat description:Start with 15 lives code:404f/03/0f cheat description:Start with 33 grenades code:405f/00/03 cartridge sha256:eae3b192006eff607dffdae3d7720af579f85335be81e6cacb55276bfc32424c name:Track & Field (USA, Europe) cheat description:Always have 100% power code:277f/28/3e+2780/01/00 cheat description:Max angle on long jump code:6d99/80/45 cheat description:Max angle on javelin code:5a1e/80/45 cheat description:Max angle on triple jump code:54d1/80/45 cartridge sha256:9047447e6ff5b0b510732befa3f48a464aebfa9ba06274b3cf6120b25e8dd033 name:Triple Play 2001 (USA, Europe) cheat description:Balls are considered strikes code:73f2/32/00 cartridge sha256:3990c42543e74387c30ac935eb45067e291b4a5e93702d5520acd0e91d14f34f name:Tumble Pop (USA, Europe) cheat description:Infinite lives code:25bc/ea/fa cheat description:Only have 2 minutes to complete each screen code:188a/03/02 cheat description:Only have 5 minutes to complete each screen code:188a/03/05 cheat description:Only have 10 minutes to complete each screen code:188a/03/0a cheat description:Start across river from original position code:1817/00/05 cheat description:Start at island castle code:1817/00/ff cheat description:Hold enemies inside gun as long as you want code:2e68/35/00 cheat description:Start with 1 life code:181c/03/00 cheat description:Start with 6 lives code:181c/03/05 cheat description:Start with 9 lives code:181c/03/08 cartridge sha256:954ed263a5133c608636af442c4c0ade7f9b7dfdc768e7bfbf31d2528a8d7796 name:Turn and Burn (USA) cheat description:Infinite missiles code:2e1c/35/00 cheat description:Gun doesn't overheat code:3151/04/00 cheat description:Start with more Aim-54 missiles code:1299/79/7c cheat description:Start with more Aim-9 missiles code:128b/79/7c cartridge sha256:0ca41e5faef09acc0f440ddb57624fb66cfb5f945145b7acc9390dd6ab07803c name:Turok - Battle of the Bionosaurs (USA, Europe) (En,Fr,De,Es) cheat description:Invincibility code:6a9c/c0/c9 cheat description:Hit anywhere code:6494/11/3a+6493/28/18 cheat description:Multi-jump code:5f16/a7/3d+5f15/cb/8b cartridge sha256:0e82076895f9aa7f8b787d5c76a33d72394f611bd0ac93ecd550873b7ce21b60 name:Turok - Rage Wars (USA, Europe) (En,Fr,De,Es) cheat description:Invincibility code:0b78/fa/c9 cheat description:Infinite ammo code:509f/77/00 cheat description:Hit anywhere code:4198/20/18+4199/2d/22 cartridge sha256:21f2b0f417dd94f8aaa75adf09b849c97780ab9140b1d7d53ed4516f33233037 name:Turok 2 - Seeds of Evil (USA, Europe) (En,Fr,De,Es) cheat description:Invincibility code:4934/28/3e+4d8e/d0/c9 cheat description:Hit anywhere (you have to be in line with them on the streets) code:750c/11/3a+750b/28/18 cheat description:Multi-jump code:4bc5/cb/8b+4bc6/a7/3d cartridge sha256:1710b81824ea2044e7c475c3a8befe52fb8ba92f5dfc8866d7362c1e11393859 name:Turok 3 - Shadow of Oblivion (USA, Europe) (En,Fr,De,Es) cheat description:Invincibility code:43f9/20/18 cheat description:Infinite ammo code:4efd/77/00 cheat description:Hit anywhere code:44a8/ff/6c+4452/59/50+4451/30/18 cartridge sha256:9008df8d950b4e6966b38218e43bc3baf9bad91ef44b271b558aee6f38c993d7 name:Ultima - Runes of Virtue (USA) cheat description:Infinite energy code:05f3/ea/fa+3400/ea/fa cheat description:Infinite money code:0b5b/ea/fa cheat description:Start with dexterity of 10 - Shamino codes only - can't use with Journey Onward option code:762b/15/10 cheat description:Start with dexterity of 30 - Shamino codes only - can't use with Journey Onward option code:762b/15/30 cheat description:Start with dexterity of 50 - Shamino codes only - can't use with Journey Onward option code:762b/15/50 cheat description:Start with strength of 10 - Shamino codes only - can't use with Journey Onward option code:762c/15/10 cheat description:Start with strength of 30 - Shamino codes only - can't use with Journey Onward option code:762c/15/30 cheat description:Start with strength of 50 - Shamino codes only - can't use with Journey Onward option code:562c/15/50 cheat description:Start with IQ of 10 - Shamino codes only - can't use with Journey Onward option code:762f/15/10 cheat description:Start with IQ of 30 - Shamino codes only - can't use with Journey Onward option code:762f/15/30 cheat description:Start with IQ of 50 - Shamino codes only - can't use with Journey Onward option code:762f/15/50 cheat description:Start with 15 coins - Shamino codes only - can't use with Journey Onward option code:7565/30/15 cheat description:Start with 40 coins - Shamino codes only - can't use with Journey Onward option code:7565/30/40 cheat description:Start with 60 coins - Shamino codes only - can't use with Journey Onward option code:7565/30/60 cheat description:No energy replacement - Shamino codes only - can't use with Journey Onward option code:0c0a/ea/fa cartridge sha256:850a429b64b7ebcb8034da2c25789dff631d64682b1ce65f8de346c9744ae31e name:Universal Soldier (USA, Europe) cheat description:Infinite energy code:387a/35/00 cheat description:Infinite time code:0a5a/35/00 cheat description:Infinite lives code:03ee/c0/c9 cheat description:Fewer enemies on each level code:1c50/34/00+1c4b/35/00 cheat description:Start with 5 lives code:15d1/03/05 cheat description:Start with 7 lives code:15d1/03/07 cheat description:Start with 9 lives code:15d1/03/09 cheat description:Start with 5 power lines code:16ac/03/05 cheat description:Start with 7 power lines code:16ac/03/07 cheat description:Start with 9 power lines code:16ac/03/09 cartridge sha256:102dabffa56271534c651579445c13a375e7978f37bdcccc3271e9320c3710fa name:Uno (USA) cheat description:Place any card on the stack regardless of color code:5891/ca/fa cartridge sha256:56b00fb68b829dabe56e88f3074316ee2f3022a15c6f45bd70bda5e8f62c2e8f name:Uno - Small World (Japan) cheat description:Can place any color card on the stack code:589f/30/18 cartridge sha256:88773be9e71529b35ce03d39f417e866f48df97cdfb894943f729dab7beefb90 name:Uno 2 - Small World (Japan) (SGB Enhanced) cheat description:Place any card on the stack code:5701/30/18+57b7/30/18 cartridge sha256:19e8ccfe0df0647cbd6517a456fcffa39c3a9ecc1e40dd31bd193423b4779020 name:Velious - Roland no Majuu (Japan) cheat description:Invincibility code:3bb6/ff/00 cheat description:Hit anywhere code:3d5a/af/b7 cheat description:Walk through walls code:038b/28/18 cartridge sha256:2b3ed695acb2fcd3aa8159b12373a55b01a72ae3a9e0867ef8446fd8abddec51 name:Velious II - Fukushuu no Jashin (Japan) cheat description:Invincibility code:3e3c/b7/af cheat description:Infinite TP code:0e01/e0/f0 cheat description:Hit anywhere - main weapon code:3fa7/d0/00+3f98/d8/00+3fa2/d8/00+3f9d/d0/00 cheat description:Hit anywhere - sub-weapon code:3f70/d0/00+3f6b/d8/00+3f66/d0/00+3f61/d8/00 cheat description:Walk through walls code:031d/28/18 cartridge sha256:1709e340bc089dc179bbc0c24242c9bd5fab9aa7bd1e57b1328725b9b4787786 name:Wacky Races (USA) (En,Fr,Es) cheat description:Press select during gameplay to skip to the end of race in your current position code:07d9/0f/00 cheat description:View ending (enable before booting the game) code:018e/ff/fe cartridge sha256:1af2d4b29552fb2cf141955e1d77f8dd99e856b1f04fbff5240d5a1c3c2c41bf name:Wario Blast featuring Bomberman! (USA, Europe) (SGB Enhanced) cheat description:Infinite time code:0a5b/77/00 cheat description:Collect up to 8 extra bomb power-ups code:53f1/04/08 cheat description:Extra bomb power-ups don't do anything code:53ef/77/00 cheat description:Explosion expanders don't do anything code:53d7/77/00 cheat description:Start with 300 seconds code:1f87/01/03 cheat description:Start with 4 extra bomb power-ups code:26c7/01/04 cheat description:Start with 4 explosion expander code:26cb/00/04 cheat description:Start on round 3-3 code:403b/ea/21+4013/af/00 cheat description:Start on round 3-Boss code:403b/ea/21+4013/af/3c cartridge sha256:ac1682f17abcf590311a233289ee325214c2d71ab3a5aa175004002d85075e56 name:Wario Land - Super Mario Land 3 (World) cheat description:Don't lose current power-up when you get hit or get a new power-up (switchable) code:0d63/ea/fa cheat description:Most enemies and obstacles are invisible code:43aa/02/00+36c0/ea/c9 cheat description:Multi-jump code:518e/c2/c4+5193/c2/c4+5196/cb/18+5197/47/11 cheat description:Get 10 hearts for killing an enemy code:03e4/01/10 cheat description:Get 25 hearts for killing an enemy code:03e4/01/25 cheat description:Get 50 hearts for killing an enemy code:03e4/01/50 cheat description:Get 99 hearts for killing an enemy code:03e4/01/99 cheat description:Start as Small Wario code:7b7e/01/00 cheat description:Start as Bull Wario code:7b7e/01/02 cheat description:Start as Jet Wario code:7b7e/01/03 cheat description:Start as Dragon Wario code:7b7e/01/04 cheat description:Start with 10 hearts code:7b7c/00/10 cheat description:Start with 25 hearts code:7b7c/00/25 cheat description:Start with 50 hearts code:7b7c/00/50 cheat description:Start with 99 hearts code:7b7c/00/99 cheat description:Start with 10 coins code:7b7b/00/10 cheat description:Start with 25 coins code:7b7b/00/25 cheat description:Start with 50 coins code:7b7b/00/50 cheat description:Start with 99 coins code:7b7b/00/99 cheat description:Start with 10 lives code:7b7d/05/10 cheat description:Start with 25 lives code:7b7d/05/25 cheat description:Start with 50 lives code:7b7d/05/50 cheat description:Start with 99 lives code:7b7d/05/99 cheat description:Start on course 26 code:7b7f/00/01 cheat description:No turbo boost code:1240/3c/00 cheat description:Infinite turbo boost code:12ca/3d/00 cheat description:No lap timer code:53b7/22/00 cheat description:Start with 800cc bike code:4965/20/3e+4966/03/02+4967/af/00 cheat description:Start with 650cc bike code:4965/20/3e+4966/03/01+4967/af/00 cartridge sha256:a3bd35fb1d2466868b5308a45e8ad3844925bd5dfa819b27ff67d0391b8e3511 name:WCW Main Event (USA, Europe) cheat description:Infinite time code:233e/01/00 cheat description:One hit kills code:1606/30/18+1605/90/af cheat description:Never regain energy code:15d9/34/c9 cheat description:Computer does massive damage code:163e/01/09 cheat description:Faster timer code:233e/01/02 cartridge sha256:e424a9893faed6a486d66002ed606cf32d68dab71971ec461103396042800b63 name:Wendy - Every Witch Way (USA, Europe) cheat description:Infinite time code:7fab/22/00 cheat description:Hit anywhere code:6afa/20/af+6afb/5f/c9 cheat description:Shoot 3 projectiles from wand code:5f9a/c2/c3 cartridge sha256:b915f6ffe0dd3ab9fe8972468013334a0c6d3f664982bc8ed8888e54d5bbbebf name:Who Wants to Be a Millionaire - 2nd Edition (USA) cheat description:Always correct code:18ff/28/18 cartridge sha256:db8029c84c99c1bff1724656d0887636497986fac02892f4d4334c60f646c84f name:Wild Snake (USA) (SGB Enhanced) cheat description:Infinite time in King Cobra mode code:0b1e/ea/fa cheat description:All snakes are shorter code:227e/30/3e+227f/f5/03 cheat description:Only plain yellow snakes fall code:2315/79/3e+2316/a7/01 cheat description:Only zig-zag snakes fall code:2315/79/3e+2316/a7/02 cheat description:Only dark dotted snakes fall code:2315/79/3e+2316/a7/03 cheat description:Only light dotted snakes fall code:2315/79/3e+2316/a7/04 cheat description:Only dark striped snakes fall code:2315/79/3e+2316/a7/05 cheat description:Only light striped snakes fall code:2315/79/3e+2316/a7/06 cheat description:Only vertically striped snakes fall code:2315/79/3e+2316/a7/07 cheat description:Only checkered snake snakes fall code:2315/79/3e+2316/a7/08 cheat description:Only skeleton snakes fall code:2315/79/3e+2316/a7/0a cheat description:Only temporarily invisible snakes fall code:2315/79/3e+2316/a7/0b cheat description:Only dark snakes fall code:2315/79/3e+2316/a7/0c cheat description:Only wild snakes fall code:2315/79/3e+2316/a7/0d cheat description:Only king cobra snakes fall code:2315/79/3e+2316/a7/0e cheat description:Collect 1 snake in King Cobra mode and finish level code:26df/fa/3e+26e1/c8/3e+26e2/3c/30 cheat description:Snakes fall very fast code:4553/fa/3e+4554/4b/01+4555/c6/00 cheat description:Snakes fall extremely fast code:4553/fa/3e+4554/4b/00+4555/c6/00 cheat description:Snakes fall slower code:4553/fa/3e+4554/4b/05+4555/c6/00 cheat description:Snakes fall very slow code:4553/fa/3e+4554/4b/1f+4555/c6/00 cheat description:Snakes fall extremely slow code:4553/fa/3e+4554/4b/af+4555/c6/00 cartridge sha256:b396d2a15563b6144630d5ec5f0a8a2928a4b289ca215e6cc581df7a5fe295ff name:WordZap (USA) cheat description:Infinite hints code:0870/35/00 cheat description:Start with only 1 hint code:1bc9/04/01 cheat description:Start with 5 hints code:1bc9/04/05 cheat description:Start with 9 hints code:1bc9/04/09 cheat description:Start with 1 chance code:1bce/03/01 cheat description:Start with 9 chances code:1bce/03/09 cartridge sha256:439854d8d2ec85bffb171efe3ec0d6ba98fed2443b26053340daaf8190611859 name:World Bowling (USA) cheat description:Always bowl at full power code:4694/c6/3e+4695/09/ff cheat description:Get a spare even if you miss code:5344/79/3e+5345/90/0a cartridge sha256:246d48cb2a6ed53a7cf78d94fc219762aaaea0111467a5fcf415ca76f9170124 name:World Circuit Series (USA) cheat description:No loss of speed on course you take your finger from acceleration button code:1ca0/3d/00 cheat description:No loss of speed when you leave course-except hitting walls code:1ae2/35/00 cheat description:No qualifying timer code:0384/35/00+0385/c0/c9 cartridge sha256:03e6c6bcd5c9942a7fd30917c70524f961e152bdd3b4e70bf1fd9f012635c065 name:World Heroes 2 Jet (USA, Europe) (SGB Enhanced) cheat description:Hit anywhere - both players code:46a1/ca/fa+452c/20/18 cartridge sha256:0ba3d3b9be8c615bd29956887584aff9446a88fb2606bfb8ccc75907164c4cf9 name:WWF King of the Ring (USA, Europe) cheat description:No out of ring timer code:2c0f/01/00 cartridge sha256:770a3c6cd89d34af0d452eb4f52cd5a2f9d2651b9b54b247de349ff701f59a52 name:WWF Raw (USA, Europe) cheat description:Infinite health - P1 code:0154/cf/10 cheat description:No health - P2 code:0100/cf/4f cartridge sha256:e5971b4a0c14a8dc06386844975ea76a65a9f81539e43bbe90a6bed198990b15 name:WWF WrestleMania 2000 (USA, Europe) cheat description:Infinite health - P1 code:0164/c0/b8 cheat description:Infinite health - P2 code:0184/c0/f9 cheat description:No health - P1 code:0100/c0/b8 cheat description:No health - P2 code:0100/c0/f9 cheat description:Always fight in cage code:0102/c6/94 cheat description:Always fight in ring code:0101/c6/94 cartridge sha256:85c5368af171f9c47e02157222f140ad44ee9f9307f31838ffe9430793d80c65 name:X-Men - Mutant Academy (USA, Europe) cheat description:Hit anywhere - both players code:5465/28/18+5466/01/12+52e6/d0/c9 cartridge sha256:e8b42d935ea865f0b00f2a5447c8695799116e33dea30eaec5159ce7df225348 name:X-Men - Mutant Wars (USA, Europe) cheat description:Invincibility code:1699/30/18 cheat description:Hit anywhere code:15fa/35/00 cheat description:One hit kills code:7225/28/18 cheat description:One hit kills - bosses code:40a4/38/18 cartridge sha256:3843f2cdb0746ff0cf7dc97e1aab4fc6a15219e7ac8e1970ead475a835c57aea name:Xenon 2 - Megablast (USA, Europe) cheat description:Invincibility code:1e50/ea/fa cheat description:Infinite energy code:2416/ea/fa cheat description:Infinite lives code:02eb/ea/fa cheat description:Purchases at shop are free code:36db/21/c9 cheat description:When you die you get an awesome ship (for a while) code:02f4/af/00 cheat description:Start with very little energy code:0308/12/01 cheat description:Start with 1/3 energy code:0308/12/05 cheat description:Start with 1/2 energy code:0308/12/09 cheat description:Start with 2,222,222 points code:0204/af/00 cheat description:Start with 1 life code:3175/05/01 cheat description:Start with 5 lives code:3175/05/05 cheat description:Start with 10 lives code:3175/05/0a cartridge sha256:79847fc3769d81c17f95f7d4797b25129c5bf416e9da2a16ab2d09d71e9b9bbe name:Yogi Bear - Great Balloon Blast (USA) cheat description:Power-up after almost every shot code:77cb/28/00 cheat description:Power-up after almost every shot (alt) code:0928/c9/26 cartridge sha256:98fb28e23fa2bdb969317544bf0fd5c24fb377134cac12897b29889bc67f6ca6 name:Yogi Bear in Yogi Bear's Goldrush (USA) cheat description:Power-up after almost every shot code:77cb/28/00 cartridge sha256:a41d3ab34e91fccdf6b4e3a203dbf606d1097b702039fdf2f252cb18c4c9f925 name:Yoshi (USA) cheat description:Always get half egg pieces code:1afc/11/1d+1afb/38/18+1af8/12/1e cheat description:At random intervals, 1 block comes down instead of 2 code:13bb/7e/00 cheat description:When setup screen appears, go to level select, push right once to start on level 6 code:2c70/fa/3e+2c71/b1/06+2c72/c6/22 cheat description:When setup screen appears, go to level select, push right once to start on level 8 code:2c70/fa/3e+2c71/b1/08+2c72/c6/22 cheat description:No timer for game B code:4c71/34/00 cartridge sha256:fb29a19cae1b04bf0f3e20e9f9853d62a5b3bf536c8aece32943442d5bb0a049 name:Yoshi's Cookie (USA, Europe) cheat description:Move one column to clear level code:13f8/f2/00 cartridge sha256:1f6a79c3a548718eea5cf530f30d67f8fd76ee9693cd2da164caef36d310a501 name:Zen - Intergalactic Ninja (USA) cheat description:Infinite lives code:196d/ea/fa cheat description:Infinite energy against bullets and most enemies code:4336/ea/fa+42a4/ea/fa cheat description:Instant staff power-up (hold B) code:2a3e/05/01 cheat description:No energy loss against fire code:51b1/ea/fa cheat description:No energy loss against hang-on enemies code:2fda/ea/fa cheat description:Start lives with 1/2 energy code:7166/0a/05 cheat description:Start each life with 7 energy points code:7166/0a/07 cheat description:Start with 1 life code:0591/03/01 cheat description:Start with 5 lives code:0591/03/05 cheat description:Start with 10 lives code:0591/03/0a phoenix/gtk/widget/console.cpp000664 001750 001750 00000005231 12651764221 017601 0ustar00sergiosergio000000 000000 namespace phoenix { static bool Console_keyPress(GtkWidget* widget, GdkEventKey* event, Console* self) { return self->p.keyPress(event->keyval, event->state); } void pConsole::print(string text) { seekCursorToEnd(); gtk_text_buffer_insert_at_cursor(textBuffer, text, -1); GtkTextMark* mark = gtk_text_buffer_get_mark(textBuffer, "insert"); gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(subWidget), mark); } void pConsole::reset() { gtk_text_buffer_set_text(textBuffer, "", -1); } void pConsole::constructor() { gtkWidget = gtk_scrolled_window_new(0, 0); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(gtkWidget), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(gtkWidget), GTK_SHADOW_ETCHED_IN); subWidget = gtk_text_view_new(); gtk_text_view_set_editable(GTK_TEXT_VIEW(subWidget), false); gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(subWidget), GTK_WRAP_NONE); gtk_container_add(GTK_CONTAINER(gtkWidget), subWidget); textBuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(subWidget)); GdkColor background = CreateColor(48, 24, 24); gtk_widget_modify_base(subWidget, GTK_STATE_NORMAL, &background); GdkColor foreground = CreateColor(255, 255, 255); gtk_widget_modify_text(subWidget, GTK_STATE_NORMAL, &foreground); g_signal_connect(G_OBJECT(subWidget), "key-press-event", G_CALLBACK(Console_keyPress), (gpointer)&console); gtk_widget_show(subWidget); } void pConsole::destructor() { gtk_widget_destroy(subWidget); gtk_widget_destroy(gtkWidget); } void pConsole::orphan() { destructor(); constructor(); } bool pConsole::keyPress(unsigned scancode, unsigned mask) { if(mask & (GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_SUPER_MASK)) return false; //allow actions such as Ctrl+C (copy) if(scancode == GDK_KEY_Return || scancode == GDK_KEY_KP_Enter) { print("\n"); if(console.onActivate) console.onActivate(command); command.reset(); return true; } if(scancode == GDK_KEY_BackSpace) { if(command.size()) { command.resize(command.size() - 1); GtkTextIter lhs, rhs; gtk_text_buffer_get_end_iter(textBuffer, &lhs); gtk_text_buffer_get_end_iter(textBuffer, &rhs); gtk_text_iter_set_offset(&lhs, gtk_text_iter_get_offset(&lhs) - 1); gtk_text_buffer_delete(textBuffer, &lhs, &rhs); seekCursorToEnd(); } return true; } if(scancode >= 0x20 && scancode <= 0x7e) { print({(char)scancode}); command.append((char)scancode); return true; } return false; } void pConsole::seekCursorToEnd() { GtkTextIter iter; gtk_text_buffer_get_end_iter(textBuffer, &iter); gtk_text_buffer_place_cursor(textBuffer, &iter); } } phoenix/reference/browser-window.hpp000664 001750 001750 00000000321 12651764221 021015 0ustar00sergiosergio000000 000000 namespace phoenix { struct pBrowserWindow { static string directory(BrowserWindow::State& state); static string open(BrowserWindow::State& state); static string save(BrowserWindow::State& state); }; } nall/dsp/resample/hermite.hpp000664 001750 001750 00000002742 12651764221 017407 0ustar00sergiosergio000000 000000 #ifdef NALL_DSP_INTERNAL_HPP struct ResampleHermite : Resampler { inline void setFrequency(); inline void clear(); inline void sample(); ResampleHermite(DSP& dsp) : Resampler(dsp) {} real fraction; real step; }; void ResampleHermite::setFrequency() { fraction = 0.0; step = dsp.settings.frequency / frequency; } void ResampleHermite::clear() { fraction = 0.0; } void ResampleHermite::sample() { while(fraction <= 1.0) { real channel[dsp.settings.channels]; for(unsigned n = 0; n < dsp.settings.channels; n++) { real a = dsp.buffer.read(n, -3); real b = dsp.buffer.read(n, -2); real c = dsp.buffer.read(n, -1); real d = dsp.buffer.read(n, -0); const real tension = 0.0; //-1 = low, 0 = normal, +1 = high const real bias = 0.0; //-1 = left, 0 = even, +1 = right real mu1, mu2, mu3, m0, m1, a0, a1, a2, a3; mu1 = fraction; mu2 = mu1 * mu1; mu3 = mu2 * mu1; m0 = (b - a) * (1.0 + bias) * (1.0 - tension) / 2.0; m0 += (c - b) * (1.0 - bias) * (1.0 - tension) / 2.0; m1 = (c - b) * (1.0 + bias) * (1.0 - tension) / 2.0; m1 += (d - c) * (1.0 - bias) * (1.0 - tension) / 2.0; a0 = +2 * mu3 - 3 * mu2 + 1; a1 = mu3 - 2 * mu2 + mu1; a2 = mu3 - mu2; a3 = -2 * mu3 + 3 * mu2; channel[n] = (a0 * b) + (a1 * m0) + (a2 * m1) + (a3 * c); } dsp.write(channel); fraction += step; } dsp.buffer.rdoffset++; fraction -= 1.0; } #endif sfc/controller/multitap/multitap.hpp000664 001750 001750 00000000246 12651764221 021057 0ustar00sergiosergio000000 000000 struct Multitap : Controller { uint2 data(); void latch(bool data); Multitap(bool port); private: bool latched; unsigned counter1; unsigned counter2; }; phoenix/qt/widget/000700 001750 001750 00000000000 12656700342 015254 5ustar00sergiosergio000000 000000 nall/string/char/strm.hpp000664 001750 001750 00000002142 12651764221 016556 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { //return = strlen(target) unsigned strmcpy(char* target, const char* source, unsigned length) { const char* origin = target; if(length) { while(*source && --length) *target++ = *source++; *target = 0; } return target - origin; } //return = strlen(target) unsigned strmcat(char* target, const char* source, unsigned length) { const char* origin = target; while(*target && length) target++, length--; return (target - origin) + strmcpy(target, source, length); } //return = true when all of source was copied bool strccpy(char* target, const char* source, unsigned length) { return !source[strmcpy(target, source, length)]; } //return = true when all of source was copied bool strccat(char* target, const char* source, unsigned length) { while(*target && length) target++, length--; return !source[strmcpy(target, source, length)]; } //return = reserved for future use void strpcpy(char*& target, const char* source, unsigned& length) { unsigned offset = strmcpy(target, source, length); target += offset, length -= offset; } } #endif sfc/chip/msu1/serialization.cpp000664 001750 001750 00000000713 12651764221 017655 0ustar00sergiosergio000000 000000 #ifdef MSU1_CPP void MSU1::serialize(serializer& s) { Thread::serialize(s); s.integer(boot); s.integer(mmio.data_offset); s.integer(mmio.audio_offset); s.integer(mmio.audio_loop_offset); s.integer(mmio.audio_track); s.integer(mmio.audio_volume); s.integer(mmio.data_busy); s.integer(mmio.audio_busy); s.integer(mmio.audio_repeat); s.integer(mmio.audio_play); s.integer(mmio.audio_error); data_open(); audio_open(); } #endif phoenix/000700 001750 001750 00000000000 12656700342 013345 5ustar00sergiosergio000000 000000 profile/Game Boy Advance.sys/manifest.bml000664 001750 001750 00000000104 12651764221 021367 0ustar00sergiosergio000000 000000 system name:Game Boy Advance cpu rom name=bios.rom size=16384 nall/beat/metadata.hpp000664 001750 001750 00000005375 12651764221 016054 0ustar00sergiosergio000000 000000 #ifndef NALL_BEAT_METADATA_HPP #define NALL_BEAT_METADATA_HPP #include #include #include #include #include namespace nall { struct bpsmetadata { inline bool load(const string& filename); inline bool save(const string& filename, const string& metadata); inline string metadata() const; protected: file sourceFile; string metadataString; }; bool bpsmetadata::load(const string& filename) { if(sourceFile.open(filename, file::mode::read) == false) return false; auto read = [&]() -> uint8_t { return sourceFile.read(); }; auto decode = [&]() -> uint64_t { uint64_t data = 0, shift = 1; while(true) { uint8_t x = read(); data += (x & 0x7f) * shift; if(x & 0x80) break; shift <<= 7; data += shift; } return data; }; if(read() != 'B') return false; if(read() != 'P') return false; if(read() != 'S') return false; if(read() != '1') return false; decode(); decode(); unsigned metadataSize = decode(); char data[metadataSize + 1]; for(unsigned n = 0; n < metadataSize; n++) data[n] = read(); data[metadataSize] = 0; metadataString = (const char*)data; return true; } bool bpsmetadata::save(const string& filename, const string& metadata) { file targetFile; if(targetFile.open(filename, file::mode::write) == false) return false; if(sourceFile.open() == false) return false; sourceFile.seek(0); auto read = [&]() -> uint8_t { return sourceFile.read(); }; auto decode = [&]() -> uint64_t { uint64_t data = 0, shift = 1; while(true) { uint8_t x = read(); data += (x & 0x7f) * shift; if(x & 0x80) break; shift <<= 7; data += shift; } return data; }; uint32_t checksum = ~0; auto write = [&](uint8_t data) { targetFile.write(data); checksum = crc32_adjust(checksum, data); }; auto encode = [&](uint64_t data) { while(true) { uint64_t x = data & 0x7f; data >>= 7; if(data == 0) { write(0x80 | x); break; } write(x); data--; } }; for(unsigned n = 0; n < 4; n++) write(read()); encode(decode()); encode(decode()); unsigned sourceLength = decode(); unsigned targetLength = metadata.length(); encode(targetLength); sourceFile.seek(sourceLength, file::index::relative); for(unsigned n = 0; n < targetLength; n++) write(metadata[n]); unsigned length = sourceFile.size() - sourceFile.offset() - 4; for(unsigned n = 0; n < length; n++) write(read()); uint32_t outputChecksum = ~checksum; for(unsigned n = 0; n < 32; n += 8) write(outputChecksum >> n); targetFile.close(); return true; } string bpsmetadata::metadata() const { return metadataString; } } #endif sfc/chip/st0010/serialization.cpp000664 001750 001750 00000000125 12651764221 017714 0ustar00sergiosergio000000 000000 #ifdef ST0010_CPP void ST0010::serialize(serializer &s) { s.array(ram); } #endif sfc/cpu/cpu.hpp000664 001750 001750 00000005216 12651764221 014556 0ustar00sergiosergio000000 000000 struct CPU : Processor::R65816, Thread, public PPUcounter { uint8 wram[128 * 1024]; enum : bool { Threaded = true }; vector coprocessors; alwaysinline void step(unsigned clocks); alwaysinline void synchronize_smp(); void synchronize_ppu(); void synchronize_coprocessors(); void synchronize_controllers(); uint8 port_read(uint2 port) const; void port_write(uint2 port, uint8 data); uint8 pio(); bool joylatch(); alwaysinline bool interrupt_pending() { return status.interrupt_pending; } void enter(); void enable(); void power(); void reset(); void serialize(serializer&); CPU(); ~CPU(); privileged: unsigned cpu_version = 2; //allowed: 1, 2 #include "dma/dma.hpp" #include "memory/memory.hpp" #include "mmio/mmio.hpp" #include "timing/timing.hpp" struct Status { bool interrupt_pending; unsigned clock_count; unsigned line_clocks; //timing bool irq_lock; unsigned dram_refresh_position; bool dram_refreshed; unsigned hdma_init_position; bool hdma_init_triggered; unsigned hdma_position; bool hdma_triggered; bool nmi_valid; bool nmi_line; bool nmi_transition; bool nmi_pending; bool nmi_hold; bool irq_valid; bool irq_line; bool irq_transition; bool irq_pending; bool irq_hold; bool reset_pending; //DMA bool dma_active; unsigned dma_counter; unsigned dma_clocks; bool dma_pending; bool hdma_pending; bool hdma_mode; //0 = init, 1 = run //auto joypad polling bool auto_joypad_active; bool auto_joypad_latch; unsigned auto_joypad_counter; unsigned auto_joypad_clock; //MMIO //$2140-217f uint8 port[4]; //$2181-$2183 uint17 wram_addr; //$4016-$4017 bool joypad_strobe_latch; uint32 joypad1_bits; uint32 joypad2_bits; //$4200 bool nmi_enabled; bool hirq_enabled, virq_enabled; bool auto_joypad_poll; //$4201 uint8 pio; //$4202-$4203 uint8 wrmpya; uint8 wrmpyb; //$4204-$4206 uint16 wrdiva; uint8 wrdivb; //$4207-$420a uint9 hirq_pos; uint9 virq_pos; //$420d unsigned rom_speed; //$4214-$4217 uint16 rddiv; uint16 rdmpy; //$4218-$421f uint16 joy1; uint16 joy2; uint16 joy3; uint16 joy4; } status; struct ALU { unsigned mpyctr; unsigned divctr; unsigned shift; } alu; static void Enter(); void op_step(); struct Debugger { hook op_exec; hook op_read; hook op_write; hook op_nmi; hook op_irq; } debugger; }; extern CPU cpu; sfc/cpu/dma/000700 001750 001750 00000000000 12656700342 013776 5ustar00sergiosergio000000 000000 phoenix/reference/widget/000700 001750 001750 00000000000 12656700342 016566 5ustar00sergiosergio000000 000000 sfc/alt/ppu-performance/background/mode7.cpp000664 001750 001750 00000006057 12651764221 022214 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP #define Clip(x) (((x) & 0x2000) ? ((x) | ~0x03ff) : ((x) & 0x03ff)) void PPU::Background::render_mode7() { signed px, py; signed tx, ty, tile, palette; signed a = sclip<16>(self.regs.m7a); signed b = sclip<16>(self.regs.m7b); signed c = sclip<16>(self.regs.m7c); signed d = sclip<16>(self.regs.m7d); signed cx = sclip<13>(self.regs.m7x); signed cy = sclip<13>(self.regs.m7y); signed hofs = sclip<13>(self.regs.mode7_hoffset); signed vofs = sclip<13>(self.regs.mode7_voffset); signed y = (self.regs.mode7_vflip == false ? self.vcounter() : 255 - self.vcounter()); uint16* mosaic_x; uint16* mosaic_y; if(id == ID::BG1) { mosaic_x = mosaic_table[self.bg1.regs.mosaic]; mosaic_y = mosaic_table[self.bg1.regs.mosaic]; } else { mosaic_x = mosaic_table[self.bg2.regs.mosaic]; mosaic_y = mosaic_table[self.bg1.regs.mosaic]; } unsigned priority0 = (priority0_enable ? regs.priority0 : 0); unsigned priority1 = (priority1_enable ? regs.priority1 : 0); if(priority0 + priority1 == 0) return; signed psx = ((a * Clip(hofs - cx)) & ~63) + ((b * Clip(vofs - cy)) & ~63) + ((b * mosaic_y[y]) & ~63) + (cx << 8); signed psy = ((c * Clip(hofs - cx)) & ~63) + ((d * Clip(vofs - cy)) & ~63) + ((d * mosaic_y[y]) & ~63) + (cy << 8); for(signed x = 0; x < 256; x++) { px = (psx + (a * mosaic_x[x])) >> 8; py = (psy + (c * mosaic_x[x])) >> 8; switch(self.regs.mode7_repeat) { case 0: case 1: { px &= 1023; py &= 1023; tx = ((px >> 3) & 127); ty = ((py >> 3) & 127); tile = ppu.vram[(ty * 128 + tx) << 1]; palette = ppu.vram[(((tile << 6) + ((py & 7) << 3) + (px & 7)) << 1) + 1]; break; } case 2: { if((px | py) & ~1023) { palette = 0; } else { px &= 1023; py &= 1023; tx = ((px >> 3) & 127); ty = ((py >> 3) & 127); tile = ppu.vram[(ty * 128 + tx) << 1]; palette = ppu.vram[(((tile << 6) + ((py & 7) << 3) + (px & 7)) << 1) + 1]; } break; } case 3: { if((px | py) & ~1023) { tile = 0; } else { px &= 1023; py &= 1023; tx = ((px >> 3) & 127); ty = ((py >> 3) & 127); tile = ppu.vram[(ty * 128 + tx) << 1]; } palette = ppu.vram[(((tile << 6) + ((py & 7) << 3) + (px & 7)) << 1) + 1]; break; } } unsigned priority; if(id == ID::BG1) { priority = priority0; } else { priority = (palette & 0x80 ? priority1 : priority0); palette &= 0x7f; } if(palette == 0) continue; unsigned plot_x = (self.regs.mode7_hflip == false ? x : 255 - x); unsigned color; if(self.screen.regs.direct_color && id == ID::BG1) { color = self.screen.get_direct_color(0, palette); } else { color = self.screen.get_palette(palette); } if(regs.main_enable && !window.main[plot_x]) self.screen.output.plot_main(plot_x, color, priority, id); if(regs.sub_enable && !window.sub[plot_x]) self.screen.output.plot_sub(plot_x, color, priority, id); } } #undef Clip #endif gba/Makefile000664 001750 001750 00000001676 12651764221 014113 0ustar00sergiosergio000000 000000 gba_objects := gba-memory gba-interface gba-scheduler gba-system gba_objects += gba-video gba-cartridge gba-player gba_objects += gba-cpu gba-ppu gba-apu objects += $(gba_objects) obj/gba-memory.o: $(gba)/memory/memory.cpp $(call rwildcard,$(gba)/memory) obj/gba-interface.o: $(gba)/interface/interface.cpp $(call rwildcard,$(gba)/interface) obj/gba-scheduler.o: $(gba)/scheduler/scheduler.cpp $(call rwildcard,$(gba)/scheduler) obj/gba-system.o: $(gba)/system/system.cpp $(call rwildcard,$(gba)/system) obj/gba-video.o: $(gba)/video/video.cpp $(call rwildcard,$(gba)/video) obj/gba-cartridge.o: $(gba)/cartridge/cartridge.cpp $(call rwildcard,$(gba)/cartridge) obj/gba-player.o: $(gba)/player/player.cpp $(call rwildcard,$(gba)/player) obj/gba-cpu.o: $(gba)/cpu/cpu.cpp $(call rwildcard,$(gba)/cpu) obj/gba-ppu.o: $(gba)/ppu/ppu.cpp $(call rwildcard,$(gba)/ppu) obj/gba-apu.o: $(gba)/apu/apu.cpp $(call rwildcard,$(gba)/apu) phoenix/windows/phoenix.Manifest000664 001750 001750 00000001332 12651764221 020215 0ustar00sergiosergio000000 000000 true sfc/cpu/dma/dma.hpp000664 001750 001750 00000002550 12651764221 015267 0ustar00sergiosergio000000 000000 struct { //$420b bool dma_enabled; //$420c bool hdma_enabled; //$43x0 bool direction; bool indirect; bool unused; bool reverse_transfer; bool fixed_transfer; uint3 transfer_mode; //$43x1 uint8 dest_addr; //$43x2-$43x3 uint16 source_addr; //$43x4 uint8 source_bank; //$43x5-$43x6 union { uint16 transfer_size; uint16 indirect_addr; }; //$43x7 uint8 indirect_bank; //$43x8-$43x9 uint16 hdma_addr; //$43xa uint8 line_counter; //$43xb/$43xf uint8 unknown; //internal state bool hdma_completed; bool hdma_do_transfer; } channel[8]; struct { bool valid; unsigned addr; uint8 data; } pipe; void dma_add_clocks(unsigned clocks); bool dma_transfer_valid(uint8 bbus, uint32 abus); bool dma_addr_valid(uint32 abus); uint8 dma_read(uint32 abus); void dma_write(bool valid, unsigned addr = 0, uint8 data = 0); void dma_transfer(bool direction, uint8 bbus, uint32 abus); uint8 dma_bbus(unsigned i, unsigned channel); uint32 dma_addr(unsigned i); uint32 hdma_addr(unsigned i); uint32 hdma_iaddr(unsigned i); uint8 dma_enabled_channels(); bool hdma_active(unsigned i); bool hdma_active_after(unsigned i); uint8 hdma_enabled_channels(); uint8 hdma_active_channels(); void dma_run(); void hdma_update(unsigned i); void hdma_run(); void hdma_init_reset(); void hdma_init(); void dma_power(); void dma_reset(); nall/string/ref.hpp000664 001750 001750 00000001335 12651764221 015433 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { struct stringref { operator const char*() const { return _data; } const char* data() const { return _data; } unsigned size() const { if(!_initialized) { _initialized = true; _size = strlen(_data); } return _size; } stringref() = delete; stringref(const stringref& source) = delete; stringref(stringref&& source) = delete; stringref(const char* source) { _data = source; _initialized = false; } stringref(const string& source) { _data = source.data(); _size = source.size(); _initialized = true; } protected: const char* _data; mutable unsigned _size; mutable bool _initialized; }; } #endif sfc/chip/superfx/core/000700 001750 001750 00000000000 12656700342 016015 5ustar00sergiosergio000000 000000 phoenix/windows/widget/combo-button.cpp000664 001750 001750 00000004474 12651764221 021464 0ustar00sergiosergio000000 000000 namespace phoenix { void pComboButton::append(string text) { SendMessage(hwnd, CB_ADDSTRING, 0, (LPARAM)(wchar_t*)utf16_t(text)); if(SendMessage(hwnd, CB_GETCOUNT, 0, 0) == 1) setSelection(0); } Size pComboButton::minimumSize() { unsigned maximumWidth = 0; for(auto& text : comboButton.state.text) maximumWidth = max(maximumWidth, pFont::size(hfont, text).width); return {maximumWidth + 24, pFont::size(hfont, " ").height + 10}; } void pComboButton::remove(unsigned selection) { locked = true; SendMessage(hwnd, CB_DELETESTRING, selection, 0); locked = false; if(selection == comboButton.state.selection) comboButton.setSelection(0); } void pComboButton::reset() { SendMessage(hwnd, CB_RESETCONTENT, 0, 0); } void pComboButton::setGeometry(Geometry geometry) { //height = minimum drop-down list height; use CB_SETITEMHEIGHT to control actual widget height pWidget::setGeometry({geometry.x, geometry.y, geometry.width, 1}); RECT rc; GetWindowRect(hwnd, &rc); unsigned adjustedHeight = geometry.height - ((rc.bottom - rc.top) - SendMessage(hwnd, CB_GETITEMHEIGHT, (WPARAM)-1, 0)); SendMessage(hwnd, CB_SETITEMHEIGHT, (WPARAM)-1, adjustedHeight); } void pComboButton::setSelection(unsigned selection) { SendMessage(hwnd, CB_SETCURSEL, selection, 0); } void pComboButton::setText(unsigned selection, string text) { locked = true; SendMessage(hwnd, CB_DELETESTRING, selection, 0); SendMessage(hwnd, CB_INSERTSTRING, selection, (LPARAM)(wchar_t*)utf16_t(text)); setSelection(comboButton.state.selection); locked = false; } void pComboButton::constructor() { hwnd = CreateWindow( L"COMBOBOX", L"", WS_CHILD | WS_TABSTOP | CBS_DROPDOWNLIST | CBS_HASSTRINGS, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&comboButton); setDefaultFont(); for(auto& text : comboButton.state.text) append(text); setSelection(comboButton.state.selection); synchronize(); } void pComboButton::destructor() { DestroyWindow(hwnd); } void pComboButton::orphan() { destructor(); constructor(); } void pComboButton::onChange() { unsigned selection = SendMessage(hwnd, CB_GETCURSEL, 0, 0); if(selection == comboButton.state.selection) return; comboButton.state.selection = selection; if(comboButton.onChange) comboButton.onChange(); } } sfc/chip/msu1/msu1.cpp000664 001750 001750 00000011331 12651764221 015663 0ustar00sergiosergio000000 000000 #include #define MSU1_CPP namespace SuperFamicom { MSU1 msu1; #include "serialization.cpp" void MSU1::Enter() { msu1.enter(); } void MSU1::enter() { if(boot == true) { boot = false; for(unsigned addr = 0x2000; addr <= 0x2007; addr++) mmio_write(addr, 0x00); } while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } int16 left = 0, right = 0; if(mmio.audio_play) { if(audiofile.open()) { if(audiofile.end()) { if(!mmio.audio_repeat) { mmio.audio_play = false; audiofile.seek(mmio.audio_offset = 8); } else { audiofile.seek(mmio.audio_offset = mmio.audio_loop_offset); } } else { mmio.audio_offset += 4; left = audiofile.readl(2); right = audiofile.readl(2); } } else { mmio.audio_play = false; } } signed lchannel = (double)left * (double)mmio.audio_volume / 255.0; signed rchannel = (double)right * (double)mmio.audio_volume / 255.0; left = sclamp<16>(lchannel); right = sclamp<16>(rchannel); if(dsp.mute()) left = 0, right = 0; audio.coprocessor_sample(left, right); step(1); synchronize_cpu(); } } void MSU1::init() { } void MSU1::load() { data_open(); } void MSU1::unload() { if(datafile.open()) datafile.close(); if(audiofile.open()) audiofile.close(); } void MSU1::power() { audio.coprocessor_enable(true); audio.coprocessor_frequency(44100.0); } void MSU1::reset() { create(MSU1::Enter, 44100); boot = true; mmio.data_offset = 0; mmio.audio_offset = 0; mmio.audio_track = 0; mmio.audio_volume = 255; mmio.data_busy = true; mmio.audio_busy = true; mmio.audio_repeat = false; mmio.audio_play = false; mmio.audio_error = false; } void MSU1::data_open() { if(datafile.open()) datafile.close(); auto document = Markup::Document(cartridge.information.markup.cartridge); string name = document["cartridge/msu1/rom/name"].data; if(name.empty()) name = "msu1.rom"; if(datafile.open({interface->path(ID::SuperFamicom), name}, file::mode::read)) { datafile.seek(mmio.data_offset); } } void MSU1::audio_open() { if(audiofile.open()) audiofile.close(); auto document = Markup::Document(cartridge.information.markup.cartridge); string name = {"track-", mmio.audio_track, ".pcm"}; for(auto track : document.find("cartridge/msu1/track")) { if(numeral(track["number"].data) != mmio.audio_track) continue; name = track["name"].data; break; } if(audiofile.open({interface->path(ID::SuperFamicom), name}, file::mode::read)) { audiofile.seek(mmio.audio_offset); } } uint8 MSU1::mmio_read(unsigned addr) { cpu.synchronize_coprocessors(); addr = 0x2000 | (addr & 7); switch(addr) { case 0x2000: return (mmio.data_busy << 7) | (mmio.audio_busy << 6) | (mmio.audio_repeat << 5) | (mmio.audio_play << 4) | (mmio.audio_error << 3) | (Revision << 0); case 0x2001: if(mmio.data_busy) return 0x00; mmio.data_offset++; if(datafile.open()) return datafile.read(); return 0x00; case 0x2002: return 'S'; case 0x2003: return '-'; case 0x2004: return 'M'; case 0x2005: return 'S'; case 0x2006: return 'U'; case 0x2007: return '1'; } // NOT REACHED return 0; } void MSU1::mmio_write(unsigned addr, uint8 data) { cpu.synchronize_coprocessors(); addr = 0x2000 | (addr & 7); switch(addr) { case 0x2000: mmio.data_offset = (mmio.data_offset & 0xffffff00) | (data << 0); break; case 0x2001: mmio.data_offset = (mmio.data_offset & 0xffff00ff) | (data << 8); break; case 0x2002: mmio.data_offset = (mmio.data_offset & 0xff00ffff) | (data << 16); break; case 0x2003: mmio.data_offset = (mmio.data_offset & 0x00ffffff) | (data << 24); if(datafile.open()) datafile.seek(mmio.data_offset); mmio.data_busy = false; break; case 0x2004: mmio.audio_track = (mmio.audio_track & 0xff00) | (data << 0); break; case 0x2005: mmio.audio_track = (mmio.audio_track & 0x00ff) | (data << 8); mmio.audio_offset = 0; audio_open(); if(audiofile.open()) { uint32 header = audiofile.readm(4); if(header != 0x4d535531) { //verify 'MSU1' header audiofile.close(); } else { mmio.audio_loop_offset = 8 + audiofile.readl(4) * 4; mmio.audio_offset = 8; } } mmio.audio_busy = false; mmio.audio_repeat = false; mmio.audio_play = false; mmio.audio_error = !audiofile.open(); break; case 0x2006: mmio.audio_volume = data; break; case 0x2007: mmio.audio_repeat = data & 2; mmio.audio_play = data & 1; break; } } } phoenix/gtk/widget/radio-button.cpp000664 001750 001750 00000005070 12651764221 020547 0ustar00sergiosergio000000 000000 namespace phoenix { static void RadioButton_activate(GtkToggleButton* toggleButton, RadioButton* self) { self->p.onActivate(); } Size pRadioButton::minimumSize() { Size size = pFont::size(widget.state.font, radioButton.state.text); if(radioButton.state.orientation == Orientation::Horizontal) { size.width += radioButton.state.image.width; size.height = max(radioButton.state.image.height, size.height); } if(radioButton.state.orientation == Orientation::Vertical) { size.width = max(radioButton.state.image.width, size.width); size.height += radioButton.state.image.height; } return {size.width + 24, size.height + 12}; } void pRadioButton::setChecked() { parent().locked = true; for(auto& item : radioButton.state.group) { bool checked = &item == &radioButton; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(item.p.gtkWidget), item.state.checked = checked); } parent().locked = false; } void pRadioButton::setGroup(const group& group) { parent().locked = true; for(auto& item : radioButton.state.group) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(item.p.gtkWidget), item.state.checked); } parent().locked = false; } void pRadioButton::setImage(const image& image, Orientation orientation) { if(image.empty() == false) { GtkImage* gtkImage = CreateImage(image); gtk_button_set_image(GTK_BUTTON(gtkWidget), (GtkWidget*)gtkImage); } else { gtk_button_set_image(GTK_BUTTON(gtkWidget), nullptr); } switch(orientation) { case Orientation::Horizontal: gtk_button_set_image_position(GTK_BUTTON(gtkWidget), GTK_POS_LEFT); break; case Orientation::Vertical: gtk_button_set_image_position(GTK_BUTTON(gtkWidget), GTK_POS_TOP); break; } } void pRadioButton::setText(string text) { gtk_button_set_label(GTK_BUTTON(gtkWidget), text); setFont(widget.state.font); } void pRadioButton::constructor() { gtkWidget = gtk_toggle_button_new(); g_signal_connect(G_OBJECT(gtkWidget), "toggled", G_CALLBACK(RadioButton_activate), (gpointer)&radioButton); setGroup(radioButton.state.group); setText(radioButton.state.text); } void pRadioButton::destructor() { gtk_widget_destroy(gtkWidget); } void pRadioButton::orphan() { destructor(); constructor(); } void pRadioButton::onActivate() { if(parent().locked) return; bool wasChecked = radioButton.state.checked; setChecked(); if(!wasChecked) { if(radioButton.onActivate) radioButton.onActivate(); } } pRadioButton& pRadioButton::parent() { if(radioButton.state.group.size()) return radioButton.state.group.first().p; return *this; } } phoenix/cocoa/widget/viewport.cpp000664 001750 001750 00000002457 12651764221 020324 0ustar00sergiosergio000000 000000 @implementation CocoaViewport : NSView -(id) initWith:(phoenix::Viewport&)viewportReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { viewport = &viewportReference; } return self; } -(void) drawRect:(NSRect)rect { [[NSColor blackColor] setFill]; NSRectFillUsingOperation(rect, NSCompositeSourceOver); } -(BOOL) acceptsFirstResponder { return YES; } -(NSDragOperation) draggingEntered:(id)sender { return DropPathsOperation(sender); } -(BOOL) performDragOperation:(id)sender { lstring paths = DropPaths(sender); if(paths.empty()) return NO; if(viewport->onDrop) viewport->onDrop(paths); return YES; } -(void) keyDown:(NSEvent*)event { } -(void) keyUp:(NSEvent*)event { } @end namespace phoenix { uintptr_t pViewport::handle() { return (uintptr_t)cocoaViewport; } void pViewport::setDroppable(bool droppable) { @autoreleasepool { if(droppable) { [cocoaViewport registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]]; } else { [cocoaViewport unregisterDraggedTypes]; } } } void pViewport::constructor() { @autoreleasepool { cocoaView = cocoaViewport = [[CocoaViewport alloc] initWith:viewport]; } } void pViewport::destructor() { @autoreleasepool { [cocoaView release]; } } } sfc/cpu/memory/memory.cpp000664 001750 001750 00000001766 12651764221 016610 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP uint8 CPU::port_read(uint2 port) const { return status.port[port]; } void CPU::port_write(uint2 port, uint8 data) { status.port[port] = data; } void CPU::op_io() { status.clock_count = 6; dma_edge(); add_clocks(6); alu_edge(); } uint8 CPU::op_read(uint32 addr) { debugger.op_read(addr); status.clock_count = speed(addr); dma_edge(); add_clocks(status.clock_count - 4); regs.mdr = bus.read(addr); add_clocks(4); alu_edge(); return regs.mdr; } void CPU::op_write(uint32 addr, uint8 data) { debugger.op_write(addr, data); alu_edge(); status.clock_count = speed(addr); dma_edge(); add_clocks(status.clock_count); bus.write(addr, regs.mdr = data); } unsigned CPU::speed(unsigned addr) const { if(addr & 0x408000) { if(addr & 0x800000) return status.rom_speed; return 8; } if((addr + 0x6000) & 0x4000) return 8; if((addr - 0x4000) & 0x7e00) return 6; return 12; } uint8 CPU::disassembler_read(uint32 addr) { return bus.read(addr); } #endif phoenix/gtk/widget/radio-label.cpp000664 001750 001750 00000003467 12651764221 020323 0ustar00sergiosergio000000 000000 namespace phoenix { static void RadioLabel_activate(GtkToggleButton* toggleButton, RadioLabel* self) { self->p.onActivate(); } Size pRadioLabel::minimumSize() { Size size = pFont::size(widget.state.font, radioLabel.state.text); return {size.width + 28, size.height + 4}; } void pRadioLabel::setChecked() { parent().locked = true; for(auto& item : radioLabel.state.group) item.state.checked = false; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtkWidget), radioLabel.state.checked = true); parent().locked = false; } void pRadioLabel::setGroup(const group& group) { if(&parent() == this) return; parent().locked = true; gtk_radio_button_set_group( GTK_RADIO_BUTTON(gtkWidget), gtk_radio_button_get_group(GTK_RADIO_BUTTON(parent().gtkWidget)) ); for(auto& item : radioLabel.state.group) { if(item.state.checked) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(item.p.gtkWidget), true); break; } } parent().locked = false; } void pRadioLabel::setText(string text) { gtk_button_set_label(GTK_BUTTON(gtkWidget), text); } void pRadioLabel::constructor() { gtkWidget = gtk_radio_button_new_with_label(nullptr, ""); g_signal_connect(G_OBJECT(gtkWidget), "toggled", G_CALLBACK(RadioLabel_activate), (gpointer)&radioLabel); setGroup(radioLabel.state.group); setText(radioLabel.state.text); } void pRadioLabel::destructor() { gtk_widget_destroy(gtkWidget); } void pRadioLabel::orphan() { destructor(); constructor(); } void pRadioLabel::onActivate() { if(parent().locked) return; bool wasChecked = radioLabel.state.checked; setChecked(); if(wasChecked) return; if(radioLabel.onActivate) radioLabel.onActivate(); } pRadioLabel& pRadioLabel::parent() { if(radioLabel.state.group.size()) return radioLabel.state.group.first().p; return *this; } } sfc/chip/hitachidsp/mmio.hpp000664 001750 001750 00000001010 12651764221 017170 0ustar00sergiosergio000000 000000 struct MMIO { bool dma; //true during DMA transfers uint24 dma_source; //$1f40-$1f42 uint24 dma_length; //$1f43-$1f44 uint24 dma_target; //$1f45-$1f47 uint8 r1f48; //$1f48 uint24 program_offset; //$1f49-$1f4b uint8 r1f4c; //$1f4c uint16 page_number; //$1f4d-$1f4e uint8 program_counter; //$1f4f uint8 r1f50; //$1f50 uint8 r1f51; //$1f51 uint8 r1f52; //$1f52 uint8 vector[32]; //$1f60-$1f7f } mmio; target-ethos/window/window.cpp000664 001750 001750 00000002113 12651764221 017635 0ustar00sergiosergio000000 000000 #include "../ethos.hpp" WindowManager* windowManager = nullptr; void WindowManager::append(Window* window, string name) { window->setMenuFont(program->normalFont); window->setWidgetFont(program->normalFont); window->setStatusFont(program->boldFont); windowList.append({window, name, window->geometry().text()}); } void WindowManager::loadGeometry() { static bool initialized = false; if(initialized == false) { initialized = true; Configuration::Node geometry; for(auto& window : windowList) { geometry.append(window.geometry, window.name); } config.append(geometry, "Geometry"); } config.load(program->path("geometry.bml")); config.save(program->path("geometry.bml")); for(auto& window : windowList) { window.window->setGeometry(window.geometry); } } void WindowManager::saveGeometry() { for(auto& window : windowList) { window.geometry = window.window->geometry().text(); } config.save(program->path("geometry.bml")); } void WindowManager::hideAll() { for(auto& window : windowList) { window.window->setVisible(false); } } out/000700 001750 001750 00000000000 12656700342 012502 5ustar00sergiosergio000000 000000 gb/ppu/dmg.cpp000664 001750 001750 00000006636 12651764221 014372 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP //OB attributes: //0x80: 0 = OBJ above BG, 1 = BG above OBJ //0x40: vertical flip //0x20: horizontal flip //0x10: palette# void PPU::dmg_read_tile(bool select, unsigned x, unsigned y, unsigned& data) { unsigned tmaddr = 0x1800 + (select << 10), tdaddr; tmaddr += (((y >> 3) << 5) + (x >> 3)) & 0x03ff; if(status.bg_tiledata_select == 0) { tdaddr = 0x1000 + ((int8)vram[tmaddr] << 4); } else { tdaddr = 0x0000 + (vram[tmaddr] << 4); } tdaddr += (y & 7) << 1; data = vram[tdaddr + 0] << 0; data |= vram[tdaddr + 1] << 8; } void PPU::dmg_scanline() { px = 0; const unsigned Height = (status.ob_size == 0 ? 8 : 16); sprites = 0; //find first ten sprites on this scanline for(unsigned n = 0; n < 40 * 4; n += 4) { Sprite& s = sprite[sprites]; s.y = oam[n + 0] - 16; s.x = oam[n + 1] - 8; s.tile = oam[n + 2] & ~status.ob_size; s.attr = oam[n + 3]; s.y = status.ly - s.y; if(s.y >= Height) continue; if(s.attr & 0x40) s.y ^= (Height - 1); unsigned tdaddr = (s.tile << 4) + (s.y << 1); s.data = vram[tdaddr + 0] << 0; s.data |= vram[tdaddr + 1] << 8; if(s.attr & 0x20) s.data = hflip(s.data); if(++sprites == 10) break; } //sort by X-coordinate for(unsigned lo = 0; lo < sprites; lo++) { for(unsigned hi = lo + 1; hi < sprites; hi++) { if(sprite[hi].x < sprite[lo].x) std::swap(sprite[lo], sprite[hi]); } } } void PPU::dmg_run() { bg.color = 0; bg.palette = 0; ob.color = 0; ob.palette = 0; unsigned color = 0; if(status.display_enable) { if(status.bg_enable) dmg_run_bg(); if(status.window_display_enable) dmg_run_window(); if(status.ob_enable) dmg_run_ob(); if(ob.palette == 0) { color = bg.color; } else if(bg.palette == 0) { color = ob.color; } else if(ob.priority) { color = ob.color; } else { color = bg.color; } } uint32* output = screen + status.ly * 160 + px++; *output = color; } void PPU::dmg_run_bg() { unsigned scrolly = (status.ly + status.scy) & 255; unsigned scrollx = (px + status.scx) & 255; unsigned tx = scrollx & 7; if(tx == 0 || px == 0) dmg_read_tile(status.bg_tilemap_select, scrollx, scrolly, background.data); unsigned index = 0; index |= (background.data & (0x0080 >> tx)) ? 1 : 0; index |= (background.data & (0x8000 >> tx)) ? 2 : 0; bg.color = bgp[index]; bg.palette = index; } void PPU::dmg_run_window() { unsigned scrolly = status.ly - status.wy; unsigned scrollx = px + 7 - status.wx; if(scrolly >= 144u) return; //also matches underflow (scrolly < 0) if(scrollx >= 160u) return; //also matches underflow (scrollx < 0) unsigned tx = scrollx & 7; if(tx == 0 || px == 0) dmg_read_tile(status.window_tilemap_select, scrollx, scrolly, window.data); unsigned index = 0; index |= (window.data & (0x0080 >> tx)) ? 1 : 0; index |= (window.data & (0x8000 >> tx)) ? 2 : 0; bg.color = bgp[index]; bg.palette = index; } void PPU::dmg_run_ob() { //render backwards, so that first sprite has priority for(signed n = sprites - 1; n >= 0; n--) { Sprite& s = sprite[n]; signed tx = px - s.x; if(tx < 0 || tx > 7) continue; unsigned index = 0; index |= (s.data & (0x0080 >> tx)) ? 1 : 0; index |= (s.data & (0x8000 >> tx)) ? 2 : 0; if(index == 0) continue; ob.color = obp[(bool)(s.attr & 0x10)][index]; ob.palette = index; ob.priority = !(s.attr & 0x80); } } #endif nall/windows/detour.hpp000664 001750 001750 00000013447 12651764221 016354 0ustar00sergiosergio000000 000000 #ifndef NALL_WINDOWS_DETOUR_HPP #define NALL_WINDOWS_DETOUR_HPP #include #include #include #include #include namespace nall { #define Copy 0 #define RelNear 1 struct detour { static bool insert(const string& moduleName, const string& functionName, void*& source, void* target); static bool remove(const string& moduleName, const string& functionName, void*& source); protected: static unsigned length(const uint8_t* function); static unsigned mirror(uint8_t* target, const uint8_t* source); struct opcode { uint16_t prefix; unsigned length; unsigned mode; uint16_t modify; }; static opcode opcodes[]; }; //TODO: //* fs:, gs: should force another opcode copy //* conditional branches within +5-byte range should fail detour::opcode detour::opcodes[] = { { 0x50, 1 }, //push eax { 0x51, 1 }, //push ecx { 0x52, 1 }, //push edx { 0x53, 1 }, //push ebx { 0x54, 1 }, //push esp { 0x55, 1 }, //push ebp { 0x56, 1 }, //push esi { 0x57, 1 }, //push edi { 0x58, 1 }, //pop eax { 0x59, 1 }, //pop ecx { 0x5a, 1 }, //pop edx { 0x5b, 1 }, //pop ebx { 0x5c, 1 }, //pop esp { 0x5d, 1 }, //pop ebp { 0x5e, 1 }, //pop esi { 0x5f, 1 }, //pop edi { 0x64, 1 }, //fs: { 0x65, 1 }, //gs: { 0x68, 5 }, //push dword { 0x6a, 2 }, //push byte { 0x74, 2, RelNear, 0x0f84 }, //je near -> je far { 0x75, 2, RelNear, 0x0f85 }, //jne near -> jne far { 0x89, 2 }, //mov reg,reg { 0x8b, 2 }, //mov reg,reg { 0x90, 1 }, //nop { 0xa1, 5 }, //mov eax,[dword] { 0xeb, 2, RelNear, 0xe9 }, //jmp near -> jmp far }; bool detour::insert(const string& moduleName, const string& functionName, void*& source, void* target) { HMODULE module = GetModuleHandleW(utf16_t(moduleName)); if(!module) return false; uint8_t* sourceData = (uint8_t*)GetProcAddress(module, functionName); if(!sourceData) return false; unsigned sourceLength = detour::length(sourceData); if(sourceLength < 5) { //unable to clone enough bytes to insert hook #if 1 string output = { "detour::insert(", moduleName, "::", functionName, ") failed: " }; for(unsigned n = 0; n < 16; n++) output.append(hex<2>(sourceData[n]), " "); output.rtrim<1>(" "); MessageBoxA(0, output, "nall::detour", MB_OK); #endif return false; } uint8_t* mirrorData = new uint8_t[512](); detour::mirror(mirrorData, sourceData); DWORD privileges; VirtualProtect((void*)mirrorData, 512, PAGE_EXECUTE_READWRITE, &privileges); VirtualProtect((void*)sourceData, 256, PAGE_EXECUTE_READWRITE, &privileges); uintmax_t address = (uintmax_t)target - ((uintmax_t)sourceData + 5); sourceData[0] = 0xe9; //jmp target sourceData[1] = address >> 0; sourceData[2] = address >> 8; sourceData[3] = address >> 16; sourceData[4] = address >> 24; VirtualProtect((void*)sourceData, 256, privileges, &privileges); source = (void*)mirrorData; return true; } bool detour::remove(const string& moduleName, const string& functionName, void*& source) { HMODULE module = GetModuleHandleW(utf16_t(moduleName)); if(!module) return false; uint8_t* sourceData = (uint8_t*)GetProcAddress(module, functionName); if(!sourceData) return false; uint8_t* mirrorData = (uint8_t*)source; if(mirrorData == sourceData) return false; //hook was never installed unsigned length = detour::length(256 + mirrorData); if(length < 5) return false; DWORD privileges; VirtualProtect((void*)sourceData, 256, PAGE_EXECUTE_READWRITE, &privileges); for(unsigned n = 0; n < length; n++) sourceData[n] = mirrorData[256 + n]; VirtualProtect((void*)sourceData, 256, privileges, &privileges); source = (void*)sourceData; delete[] mirrorData; return true; } unsigned detour::length(const uint8_t* function) { unsigned length = 0; while(length < 5) { detour::opcode *opcode = 0; foreach(op, detour::opcodes) { if(function[length] == op.prefix) { opcode = &op; break; } } if(opcode == 0) break; length += opcode->length; } return length; } unsigned detour::mirror(uint8_t* target, const uint8_t* source) { const uint8_t *entryPoint = source; for(unsigned n = 0; n < 256; n++) target[256 + n] = source[n]; unsigned size = detour::length(source); while(size) { detour::opcode *opcode = 0; foreach(op, detour::opcodes) { if(*source == op.prefix) { opcode = &op; break; } } switch(opcode->mode) { case Copy: for(unsigned n = 0; n < opcode->length; n++) *target++ = *source++; break; case RelNear: { source++; uintmax_t sourceAddress = (uintmax_t)source + 1 + (int8_t)*source; *target++ = opcode->modify; if(opcode->modify >> 8) *target++ = opcode->modify >> 8; uintmax_t targetAddress = (uintmax_t)target + 4; uintmax_t address = sourceAddress - targetAddress; *target++ = address >> 0; *target++ = address >> 8; *target++ = address >> 16; *target++ = address >> 24; source += 2; } break; } size -= opcode->length; } uintmax_t address = (entryPoint + detour::length(entryPoint)) - (target + 5); *target++ = 0xe9; //jmp entryPoint *target++ = address >> 0; *target++ = address >> 8; *target++ = address >> 16; *target++ = address >> 24; return source - entryPoint; } #undef Implied #undef RelNear } #endif gb/cartridge/mbc2/mbc2.hpp000664 001750 001750 00000000276 12651764221 016430 0ustar00sergiosergio000000 000000 struct MBC2 : MMIO { bool ram_enable; //$0000-1fff uint8 rom_select; //$2000-3fff uint8 mmio_read(uint16 addr); void mmio_write(uint16 addr, uint8 data); void power(); } mbc2; phoenix/windows/widget/hex-edit.cpp000664 001750 001750 00000015344 12651764221 020561 0ustar00sergiosergio000000 000000 namespace phoenix { static LRESULT CALLBACK HexEdit_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { HexEdit& hexEdit = *(HexEdit*)GetWindowLongPtr(hwnd, GWLP_USERDATA); switch(msg) { case WM_KEYDOWN: if(hexEdit.p.keyPress(wparam)) return 0; break; case WM_MOUSEWHEEL: { signed offset = -((int16_t)HIWORD(wparam) / WHEEL_DELTA); hexEdit.p.scrollTo(hexEdit.p.scrollPosition() + offset); return true; } case WM_SIZE: { RECT rc; GetClientRect(hexEdit.p.hwnd, &rc); SetWindowPos(hexEdit.p.scrollBar, HWND_TOP, rc.right - 18, 0, 18, rc.bottom, SWP_SHOWWINDOW); break; } case WM_VSCROLL: { SCROLLINFO info; memset(&info, 0, sizeof(SCROLLINFO)); info.cbSize = sizeof(SCROLLINFO); info.fMask = SIF_ALL; GetScrollInfo((HWND)lparam, SB_CTL, &info); switch(LOWORD(wparam)) { case SB_LEFT: info.nPos = info.nMin; break; case SB_RIGHT: info.nPos = info.nMax; break; case SB_LINELEFT: info.nPos--; break; case SB_LINERIGHT: info.nPos++; break; case SB_PAGELEFT: info.nPos -= info.nMax >> 3; break; case SB_PAGERIGHT: info.nPos += info.nMax >> 3; break; case SB_THUMBTRACK: info.nPos = info.nTrackPos; break; } info.fMask = SIF_POS; SetScrollInfo((HWND)lparam, SB_CTL, &info, TRUE); GetScrollInfo((HWND)lparam, SB_CTL, &info); //get clamped position hexEdit.p.scrollTo(info.nPos); return TRUE; } } return hexEdit.p.windowProc(hwnd, msg, wparam, lparam); } void pHexEdit::setColumns(unsigned columns) { update(); } void pHexEdit::setLength(unsigned length) { SetScrollRange(scrollBar, SB_CTL, 0, rowsScrollable(), TRUE); EnableWindow(scrollBar, rowsScrollable() > 0); update(); } void pHexEdit::setOffset(unsigned offset) { SetScrollPos(scrollBar, SB_CTL, offset / hexEdit.state.columns, TRUE); update(); } void pHexEdit::setRows(unsigned rows) { update(); } void pHexEdit::update() { if(!hexEdit.onRead) { SetWindowText(hwnd, L""); return; } unsigned cursorPosition = Edit_GetSel(hwnd); string output; unsigned offset = hexEdit.state.offset; for(unsigned row = 0; row < hexEdit.state.rows; row++) { output.append(hex<8>(offset)); output.append(" "); string hexdata; string ansidata = " "; for(unsigned column = 0; column < hexEdit.state.columns; column++) { if(offset < hexEdit.state.length) { uint8_t data = hexEdit.onRead(offset++); hexdata.append(hex<2>(data)); hexdata.append(" "); ansidata.append(data >= 0x20 && data <= 0x7e ? (char)data : '.'); } else { hexdata.append(" "); ansidata.append(" "); } } output.append(hexdata); output.append(ansidata); if(offset >= hexEdit.state.length) break; if(row != hexEdit.state.rows - 1) output.append("\r\n"); } SetWindowText(hwnd, utf16_t(output)); Edit_SetSel(hwnd, LOWORD(cursorPosition), HIWORD(cursorPosition)); } void pHexEdit::constructor() { hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, L"EDIT", L"", WS_CHILD | WS_TABSTOP | ES_AUTOHSCROLL | ES_READONLY | ES_MULTILINE | ES_WANTRETURN, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&hexEdit); scrollBar = CreateWindowEx( 0, L"SCROLLBAR", L"", WS_VISIBLE | WS_CHILD | SBS_VERT, 0, 0, 0, 0, hwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(scrollBar, GWLP_USERDATA, (LONG_PTR)&hexEdit); windowProc = (WindowProc)GetWindowLongPtr(hwnd, GWLP_WNDPROC); SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)HexEdit_windowProc); setDefaultFont(); setLength(hexEdit.state.length); setOffset(hexEdit.state.offset); update(); PostMessage(hwnd, EM_SETSEL, 10, 10); synchronize(); } void pHexEdit::destructor() { DestroyWindow(hwnd); } void pHexEdit::orphan() { destructor(); constructor(); } bool pHexEdit::keyPress(unsigned scancode) { if(!hexEdit.onRead) return false; signed position = LOWORD(Edit_GetSel(hwnd)); signed lineWidth = 10 + (hexEdit.state.columns * 3) + 1 + hexEdit.state.columns + 2; signed cursorY = position / lineWidth; signed cursorX = position % lineWidth; if(scancode == VK_HOME) { signed offset = cursorY * lineWidth + 10; Edit_SetSel(hwnd, offset, offset); return true; } if(scancode == VK_END) { signed offset = cursorY * lineWidth + 57; Edit_SetSel(hwnd, offset, offset); return true; } if(scancode == VK_UP) { if(cursorY > 0) return false; scrollTo(scrollPosition() - 1); return true; } if(scancode == VK_DOWN) { if(cursorY >= rows() - 1) return true; if(cursorY < hexEdit.state.rows - 1) return false; scrollTo(scrollPosition() + 1); return true; } if(scancode == VK_PRIOR) { scrollTo(scrollPosition() - hexEdit.state.rows); return true; } if(scancode == VK_NEXT) { scrollTo(scrollPosition() + hexEdit.state.rows); return true; } //convert scancode to hex nibble if(scancode >= '0' && scancode <= '9') scancode = scancode - '0'; else if(scancode >= 'A' && scancode <= 'F') scancode = scancode - 'A' + 10; else if(scancode >= 'a' && scancode <= 'f') scancode = scancode - 'a' + 10; else return false; if(cursorX >= 10) { //not on an offset cursorX -= 10; if((cursorX % 3) != 2) { //not on a space bool cursorNibble = (cursorX % 3) == 1; //0 = high, 1 = low cursorX /= 3; if(cursorX < hexEdit.state.columns) { //not in ANSI region unsigned offset = hexEdit.state.offset + (cursorY * hexEdit.state.columns + cursorX); if(offset >= hexEdit.state.length) return false; //do not edit past end of data uint8_t data = hexEdit.onRead(offset); //write modified value if(cursorNibble == 1) { data = (data & 0xf0) | (scancode << 0); } else { data = (data & 0x0f) | (scancode << 4); } if(hexEdit.onWrite) hexEdit.onWrite(offset, data); //auto-advance cursor to next nibble or byte position++; if(cursorNibble && cursorX != hexEdit.state.columns - 1) position++; Edit_SetSel(hwnd, position, position); //refresh output to reflect modified data update(); } } } return true; } signed pHexEdit::rows() { return (max(1u, hexEdit.state.length) + hexEdit.state.columns - 1) / hexEdit.state.columns; } signed pHexEdit::rowsScrollable() { return max(0u, rows() - hexEdit.state.rows); } signed pHexEdit::scrollPosition() { return hexEdit.state.offset / hexEdit.state.columns; } void pHexEdit::scrollTo(signed position) { if(position > rowsScrollable()) position = rowsScrollable(); if(position < 0) position = 0; if(position == scrollPosition()) return; hexEdit.setOffset(position * hexEdit.state.columns); } } phoenix/qt/action/menu.cpp000664 001750 001750 00000003202 12651764221 016730 0ustar00sergiosergio000000 000000 namespace phoenix { void pMenu::append(Action& action) { if(dynamic_cast(&action)) { qtMenu->addMenu(((Menu&)action).p.qtMenu); } else if(dynamic_cast(&action)) { qtMenu->addAction(((Separator&)action).p.qtAction); } else if(dynamic_cast(&action)) { qtMenu->addAction(((Item&)action).p.qtAction); } else if(dynamic_cast(&action)) { qtMenu->addAction(((CheckItem&)action).p.qtAction); } else if(dynamic_cast(&action)) { qtMenu->addAction(((RadioItem&)action).p.qtAction); } } void pMenu::remove(Action& action) { if(dynamic_cast(&action)) { //QMenu::removeMenu() does not exist qtMenu->clear(); for(auto &action : menu.state.action) append(action); } else if(dynamic_cast(&action)) { qtMenu->removeAction(((Separator&)action).p.qtAction); } else if(dynamic_cast(&action)) { qtMenu->removeAction(((Item&)action).p.qtAction); } else if(dynamic_cast(&action)) { qtMenu->removeAction(((CheckItem&)action).p.qtAction); } else if(dynamic_cast(&action)) { qtMenu->removeAction(((CheckItem&)action).p.qtAction); } } void pMenu::setFont(string font) { qtMenu->setFont(pFont::create(font)); for(auto &item : menu.state.action) item.p.setFont(font); } void pMenu::setImage(const image& image) { qtMenu->setIcon(CreateIcon(image)); } void pMenu::setText(string text) { qtMenu->setTitle(QString::fromUtf8(text)); } void pMenu::constructor() { qtMenu = new QMenu; } void pMenu::destructor() { if(action.state.menu) action.state.menu->remove(menu); delete qtMenu; qtMenu = nullptr; } } fc/cartridge/board/nes-exrom.cpp000664 001750 001750 00000001343 12651764221 017755 0ustar00sergiosergio000000 000000 struct NES_ExROM : Board { enum class Revision : unsigned { EKROM, ELROM, ETROM, EWROM, } revision; MMC5 mmc5; void main() { mmc5.main(); } uint8 prg_read(unsigned addr) { return mmc5.prg_read(addr); } void prg_write(unsigned addr, uint8 data) { mmc5.prg_write(addr, data); } uint8 chr_read(unsigned addr) { return mmc5.chr_read(addr); } void chr_write(unsigned addr, uint8 data) { mmc5.chr_write(addr, data); } void scanline(unsigned y) { mmc5.scanline(y); } void power() { mmc5.power(); } void reset() { mmc5.reset(); } void serialize(serializer& s) { Board::serialize(s); mmc5.serialize(s); } NES_ExROM(Markup::Node& document) : Board(document), mmc5(*this) { revision = Revision::ELROM; } }; target-ethos/resource/resource.hpp000664 001750 001750 00000001032 12651764221 020501 0ustar00sergiosergio000000 000000 namespace resource { extern const uint8_t advanced[611]; extern const uint8_t audio[592]; extern const uint8_t cheatEditor[937]; extern const uint8_t folder[1176]; extern const uint8_t game[1490]; extern const uint8_t home[606]; extern const uint8_t hotkeys[587]; extern const uint8_t input[812]; extern const uint8_t server[408]; extern const uint8_t stateManager[378]; extern const uint8_t timing[897]; extern const uint8_t unverified[1675]; extern const uint8_t up[652]; extern const uint8_t video[662]; }; processor/r6502/serialization.cpp000664 001750 001750 00000000621 12651764221 020065 0ustar00sergiosergio000000 000000 void R6502::serialize(serializer& s) { s.integer(regs.mdr); s.integer(regs.pc); s.integer(regs.a); s.integer(regs.x); s.integer(regs.y); s.integer(regs.s); s.integer(regs.p.n); s.integer(regs.p.v); s.integer(regs.p.d); s.integer(regs.p.i); s.integer(regs.p.z); s.integer(regs.p.c); s.integer(abs.w); s.integer(iabs.w); s.integer(rd); s.integer(zp); s.integer(aa); } phoenix/cocoa/desktop.cpp000664 001750 001750 00000000734 12651764221 016627 0ustar00sergiosergio000000 000000 namespace phoenix { Size pDesktop::size() { @autoreleasepool { NSRect primary = [[[NSScreen screens] objectAtIndex:0] frame]; return {primary.size.width, primary.size.height}; } } Geometry pDesktop::workspace() { @autoreleasepool { auto screen = Desktop::size(); NSRect area = [[[NSScreen screens] objectAtIndex:0] visibleFrame]; return {area.origin.x, screen.height - area.size.height - area.origin.y, area.size.width, area.size.height}; } } } sfc/chip/dsp2/dsp2.cpp000664 001750 001750 00000006554 12651764221 015644 0ustar00sergiosergio000000 000000 #include #define DSP2_CPP namespace SuperFamicom { DSP2 dsp2; #include "serialization.cpp" #include "opcodes.cpp" void DSP2::init() { } void DSP2::load() { } void DSP2::unload() { } void DSP2::power() { } void DSP2::reset() { status.waiting_for_command = true; status.in_count = 0; status.in_index = 0; status.out_count = 0; status.out_index = 0; status.op05transparent = 0; status.op05haslen = false; status.op05len = 0; status.op06haslen = false; status.op06len = 0; status.op09word1 = 0; status.op09word2 = 0; status.op0dhaslen = false; status.op0doutlen = 0; status.op0dinlen = 0; } uint8 DSP2::read(unsigned addr) { if (addr & Select) { //sr return 0; } else { //dr uint8 r = 0xff; if(status.out_count) { r = status.output[status.out_index++]; status.out_index &= 511; if(status.out_count == status.out_index) { status.out_count = 0; } } return r; } } void DSP2::write(unsigned addr, uint8 data) { if (addr & Select) { //sr return; } else { //dr if(status.waiting_for_command) { status.command = data; status.in_index = 0; status.waiting_for_command = false; switch(data) { case 0x01: status.in_count = 32; break; case 0x03: status.in_count = 1; break; case 0x05: status.in_count = 1; break; case 0x06: status.in_count = 1; break; case 0x07: break; case 0x08: break; case 0x09: status.in_count = 4; break; case 0x0d: status.in_count = 2; break; case 0x0f: status.in_count = 0; break; } } else { status.parameters[status.in_index++] = data; status.in_index &= 511; } if(status.in_count == status.in_index) { status.waiting_for_command = true; status.out_index = 0; switch(status.command) { case 0x01: { status.out_count = 32; op01(); } break; case 0x03: { op03(); } break; case 0x05: { if(status.op05haslen) { status.op05haslen = false; status.out_count = status.op05len; op05(); } else { status.op05len = status.parameters[0]; status.in_index = 0; status.in_count = status.op05len * 2; status.op05haslen = true; if(data)status.waiting_for_command = false; } } break; case 0x06: { if(status.op06haslen) { status.op06haslen = false; status.out_count = status.op06len; op06(); } else { status.op06len = status.parameters[0]; status.in_index = 0; status.in_count = status.op06len; status.op06haslen = true; if(data)status.waiting_for_command = false; } } break; case 0x07: break; case 0x08: break; case 0x09: { op09(); } break; case 0x0d: { if(status.op0dhaslen) { status.op0dhaslen = false; status.out_count = status.op0doutlen; op0d(); } else { status.op0dinlen = status.parameters[0]; status.op0doutlen = status.parameters[1]; status.in_index = 0; status.in_count = (status.op0dinlen + 1) >> 1; status.op0dhaslen = true; if(data)status.waiting_for_command = false; } } break; case 0x0f: break; } } } } } ruby/video/sdl.cpp000664 001750 001750 00000006661 12651764221 015276 0ustar00sergiosergio000000 000000 #include #include #include #include #include #include namespace ruby { struct pVideoSDL { Display* display; SDL_Surface* screen; SDL_Surface* buffer; unsigned iwidth, iheight; struct { uintptr_t handle; unsigned width; unsigned height; } settings; bool cap(const string& name) { if(name == Video::Handle) return true; return false; } any get(const string& name) { if(name == Video::Handle) return settings.handle; return false; } bool set(const string& name, const any& value) { if(name == Video::Handle) { settings.handle = any_cast(value); return true; } return false; } void resize(unsigned width, unsigned height) { if(iwidth >= width && iheight >= height) return; iwidth = max(width, iwidth); iheight = max(height, iheight); if(buffer) SDL_FreeSurface(buffer); buffer = SDL_CreateRGBSurface( SDL_SWSURFACE, iwidth, iheight, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 ); } bool lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) { if(width != settings.width || height != settings.height) { resize(settings.width = width, settings.height = height); } if(SDL_MUSTLOCK(buffer)) SDL_LockSurface(buffer); pitch = buffer->pitch; return data = (uint32_t*)buffer->pixels; } void unlock() { if(SDL_MUSTLOCK(buffer)) SDL_UnlockSurface(buffer); } void clear() { if(SDL_MUSTLOCK(buffer)) SDL_LockSurface(buffer); for(unsigned y = 0; y < iheight; y++) { uint32_t* data = (uint32_t*)buffer->pixels + y * (buffer->pitch >> 2); for(unsigned x = 0; x < iwidth; x++) *data++ = 0xff000000; } if(SDL_MUSTLOCK(buffer)) SDL_UnlockSurface(buffer); refresh(); } void refresh() { //ruby input is X8R8G8B8, top 8-bits are ignored. //as SDL forces us to use a 32-bit buffer, we must set alpha to 255 (full opacity) //to prevent blending against the window beneath when X window visual is 32-bits. if(SDL_MUSTLOCK(buffer)) SDL_LockSurface(buffer); for(unsigned y = 0; y < settings.height; y++) { uint32_t *data = (uint32_t*)buffer->pixels + y * (buffer->pitch >> 2); for(unsigned x = 0; x < settings.width; x++) *data++ |= 0xff000000; } if(SDL_MUSTLOCK(buffer)) SDL_UnlockSurface(buffer); XWindowAttributes attributes; XGetWindowAttributes(display, settings.handle, &attributes); SDL_Rect src, dest; src.x = 0; src.y = 0; src.w = settings.width; src.h = settings.height; dest.x = 0; dest.y = 0; dest.w = attributes.width; dest.h = attributes.height; SDL_SoftStretch(buffer, &src, screen, &dest); SDL_UpdateRect(screen, dest.x, dest.y, dest.w, dest.h); } bool init() { display = XOpenDisplay(0); char env[512]; sprintf(env, "SDL_WINDOWID=%ld", (long int)settings.handle); putenv(env); SDL_InitSubSystem(SDL_INIT_VIDEO); screen = SDL_SetVideoMode(2560, 1600, 32, SDL_HWSURFACE); XUndefineCursor(display, settings.handle); buffer = 0; iwidth = 0; iheight = 0; resize(settings.width = 256, settings.height = 256); return true; } void term() { XCloseDisplay(display); SDL_FreeSurface(buffer); SDL_QuitSubSystem(SDL_INIT_VIDEO); } pVideoSDL() { settings.handle = 0; } }; DeclareVideo(SDL) }; sfc/cpu/timing/timing.hpp000664 001750 001750 00000000706 12651764221 016544 0ustar00sergiosergio000000 000000 //timing.cpp unsigned dma_counter(); alwaysinline void add_clocks(unsigned clocks); void scanline(); alwaysinline void alu_edge(); alwaysinline void dma_edge(); alwaysinline void last_cycle(); void timing_power(); void timing_reset(); //irq.cpp alwaysinline void poll_interrupts(); void nmitimen_update(uint8 data); bool rdnmi(); bool timeup(); alwaysinline bool nmi_test(); alwaysinline bool irq_test(); //joypad.cpp void step_auto_joypad_poll(); phoenix/cocoa/widget/widget.hpp000664 001750 001750 00000000731 12651764221 017726 0ustar00sergiosergio000000 000000 namespace phoenix { struct pWidget : public pSizable { Widget& widget; NSView* cocoaView = nullptr; bool enabled(); bool focused(); virtual Size minimumSize(); virtual void setEnabled(bool enabled); void setFocused(); virtual void setFont(string font); virtual void setGeometry(Geometry geometry); virtual void setVisible(bool visible); pWidget(Widget& widget) : pSizable(widget), widget(widget) {} void constructor(); void destructor(); }; } gb/cartridge/mbc5/mbc5.cpp000664 001750 001750 00000002271 12651764221 016426 0ustar00sergiosergio000000 000000 #ifdef CARTRIDGE_CPP uint8 Cartridge::MBC5::mmio_read(uint16 addr) { if((addr & 0xc000) == 0x0000) { //$0000-3fff return cartridge.rom_read(addr); } if((addr & 0xc000) == 0x4000) { //$4000-7fff return cartridge.rom_read((rom_select << 14) | (addr & 0x3fff)); } if((addr & 0xe000) == 0xa000) { //$a000-bfff if(ram_enable) return cartridge.ram_read((ram_select << 13) | (addr & 0x1fff)); return 0x00; } return 0x00; } void Cartridge::MBC5::mmio_write(uint16 addr, uint8 data) { if((addr & 0xe000) == 0x0000) { //$0000-1fff ram_enable = (data & 0x0f) == 0x0a; return; } if((addr & 0xf000) == 0x2000) { //$2000-2fff rom_select = (rom_select & 0x0100) | data; return; } if((addr & 0xf000) == 0x3000) { //$3000-3fff rom_select = ((data & 1) << 8) | (rom_select & 0x00ff); return; } if((addr & 0xe000) == 0x4000) { //$4000-5fff ram_select = data & 0x0f; return; } if((addr & 0xe000) == 0xa000) { //$a000-bfff if(ram_enable) cartridge.ram_write((ram_select << 13) | (addr & 0x1fff), data); return; } } void Cartridge::MBC5::power() { ram_enable = false; rom_select = 0x001; ram_select = 0x00; } #endif sfc/smp/memory.cpp000664 001750 001750 00000011145 12651764221 015300 0ustar00sergiosergio000000 000000 #ifdef SMP_CPP alwaysinline uint8 SMP::ram_read(uint16 addr) { if(addr >= 0xffc0 && status.iplrom_enable) return iplrom[addr & 0x3f]; if(status.ram_disable) return 0x5a; //0xff on mini-SNES return apuram[addr]; } alwaysinline void SMP::ram_write(uint16 addr, uint8 data) { //writes to $ffc0-$ffff always go to apuram, even if the iplrom is enabled if(status.ram_writable && !status.ram_disable) apuram[addr] = data; } uint8 SMP::port_read(uint2 port) const { return apuram[0xf4 + port]; } void SMP::port_write(uint2 port, uint8 data) { apuram[0xf4 + port] = data; } uint8 SMP::op_busread(uint16 addr) { unsigned result; switch(addr) { case 0xf0: //TEST -- write-only register return 0x00; case 0xf1: //CONTROL -- write-only register return 0x00; case 0xf2: //DSPADDR return status.dsp_addr; case 0xf3: //DSPDATA //0x80-0xff are read-only mirrors of 0x00-0x7f return dsp.read(status.dsp_addr & 0x7f); case 0xf4: //CPUIO0 case 0xf5: //CPUIO1 case 0xf6: //CPUIO2 case 0xf7: //CPUIO3 synchronize_cpu(); return cpu.port_read(addr); case 0xf8: //RAM0 return status.ram00f8; case 0xf9: //RAM1 return status.ram00f9; case 0xfa: //T0TARGET case 0xfb: //T1TARGET case 0xfc: //T2TARGET -- write-only registers return 0x00; case 0xfd: //T0OUT -- 4-bit counter value result = timer0.stage3_ticks; timer0.stage3_ticks = 0; return result; case 0xfe: //T1OUT -- 4-bit counter value result = timer1.stage3_ticks; timer1.stage3_ticks = 0; return result; case 0xff: //T2OUT -- 4-bit counter value result = timer2.stage3_ticks; timer2.stage3_ticks = 0; return result; } return ram_read(addr); } void SMP::op_buswrite(uint16 addr, uint8 data) { switch(addr) { case 0xf0: //TEST if(regs.p.p) break; //writes only valid when P flag is clear status.clock_speed = (data >> 6) & 3; status.timer_speed = (data >> 4) & 3; status.timers_enable = data & 0x08; status.ram_disable = data & 0x04; status.ram_writable = data & 0x02; status.timers_disable = data & 0x01; status.timer_step = (1 << status.clock_speed) + (2 << status.timer_speed); timer0.synchronize_stage1(); timer1.synchronize_stage1(); timer2.synchronize_stage1(); break; case 0xf1: //CONTROL status.iplrom_enable = data & 0x80; if(data & 0x30) { //one-time clearing of APU port read registers, //emulated by simulating CPU writes of 0x00 synchronize_cpu(); if(data & 0x20) { cpu.port_write(2, 0x00); cpu.port_write(3, 0x00); } if(data & 0x10) { cpu.port_write(0, 0x00); cpu.port_write(1, 0x00); } } //0->1 transistion resets timers if(timer2.enable == false && (data & 0x04)) { timer2.stage2_ticks = 0; timer2.stage3_ticks = 0; } timer2.enable = data & 0x04; if(timer1.enable == false && (data & 0x02)) { timer1.stage2_ticks = 0; timer1.stage3_ticks = 0; } timer1.enable = data & 0x02; if(timer0.enable == false && (data & 0x01)) { timer0.stage2_ticks = 0; timer0.stage3_ticks = 0; } timer0.enable = data & 0x01; break; case 0xf2: //DSPADDR status.dsp_addr = data; break; case 0xf3: //DSPDATA if(status.dsp_addr & 0x80) break; //0x80-0xff are read-only mirrors of 0x00-0x7f dsp.write(status.dsp_addr & 0x7f, data); break; case 0xf4: //CPUIO0 case 0xf5: //CPUIO1 case 0xf6: //CPUIO2 case 0xf7: //CPUIO3 synchronize_cpu(); port_write(addr, data); break; case 0xf8: //RAM0 status.ram00f8 = data; break; case 0xf9: //RAM1 status.ram00f9 = data; break; case 0xfa: //T0TARGET timer0.target = data; break; case 0xfb: //T1TARGET timer1.target = data; break; case 0xfc: //T2TARGET timer2.target = data; break; case 0xfd: //T0OUT case 0xfe: //T1OUT case 0xff: //T2OUT -- read-only registers break; } ram_write(addr, data); //all writes, even to MMIO registers, appear on bus } void SMP::op_io() { add_clocks(24); cycle_edge(); } uint8 SMP::op_read(uint16 addr) { debugger.op_read(addr); add_clocks(12); uint8 r = op_busread(addr); add_clocks(12); cycle_edge(); return r; } void SMP::op_write(uint16 addr, uint8 data) { debugger.op_write(addr, data); add_clocks(24); op_buswrite(addr, data); cycle_edge(); } uint8 SMP::disassembler_read(uint16 addr) { if((addr & 0xfff0) == 0x00f0) return 0x00; if((addr & 0xffc0) == 0xffc0 && status.iplrom_enable) return iplrom[addr & 0x3f]; return apuram[addr]; } #endif libco/amd64.c000664 001750 001750 00000017545 12651764221 014073 0ustar00sergiosergio000000 000000 /* libco.amd64 (2009-10-12) author: byuu license: public domain */ #define LIBCO_C #include "libco.h" #include #include #if defined(__GNUC__) && !defined(_WIN32) && !defined(__cplusplus) #define CO_USE_INLINE_ASM #endif #ifdef __cplusplus extern "C" { #endif static thread_local long long co_active_buffer[64]; static thread_local cothread_t co_active_handle = 0; #ifndef CO_USE_INLINE_ASM static void (*co_swap)(cothread_t, cothread_t) = 0; #else void co_swap(cothread_t, cothread_t); #endif #ifdef _WIN32 //ABI: Win64 static unsigned char co_swap_function[] = { 0x48, 0x89, 0x22, /* mov [rdx],rsp */ 0x48, 0x8b, 0x21, /* mov rsp,[rcx] */ 0x58, /* pop rax */ 0x48, 0x89, 0x6a, 0x08, /* mov [rdx+0x8],rbp */ 0x48, 0x89, 0x72, 0x10, /* mov [rdx+0x10],rsi */ 0x48, 0x89, 0x7a, 0x18, /* mov [rdx+0x18],rdi */ 0x48, 0x89, 0x5a, 0x20, /* mov [rdx+0x20],rbx */ 0x4c, 0x89, 0x62, 0x28, /* mov [rdx+0x28],r12 */ 0x4c, 0x89, 0x6a, 0x30, /* mov [rdx+0x30],r13 */ 0x4c, 0x89, 0x72, 0x38, /* mov [rdx+0x38],r14 */ 0x4c, 0x89, 0x7a, 0x40, /* mov [rdx+0x40],r15 */ 0x48, 0x81, 0xc2, 0x80, 0x00, 0x00, 0x00, /* add rdx,0x80 */ 0x48, 0x83, 0xe2, 0xf0, /* and rdx,-0x10 */ 0x0f, 0x29, 0x32, /* movaps [rdx],xmm6 */ 0x0f, 0x29, 0x7a, 0x10, /* movaps [rdx+0x10],xmm7 */ 0x44, 0x0f, 0x29, 0x42, 0x20, /* movaps [rdx+0x20],xmm8 */ 0x44, 0x0f, 0x29, 0x4a, 0x30, /* movaps [rdx+0x30],xmm9 */ 0x44, 0x0f, 0x29, 0x52, 0x40, /* movaps [rdx+0x40],xmm10 */ 0x44, 0x0f, 0x29, 0x5a, 0x50, /* movaps [rdx+0x50],xmm11 */ 0x44, 0x0f, 0x29, 0x62, 0x60, /* movaps [rdx+0x60],xmm12 */ 0x44, 0x0f, 0x29, 0x6a, 0x70, /* movaps [rdx+0x70],xmm13 */ 0x44, 0x0f, 0x29, 0xb2, 0x80, 0x00, 0x00, 0x00, /* movaps [rdx+0x80],xmm14 */ 0x44, 0x0f, 0x29, 0xba, 0x90, 0x00, 0x00, 0x00, /* movaps [rdx+0x90],xmm15 */ 0x48, 0x8b, 0x69, 0x08, /* mov rbp,[rcx+0x8] */ 0x48, 0x8b, 0x71, 0x10, /* mov rsi,[rcx+0x10] */ 0x48, 0x8b, 0x79, 0x18, /* mov rdi,[rcx+0x18] */ 0x48, 0x8b, 0x59, 0x20, /* mov rbx,[rcx+0x20] */ 0x4c, 0x8b, 0x61, 0x28, /* mov r12,[rcx+0x28] */ 0x4c, 0x8b, 0x69, 0x30, /* mov r13,[rcx+0x30] */ 0x4c, 0x8b, 0x71, 0x38, /* mov r14,[rcx+0x38] */ 0x4c, 0x8b, 0x79, 0x40, /* mov r15,[rcx+0x40] */ 0x48, 0x81, 0xc1, 0x80, 0x00, 0x00, 0x00, /* add rcx,0x80 */ 0x48, 0x83, 0xe1, 0xf0, /* and rcx,-0x10 */ 0x0f, 0x29, 0x31, /* movaps [rcx],xmm6 */ 0x0f, 0x29, 0x79, 0x10, /* movaps [rcx+0x10],xmm7 */ 0x44, 0x0f, 0x29, 0x41, 0x20, /* movaps [rcx+0x20],xmm8 */ 0x44, 0x0f, 0x29, 0x49, 0x30, /* movaps [rcx+0x30],xmm9 */ 0x44, 0x0f, 0x29, 0x51, 0x40, /* movaps [rcx+0x40],xmm10 */ 0x44, 0x0f, 0x29, 0x59, 0x50, /* movaps [rcx+0x50],xmm11 */ 0x44, 0x0f, 0x29, 0x61, 0x60, /* movaps [rcx+0x60],xmm12 */ 0x44, 0x0f, 0x29, 0x69, 0x70, /* movaps [rcx+0x70],xmm13 */ 0x44, 0x0f, 0x29, 0xb1, 0x80, 0x00, 0x00, 0x00, /* movaps [rcx+0x80],xmm14 */ 0x44, 0x0f, 0x29, 0xb9, 0x90, 0x00, 0x00, 0x00, /* movaps [rcx+0x90],xmm15 */ 0xff, 0xe0, /* jmp rax */ }; #include void co_init(void) { DWORD old_privileges; VirtualProtect(co_swap_function, sizeof(co_swap_function), PAGE_EXECUTE_READWRITE, &old_privileges); } #else //ABI: SystemV #ifndef CO_USE_INLINE_ASM static unsigned char co_swap_function[] = { 0x48, 0x89, 0x26, /* mov [rsi],rsp */ 0x48, 0x8b, 0x27, /* mov rsp,[rdi] */ 0x58, /* pop rax */ 0x48, 0x89, 0x6e, 0x08, /* mov [rsi+0x08],rbp */ 0x48, 0x89, 0x5e, 0x10, /* mov [rsi+0x10],rbx */ 0x4c, 0x89, 0x66, 0x18, /* mov [rsi+0x18],r12 */ 0x4c, 0x89, 0x6e, 0x20, /* mov [rsi+0x20],r13 */ 0x4c, 0x89, 0x76, 0x28, /* mov [rsi+0x28],r14 */ 0x4c, 0x89, 0x7e, 0x30, /* mov [rsi+0x30],r15 */ 0x48, 0x8b, 0x6f, 0x08, /* mov rbp,[rdi+0x08] */ 0x48, 0x8b, 0x5f, 0x10, /* mov rbx,[rdi+0x10] */ 0x4c, 0x8b, 0x67, 0x18, /* mov r12,[rdi+0x18] */ 0x4c, 0x8b, 0x6f, 0x20, /* mov r13,[rdi+0x20] */ 0x4c, 0x8b, 0x77, 0x28, /* mov r14,[rdi+0x28] */ 0x4c, 0x8b, 0x7f, 0x30, /* mov r15,[rdi+0x30] */ 0xff, 0xe0, /* jmp rax */ }; #include #include void co_init(void) { unsigned long long addr = (unsigned long long)co_swap_function; unsigned long long base = addr - (addr % sysconf(_SC_PAGESIZE)); unsigned long long size = (addr - base) + sizeof(co_swap_function); mprotect((void*)base, size, PROT_READ | PROT_WRITE | PROT_EXEC); } #else __asm__( ".intel_syntax noprefix\n" ".globl co_swap \n" "co_swap: \n" ".globl _co_swap \n" /* OSX ABI is different from Linux. */ "_co_swap: \n" "mov [rsi],rsp \n" "mov [rsi+0x08],rbp \n" "mov [rsi+0x10],rbx \n" "mov [rsi+0x18],r12 \n" "mov [rsi+0x20],r13 \n" "mov [rsi+0x28],r14 \n" "mov [rsi+0x30],r15 \n" "mov rsp,[rdi] \n" "mov rbp,[rdi+0x08] \n" "mov rbx,[rdi+0x10] \n" "mov r12,[rdi+0x18] \n" "mov r13,[rdi+0x20] \n" "mov r14,[rdi+0x28] \n" "mov r15,[rdi+0x30] \n" "ret \n" ".att_syntax \n" ); #endif #endif static void crash(void) { assert(0); /* called only if cothread_t entrypoint returns */ } cothread_t co_active(void) { if (!co_active_handle) co_active_handle = &co_active_buffer; return co_active_handle; } cothread_t co_create(unsigned int size, void (*entrypoint)(void)) { cothread_t handle; #ifndef CO_USE_INLINE_ASM if(!co_swap) { co_init(); co_swap = (void (*)(cothread_t, cothread_t))co_swap_function; } #endif if (!co_active_handle) co_active_handle = &co_active_buffer; size += 512; /* allocate additional space for storage */ size &= ~15; /* align stack to 16-byte boundary */ if((handle = (cothread_t)malloc(size))) { long long *p = (long long*)((char*)handle + size); /* seek to top of stack */ *--p = (long long)crash; /* crash if entrypoint returns */ *--p = (long long)entrypoint; /* start of function */ *(long long*)handle = (long long)p; /* stack pointer */ } return handle; } void co_delete(cothread_t handle) { free(handle); } void co_switch(cothread_t handle) { register cothread_t co_previous_handle = co_active_handle; co_swap(co_active_handle = handle, co_previous_handle); } #ifdef __cplusplus } #endif gba/cpu/registers.cpp000664 001750 001750 00000013436 12651764221 015752 0ustar00sergiosergio000000 000000 CPU::Registers::DMAControl::operator uint16() const { return ( (targetmode << 5) | (sourcemode << 7) | (repeat << 9) | (size << 10) | (drq << 11) | (timingmode << 12) | (irq << 14) | (enable << 15) ); } uint16 CPU::Registers::DMAControl::operator=(uint16 source) { targetmode = source >> 5; sourcemode = source >> 7; repeat = source >> 9; size = source >> 10; drq = source >> 11; timingmode = source >> 12; irq = source >> 14; enable = source >> 15; return operator uint16(); } CPU::Registers::TimerControl::operator uint16() const { return ( (frequency << 0) | (cascade << 2) | (irq << 6) | (enable << 7) ); } uint16 CPU::Registers::TimerControl::operator=(uint16 source) { frequency = source >> 0; cascade = source >> 2; irq = source >> 6; enable = source >> 7; return operator uint16(); } CPU::Registers::SerialControl::operator uint16() const { return ( (shiftclockselect << 0) | (shiftclockfrequency << 1) | (transferenablereceive << 2) | (transferenablesend << 3) | (startbit << 7) | (transferlength << 12) | (irqenable << 14) ); } uint16 CPU::Registers::SerialControl::operator=(uint16 source) { shiftclockselect = source >> 0; shiftclockfrequency = source >> 1; transferenablereceive = source >> 2; transferenablesend = source >> 3; startbit = source >> 7; transferlength = source >> 12; irqenable = source >> 14; return operator uint16(); } CPU::Registers::KeypadControl::operator uint16() const { return ( (flag[0] << 0) | (flag[1] << 1) | (flag[2] << 2) | (flag[3] << 3) | (flag[4] << 4) | (flag[5] << 5) | (flag[6] << 6) | (flag[7] << 7) | (flag[8] << 8) | (flag[9] << 9) | (enable << 14) | (condition << 15) ); } uint16 CPU::Registers::KeypadControl::operator=(uint16 source) { flag[0] = source >> 0; flag[1] = source >> 1; flag[2] = source >> 2; flag[3] = source >> 3; flag[4] = source >> 4; flag[5] = source >> 5; flag[6] = source >> 6; flag[7] = source >> 7; flag[8] = source >> 8; flag[9] = source >> 9; enable = source >> 14; condition = source >> 15; return operator uint16(); } CPU::Registers::JoybusSettings::operator uint16() const { return ( (sc << 0) | (sd << 1) | (si << 2) | (so << 3) | (scmode << 4) | (sdmode << 5) | (simode << 6) | (somode << 7) | (irqenable << 8) | (mode << 14) ); } uint16 CPU::Registers::JoybusSettings::operator=(uint16 source) { sc = source >> 0; sd = source >> 1; si = source >> 2; so = source >> 3; scmode = source >> 4; sdmode = source >> 5; simode = source >> 6; somode = source >> 7; irqenable = source >> 8; mode = source >> 14; return operator uint16(); } CPU::Registers::JoybusControl::operator uint16() const { return ( (resetsignal << 0) | (receivecomplete << 1) | (sendcomplete << 2) | (irqenable << 6) ); } uint16 CPU::Registers::JoybusControl::operator=(uint16 source) { resetsignal = source >> 0; receivecomplete = source >> 1; sendcomplete = source >> 2; irqenable = source >> 6; return operator uint16(); } CPU::Registers::JoybusStatus::operator uint16() const { return ( (receiveflag << 1) | (sendflag << 3) | (generalflag << 4) ); } uint16 CPU::Registers::JoybusStatus::operator=(uint16 source) { receiveflag = source >> 1; sendflag = source >> 3; generalflag = source >> 4; return operator uint16(); } CPU::Registers::Interrupt::operator uint16() const { return ( (vblank << 0) | (hblank << 1) | (vcoincidence << 2) | (timer[0] << 3) | (timer[1] << 4) | (timer[2] << 5) | (timer[3] << 6) | (serial << 7) | (dma[0] << 8) | (dma[1] << 9) | (dma[2] << 10) | (dma[3] << 11) | (keypad << 12) | (cartridge << 13) ); } uint16 CPU::Registers::Interrupt::operator=(uint16 source) { vblank = source >> 0; hblank = source >> 1; vcoincidence = source >> 2; timer[0] = source >> 3; timer[1] = source >> 4; timer[2] = source >> 5; timer[3] = source >> 6; serial = source >> 7; dma[0] = source >> 8; dma[1] = source >> 9; dma[2] = source >> 10; dma[3] = source >> 11; keypad = source >> 12; cartridge = source >> 13; return operator uint16(); } CPU::Registers::WaitControl::operator uint16() const { return ( (nwait[3] << 0) | (nwait[0] << 2) | (swait[0] << 4) | (nwait[1] << 5) | (swait[1] << 7) | (nwait[2] << 8) | (swait[2] << 10) | (phi << 11) | (prefetch << 14) | (gametype << 15) ); } uint16 CPU::Registers::WaitControl::operator=(uint16 source) { nwait[3] = (source >> 0) & 3; nwait[0] = (source >> 2) & 3; swait[0] = (source >> 4) & 1; nwait[1] = (source >> 5) & 3; swait[1] = (source >> 7) & 1; nwait[2] = (source >> 8) & 3; swait[2] = (source >> 10) & 1; phi = (source >> 11) & 3; prefetch = (source >> 14) & 1; gametype = (source >> 15) & 1; swait[3] = nwait[3]; return operator uint16(); } CPU::Registers::MemoryControl::operator uint32() const { return ( (disable << 0) | (unknown1 << 1) | (ewram << 5) | (ewramwait << 24) | (unknown2 << 28) ); } uint32 CPU::Registers::MemoryControl::operator=(uint32 source) { disable = source >> 0; unknown1 = source >> 1; ewram = source >> 5; ewramwait = source >> 24; unknown2 = source >> 28; return operator uint32(); } processor/arm/serialization.cpp000664 001750 001750 00000003640 12651764221 020072 0ustar00sergiosergio000000 000000 void ARM::PSR::serialize(serializer& s) { s.integer(n); s.integer(z); s.integer(c); s.integer(v); s.integer(i); s.integer(f); s.integer(t); s.integer(m); } void ARM::serialize(serializer& s) { s.integer(processor.r0.data); s.integer(processor.r1.data); s.integer(processor.r2.data); s.integer(processor.r3.data); s.integer(processor.r4.data); s.integer(processor.r5.data); s.integer(processor.r6.data); s.integer(processor.r7.data); s.integer(processor.usr.r8.data); s.integer(processor.usr.r9.data); s.integer(processor.usr.r10.data); s.integer(processor.usr.r11.data); s.integer(processor.usr.r12.data); s.integer(processor.usr.sp.data); s.integer(processor.usr.lr.data); s.integer(processor.fiq.r8.data); s.integer(processor.fiq.r9.data); s.integer(processor.fiq.r10.data); s.integer(processor.fiq.r11.data); s.integer(processor.fiq.r12.data); s.integer(processor.fiq.sp.data); s.integer(processor.fiq.lr.data); processor.fiq.spsr.serialize(s); s.integer(processor.irq.sp.data); s.integer(processor.irq.lr.data); processor.irq.spsr.serialize(s); s.integer(processor.svc.sp.data); s.integer(processor.svc.lr.data); processor.svc.spsr.serialize(s); s.integer(processor.abt.sp.data); s.integer(processor.abt.lr.data); processor.abt.spsr.serialize(s); s.integer(processor.und.sp.data); s.integer(processor.und.lr.data); processor.und.spsr.serialize(s); s.integer(processor.pc.data); processor.cpsr.serialize(s); s.integer(processor.carryout); s.integer(processor.sequential); s.integer(processor.irqline); s.integer(pipeline.reload); s.integer(pipeline.execute.address); s.integer(pipeline.execute.instruction); s.integer(pipeline.decode.address); s.integer(pipeline.decode.instruction); s.integer(pipeline.fetch.address); s.integer(pipeline.fetch.instruction); s.integer(crash); processor.setMode((Processor::Mode)cpsr().m); } nall/beat/000700 001750 001750 00000000000 12656700342 013534 5ustar00sergiosergio000000 000000 fc/cheat/cheat.cpp000664 001750 001750 00000001014 12651764221 015150 0ustar00sergiosergio000000 000000 #include namespace Famicom { Cheat cheat; void Cheat::reset() { codes.reset(); } void Cheat::append(unsigned addr, unsigned data) { codes.append({addr, Unused, data}); } void Cheat::append(unsigned addr, unsigned comp, unsigned data) { codes.append({addr, comp, data}); } optional Cheat::find(unsigned addr, unsigned comp) { for(auto& code : codes) { if(code.addr == addr && (code.comp == Unused || code.comp == comp)) { return {true, code.data}; } } return false; } } phoenix/cocoa/object.cpp000664 001750 001750 00000000130 12651764221 016412 0ustar00sergiosergio000000 000000 namespace phoenix { void pObject::constructor() { } void pObject::destructor() { } } nall/interpolation.hpp000664 001750 001750 00000003254 12651764221 016242 0ustar00sergiosergio000000 000000 #ifndef NALL_INTERPOLATION_HPP #define NALL_INTERPOLATION_HPP namespace nall { struct Interpolation { static inline double Nearest(double mu, double a, double b, double c, double d) { return (mu <= 0.5 ? b : c); } static inline double Sublinear(double mu, double a, double b, double c, double d) { mu = ((mu - 0.5) * 2.0) + 0.5; if(mu < 0) mu = 0; if(mu > 1) mu = 1; return b * (1.0 - mu) + c * mu; } static inline double Linear(double mu, double a, double b, double c, double d) { return b * (1.0 - mu) + c * mu; } static inline double Cosine(double mu, double a, double b, double c, double d) { mu = (1.0 - cos(mu * 3.14159265)) / 2.0; return b * (1.0 - mu) + c * mu; } static inline double Cubic(double mu, double a, double b, double c, double d) { double A = d - c - a + b; double B = a - b - A; double C = c - a; double D = b; return A * (mu * mu * mu) + B * (mu * mu) + C * mu + D; } static inline double Hermite(double mu1, double a, double b, double c, double d) { const double tension = 0.0; //-1 = low, 0 = normal, +1 = high const double bias = 0.0; //-1 = left, 0 = even, +1 = right double mu2, mu3, m0, m1, a0, a1, a2, a3; mu2 = mu1 * mu1; mu3 = mu2 * mu1; m0 = (b - a) * (1.0 + bias) * (1.0 - tension) / 2.0; m0 += (c - b) * (1.0 - bias) * (1.0 - tension) / 2.0; m1 = (c - b) * (1.0 + bias) * (1.0 - tension) / 2.0; m1 += (d - c) * (1.0 - bias) * (1.0 - tension) / 2.0; a0 = +2 * mu3 - 3 * mu2 + 1; a1 = mu3 - 2 * mu2 + mu1; a2 = mu3 - mu2; a3 = -2 * mu3 + 3 * mu2; return (a0 * b) + (a1 * m0) + (a2 * m1) + (a3 * c); } }; } #endif phoenix/cocoa/action/separator.hpp000664 001750 001750 00000000375 12651764221 020441 0ustar00sergiosergio000000 000000 namespace phoenix { struct pSeparator : public pAction { Separator& separator; NSMenuItem* cocoaSeparator = nullptr; pSeparator(Separator& separator) : pAction(separator), separator(separator) {} void constructor(); void destructor(); }; } target-ethos/settings/video.cpp000664 001750 001750 00000004722 12651764221 017775 0ustar00sergiosergio000000 000000 VideoSettings* videoSettings = nullptr; VideoSlider::VideoSlider() { append(name, {75, 0}); append(value, {75, 0}); append(slider, {~0, 0}); } VideoSettings::VideoSettings() { colorAdjustment.setFont(program->boldFont); colorAdjustment.setText("Color adjustment:"); saturation.name.setText("Saturation:"); saturation.slider.setLength(201); gamma.name.setText("Gamma:"); gamma.slider.setLength(101); luminance.name.setText("Luminance:"); luminance.slider.setLength(101); colorEmulation.setText("Color emulation"); overscanAdjustment.setFont(program->boldFont); overscanAdjustment.setText("Overscan mask:"); overscanHorizontal.name.setText("Horizontal:"); overscanHorizontal.slider.setLength(17); overscanVertical.name.setText("Vertical:"); overscanVertical.slider.setLength(17); append(colorAdjustment, {~0, 0}); append(saturation, {~0, 0}); append(gamma, {~0, 0}); append(luminance, {~0, 0}); append(colorEmulation, {~0, 0}, 5); append(overscanAdjustment, {~0, 0}); append(overscanHorizontal, {~0, 0}); append(overscanVertical, {~0, 0}, 5); colorEmulation.setChecked(config->video.colorEmulation); saturation.slider.setPosition(config->video.saturation); gamma.slider.setPosition(config->video.gamma - 100); luminance.slider.setPosition(config->video.luminance); overscanHorizontal.slider.setPosition(config->video.maskOverscan.horizontal); overscanVertical.slider.setPosition(config->video.maskOverscan.vertical); synchronize(); saturation.slider.onChange = gamma.slider.onChange = luminance.slider.onChange = colorEmulation.onToggle = overscanHorizontal.slider.onChange = overscanVertical.slider.onChange = {&VideoSettings::synchronize, this}; } void VideoSettings::synchronize() { config->video.saturation = saturation.slider.position(); config->video.gamma = 100 + gamma.slider.position(); config->video.luminance = luminance.slider.position(); config->video.colorEmulation = colorEmulation.checked(); config->video.maskOverscan.horizontal = overscanHorizontal.slider.position(); config->video.maskOverscan.vertical = overscanVertical.slider.position(); saturation.value.setText({config->video.saturation, "%"}); gamma.value.setText({config->video.gamma, "%"}); luminance.value.setText({config->video.luminance, "%"}); overscanHorizontal.value.setText({config->video.maskOverscan.horizontal, "px"}); overscanVertical.value.setText({config->video.maskOverscan.vertical, "px"}); utility->updatePalette(); } ruby/video/gdi.cpp000664 001750 001750 00000004343 12651764221 015252 0ustar00sergiosergio000000 000000 #include namespace ruby { class pVideoGDI { public: uint32_t* buffer; HBITMAP bitmap; HDC bitmapdc; BITMAPINFO bmi; struct { HWND handle; unsigned width; unsigned height; } settings; bool cap(const string& name) { if(name == Video::Handle) return true; return false; } any get(const string& name) { if(name == Video::Handle) return (uintptr_t)settings.handle; return false; } bool set(const string& name, const any& value) { if(name == Video::Handle) { settings.handle = (HWND)any_cast(value); return true; } return false; } bool lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) { settings.width = width; settings.height = height; pitch = 1024 * 4; return data = buffer; } void unlock() {} void clear() {} void refresh() { RECT rc; GetClientRect(settings.handle, &rc); SetDIBits(bitmapdc, bitmap, 0, settings.height, (void*)buffer, &bmi, DIB_RGB_COLORS); HDC hdc = GetDC(settings.handle); StretchBlt(hdc, rc.left, rc.top, rc.right, rc.bottom, bitmapdc, 0, 1024 - settings.height, settings.width, settings.height, SRCCOPY); ReleaseDC(settings.handle, hdc); } bool init() { HDC hdc = GetDC(settings.handle); bitmapdc = CreateCompatibleDC(hdc); assert(bitmapdc); bitmap = CreateCompatibleBitmap(hdc, 1024, 1024); assert(bitmap); SelectObject(bitmapdc, bitmap); ReleaseDC(settings.handle, hdc); memset(&bmi, 0, sizeof(BITMAPINFO)); bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmi.bmiHeader.biWidth = 1024; bmi.bmiHeader.biHeight = -1024; bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biBitCount = 32; //biBitCount of 15 is invalid, biBitCount of 16 is really RGB555 bmi.bmiHeader.biCompression = BI_RGB; bmi.bmiHeader.biSizeImage = 1024 * 1024 * sizeof(uint32_t); settings.width = 256; settings.height = 256; return true; } void term() { DeleteObject(bitmap); DeleteDC(bitmapdc); } pVideoGDI() { buffer = (uint32_t*)malloc(1024 * 1024 * sizeof(uint32_t)); settings.handle = 0; } ~pVideoGDI() { if(buffer) free(buffer); } }; DeclareVideo(GDI) }; sfc/dsp/moduloarray.hpp000664 001750 001750 00000001046 12651764221 016321 0ustar00sergiosergio000000 000000 template struct moduloarray { inline T operator[](int index) const { return buffer[size + index]; } inline T read(int index) const { return buffer[size + index]; } inline void write(unsigned index, const T value) { buffer[index] = buffer[index + size] = buffer[index + size + size] = value; } void serialize(serializer& s) { s.array(buffer, size * 3); } moduloarray() { buffer = new T[size * 3](); } ~moduloarray() { delete[] buffer; } private: T* buffer; }; ananke/heuristics/satellaview.hpp000664 001750 001750 00000000756 12651764221 020370 0ustar00sergiosergio000000 000000 #ifndef NALL_EMULATION_SATELLAVIEW_HPP #define NALL_EMULATION_SATELLAVIEW_HPP #include #include namespace nall { struct SatellaviewCartridge { string markup; inline SatellaviewCartridge(const uint8_t *data, unsigned size); }; SatellaviewCartridge::SatellaviewCartridge(const uint8_t *data, unsigned size) { markup = ""; markup.append("cartridge\n"); markup.append(" rom name=program.rom size=0x", hex(size), " type=FlashROM\n"); } } #endif sfc/dsp/envelope.cpp000664 001750 001750 00000003014 12651764221 015570 0ustar00sergiosergio000000 000000 #ifdef DSP_CPP void DSP::envelope_run(voice_t& v) { int env = v.env; if(v.env_mode == env_release) { //60% env -= 0x8; if(env < 0) env = 0; v.env = env; return; } int rate; int env_data = VREG(adsr1); if(state.t_adsr0 & 0x80) { //99% ADSR if(v.env_mode >= env_decay) { //99% env--; env -= env >> 8; rate = env_data & 0x1f; if(v.env_mode == env_decay) { //1% rate = ((state.t_adsr0 >> 3) & 0x0e) + 0x10; } } else { //env_attack rate = ((state.t_adsr0 & 0x0f) << 1) + 1; env += rate < 31 ? 0x20 : 0x400; } } else { //GAIN env_data = VREG(gain); int mode = env_data >> 5; if(mode < 4) { //direct env = env_data << 4; rate = 31; } else { rate = env_data & 0x1f; if(mode == 4) { //4: linear decrease env -= 0x20; } else if(mode < 6) { //5: exponential decrease env--; env -= env >> 8; } else { //6, 7: linear increase env += 0x20; if(mode > 6 && (unsigned)v.hidden_env >= 0x600) { env += 0x8 - 0x20; //7: two-slope linear increase } } } } //sustain level if((env >> 8) == (env_data >> 5) && v.env_mode == env_decay) v.env_mode = env_sustain; v.hidden_env = env; //unsigned cast because linear decrease underflowing also triggers this if((unsigned)env > 0x7ff) { env = (env < 0 ? 0 : 0x7ff); if(v.env_mode == env_attack) v.env_mode = env_decay; } if(counter_poll(rate) == true) v.env = env; } #endif phoenix/reference/timer.cpp000664 001750 001750 00000000262 12651764221 017144 0ustar00sergiosergio000000 000000 namespace phoenix { void pTimer::setEnabled(bool enabled) { } void pTimer::setInterval(unsigned interval) { } void pTimer::constructor() { } void pTimer::destructor() { } } phoenix/cocoa/widget/sizable.hpp000664 001750 001750 00000000230 12651764221 020066 0ustar00sergiosergio000000 000000 namespace phoenix { struct pSizable : public pObject { Sizable& sizable; pSizable(Sizable& sizable) : pObject(sizable), sizable(sizable) {} }; } phoenix/reference/action/menu.hpp000664 001750 001750 00000000451 12651764221 020252 0ustar00sergiosergio000000 000000 namespace phoenix { struct pMenu : public pAction { Menu& menu; void append(Action& action); void remove(Action& action); void setImage(const image& image); void setText(string text); pMenu(Menu& menu) : pAction(menu), menu(menu) {} void constructor(); void destructor(); }; } phoenix/cocoa/widget/text-edit.hpp000664 001750 001750 00000001307 12651764221 020352 0ustar00sergiosergio000000 000000 @interface CocoaTextEdit : NSScrollView { @public phoenix::TextEdit* textEdit; NSTextView* content; } -(id) initWith:(phoenix::TextEdit&)textEdit; -(NSTextView*) content; -(void) configure; -(void) textDidChange:(NSNotification*)notification; @end namespace phoenix { struct pTextEdit : public pWidget { TextEdit& textEdit; CocoaTextEdit* cocoaTextEdit = nullptr; void setCursorPosition(unsigned position); void setEditable(bool editable); void setFont(string font); void setText(string text); void setWordWrap(bool wordWrap); string text(); pTextEdit(TextEdit& textEdit) : pWidget(textEdit), textEdit(textEdit) {} void constructor(); void destructor(); }; } sfc/chip/epsonrtc/time.cpp000664 001750 001750 00000007242 12651764221 016712 0ustar00sergiosergio000000 000000 #ifdef EPSONRTC_CPP void EpsonRTC::irq(uint2 period) { if(stop || pause) return; if(period == irqperiod) irqflag = 1; } void EpsonRTC::duty() { if(irqduty) irqflag = 0; } void EpsonRTC::round_seconds() { if(roundseconds == 0) return; roundseconds = 0; if(secondhi >= 3) tick_minute(); secondlo = 0; secondhi = 0; } void EpsonRTC::tick() { if(stop || pause) return; if(hold) { holdtick = 1; return; } resync = 1; tick_second(); } //below code provides bit-perfect emulation of invalid BCD values on the RTC-4513 //code makes extensive use of variable-length integers (see epsonrtc.hpp for sizes) void EpsonRTC::tick_second() { if(secondlo <= 8 || secondlo == 12) { secondlo++; } else { secondlo = 0; if(secondhi < 5) { secondhi++; } else { secondhi = 0; tick_minute(); } } } void EpsonRTC::tick_minute() { if(minutelo <= 8 || minutelo == 12) { minutelo++; } else { minutelo = 0; if(minutehi < 5) { minutehi++; } else { minutehi = 0; tick_hour(); } } } void EpsonRTC::tick_hour() { if(atime) { if(hourhi < 2) { if(hourlo <= 8 || hourlo == 12) { hourlo++; } else { hourlo = !(hourlo & 1); hourhi++; } } else { if(hourlo != 3 && !(hourlo & 4)) { if(hourlo <= 8 || hourlo >= 12) { hourlo++; } else { hourlo = !(hourlo & 1); hourhi++; } } else { hourlo = !(hourlo & 1); hourhi = 0; tick_day(); } } } else { if(hourhi == 0) { if(hourlo <= 8 || hourlo == 12) { hourlo++; } else { hourlo = !(hourlo & 1); hourhi ^= 1; } } else { if(hourlo & 1) meridian ^= 1; if(hourlo < 2 || hourlo == 4 || hourlo == 5 || hourlo == 8 || hourlo == 12) { hourlo++; } else { hourlo = !(hourlo & 1); hourhi ^= 1; } if(meridian == 0 && !(hourlo & 1)) tick_day(); } } } void EpsonRTC::tick_day() { if(calendar == 0) return; weekday = (weekday + 1) + (weekday == 6); //January - December = 0x01 - 0x09; 0x10 - 0x12 static const unsigned daysinmonth[32] = { 30, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, }; unsigned days = daysinmonth[monthhi << 4 | monthlo]; if(days == 28) { //add one day for leap years if((yearhi & 1) == 0 && ((yearlo - 0) & 3) == 0) days++; if((yearhi & 1) == 1 && ((yearlo - 2) & 3) == 0) days++; } if(days == 28 && (dayhi == 3 || (dayhi == 2 && daylo >= 8))) { daylo = 1; dayhi = 0; return tick_month(); } if(days == 29 && (dayhi == 3 || (dayhi == 2 && (daylo > 8 && daylo != 12)))) { daylo = 1; dayhi = 0; return tick_month(); } if(days == 30 && (dayhi == 3 || (dayhi == 2 && (daylo == 10 || daylo == 14)))) { daylo = 1; dayhi = 0; return tick_month(); } if(days == 31 && (dayhi == 3 && (daylo & 3))) { daylo = 1; dayhi = 0; return tick_month(); } if(daylo <= 8 || daylo == 12) { daylo++; } else { daylo = !(daylo & 1); dayhi++; } } void EpsonRTC::tick_month() { if(monthhi == 0 || !(monthlo & 2)) { if(monthlo <= 8 || monthlo == 12) { monthlo++; } else { monthlo = !(monthlo & 1); monthhi ^= 1; } } else { monthlo = !(monthlo & 1); monthhi = 0; tick_year(); } } void EpsonRTC::tick_year() { if(yearlo <= 8 || yearlo == 12) { yearlo++; } else { yearlo = !(yearlo & 1); if(yearhi <= 8 || yearhi == 12) { yearhi++; } else { yearhi = !(yearhi & 1); } } } #endif phoenix/qt/widget/viewport.cpp000664 001750 001750 00000004023 12651764221 017653 0ustar00sergiosergio000000 000000 namespace phoenix { uintptr_t pViewport::handle() { return (uintptr_t)qtViewport->winId(); } void pViewport::setDroppable(bool droppable) { qtViewport->setAcceptDrops(droppable); } void pViewport::constructor() { qtWidget = qtViewport = new QtViewport(*this); qtViewport->setMouseTracking(true); qtViewport->setAttribute(Qt::WA_PaintOnScreen, true); qtViewport->setStyleSheet("background: #000000"); pWidget::synchronizeState(); } void pViewport::destructor() { delete qtViewport; qtWidget = qtViewport = nullptr; } void pViewport::orphan() { destructor(); constructor(); } void pViewport::QtViewport::dragEnterEvent(QDragEnterEvent* event) { if(event->mimeData()->hasUrls()) { event->acceptProposedAction(); } } void pViewport::QtViewport::dropEvent(QDropEvent* event) { lstring paths = DropPaths(event); if(paths.empty()) return; if(self.viewport.onDrop) self.viewport.onDrop(paths); } void pViewport::QtViewport::leaveEvent(QEvent* event) { if(self.viewport.onMouseLeave) self.viewport.onMouseLeave(); } void pViewport::QtViewport::mouseMoveEvent(QMouseEvent* event) { if(self.viewport.onMouseMove) self.viewport.onMouseMove({event->pos().x(), event->pos().y()}); } void pViewport::QtViewport::mousePressEvent(QMouseEvent* event) { if(!self.viewport.onMousePress) return; switch(event->button()) { case Qt::LeftButton: self.viewport.onMousePress(Mouse::Button::Left); break; case Qt::MidButton: self.viewport.onMousePress(Mouse::Button::Middle); break; case Qt::RightButton: self.viewport.onMousePress(Mouse::Button::Right); break; } } void pViewport::QtViewport::mouseReleaseEvent(QMouseEvent* event) { if(!self.viewport.onMouseRelease) return; switch(event->button()) { case Qt::LeftButton: self.viewport.onMouseRelease(Mouse::Button::Left); break; case Qt::MidButton: self.viewport.onMouseRelease(Mouse::Button::Middle); break; case Qt::RightButton: self.viewport.onMouseRelease(Mouse::Button::Right); break; } } pViewport::QtViewport::QtViewport(pViewport& self) : self(self) { } } target-ethos/configuration/000700 001750 001750 00000000000 12656700342 017150 5ustar00sergiosergio000000 000000 sfc/chip/spc7110/data.cpp000664 001750 001750 00000003730 12651764221 016124 0ustar00sergiosergio000000 000000 #ifdef SPC7110_CPP uint8 SPC7110::datarom_read(unsigned addr) { unsigned size = 1 << (r4834 & 3); //size in MB unsigned mask = 0x100000 * size - 1; unsigned offset = addr & mask; if((r4834 & 3) != 3 && (addr & 0x400000)) return 0x00; return drom.read(Bus::mirror(offset, drom.size())); } unsigned SPC7110::data_offset() { return r4811 | r4812 << 8 | r4813 << 16; } unsigned SPC7110::data_adjust() { return r4814 | r4815 << 8; } unsigned SPC7110::data_stride() { return r4816 | r4817 << 8; } void SPC7110::set_data_offset(unsigned addr) { r4811 = addr; r4812 = addr >> 8; r4813 = addr >> 16; } void SPC7110::set_data_adjust(unsigned addr) { r4814 = addr; r4815 = addr >> 8; } void SPC7110::data_port_read() { unsigned offset = data_offset(); unsigned adjust = r4818 & 2 ? data_adjust() : 0; if(r4818 & 8) adjust = (int16)adjust; r4810 = datarom_read(offset + adjust); } void SPC7110::data_port_increment_4810() { unsigned offset = data_offset(); unsigned stride = r4818 & 1 ? data_stride() : 1; unsigned adjust = data_adjust(); if(r4818 & 4) stride = (int16)stride; if(r4818 & 8) adjust = (int16)adjust; if((r4818 & 16) == 0) set_data_offset(offset + stride); if((r4818 & 16) != 0) set_data_adjust(adjust + stride); data_port_read(); } void SPC7110::data_port_increment_4814() { if(r4818 >> 5 != 1) return; unsigned offset = data_offset(); unsigned adjust = data_adjust(); if(r4818 & 8) adjust = (int16)adjust; set_data_offset(offset + adjust); data_port_read(); } void SPC7110::data_port_increment_4815() { if(r4818 >> 5 != 2) return; unsigned offset = data_offset(); unsigned adjust = data_adjust(); if(r4818 & 8) adjust = (int16)adjust; set_data_offset(offset + adjust); data_port_read(); } void SPC7110::data_port_increment_481a() { if(r4818 >> 5 != 3) return; unsigned offset = data_offset(); unsigned adjust = data_adjust(); if(r4818 & 8) adjust = (int16)adjust; set_data_offset(offset + adjust); data_port_read(); } #endif nall/dl.hpp000664 001750 001750 00000006146 12651764221 013755 0ustar00sergiosergio000000 000000 #ifndef NALL_DL_HPP #define NALL_DL_HPP //dynamic linking support #include #include #include #include #if defined(PLATFORM_X) || defined(PLATFORM_MACOSX) #include #elif defined(PLATFORM_WINDOWS) #include #include #endif namespace nall { struct library { explicit operator bool() const { return open(); } bool open() const { return handle; } bool open(const string&, const string& = ""); bool open_absolute(const string&); void* sym(const string&); void close(); library() = default; ~library() { close(); } library& operator=(const library&) = delete; library(const library&) = delete; private: uintptr_t handle = 0; }; #if defined(PLATFORM_X) inline bool library::open(const string& name, const string& path) { if(handle) close(); handle = (uintptr_t)dlopen(string(path, !path.empty() && !path.endsWith("/") ? "/" : "", "lib", name, ".so"), RTLD_LAZY); if(!handle) handle = (uintptr_t)dlopen(string("/usr/local/lib/lib", name, ".so"), RTLD_LAZY); return handle; } inline bool library::open_absolute(const string& name) { if(handle) close(); handle = (uintptr_t)dlopen(name, RTLD_LAZY); return handle; } inline void* library::sym(const string& name) { if(!handle) return nullptr; return dlsym((void*)handle, name); } inline void library::close() { if(!handle) return; dlclose((void*)handle); handle = 0; } #elif defined(PLATFORM_MACOSX) inline bool library::open(const string& name, const string& path) { if(handle) close(); handle = (uintptr_t)dlopen(string(path, !path.empty() && !path.endsWith("/") ? "/" : "", "lib", name, ".dylib"), RTLD_LAZY); if(!handle) handle = (uintptr_t)dlopen(string("/usr/local/lib/lib", name, ".dylib"), RTLD_LAZY); return handle; } inline bool library::open_absolute(const string& name) { if(handle) close(); handle = (uintptr_t)dlopen(name, RTLD_LAZY); return handle; } inline void* library::sym(const string& name) { if(!handle) return nullptr; return dlsym((void*)handle, name); } inline void library::close() { if(!handle) return; dlclose((void*)handle); handle = 0; } #elif defined(PLATFORM_WINDOWS) inline bool library::open(const string& name, const string& path) { if(handle) close(); string filepath(path, !path.empty() && !path.endsWith("/") && !path.endsWith("\\") ? "/" : "", name, ".dll"); handle = (uintptr_t)LoadLibraryW(utf16_t(filepath)); return handle; } inline bool library::open_absolute(const string& name) { if(handle) close(); handle = (uintptr_t)LoadLibraryW(utf16_t(name)); return handle; } inline void* library::sym(const string& name) { if(!handle) return nullptr; return (void*)GetProcAddress((HMODULE)handle, name); } inline void library::close() { if(!handle) return; FreeLibrary((HMODULE)handle); handle = 0; } #else inline bool library::open(const string&, const string&) { return false; } inline bool library::open_absolute(const string&) { return false; } inline void* library::sym(const string&) { return nullptr; } inline void library::close() {} #endif } #endif gba/scheduler/scheduler.cpp000664 001750 001750 00000000732 12651764221 017103 0ustar00sergiosergio000000 000000 #include namespace GameBoyAdvance { Scheduler scheduler; void Scheduler::enter() { host = co_active(); co_switch(active); } void Scheduler::exit(ExitReason reason) { exit_reason = reason; active = co_active(); co_switch(host); } void Scheduler::power() { host = co_active(); active = cpu.thread; } Scheduler::Scheduler() { sync = SynchronizeMode::None; exit_reason = ExitReason::UnknownEvent; host = nullptr; active = nullptr; } } processor/upd96050/registers.hpp000664 001750 001750 00000002641 12651764221 017646 0ustar00sergiosergio000000 000000 struct Flag { bool s1, s0, c, z, ov1, ov0; inline operator unsigned() const { return (s1 << 5) + (s0 << 4) + (c << 3) + (z << 2) + (ov1 << 1) + (ov0 << 0); } inline unsigned operator=(unsigned d) { s1 = d & 0x20; s0 = d & 0x10; c = d & 0x08; z = d & 0x04; ov1 = d & 0x02; ov0 = d & 0x01; return d; } }; struct Status { bool rqm, usf1, usf0, drs, dma, drc, soc, sic, ei, p1, p0; inline operator unsigned() const { return (rqm << 15) + (usf1 << 14) + (usf0 << 13) + (drs << 12) + (dma << 11) + (drc << 10) + (soc << 9) + (sic << 8) + (ei << 7) + (p1 << 1) + (p0 << 0); } inline unsigned operator=(unsigned d) { rqm = d & 0x8000; usf1 = d & 0x4000; usf0 = d & 0x2000; drs = d & 0x1000; dma = d & 0x0800; drc = d & 0x0400; soc = d & 0x0200; sic = d & 0x0100; ei = d & 0x0080; p1 = d & 0x0002; p0 = d & 0x0001; return d; } }; struct Regs { uint16 stack[16]; //LIFO varuint pc; //program counter varuint rp; //ROM pointer varuint dp; //data pointer uint4 sp; //stack pointer int16 k; int16 l; int16 m; int16 n; int16 a; //accumulator int16 b; //accumulator Flag flaga; Flag flagb; uint16 tr; //temporary register uint16 trb; //temporary register Status sr; //status register uint16 dr; //data register uint16 si; uint16 so; } regs; phoenix/gtk/settings.cpp000664 001750 001750 00000001523 12651764221 016514 0ustar00sergiosergio000000 000000 namespace phoenix { static Settings* settings = nullptr; void Settings::load() { string path = {userpath(), ".config/phoenix/"}; Configuration::Document::load({path, "gtk.bml"}); } void Settings::save() { string path = {userpath(), ".config/phoenix/"}; directory::create(path, 0755); Configuration::Document::save({path, "gtk.bml"}); } Settings::Settings() { geometry.append(geometry.frameX = 4, "FrameX"); geometry.append(geometry.frameY = 24, "FrameY"); geometry.append(geometry.frameWidth = 8, "FrameWidth"); geometry.append(geometry.frameHeight = 28, "FrameHeight"); geometry.append(geometry.menuHeight = 20, "MenuHeight"); geometry.append(geometry.statusHeight = 20, "StatusHeight"); append(geometry, "Geometry"); window.append(window.backgroundColor = 0xedeceb, "BackgroundColor"); append(window, "Window"); } } ananke/ananke.cpp000664 001750 001750 00000013716 12651764221 015116 0ustar00sergiosergio000000 000000 #include #include #include "heuristics/famicom.hpp" #include "heuristics/super-famicom.hpp" #include "heuristics/game-boy.hpp" #include "heuristics/game-boy-advance.hpp" using namespace nall; #include using namespace phoenix; namespace Database { #include "database/super-famicom.hpp" #include "database/sufami-turbo.hpp" #include "database/bsx-satellaview.hpp" }; struct Ananke { #include "configuration.cpp" string libraryPath; Ananke(); struct Information { string path; //path to selected file string name; //name of selected file (inside of archive if .zip) string archive; //pathname of archive string manifest; //manifest from successfully applied patch } information; //archive.cpp vector extractROM(); vector extractFile(const string &filename); //patch.cpp void applyBeatPatch(vector &buffer); //famicom.cpp void copyFamicomSaves(const string &pathname); string createFamicomHeuristic(vector &buffer); string openFamicom(vector &buffer); string syncFamicom(const string &pathname); //super-famicom.cpp void copySuperFamicomSaves(const string &pathname); string createSuperFamicomDatabase(vector &buffer, Markup::Node &document, const string &manifest); string createSuperFamicomHeuristic(vector &buffer); void createSuperFamicomHeuristicFirmware(vector &buffer, const string &pathname, bool firmware_appended); string openSuperFamicom(vector &buffer); string syncSuperFamicom(const string &pathname); //sufami-turbo.cpp void copySufamiTurboSaves(const string &pathname); string createSufamiTurboDatabase(vector &buffer, Markup::Node &document, const string &manifest); string createSufamiTurboHeuristic(vector &buffer); string openSufamiTurbo(vector &buffer); string syncSufamiTurbo(const string &pathname); //bsx-satellaview.cpp string createBsxSatellaviewDatabase(vector &buffer, Markup::Node &document, const string &manifest); string createBsxSatellaviewHeuristic(vector &buffer); string openBsxSatellaview(vector &buffer); string syncBsxSatellaview(const string &pathname); //game-boy.cpp void copyGameBoySaves(const string &pathname); string createGameBoyHeuristic(vector &buffer); string openGameBoy(vector &buffer); string syncGameBoy(const string &pathname); //game-boy-advance.cpp void copyGameBoyAdvanceSaves(const string &pathname); string createGameBoyAdvanceHeuristic(vector &buffer); string openGameBoyAdvance(vector &buffer); string syncGameBoyAdvance(const string &pathname); static bool supported(const string &filename); string open(string filename = ""); string sync(string pathname); }; #include "resource/resource.cpp" #include "file-dialog.cpp" #include "archive.cpp" #include "patch.cpp" #include "famicom.cpp" #include "super-famicom.cpp" #include "sufami-turbo.cpp" #include "bsx-satellaview.cpp" #include "game-boy.cpp" #include "game-boy-advance.cpp" FileDialog *fileDialog = nullptr; Ananke::Ananke() { libraryPath = string::read({configpath(), "higan/library.bml"}).strip().ltrim<1>("Path: ").replace("\\", "/"); if(libraryPath.empty()) libraryPath = {userpath(), "Emulation/"}; if(libraryPath.endsWith("/") == false) libraryPath.append("/"); } bool Ananke::supported(const string &filename) { string extension = nall::extension(filename); if(extension == "fc" ) return true; if(extension == "nes") return true; if(extension == "sfc") return true; if(extension == "smc") return true; if(extension == "st" ) return true; if(extension == "bs" ) return true; if(extension == "gb" ) return true; if(extension == "gbc") return true; if(extension == "gba") return true; if(extension == "zip") return true; return false; } string Ananke::open(string filename) { if(filename.empty()) { if(!fileDialog) { fileDialog = new FileDialog; fileDialog->setGeometry(config.geometry); } fileDialog->setPath(config.path); filename = fileDialog->open(); config.geometry = fileDialog->geometry().text(); } if(filename.empty()) return ""; information.path = dir(filename); information.name = notdir(filename); config.path = information.path; //remember last used directory vector buffer; if(filename.endsWith(".zip")) { information.archive = filename; buffer = extractROM(); } else { buffer = file::read(filename); } if(buffer.size() == 0) return ""; //failed to read file applyBeatPatch(buffer); if(information.name.endsWith(".fc") || information.name.endsWith(".nes")) return openFamicom(buffer); if(information.name.endsWith(".sfc") || information.name.endsWith(".smc")) return openSuperFamicom(buffer); if(information.name.endsWith(".st")) return openSufamiTurbo(buffer); if(information.name.endsWith(".bs")) return openBsxSatellaview(buffer); if(information.name.endsWith(".gb") || information.name.endsWith(".gbc")) return openGameBoy(buffer); if(information.name.endsWith(".gba")) return openGameBoyAdvance(buffer); return ""; } string Ananke::sync(string pathname) { if(pathname.endsWith(".fc/")) return syncFamicom(pathname); if(pathname.endsWith(".sfc/")) return syncSuperFamicom(pathname); if(pathname.endsWith(".st/")) return syncSufamiTurbo(pathname); if(pathname.endsWith(".bs/")) return syncBsxSatellaview(pathname); if(pathname.endsWith(".gb/")) return syncGameBoy(pathname); if(pathname.endsWith(".gbc/")) return syncGameBoy(pathname); if(pathname.endsWith(".gba/")) return syncGameBoyAdvance(pathname); return ""; } extern "C" string ananke_browse(const string &filename) { Ananke ananke; return ananke.open(); } extern "C" string ananke_open(const string &filename) { Ananke ananke; return ananke.open(filename); } extern "C" string ananke_sync(const string &pathname) { Ananke ananke; return ananke.sync(pathname); } target-ethos/settings/input.hpp000664 001750 001750 00000001757 12651764221 020040 0ustar00sergiosergio000000 000000 struct InputSettings : SettingsLayout { HorizontalLayout focusLayout; Label focusLabel; CheckLabel focusPause; CheckLabel focusAllow; HorizontalLayout selectionLayout; ComboButton systemList; ComboButton portList; ComboButton deviceList; ListView inputList; HorizontalLayout controlLayout; Button assign[3]; Widget spacer; Button resetButton; Button eraseButton; void synchronize(); Emulator::Interface& activeSystem(); Emulator::Interface::Port& activePort(); Emulator::Interface::Device& activeDevice(); void systemChanged(); void portChanged(); void deviceChanged(); void inputChanged(); void resetInput(); void eraseInput(); void assignInput(); void assignMouseInput(unsigned n); void inputEvent(HID::Device& device, unsigned group, unsigned input, int16_t oldValue, int16_t newValue, bool allowMouseInput = false); InputSettings(); private: AbstractInput* activeInput = nullptr; }; extern InputSettings* inputSettings; sfc/alt/ppu-performance/sprite/sprite.cpp000664 001750 001750 00000014007 12651764221 021670 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP void PPU::Sprite::frame() { regs.time_over = false; regs.range_over = false; } void PPU::Sprite::update_list(unsigned addr, uint8 data) { if(addr < 0x0200) { unsigned i = addr >> 2; switch(addr & 3) { case 0: list[i].x = (list[i].x & 0x0100) | data; break; case 1: list[i].y = (data + 1) & 0xff; break; case 2: list[i].character = data; break; case 3: list[i].vflip = data & 0x80; list[i].hflip = data & 0x40; list[i].priority = (data >> 4) & 3; list[i].palette = (data >> 1) & 7; list[i].use_nameselect = data & 0x01; break; } } else { unsigned i = (addr & 0x1f) << 2; list[i + 0].x = ((data & 0x01) << 8) | (list[i + 0].x & 0xff); list[i + 0].size = data & 0x02; list[i + 1].x = ((data & 0x04) << 6) | (list[i + 1].x & 0xff); list[i + 1].size = data & 0x08; list[i + 2].x = ((data & 0x10) << 4) | (list[i + 2].x & 0xff); list[i + 2].size = data & 0x20; list[i + 3].x = ((data & 0x40) << 2) | (list[i + 3].x & 0xff); list[i + 3].size = data & 0x80; list_valid = false; } } void PPU::Sprite::address_reset() { self.regs.oam_addr = self.regs.oam_baseaddr << 1; set_first(); } void PPU::Sprite::set_first() { regs.first_sprite = (self.regs.oam_priority == false ? 0 : (self.regs.oam_addr >> 2) & 127); } bool PPU::Sprite::on_scanline(unsigned sprite) { auto& s = list[sprite]; if(s.x > 256 && (s.x + s.width - 1) < 512) return false; signed height = (regs.interlace == false ? s.height : s.height >> 1); if(self.vcounter() >= s.y && self.vcounter() < (s.y + height)) return true; if((s.y + height) >= 256 && self.vcounter() < ((s.y + height) & 255)) return true; return false; } void PPU::Sprite::render() { if(list_valid == false) { list_valid = true; for(unsigned i = 0; i < 128; i++) { if(list[i].size == 0) { static unsigned width[] = { 8, 8, 8, 16, 16, 32, 16, 16 }; static unsigned height[] = { 8, 8, 8, 16, 16, 32, 32, 32 }; list[i].width = width[regs.base_size]; list[i].height = height[regs.base_size]; } else { static unsigned width[] = { 16, 32, 64, 32, 64, 64, 32, 32 }; static unsigned height[] = { 16, 32, 64, 32, 64, 64, 64, 32 }; list[i].width = width[regs.base_size]; list[i].height = height[regs.base_size]; if(regs.interlace && regs.base_size >= 6) list[i].height = 16; } } } unsigned itemcount = 0; unsigned tilecount = 0; memset(output.priority, 0xff, 256); memset(itemlist, 0xff, 32); for(unsigned i = 0; i < 34; i++) tilelist[i].tile = 0xffff; for(unsigned i = 0; i < 128; i++) { unsigned s = (regs.first_sprite + i) & 127; if(on_scanline(s) == false) continue; if(itemcount++ >= 32) break; itemlist[itemcount - 1] = s; } for(signed i = 31; i >= 0; i--) { if(itemlist[i] == 0xff) continue; auto& s = list[itemlist[i]]; unsigned tile_width = s.width >> 3; signed x = s.x; signed y = (self.vcounter() - s.y) & 0xff; if(regs.interlace) y <<= 1; if(s.vflip) { if(s.width == s.height) { y = (s.height - 1) - y; } else { y = (y < s.width) ? ((s.width - 1) - y) : (s.width + ((s.width - 1) - (y - s.width))); } } if(regs.interlace) { y = (s.vflip == false) ? (y + self.field()) : (y - self.field()); } x &= 511; y &= 255; uint16 tdaddr = regs.tiledata_addr; uint16 chrx = (s.character >> 0) & 15; uint16 chry = (s.character >> 4) & 15; if(s.use_nameselect) { tdaddr += (256 * 32) + (regs.nameselect << 13); } chry += (y >> 3); chry &= 15; chry <<= 4; for(unsigned tx = 0; tx < tile_width; tx++) { unsigned sx = (x + (tx << 3)) & 511; if(x != 256 && sx >= 256 && (sx + 7) < 512) continue; if(tilecount++ >= 34) break; unsigned n = tilecount - 1; tilelist[n].x = sx; tilelist[n].y = y; tilelist[n].priority = s.priority; tilelist[n].palette = 128 + (s.palette << 4); tilelist[n].hflip = s.hflip; unsigned mx = (s.hflip == false) ? tx : ((tile_width - 1) - tx); unsigned pos = tdaddr + ((chry + ((chrx + mx) & 15)) << 5); tilelist[n].tile = (pos >> 5) & 0x07ff; } } regs.time_over |= (tilecount > 34); regs.range_over |= (itemcount > 32); if(regs.main_enable == false && regs.sub_enable == false) return; for(unsigned i = 0; i < 34; i++) { if(tilelist[i].tile == 0xffff) continue; auto& t = tilelist[i]; uint8* tiledata = self.cache.tile_4bpp(t.tile); tiledata += (t.y & 7) << 3; unsigned sx = t.x; for(unsigned x = 0; x < 8; x++) { sx &= 511; if(sx < 256) { unsigned color = *(tiledata + (t.hflip == false ? x : 7 - x)); if(color) { color += t.palette; output.palette[sx] = color; output.priority[sx] = t.priority; } } sx++; } } if(regs.main_enable) window.render(0); if(regs.sub_enable) window.render(1); unsigned priority0 = (priority0_enable ? regs.priority0 : 0); unsigned priority1 = (priority1_enable ? regs.priority1 : 0); unsigned priority2 = (priority2_enable ? regs.priority2 : 0); unsigned priority3 = (priority3_enable ? regs.priority3 : 0); if(priority0 + priority1 + priority2 + priority3 == 0) return; const unsigned priority_table[] = { priority0, priority1, priority2, priority3 }; for(unsigned x = 0; x < 256; x++) { if(output.priority[x] == 0xff) continue; unsigned priority = priority_table[output.priority[x]]; unsigned palette = output.palette[x]; unsigned color = self.screen.get_palette(output.palette[x]); if(regs.main_enable && !window.main[x]) self.screen.output.plot_main(x, color, priority, 4 + (palette < 192)); if(regs.sub_enable && !window.sub[x]) self.screen.output.plot_sub(x, color, priority, 4 + (palette < 192)); } } PPU::Sprite::Sprite(PPU& self) : self(self) { priority0_enable = true; priority1_enable = true; priority2_enable = true; priority3_enable = true; } #endif phoenix/cocoa/widget/vertical-scroller.hpp000664 001750 001750 00000001212 12651764221 022072 0ustar00sergiosergio000000 000000 @interface CocoaVerticalScroller : NSScroller { @public phoenix::VerticalScroller* verticalScroller; } -(id) initWith:(phoenix::VerticalScroller&)verticalScroller; -(void) update; -(IBAction) scroll:(id)sender; @end namespace phoenix { struct pVerticalScroller : public pWidget { VerticalScroller& verticalScroller; CocoaVerticalScroller* cocoaVerticalScroller = nullptr; Size minimumSize(); void setLength(unsigned length); void setPosition(unsigned position); pVerticalScroller(VerticalScroller& verticalScroller) : pWidget(verticalScroller), verticalScroller(verticalScroller) {} void constructor(); void destructor(); }; } ruby/video/wgl.cpp000664 001750 001750 00000007655 12651764221 015311 0ustar00sergiosergio000000 000000 #include "opengl/opengl.hpp" #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 namespace ruby { struct pVideoWGL : OpenGL { HGLRC (APIENTRY* wglCreateContextAttribs)(HDC, HGLRC, const int*) = nullptr; BOOL (APIENTRY* wglSwapInterval)(int) = nullptr; HDC display; HGLRC wglcontext; HWND window; HINSTANCE glwindow; struct { HWND handle; bool synchronize; unsigned filter; string shader; } settings; bool cap(const string& name) { if(name == Video::Handle) return true; if(name == Video::Synchronize) return true; if(name == Video::Filter) return true; if(name == Video::Shader) return true; return false; } any get(const string& name) { if(name == Video::Handle) return (uintptr_t)settings.handle; if(name == Video::Synchronize) return settings.synchronize; if(name == Video::Filter) return settings.filter; return false; } bool set(const string& name, const any& value) { if(name == Video::Handle) { settings.handle = (HWND)any_cast(value); return true; } if(name == Video::Synchronize) { if(settings.synchronize != any_cast(value)) { settings.synchronize = any_cast(value); if(wglcontext) { init(); OpenGL::shader(settings.shader); if(settings.shader.empty()) OpenGL::filter = settings.filter ? GL_LINEAR : GL_NEAREST; } } } if(name == Video::Filter) { settings.filter = any_cast(value); if(settings.shader.empty()) OpenGL::filter = settings.filter ? GL_LINEAR : GL_NEAREST; return true; } if(name == Video::Shader) { settings.shader = any_cast(value); OpenGL::shader(settings.shader); if(settings.shader.empty()) OpenGL::filter = settings.filter ? GL_LINEAR : GL_NEAREST; return true; } return false; } bool lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) { OpenGL::size(width, height); return OpenGL::lock(data, pitch); } void unlock() { } void clear() { OpenGL::clear(); SwapBuffers(display); } void refresh() { RECT rc; GetClientRect(settings.handle, &rc); outputWidth = rc.right - rc.left, outputHeight = rc.bottom - rc.top; OpenGL::refresh(); SwapBuffers(display); } bool init() { term(); GLuint pixel_format; PIXELFORMATDESCRIPTOR pfd; memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR)); pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); pfd.nVersion = 1; pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; pfd.iPixelType = PFD_TYPE_RGBA; display = GetDC(settings.handle); pixel_format = ChoosePixelFormat(display, &pfd); SetPixelFormat(display, pixel_format, &pfd); wglcontext = wglCreateContext(display); wglMakeCurrent(display, wglcontext); wglCreateContextAttribs = (HGLRC (APIENTRY*)(HDC, HGLRC, const int*))glGetProcAddress("wglCreateContextAttribsARB"); wglSwapInterval = (BOOL (APIENTRY*)(int))glGetProcAddress("wglSwapIntervalEXT"); if(wglCreateContextAttribs) { int attributes[] = { WGL_CONTEXT_MAJOR_VERSION_ARB, 3, WGL_CONTEXT_MINOR_VERSION_ARB, 2, 0 }; HGLRC context = wglCreateContextAttribs(display, 0, attributes); if(context) { wglMakeCurrent(NULL, NULL); wglDeleteContext(wglcontext); wglMakeCurrent(display, wglcontext = context); } } if(wglSwapInterval) { wglSwapInterval(settings.synchronize); } OpenGL::init(); return true; } void term() { OpenGL::term(); if(wglcontext) { wglDeleteContext(wglcontext); wglcontext = 0; } } pVideoWGL() { settings.handle = 0; settings.synchronize = false; settings.filter = 0; window = 0; wglcontext = 0; glwindow = 0; } ~pVideoWGL() { term(); } }; DeclareVideo(WGL) }; phoenix/gtk/widget/combo-button.cpp000664 001750 001750 00000004153 12651764221 020551 0ustar00sergiosergio000000 000000 namespace phoenix { static void ComboButton_change(ComboButton* self) { if(!self->p.locked) { self->state.selection = gtk_combo_box_get_active(GTK_COMBO_BOX(self->p.gtkWidget)); if(self->onChange) self->onChange(); } } void pComboButton::append(string text) { gtk_combo_box_append_text(GTK_COMBO_BOX(gtkWidget), text); if(itemCounter++ == 0) comboButton.setSelection(0); } Size pComboButton::minimumSize() { unsigned maximumWidth = 0; for(auto& item : comboButton.state.text) maximumWidth = max(maximumWidth, pFont::size(widget.state.font, item).width); Size size = pFont::size(widget.state.font, " "); return {maximumWidth + 44, size.height + 12}; } void pComboButton::remove(unsigned selection) { locked = true; gtk_combo_box_remove_text(GTK_COMBO_BOX(gtkWidget), selection); itemCounter--; locked = false; //when removing the actively selected item, reset the selection to the first entry if(selection == comboButton.state.selection) comboButton.setSelection(0); } void pComboButton::reset() { locked = true; gtk_list_store_clear(GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(gtkWidget)))); itemCounter = 0; locked = false; } void pComboButton::setSelection(unsigned selection) { locked = true; gtk_combo_box_set_active(GTK_COMBO_BOX(gtkWidget), selection); locked = false; } void pComboButton::setText(unsigned selection, string text) { locked = true; gtk_combo_box_remove_text(GTK_COMBO_BOX(gtkWidget), selection); gtk_combo_box_insert_text(GTK_COMBO_BOX(gtkWidget), selection, text); gtk_combo_box_set_active(GTK_COMBO_BOX(gtkWidget), comboButton.state.selection); locked = false; } void pComboButton::constructor() { itemCounter = 0; gtkWidget = gtk_combo_box_new_text(); g_signal_connect_swapped(G_OBJECT(gtkWidget), "changed", G_CALLBACK(ComboButton_change), (gpointer)&comboButton); locked = true; for(auto& text : comboButton.state.text) append(text); locked = false; setSelection(comboButton.state.selection); } void pComboButton::destructor() { gtk_widget_destroy(gtkWidget); } void pComboButton::orphan() { destructor(); constructor(); } } sfc/chip/cx4/serialization.cpp000664 001750 001750 00000001226 12651764221 017466 0ustar00sergiosergio000000 000000 #ifdef CX4_CPP void Cx4::serialize(serializer &s) { s.array(ram); s.array(reg); s.integer(r0); s.integer(r1); s.integer(r2); s.integer(r3); s.integer(r4); s.integer(r5); s.integer(r6); s.integer(r7); s.integer(r8); s.integer(r9); s.integer(r10); s.integer(r11); s.integer(r12); s.integer(r13); s.integer(r14); s.integer(r15); s.integer(C4WFXVal); s.integer(C4WFYVal); s.integer(C4WFZVal); s.integer(C4WFX2Val); s.integer(C4WFY2Val); s.integer(C4WFDist); s.integer(C4WFScale); s.integer(C41FXVal); s.integer(C41FYVal); s.integer(C41FAngleRes); s.integer(C41FDist); s.integer(C41FDistVal); } #endif ananke/database/bsx-satellaview.hpp000664 001750 001750 00000000733 12651764221 020537 0ustar00sergiosergio000000 000000 string BsxSatellaview = R"( database revision=2013-01-22 release cartridge rom name=program.rom size=0x80000 type=MaskROM information title: 鮫亀 キャラカセット name: Same Game - Character Cassette region: JP revision: 1.0 board: BSMC-CR-01 serial: BSMC-ZS5J-JPN sha256: 80c34b50817d58820bc8c88d2d9fa462550b4a76372e19c6467cbfbc8cf5d9ef configuration rom name=program.rom size=0x80000 type=MaskROM )"; target-ethos/resource/game.png000664 001750 001750 00000002722 12651764221 017567 0ustar00sergiosergio000000 000000 PNG  IHDR szzsBIT|dIDATX[l盛|Yq QR42[5ԄT(R՗HDQlJyzQ}BB[%AR (I 7p:1}f>x찶O˜sO^tf/[﵆q؟ ZL/[gvj᏷gɴ5: jaL?62ܭ89_+obP{_fE_|jہl/;0oӋ DB&{ir{|ˁl/;0o|.@kܛA"ތ9>LE%k՞Ӂ@\lVJ@DD]P˯6O\N@$~S@8kA4~ϧ^:Hn.9] l?UDs?3( D)+GoN v_Ot52" A)cF [Bө%xۯ[B1DP}RieAK-%۶d+dz?luMHSuo/\IkOa/^=Hq@qllG)9K(Pf)l5͈HB"ɩGYaXUX( QYL-d /͞(iZQE(;sG~Hܰ,X1L-8 څi#H 3Euo D^zܼt&=ZY݈Z$:PST!'?QKDdzنȁbZO5߸DbnFƃqDX8v%Ik4 !A;mkVT @(N~1j;X҅5hz; PШyK-]v-7/B&fZQ'׾s@x/AcS'ǨkG8^kASװ`סGO!>/26NKB֒.PA!sl;UV~Ӷ;N(`U㍜+M]Ϳ5gU TίbU\Hemfs'np4H4P|ܿR 3\vsߑE_.XI!J}aG/s,&^P[ZXD/Zgnu[ZԷ⏜8gA Qk `fPrHWVLڠoJoY'1Ѹe0cƿY3Ϟ;B("lv,Ê, gD!-|ay6GS/>3;qr_w?k GIENDB`sfc/chip/cx4/cx4.hpp000664 001750 001750 00000004053 12651764221 015315 0ustar00sergiosergio000000 000000 class Cx4 : public Memory { public: void init(); void load(); void unload(); void power(); void reset(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); void serialize(serializer&); private: uint8 ram[0x0c00]; uint8 reg[0x0100]; uint32 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15; static const uint8 immediate_data[48]; static const uint16 wave_data[40]; static const uint32 sin_table[256]; static const int16 SinTable[512]; static const int16 CosTable[512]; int16 C4WFXVal, C4WFYVal, C4WFZVal, C4WFX2Val, C4WFY2Val, C4WFDist, C4WFScale; int16 C41FXVal, C41FYVal, C41FAngleRes, C41FDist, C41FDistVal; void C4TransfWireFrame(); void C4TransfWireFrame2(); void C4CalcWireFrame(); void C4DrawLine(int32 X1, int32 Y1, int16 Z1, int32 X2, int32 Y2, int16 Z2, uint8 Color); void C4DrawWireFrame(); void C4DoScaleRotate(int row_padding); public: uint32 ldr(uint8 r); void str(uint8 r, uint32 data); void mul(uint32 x, uint32 y, uint32 &rl, uint32 &rh); uint32 sin(uint32 rx); uint32 cos(uint32 rx); void transfer_data(); void immediate_reg(uint32 num); void op00_00(); void op00_03(); void op00_05(); void op00_07(); void op00_08(); void op00_0b(); void op00_0c(); void op00(); void op01(); void op05(); void op0d(); void op10(); void op13(); void op15(); void op1f(); void op22(); void op25(); void op2d(); void op40(); void op54(); void op5c(); void op5e(); void op60(); void op62(); void op64(); void op66(); void op68(); void op6a(); void op6c(); void op6e(); void op70(); void op72(); void op74(); void op76(); void op78(); void op7a(); void op7c(); void op89(); uint8 readb(uint16 addr); uint16 readw(uint16 addr); uint32 readl(uint16 addr); void writeb(uint16 addr, uint8 data); void writew(uint16 addr, uint16 data); void writel(uint16 addr, uint32 data); }; extern Cx4 cx4; sfc/chip/cx4/oam.cpp000664 001750 001750 00000013702 12651764221 015367 0ustar00sergiosergio000000 000000 #ifdef CX4_CPP //Build OAM void Cx4::op00_00() { uint32 oamptr = ram[0x626] << 2; for(int32 i = 0x1fd; i > oamptr && i >= 0; i -= 4) { //clear oam-to-be if(i >= 0) ram[i] = 0xe0; } uint16 globalx, globaly; uint32 oamptr2; int16 sprx, spry; uint8 sprname, sprattr; uint8 sprcount; globalx = readw(0x621); globaly = readw(0x623); oamptr2 = 0x200 + (ram[0x626] >> 2); if(!ram[0x620]) return; sprcount = 128 - ram[0x626]; uint8 offset = (ram[0x626] & 3) * 2; uint32 srcptr = 0x220; for(int i = ram[0x620]; i > 0 && sprcount > 0; i--, srcptr += 16) { sprx = readw(srcptr) - globalx; spry = readw(srcptr + 2) - globaly; sprname = ram[srcptr + 5]; sprattr = ram[srcptr + 4] | ram[srcptr + 6]; uint32 spraddr = readl(srcptr + 7); if(bus.read(spraddr)) { int16 x, y; for(int sprcnt = bus.read(spraddr++); sprcnt > 0 && sprcount > 0; sprcnt--, spraddr += 4) { x = (int8)bus.read(spraddr + 1); if(sprattr & 0x40) { x = -x - ((bus.read(spraddr) & 0x20) ? 16 : 8); } x += sprx; if(x >= -16 && x <= 272) { y = (int8)bus.read(spraddr + 2); if(sprattr & 0x80) { y = -y - ((bus.read(spraddr) & 0x20) ? 16 : 8); } y += spry; if(y >= -16 && y <= 224) { ram[oamptr ] = (uint8)x; ram[oamptr + 1] = (uint8)y; ram[oamptr + 2] = sprname + bus.read(spraddr + 3); ram[oamptr + 3] = sprattr ^ (bus.read(spraddr) & 0xc0); ram[oamptr2] &= ~(3 << offset); if(x & 0x100) ram[oamptr2] |= 1 << offset; if(bus.read(spraddr) & 0x20) ram[oamptr2] |= 2 << offset; oamptr += 4; sprcount--; offset = (offset + 2) & 6; if(!offset)oamptr2++; } } } } else if(sprcount > 0) { ram[oamptr ] = (uint8)sprx; ram[oamptr + 1] = (uint8)spry; ram[oamptr + 2] = sprname; ram[oamptr + 3] = sprattr; ram[oamptr2] &= ~(3 << offset); if(sprx & 0x100) ram[oamptr2] |= 3 << offset; else ram[oamptr2] |= 2 << offset; oamptr += 4; sprcount--; offset = (offset + 2) & 6; if(!offset) oamptr2++; } } } //Scale and Rotate void Cx4::op00_03() { C4DoScaleRotate(0); } //Transform Lines void Cx4::op00_05() { C4WFX2Val = read(0x1f83); C4WFY2Val = read(0x1f86); C4WFDist = read(0x1f89); C4WFScale = read(0x1f8c); //Transform Vertices uint32 ptr = 0; for(int32 i = readw(0x1f80); i > 0; i--, ptr += 0x10) { C4WFXVal = readw(ptr + 1); C4WFYVal = readw(ptr + 5); C4WFZVal = readw(ptr + 9); C4TransfWireFrame(); //Displace writew(ptr + 1, C4WFXVal + 0x80); writew(ptr + 5, C4WFYVal + 0x50); } writew(0x600, 23); writew(0x602, 0x60); writew(0x605, 0x40); writew(0x600 + 8, 23); writew(0x602 + 8, 0x60); writew(0x605 + 8, 0x40); ptr = 0xb02; uint32 ptr2 = 0; for(int32 i = readw(0xb00); i > 0; i--, ptr += 2, ptr2 += 8) { C4WFXVal = readw((read(ptr + 0) << 4) + 1); C4WFYVal = readw((read(ptr + 0) << 4) + 5); C4WFX2Val = readw((read(ptr + 1) << 4) + 1); C4WFY2Val = readw((read(ptr + 1) << 4) + 5); C4CalcWireFrame(); writew(ptr2 + 0x600, C4WFDist ? C4WFDist : 1); writew(ptr2 + 0x602, C4WFXVal); writew(ptr2 + 0x605, C4WFYVal); } } //Scale and Rotate void Cx4::op00_07() { C4DoScaleRotate(64); } //Draw Wireframe void Cx4::op00_08() { C4DrawWireFrame(); } //Disintegrate void Cx4::op00_0b() { uint8 width, height; uint32 startx, starty; uint32 srcptr; uint32 x, y; int32 scalex, scaley; int32 cx, cy; int32 i, j; width = read(0x1f89); height = read(0x1f8c); cx = readw(0x1f80); cy = readw(0x1f83); scalex = (int16)readw(0x1f86); scaley = (int16)readw(0x1f8f); startx = -cx * scalex + (cx << 8); starty = -cy * scaley + (cy << 8); srcptr = 0x600; for(i = 0; i < (width * height) >> 1; i++) { write(i, 0); } for(y = starty, i = 0;i < height; i++, y += scaley) { for(x = startx, j = 0;j < width; j++, x += scalex) { if((x >> 8) < width && (y >> 8) < height && (y >> 8) * width + (x >> 8) < 0x2000) { uint8 pixel = (j & 1) ? (ram[srcptr] >> 4) : (ram[srcptr]); int32 index = (y >> 11) * width * 4 + (x >> 11) * 32 + ((y >> 8) & 7) * 2; uint8 mask = 0x80 >> ((x >> 8) & 7); if(pixel & 1) ram[index ] |= mask; if(pixel & 2) ram[index + 1] |= mask; if(pixel & 4) ram[index + 16] |= mask; if(pixel & 8) ram[index + 17] |= mask; } if(j & 1) srcptr++; } } } //Bitplane Wave void Cx4::op00_0c() { uint32 destptr = 0; uint32 waveptr = read(0x1f83); uint16 mask1 = 0xc0c0; uint16 mask2 = 0x3f3f; for(int j = 0; j < 0x10; j++) { do { int16 height = -((int8)read(waveptr + 0xb00)) - 16; for(int i = 0; i < 40; i++) { uint16 temp = readw(destptr + wave_data[i]) & mask2; if(height >= 0) { if(height < 8) { temp |= mask1 & readw(0xa00 + height * 2); } else { temp |= mask1 & 0xff00; } } writew(destptr + wave_data[i], temp); height++; } waveptr = (waveptr + 1) & 0x7f; mask1 = (mask1 >> 2) | (mask1 << 6); mask2 = (mask2 >> 2) | (mask2 << 6); } while(mask1 != 0xc0c0); destptr += 16; do { int16 height = -((int8)read(waveptr + 0xb00)) - 16; for(int i = 0; i < 40; i++) { uint16 temp = readw(destptr + wave_data[i]) & mask2; if(height >= 0) { if(height < 8) { temp |= mask1 & readw(0xa10 + height * 2); } else { temp |= mask1 & 0xff00; } } writew(destptr + wave_data[i], temp); height++; } waveptr = (waveptr + 1) & 0x7f; mask1 = (mask1 >> 2) | (mask1 << 6); mask2 = (mask2 >> 2) | (mask2 << 6); } while(mask1 != 0xc0c0); destptr += 16; } } #endif ruby/audio/ao.cpp000664 001750 001750 00000003616 12651764221 015103 0ustar00sergiosergio000000 000000 /* audio.ao (2008-06-01) authors: Nach, RedDwarf */ #include namespace ruby { class pAudioAO { public: int driver_id; ao_sample_format driver_format; ao_device* audio_device; struct { unsigned frequency; } settings; bool cap(const string& name) { if(name == Audio::Frequency) return true; return false; } any get(const string& name) { if(name == Audio::Frequency) return settings.frequency; return false; } bool set(const string& name, const any& value) { if(name == Audio::Frequency) { settings.frequency = any_cast(value); if(audio_device) init(); return true; } return false; } void sample(uint16_t l_sample, uint16_t r_sample) { uint32_t samp = (l_sample << 0) + (r_sample << 16); ao_play(audio_device, (char*)&samp, 4); //This may need to be byte swapped for Big Endian } void clear() { } bool init() { term(); driver_id = ao_default_driver_id(); //ao_driver_id((const char*)driver) if(driver_id < 0) return false; driver_format.bits = 16; driver_format.channels = 2; driver_format.rate = settings.frequency; driver_format.byte_format = AO_FMT_LITTLE; ao_option* options = nullptr; ao_info *di = ao_driver_info(driver_id); if(!di) return false; if(!strcmp(di->short_name, "alsa")) { ao_append_option(&options, "buffer_time", "100000"); //100ms latency (default was 500ms) } audio_device = ao_open_live(driver_id, &driver_format, options); if(!audio_device) return false; return true; } void term() { if(audio_device) { ao_close(audio_device); audio_device = 0; } } pAudioAO() { audio_device = 0; ao_initialize(); settings.frequency = 22050; } ~pAudioAO() { term(); //ao_shutdown(); //FIXME: this is causing a segfault for some reason when called ... } }; DeclareAudio(AO) }; sfc/alt/dsp/blargg_config.h000664 001750 001750 00000001152 12651764221 016764 0ustar00sergiosergio000000 000000 // snes_spc 0.9.0 user configuration file. Don't replace when updating library. // snes_spc 0.9.0 #ifndef BLARGG_CONFIG_H #define BLARGG_CONFIG_H // Uncomment to disable debugging checks #define NDEBUG 1 // Uncomment to enable platform-specific (and possibly non-portable) optimizations //#define BLARGG_NONPORTABLE 1 // Uncomment if automatic byte-order determination doesn't work //#define BLARGG_BIG_ENDIAN 1 // Uncomment if you get errors in the bool section of blargg_common.h //#define BLARGG_COMPILER_HAS_BOOL 1 // Use standard config.h if present #ifdef HAVE_CONFIG_H #include "config.h" #endif #endif target-ethos/general/general.hpp000664 001750 001750 00000000117 12651764221 020060 0ustar00sergiosergio000000 000000 #include "library.hpp" #include "presentation.hpp" #include "dip-switches.hpp" processor/hg51b/serialization.cpp000664 001750 001750 00000001024 12651764221 020213 0ustar00sergiosergio000000 000000 #ifdef PROCESSOR_HG51B_HPP void HG51B::serialize(serializer& s) { s.array(dataRAM); for(auto& n : stack) s.integer(n); s.integer(opcode); s.integer(regs.halt); s.integer(regs.pc); s.integer(regs.p); s.integer(regs.n); s.integer(regs.z); s.integer(regs.c); s.integer(regs.a); s.integer(regs.acch); s.integer(regs.accl); s.integer(regs.busdata); s.integer(regs.romdata); s.integer(regs.ramdata); s.integer(regs.busaddr); s.integer(regs.ramaddr); for(auto& n : regs.gpr) s.integer(n); } #endif fc/cartridge/board/nes-bnrom.cpp000664 001750 001750 00000002065 12651764221 017742 0ustar00sergiosergio000000 000000 //NES-BN-ROM-01 struct NES_BNROM : Board { struct Settings { bool mirror; //0 = horizontal, 1 = vertical } settings; uint2 prg_bank; uint8 prg_read(unsigned addr) { if(addr & 0x8000) return prgrom.read((prg_bank << 15) | (addr & 0x7fff)); return cpu.mdr(); } void prg_write(unsigned addr, uint8 data) { if(addr & 0x8000) prg_bank = data & 0x03; } uint8 chr_read(unsigned addr) { if(addr & 0x2000) { if(settings.mirror == 0) addr = ((addr & 0x0800) >> 1) | (addr & 0x03ff); return ppu.ciram_read(addr); } return Board::chr_read(addr); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) { if(settings.mirror == 0) addr = ((addr & 0x0800) >> 1) | (addr & 0x03ff); return ppu.ciram_write(addr, data); } return Board::chr_write(addr, data); } void power() { } void reset() { prg_bank = 0; } void serialize(serializer& s) { Board::serialize(s); s.integer(prg_bank); } NES_BNROM(Markup::Node& document) : Board(document) { settings.mirror = document["cartridge"]["mirror"]["mode"].data == "vertical" ? 1 : 0; } }; sfc/alt/smp/core/000700 001750 001750 00000000000 12656700342 014755 5ustar00sergiosergio000000 000000 processor/lr35902/instructions.cpp000664 001750 001750 00000031076 12651764221 020226 0ustar00sergiosergio000000 000000 void LR35902::op_xx() { } void LR35902::op_cb() { exec_cb(); } //8-bit load commands template void LR35902::op_ld_r_r() { r[x] = r[y]; } template void LR35902::op_ld_r_n() { r[x] = op_read(r[PC]++); } template void LR35902::op_ld_r_hl() { r[x] = op_read(r[HL]); } template void LR35902::op_ld_hl_r() { op_write(r[HL], r[x]); } void LR35902::op_ld_hl_n() { op_write(r[HL], op_read(r[PC]++)); } template void LR35902::op_ld_a_rr() { r[A] = op_read(r[x]); } void LR35902::op_ld_a_nn() { uint8 lo = op_read(r[PC]++); uint8 hi = op_read(r[PC]++); r[A] = op_read((hi << 8) | (lo << 0)); } template void LR35902::op_ld_rr_a() { op_write(r[x], r[A]); } void LR35902::op_ld_nn_a() { uint8 lo = op_read(r[PC]++); uint8 hi = op_read(r[PC]++); op_write((hi << 8) | (lo << 0), r[A]); } void LR35902::op_ld_a_ffn() { r[A] = op_read(0xff00 + op_read(r[PC]++)); } void LR35902::op_ld_ffn_a() { op_write(0xff00 + op_read(r[PC]++), r[A]); } void LR35902::op_ld_a_ffc() { r[A] = op_read(0xff00 + r[C]); } void LR35902::op_ld_ffc_a() { op_write(0xff00 + r[C], r[A]); } void LR35902::op_ldi_hl_a() { op_write(r[HL], r[A]); r[HL]++; } void LR35902::op_ldi_a_hl() { r[A] = op_read(r[HL]); r[HL]++; } void LR35902::op_ldd_hl_a() { op_write(r[HL], r[A]); r[HL]--; } void LR35902::op_ldd_a_hl() { r[A] = op_read(r[HL]); r[HL]--; } //16-bit load commands template void LR35902::op_ld_rr_nn() { r[x] = op_read(r[PC]++) << 0; r[x] |= op_read(r[PC]++) << 8; } void LR35902::op_ld_nn_sp() { uint16 addr = op_read(r[PC]++) << 0; addr |= op_read(r[PC]++) << 8; op_write(addr + 0, r[SP] >> 0); op_write(addr + 1, r[SP] >> 8); } void LR35902::op_ld_sp_hl() { r[SP] = r[HL]; op_io(); } template void LR35902::op_push_rr() { op_write(--r[SP], r[x] >> 8); op_write(--r[SP], r[x] >> 0); op_io(); } template void LR35902::op_pop_rr() { r[x] = op_read(r[SP]++) << 0; r[x] |= op_read(r[SP]++) << 8; } //8-bit arithmetic commands void LR35902::opi_add_a(uint8 x) { uint16 rh = r[A] + x; uint16 rl = (r[A] & 0x0f) + (x & 0x0f); r[A] = rh; r.f.z = (uint8)rh == 0; r.f.n = 0; r.f.h = rl > 0x0f; r.f.c = rh > 0xff; } template void LR35902::op_add_a_r() { opi_add_a(r[x]); } void LR35902::op_add_a_n() { opi_add_a(op_read(r[PC]++)); } void LR35902::op_add_a_hl() { opi_add_a(op_read(r[HL])); } void LR35902::opi_adc_a(uint8 x) { uint16 rh = r[A] + x + r.f.c; uint16 rl = (r[A] & 0x0f) + (x & 0x0f) + r.f.c; r[A] = rh; r.f.z = (uint8)rh == 0; r.f.n = 0; r.f.h = rl > 0x0f; r.f.c = rh > 0xff; } template void LR35902::op_adc_a_r() { opi_adc_a(r[x]); } void LR35902::op_adc_a_n() { opi_adc_a(op_read(r[PC]++)); } void LR35902::op_adc_a_hl() { opi_adc_a(op_read(r[HL])); } void LR35902::opi_sub_a(uint8 x) { uint16 rh = r[A] - x; uint16 rl = (r[A] & 0x0f) - (x & 0x0f); r[A] = rh; r.f.z = (uint8)rh == 0; r.f.n = 1; r.f.h = rl > 0x0f; r.f.c = rh > 0xff; } template void LR35902::op_sub_a_r() { opi_sub_a(r[x]); } void LR35902::op_sub_a_n() { opi_sub_a(op_read(r[PC]++)); } void LR35902::op_sub_a_hl() { opi_sub_a(op_read(r[HL])); } void LR35902::opi_sbc_a(uint8 x) { uint16 rh = r[A] - x - r.f.c; uint16 rl = (r[A] & 0x0f) - (x & 0x0f) - r.f.c; r[A] = rh; r.f.z = (uint8)rh == 0; r.f.n = 1; r.f.h = rl > 0x0f; r.f.c = rh > 0xff; } template void LR35902::op_sbc_a_r() { opi_sbc_a(r[x]); } void LR35902::op_sbc_a_n() { opi_sbc_a(op_read(r[PC]++)); } void LR35902::op_sbc_a_hl() { opi_sbc_a(op_read(r[HL])); } void LR35902::opi_and_a(uint8 x) { r[A] &= x; r.f.z = r[A] == 0; r.f.n = 0; r.f.h = 1; r.f.c = 0; } template void LR35902::op_and_a_r() { opi_and_a(r[x]); } void LR35902::op_and_a_n() { opi_and_a(op_read(r[PC]++)); } void LR35902::op_and_a_hl() { opi_and_a(op_read(r[HL])); } void LR35902::opi_xor_a(uint8 x) { r[A] ^= x; r.f.z = r[A] == 0; r.f.n = 0; r.f.h = 0; r.f.c = 0; } template void LR35902::op_xor_a_r() { opi_xor_a(r[x]); } void LR35902::op_xor_a_n() { opi_xor_a(op_read(r[PC]++)); } void LR35902::op_xor_a_hl() { opi_xor_a(op_read(r[HL])); } void LR35902::opi_or_a(uint8 x) { r[A] |= x; r.f.z = r[A] == 0; r.f.n = 0; r.f.h = 0; r.f.c = 0; } template void LR35902::op_or_a_r() { opi_or_a(r[x]); } void LR35902::op_or_a_n() { opi_or_a(op_read(r[PC]++)); } void LR35902::op_or_a_hl() { opi_or_a(op_read(r[HL])); } void LR35902::opi_cp_a(uint8 x) { uint16 rh = r[A] - x; uint16 rl = (r[A] & 0x0f) - (x & 0x0f); r.f.z = (uint8)rh == 0; r.f.n = 1; r.f.h = rl > 0x0f; r.f.c = rh > 0xff; } template void LR35902::op_cp_a_r() { opi_cp_a(r[x]); } void LR35902::op_cp_a_n() { opi_cp_a(op_read(r[PC]++)); } void LR35902::op_cp_a_hl() { opi_cp_a(op_read(r[HL])); } template void LR35902::op_inc_r() { r[x]++; r.f.z = r[x] == 0; r.f.n = 0; r.f.h = (r[x] & 0x0f) == 0x00; } void LR35902::op_inc_hl() { uint8 n = op_read(r[HL]); op_write(r[HL], ++n); r.f.z = n == 0; r.f.n = 0; r.f.h = (n & 0x0f) == 0x00; } template void LR35902::op_dec_r() { r[x]--; r.f.z = r[x] == 0; r.f.n = 1; r.f.h = (r[x] & 0x0f) == 0x0f; } void LR35902::op_dec_hl() { uint8 n = op_read(r[HL]); op_write(r[HL], --n); r.f.z = n == 0; r.f.n = 1; r.f.h = (n & 0x0f) == 0x0f; } void LR35902::op_daa() { uint16 a = r[A]; if(r.f.n == 0) { if(r.f.h || (a & 0x0f) > 0x09) a += 0x06; if(r.f.c || (a ) > 0x9f) a += 0x60; } else { if(r.f.h) { a -= 0x06; if(r.f.c == 0) a &= 0xff; } if(r.f.c) a -= 0x60; } r[A] = a; r.f.z = r[A] == 0; r.f.h = 0; r.f.c |= a & 0x100; } void LR35902::op_cpl() { r[A] ^= 0xff; r.f.n = 1; r.f.h = 1; } //16-bit arithmetic commands template void LR35902::op_add_hl_rr() { op_io(); uint32 rb = (r[HL] + r[x]); uint32 rn = (r[HL] & 0xfff) + (r[x] & 0xfff); r[HL] = rb; r.f.n = 0; r.f.h = rn > 0x0fff; r.f.c = rb > 0xffff; } template void LR35902::op_inc_rr() { op_io(); r[x]++; } template void LR35902::op_dec_rr() { op_io(); r[x]--; } void LR35902::op_add_sp_n() { op_io(); op_io(); signed n = (int8)op_read(r[PC]++); r.f.z = 0; r.f.n = 0; r.f.h = ((r[SP] & 0x0f) + (n & 0x0f)) > 0x0f; r.f.c = ((r[SP] & 0xff) + (n & 0xff)) > 0xff; r[SP] += n; } void LR35902::op_ld_hl_sp_n() { op_io(); signed n = (int8)op_read(r[PC]++); r.f.z = 0; r.f.n = 0; r.f.h = ((r[SP] & 0x0f) + (n & 0x0f)) > 0x0f; r.f.c = ((r[SP] & 0xff) + (n & 0xff)) > 0xff; r[HL] = r[SP] + n; } //rotate/shift commands void LR35902::op_rlca() { r[A] = (r[A] << 1) | (r[A] >> 7); r.f.z = 0; r.f.n = 0; r.f.h = 0; r.f.c = r[A] & 0x01; } void LR35902::op_rla() { bool c = r[A] & 0x80; r[A] = (r[A] << 1) | (r.f.c << 0); r.f.z = 0; r.f.n = 0; r.f.h = 0; r.f.c = c; } void LR35902::op_rrca() { r[A] = (r[A] >> 1) | (r[A] << 7); r.f.z = 0; r.f.n = 0; r.f.h = 0; r.f.c = r[A] & 0x80; } void LR35902::op_rra() { bool c = r[A] & 0x01; r[A] = (r[A] >> 1) | (r.f.c << 7); r.f.z = 0; r.f.n = 0; r.f.h = 0; r.f.c = c; } template void LR35902::op_rlc_r() { r[x] = (r[x] << 1) | (r[x] >> 7); r.f.z = r[x] == 0; r.f.n = 0; r.f.h = 0; r.f.c = r[x] & 0x01; } void LR35902::op_rlc_hl() { uint8 n = op_read(r[HL]); n = (n << 1) | (n >> 7); op_write(r[HL], n); r.f.z = n == 0; r.f.n = 0; r.f.h = 0; r.f.c = n & 0x01; } template void LR35902::op_rl_r() { bool c = r[x] & 0x80; r[x] = (r[x] << 1) | (r.f.c << 0); r.f.z = r[x] == 0; r.f.n = 0; r.f.h = 0; r.f.c = c; } void LR35902::op_rl_hl() { uint8 n = op_read(r[HL]); bool c = n & 0x80; n = (n << 1) | (r.f.c << 0); op_write(r[HL], n); r.f.z = n == 0; r.f.n = 0; r.f.h = 0; r.f.c = c; } template void LR35902::op_rrc_r() { r[x] = (r[x] >> 1) | (r[x] << 7); r.f.z = r[x] == 0; r.f.n = 0; r.f.h = 0; r.f.c = r[x] & 0x80; } void LR35902::op_rrc_hl() { uint8 n = op_read(r[HL]); n = (n >> 1) | (n << 7); op_write(r[HL], n); r.f.z = n == 0; r.f.n = 0; r.f.h = 0; r.f.c = n & 0x80; } template void LR35902::op_rr_r() { bool c = r[x] & 0x01; r[x] = (r[x] >> 1) | (r.f.c << 7); r.f.z = r[x] == 0; r.f.n = 0; r.f.h = 0; r.f.c = c; } void LR35902::op_rr_hl() { uint8 n = op_read(r[HL]); bool c = n & 0x01; n = (n >> 1) | (r.f.c << 7); op_write(r[HL], n); r.f.z = n == 0; r.f.n = 0; r.f.h = 0; r.f.c = c; } template void LR35902::op_sla_r() { bool c = r[x] & 0x80; r[x] <<= 1; r.f.z = r[x] == 0; r.f.n = 0; r.f.h = 0; r.f.c = c; } void LR35902::op_sla_hl() { uint8 n = op_read(r[HL]); bool c = n & 0x80; n <<= 1; op_write(r[HL], n); r.f.z = n == 0; r.f.n = 0; r.f.h = 0; r.f.c = c; } template void LR35902::op_swap_r() { r[x] = (r[x] << 4) | (r[x] >> 4); r.f.z = r[x] == 0; r.f.n = 0; r.f.h = 0; r.f.c = 0; } void LR35902::op_swap_hl() { uint8 n = op_read(r[HL]); n = (n << 4) | (n >> 4); op_write(r[HL], n); r.f.z = n == 0; r.f.n = 0; r.f.h = 0; r.f.c = 0; } template void LR35902::op_sra_r() { bool c = r[x] & 0x01; r[x] = (int8)r[x] >> 1; r.f.z = r[x] == 0; r.f.n = 0; r.f.h = 0; r.f.c = c; } void LR35902::op_sra_hl() { uint8 n = op_read(r[HL]); bool c = n & 0x01; n = (int8)n >> 1; op_write(r[HL], n); r.f.z = n == 0; r.f.n = 0; r.f.h = 0; r.f.c = c; } template void LR35902::op_srl_r() { bool c = r[x] & 0x01; r[x] >>= 1; r.f.z = r[x] == 0; r.f.n = 0; r.f.h = 0; r.f.c = c; } void LR35902::op_srl_hl() { uint8 n = op_read(r[HL]); bool c = n & 0x01; n >>= 1; op_write(r[HL], n); r.f.z = n == 0; r.f.n = 0; r.f.h = 0; r.f.c = c; } //single-bit commands template void LR35902::op_bit_n_r() { r.f.z = (r[x] & (1 << b)) == 0; r.f.n = 0; r.f.h = 1; } template void LR35902::op_bit_n_hl() { uint8 n = op_read(r[HL]); r.f.z = (n & (1 << b)) == 0; r.f.n = 0; r.f.h = 1; } template void LR35902::op_set_n_r() { r[x] |= 1 << b; } template void LR35902::op_set_n_hl() { uint8 n = op_read(r[HL]); n |= 1 << b; op_write(r[HL], n); } template void LR35902::op_res_n_r() { r[x] &= ~(1 << b); } template void LR35902::op_res_n_hl() { uint8 n = op_read(r[HL]); n &= ~(1 << b); op_write(r[HL], n); } //control commands void LR35902::op_ccf() { r.f.n = 0; r.f.h = 0; r.f.c = !r.f.c; } void LR35902::op_scf() { r.f.n = 0; r.f.h = 0; r.f.c = 1; } void LR35902::op_nop() { } void LR35902::op_halt() { r.halt = true; while(r.halt == true) op_io(); } void LR35902::op_stop() { if(stop()) return; r.stop = true; while(r.stop == true) op_io(); } void LR35902::op_di() { r.ime = 0; } void LR35902::op_ei() { r.ei = true; //r.ime = 1; } //jump commands void LR35902::op_jp_nn() { uint8 lo = op_read(r[PC]++); uint8 hi = op_read(r[PC]++); r[PC] = (hi << 8) | (lo << 0); op_io(); } void LR35902::op_jp_hl() { r[PC] = r[HL]; } template void LR35902::op_jp_f_nn() { uint8 lo = op_read(r[PC]++); uint8 hi = op_read(r[PC]++); if(r.f[x] == y) { r[PC] = (hi << 8) | (lo << 0); op_io(); } } void LR35902::op_jr_n() { int8 n = op_read(r[PC]++); r[PC] += n; op_io(); } template void LR35902::op_jr_f_n() { int8 n = op_read(r[PC]++); if(r.f[x] == y) { r[PC] += n; op_io(); } } void LR35902::op_call_nn() { uint8 lo = op_read(r[PC]++); uint8 hi = op_read(r[PC]++); op_write(--r[SP], r[PC] >> 8); op_write(--r[SP], r[PC] >> 0); r[PC] = (hi << 8) | (lo << 0); op_io(); } template void LR35902::op_call_f_nn() { uint8 lo = op_read(r[PC]++); uint8 hi = op_read(r[PC]++); if(r.f[x] == y) { op_write(--r[SP], r[PC] >> 8); op_write(--r[SP], r[PC] >> 0); r[PC] = (hi << 8) | (lo << 0); op_io(); } } void LR35902::op_ret() { uint8 lo = op_read(r[SP]++); uint8 hi = op_read(r[SP]++); r[PC] = (hi << 8) | (lo << 0); op_io(); } template void LR35902::op_ret_f() { op_io(); if(r.f[x] == y) { uint8 lo = op_read(r[SP]++); uint8 hi = op_read(r[SP]++); r[PC] = (hi << 8) | (lo << 0); op_io(); } } void LR35902::op_reti() { uint8 lo = op_read(r[SP]++); uint8 hi = op_read(r[SP]++); r[PC] = (hi << 8) | (lo << 0); op_io(); r.ime = 1; } template void LR35902::op_rst_n() { op_write(--r[SP], r[PC] >> 8); op_write(--r[SP], r[PC] >> 0); r[PC] = n; op_io(); } sfc/controller/000700 001750 001750 00000000000 12656700342 014631 5ustar00sergiosergio000000 000000 gb/cheat/cheat.hpp000664 001750 001750 00000000642 12651764221 015163 0ustar00sergiosergio000000 000000 struct Cheat { struct Code { unsigned addr; unsigned comp; unsigned data; }; vector codes; enum : unsigned { Unused = ~0u }; alwaysinline bool enable() const { return codes.size() > 0; } void reset(); void append(unsigned addr, unsigned data); void append(unsigned addr, unsigned comp, unsigned data); optional find(unsigned addr, unsigned comp); }; extern Cheat cheat; sfc/alt/cpu/mmio.cpp000664 001750 001750 00000016545 12651764221 015512 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP uint8 CPU::mmio_read(unsigned addr) { if((addr & 0xffc0) == 0x2140) { synchronize_smp(); return smp.port_read(addr & 3); } switch(addr & 0xffff) { case 0x2180: { uint8 result = bus.read(0x7e0000 | status.wram_addr); status.wram_addr = (status.wram_addr + 1) & 0x01ffff; return result; } case 0x4016: { uint8 result = regs.mdr & 0xfc; result |= input.port1->data() & 3; return result; } case 0x4017: { uint8 result = (regs.mdr & 0xe0) | 0x1c; result |= input.port2->data() & 3; return result; } case 0x4210: { uint8 result = (regs.mdr & 0x70); result |= status.nmi_line << 7; result |= 0x02; //CPU revision status.nmi_line = false; return result; } case 0x4211: { uint8 result = (regs.mdr & 0x7f); result |= status.irq_line << 7; status.irq_line = false; return result; } case 0x4212: { uint8 result = (regs.mdr & 0x3e); unsigned vbstart = ppu.overscan() == false ? 225 : 240; if(vcounter() >= vbstart && vcounter() <= vbstart + 2) result |= 0x01; if(hcounter() <= 2 || hcounter() >= 1096) result |= 0x40; if(vcounter() >= vbstart) result |= 0x80; return result; } case 0x4213: return status.pio; case 0x4214: return status.rddiv >> 0; case 0x4215: return status.rddiv >> 8; case 0x4216: return status.rdmpy >> 0; case 0x4217: return status.rdmpy >> 8; case 0x4218: return status.joy1l; case 0x4219: return status.joy1h; case 0x421a: return status.joy2l; case 0x421b: return status.joy2h; case 0x421c: return status.joy3l; case 0x421d: return status.joy3h; case 0x421e: return status.joy4l; case 0x421f: return status.joy4h; } if((addr & 0xff80) == 0x4300) { unsigned i = (addr >> 4) & 7; switch(addr & 0xff8f) { case 0x4300: { return (channel[i].direction << 7) | (channel[i].indirect << 6) | (channel[i].unused << 5) | (channel[i].reverse_transfer << 4) | (channel[i].fixed_transfer << 3) | (channel[i].transfer_mode << 0); } case 0x4301: return channel[i].dest_addr; case 0x4302: return channel[i].source_addr >> 0; case 0x4303: return channel[i].source_addr >> 8; case 0x4304: return channel[i].source_bank; case 0x4305: return channel[i].transfer_size >> 0; case 0x4306: return channel[i].transfer_size >> 8; case 0x4307: return channel[i].indirect_bank; case 0x4308: return channel[i].hdma_addr >> 0; case 0x4309: return channel[i].hdma_addr >> 8; case 0x430a: return channel[i].line_counter; case 0x430b: case 0x430f: return channel[i].unknown; } } return regs.mdr; } void CPU::mmio_write(unsigned addr, uint8 data) { if((addr & 0xffc0) == 0x2140) { synchronize_smp(); port_write(addr & 3, data); return; } switch(addr & 0xffff) { case 0x2180: { bus.write(0x7e0000 | status.wram_addr, data); status.wram_addr = (status.wram_addr + 1) & 0x01ffff; return; } case 0x2181: { status.wram_addr = (status.wram_addr & 0x01ff00) | (data << 0); return; } case 0x2182: { status.wram_addr = (status.wram_addr & 0x0100ff) | (data << 8); return; } case 0x2183: { status.wram_addr = (status.wram_addr & 0x00ffff) | ((data & 1) << 16); return; } case 0x4016: { input.port1->latch(data & 1); input.port2->latch(data & 1); return; } case 0x4200: { bool nmi_enabled = status.nmi_enabled; bool virq_enabled = status.virq_enabled; bool hirq_enabled = status.hirq_enabled; status.nmi_enabled = data & 0x80; status.virq_enabled = data & 0x20; status.hirq_enabled = data & 0x10; status.auto_joypad_poll_enabled = data & 0x01; if(!nmi_enabled && status.nmi_enabled && status.nmi_line) { status.nmi_transition = true; } if(status.virq_enabled && !status.hirq_enabled && status.irq_line) { status.irq_transition = true; } if(!status.virq_enabled && !status.hirq_enabled) { status.irq_line = false; status.irq_transition = false; } status.irq_lock = true; return; } case 0x4201: { if((status.pio & 0x80) && !(data & 0x80)) ppu.latch_counters(); status.pio = data; } case 0x4202: { status.wrmpya = data; return; } case 0x4203: { status.wrmpyb = data; status.rdmpy = status.wrmpya * status.wrmpyb; return; } case 0x4204: { status.wrdiva = (status.wrdiva & 0xff00) | (data << 0); return; } case 0x4205: { status.wrdiva = (data << 8) | (status.wrdiva & 0x00ff); return; } case 0x4206: { status.wrdivb = data; status.rddiv = status.wrdivb ? status.wrdiva / status.wrdivb : 0xffff; status.rdmpy = status.wrdivb ? status.wrdiva % status.wrdivb : status.wrdiva; return; } case 0x4207: { status.htime = (status.htime & 0x0100) | (data << 0); return; } case 0x4208: { status.htime = ((data & 1) << 8) | (status.htime & 0x00ff); return; } case 0x4209: { status.vtime = (status.vtime & 0x0100) | (data << 0); return; } case 0x420a: { status.vtime = ((data & 1) << 8) | (status.vtime & 0x00ff); return; } case 0x420b: { for(unsigned i = 0; i < 8; i++) channel[i].dma_enabled = data & (1 << i); if(data) dma_run(); return; } case 0x420c: { for(unsigned i = 0; i < 8; i++) channel[i].hdma_enabled = data & (1 << i); return; } case 0x420d: { status.rom_speed = data & 1 ? 6 : 8; return; } } if((addr & 0xff80) == 0x4300) { unsigned i = (addr >> 4) & 7; switch(addr & 0xff8f) { case 0x4300: { channel[i].direction = data & 0x80; channel[i].indirect = data & 0x40; channel[i].unused = data & 0x20; channel[i].reverse_transfer = data & 0x10; channel[i].fixed_transfer = data & 0x08; channel[i].transfer_mode = data & 0x07; return; } case 0x4301: { channel[i].dest_addr = data; return; } case 0x4302: { channel[i].source_addr = (channel[i].source_addr & 0xff00) | (data << 0); return; } case 0x4303: { channel[i].source_addr = (data << 8) | (channel[i].source_addr & 0x00ff); return; } case 0x4304: { channel[i].source_bank = data; return; } case 0x4305: { channel[i].transfer_size = (channel[i].transfer_size & 0xff00) | (data << 0); return; } case 0x4306: { channel[i].transfer_size = (data << 8) | (channel[i].transfer_size & 0x00ff); return; } case 0x4307: { channel[i].indirect_bank = data; return; } case 0x4308: { channel[i].hdma_addr = (channel[i].hdma_addr & 0xff00) | (data << 0); return; } case 0x4309: { channel[i].hdma_addr = (data << 8) | (channel[i].hdma_addr & 0x00ff); return; } case 0x430a: { channel[i].line_counter = data; return; } case 0x430b: case 0x430f: { channel[i].unknown = data; return; } } } } #endif sfc/controller/justifier/justifier.hpp000664 001750 001750 00000000574 12651764221 021375 0ustar00sergiosergio000000 000000 struct Justifier : Controller { void enter(); uint2 data(); void latch(bool data); Justifier(bool port, bool chained); //private: const bool chained; //true if the second justifier is attached to the first const unsigned device; bool latched; unsigned counter; bool active; struct Player { signed x, y; bool trigger, start; } player1, player2; }; processor/000700 001750 001750 00000000000 12656700342 013712 5ustar00sergiosergio000000 000000 phoenix/gtk/widget/check-label.cpp000664 001750 001750 00000002046 12651764221 020272 0ustar00sergiosergio000000 000000 namespace phoenix { static void CheckLabel_toggle(GtkToggleButton* toggleButton, CheckLabel* self) { self->state.checked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->p.gtkWidget)); if(!self->p.locked && self->onToggle) self->onToggle(); } Size pCheckLabel::minimumSize() { Size size = pFont::size(widget.state.font, checkLabel.state.text); return {size.width + 28, size.height + 4}; } void pCheckLabel::setChecked(bool checked) { locked = true; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtkWidget), checked); locked = false; } void pCheckLabel::setText(string text) { gtk_button_set_label(GTK_BUTTON(gtkWidget), text); } void pCheckLabel::constructor() { gtkWidget = gtk_check_button_new_with_label(""); g_signal_connect(G_OBJECT(gtkWidget), "toggled", G_CALLBACK(CheckLabel_toggle), (gpointer)&checkLabel); setChecked(checkLabel.state.checked); setText(checkLabel.state.text); } void pCheckLabel::destructor() { gtk_widget_destroy(gtkWidget); } void pCheckLabel::orphan() { destructor(); constructor(); } } processor/r65816/memory.hpp000664 001750 001750 00000003616 12651764221 016631 0ustar00sergiosergio000000 000000 alwaysinline uint8 op_readpc() { return op_read((regs.pc.b << 16) + regs.pc.w++); } alwaysinline uint8 op_readstack() { regs.e ? regs.s.l++ : regs.s.w++; return op_read(regs.s.w); } alwaysinline uint8 op_readstackn() { return op_read(++regs.s.w); } alwaysinline uint8 op_readaddr(uint32 addr) { return op_read(addr & 0xffff); } alwaysinline uint8 op_readlong(uint32 addr) { return op_read(addr & 0xffffff); } alwaysinline uint8 op_readdbr(uint32 addr) { return op_read(((regs.db << 16) + addr) & 0xffffff); } alwaysinline uint8 op_readpbr(uint32 addr) { return op_read((regs.pc.b << 16) + (addr & 0xffff)); } alwaysinline uint8 op_readdp(uint32 addr) { if(regs.e && regs.d.l == 0x00) { return op_read((regs.d & 0xff00) + ((regs.d + (addr & 0xffff)) & 0xff)); } else { return op_read((regs.d + (addr & 0xffff)) & 0xffff); } } alwaysinline uint8 op_readsp(uint32 addr) { return op_read((regs.s + (addr & 0xffff)) & 0xffff); } alwaysinline void op_writestack(uint8 data) { op_write(regs.s.w, data); regs.e ? regs.s.l-- : regs.s.w--; } alwaysinline void op_writestackn(uint8 data) { op_write(regs.s.w--, data); } alwaysinline void op_writeaddr(uint32 addr, uint8 data) { op_write(addr & 0xffff, data); } alwaysinline void op_writelong(uint32 addr, uint8 data) { op_write(addr & 0xffffff, data); } alwaysinline void op_writedbr(uint32 addr, uint8 data) { op_write(((regs.db << 16) + addr) & 0xffffff, data); } alwaysinline void op_writepbr(uint32 addr, uint8 data) { op_write((regs.pc.b << 16) + (addr & 0xffff), data); } alwaysinline void op_writedp(uint32 addr, uint8 data) { if(regs.e && regs.d.l == 0x00) { op_write((regs.d & 0xff00) + ((regs.d + (addr & 0xffff)) & 0xff), data); } else { op_write((regs.d + (addr & 0xffff)) & 0xffff, data); } } alwaysinline void op_writesp(uint32 addr, uint8 data) { op_write((regs.s + (addr & 0xffff)) & 0xffff, data); } sfc/alt/smp/core/cc.sh000664 001750 001750 00000000074 12651764221 015714 0ustar00sergiosergio000000 000000 g++-4.5 -std=gnu++0x -I../../../.. -o generate generate.cpp ananke/resource/resource.hpp000664 001750 001750 00000000307 12651764221 017334 0ustar00sergiosergio000000 000000 namespace resource { extern const uint8_t home[606]; extern const uint8_t up[652]; extern const uint8_t folder[1176]; extern const uint8_t file[844]; extern const uint8_t archive[1067]; }; sfc/chip/epsonrtc/epsonrtc.hpp000664 001750 001750 00000002663 12651764221 017620 0ustar00sergiosergio000000 000000 //Epson RTC-4513 Real-Time Clock struct EpsonRTC : Coprocessor { static void Enter(); void enter(); void init(); void load(); void unload(); void power(); void reset(); void sync(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); void serialize(serializer&); uint21 clocks; unsigned seconds; uint2 chipselect; enum class State : unsigned { Mode, Seek, Read, Write } state; uint4 mdr; uint4 offset; unsigned wait; uint1 ready; uint1 holdtick; uint4 secondlo; uint3 secondhi; uint1 batteryfailure; uint4 minutelo; uint3 minutehi; uint1 resync; uint4 hourlo; uint2 hourhi; uint1 meridian; uint4 daylo; uint2 dayhi; uint1 dayram; uint4 monthlo; uint1 monthhi; uint2 monthram; uint4 yearlo; uint4 yearhi; uint3 weekday; uint1 hold; uint1 calendar; uint1 irqflag; uint1 roundseconds; uint1 irqmask; uint1 irqduty; uint2 irqperiod; uint1 pause; uint1 stop; uint1 atime; //astronomical time (24-hour mode) uint1 test; //memory.cpp void rtc_reset(); uint4 rtc_read(uint4 addr); void rtc_write(uint4 addr, uint4 data); void load(const uint8* data); void save(uint8* data); //time.cpp void irq(uint2 period); void duty(); void round_seconds(); void tick(); void tick_second(); void tick_minute(); void tick_hour(); void tick_day(); void tick_month(); void tick_year(); }; extern EpsonRTC epsonrtc; libco/armeabi.c000664 001750 001750 00000003663 12651764221 014554 0ustar00sergiosergio000000 000000 /* libco.armeabi (2013-04-05) author: Themaister license: public domain */ #define LIBCO_C #include "libco.h" #include #include #include #include #ifndef IOS #include #endif #ifdef __cplusplus extern "C" { #endif static thread_local uint32_t co_active_buffer[64]; static thread_local cothread_t co_active_handle; asm ( ".arm\n" ".align 4\n" ".globl co_switch_arm\n" ".globl _co_switch_arm\n" "co_switch_arm:\n" "_co_switch_arm:\n" " stmia r1!, {r4, r5, r6, r7, r8, r9, r10, r11, sp, lr}\n" " ldmia r0!, {r4, r5, r6, r7, r8, r9, r10, r11, sp, pc}\n" ); /* ASM */ void co_switch_arm(cothread_t handle, cothread_t current); static void crash(void) { /* Called only if cothread_t entrypoint returns. */ assert(0); } cothread_t co_create(unsigned int size, void (*entrypoint)(void)) { size = (size + 1023) & ~1023; cothread_t handle = 0; #if HAVE_POSIX_MEMALIGN >= 1 if (posix_memalign(&handle, 1024, size + 256) < 0) return 0; #else handle = memalign(1024, size + 256); #endif if (!handle) return handle; uint32_t *ptr = (uint32_t*)handle; /* Non-volatiles. */ ptr[0] = 0; /* r4 */ ptr[1] = 0; /* r5 */ ptr[2] = 0; /* r6 */ ptr[3] = 0; /* r7 */ ptr[4] = 0; /* r8 */ ptr[5] = 0; /* r9 */ ptr[6] = 0; /* r10 */ ptr[7] = 0; /* r11 */ ptr[8] = (uintptr_t)ptr + size + 256 - 4; /* r13, stack pointer */ ptr[9] = (uintptr_t)entrypoint; /* r15, PC (link register r14 gets saved here). */ return handle; } cothread_t co_active(void) { if (!co_active_handle) co_active_handle = co_active_buffer; return co_active_handle; } void co_delete(cothread_t handle) { free(handle); } void co_switch(cothread_t handle) { cothread_t co_previous_handle = co_active(); co_switch_arm(co_active_handle = handle, co_previous_handle); } #ifdef __cplusplus } #endif phoenix/cocoa/widget/console.cpp000664 001750 001750 00000001013 12651764221 020072 0ustar00sergiosergio000000 000000 @implementation CocoaConsole : NSScrollView -(id) initWith:(phoenix::Console&)consoleReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { console = &consoleReference; } return self; } @end namespace phoenix { void pConsole::print(string text) { } void pConsole::reset() { } void pConsole::constructor() { @autoreleasepool { cocoaView = cocoaConsole = [[CocoaConsole alloc] initWith:console]; } } void pConsole::destructor() { @autoreleasepool { [cocoaView release]; } } } ruby/video/opengl/utility.hpp000664 001750 001750 00000006765 12651764221 017515 0ustar00sergiosergio000000 000000 static unsigned glrSize(unsigned size) { return size; //return bit::round(size); //return nearest power of two } static GLuint glrFormat(const string& format) { if(format == "r32i" ) return GL_R32I; if(format == "r32ui" ) return GL_R32UI; if(format == "rgba8" ) return GL_RGBA8; if(format == "rgb10a2") return GL_RGB10_A2; if(format == "rgba12" ) return GL_RGBA12; if(format == "rgba16" ) return GL_RGBA16; if(format == "rgba16f") return GL_RGBA16F; if(format == "rgba32f") return GL_RGBA32F; return GL_RGBA8; } static GLuint glrFilter(const string& filter) { if(filter == "nearest") return GL_NEAREST; if(filter == "linear" ) return GL_LINEAR; return GL_LINEAR; } static GLuint glrWrap(const string& wrap) { if(wrap == "border") return GL_CLAMP_TO_BORDER; if(wrap == "edge" ) return GL_CLAMP_TO_EDGE; if(wrap == "repeat") return GL_REPEAT; return GL_CLAMP_TO_BORDER; } static unsigned glrModulo(unsigned modulo) { if(modulo) return modulo; return 300; //divisible by 2, 3, 4, 5, 6, 10, 12, 15, 20, 25, 30, 50, 60, 100, 150 } static GLuint glrProgram() { GLuint program = 0; glGetIntegerv(GL_CURRENT_PROGRAM, (GLint*)&program); return program; } static void glrUniform1i(const string& name, GLint value) { GLint location = glGetUniformLocation(glrProgram(), name); glUniform1i(location, value); } static void glrUniform4f(const string& name, GLfloat value0, GLfloat value1, GLfloat value2, GLfloat value3) { GLint location = glGetUniformLocation(glrProgram(), name); glUniform4f(location, value0, value1, value2, value3); } static void glrUniformMatrix4fv(const string& name, GLfloat *values) { GLint location = glGetUniformLocation(glrProgram(), name); glUniformMatrix4fv(location, 1, GL_FALSE, values); } static void glrParameters(GLuint filter, GLuint wrap) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap); } static GLuint glrCreateShader(GLuint program, GLuint type, const char* source) { GLuint shader = glCreateShader(type); glShaderSource(shader, 1, &source, 0); glCompileShader(shader); GLint result = GL_FALSE; glGetShaderiv(shader, GL_COMPILE_STATUS, &result); if(result == GL_FALSE) { GLint length = 0; glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length); char text[length + 1]; glGetShaderInfoLog(shader, length, &length, text); text[length] = 0; print("[ruby::OpenGL: shader compiler error]\n", (const char*)text, "\n\n"); return 0; } glAttachShader(program, shader); return shader; } static void glrLinkProgram(GLuint program) { glLinkProgram(program); GLint result = GL_FALSE; glGetProgramiv(program, GL_LINK_STATUS, &result); if(result == GL_FALSE) { GLint length = 0; glGetProgramiv(program, GL_INFO_LOG_LENGTH, &length); char text[length + 1]; glGetProgramInfoLog(program, length, &length, text); text[length] = 0; print("[ruby::OpenGL: shader linker error]\n", (const char*)text, "\n\n"); } glValidateProgram(program); result = GL_FALSE; glGetProgramiv(program, GL_VALIDATE_STATUS, &result); if(result == GL_FALSE) { GLint length = 0; glGetProgramiv(program, GL_INFO_LOG_LENGTH, &length); char text[length + 1]; glGetProgramInfoLog(program, length, &length, text); text[length] = 0; print("[ruby::OpenGL: shader validation error]\n", (const char*)text, "\n\n"); } } sfc/interface/interface.hpp000664 001750 001750 00000004270 12651764221 017077 0ustar00sergiosergio000000 000000 #ifndef SFC_HPP namespace SuperFamicom { #endif struct ID { enum : unsigned { //cartridges (folders) System, SuperFamicom, SuperGameBoy, Satellaview, SufamiTurboSlotA, SufamiTurboSlotB, //memory (files) IPLROM, Manifest, ROM, RAM, EventROM0, EventROM1, EventROM2, EventROM3, EventRAM, SA1ROM, SA1IRAM, SA1BWRAM, SuperFXROM, SuperFXRAM, ArmDSPPROM, ArmDSPDROM, ArmDSPRAM, HitachiDSPROM, HitachiDSPRAM, HitachiDSPDROM, HitachiDSPDRAM, Nec7725DSPPROM, Nec7725DSPDROM, Nec7725DSPRAM, Nec96050DSPPROM, Nec96050DSPDROM, Nec96050DSPRAM, EpsonRTC, SharpRTC, SPC7110PROM, SPC7110DROM, SPC7110RAM, SDD1ROM, SDD1RAM, OBC1RAM, SuperGameBoyBootROM, BsxROM, BsxRAM, BsxPSRAM, SuperGameBoyManifest, SuperGameBoyROM, SuperGameBoyRAM, SatellaviewManifest, SatellaviewROM, SufamiTurboSlotAManifest, SufamiTurboSlotAROM, SufamiTurboSlotARAM, SufamiTurboSlotBManifest, SufamiTurboSlotBROM, SufamiTurboSlotBRAM, //controller ports Port1 = 1, Port2 = 2, }; }; struct Alt { enum : unsigned { ForDSP, ForSuperGameBoy, }; struct DSP { enum : unsigned { LLE, HLE, }; }; struct SuperGameBoy { enum : unsigned { Internal, External, }; }; }; struct Interface : Emulator::Interface { string title(); double videoFrequency(); double audioFrequency(); bool loaded(); string sha256(); unsigned group(unsigned id); void load(unsigned id); void save(); void load(unsigned id, const stream& stream); void save(unsigned id, const stream& stream); void unload(); void connect(unsigned port, unsigned device); void power(); void reset(); void run(); bool rtc(); void rtcsync(); serializer serialize(); bool unserialize(serializer&); void cheatSet(const lstring&); void paletteUpdate(PaletteMode mode); //debugger functions bool tracerEnable(bool); void exportMemory(); Interface(); file tracer; vector device; }; extern Interface* interface; #ifndef SFC_HPP } #endif sfc/chip/superfx/bus/bus.cpp000664 001750 001750 00000001540 12651764221 017170 0ustar00sergiosergio000000 000000 #ifdef SUPERFX_CPP //ROM / RAM access from the S-CPU unsigned SuperFX::CPUROM::size() const { return superfx.rom.size(); } uint8 SuperFX::CPUROM::read(unsigned addr) { if(superfx.regs.sfr.g && superfx.regs.scmr.ron) { static const uint8_t data[16] = { 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x08, 0x01, 0x00, 0x01, 0x0c, 0x01, }; return data[addr & 15]; } return superfx.rom.read(addr); } void SuperFX::CPUROM::write(unsigned addr, uint8 data) { superfx.rom.write(addr, data); } unsigned SuperFX::CPURAM::size() const { return superfx.ram.size(); } uint8 SuperFX::CPURAM::read(unsigned addr) { if(superfx.regs.sfr.g && superfx.regs.scmr.ran) return cpu.regs.mdr; return superfx.ram.read(addr); } void SuperFX::CPURAM::write(unsigned addr, uint8 data) { superfx.ram.write(addr, data); } #endif phoenix/cocoa/widget/hex-edit.hpp000664 001750 001750 00000001010 12651764221 020141 0ustar00sergiosergio000000 000000 @interface CocoaHexEdit : NSScrollView { @public phoenix::HexEdit* hexEdit; } -(id) initWith:(phoenix::HexEdit&)hexEdit; @end namespace phoenix { struct pHexEdit : public pWidget { HexEdit& hexEdit; CocoaHexEdit* cocoaHexEdit = nullptr; void setColumns(unsigned columns); void setLength(unsigned length); void setOffset(unsigned offset); void setRows(unsigned rows); void update(); pHexEdit(HexEdit& hexEdit) : pWidget(hexEdit), hexEdit(hexEdit) {} void constructor(); void destructor(); }; } sfc/system/audio.hpp000664 001750 001750 00000001054 12651764221 015621 0ustar00sergiosergio000000 000000 struct Audio { void coprocessor_enable(bool state); void coprocessor_frequency(double frequency); void sample(int16 lsample, int16 rsample); void coprocessor_sample(int16 lsample, int16 rsample); void init(); private: nall::DSP dspaudio; bool coprocessor; enum : unsigned { buffer_size = 256, buffer_mask = buffer_size - 1 }; uint32 dsp_buffer[buffer_size], cop_buffer[buffer_size]; unsigned dsp_rdoffset, cop_rdoffset; unsigned dsp_wroffset, cop_wroffset; unsigned dsp_length, cop_length; void flush(); }; extern Audio audio; gb/cartridge/huc1/huc1.cpp000664 001750 001750 00000002241 12651764221 016447 0ustar00sergiosergio000000 000000 #ifdef CARTRIDGE_CPP uint8 Cartridge::HuC1::mmio_read(uint16 addr) { if((addr & 0xc000) == 0x0000) { //$0000-3fff return cartridge.rom_read(addr); } if((addr & 0xc000) == 0x4000) { //$4000-7fff return cartridge.rom_read((rom_select << 14) | (addr & 0x3fff)); } if((addr & 0xe000) == 0xa000) { //$a000-bfff return cartridge.ram_read((ram_select << 13) | (addr & 0x1fff)); } return 0x00; } void Cartridge::HuC1::mmio_write(uint16 addr, uint8 data) { if((addr & 0xe000) == 0x0000) { //$0000-1fff ram_writable = (data & 0x0f) == 0x0a; return; } if((addr & 0xe000) == 0x2000) { //$2000-3fff rom_select = data; if(rom_select == 0) rom_select = 1; return; } if((addr & 0xe000) == 0x4000) { //$4000-5fff ram_select = data; return; } if((addr & 0xe000) == 0x6000) { //$6000-7fff model = data & 0x01; return; } if((addr & 0xe000) == 0xa000) { //$a000-bfff if(ram_writable == false) return; return cartridge.ram_write((ram_select << 13) | (addr & 0x1fff), data); } } void Cartridge::HuC1::power() { ram_writable = false; rom_select = 0x01; ram_select = 0x00; model = 0; } #endif phoenix/gtk/desktop.cpp000664 001750 001750 00000002041 12651764221 016321 0ustar00sergiosergio000000 000000 namespace phoenix { Size pDesktop::size() { return { gdk_screen_get_width(gdk_screen_get_default()), gdk_screen_get_height(gdk_screen_get_default()) }; } Geometry pDesktop::workspace() { XlibDisplay* display = XOpenDisplay(nullptr); int screen = DefaultScreen(display); static Atom atom = XlibNone; if(atom == XlibNone) atom = XInternAtom(display, "_NET_WORKAREA", True); int format; unsigned char* data = nullptr; unsigned long items, after; Atom returnAtom; int result = XGetWindowProperty( display, RootWindow(display, screen), atom, 0, 4, False, XA_CARDINAL, &returnAtom, &format, &items, &after, &data ); XCloseDisplay(display); if(result == Success && returnAtom == XA_CARDINAL && format == 32 && items == 4) { unsigned long *workarea = (unsigned long*)data; return {(signed)workarea[0], (signed)workarea[1], (unsigned)workarea[2], (unsigned)workarea[3]}; } return { 0, 0, gdk_screen_get_width(gdk_screen_get_default()), gdk_screen_get_height(gdk_screen_get_default()) }; } } fc/apu/triangle.hpp000664 001750 001750 00000000555 12651764221 015410 0ustar00sergiosergio000000 000000 struct Triangle { unsigned length_counter; uint8 linear_length; bool halt_length_counter; uint11 period; unsigned period_counter; uint5 step_counter; uint8 linear_length_counter; bool reload_linear; void clock_length(); void clock_linear_length(); uint8 clock(); void power(); void reset(); void serialize(serializer&); } triangle; ruby/input/shared/000700 001750 001750 00000000000 12656700342 015261 5ustar00sergiosergio000000 000000 sfc/chip/superfx/memory/memory.hpp000664 001750 001750 00000000546 12651764221 020440 0ustar00sergiosergio000000 000000 unsigned rom_mask; //rom_size - 1 unsigned ram_mask; //ram_size - 1 uint8 bus_read(unsigned addr); void bus_write(unsigned addr, uint8 data); uint8 op_read(uint16 addr); alwaysinline uint8 peekpipe(); alwaysinline uint8 pipe(); void cache_flush(); uint8 cache_mmio_read(uint16 addr); void cache_mmio_write(uint16 addr, uint8 data); void memory_reset(); phoenix/cocoa/action/action.hpp000664 001750 001750 00000000442 12651764221 017711 0ustar00sergiosergio000000 000000 namespace phoenix { struct pAction : public pObject { Action& action; NSMenuItem* cocoaAction = nullptr; void setEnabled(bool enabled); void setVisible(bool visible); pAction(Action& action) : pObject(action), action(action) {} void constructor(); void destructor(); }; } sfc/alt/smp/core/opcycle_misc.cpp000664 001750 001750 00000022467 12651764221 020162 0ustar00sergiosergio000000 000000 case 0x00: { switch(opcode_cycle++) { case 1: op_io(); opcode_cycle = 0; break; } break; } case 0xef: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); regs.pc--; opcode_cycle = 0; break; } break; } case 0xff: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); regs.pc--; opcode_cycle = 0; break; } break; } case 0x9f: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); break; case 3: op_io(); break; case 4: op_io(); regs.a = (regs.a >> 4) | (regs.a << 4); regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0xdf: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); if(regs.p.c || (regs.a) > 0x99) { regs.a += 0x60; regs.p.c = 1; } if(regs.p.h || (regs.a & 15) > 0x09) { regs.a += 0x06; } regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0xbe: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); if(!regs.p.c || (regs.a) > 0x99) { regs.a -= 0x60; regs.p.c = 0; } if(!regs.p.h || (regs.a & 15) > 0x09) { regs.a -= 0x06; } regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } case 0x60: { switch(opcode_cycle++) { case 1: op_io(); regs.p.c = 0; opcode_cycle = 0; break; } break; } case 0x20: { switch(opcode_cycle++) { case 1: op_io(); regs.p.p = 0; opcode_cycle = 0; break; } break; } case 0x80: { switch(opcode_cycle++) { case 1: op_io(); regs.p.c = 1; opcode_cycle = 0; break; } break; } case 0x40: { switch(opcode_cycle++) { case 1: op_io(); regs.p.p = 1; opcode_cycle = 0; break; } break; } case 0xe0: { switch(opcode_cycle++) { case 1: op_io(); regs.p.v = 0; regs.p.h = 0; opcode_cycle = 0; break; } break; } case 0xed: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); regs.p.c = !regs.p.c; opcode_cycle = 0; break; } break; } case 0xa0: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); regs.p.i = 1; opcode_cycle = 0; break; } break; } case 0xc0: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); regs.p.i = 0; opcode_cycle = 0; break; } break; } case 0x02: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd |= 0x01; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x12: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd &= ~0x01; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x22: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd |= 0x02; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x32: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd &= ~0x02; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x42: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd |= 0x04; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x52: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd &= ~0x04; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x62: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd |= 0x08; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x72: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd &= ~0x08; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x82: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd |= 0x10; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x92: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd &= ~0x10; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0xa2: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd |= 0x20; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0xb2: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd &= ~0x20; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0xc2: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd |= 0x40; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0xd2: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd &= ~0x40; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0xe2: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd |= 0x80; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0xf2: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd &= ~0x80; op_writedp(dp, rd); opcode_cycle = 0; break; } break; } case 0x2d: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); break; case 3: op_writestack(regs.a); opcode_cycle = 0; break; } break; } case 0x4d: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); break; case 3: op_writestack(regs.x); opcode_cycle = 0; break; } break; } case 0x6d: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); break; case 3: op_writestack(regs.y); opcode_cycle = 0; break; } break; } case 0x0d: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); break; case 3: op_writestack(regs.p); opcode_cycle = 0; break; } break; } case 0xae: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); break; case 3: regs.a = op_readstack(); opcode_cycle = 0; break; } break; } case 0xce: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); break; case 3: regs.x = op_readstack(); opcode_cycle = 0; break; } break; } case 0xee: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); break; case 3: regs.y = op_readstack(); opcode_cycle = 0; break; } break; } case 0x8e: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); break; case 3: regs.p = op_readstack(); opcode_cycle = 0; break; } break; } case 0xcf: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_io(); break; case 7: op_io(); break; case 8: op_io(); ya = regs.y * regs.a; regs.a = ya; regs.y = ya >> 8; //result is set based on y (high-byte) only regs.p.n = !!(regs.y & 0x80); regs.p.z = (regs.y == 0); opcode_cycle = 0; break; } break; } case 0x9e: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: op_io(); break; case 3: op_io(); break; case 4: op_io(); break; case 5: op_io(); break; case 6: op_io(); break; case 7: op_io(); break; case 8: op_io(); break; case 9: op_io(); break; case 10: op_io(); break; case 11: op_io(); ya = regs.ya; //overflow set if quotient >= 256 regs.p.v = !!(regs.y >= regs.x); regs.p.h = !!((regs.y & 15) >= (regs.x & 15)); if(regs.y < (regs.x << 1)) { //if quotient is <= 511 (will fit into 9-bit result) regs.a = ya / regs.x; regs.y = ya % regs.x; } else { //otherwise, the quotient won't fit into regs.p.v + regs.a //this emulates the odd behavior of the S-SMP in this case regs.a = 255 - (ya - (regs.x << 9)) / (256 - regs.x); regs.y = regs.x + (ya - (regs.x << 9)) % (256 - regs.x); } //result is set based on a (quotient) only regs.p.n = !!(regs.a & 0x80); regs.p.z = (regs.a == 0); opcode_cycle = 0; break; } break; } nall/algorithm.hpp000664 001750 001750 00000000442 12651764221 015335 0ustar00sergiosergio000000 000000 #ifndef NALL_ALGORITHM_HPP #define NALL_ALGORITHM_HPP #undef min #undef max namespace nall { template T min(const T& t, const U& u) { return t < u ? t : u; } template T max(const T& t, const U& u) { return t > u ? t : u; } } #endif fc/Makefile000664 001750 001750 00000001706 12651764221 013744 0ustar00sergiosergio000000 000000 fc_objects := fc-interface fc-system fc-scheduler fc-input fc_objects += fc-memory fc-cartridge fc-cpu fc-apu fc-ppu fc_objects += fc-cheat fc-video objects += $(fc_objects) obj/fc-interface.o: $(fc)/interface/interface.cpp $(call rwildcard,$(fc)/interface/) obj/fc-system.o: $(fc)/system/system.cpp $(call rwildcard,$(fc)/system/) obj/fc-scheduler.o: $(fc)/scheduler/scheduler.cpp $(call rwildcard,$(fc)/scheduler/) obj/fc-input.o: $(fc)/input/input.cpp $(call rwildcard,$(fc)/input/) obj/fc-memory.o: $(fc)/memory/memory.cpp $(call rwildcard,$(fc)/memory/) obj/fc-cartridge.o: $(fc)/cartridge/cartridge.cpp $(call rwildcard,$(fc)/cartridge/) obj/fc-cpu.o: $(fc)/cpu/cpu.cpp $(call rwildcard,$(fc)/cpu/) obj/fc-apu.o: $(fc)/apu/apu.cpp $(call rwildcard,$(fc)/apu/) obj/fc-ppu.o: $(fc)/ppu/ppu.cpp $(call rwildcard,$(fc)/ppu/) obj/fc-cheat.o: $(fc)/cheat/cheat.cpp $(call rwildcard,$(fc)/cheat/) obj/fc-video.o: $(fc)/video/video.cpp $(call rwildcard,$(fc)/video/) sfc/chip/sa1/dma/dma.hpp000664 001750 001750 00000000433 12651764221 016105 0ustar00sergiosergio000000 000000 struct DMA { enum CDEN { DmaNormal = 0, DmaCharConversion = 1 }; enum SD { SourceROM = 0, SourceBWRAM = 1, SourceIRAM = 2 }; enum DD { DestIRAM = 0, DestBWRAM = 1 }; unsigned line; } dma; void dma_normal(); void dma_cc1(); uint8 dma_cc1_read(unsigned addr); void dma_cc2(); phoenix/cocoa/widget/progress-bar.hpp000664 001750 001750 00000000733 12651764221 021053 0ustar00sergiosergio000000 000000 @interface CocoaProgressBar : NSProgressIndicator { @public phoenix::ProgressBar* progressBar; } -(id) initWith:(phoenix::ProgressBar&)progressBar; @end namespace phoenix { struct pProgressBar : public pWidget { ProgressBar& progressBar; CocoaProgressBar* cocoaProgressBar = nullptr; void setPosition(unsigned position); pProgressBar(ProgressBar& progressBar) : pWidget(progressBar), progressBar(progressBar) {} void constructor(); void destructor(); }; } phoenix/cocoa/widget/button.hpp000664 001750 001750 00000001022 12651764221 017750 0ustar00sergiosergio000000 000000 @interface CocoaButton : NSButton { @public phoenix::Button* button; } -(id) initWith:(phoenix::Button&)button; -(IBAction) activate:(id)sender; @end namespace phoenix { struct pButton : public pWidget { Button& button; CocoaButton* cocoaButton = nullptr; Size minimumSize(); void setGeometry(Geometry geometry); void setImage(const image& image, Orientation orientation); void setText(string text); pButton(Button& button) : pWidget(button), button(button) {} void constructor(); void destructor(); }; } phoenix/qt/widget/horizontal-slider.cpp000664 001750 001750 00000001754 12651764221 021455 0ustar00sergiosergio000000 000000 namespace phoenix { Size pHorizontalSlider::minimumSize() { return {0, 20}; } void pHorizontalSlider::setLength(unsigned length) { length += length == 0; qtSlider->setRange(0, length - 1); qtSlider->setPageStep(length >> 3); } void pHorizontalSlider::setPosition(unsigned position) { qtSlider->setValue(position); } void pHorizontalSlider::constructor() { qtWidget = qtSlider = new QSlider(Qt::Horizontal); qtSlider->setRange(0, 100); qtSlider->setPageStep(101 >> 3); connect(qtSlider, SIGNAL(valueChanged(int)), SLOT(onChange())); pWidget::synchronizeState(); setLength(horizontalSlider.state.length); setPosition(horizontalSlider.state.position); } void pHorizontalSlider::destructor() { delete qtSlider; qtWidget = qtSlider = nullptr; } void pHorizontalSlider::orphan() { destructor(); constructor(); } void pHorizontalSlider::onChange() { horizontalSlider.state.position = qtSlider->value(); if(horizontalSlider.onChange) horizontalSlider.onChange(); } } fc/cartridge/board/nes-txrom.cpp000664 001750 001750 00000002305 12651764221 017773 0ustar00sergiosergio000000 000000 struct NES_TxROM : Board { enum class Revision : unsigned { TBROM, TEROM, TFROM, TGROM, TKROM, TKSROM, TLROM, TL1ROM, TL2ROM, TLSROM, TNROM, TQROM, TR1ROM, TSROM, TVROM, } revision; MMC3 mmc3; void main() { mmc3.main(); } uint8 prg_read(unsigned addr) { if((addr & 0xe000) == 0x6000) return mmc3.ram_read(addr); if(addr & 0x8000) return prgrom.read(mmc3.prg_addr(addr)); return cpu.mdr(); } void prg_write(unsigned addr, uint8 data) { if((addr & 0xe000) == 0x6000) return mmc3.ram_write(addr, data); if(addr & 0x8000) return mmc3.reg_write(addr, data); } uint8 chr_read(unsigned addr) { mmc3.irq_test(addr); if(addr & 0x2000) return ppu.ciram_read(mmc3.ciram_addr(addr)); return Board::chr_read(mmc3.chr_addr(addr)); } void chr_write(unsigned addr, uint8 data) { mmc3.irq_test(addr); if(addr & 0x2000) return ppu.ciram_write(mmc3.ciram_addr(addr), data); return Board::chr_write(mmc3.chr_addr(addr), data); } void power() { mmc3.power(); } void reset() { mmc3.reset(); } void serialize(serializer& s) { Board::serialize(s); mmc3.serialize(s); } NES_TxROM(Markup::Node& document) : Board(document), mmc3(*this) { revision = Revision::TLROM; } }; target-ethos/Makefile000664 001750 001750 00000007622 12651764221 015765 0ustar00sergiosergio000000 000000 name := higan processors := arm gsu hg51b lr35902 r6502 r65816 spc700 upd96050 include processor/Makefile include fc/Makefile include sfc/Makefile include gb/Makefile include gba/Makefile ui_objects := ui-ethos ui-configuration ui-interface ui-utility ui_objects += ui-input ui-window ui-general ui-settings ui-tools ui_objects += phoenix ruby ui_objects += $(if $(call streq,$(platform),windows),resource) # platform ifeq ($(platform),windows) ruby := video.direct3d video.wgl video.directdraw video.gdi ruby += audio.directsound audio.xaudio2 ruby += input.windows else ifeq ($(platform),macosx) ruby := video.cgl ruby += audio.openal ruby += input.carbon else ifeq ($(platform),linux) ruby := video.glx video.xv video.xshm video.sdl ruby += audio.alsa audio.openal audio.oss audio.pulseaudio audio.pulseaudiosimple audio.ao ruby += input.udev input.sdl input.x else ifeq ($(platform),bsd) ruby := video.glx ruby += audio.openal audio.oss ruby += input.x endif # phoenix include phoenix/Makefile link += $(phoenixlink) # ruby include ruby/Makefile link += $(rubylink) # rules objects := $(ui_objects) $(objects) objects := $(patsubst %,obj/%.o,$(objects)) sfc_objects := $(patsubst %,obj/%-$(profile).o,$(sfc_objects)) objects += $(sfc_objects) obj/ui-ethos.o: $(ui)/ethos.cpp $(call rwildcard,$(ui)/) obj/ui-configuration.o: $(ui)/configuration/configuration.cpp $(call rwildcard,$(ui)/) obj/ui-interface.o: $(ui)/interface/interface.cpp $(call rwildcard,$(ui)/) obj/ui-utility.o: $(ui)/utility/utility.cpp $(call rwildcard,$(ui)/) obj/ui-input.o: $(ui)/input/input.cpp $(call rwildcard,$(ui)/) obj/ui-window.o: $(ui)/window/window.cpp $(call rwildcard,$(ui)/) obj/ui-general.o: $(ui)/general/general.cpp $(call rwildcard,$(ui)/) obj/ui-settings.o: $(ui)/settings/settings.cpp $(call rwildcard,$(ui)/) obj/ui-tools.o: $(ui)/tools/tools.cpp $(call rwildcard,$(ui)/) obj/ruby.o: ruby/ruby.cpp $(call rwildcard,ruby/*) $(compiler) $(rubyflags) -c $< -o $@ obj/phoenix.o: phoenix/phoenix.cpp $(call rwildcard,phoenix/*) $(compiler) $(phoenixflags) -c $< -o $@ obj/resource.o: $(ui)/resource.rc ifeq ($(arch),win32) windres --target=pe-i386 $(ui)/resource.rc obj/resource.o else windres $(ui)/resource.rc obj/resource.o endif # targets build: $(objects) ifeq ($(platform),windows) $(strip $(compiler) -shared -o out/phoenix.dll obj/phoenix.o $(phoenixlink)) $(strip $(compiler) -o out/$(name) $(subst obj/phoenix.o,,$(objects)) $(link) -Lout -lphoenix) else ifeq ($(platform),macosx) if [ -d out/$(name).app ]; then rm -r out/$(name).app; fi mkdir out/$(name).app mkdir out/$(name).app/Contents mkdir out/$(name).app/Contents/MacOS mkdir out/$(name).app/Contents/Resources cp data/Info.plist out/$(name).app/Contents/Info.plist sips -s format icns data/higan.png --out out/$(name).app/Contents/Resources/higan.icns $(strip $(compiler) -o out/$(name).app/Contents/MacOS/$(name) $(objects) $(link)) else $(strip $(compiler) -o out/$(name) $(objects) $(link)) endif resource: sourcery $(ui)/resource/resource.bml $(ui)/resource/resource.cpp $(ui)/resource/resource.hpp install: ifeq ($(platform),windows) else ifeq ($(platform),macosx) sudo mkdir -p /Library/Application\ Support/$(name) sudo cp -R profile/* /Library/Application\ Support/$(name) sudo cp data/cheats.bml /Library/Application\ Support/$(name)/cheats.bml sudo chmod -R 777 /Library/Application\ Support/$(name) else sudo install -D -m 755 out/$(name) $(DESTDIR)$(prefix)/bin/$(name) sudo install -D -m 644 data/$(name).png $(DESTDIR)$(prefix)/share/pixmaps/$(name).png sudo install -D -m 644 data/$(name).desktop $(DESTDIR)$(prefix)/share/applications/$(name).desktop sudo mkdir -p /usr/share/$(name) sudo cp -R profile/* /usr/share/$(name) sudo cp data/cheats.bml /usr/share/$(name)/cheats.bml sudo chmod -R 777 /usr/share/$(name) endif uninstall: ifeq ($(platform),windows) else ifeq ($(platform),macosx) else sudo rm $(DESTDIR)$(prefix)/bin/$(name) endif processor/spc700/000700 001750 001750 00000000000 12656700342 014726 5ustar00sergiosergio000000 000000 processor/lr35902/disassembler.cpp000664 001750 001750 00000051345 12651764221 020140 0ustar00sergiosergio000000 000000 string LR35902::disassemble(uint16 pc) { char output[80]; memset(output, ' ', sizeof output); output[79] = 0; string opcode = disassemble_opcode(pc); string registers = { " AF:", hex<4>(r[AF]), " BC:", hex<4>(r[BC]), " DE:", hex<4>(r[DE]), " HL:", hex<4>(r[HL]), " SP:", hex<4>(r[SP]) }; memcpy(output + 0, hex<4>(pc), 4); memcpy(output + 6, opcode, opcode.length()); memcpy(output + 23, registers, registers.length()); output[63] = 0; return output; } string LR35902::disassemble_opcode(uint16 pc) { uint8 opcode = debugger_read(pc); uint8 p0 = debugger_read(pc + 1); uint8 p1 = debugger_read(pc + 2); uint8 p2 = debugger_read(pc + 3); switch(opcode) { case 0x00: return { "nop" }; case 0x01: return { "ld bc,$", hex<2>(p1), hex<2>(p0) }; case 0x02: return { "ld (bc),a" }; case 0x03: return { "inc bc" }; case 0x04: return { "inc b" }; case 0x05: return { "dec b" }; case 0x06: return { "ld b,$", hex<2>(p0) }; case 0x07: return { "rlc a" }; case 0x08: return { "ld ($", hex<2>(p1), hex<2>(p0), "),sp" }; case 0x09: return { "add hl,bc" }; case 0x0a: return { "ld a,(bc)" }; case 0x0b: return { "dec bc" }; case 0x0c: return { "inc c" }; case 0x0d: return { "dec c" }; case 0x0e: return { "ld c,$", hex<2>(p0) }; case 0x0f: return { "rrc a" }; case 0x10: return { "stop" }; case 0x11: return { "ld de,$", hex<2>(p1), hex<2>(p0) }; case 0x12: return { "ld (de),a" }; case 0x13: return { "inc de" }; case 0x14: return { "inc d" }; case 0x15: return { "dec d" }; case 0x16: return { "ld d,$", hex<2>(p0) }; case 0x17: return { "rl a" }; case 0x18: return { "jr $", hex<4>(r[PC] + 2 + (int8)p0) }; case 0x19: return { "add hl,de" }; case 0x1a: return { "ld a,(de)" }; case 0x1b: return { "dec de" }; case 0x1c: return { "inc e" }; case 0x1d: return { "dec e" }; case 0x1e: return { "ld e,$", hex<2>(p0) }; case 0x1f: return { "rr a" }; case 0x20: return { "jr nz,$", hex<4>(r[PC] + 2 + (int8)p0) }; case 0x21: return { "ld hl,$", hex<2>(p1), hex<2>(p0) }; case 0x22: return { "ldi (hl),a" }; case 0x23: return { "inc hl" }; case 0x24: return { "inc h" }; case 0x25: return { "dec h" }; case 0x26: return { "ld h,$", hex<2>(p0) }; case 0x27: return { "daa" }; case 0x28: return { "jr z,$", hex<4>(r[PC] + 2 + (int8)p0) }; case 0x29: return { "add hl,hl" }; case 0x2a: return { "ldi a,(hl)" }; case 0x2b: return { "dec hl" }; case 0x2c: return { "inc l" }; case 0x2d: return { "dec l" }; case 0x2e: return { "ld l,$", hex<2>(p0) }; case 0x2f: return { "cpl" }; case 0x30: return { "jr nc,$", hex<4>(r[PC] + 2 + (int8)p0) }; case 0x31: return { "ld sp,$", hex<2>(p1), hex<2>(p0) }; case 0x32: return { "ldd (hl),a" }; case 0x33: return { "inc sp" }; case 0x34: return { "inc (hl)" }; case 0x35: return { "dec (hl)" }; case 0x36: return { "ld (hl),$", hex<2>(p0) }; case 0x37: return { "scf" }; case 0x38: return { "jr c,$", hex<4>(r[PC] + 2 + (int8)p0) }; case 0x39: return { "add hl,sp" }; case 0x3a: return { "ldd a,(hl)" }; case 0x3b: return { "dec sp" }; case 0x3c: return { "inc a" }; case 0x3d: return { "dec a" }; case 0x3e: return { "ld a,$", hex<2>(p0) }; case 0x3f: return { "ccf" }; case 0x40: return { "ld b,b" }; case 0x41: return { "ld b,c" }; case 0x42: return { "ld b,d" }; case 0x43: return { "ld b,e" }; case 0x44: return { "ld b,h" }; case 0x45: return { "ld b,l" }; case 0x46: return { "ld b,(hl)" }; case 0x47: return { "ld b,a" }; case 0x48: return { "ld c,b" }; case 0x49: return { "ld c,c" }; case 0x4a: return { "ld c,d" }; case 0x4b: return { "ld c,e" }; case 0x4c: return { "ld c,h" }; case 0x4d: return { "ld c,l" }; case 0x4e: return { "ld c,(hl)" }; case 0x4f: return { "ld c,a" }; case 0x50: return { "ld d,b" }; case 0x51: return { "ld d,c" }; case 0x52: return { "ld d,d" }; case 0x53: return { "ld d,e" }; case 0x54: return { "ld d,h" }; case 0x55: return { "ld d,l" }; case 0x56: return { "ld d,(hl)" }; case 0x57: return { "ld d,a" }; case 0x58: return { "ld e,b" }; case 0x59: return { "ld e,c" }; case 0x5a: return { "ld e,d" }; case 0x5b: return { "ld e,e" }; case 0x5c: return { "ld e,h" }; case 0x5d: return { "ld e,l" }; case 0x5e: return { "ld e,(hl)" }; case 0x5f: return { "ld e,a" }; case 0x60: return { "ld h,b" }; case 0x61: return { "ld h,c" }; case 0x62: return { "ld h,d" }; case 0x63: return { "ld h,e" }; case 0x64: return { "ld h,h" }; case 0x65: return { "ld h,l" }; case 0x66: return { "ld h,(hl)" }; case 0x67: return { "ld h,a" }; case 0x68: return { "ld l,b" }; case 0x69: return { "ld l,c" }; case 0x6a: return { "ld l,d" }; case 0x6b: return { "ld l,e" }; case 0x6c: return { "ld l,h" }; case 0x6d: return { "ld l,l" }; case 0x6e: return { "ld l,(hl)" }; case 0x6f: return { "ld l,a" }; case 0x70: return { "ld (hl),b" }; case 0x71: return { "ld (hl),c" }; case 0x72: return { "ld (hl),d" }; case 0x73: return { "ld (hl),e" }; case 0x74: return { "ld (hl),h" }; case 0x75: return { "ld (hl),l" }; case 0x76: return { "halt" }; case 0x77: return { "ld (hl),a" }; case 0x78: return { "ld a,b" }; case 0x79: return { "ld a,c" }; case 0x7a: return { "ld a,d" }; case 0x7b: return { "ld a,e" }; case 0x7c: return { "ld a,h" }; case 0x7d: return { "ld a,l" }; case 0x7e: return { "ld a,(hl)" }; case 0x7f: return { "ld a,a" }; case 0x80: return { "add a,b" }; case 0x81: return { "add a,c" }; case 0x82: return { "add a,d" }; case 0x83: return { "add a,e" }; case 0x84: return { "add a,h" }; case 0x85: return { "add a,l" }; case 0x86: return { "add a,(hl)" }; case 0x87: return { "add a,a" }; case 0x88: return { "adc a,b" }; case 0x89: return { "adc a,c" }; case 0x8a: return { "adc a,d" }; case 0x8b: return { "adc a,e" }; case 0x8c: return { "adc a,h" }; case 0x8d: return { "adc a,l" }; case 0x8e: return { "adc a,(hl)" }; case 0x8f: return { "adc a,a" }; case 0x90: return { "sub a,b" }; case 0x91: return { "sub a,c" }; case 0x92: return { "sub a,d" }; case 0x93: return { "sub a,e" }; case 0x94: return { "sub a,h" }; case 0x95: return { "sub a,l" }; case 0x96: return { "sub a,(hl)" }; case 0x97: return { "sub a,a" }; case 0x98: return { "sbc a,b" }; case 0x99: return { "sbc a,c" }; case 0x9a: return { "sbc a,d" }; case 0x9b: return { "sbc a,e" }; case 0x9c: return { "sbc a,h" }; case 0x9d: return { "sbc a,l" }; case 0x9e: return { "sbc a,(hl)" }; case 0x9f: return { "sbc a,a" }; case 0xa0: return { "and a,b" }; case 0xa1: return { "and a,c" }; case 0xa2: return { "and a,d" }; case 0xa3: return { "and a,e" }; case 0xa4: return { "and a,h" }; case 0xa5: return { "and a,l" }; case 0xa6: return { "and a,(hl)" }; case 0xa7: return { "and a,a" }; case 0xa8: return { "xor a,b" }; case 0xa9: return { "xor a,c" }; case 0xaa: return { "xor a,d" }; case 0xab: return { "xor a,e" }; case 0xac: return { "xor a,h" }; case 0xad: return { "xor a,l" }; case 0xae: return { "xor a,(hl)" }; case 0xaf: return { "xor a,a" }; case 0xb0: return { "or a,b" }; case 0xb1: return { "or a,c" }; case 0xb2: return { "or a,d" }; case 0xb3: return { "or a,e" }; case 0xb4: return { "or a,h" }; case 0xb5: return { "or a,l" }; case 0xb6: return { "or a,(hl)" }; case 0xb7: return { "or a,a" }; case 0xb8: return { "cp a,b" }; case 0xb9: return { "cp a,c" }; case 0xba: return { "cp a,d" }; case 0xbb: return { "cp a,e" }; case 0xbc: return { "cp a,h" }; case 0xbd: return { "cp a,l" }; case 0xbe: return { "cp a,(hl)" }; case 0xbf: return { "cp a,a" }; case 0xc0: return { "ret nz" }; case 0xc1: return { "pop bc" }; case 0xc2: return { "jp nz,$", hex<2>(p1), hex<2>(p0) }; case 0xc3: return { "jp $", hex<2>(p1), hex<2>(p0) }; case 0xc4: return { "call nz,$", hex<2>(p1), hex<2>(p0) }; case 0xc5: return { "push bc" }; case 0xc6: return { "add a,$", hex<2>(p0) }; case 0xc7: return { "rst $0000" }; case 0xc8: return { "ret z" }; case 0xc9: return { "ret" }; case 0xca: return { "jp z,$", hex<2>(p1), hex<2>(p0) }; case 0xcb: return disassemble_opcode_cb(pc + 1); case 0xcc: return { "call z,$", hex<2>(p1), hex<2>(p0) }; case 0xcd: return { "call $", hex<2>(p1), hex<2>(p0) }; case 0xce: return { "adc a,$", hex<2>(p0) }; case 0xcf: return { "rst $0008" }; case 0xd0: return { "ret nc" }; case 0xd1: return { "pop de" }; case 0xd2: return { "jp nc,$", hex<2>(p1), hex<2>(p0) }; case 0xd3: return { "xx" }; case 0xd4: return { "call nc,$", hex<2>(p1), hex<2>(p0) }; case 0xd5: return { "push de" }; case 0xd6: return { "sub a,$", hex<2>(p0) }; case 0xd7: return { "rst $0010" }; case 0xd8: return { "ret c" }; case 0xd9: return { "reti" }; case 0xda: return { "jp c,$", hex<2>(p1), hex<2>(p0) }; case 0xdb: return { "xx" }; case 0xdc: return { "call c,$", hex<2>(p1), hex<2>(p0) }; case 0xdd: return { "xx" }; case 0xde: return { "sbc a,$", hex<2>(p0) }; case 0xdf: return { "rst $0018" }; case 0xe0: return { "ld ($ff", hex<2>(p0), "),a" }; case 0xe1: return { "pop hl" }; case 0xe2: return { "ld ($ff00+c),a" }; case 0xe3: return { "xx" }; case 0xe4: return { "xx" }; case 0xe5: return { "push hl" }; case 0xe6: return { "and a,$", hex<2>(p0) }; case 0xe7: return { "rst $0020" }; case 0xe8: return { "add sp,$", hex<4>((int8)p0) }; case 0xe9: return { "jp hl" }; case 0xea: return { "ld ($", hex<2>(p1), hex<2>(p0), "),a" }; case 0xeb: return { "xx" }; case 0xec: return { "xx" }; case 0xed: return { "xx" }; case 0xee: return { "xor a,$", hex<2>(p0) }; case 0xef: return { "rst $0028" }; case 0xf0: return { "ld a,($ff", hex<2>(p0), ")" }; case 0xf1: return { "pop af" }; case 0xf2: return { "ld a,($ff00+c)" }; case 0xf3: return { "di" }; case 0xf4: return { "xx" }; case 0xf5: return { "push af" }; case 0xf6: return { "or a,$", hex<2>(p0) }; case 0xf7: return { "rst $0030" }; case 0xf8: return { "ld hl,sp+$", hex<4>((int8)p0) }; case 0xf9: return { "ld sp,hl" }; case 0xfa: return { "ld a,($", hex<2>(p1), hex<2>(p0), ")" }; case 0xfb: return { "ei" }; case 0xfc: return { "xx" }; case 0xfd: return { "xx" }; case 0xfe: return { "cp a,$", hex<2>(p0) }; case 0xff: return { "rst $0038" }; } return ""; } string LR35902::disassemble_opcode_cb(uint16 pc) { uint8 opcode = debugger_read(pc); uint8 p0 = debugger_read(pc + 1); uint8 p1 = debugger_read(pc + 2); uint8 p2 = debugger_read(pc + 3); switch(opcode) { case 0x00: return { "rlc b" }; case 0x01: return { "rlc c" }; case 0x02: return { "rlc d" }; case 0x03: return { "rlc e" }; case 0x04: return { "rlc h" }; case 0x05: return { "rlc l" }; case 0x06: return { "rlc (hl)" }; case 0x07: return { "rlc a" }; case 0x08: return { "rrc b" }; case 0x09: return { "rrc c" }; case 0x0a: return { "rrc d" }; case 0x0b: return { "rrc e" }; case 0x0c: return { "rrc h" }; case 0x0d: return { "rrc l" }; case 0x0e: return { "rrc (hl)" }; case 0x0f: return { "rrc a" }; case 0x10: return { "rl b" }; case 0x11: return { "rl c" }; case 0x12: return { "rl d" }; case 0x13: return { "rl e" }; case 0x14: return { "rl h" }; case 0x15: return { "rl l" }; case 0x16: return { "rl (hl)" }; case 0x17: return { "rl a" }; case 0x18: return { "rr b" }; case 0x19: return { "rr c" }; case 0x1a: return { "rr d" }; case 0x1b: return { "rr e" }; case 0x1c: return { "rr h" }; case 0x1d: return { "rr l" }; case 0x1e: return { "rr (hl)" }; case 0x1f: return { "rr a" }; case 0x20: return { "sla b" }; case 0x21: return { "sla c" }; case 0x22: return { "sla d" }; case 0x23: return { "sla e" }; case 0x24: return { "sla h" }; case 0x25: return { "sla l" }; case 0x26: return { "sla (hl)" }; case 0x27: return { "sla a" }; case 0x28: return { "sra b" }; case 0x29: return { "sra c" }; case 0x2a: return { "sra d" }; case 0x2b: return { "sra e" }; case 0x2c: return { "sra h" }; case 0x2d: return { "sra l" }; case 0x2e: return { "sra (hl)" }; case 0x2f: return { "sra a" }; case 0x30: return { "swap b" }; case 0x31: return { "swap c" }; case 0x32: return { "swap d" }; case 0x33: return { "swap e" }; case 0x34: return { "swap h" }; case 0x35: return { "swap l" }; case 0x36: return { "swap (hl)" }; case 0x37: return { "swap a" }; case 0x38: return { "srl b" }; case 0x39: return { "srl c" }; case 0x3a: return { "srl d" }; case 0x3b: return { "srl e" }; case 0x3c: return { "srl h" }; case 0x3d: return { "srl l" }; case 0x3e: return { "srl (hl)" }; case 0x3f: return { "srl a" }; case 0x40: return { "bit 0,b" }; case 0x41: return { "bit 0,c" }; case 0x42: return { "bit 0,d" }; case 0x43: return { "bit 0,e" }; case 0x44: return { "bit 0,h" }; case 0x45: return { "bit 0,l" }; case 0x46: return { "bit 0,(hl)" }; case 0x47: return { "bit 0,a" }; case 0x48: return { "bit 1,b" }; case 0x49: return { "bit 1,c" }; case 0x4a: return { "bit 1,d" }; case 0x4b: return { "bit 1,e" }; case 0x4c: return { "bit 1,h" }; case 0x4d: return { "bit 1,l" }; case 0x4e: return { "bit 1,(hl)" }; case 0x4f: return { "bit 1,a" }; case 0x50: return { "bit 2,b" }; case 0x51: return { "bit 2,c" }; case 0x52: return { "bit 2,d" }; case 0x53: return { "bit 2,e" }; case 0x54: return { "bit 2,h" }; case 0x55: return { "bit 2,l" }; case 0x56: return { "bit 2,(hl)" }; case 0x57: return { "bit 2,a" }; case 0x58: return { "bit 3,b" }; case 0x59: return { "bit 3,c" }; case 0x5a: return { "bit 3,d" }; case 0x5b: return { "bit 3,e" }; case 0x5c: return { "bit 3,h" }; case 0x5d: return { "bit 3,l" }; case 0x5e: return { "bit 3,(hl)" }; case 0x5f: return { "bit 3,a" }; case 0x60: return { "bit 4,b" }; case 0x61: return { "bit 4,c" }; case 0x62: return { "bit 4,d" }; case 0x63: return { "bit 4,e" }; case 0x64: return { "bit 4,h" }; case 0x65: return { "bit 4,l" }; case 0x66: return { "bit 4,(hl)" }; case 0x67: return { "bit 4,a" }; case 0x68: return { "bit 5,b" }; case 0x69: return { "bit 5,c" }; case 0x6a: return { "bit 5,d" }; case 0x6b: return { "bit 5,e" }; case 0x6c: return { "bit 5,h" }; case 0x6d: return { "bit 5,l" }; case 0x6e: return { "bit 5,(hl)" }; case 0x6f: return { "bit 5,a" }; case 0x70: return { "bit 6,b" }; case 0x71: return { "bit 6,c" }; case 0x72: return { "bit 6,d" }; case 0x73: return { "bit 6,e" }; case 0x74: return { "bit 6,h" }; case 0x75: return { "bit 6,l" }; case 0x76: return { "bit 6,(hl)" }; case 0x77: return { "bit 6,a" }; case 0x78: return { "bit 7,b" }; case 0x79: return { "bit 7,c" }; case 0x7a: return { "bit 7,d" }; case 0x7b: return { "bit 7,e" }; case 0x7c: return { "bit 7,h" }; case 0x7d: return { "bit 7,l" }; case 0x7e: return { "bit 7,(hl)" }; case 0x7f: return { "bit 7,a" }; case 0x80: return { "res 0,b" }; case 0x81: return { "res 0,c" }; case 0x82: return { "res 0,d" }; case 0x83: return { "res 0,e" }; case 0x84: return { "res 0,h" }; case 0x85: return { "res 0,l" }; case 0x86: return { "res 0,(hl)" }; case 0x87: return { "res 0,a" }; case 0x88: return { "res 1,b" }; case 0x89: return { "res 1,c" }; case 0x8a: return { "res 1,d" }; case 0x8b: return { "res 1,e" }; case 0x8c: return { "res 1,h" }; case 0x8d: return { "res 1,l" }; case 0x8e: return { "res 1,(hl)" }; case 0x8f: return { "res 1,a" }; case 0x90: return { "res 2,b" }; case 0x91: return { "res 2,c" }; case 0x92: return { "res 2,d" }; case 0x93: return { "res 2,e" }; case 0x94: return { "res 2,h" }; case 0x95: return { "res 2,l" }; case 0x96: return { "res 2,(hl)" }; case 0x97: return { "res 2,a" }; case 0x98: return { "res 3,b" }; case 0x99: return { "res 3,c" }; case 0x9a: return { "res 3,d" }; case 0x9b: return { "res 3,e" }; case 0x9c: return { "res 3,h" }; case 0x9d: return { "res 3,l" }; case 0x9e: return { "res 3,(hl)" }; case 0x9f: return { "res 3,a" }; case 0xa0: return { "res 4,b" }; case 0xa1: return { "res 4,c" }; case 0xa2: return { "res 4,d" }; case 0xa3: return { "res 4,e" }; case 0xa4: return { "res 4,h" }; case 0xa5: return { "res 4,l" }; case 0xa6: return { "res 4,(hl)" }; case 0xa7: return { "res 4,a" }; case 0xa8: return { "res 5,b" }; case 0xa9: return { "res 5,c" }; case 0xaa: return { "res 5,d" }; case 0xab: return { "res 5,e" }; case 0xac: return { "res 5,h" }; case 0xad: return { "res 5,l" }; case 0xae: return { "res 5,(hl)" }; case 0xaf: return { "res 5,a" }; case 0xb0: return { "res 6,b" }; case 0xb1: return { "res 6,c" }; case 0xb2: return { "res 6,d" }; case 0xb3: return { "res 6,e" }; case 0xb4: return { "res 6,h" }; case 0xb5: return { "res 6,l" }; case 0xb6: return { "res 6,(hl)" }; case 0xb7: return { "res 6,a" }; case 0xb8: return { "res 7,b" }; case 0xb9: return { "res 7,c" }; case 0xba: return { "res 7,d" }; case 0xbb: return { "res 7,e" }; case 0xbc: return { "res 7,h" }; case 0xbd: return { "res 7,l" }; case 0xbe: return { "res 7,(hl)" }; case 0xbf: return { "res 7,a" }; case 0xc0: return { "set 0,b" }; case 0xc1: return { "set 0,c" }; case 0xc2: return { "set 0,d" }; case 0xc3: return { "set 0,e" }; case 0xc4: return { "set 0,h" }; case 0xc5: return { "set 0,l" }; case 0xc6: return { "set 0,(hl)" }; case 0xc7: return { "set 0,a" }; case 0xc8: return { "set 1,b" }; case 0xc9: return { "set 1,c" }; case 0xca: return { "set 1,d" }; case 0xcb: return { "set 1,e" }; case 0xcc: return { "set 1,h" }; case 0xcd: return { "set 1,l" }; case 0xce: return { "set 1,(hl)" }; case 0xcf: return { "set 1,a" }; case 0xd0: return { "set 2,b" }; case 0xd1: return { "set 2,c" }; case 0xd2: return { "set 2,d" }; case 0xd3: return { "set 2,e" }; case 0xd4: return { "set 2,h" }; case 0xd5: return { "set 2,l" }; case 0xd6: return { "set 2,(hl)" }; case 0xd7: return { "set 2,a" }; case 0xd8: return { "set 3,b" }; case 0xd9: return { "set 3,c" }; case 0xda: return { "set 3,d" }; case 0xdb: return { "set 3,e" }; case 0xdc: return { "set 3,h" }; case 0xdd: return { "set 3,l" }; case 0xde: return { "set 3,(hl)" }; case 0xdf: return { "set 3,a" }; case 0xe0: return { "set 4,b" }; case 0xe1: return { "set 4,c" }; case 0xe2: return { "set 4,d" }; case 0xe3: return { "set 4,e" }; case 0xe4: return { "set 4,h" }; case 0xe5: return { "set 4,l" }; case 0xe6: return { "set 4,(hl)" }; case 0xe7: return { "set 4,a" }; case 0xe8: return { "set 5,b" }; case 0xe9: return { "set 5,c" }; case 0xea: return { "set 5,d" }; case 0xeb: return { "set 5,e" }; case 0xec: return { "set 5,h" }; case 0xed: return { "set 5,l" }; case 0xee: return { "set 5,(hl)" }; case 0xef: return { "set 5,a" }; case 0xf0: return { "set 6,b" }; case 0xf1: return { "set 6,c" }; case 0xf2: return { "set 6,d" }; case 0xf3: return { "set 6,e" }; case 0xf4: return { "set 6,h" }; case 0xf5: return { "set 6,l" }; case 0xf6: return { "set 6,(hl)" }; case 0xf7: return { "set 6,a" }; case 0xf8: return { "set 7,b" }; case 0xf9: return { "set 7,c" }; case 0xfa: return { "set 7,d" }; case 0xfb: return { "set 7,e" }; case 0xfc: return { "set 7,h" }; case 0xfd: return { "set 7,l" }; case 0xfe: return { "set 7,(hl)" }; case 0xff: return { "set 7,a" }; } return ""; } phoenix/qt/settings.cpp000664 001750 001750 00000001356 12651764221 016357 0ustar00sergiosergio000000 000000 namespace phoenix { static Settings *settings = nullptr; void Settings::load() { string path = {userpath(), ".config/phoenix/"}; Configuration::Document::load({path, "qt.bml"}); } void Settings::save() { string path = {userpath(), ".config/phoenix/"}; directory::create(path, 0755); Configuration::Document::save({path, "qt.bml"}); } Settings::Settings() { geometry.append(geometry.frameX = 4, "FrameX"); geometry.append(geometry.frameY = 24, "FrameY"); geometry.append(geometry.frameWidth = 8, "FrameWidth"); geometry.append(geometry.frameHeight = 28, "FrameHeight"); geometry.append(geometry.menuHeight = 20, "MenuHeight"); geometry.append(geometry.statusHeight = 20, "StatusHeight"); append(geometry, "Geometry"); } } sfc/chip/hitachidsp/000700 001750 001750 00000000000 12656700342 015511 5ustar00sergiosergio000000 000000 target-ethos/interface/interface.cpp000664 001750 001750 00000010034 12651764221 020720 0ustar00sergiosergio000000 000000 #include "../ethos.hpp" Interface* interface = nullptr; void Interface::loadRequest(unsigned id, string name, string type) { return utility->loadRequest(id, name, type); } void Interface::loadRequest(unsigned id, string path) { return utility->loadRequest(id, path); } void Interface::saveRequest(unsigned id, string path) { return utility->saveRequest(id, path); } uint32_t Interface::videoColor(unsigned source, uint16_t a, uint16_t r, uint16_t g, uint16_t b) { if(config->video.shader != "Display Emulation") { if(config->video.saturation != 100) { uint16_t grayscale = uclamp<16>((r + g + b) / 3); double saturation = config->video.saturation * 0.01; double inverse = max(0.0, 1.0 - saturation); r = uclamp<16>(r * saturation + grayscale * inverse); g = uclamp<16>(g * saturation + grayscale * inverse); b = uclamp<16>(b * saturation + grayscale * inverse); } if(config->video.gamma != 100) { double exponent = config->video.gamma * 0.01; double reciprocal = 1.0 / 32767.0; r = r > 32767 ? r : 32767 * pow(r * reciprocal, exponent); g = g > 32767 ? g : 32767 * pow(g * reciprocal, exponent); b = b > 32767 ? b : 32767 * pow(b * reciprocal, exponent); } if(config->video.luminance != 100) { double luminance = config->video.luminance * 0.01; r = r * luminance; g = g * luminance; b = b * luminance; } } if(program->depth == 30) { a >>= 14, r >>= 6, g >>= 6, b >>= 6; return a << 30 | r << 20 | g << 10 | b << 0; } if(program->depth == 24) { a >>= 8, r >>= 8, g >>= 8, b >>= 8; return a << 24 | r << 16 | g << 8 | b << 0; } return 0u; } void Interface::videoRefresh(const uint32_t* palette, const uint32_t* data, unsigned pitch, unsigned width, unsigned height) { uint32_t* output; unsigned outputPitch; if(video.lock(output, outputPitch, width, height)) { pitch >>= 2, outputPitch >>= 2; for(unsigned y = 0; y < height; y++) { const uint32_t* sp = data + y * pitch; uint32_t* dp = output + y * outputPitch; for(unsigned x = 0; x < width; x++) { *dp++ = palette[*sp++]; } } if(system().information.overscan && config->video.maskOverscan.enable) { unsigned h = config->video.maskOverscan.horizontal; unsigned v = config->video.maskOverscan.vertical; if(h) for(unsigned y = 0; y < height; y++) { memset(output + y * outputPitch, 0, 4 * h); memset(output + y * outputPitch + (width - h), 0, 4 * h); } if(v) for(unsigned y = 0; y < v; y++) { memset(output + y * outputPitch, 0, 4 * width); memset(output + (height - 1 - y) * outputPitch, 0, 4 * width); } } video.unlock(); video.refresh(); } static unsigned frameCounter = 0; static time_t previous, current; frameCounter++; time(¤t); if(current != previous) { previous = current; utility->setStatusText({"FPS: ", frameCounter}); frameCounter = 0; } } void Interface::audioSample(int16_t lsample, int16_t rsample) { signed samples[] = {lsample, rsample}; dspaudio.sample(samples); while(dspaudio.pending()) { dspaudio.read(samples); audio.sample(samples[0], samples[1]); } } int16_t Interface::inputPoll(unsigned port, unsigned device, unsigned input) { unsigned guid = system().port[port].device[device].input[input].guid; return inputManager->inputMap[guid]->poll(); } void Interface::inputRumble(unsigned port, unsigned device, unsigned input, bool enable) { unsigned guid = system().port[port].device[device].input[input].guid; return inputManager->inputMap[guid]->rumble(enable); } unsigned Interface::dipSettings(const Markup::Node& node) { return dipSwitches->run(node); } string Interface::path(unsigned group) { return utility->path(group); } string Interface::server() { return { config->server.username, ":", config->server.password, "@", config->server.hostname }; } void Interface::notify(string text) { MessageWindow().setParent(*presentation).setText(text).information(); } target-ethos/resource/hotkeys.png000664 001750 001750 00000001113 12651764221 020335 0ustar00sergiosergio000000 000000 PNG  IHDRasBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<IDAT8kSQs__I&"f"ԨH-t  8U㒢UpԾ4}m5s.|߽Rqz%00PT:X<ﻈdXcǘWLJH&Rj-9{lE;g2 cVlﳮj̟hno( 4]2C;8 sw殣ʩhPպrq[=Rpoee`M--%Nv9FV{h 9{^=XxXVx-Spjfzk=D+c 8G0 1ZhTn_]}v>aͯH%ӠJ)6\8l6Oj4ob.AΑ=c4st]2cfijwEx'Z7pbh7_q䤗IENDB`sfc/chip/necdsp/necdsp.hpp000664 001750 001750 00000000652 12651764221 016652 0ustar00sergiosergio000000 000000 struct NECDSP : Processor::uPD96050, Coprocessor { unsigned Select; static void Enter(); void enter(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); uint8 ram_read(unsigned addr); void ram_write(unsigned addr, uint8 data); void init(); void load(); void unload(); void power(); void reset(); vector firmware(); void serialize(serializer&); }; extern NECDSP necdsp; nall/stream/000700 001750 001750 00000000000 12656700342 014114 5ustar00sergiosergio000000 000000 sfc/chip/superfx/timing/timing.cpp000664 001750 001750 00000003713 12651764221 020370 0ustar00sergiosergio000000 000000 #ifdef SUPERFX_CPP void SuperFX::step(unsigned clocks) { if(regs.romcl) { regs.romcl -= min(clocks, regs.romcl); if(regs.romcl == 0) { regs.sfr.r = 0; regs.romdr = bus_read((regs.rombr << 16) + regs.r[14]); } } if(regs.ramcl) { regs.ramcl -= min(clocks, regs.ramcl); if(regs.ramcl == 0) { bus_write(0x700000 + (regs.rambr << 16) + regs.ramar, regs.ramdr); } } Coprocessor::step(clocks); synchronize_cpu(); } void SuperFX::rombuffer_sync() { if(regs.romcl) step(regs.romcl); } void SuperFX::rombuffer_update() { regs.sfr.r = 1; regs.romcl = memory_access_speed; } uint8 SuperFX::rombuffer_read() { rombuffer_sync(); return regs.romdr; } void SuperFX::rambuffer_sync() { if(regs.ramcl) step(regs.ramcl); } uint8 SuperFX::rambuffer_read(uint16 addr) { rambuffer_sync(); return bus_read(0x700000 + (regs.rambr << 16) + addr); } void SuperFX::rambuffer_write(uint16 addr, uint8 data) { rambuffer_sync(); regs.ramcl = memory_access_speed; regs.ramar = addr; regs.ramdr = data; } void SuperFX::r14_modify(uint16 data) { regs.r[14].data = data; rombuffer_update(); } void SuperFX::r15_modify(uint16 data) { regs.r[15].data = data; r15_modified = true; } void SuperFX::update_speed() { //force SuperFX1 mode? if(clockmode == 1) { cache_access_speed = 2; memory_access_speed = 6; return; } //force SuperFX2 mode? if(clockmode == 2) { cache_access_speed = 1; memory_access_speed = 5; regs.cfgr.ms0 = 0; //cannot use high-speed multiplication in 21MHz mode return; } //default: allow S-CPU to select mode cache_access_speed = (regs.clsr ? 1 : 2); memory_access_speed = (regs.clsr ? 5 : 6); if(regs.clsr) regs.cfgr.ms0 = 0; //cannot use high-speed multiplication in 21MHz mode } void SuperFX::timing_reset() { update_speed(); r15_modified = false; regs.romcl = 0; regs.romdr = 0; regs.ramcl = 0; regs.ramar = 0; regs.ramdr = 0; } #endif sfc/ppu/mmio/mmio.hpp000664 001750 001750 00000007224 12651764221 015707 0ustar00sergiosergio000000 000000 public: uint8 mmio_read(unsigned addr); void mmio_write(unsigned addr, uint8 data); privileged: struct { uint8 ppu1_mdr; uint8 ppu2_mdr; uint16 vram_readbuffer; uint8 oam_latchdata; uint8 cgram_latchdata; uint8 bgofs_latchdata; uint8 mode7_latchdata; bool counters_latched; bool latch_hcounter; bool latch_vcounter; uint10 oam_iaddr; uint9 cgram_iaddr; //$2100 INIDISP bool display_disable; uint4 display_brightness; //$2102 OAMADDL //$2103 OAMADDH uint10 oam_baseaddr; uint10 oam_addr; bool oam_priority; //$2105 BGMODE bool bg3_priority; uint8 bgmode; //$210d BG1HOFS uint16 mode7_hoffset; //$210e BG1VOFS uint16 mode7_voffset; //$2115 VMAIN bool vram_incmode; uint2 vram_mapping; uint8 vram_incsize; //$2116 VMADDL //$2117 VMADDH uint16 vram_addr; //$211a M7SEL uint2 mode7_repeat; bool mode7_vflip; bool mode7_hflip; //$211b M7A uint16 m7a; //$211c M7B uint16 m7b; //$211d M7C uint16 m7c; //$211e M7D uint16 m7d; //$211f M7X uint16 m7x; //$2120 M7Y uint16 m7y; //$2121 CGADD uint9 cgram_addr; //$2133 SETINI bool mode7_extbg; bool pseudo_hires; bool overscan; bool interlace; //$213c OPHCT uint16 hcounter; //$213d OPVCT uint16 vcounter; } regs; uint16 get_vram_address(); uint8 vram_read(unsigned addr); void vram_write(unsigned addr, uint8 data); uint8 oam_read(unsigned addr); void oam_write(unsigned addr, uint8 data); uint8 cgram_read(unsigned addr); void cgram_write(unsigned addr, uint8 data); void mmio_update_video_mode(); void mmio_w2100(uint8); //INIDISP void mmio_w2101(uint8); //OBSEL void mmio_w2102(uint8); //OAMADDL void mmio_w2103(uint8); //OAMADDH void mmio_w2104(uint8); //OAMDATA void mmio_w2105(uint8); //BGMODE void mmio_w2106(uint8); //MOSAIC void mmio_w2107(uint8); //BG1SC void mmio_w2108(uint8); //BG2SC void mmio_w2109(uint8); //BG3SC void mmio_w210a(uint8); //BG4SC void mmio_w210b(uint8); //BG12NBA void mmio_w210c(uint8); //BG34NBA void mmio_w210d(uint8); //BG1HOFS void mmio_w210e(uint8); //BG1VOFS void mmio_w210f(uint8); //BG2HOFS void mmio_w2110(uint8); //BG2VOFS void mmio_w2111(uint8); //BG3HOFS void mmio_w2112(uint8); //BG3VOFS void mmio_w2113(uint8); //BG4HOFS void mmio_w2114(uint8); //BG4VOFS void mmio_w2115(uint8); //VMAIN void mmio_w2116(uint8); //VMADDL void mmio_w2117(uint8); //VMADDH void mmio_w2118(uint8); //VMDATAL void mmio_w2119(uint8); //VMDATAH void mmio_w211a(uint8); //M7SEL void mmio_w211b(uint8); //M7A void mmio_w211c(uint8); //M7B void mmio_w211d(uint8); //M7C void mmio_w211e(uint8); //M7D void mmio_w211f(uint8); //M7X void mmio_w2120(uint8); //M7Y void mmio_w2121(uint8); //CGADD void mmio_w2122(uint8); //CGDATA void mmio_w2123(uint8); //W12SEL void mmio_w2124(uint8); //W34SEL void mmio_w2125(uint8); //WOBJSEL void mmio_w2126(uint8); //WH0 void mmio_w2127(uint8); //WH1 void mmio_w2128(uint8); //WH2 void mmio_w2129(uint8); //WH3 void mmio_w212a(uint8); //WBGLOG void mmio_w212b(uint8); //WOBJLOG void mmio_w212c(uint8); //TM void mmio_w212d(uint8); //TS void mmio_w212e(uint8); //TMW void mmio_w212f(uint8); //TSW void mmio_w2130(uint8); //CGWSEL void mmio_w2131(uint8); //CGADDSUB void mmio_w2132(uint8); //COLDATA void mmio_w2133(uint8); //SETINI uint8 mmio_r2134(); //MPYL uint8 mmio_r2135(); //MPYM uint8 mmio_r2136(); //MPYH uint8 mmio_r2137(); //SLHV uint8 mmio_r2138(); //OAMDATAREAD uint8 mmio_r2139(); //VMDATALREAD uint8 mmio_r213a(); //VMDATAHREAD uint8 mmio_r213b(); //CGDATAREAD uint8 mmio_r213c(); //OPHCT uint8 mmio_r213d(); //OPVCT uint8 mmio_r213e(); //STAT77 uint8 mmio_r213f(); //STAT78 void mmio_reset(); phoenix/qt/application.cpp000664 001750 001750 00000002045 12651764221 017016 0ustar00sergiosergio000000 000000 namespace phoenix { XlibDisplay* pApplication::display = nullptr; void pApplication::run() { if(Application::main) { while(applicationState.quit == false) { processEvents(); Application::main(); } } else { QApplication::exec(); } } bool pApplication::pendingEvents() { return QApplication::hasPendingEvents(); } void pApplication::processEvents() { while(pendingEvents()) QApplication::processEvents(); } void pApplication::quit() { QApplication::quit(); //note: QApplication cannot be deleted; or libQtGui will crash qtApplication = nullptr; } void pApplication::syncX() { for(unsigned n = 0; n < 8; n++) { QApplication::syncX(); Application::processEvents(); usleep(2000); } } void pApplication::initialize() { display = XOpenDisplay(0); settings = new Settings; settings->load(); static int argc = 1; static char* argv[] = {new char[8], nullptr}; strcpy(argv[0], "phoenix"); char** argvp = argv; qtApplication = new QApplication(argc, argvp); pKeyboard::initialize(); } } sfc/alt/dsp/SPC_DSP.cpp000664 001750 001750 00000063565 12651764221 015707 0ustar00sergiosergio000000 000000 // snes_spc 0.9.0. http://www.slack.net/~ant/ #include "SPC_DSP.h" #include "blargg_endian.h" #include /* Copyright (C) 2007 Shay Green. This module is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This module is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "blargg_source.h" #ifdef BLARGG_ENABLE_OPTIMIZER #include BLARGG_ENABLE_OPTIMIZER #endif #if INT_MAX < 0x7FFFFFFF #error "Requires that int type have at least 32 bits" #endif // TODO: add to blargg_endian.h #define GET_LE16SA( addr ) ((BOOST::int16_t) GET_LE16( addr )) #define GET_LE16A( addr ) GET_LE16( addr ) #define SET_LE16A( addr, data ) SET_LE16( addr, data ) static BOOST::uint8_t const initial_regs [SPC_DSP::register_count] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x45,0x8B,0x5A,0x9A,0xE4,0x82,0x1B,0x78,0x00,0x00,0xAA,0x96,0x89,0x0E,0xE0,0x80, // 0x2A,0x49,0x3D,0xBA,0x14,0xA0,0xAC,0xC5,0x00,0x00,0x51,0xBB,0x9C,0x4E,0x7B,0xFF, // 0xF4,0xFD,0x57,0x32,0x37,0xD9,0x42,0x22,0x00,0x00,0x5B,0x3C,0x9F,0x1B,0x87,0x9A, // 0x6F,0x27,0xAF,0x7B,0xE5,0x68,0x0A,0xD9,0x00,0x00,0x9A,0xC5,0x9C,0x4E,0x7B,0xFF, // 0xEA,0x21,0x78,0x4F,0xDD,0xED,0x24,0x14,0x00,0x00,0x77,0xB1,0xD1,0x36,0xC1,0x67, // 0x52,0x57,0x46,0x3D,0x59,0xF4,0x87,0xA4,0x00,0x00,0x7E,0x44,0x9C,0x4E,0x7B,0xFF, // 0x75,0xF5,0x06,0x97,0x10,0xC3,0x24,0xBB,0x00,0x00,0x7B,0x7A,0xE0,0x60,0x12,0x0F, // 0xF7,0x74,0x1C,0xE5,0x39,0x3D,0x73,0xC1,0x00,0x00,0x7A,0xB3,0xFF,0x4E,0x7B,0xFF }; // if ( io < -32768 ) io = -32768; // if ( io > 32767 ) io = 32767; #define CLAMP16( io )\ {\ if ( (int16_t) io != io )\ io = (io >> 31) ^ 0x7FFF;\ } // Access global DSP register #define REG(n) m.regs [r_##n] // Access voice DSP register #define VREG(r,n) r [v_##n] #define WRITE_SAMPLES( l, r, out ) \ {\ out [0] = l;\ out [1] = r;\ out += 2;\ if ( out >= m.out_end )\ {\ check( out == m.out_end );\ check( m.out_end != &m.extra [extra_size] || \ (m.extra <= m.out_begin && m.extra < &m.extra [extra_size]) );\ out = m.extra;\ m.out_end = &m.extra [extra_size];\ }\ }\ void SPC_DSP::set_output( sample_t* out, int size ) { require( (size & 1) == 0 ); // must be even if ( !out ) { out = m.extra; size = extra_size; } m.out_begin = out; m.out = out; m.out_end = out + size; } // Volume registers and efb are signed! Easy to forget int8_t cast. // Prefixes are to avoid accidental use of locals with same names. // Gaussian interpolation static short const gauss [512] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 21, 22, 23, 23, 24, 24, 25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 64, 65, 66, 67, 69, 70, 71, 73, 74, 76, 77, 78, 80, 81, 83, 84, 86, 87, 89, 90, 92, 94, 95, 97, 99, 100, 102, 104, 106, 107, 109, 111, 113, 115, 117, 118, 120, 122, 124, 126, 128, 130, 132, 134, 137, 139, 141, 143, 145, 147, 150, 152, 154, 156, 159, 161, 163, 166, 168, 171, 173, 175, 178, 180, 183, 186, 188, 191, 193, 196, 199, 201, 204, 207, 210, 212, 215, 218, 221, 224, 227, 230, 233, 236, 239, 242, 245, 248, 251, 254, 257, 260, 263, 267, 270, 273, 276, 280, 283, 286, 290, 293, 297, 300, 304, 307, 311, 314, 318, 321, 325, 328, 332, 336, 339, 343, 347, 351, 354, 358, 362, 366, 370, 374, 378, 381, 385, 389, 393, 397, 401, 405, 410, 414, 418, 422, 426, 430, 434, 439, 443, 447, 451, 456, 460, 464, 469, 473, 477, 482, 486, 491, 495, 499, 504, 508, 513, 517, 522, 527, 531, 536, 540, 545, 550, 554, 559, 563, 568, 573, 577, 582, 587, 592, 596, 601, 606, 611, 615, 620, 625, 630, 635, 640, 644, 649, 654, 659, 664, 669, 674, 678, 683, 688, 693, 698, 703, 708, 713, 718, 723, 728, 732, 737, 742, 747, 752, 757, 762, 767, 772, 777, 782, 787, 792, 797, 802, 806, 811, 816, 821, 826, 831, 836, 841, 846, 851, 855, 860, 865, 870, 875, 880, 884, 889, 894, 899, 904, 908, 913, 918, 923, 927, 932, 937, 941, 946, 951, 955, 960, 965, 969, 974, 978, 983, 988, 992, 997,1001,1005,1010,1014,1019,1023,1027,1032,1036, 1040,1045,1049,1053,1057,1061,1066,1070,1074,1078,1082,1086,1090,1094,1098,1102, 1106,1109,1113,1117,1121,1125,1128,1132,1136,1139,1143,1146,1150,1153,1157,1160, 1164,1167,1170,1174,1177,1180,1183,1186,1190,1193,1196,1199,1202,1205,1207,1210, 1213,1216,1219,1221,1224,1227,1229,1232,1234,1237,1239,1241,1244,1246,1248,1251, 1253,1255,1257,1259,1261,1263,1265,1267,1269,1270,1272,1274,1275,1277,1279,1280, 1282,1283,1284,1286,1287,1288,1290,1291,1292,1293,1294,1295,1296,1297,1297,1298, 1299,1300,1300,1301,1302,1302,1303,1303,1303,1304,1304,1304,1304,1304,1305,1305, }; inline int SPC_DSP::interpolate( voice_t const* v ) { // Make pointers into gaussian based on fractional position between samples int offset = v->interp_pos >> 4 & 0xFF; short const* fwd = gauss + 255 - offset; short const* rev = gauss + offset; // mirror left half of gaussian int const* in = &v->buf [(v->interp_pos >> 12) + v->buf_pos]; int out; out = (fwd [ 0] * in [0]) >> 11; out += (fwd [256] * in [1]) >> 11; out += (rev [256] * in [2]) >> 11; out = (int16_t) out; out += (rev [ 0] * in [3]) >> 11; CLAMP16( out ); out &= ~1; return out; } //// Counters int const simple_counter_range = 2048 * 5 * 3; // 30720 static unsigned const counter_rates [32] = { simple_counter_range + 1, // never fires 2048, 1536, 1280, 1024, 768, 640, 512, 384, 320, 256, 192, 160, 128, 96, 80, 64, 48, 40, 32, 24, 20, 16, 12, 10, 8, 6, 5, 4, 3, 2, 1 }; static unsigned const counter_offsets [32] = { 1, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 536, 0, 1040, 0, 0 }; inline void SPC_DSP::init_counter() { m.counter = 0; } inline void SPC_DSP::run_counters() { if ( --m.counter < 0 ) m.counter = simple_counter_range - 1; } inline unsigned SPC_DSP::read_counter( int rate ) { return ((unsigned) m.counter + counter_offsets [rate]) % counter_rates [rate]; } //// Envelope inline void SPC_DSP::run_envelope( voice_t* const v ) { int env = v->env; if ( v->env_mode == env_release ) // 60% { if ( (env -= 0x8) < 0 ) env = 0; v->env = env; } else { int rate; int env_data = VREG(v->regs,adsr1); if ( m.t_adsr0 & 0x80 ) // 99% ADSR { if ( v->env_mode >= env_decay ) // 99% { env--; env -= env >> 8; rate = env_data & 0x1F; if ( v->env_mode == env_decay ) // 1% rate = (m.t_adsr0 >> 3 & 0x0E) + 0x10; } else // env_attack { rate = (m.t_adsr0 & 0x0F) * 2 + 1; env += rate < 31 ? 0x20 : 0x400; } } else // GAIN { int mode; env_data = VREG(v->regs,gain); mode = env_data >> 5; if ( mode < 4 ) // direct { env = env_data * 0x10; rate = 31; } else { rate = env_data & 0x1F; if ( mode == 4 ) // 4: linear decrease { env -= 0x20; } else if ( mode < 6 ) // 5: exponential decrease { env--; env -= env >> 8; } else // 6,7: linear increase { env += 0x20; if ( mode > 6 && (unsigned) v->hidden_env >= 0x600 ) env += 0x8 - 0x20; // 7: two-slope linear increase } } } // Sustain level if ( (env >> 8) == (env_data >> 5) && v->env_mode == env_decay ) v->env_mode = env_sustain; v->hidden_env = env; // unsigned cast because linear decrease going negative also triggers this if ( (unsigned) env > 0x7FF ) { env = (env < 0 ? 0 : 0x7FF); if ( v->env_mode == env_attack ) v->env_mode = env_decay; } if ( !read_counter( rate ) ) v->env = env; // nothing else is controlled by the counter } } //// BRR Decoding inline void SPC_DSP::decode_brr( voice_t* v ) { // Arrange the four input nybbles in 0xABCD order for easy decoding int nybbles = m.t_brr_byte * 0x100 + m.ram [(v->brr_addr + v->brr_offset + 1) & 0xFFFF]; int const header = m.t_brr_header; // Write to next four samples in circular buffer int* pos = &v->buf [v->buf_pos]; int* end; if ( (v->buf_pos += 4) >= brr_buf_size ) v->buf_pos = 0; // Decode four samples for ( end = pos + 4; pos < end; pos++, nybbles <<= 4 ) { // Extract nybble and sign-extend int s = (int16_t) nybbles >> 12; // Shift sample based on header int const shift = header >> 4; s = (s << shift) >> 1; if ( shift >= 0xD ) // handle invalid range s = (s >> 25) << 11; // same as: s = (s < 0 ? -0x800 : 0) // Apply IIR filter (8 is the most commonly used) int const filter = header & 0x0C; int const p1 = pos [brr_buf_size - 1]; int const p2 = pos [brr_buf_size - 2] >> 1; if ( filter >= 8 ) { s += p1; s -= p2; if ( filter == 8 ) // s += p1 * 0.953125 - p2 * 0.46875 { s += p2 >> 4; s += (p1 * -3) >> 6; } else // s += p1 * 0.8984375 - p2 * 0.40625 { s += (p1 * -13) >> 7; s += (p2 * 3) >> 4; } } else if ( filter ) // s += p1 * 0.46875 { s += p1 >> 1; s += (-p1) >> 5; } // Adjust and write sample CLAMP16( s ); s = (int16_t) (s * 2); pos [brr_buf_size] = pos [0] = s; // second copy simplifies wrap-around } } //// Misc #define MISC_CLOCK( n ) inline void SPC_DSP::misc_##n() MISC_CLOCK( 27 ) { m.t_pmon = REG(pmon) & 0xFE; // voice 0 doesn't support PMON } MISC_CLOCK( 28 ) { m.t_non = REG(non); m.t_eon = REG(eon); m.t_dir = REG(dir); } MISC_CLOCK( 29 ) { if ( (m.every_other_sample ^= 1) != 0 ) m.new_kon &= ~m.kon; // clears KON 63 clocks after it was last read } MISC_CLOCK( 30 ) { if ( m.every_other_sample ) { m.kon = m.new_kon; m.t_koff = REG(koff) | m.mute_mask; } run_counters(); // Noise if ( !read_counter( REG(flg) & 0x1F ) ) { int feedback = (m.noise << 13) ^ (m.noise << 14); m.noise = (feedback & 0x4000) ^ (m.noise >> 1); } } //// Voices #define VOICE_CLOCK( n ) void SPC_DSP::voice_##n( voice_t* const v ) inline VOICE_CLOCK( V1 ) { m.t_dir_addr = m.t_dir * 0x100 + m.t_srcn * 4; m.t_srcn = VREG(v->regs,srcn); } inline VOICE_CLOCK( V2 ) { // Read sample pointer (ignored if not needed) uint8_t const* entry = &m.ram [m.t_dir_addr]; if ( !v->kon_delay ) entry += 2; m.t_brr_next_addr = GET_LE16A( entry ); m.t_adsr0 = VREG(v->regs,adsr0); // Read pitch, spread over two clocks m.t_pitch = VREG(v->regs,pitchl); } inline VOICE_CLOCK( V3a ) { m.t_pitch += (VREG(v->regs,pitchh) & 0x3F) << 8; } inline VOICE_CLOCK( V3b ) { // Read BRR header and byte m.t_brr_byte = m.ram [(v->brr_addr + v->brr_offset) & 0xFFFF]; m.t_brr_header = m.ram [v->brr_addr]; // brr_addr doesn't need masking } VOICE_CLOCK( V3c ) { // Pitch modulation using previous voice's output if ( m.t_pmon & v->vbit ) m.t_pitch += ((m.t_output >> 5) * m.t_pitch) >> 10; if ( v->kon_delay ) { // Get ready to start BRR decoding on next sample if ( v->kon_delay == 5 ) { v->brr_addr = m.t_brr_next_addr; v->brr_offset = 1; v->buf_pos = 0; m.t_brr_header = 0; // header is ignored on this sample m.kon_check = true; } // Envelope is never run during KON v->env = 0; v->hidden_env = 0; // Disable BRR decoding until last three samples v->interp_pos = 0; if ( --v->kon_delay & 3 ) v->interp_pos = 0x4000; // Pitch is never added during KON m.t_pitch = 0; } // Gaussian interpolation { int output = interpolate( v ); // Noise if ( m.t_non & v->vbit ) output = (int16_t) (m.noise * 2); // Apply envelope m.t_output = (output * v->env) >> 11 & ~1; v->t_envx_out = (uint8_t) (v->env >> 4); } // Immediate silence due to end of sample or soft reset if ( REG(flg) & 0x80 || (m.t_brr_header & 3) == 1 ) { v->env_mode = env_release; v->env = 0; } if ( m.every_other_sample ) { // KOFF if ( m.t_koff & v->vbit ) v->env_mode = env_release; // KON if ( m.kon & v->vbit ) { v->kon_delay = 5; v->env_mode = env_attack; } } // Run envelope for next sample if ( !v->kon_delay ) run_envelope( v ); } inline void SPC_DSP::voice_output( voice_t const* v, int ch ) { // Apply left/right volume int amp = (m.t_output * (int8_t) VREG(v->regs,voll + ch)) >> 7; // Add to output total m.t_main_out [ch] += amp; CLAMP16( m.t_main_out [ch] ); // Optionally add to echo total if ( m.t_eon & v->vbit ) { m.t_echo_out [ch] += amp; CLAMP16( m.t_echo_out [ch] ); } } VOICE_CLOCK( V4 ) { // Decode BRR m.t_looped = 0; if ( v->interp_pos >= 0x4000 ) { decode_brr( v ); if ( (v->brr_offset += 2) >= brr_block_size ) { // Start decoding next BRR block assert( v->brr_offset == brr_block_size ); v->brr_addr = (v->brr_addr + brr_block_size) & 0xFFFF; if ( m.t_brr_header & 1 ) { v->brr_addr = m.t_brr_next_addr; m.t_looped = v->vbit; } v->brr_offset = 1; } } // Apply pitch v->interp_pos = (v->interp_pos & 0x3FFF) + m.t_pitch; // Keep from getting too far ahead (when using pitch modulation) if ( v->interp_pos > 0x7FFF ) v->interp_pos = 0x7FFF; // Output left voice_output( v, 0 ); } inline VOICE_CLOCK( V5 ) { // Output right voice_output( v, 1 ); // ENDX, OUTX, and ENVX won't update if you wrote to them 1-2 clocks earlier int endx_buf = REG(endx) | m.t_looped; // Clear bit in ENDX if KON just began if ( v->kon_delay == 5 ) endx_buf &= ~v->vbit; m.endx_buf = (uint8_t) endx_buf; } inline VOICE_CLOCK( V6 ) { (void) v; // avoid compiler warning about unused v m.outx_buf = (uint8_t) (m.t_output >> 8); } inline VOICE_CLOCK( V7 ) { // Update ENDX REG(endx) = m.endx_buf; m.envx_buf = v->t_envx_out; } inline VOICE_CLOCK( V8 ) { // Update OUTX VREG(v->regs,outx) = m.outx_buf; } inline VOICE_CLOCK( V9 ) { // Update ENVX VREG(v->regs,envx) = m.envx_buf; } // Most voices do all these in one clock, so make a handy composite inline VOICE_CLOCK( V3 ) { voice_V3a( v ); voice_V3b( v ); voice_V3c( v ); } // Common combinations of voice steps on different voices. This greatly reduces // code size and allows everything to be inlined in these functions. VOICE_CLOCK(V7_V4_V1) { voice_V7(v); voice_V1(v+3); voice_V4(v+1); } VOICE_CLOCK(V8_V5_V2) { voice_V8(v); voice_V5(v+1); voice_V2(v+2); } VOICE_CLOCK(V9_V6_V3) { voice_V9(v); voice_V6(v+1); voice_V3(v+2); } //// Echo // Current echo buffer pointer for left/right channel #define ECHO_PTR( ch ) (&m.ram [m.t_echo_ptr + ch * 2]) // Sample in echo history buffer, where 0 is the oldest #define ECHO_FIR( i ) (m.echo_hist_pos [i]) // Calculate FIR point for left/right channel #define CALC_FIR( i, ch ) ((ECHO_FIR( i + 1 ) [ch] * (int8_t) REG(fir + i * 0x10)) >> 6) #define ECHO_CLOCK( n ) inline void SPC_DSP::echo_##n() inline void SPC_DSP::echo_read( int ch ) { int s = GET_LE16SA( ECHO_PTR( ch ) ); // second copy simplifies wrap-around handling ECHO_FIR( 0 ) [ch] = ECHO_FIR( 8 ) [ch] = s >> 1; } ECHO_CLOCK( 22 ) { // History if ( ++m.echo_hist_pos >= &m.echo_hist [echo_hist_size] ) m.echo_hist_pos = m.echo_hist; m.t_echo_ptr = (m.t_esa * 0x100 + m.echo_offset) & 0xFFFF; echo_read( 0 ); // FIR (using l and r temporaries below helps compiler optimize) int l = CALC_FIR( 0, 0 ); int r = CALC_FIR( 0, 1 ); m.t_echo_in [0] = l; m.t_echo_in [1] = r; } ECHO_CLOCK( 23 ) { int l = CALC_FIR( 1, 0 ) + CALC_FIR( 2, 0 ); int r = CALC_FIR( 1, 1 ) + CALC_FIR( 2, 1 ); m.t_echo_in [0] += l; m.t_echo_in [1] += r; echo_read( 1 ); } ECHO_CLOCK( 24 ) { int l = CALC_FIR( 3, 0 ) + CALC_FIR( 4, 0 ) + CALC_FIR( 5, 0 ); int r = CALC_FIR( 3, 1 ) + CALC_FIR( 4, 1 ) + CALC_FIR( 5, 1 ); m.t_echo_in [0] += l; m.t_echo_in [1] += r; } ECHO_CLOCK( 25 ) { int l = m.t_echo_in [0] + CALC_FIR( 6, 0 ); int r = m.t_echo_in [1] + CALC_FIR( 6, 1 ); l = (int16_t) l; r = (int16_t) r; l += (int16_t) CALC_FIR( 7, 0 ); r += (int16_t) CALC_FIR( 7, 1 ); CLAMP16( l ); CLAMP16( r ); m.t_echo_in [0] = l & ~1; m.t_echo_in [1] = r & ~1; } inline int SPC_DSP::echo_output( int ch ) { int out = (int16_t) ((m.t_main_out [ch] * (int8_t) REG(mvoll + ch * 0x10)) >> 7) + (int16_t) ((m.t_echo_in [ch] * (int8_t) REG(evoll + ch * 0x10)) >> 7); CLAMP16( out ); return out; } ECHO_CLOCK( 26 ) { // Left output volumes // (save sample for next clock so we can output both together) m.t_main_out [0] = echo_output( 0 ); // Echo feedback int l = m.t_echo_out [0] + (int16_t) ((m.t_echo_in [0] * (int8_t) REG(efb)) >> 7); int r = m.t_echo_out [1] + (int16_t) ((m.t_echo_in [1] * (int8_t) REG(efb)) >> 7); CLAMP16( l ); CLAMP16( r ); m.t_echo_out [0] = l & ~1; m.t_echo_out [1] = r & ~1; } ECHO_CLOCK( 27 ) { // Output int l = m.t_main_out [0]; int r = echo_output( 1 ); m.t_main_out [0] = 0; m.t_main_out [1] = 0; // TODO: global muting isn't this simple (turns DAC on and off // or something, causing small ~37-sample pulse when first muted) if ( REG(flg) & 0x40 ) { l = 0; r = 0; } // Output sample to DAC #ifdef SPC_DSP_OUT_HOOK SPC_DSP_OUT_HOOK( l, r ); #else sample_t* out = m.out; WRITE_SAMPLES( l, r, out ); m.out = out; #endif } ECHO_CLOCK( 28 ) { m.t_echo_enabled = REG(flg); } inline void SPC_DSP::echo_write( int ch ) { if ( !(m.t_echo_enabled & 0x20) ) SET_LE16A( ECHO_PTR( ch ), m.t_echo_out [ch] ); m.t_echo_out [ch] = 0; } ECHO_CLOCK( 29 ) { m.t_esa = REG(esa); if ( !m.echo_offset ) m.echo_length = (REG(edl) & 0x0F) * 0x800; m.echo_offset += 4; if ( m.echo_offset >= m.echo_length ) m.echo_offset = 0; // Write left echo echo_write( 0 ); m.t_echo_enabled = REG(flg); } ECHO_CLOCK( 30 ) { // Write right echo echo_write( 1 ); } //// Timing // Execute clock for a particular voice #define V( clock, voice ) voice_##clock( &m.voices [voice] ); /* The most common sequence of clocks uses composite operations for efficiency. For example, the following are equivalent to the individual steps on the right: V(V7_V4_V1,2) -> V(V7,2) V(V4,3) V(V1,5) V(V8_V5_V2,2) -> V(V8,2) V(V5,3) V(V2,4) V(V9_V6_V3,2) -> V(V9,2) V(V6,3) V(V3,4) */ // Voice 0 1 2 3 4 5 6 7 #define GEN_DSP_TIMING \ PHASE( 0) V(V5,0)V(V2,1)\ PHASE( 1) V(V6,0)V(V3,1)\ PHASE( 2) V(V7_V4_V1,0)\ PHASE( 3) V(V8_V5_V2,0)\ PHASE( 4) V(V9_V6_V3,0)\ PHASE( 5) V(V7_V4_V1,1)\ PHASE( 6) V(V8_V5_V2,1)\ PHASE( 7) V(V9_V6_V3,1)\ PHASE( 8) V(V7_V4_V1,2)\ PHASE( 9) V(V8_V5_V2,2)\ PHASE(10) V(V9_V6_V3,2)\ PHASE(11) V(V7_V4_V1,3)\ PHASE(12) V(V8_V5_V2,3)\ PHASE(13) V(V9_V6_V3,3)\ PHASE(14) V(V7_V4_V1,4)\ PHASE(15) V(V8_V5_V2,4)\ PHASE(16) V(V9_V6_V3,4)\ PHASE(17) V(V1,0) V(V7,5)V(V4,6)\ PHASE(18) V(V8_V5_V2,5)\ PHASE(19) V(V9_V6_V3,5)\ PHASE(20) V(V1,1) V(V7,6)V(V4,7)\ PHASE(21) V(V8,6)V(V5,7) V(V2,0) /* t_brr_next_addr order dependency */\ PHASE(22) V(V3a,0) V(V9,6)V(V6,7) echo_22();\ PHASE(23) V(V7,7) echo_23();\ PHASE(24) V(V8,7) echo_24();\ PHASE(25) V(V3b,0) V(V9,7) echo_25();\ PHASE(26) echo_26();\ PHASE(27) misc_27(); echo_27();\ PHASE(28) misc_28(); echo_28();\ PHASE(29) misc_29(); echo_29();\ PHASE(30) misc_30();V(V3c,0) echo_30();\ PHASE(31) V(V4,0) V(V1,2)\ #if !SPC_DSP_CUSTOM_RUN void SPC_DSP::run( int clocks_remain ) { require( clocks_remain > 0 ); int const phase = m.phase; m.phase = (phase + clocks_remain) & 31; switch ( phase ) { loop: #define PHASE( n ) if ( n && !--clocks_remain ) break; case n: GEN_DSP_TIMING #undef PHASE if ( --clocks_remain ) goto loop; } } #endif //// Setup void SPC_DSP::init( void* ram_64k ) { m.ram = (uint8_t*) ram_64k; mute_voices( 0 ); disable_surround( false ); set_output( 0, 0 ); reset(); #ifndef NDEBUG // be sure this sign-extends assert( (int16_t) 0x8000 == -0x8000 ); // be sure right shift preserves sign assert( (-1 >> 1) == -1 ); // check clamp macro int i; i = +0x8000; CLAMP16( i ); assert( i == +0x7FFF ); i = -0x8001; CLAMP16( i ); assert( i == -0x8000 ); blargg_verify_byte_order(); #endif } void SPC_DSP::soft_reset_common() { require( m.ram ); // init() must have been called already m.noise = 0x4000; m.echo_hist_pos = m.echo_hist; m.every_other_sample = 1; m.echo_offset = 0; m.phase = 0; init_counter(); } void SPC_DSP::soft_reset() { REG(flg) = 0xE0; soft_reset_common(); } void SPC_DSP::load( uint8_t const regs [register_count] ) { memcpy( m.regs, regs, sizeof m.regs ); memset( &m.regs [register_count], 0, offsetof (state_t,ram) - register_count ); // Internal state for ( int i = voice_count; --i >= 0; ) { voice_t* v = &m.voices [i]; v->brr_offset = 1; v->vbit = 1 << i; v->regs = &m.regs [i * 0x10]; } m.new_kon = REG(kon); m.t_dir = REG(dir); m.t_esa = REG(esa); soft_reset_common(); } void SPC_DSP::reset() { load( initial_regs ); } //// State save/load #if !SPC_NO_COPY_STATE_FUNCS void SPC_State_Copier::copy( void* state, size_t size ) { func( buf, state, size ); } int SPC_State_Copier::copy_int( int state, int size ) { BOOST::uint8_t s [2]; SET_LE16( s, state ); func( buf, &s, size ); return GET_LE16( s ); } void SPC_State_Copier::skip( int count ) { if ( count > 0 ) { char temp [64]; memset( temp, 0, sizeof temp ); do { int n = sizeof temp; if ( n > count ) n = count; count -= n; func( buf, temp, n ); } while ( count ); } } void SPC_State_Copier::extra() { int n = 0; SPC_State_Copier& copier = *this; SPC_COPY( uint8_t, n ); skip( n ); } void SPC_DSP::copy_state( unsigned char** io, copy_func_t copy ) { SPC_State_Copier copier( io, copy ); // DSP registers copier.copy( m.regs, register_count ); // Internal state // Voices int i; for ( i = 0; i < voice_count; i++ ) { voice_t* v = &m.voices [i]; // BRR buffer int i; for ( i = 0; i < brr_buf_size; i++ ) { int s = v->buf [i]; SPC_COPY( int16_t, s ); v->buf [i] = v->buf [i + brr_buf_size] = s; } SPC_COPY( uint16_t, v->interp_pos ); SPC_COPY( uint16_t, v->brr_addr ); SPC_COPY( uint16_t, v->env ); SPC_COPY( int16_t, v->hidden_env ); SPC_COPY( uint8_t, v->buf_pos ); SPC_COPY( uint8_t, v->brr_offset ); SPC_COPY( uint8_t, v->kon_delay ); { int m = v->env_mode; SPC_COPY( uint8_t, m ); v->env_mode = (enum env_mode_t) m; } SPC_COPY( uint8_t, v->t_envx_out ); copier.extra(); } // Echo history for ( i = 0; i < echo_hist_size; i++ ) { int j; for ( j = 0; j < 2; j++ ) { int s = m.echo_hist_pos [i] [j]; SPC_COPY( int16_t, s ); m.echo_hist [i] [j] = s; // write back at offset 0 } } m.echo_hist_pos = m.echo_hist; memcpy( &m.echo_hist [echo_hist_size], m.echo_hist, echo_hist_size * sizeof m.echo_hist [0] ); // Misc SPC_COPY( uint8_t, m.every_other_sample ); SPC_COPY( uint8_t, m.kon ); SPC_COPY( uint16_t, m.noise ); SPC_COPY( uint16_t, m.counter ); SPC_COPY( uint16_t, m.echo_offset ); SPC_COPY( uint16_t, m.echo_length ); SPC_COPY( uint8_t, m.phase ); SPC_COPY( uint8_t, m.new_kon ); SPC_COPY( uint8_t, m.endx_buf ); SPC_COPY( uint8_t, m.envx_buf ); SPC_COPY( uint8_t, m.outx_buf ); SPC_COPY( uint8_t, m.t_pmon ); SPC_COPY( uint8_t, m.t_non ); SPC_COPY( uint8_t, m.t_eon ); SPC_COPY( uint8_t, m.t_dir ); SPC_COPY( uint8_t, m.t_koff ); SPC_COPY( uint16_t, m.t_brr_next_addr ); SPC_COPY( uint8_t, m.t_adsr0 ); SPC_COPY( uint8_t, m.t_brr_header ); SPC_COPY( uint8_t, m.t_brr_byte ); SPC_COPY( uint8_t, m.t_srcn ); SPC_COPY( uint8_t, m.t_esa ); SPC_COPY( uint8_t, m.t_echo_enabled ); SPC_COPY( int16_t, m.t_main_out [0] ); SPC_COPY( int16_t, m.t_main_out [1] ); SPC_COPY( int16_t, m.t_echo_out [0] ); SPC_COPY( int16_t, m.t_echo_out [1] ); SPC_COPY( int16_t, m.t_echo_in [0] ); SPC_COPY( int16_t, m.t_echo_in [1] ); SPC_COPY( uint16_t, m.t_dir_addr ); SPC_COPY( uint16_t, m.t_pitch ); SPC_COPY( int16_t, m.t_output ); SPC_COPY( uint16_t, m.t_echo_ptr ); SPC_COPY( uint8_t, m.t_looped ); copier.extra(); } #endif phoenix/reference/font.hpp000664 001750 001750 00000000367 12651764221 017005 0ustar00sergiosergio000000 000000 namespace phoenix { struct pFont { static string serif(unsigned size, string style); static string sans(unsigned size, string style); static string monospace(unsigned size, string style); static Size size(string font, string text); }; } sfc/chip/bsx/000700 001750 001750 00000000000 12656700342 014165 5ustar00sergiosergio000000 000000 sfc/ppu/ppu.hpp000664 001750 001750 00000002646 12651764221 014614 0ustar00sergiosergio000000 000000 struct PPU : Thread, public PPUcounter { uint8 vram[64 * 1024]; uint8 oam[544]; uint8 cgram[512]; enum : bool { Threaded = true }; alwaysinline void step(unsigned clocks); alwaysinline void synchronize_cpu(); void latch_counters(); bool interlace() const; bool overscan() const; bool hires() const; void enter(); void enable(); void power(); void reset(); void serialize(serializer&); PPU(); ~PPU(); privileged: unsigned ppu1_version = 1; //allowed: 1 unsigned ppu2_version = 3; //allowed: 1, 2, 3 uint32* surface; uint32* output; struct { bool interlace; bool overscan; } display; #include "background/background.hpp" #include "mmio/mmio.hpp" #include "screen/screen.hpp" #include "sprite/sprite.hpp" #include "window/window.hpp" Background bg1; Background bg2; Background bg3; Background bg4; Sprite sprite; Window window; Screen screen; static void Enter(); void add_clocks(unsigned); void scanline(); void frame(); friend class PPU::Background; friend class PPU::Sprite; friend class PPU::Window; friend class PPU::Screen; friend class Video; struct Debugger { hook vram_read; hook oam_read; hook cgram_read; hook vram_write; hook oam_write; hook cgram_write; } debugger; }; extern PPU ppu; gb/cartridge/mmm01/000700 001750 001750 00000000000 12656700342 015156 5ustar00sergiosergio000000 000000 nall/dsp/resample/lib/sinc.hpp000664 001750 001750 00000043675 12651764221 017466 0ustar00sergiosergio000000 000000 // If these types are changed to anything other than "float", you should comment out the SSE detection directives below // so that the SSE code is not used. typedef float resample_coeff_t; // note: sizeof(resample_coeff_t) must be == to a power of 2, and not larger than 16 typedef float resample_samp_t; // ...but don't comment this single RESAMPLE_SSEREGPARM define out when disabling SSE. #define RESAMPLE_SSEREGPARM #if defined(__SSE__) #define SINCRESAMPLE_USE_SSE 1 #ifndef __x86_64__ // clang may not have this extension (Apple's certainly doesn't) #ifndef __clang__ #undef RESAMPLE_SSEREGPARM #define RESAMPLE_SSEREGPARM __attribute__((sseregparm)) #endif #endif #else // TODO: altivec here #endif namespace ResampleUtility { inline void kaiser_window(double* io, int count, double beta); inline void gen_sinc(double* out, int size, double cutoff, double kaiser); inline void gen_sinc_os(double* out, int size, double cutoff, double kaiser); inline void normalize(double* io, int size, double gain = 1.0); inline void* make_aligned(void* ptr, unsigned boundary); // boundary must be a power of 2 } class SincResampleHR { private: inline void Init(unsigned ratio_arg, double desired_bandwidth, double beta, double d); inline void write(resample_samp_t sample) RESAMPLE_SSEREGPARM; inline resample_samp_t read(void) RESAMPLE_SSEREGPARM; inline bool output_avail(void); private: inline resample_samp_t mac(const resample_samp_t *wave, const resample_coeff_t *coeff, unsigned count); unsigned ratio; unsigned num_convolutions; resample_coeff_t *coeffs; std::vector coeffs_mem; // second half of ringbuffer should be copy of first half. resample_samp_t *rb; std::vector rb_mem; signed rb_readpos; signed rb_writepos; signed rb_in; signed rb_eff_size; friend class SincResample; }; class SincResample { public: enum { QUALITY_LOW = 0, QUALITY_MEDIUM = 2, QUALITY_HIGH = 4 }; inline SincResample(double input_rate, double output_rate, double desired_bandwidth, unsigned quality = QUALITY_HIGH); inline void write(resample_samp_t sample) RESAMPLE_SSEREGPARM; inline resample_samp_t read(void) RESAMPLE_SSEREGPARM; inline bool output_avail(void); private: inline void Init(double input_rate, double output_rate, double desired_bandwidth, double beta, double d, unsigned pn_nume, unsigned phases_min); inline resample_samp_t mac(const resample_samp_t *wave, const resample_coeff_t *coeffs_a, const resample_coeff_t *coeffs_b, const double ffract, unsigned count) RESAMPLE_SSEREGPARM; unsigned num_convolutions; unsigned num_phases; unsigned step_int; double step_fract; double input_pos_fract; std::vector coeffs; // Pointers into coeff_mem. std::vector coeff_mem; std::vector rb; // second half should be copy of first half. signed rb_readpos; signed rb_writepos; signed rb_in; bool hr_used; SincResampleHR hr; }; // // Code: // //#include "resample.hpp" #if 0 namespace bit { inline unsigned round(unsigned x) { if((x & (x - 1)) == 0) return x; while(x & (x - 1)) x &= x - 1; return x << 1; } } #endif void SincResampleHR::Init(unsigned ratio_arg, double desired_bandwidth, double beta, double d) { const unsigned align_boundary = 16; std::vector coeffs_tmp; double cutoff; // 1.0 = f/2 ratio = ratio_arg; //num_convolutions = ((unsigned)ceil(d / ((1.0 - desired_bandwidth) / ratio)) + 1) &~ 1; // round up to be even num_convolutions = ((unsigned)ceil(d / ((1.0 - desired_bandwidth) / ratio)) | 1); cutoff = (1.0 / ratio) - (d / num_convolutions); //printf("%d %d %.20f\n", ratio, num_convolutions, cutoff); assert(num_convolutions > ratio); // Generate windowed sinc of POWER coeffs_tmp.resize(num_convolutions); //ResampleUtility::gen_sinc(&coeffs_tmp[0], num_convolutions, cutoff, beta); ResampleUtility::gen_sinc_os(&coeffs_tmp[0], num_convolutions, cutoff, beta); ResampleUtility::normalize(&coeffs_tmp[0], num_convolutions); // Copy from coeffs_tmp to coeffs~ // We multiply many coefficients at a time in the mac loop, so make sure the last few that don't really // exist are allocated, zero'd mem. coeffs_mem.resize(((num_convolutions + 7) &~ 7) * sizeof(resample_coeff_t) + (align_boundary - 1)); coeffs = (resample_coeff_t *)ResampleUtility::make_aligned(&coeffs_mem[0], align_boundary); for(unsigned i = 0; i < num_convolutions; i++) coeffs[i] = coeffs_tmp[i]; rb_eff_size = nall::bit::round(num_convolutions * 2) >> 1; rb_readpos = 0; rb_writepos = 0; rb_in = 0; rb_mem.resize(rb_eff_size * 2 * sizeof(resample_samp_t) + (align_boundary - 1)); rb = (resample_samp_t *)ResampleUtility::make_aligned(&rb_mem[0], align_boundary); } inline bool SincResampleHR::output_avail(void) { return(rb_in >= (signed)num_convolutions); } inline void SincResampleHR::write(resample_samp_t sample) { assert(!output_avail()); rb[rb_writepos] = sample; rb[rb_writepos + rb_eff_size] = sample; rb_writepos = (rb_writepos + 1) & (rb_eff_size - 1); rb_in++; } resample_samp_t SincResampleHR::mac(const resample_samp_t *wave, const resample_coeff_t *coeff, unsigned count) { #if SINCRESAMPLE_USE_SSE __m128 accum_veca[2] = { _mm_set1_ps(0), _mm_set1_ps(0) }; resample_samp_t accum; for(unsigned c = 0; c < count; c += 8) { for(unsigned i = 0; i < 2; i++) { __m128 co[2]; __m128 w[2]; co[i] = _mm_load_ps(&coeff[c + i * 4]); w[i] = _mm_load_ps(&wave[c + i * 4]); w[i] = _mm_mul_ps(w[i], co[i]); accum_veca[i] = _mm_add_ps(w[i], accum_veca[i]); } } __m128 accum_vec = _mm_add_ps(accum_veca[0], accum_veca[1]); //_mm_add_ps(_mm_add_ps(accum_veca[0], accum_veca[1]), _mm_add_ps(accum_veca[2], accum_veca[3])); accum_vec = _mm_add_ps(accum_vec, _mm_shuffle_ps(accum_vec, accum_vec, (3 << 0) | (2 << 2) | (1 << 4) | (0 << 6))); accum_vec = _mm_add_ps(accum_vec, _mm_shuffle_ps(accum_vec, accum_vec, (1 << 0) | (0 << 2) | (1 << 4) | (0 << 6))); _mm_store_ss(&accum, accum_vec); return accum; #else resample_samp_t accum[4] = { 0, 0, 0, 0 }; for(unsigned c = 0; c < count; c+= 4) { accum[0] += wave[c + 0] * coeff[c + 0]; accum[1] += wave[c + 1] * coeff[c + 1]; accum[2] += wave[c + 2] * coeff[c + 2]; accum[3] += wave[c + 3] * coeff[c + 3]; } return (accum[0] + accum[1]) + (accum[2] + accum[3]); // don't mess with parentheses(assuming compiler doesn't already, which it may... #endif } resample_samp_t SincResampleHR::read(void) { assert(output_avail()); resample_samp_t ret; ret = mac(&rb[rb_readpos], &coeffs[0], num_convolutions); rb_readpos = (rb_readpos + ratio) & (rb_eff_size - 1); rb_in -= ratio; return ret; } SincResample::SincResample(double input_rate, double output_rate, double desired_bandwidth, unsigned quality) { const struct { double beta; double d; unsigned pn_nume; unsigned phases_min; } qtab[5] = { { 5.658, 3.62, 4096, 4 }, { 6.764, 4.32, 8192, 4 }, { 7.865, 5.0, 16384, 8 }, { 8.960, 5.7, 32768, 16 }, { 10.056, 6.4, 65536, 32 } }; // Sanity checks assert(ceil(input_rate) > 0); assert(ceil(output_rate) > 0); assert(ceil(input_rate / output_rate) <= 1024); assert(ceil(output_rate / input_rate) <= 1024); // The simplistic number-of-phases calculation code doesn't work well enough for when desired_bandwidth is close to 1.0 and when // upsampling. assert(desired_bandwidth >= 0.25 && desired_bandwidth < 0.96); assert(quality >= 0 && quality <= 4); hr_used = false; #if 1 // Round down to the nearest multiple of 4(so wave buffer remains aligned) // It also adjusts the effective intermediate sampling rate up slightly, so that the upper frequencies below f/2 // aren't overly attenuated so much. In the future, we might want to do an FFT or something to choose the intermediate rate more accurately // to virtually eliminate over-attenuation. unsigned ioratio_rd = (unsigned)floor(input_rate / (output_rate * (1.0 + (1.0 - desired_bandwidth) / 2) )) & ~3; if(ioratio_rd >= 8) { hr.Init(ioratio_rd, desired_bandwidth, qtab[quality].beta, qtab[quality].d); //10.056, 6.4); hr_used = true; input_rate /= ioratio_rd; } #endif Init(input_rate, output_rate, desired_bandwidth, qtab[quality].beta, qtab[quality].d, qtab[quality].pn_nume, qtab[quality].phases_min); } void SincResample::Init(double input_rate, double output_rate, double desired_bandwidth, double beta, double d, unsigned pn_nume, unsigned phases_min) { const unsigned max_mult_atatime = 8; // multiply "granularity". must be power of 2. const unsigned max_mult_minus1 = (max_mult_atatime - 1); const unsigned conv_alignment_bytes = 16; // must be power of 2 const double input_to_output_ratio = input_rate / output_rate; const double output_to_input_ratio = output_rate / input_rate; double cutoff; // 1.0 = input_rate / 2 std::vector coeff_init_buffer; // Round up num_convolutions to be even. if(output_rate > input_rate) num_convolutions = ((unsigned)ceil(d / (1.0 - desired_bandwidth)) + 1) & ~1; else num_convolutions = ((unsigned)ceil(d / (output_to_input_ratio * (1.0 - desired_bandwidth))) + 1) & ~1; if(output_rate > input_rate) // Upsampling cutoff = desired_bandwidth; else // Downsampling cutoff = output_to_input_ratio * desired_bandwidth; // Round up to be even. num_phases = (std::max(pn_nume / num_convolutions, phases_min) + 1) &~1; // Adjust cutoff to account for the multiple phases. cutoff = cutoff / num_phases; assert((num_convolutions & 1) == 0); assert((num_phases & 1) == 0); // fprintf(stderr, "num_convolutions=%u, num_phases=%u, total expected coeff byte size=%lu\n", num_convolutions, num_phases, // (long)((num_phases + 2) * ((num_convolutions + max_mult_minus1) & ~max_mult_minus1) * sizeof(float) + conv_alignment_bytes)); coeff_init_buffer.resize(num_phases * num_convolutions); coeffs.resize(num_phases + 1 + 1); coeff_mem.resize((num_phases + 1 + 1) * ((num_convolutions + max_mult_minus1) &~ max_mult_minus1) * sizeof(resample_coeff_t) + conv_alignment_bytes); // Assign aligned pointers into coeff_mem { resample_coeff_t *base_ptr = (resample_coeff_t *)ResampleUtility::make_aligned(&coeff_mem[0], conv_alignment_bytes); for(unsigned phase = 0; phase < (num_phases + 1 + 1); phase++) { coeffs[phase] = base_ptr + (((num_convolutions + max_mult_minus1) & ~max_mult_minus1) * phase); } } ResampleUtility::gen_sinc(&coeff_init_buffer[0], num_phases * num_convolutions, cutoff, beta); ResampleUtility::normalize(&coeff_init_buffer[0], num_phases * num_convolutions, num_phases); // Reorder coefficients to allow for more efficient convolution. for(int phase = -1; phase < ((int)num_phases + 1); phase++) { for(int conv = 0; conv < (int)num_convolutions; conv++) { double coeff; if(phase == -1 && conv == 0) coeff = 0; else if(phase == (int)num_phases && conv == ((int)num_convolutions - 1)) coeff = 0; else coeff = coeff_init_buffer[conv * num_phases + phase]; coeffs[phase + 1][conv] = coeff; } } // Free a bit of mem coeff_init_buffer.resize(0); step_int = floor(input_to_output_ratio); step_fract = input_to_output_ratio - step_int; input_pos_fract = 0; // Do NOT use rb.size() later in the code, since it'll include the padding. // We should only need one "max_mult_minus1" here, not two, since it won't matter if it over-reads(due to doing "max_mult_atatime" multiplications at a time // rather than just 1, in which case this over-read wouldn't happen), from the first half into the duplicated half, // since those corresponding coefficients will be zero anyway; this is just to handle the case of reading off the end of the duplicated half to // prevent illegal memory accesses. rb.resize(num_convolutions * 2 + max_mult_minus1); rb_readpos = 0; rb_writepos = 0; rb_in = 0; } resample_samp_t SincResample::mac(const resample_samp_t *wave, const resample_coeff_t *coeffs_a, const resample_coeff_t *coeffs_b, const double ffract, unsigned count) { resample_samp_t accum = 0; #if SINCRESAMPLE_USE_SSE __m128 accum_vec_a[2] = { _mm_set1_ps(0), _mm_set1_ps(0) }; __m128 accum_vec_b[2] = { _mm_set1_ps(0), _mm_set1_ps(0) }; for(unsigned c = 0; c < count; c += 8) //8) //4) { __m128 coeff_a[2]; __m128 coeff_b[2]; __m128 w[2]; __m128 result_a[2], result_b[2]; for(unsigned i = 0; i < 2; i++) { coeff_a[i] = _mm_load_ps(&coeffs_a[c + (i * 4)]); coeff_b[i] = _mm_load_ps(&coeffs_b[c + (i * 4)]); w[i] = _mm_loadu_ps(&wave[c + (i * 4)]); result_a[i] = _mm_mul_ps(coeff_a[i], w[i]); result_b[i] = _mm_mul_ps(coeff_b[i], w[i]); accum_vec_a[i] = _mm_add_ps(result_a[i], accum_vec_a[i]); accum_vec_b[i] = _mm_add_ps(result_b[i], accum_vec_b[i]); } } __m128 accum_vec, av_a, av_b; __m128 mult_a_vec = _mm_set1_ps(1.0 - ffract); __m128 mult_b_vec = _mm_set1_ps(ffract); av_a = _mm_mul_ps(mult_a_vec, /*accum_vec_a[0]);*/ _mm_add_ps(accum_vec_a[0], accum_vec_a[1])); av_b = _mm_mul_ps(mult_b_vec, /*accum_vec_b[0]);*/ _mm_add_ps(accum_vec_b[0], accum_vec_b[1])); accum_vec = _mm_add_ps(av_a, av_b); accum_vec = _mm_add_ps(accum_vec, _mm_shuffle_ps(accum_vec, accum_vec, (3 << 0) | (2 << 2) | (1 << 4) | (0 << 6))); accum_vec = _mm_add_ps(accum_vec, _mm_shuffle_ps(accum_vec, accum_vec, (1 << 0) | (0 << 2) | (1 << 4) | (0 << 6))); _mm_store_ss(&accum, accum_vec); #else resample_coeff_t mult_a = 1.0 - ffract; resample_coeff_t mult_b = ffract; for(unsigned c = 0; c < count; c += 4) { accum += wave[c + 0] * (coeffs_a[c + 0] * mult_a + coeffs_b[c + 0] * mult_b); accum += wave[c + 1] * (coeffs_a[c + 1] * mult_a + coeffs_b[c + 1] * mult_b); accum += wave[c + 2] * (coeffs_a[c + 2] * mult_a + coeffs_b[c + 2] * mult_b); accum += wave[c + 3] * (coeffs_a[c + 3] * mult_a + coeffs_b[c + 3] * mult_b); } #endif return accum; } inline bool SincResample::output_avail(void) { return(rb_in >= (int)num_convolutions); } resample_samp_t SincResample::read(void) { assert(output_avail()); double phase = input_pos_fract * num_phases - 0.5; signed phase_int = (signed)floor(phase); double phase_fract = phase - phase_int; unsigned phase_a = num_phases - 1 - phase_int; unsigned phase_b = phase_a - 1; resample_samp_t ret; ret = mac(&rb[rb_readpos], &coeffs[phase_a + 1][0], &coeffs[phase_b + 1][0], phase_fract, num_convolutions); unsigned int_increment = step_int; input_pos_fract += step_fract; int_increment += floor(input_pos_fract); input_pos_fract -= floor(input_pos_fract); rb_readpos = (rb_readpos + int_increment) % num_convolutions; rb_in -= int_increment; return ret; } inline void SincResample::write(resample_samp_t sample) { assert(!output_avail()); if(hr_used) { hr.write(sample); if(hr.output_avail()) { sample = hr.read(); } else { return; } } rb[rb_writepos + 0 * num_convolutions] = sample; rb[rb_writepos + 1 * num_convolutions] = sample; rb_writepos = (rb_writepos + 1) % num_convolutions; rb_in++; } void ResampleUtility::kaiser_window( double* io, int count, double beta) { int const accuracy = 24; //16; //12; double* end = io + count; double beta2 = beta * beta * (double) -0.25; double to_fract = beta2 / ((double) count * count); double i = 0; double rescale = 0; // Doesn't need an initializer, to shut up gcc for ( ; io < end; ++io, i += 1 ) { double x = i * i * to_fract - beta2; double u = x; double k = x + 1; double n = 2; do { u *= x / (n * n); n += 1; k += u; } while ( k <= u * (1 << accuracy) ); if ( !i ) rescale = 1 / k; // otherwise values get large *io *= k * rescale; } } void ResampleUtility::gen_sinc(double* out, int size, double cutoff, double kaiser) { assert( size % 2 == 0 ); // size must be even int const half_size = size / 2; double* const mid = &out [half_size]; // Generate right half of sinc for ( int i = 0; i < half_size; i++ ) { double angle = (i * 2 + 1) * (Math::Pi / 2); mid [i] = sin( angle * cutoff ) / angle; } kaiser_window( mid, half_size, kaiser ); // Mirror for left half for ( int i = 0; i < half_size; i++ ) out [i] = mid [half_size - 1 - i]; } void ResampleUtility::gen_sinc_os(double* out, int size, double cutoff, double kaiser) { assert( size % 2 == 1); // size must be odd for(int i = 0; i < size; i++) { if(i == (size / 2)) out[i] = 2 * Math::Pi * (cutoff / 2); //0.078478; //1.0; //sin(2 * M_PI * (cutoff / 2) * (i - size / 2)) / (i - (size / 2)); else out[i] = sin(2 * Math::Pi * (cutoff / 2) * (i - size / 2)) / (i - (size / 2)); // out[i] *= 0.3635819 - 0.4891775 * cos(2 * M_PI * i / (size - 1)) + 0.1365995 * cos(4 * M_PI * i / (size - 1)) - 0.0106411 * cos(6 * M_PI * i / (size - 1)); //0.42 - 0.5 * cos(2 * M_PI * i / (size - 1)) + 0.08 * cos(4 * M_PI * i / (size - 1)); // printf("%d %f\n", i, out[i]); } kaiser_window(&out[size / 2], size / 2 + 1, kaiser); // Mirror for left half for ( int i = 0; i < size / 2; i++ ) out [i] = out [size - 1 - i]; } void ResampleUtility::normalize(double* io, int size, double gain) { double sum = 0; for ( int i = 0; i < size; i++ ) sum += io [i]; double scale = gain / sum; for ( int i = 0; i < size; i++ ) io [i] *= scale; } void* ResampleUtility::make_aligned(void* ptr, unsigned boundary) { unsigned char* null_ptr = (unsigned char *)nullptr; unsigned char* uc_ptr = (unsigned char *)ptr; uc_ptr += (boundary - ((uc_ptr - null_ptr) & (boundary - 1))) & (boundary - 1); //while((uc_ptr - null_ptr) & (boundary - 1)) // uc_ptr++; //printf("%16llx %16llx\n", (unsigned long long)ptr, (unsigned long long)uc_ptr); assert((uc_ptr - (unsigned char *)ptr) < boundary && (uc_ptr >= (unsigned char *)ptr)); return uc_ptr; } ruby/input/windows.cpp000664 001750 001750 00000005333 12651764221 016232 0ustar00sergiosergio000000 000000 #include #define DIRECTINPUT_VERSION 0x0800 #include #include "shared/rawinput.cpp" #include "keyboard/rawinput.cpp" #include "mouse/rawinput.cpp" #include "joypad/xinput.cpp" #include "joypad/directinput.cpp" namespace ruby { struct pInputWindows { InputKeyboardRawInput rawinputKeyboard; InputMouseRawInput rawinputMouse; InputJoypadXInput xinput; InputJoypadDirectInput directinput; LPDIRECTINPUT8 directinputContext = nullptr; struct Settings { uintptr_t handle = 0; } settings; bool cap(const string& name) { if(name == Input::Handle) return true; if(name == Input::KeyboardSupport) return true; if(name == Input::MouseSupport) return true; if(name == Input::JoypadSupport) return true; if(name == Input::JoypadRumbleSupport) return true; return false; } any get(const string& name) { if(name == Input::Handle) return (uintptr_t)settings.handle; return false; } bool set(const string& name, const any& value) { if(name == Input::Handle) { settings.handle = any_cast(value); return true; } return false; } bool acquire() { return rawinputMouse.acquire(); } bool unacquire() { return rawinputMouse.unacquire(); } bool acquired() { return rawinputMouse.acquired(); } vector poll() { vector devices; rawinputKeyboard.poll(devices); rawinputMouse.poll(devices); xinput.poll(devices); directinput.poll(devices); return devices; } bool rumble(uint64_t id, bool enable) { if(xinput.rumble(id, enable)) return true; if(directinput.rumble(id, enable)) return true; return false; } bool init() { if(rawinput.initialized == false) { rawinput.initialized = true; rawinput.mutex = CreateMutex(NULL, FALSE, NULL); CreateThread(NULL, 0, RawInputThreadProc, 0, 0, NULL); do { Sleep(1); WaitForSingleObject(rawinput.mutex, INFINITE); ReleaseMutex(rawinput.mutex); } while(rawinput.ready == false); } DirectInput8Create(GetModuleHandle(0), DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&directinputContext, 0); if(directinputContext == nullptr) return false; if(rawinputKeyboard.init() == false) return false; if(rawinputMouse.init(settings.handle) == false) return false; bool xinputAvailable = xinput.init(); if(directinput.init(settings.handle, directinputContext, xinputAvailable) == false) return false; return true; } void term() { rawinputKeyboard.term(); rawinputMouse.term(); xinput.term(); directinput.term(); if(directinputContext) { directinputContext->Release(); directinputContext = nullptr; } } }; DeclareInput(Windows) } sfc/ppu/background/background.hpp000664 001750 001750 00000003210 12651764221 020232 0ustar00sergiosergio000000 000000 struct Background { struct ID { enum { BG1, BG2, BG3, BG4 }; }; unsigned id; struct Mode { enum { BPP2, BPP4, BPP8, Mode7, Inactive }; }; struct ScreenSize { enum { Size32x32, Size32x64, Size64x32, Size64x64 }; }; struct TileSize { enum { Size8x8, Size16x16 }; }; struct Screen { enum { Main, Sub }; }; struct Regs { uint16 tiledata_addr; uint16 screen_addr; uint2 screen_size; uint4 mosaic; bool tile_size; unsigned mode; unsigned priority0; unsigned priority1; bool main_enable; bool sub_enable; uint16 hoffset; uint16 voffset; } regs; struct Cache { uint16 hoffset; uint16 voffset; } cache; unsigned voffset() const; unsigned hoffset() const; struct Output { struct Pixel { unsigned priority; //0 = none (transparent) uint8 palette; uint16 tile; } main, sub; } output; struct Mosaic : Output::Pixel { unsigned vcounter; unsigned voffset; unsigned hcounter; unsigned hoffset; } mosaic; struct { signed x; signed y; unsigned tile_counter; unsigned tile; unsigned priority; unsigned palette_number; unsigned palette_index; uint8 data[8]; }; inline void frame(); inline void scanline(); inline void begin(); inline void run(bool screen); inline void reset(); inline void get_tile(); inline unsigned get_tile_color(); inline unsigned get_tile(unsigned x, unsigned y); inline signed clip(signed n); inline void begin_mode7(); inline void run_mode7(); inline void serialize(serializer&); inline Background(PPU& self, unsigned id); PPU& self; friend class PPU; }; sfc/chip/sdd1/sdd1.cpp000664 001750 001750 00000011756 12651764221 015612 0ustar00sergiosergio000000 000000 #include #define SDD1_CPP namespace SuperFamicom { SDD1 sdd1; #include "decomp.cpp" #include "serialization.cpp" void SDD1::init() { } void SDD1::load() { //hook S-CPU DMA MMIO registers to gather information for struct dma[]; //buffer address and transfer size information for use in SDD1::mcu_read() bus.map({&SDD1::read, &sdd1}, {&SDD1::write, &sdd1}, 0x00, 0x3f, 0x4300, 0x437f); bus.map({&SDD1::read, &sdd1}, {&SDD1::write, &sdd1}, 0x80, 0xbf, 0x4300, 0x437f); } void SDD1::unload() { rom.reset(); ram.reset(); } void SDD1::power() { } void SDD1::reset() { sdd1_enable = 0x00; xfer_enable = 0x00; dma_ready = false; mmc[0] = 0 << 20; mmc[1] = 1 << 20; mmc[2] = 2 << 20; mmc[3] = 3 << 20; for(unsigned i = 0; i < 8; i++) { dma[i].addr = 0; dma[i].size = 0; } } uint8 SDD1::read(unsigned addr) { addr &= 0xffff; if((addr & 0x4380) == 0x4300) { return cpu.mmio_read(addr); } switch(addr) { case 0x4804: return mmc[0] >> 20; case 0x4805: return mmc[1] >> 20; case 0x4806: return mmc[2] >> 20; case 0x4807: return mmc[3] >> 20; } return cpu.regs.mdr; } void SDD1::write(unsigned addr, uint8 data) { addr &= 0xffff; if((addr & 0x4380) == 0x4300) { unsigned channel = (addr >> 4) & 7; switch(addr & 15) { case 2: dma[channel].addr = (dma[channel].addr & 0xffff00) + (data << 0); break; case 3: dma[channel].addr = (dma[channel].addr & 0xff00ff) + (data << 8); break; case 4: dma[channel].addr = (dma[channel].addr & 0x00ffff) + (data << 16); break; case 5: dma[channel].size = (dma[channel].size & 0xff00) + (data << 0); break; case 6: dma[channel].size = (dma[channel].size & 0x00ff) + (data << 8); break; } return cpu.mmio_write(addr, data); } switch(addr) { case 0x4800: sdd1_enable = data; break; case 0x4801: xfer_enable = data; break; case 0x4804: mmc[0] = data << 20; break; case 0x4805: mmc[1] = data << 20; break; case 0x4806: mmc[2] = data << 20; break; case 0x4807: mmc[3] = data << 20; break; } } uint8 SDD1::mmc_read(unsigned addr) { return rom.read(mmc[(addr >> 20) & 3] + (addr & 0x0fffff)); } //SDD1::mcu_read() is mapped to $c0-ff:0000-ffff //the design is meant to be as close to the hardware design as possible, thus this code //avoids adding S-DD1 hooks inside S-CPU::DMA emulation. // //the real S-DD1 cannot see $420b (DMA enable) writes, as they are not placed on the bus. //however, $43x0-$43xf writes (DMAx channel settings) most likely do appear on the bus. //the S-DD1 also requires fixed addresses for transfers, which wouldn't be necessary if //it could see $420b writes (eg it would know when the transfer should begin.) // //the hardware needs a way to distinguish program code after $4801 writes from DMA //decompression that follows soon after. // //the only plausible design for hardware would be for the S-DD1 to spy on DMAx settings, //and begin spooling decompression on writes to $4801 that activate a channel. after that, //it feeds decompressed data only when the ROM read address matches the DMA channel address. // //the actual S-DD1 transfer can occur on any channel, but it is most likely limited to //one transfer per $420b write (for spooling purposes). however, this is not known for certain. uint8 SDD1::mcurom_read(unsigned addr) { if(addr < 0x400000) { //(addr & 0x408000) == 0x008000) { //$00-3f|80-bf:8000-ffff return rom.read(addr); //addr = ((addr & 0x7f0000) >> 1) | (addr & 0x7fff); //return rom.read(addr); } //$40-7f|c0-ff:0000-ffff (MMC) if(sdd1_enable & xfer_enable) { //at least one channel has S-DD1 decompression enabled ... for(unsigned i = 0; i < 8; i++) { if(sdd1_enable & xfer_enable & (1 << i)) { //S-DD1 always uses fixed transfer mode, so address will not change during transfer if(addr == dma[i].addr) { if(!dma_ready) { //prepare streaming decompression decomp.init(addr); dma_ready = true; } //fetch a decompressed byte; once finished, disable channel and invalidate buffer uint8 data = decomp.read(); if(--dma[i].size == 0) { dma_ready = false; xfer_enable &= ~(1 << i); } return data; } //address matched } //channel enabled } //channel loop } //S-DD1 decompressor enabled //S-DD1 decompression mode inactive; return ROM data return mmc_read(addr); } void SDD1::mcurom_write(unsigned addr, uint8 data) { } uint8 SDD1::mcuram_read(unsigned addr) { if((addr & 0x60e000) == 0x006000) { //$00-3f|80-bf:6000-7fff return ram.read(addr & 0x1fff); } if((addr & 0xf08000) == 0x700000) { //$70-7f:0000-7fff return ram.read(addr & 0x1fff); } return cpu.regs.mdr; } void SDD1::mcuram_write(unsigned addr, uint8 data) { if((addr & 0x60e000) == 0x006000) { //$00-3f|80-bf:6000-7fff return ram.write(addr & 0x1fff, data); } if((addr & 0xf08000) == 0x700000) { //$70-7f:0000-7fff return ram.write(addr & 0x1fff, data); } } } phoenix/windows/widget/widget.cpp000664 001750 001750 00000004340 12651764221 020327 0ustar00sergiosergio000000 000000 namespace phoenix { bool pWidget::focused() { return GetFocus() == hwnd; } Size pWidget::minimumSize() { return {0, 0}; } void pWidget::setEnabled(bool enabled) { if(!widget.parent()) enabled = false; if(widget.state.abstract) enabled = false; if(!widget.enabledToAll()) enabled = false; EnableWindow(hwnd, enabled); } void pWidget::setFocused() { SetFocus(hwnd); } void pWidget::setFont(string font) { if(hfont) DeleteObject(hfont); hfont = pFont::create(font); SendMessage(hwnd, WM_SETFONT, (WPARAM)hfont, 0); } void pWidget::setGeometry(Geometry geometry) { if(GetParentWidget(&sizable)) { Position displacement = GetParentWidget(&sizable)->state.geometry.position(); geometry.x -= displacement.x; geometry.y -= displacement.y; } SetWindowPos(hwnd, NULL, geometry.x, geometry.y, geometry.width, geometry.height, SWP_NOZORDER); if(widget.onSize) widget.onSize(); } void pWidget::setVisible(bool visible) { if(!widget.parent()) visible = false; if(widget.state.abstract) visible = false; if(!widget.visibleToAll()) visible = false; ShowWindow(hwnd, visible ? SW_SHOWNORMAL : SW_HIDE); } void pWidget::constructor() { hfont = pFont::create(Font::sans(8)); if(widget.state.abstract) { hwnd = CreateWindow(L"phoenix_label", L"", WS_CHILD, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&widget); } } void pWidget::destructor() { if(widget.state.abstract) { DestroyWindow(hwnd); } } void pWidget::orphan() { destructor(); constructor(); } void pWidget::setDefaultFont() { string description = widget.state.font; if(description.empty()) description = Font::sans(8); hfont = pFont::create(description); SendMessage(hwnd, WM_SETFONT, (WPARAM)hfont, 0); } //calling Widget::setParent destroys widget and re-creates it: //need to re-apply visiblity and enabled status; called by each subclassed setParent() function //constructors are called top-down, so set each widget to the top of the z-order (so children appear on top of parents) void pWidget::synchronize() { widget.setEnabled(widget.enabled()); widget.setVisible(widget.visible()); SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); } } phoenix/cocoa/action/menu.hpp000664 001750 001750 00000000746 12651764221 017407 0ustar00sergiosergio000000 000000 @interface CocoaMenu : NSMenuItem { @public phoenix::Menu* menu; NSMenu* cocoaMenu; } -(id) initWith:(phoenix::Menu&)menu; -(NSMenu*) cocoaMenu; @end namespace phoenix { struct pMenu : public pAction { Menu& menu; CocoaMenu* cocoaMenu = nullptr; void append(Action& action); void remove(Action& action); void setImage(const image& image); void setText(string text); pMenu(Menu& menu) : pAction(menu), menu(menu) {} void constructor(); void destructor(); }; } gba/ppu/ppu.cpp000664 001750 001750 00000007111 12651764221 014555 0ustar00sergiosergio000000 000000 #include //pixel: 4 cycles //hdraw: 240 pixels ( 960 cycles) //hblank: 68 pixels ( 272 cycles) //scanline: 308 pixels (1232 cycles) //vdraw: 160 scanlines (197120 cycles) //vblank: 68 scanlines ( 83776 cycles) //frame: 228 scanlines (280896 cycles) namespace GameBoyAdvance { #include "registers.cpp" #include "background.cpp" #include "object.cpp" #include "mosaic.cpp" #include "screen.cpp" #include "mmio.cpp" #include "memory.cpp" #include "serialization.cpp" PPU ppu; void PPU::Enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } ppu.main(); } } void PPU::main() { scanline(); } void PPU::step(unsigned clocks) { clock += clocks; if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cpu.thread); } void PPU::power() { create(PPU::Enter, 16777216); for(unsigned n = 0; n < 240 * 160; n++) output[n] = 0; for(unsigned n = 0; n < 1024; n += 2) pram_write(n, Half, 0x0000); for(unsigned n = 0; n < 1024; n += 2) oam_write(n, Half, 0x0000); regs.control = 0; regs.greenswap = 0; regs.status = 0; regs.vcounter = 0; for(auto& bg : regs.bg) { bg.control = 0; bg.hoffset = 0; bg.voffset = 0; bg.pa = 0; bg.pb = 0; bg.pc = 0; bg.pd = 0; bg.x = 0; bg.y = 0; bg.lx = 0; bg.ly = 0; } for(auto& w : regs.window) { w.x1 = 0; w.x2 = 0; w.y1 = 0; w.y2 = 0; } for(auto& f : regs.windowflags) { f = 0; } regs.mosaic.bghsize = 0; regs.mosaic.bgvsize = 0; regs.mosaic.objhsize = 0; regs.mosaic.objvsize = 0; regs.blend.control = 0; regs.blend.eva = 0; regs.blend.evb = 0; regs.blend.evy = 0; for(unsigned n = 0x000; n <= 0x055; n++) bus.mmio[n] = this; } void PPU::scanline() { cpu.keypad_run(); regs.status.vblank = regs.vcounter >= 160 && regs.vcounter <= 226; regs.status.vcoincidence = regs.vcounter == regs.status.vcompare; if(regs.vcounter == 0) { frame(); regs.bg[2].lx = regs.bg[2].x; regs.bg[2].ly = regs.bg[2].y; regs.bg[3].lx = regs.bg[3].x; regs.bg[3].ly = regs.bg[3].y; } if(regs.vcounter == 160) { if(regs.status.irqvblank) cpu.regs.irq.flag.vblank = 1; cpu.dma_vblank(); } if(regs.status.irqvcoincidence) { if(regs.status.vcoincidence) cpu.regs.irq.flag.vcoincidence = 1; } if(regs.vcounter < 160) { if(regs.control.forceblank || cpu.regs.mode == CPU::Registers::Mode::Stop) { render_forceblank(); } else { for(unsigned x = 0; x < 240; x++) { windowmask[0][x] = false; windowmask[1][x] = false; windowmask[2][x] = false; layer[OBJ][x].write(false); layer[BG0][x].write(false); layer[BG1][x].write(false); layer[BG2][x].write(false); layer[BG3][x].write(false); layer[SFX][x].write(true, 3, pram[0]); } render_window(0); render_window(1); render_objects(); render_backgrounds(); render_screen(); } } step(960); regs.status.hblank = 1; if(regs.status.irqhblank) cpu.regs.irq.flag.hblank = 1; if(regs.vcounter < 160) cpu.dma_hblank(); step(240); regs.status.hblank = 0; if(regs.vcounter < 160) cpu.dma_hdma(); step(32); if(++regs.vcounter == 228) regs.vcounter = 0; } void PPU::frame() { player.frame(); scheduler.exit(Scheduler::ExitReason::FrameEvent); } PPU::PPU() { output = new uint32[240 * 160]; regs.bg[0].id = BG0; regs.bg[1].id = BG1; regs.bg[2].id = BG2; regs.bg[3].id = BG3; } PPU::~PPU() { delete[] output; } } phoenix/reference/widget/radio-label.cpp000664 001750 001750 00000000360 12651764221 021461 0ustar00sergiosergio000000 000000 namespace phoenix { void pRadioLabel::setChecked() { } void pRadioLabel::setGroup(const group& group) { } void pRadioLabel::setText(string text) { } void pRadioLabel::constructor() { } void pRadioLabel::destructor() { } } nall/image/utility.hpp000664 001750 001750 00000006524 12651764221 016143 0ustar00sergiosergio000000 000000 #ifndef NALL_IMAGE_UTILITY_HPP #define NALL_IMAGE_UTILITY_HPP namespace nall { bool image::crop(unsigned outputX, unsigned outputY, unsigned outputWidth, unsigned outputHeight) { if(outputX + outputWidth > width) return false; if(outputY + outputHeight > height) return false; uint8_t* outputData = allocate(outputWidth, outputHeight, stride); unsigned outputPitch = outputWidth * stride; #pragma omp parallel for for(unsigned y = 0; y < outputHeight; y++) { const uint8_t* sp = data + pitch * (outputY + y) + stride * outputX; uint8_t* dp = outputData + outputPitch * y; for(unsigned x = 0; x < outputWidth; x++) { write(dp, read(sp)); sp += stride; dp += stride; } } delete[] data; data = outputData; width = outputWidth; height = outputHeight; pitch = outputPitch; size = width * pitch; return true; } void image::alphaBlend(uint64_t alphaColor) { uint64_t alphaR = (alphaColor & red.mask ) >> red.shift; uint64_t alphaG = (alphaColor & green.mask) >> green.shift; uint64_t alphaB = (alphaColor & blue.mask ) >> blue.shift; #pragma omp parallel for for(unsigned y = 0; y < height; y++) { uint8_t* dp = data + pitch * y; for(unsigned x = 0; x < width; x++) { uint64_t color = read(dp); uint64_t colorA = (color & alpha.mask) >> alpha.shift; uint64_t colorR = (color & red.mask ) >> red.shift; uint64_t colorG = (color & green.mask) >> green.shift; uint64_t colorB = (color & blue.mask ) >> blue.shift; double alphaScale = (double)colorA / (double)((1 << alpha.depth) - 1); colorA = (1 << alpha.depth) - 1; colorR = (colorR * alphaScale) + (alphaR * (1.0 - alphaScale)); colorG = (colorG * alphaScale) + (alphaG * (1.0 - alphaScale)); colorB = (colorB * alphaScale) + (alphaB * (1.0 - alphaScale)); write(dp, (colorA << alpha.shift) | (colorR << red.shift) | (colorG << green.shift) | (colorB << blue.shift)); dp += stride; } } } void image::transform(bool outputEndian, unsigned outputDepth, uint64_t outputAlphaMask, uint64_t outputRedMask, uint64_t outputGreenMask, uint64_t outputBlueMask) { if(endian == outputEndian && depth == outputDepth && alpha.mask == outputAlphaMask && red.mask == outputRedMask && green.mask == outputGreenMask && blue.mask == outputBlueMask) return; image output(outputEndian, outputDepth, outputAlphaMask, outputRedMask, outputGreenMask, outputBlueMask); output.allocate(width, height); #pragma omp parallel for for(unsigned y = 0; y < height; y++) { const uint8_t* sp = data + pitch * y; uint8_t* dp = output.data + output.pitch * y; for(unsigned x = 0; x < width; x++) { uint64_t color = read(sp); sp += stride; uint64_t a = (color & alpha.mask) >> alpha.shift; uint64_t r = (color & red.mask) >> red.shift; uint64_t g = (color & green.mask) >> green.shift; uint64_t b = (color & blue.mask) >> blue.shift; a = normalize(a, alpha.depth, output.alpha.depth); r = normalize(r, red.depth, output.red.depth); g = normalize(g, green.depth, output.green.depth); b = normalize(b, blue.depth, output.blue.depth); output.write(dp, (a << output.alpha.shift) | (r << output.red.shift) | (g << output.green.shift) | (b << output.blue.shift)); dp += output.stride; } } operator=(std::move(output)); } } #endif sfc/controller/usart/usart.hpp000664 001750 001750 00000001401 12651764221 017647 0ustar00sergiosergio000000 000000 struct USART : Controller, public library { void enter(); bool quit(); void usleep(unsigned milliseconds); bool readable(); uint8 read(); bool writable(); void write(uint8 data); uint2 data(); void latch(bool data); USART(bool port); ~USART(); private: bool latched; bool data1; bool data2; unsigned counter; uint8 rxlength; uint8 rxdata; vector rxbuffer; uint8 txlength; uint8 txdata; vector txbuffer; function, //quit function, //usleep function, //readable function, //read function, //writable function //write )> init; function main; }; gb/memory/memory.hpp000664 001750 001750 00000001133 12651764221 015627 0ustar00sergiosergio000000 000000 struct Memory { uint8_t* data; unsigned size; uint8_t& operator[](unsigned addr); void allocate(unsigned size); void copy(const uint8_t* data, unsigned size); void free(); Memory(); ~Memory(); }; struct MMIO { virtual uint8 mmio_read(uint16 addr) = 0; virtual void mmio_write(uint16 addr, uint8 data) = 0; }; struct Unmapped : MMIO { uint8 mmio_read(uint16) { return 0x00; } void mmio_write(uint16, uint8) {} }; struct Bus { MMIO* mmio[65536]; uint8 read(uint16 addr); void write(uint16 addr, uint8 data); void power(); }; extern Unmapped unmapped; extern Bus bus; phoenix/windows/widget/tab-frame.cpp000664 001750 001750 00000010536 12651764221 020706 0ustar00sergiosergio000000 000000 namespace phoenix { static LRESULT CALLBACK TabFrame_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { Object* object = (Object*)GetWindowLongPtr(hwnd, GWLP_USERDATA); if(object == nullptr) return DefWindowProc(hwnd, msg, wparam, lparam); TabFrame& tabFrame = (TabFrame&)*object; return Shared_windowProc(tabFrame.p.windowProc, hwnd, msg, wparam, lparam); } void pTabFrame::append(string text, const image& image) { unsigned selection = TabCtrl_GetItemCount(hwnd); wchar_t wtext[] = L""; TCITEM item; item.mask = TCIF_TEXT; item.pszText = wtext; TabCtrl_InsertItem(hwnd, selection, &item); setText(selection, text); if(!image.empty()) setImage(selection, image); } void pTabFrame::remove(unsigned selection) { TabCtrl_DeleteItem(hwnd, selection); buildImageList(); } void pTabFrame::setEnabled(bool enabled) { pWidget::setEnabled(enabled); for(auto& layout : tabFrame.state.layout) { if(layout) layout->setEnabled(layout->enabled()); } } void pTabFrame::setGeometry(Geometry geometry) { pWidget::setGeometry(geometry); geometry.x += 1, geometry.width -= 4; geometry.y += 21, geometry.height -= 23; for(auto& layout : tabFrame.state.layout) { if(layout) layout->setGeometry(geometry); } } void pTabFrame::setImage(unsigned selection, const image& image) { buildImageList(); } void pTabFrame::setSelection(unsigned selection) { TabCtrl_SetCurSel(hwnd, selection); synchronizeLayout(); } void pTabFrame::setText(unsigned selection, string text) { utf16_t wtext(text); TCITEM item; item.mask = TCIF_TEXT; item.pszText = (wchar_t*)wtext; TabCtrl_SetItem(hwnd, selection, &item); } void pTabFrame::setVisible(bool visible) { pWidget::setVisible(visible); for(auto& layout : tabFrame.state.layout) { if(layout) layout->setVisible(layout->visible()); } } void pTabFrame::constructor() { hwnd = CreateWindow(WC_TABCONTROL, L"", WS_CHILD | WS_TABSTOP, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&tabFrame); windowProc = (WindowProc)GetWindowLongPtr(hwnd, GWLP_WNDPROC); SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)TabFrame_windowProc); setDefaultFont(); for(auto& text : tabFrame.state.text) append(text, {}); buildImageList(); setSelection(tabFrame.state.selection); synchronize(); } void pTabFrame::destructor() { if(imageList) { ImageList_Destroy(imageList); imageList = nullptr; } DestroyWindow(hwnd); } void pTabFrame::orphan() { destructor(); constructor(); } void pTabFrame::buildImageList() { if(imageList) ImageList_Destroy(imageList); unsigned size = pFont::size(hfont, " ").height; imageList = ImageList_Create(size, size, ILC_COLOR32, 1, 0); for(auto& image : tabFrame.state.image) { ImageList_Append(imageList, image, size); } TabCtrl_SetImageList(hwnd, imageList); for(unsigned n = 0; n < tabFrame.state.image.size(); n++) { TCITEM item; item.mask = TCIF_IMAGE; item.iImage = (tabFrame.state.image(n).empty() ? -1 : n); TabCtrl_SetItem(hwnd, n, &item); } } void pTabFrame::synchronizeLayout() { unsigned selection = 0; for(auto& layout : tabFrame.state.layout) { if(layout) layout->setVisible(selection == tabFrame.state.selection); selection++; } } void pTabFrame::onChange() { tabFrame.state.selection = TabCtrl_GetCurSel(hwnd); synchronizeLayout(); if(tabFrame.onChange) tabFrame.onChange(); } //called only if TCS_OWNERDRAWFIXED style is used //this style disables XP/Vista theming of the TabFrame void pTabFrame::onDrawItem(LPARAM lparam) { LPDRAWITEMSTRUCT item = (LPDRAWITEMSTRUCT)lparam; FillRect(item->hDC, &item->rcItem, GetSysColorBrush(COLOR_3DFACE)); SetBkMode(item->hDC, TRANSPARENT); SetTextColor(item->hDC, GetSysColor(COLOR_BTNTEXT)); unsigned selection = item->itemID; if(selection < tabFrame.state.text.size()) { string text = tabFrame.state.text[selection]; Size size = pFont::size(hfont, text); unsigned width = item->rcItem.right - item->rcItem.left + 1; if(!tabFrame.state.image[selection].empty()) { width += size.height + 2; ImageList_Draw(imageList, selection, item->hDC, item->rcItem.left + (width - size.width) / 2 - (size.height + 3), item->rcItem.top + 2, ILD_NORMAL); } TextOut(item->hDC, item->rcItem.left + (width - size.width) / 2, item->rcItem.top + 2, utf16_t(text), text.size()); } } } sfc/chip/st0010/st0010.cpp000664 001750 001750 00000003314 12651764221 015771 0ustar00sergiosergio000000 000000 #include #define ST0010_CPP namespace SuperFamicom { ST0010 st0010; #include "data.hpp" #include "opcodes.cpp" #include "serialization.cpp" void ST0010::init() { } void ST0010::load() { } void ST0010::unload() { } int16 ST0010::sin(int16 theta) { return sin_table[(theta >> 8) & 0xff]; } int16 ST0010::cos(int16 theta) { return sin_table[((theta + 0x4000) >> 8) & 0xff]; } uint8 ST0010::readb(uint16 addr) { return ram[addr & 0xfff]; } uint16 ST0010::readw(uint16 addr) { return (readb(addr + 0) << 0) | (readb(addr + 1) << 8); } uint32 ST0010::readd(uint16 addr) { return (readb(addr + 0) << 0) | (readb(addr + 1) << 8) | (readb(addr + 2) << 16) | (readb(addr + 3) << 24); } void ST0010::writeb(uint16 addr, uint8 data) { ram[addr & 0xfff] = data; } void ST0010::writew(uint16 addr, uint16 data) { writeb(addr + 0, data >> 0); writeb(addr + 1, data >> 8); } void ST0010::writed(uint16 addr, uint32 data) { writeb(addr + 0, data >> 0); writeb(addr + 1, data >> 8); writeb(addr + 2, data >> 16); writeb(addr + 3, data >> 24); } // void ST0010::power() { reset(); } void ST0010::reset() { memset(ram, 0x00, sizeof ram); } // uint8 ST0010::read(unsigned addr) { return readb(addr); } void ST0010::write(unsigned addr, uint8 data) { writeb(addr, data); if((addr & 0xfff) == 0x0021 && (data & 0x80)) { switch(ram[0x0020]) { case 0x01: op_01(); break; case 0x02: op_02(); break; case 0x03: op_03(); break; case 0x04: op_04(); break; case 0x05: op_05(); break; case 0x06: op_06(); break; case 0x07: op_07(); break; case 0x08: op_08(); break; } ram[0x0021] &= ~0x80; } } } phoenix/reference/application.cpp000664 001750 001750 00000000331 12651764221 020324 0ustar00sergiosergio000000 000000 namespace phoenix { void pApplication::run() { } bool pApplication::pendingEvents() { return false; } void pApplication::processEvents() { } void pApplication::quit() { } void pApplication::initialize() { } } phoenix/cocoa/widget/check-button.cpp000664 001750 001750 00000004166 12651764221 021032 0ustar00sergiosergio000000 000000 @implementation CocoaCheckButton : NSButton -(id) initWith:(phoenix::CheckButton&)checkButtonReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { checkButton = &checkButtonReference; [self setTarget:self]; [self setAction:@selector(activate:)]; [self setBezelStyle:NSRegularSquareBezelStyle]; [self setButtonType:NSOnOffButton]; } return self; } -(IBAction) activate:(id)sender { checkButton->state.checked = [self state] != NSOffState; if(checkButton->onToggle) checkButton->onToggle(); } @end namespace phoenix { Size pCheckButton::minimumSize() { Size size = Font::size(checkButton.font(), checkButton.state.text); if(checkButton.state.orientation == Orientation::Horizontal) { size.width += checkButton.state.image.width; size.height = max(checkButton.state.image.height, size.height); } if(checkButton.state.orientation == Orientation::Vertical) { size.width = max(checkButton.state.image.width, size.width); size.height += checkButton.state.image.height; } return {size.width + 20, size.height + 4}; } void pCheckButton::setChecked(bool checked) { @autoreleasepool { [cocoaView setState:checked ? NSOnState : NSOffState]; } } void pCheckButton::setGeometry(Geometry geometry) { pWidget::setGeometry({ geometry.x - 2, geometry.y - 2, geometry.width + 4, geometry.height + 4 }); } void pCheckButton::setImage(const image& image, Orientation orientation) { @autoreleasepool { if(image.empty()) { [cocoaView setImage:nil]; return; } [cocoaView setImage:NSMakeImage(image)]; if(orientation == Orientation::Horizontal) [cocoaView setImagePosition:NSImageLeft]; if(orientation == Orientation::Vertical ) [cocoaView setImagePosition:NSImageAbove]; } } void pCheckButton::setText(string text) { @autoreleasepool { [cocoaView setTitle:[NSString stringWithUTF8String:text]]; } } void pCheckButton::constructor() { @autoreleasepool { cocoaView = cocoaCheckButton = [[CocoaCheckButton alloc] initWith:checkButton]; } } void pCheckButton::destructor() { @autoreleasepool { [cocoaView release]; } } } phoenix/cocoa/keyboard.cpp000664 001750 001750 00000000407 12651764221 016753 0ustar00sergiosergio000000 000000 namespace phoenix { bool pKeyboard::pressed(Keyboard::Scancode scancode) { return false; } vector pKeyboard::state() { vector output; output.resize((unsigned)Keyboard::Scancode::Limit); for(auto& n : output) n = false; return output; } } ruby/video/opengl/main.hpp000664 001750 001750 00000016240 12651764221 016723 0ustar00sergiosergio000000 000000 void OpenGL::shader(const char* pathname) { for(auto& program : programs) program.release(); programs.reset(); settings.reset(); format = inputFormat; filter = GL_LINEAR; wrap = GL_CLAMP_TO_BORDER; absoluteWidth = 0, absoluteHeight = 0; relativeWidth = 0, relativeHeight = 0; unsigned historySize = 0; if(pathname) { auto document = Markup::Document(file::read({pathname, "manifest.bml"})); for(auto& node : document["settings"]) { settings.insert({node.name, node.text()}); } for(auto& node : document["input"]) { if(node.name == "history") historySize = node.decimal(); if(node.name == "format") format = glrFormat(node.text()); if(node.name == "filter") filter = glrFilter(node.text()); if(node.name == "wrap") wrap = glrWrap(node.text()); } for(auto& node : document["output"]) { string text = node.text(); if(node.name == "width") { if(text.endsWith("%")) relativeWidth = real(text.rtrim<1>("%")) / 100.0; else absoluteWidth = decimal(text); } if(node.name == "height") { if(text.endsWith("%")) relativeHeight = real(text.rtrim<1>("%")) / 100.0; else absoluteHeight = decimal(text); } } for(auto& node : document.find("program")) { unsigned n = programs.size(); programs(n).bind(this, node, pathname); } } //changing shaders may change input format, which requires the input texture to be recreated if(texture) { glDeleteTextures(1, &texture); texture = 0; } glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, getFormat(), getType(), buffer); allocateHistory(historySize); } void OpenGL::allocateHistory(unsigned size) { for(auto& frame : history) glDeleteTextures(1, &frame.texture); history.reset(); while(size--) { OpenGLTexture frame; frame.filter = filter; frame.wrap = wrap; glGenTextures(1, &frame.texture); glBindTexture(GL_TEXTURE_2D, frame.texture); glTexImage2D(GL_TEXTURE_2D, 0, format, frame.width = width, frame.height = height, 0, getFormat(), getType(), buffer); history.append(frame); } } bool OpenGL::lock(uint32_t*& data, unsigned& pitch) { pitch = width * sizeof(uint32_t); return data = buffer; } void OpenGL::clear() { for(auto& p : programs) { glUseProgram(p.program); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, p.framebuffer); glClearColor(0, 0, 0, 1); glClear(GL_COLOR_BUFFER_BIT); } glUseProgram(0); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); glClearColor(0, 0, 0, 1); glClear(GL_COLOR_BUFFER_BIT); } void OpenGL::refresh() { clear(); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texture); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, getFormat(), getType(), buffer); struct Source { GLuint texture; unsigned width, height; GLuint filter, wrap; }; vector sources; sources.prepend({texture, width, height, filter, wrap}); for(auto& p : programs) { unsigned targetWidth = p.absoluteWidth ? p.absoluteWidth : outputWidth; unsigned targetHeight = p.absoluteHeight ? p.absoluteHeight : outputHeight; if(p.relativeWidth) targetWidth = sources[0].width * p.relativeWidth; if(p.relativeHeight) targetHeight = sources[0].height * p.relativeHeight; p.size(targetWidth, targetHeight); glUseProgram(p.program); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, p.framebuffer); glrUniform1i("phase", p.phase); glrUniform1i("historyLength", history.size()); glrUniform1i("sourceLength", sources.size()); glrUniform1i("pixmapLength", p.pixmaps.size()); glrUniform4f("targetSize", targetWidth, targetHeight, 1.0 / targetWidth, 1.0 / targetHeight); glrUniform4f("outputSize", outputWidth, outputHeight, 1.0 / outputWidth, 1.0 / outputHeight); unsigned aid = 0; for(auto& frame : history) { glrUniform1i({"history[", aid, "]"}, aid); glrUniform4f({"historySize[", aid, "]"}, frame.width, frame.height, 1.0 / frame.width, 1.0 / frame.height); glActiveTexture(GL_TEXTURE0 + (aid++)); glBindTexture(GL_TEXTURE_2D, frame.texture); glrParameters(frame.filter, frame.wrap); } unsigned bid = 0; for(auto& source : sources) { glrUniform1i({"source[", bid, "]"}, aid + bid); glrUniform4f({"sourceSize[", bid, "]"}, source.width, source.height, 1.0 / source.width, 1.0 / source.height); glActiveTexture(GL_TEXTURE0 + aid + (bid++)); glBindTexture(GL_TEXTURE_2D, source.texture); glrParameters(source.filter, source.wrap); } unsigned cid = 0; for(auto& pixmap : p.pixmaps) { glrUniform1i({"pixmap[", cid, "]"}, aid + bid + cid); glrUniform4f({"pixmapSize[", bid, "]"}, pixmap.width, pixmap.height, 1.0 / pixmap.width, 1.0 / pixmap.height); glActiveTexture(GL_TEXTURE0 + aid + bid + (cid++)); glBindTexture(GL_TEXTURE_2D, pixmap.texture); glrParameters(pixmap.filter, pixmap.wrap); } glActiveTexture(GL_TEXTURE0); glrParameters(sources[0].filter, sources[0].wrap); p.render(sources[0].width, sources[0].height, targetWidth, targetHeight); glBindTexture(GL_TEXTURE_2D, p.texture); p.phase = (p.phase + 1) % p.modulo; sources.prepend({p.texture, p.width, p.height, p.filter, p.wrap}); } unsigned targetWidth = absoluteWidth ? absoluteWidth : outputWidth; unsigned targetHeight = absoluteHeight ? absoluteHeight : outputHeight; if(relativeWidth) targetWidth = sources[0].width * relativeWidth; if(relativeHeight) targetHeight = sources[0].height * relativeHeight; glUseProgram(program); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); glrUniform1i("source[0]", 0); glrUniform4f("targetSize", targetWidth, targetHeight, 1.0 / targetWidth, 1.0 / targetHeight); glrUniform4f("outputSize", outputWidth, outputHeight, 1.0 / outputWidth, 1.0 / outputHeight); glrParameters(sources[0].filter, sources[0].wrap); render(sources[0].width, sources[0].height, outputWidth, outputHeight); if(history.size() > 0) { OpenGLTexture frame = history.takeLast(); glBindTexture(GL_TEXTURE_2D, frame.texture); if(width == frame.width && height == frame.height) { glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, getFormat(), getType(), buffer); } else { glTexImage2D(GL_TEXTURE_2D, 0, format, frame.width = width, frame.height = height, 0, getFormat(), getType(), buffer); } history.prepend(frame); } } bool OpenGL::init() { if(!OpenGLBind()) return false; glDisable(GL_ALPHA_TEST); glDisable(GL_BLEND); glDisable(GL_DEPTH_TEST); glDisable(GL_POLYGON_SMOOTH); glDisable(GL_STENCIL_TEST); glEnable(GL_DITHER); glEnable(GL_TEXTURE_2D); program = glCreateProgram(); vertex = glrCreateShader(program, GL_VERTEX_SHADER, OpenGLOutputVertexShader); //geometry = glrCreateShader(program, GL_GEOMETRY_SHADER, OpenGLGeometryShader); fragment = glrCreateShader(program, GL_FRAGMENT_SHADER, OpenGLFragmentShader); OpenGLSurface::allocate(); glrLinkProgram(program); shader(nullptr); return true; } void OpenGL::term() { shader(nullptr); //release shader resources (eg frame[] history) OpenGLSurface::release(); if(buffer) { delete[] buffer; buffer = nullptr; } } gb/apu/square1/square1.hpp000664 001750 001750 00000001242 12651764221 016537 0ustar00sergiosergio000000 000000 struct Square1 { bool enable; uint3 sweep_frequency; bool sweep_direction; uint3 sweep_shift; bool sweep_negate; uint2 duty; uint6 length; uint4 envelope_volume; bool envelope_direction; uint3 envelope_frequency; uint11 frequency; bool counter; int16 output; bool duty_output; uint3 phase; unsigned period; uint3 envelope_period; uint3 sweep_period; signed frequency_shadow; bool sweep_enable; uint4 volume; bool dac_enable(); void run(); void sweep(bool update); void clock_length(); void clock_sweep(); void clock_envelope(); void write(unsigned r, uint8 data); void power(); void serialize(serializer&); }; phoenix/reference/widget/tab-frame.cpp000664 001750 001750 00000000603 12651764221 021144 0ustar00sergiosergio000000 000000 namespace phoenix { void pTabFrame::append(string text, const image& image) { } void pTabFrame::remove(unsigned selection) { } void pTabFrame::setImage(unsigned selection, const image& image) { } void pTabFrame::setSelection(unsigned selection) { } void pTabFrame::setText(unsigned selection, string text) { } void pTabFrame::constructor() { } void pTabFrame::destructor() { } } nall/stream/stream.hpp000664 001750 001750 00000004305 12651764221 016137 0ustar00sergiosergio000000 000000 #ifndef NALL_STREAM_STREAM_HPP #define NALL_STREAM_STREAM_HPP namespace nall { struct stream { virtual bool seekable() const = 0; virtual bool readable() const = 0; virtual bool writable() const = 0; virtual bool randomaccess() const = 0; virtual uint8_t* data() const { return nullptr; } virtual unsigned size() const = 0; virtual unsigned offset() const = 0; virtual void seek(unsigned offset) const = 0; virtual uint8_t read() const = 0; virtual void write(uint8_t data) const = 0; virtual uint8_t read(unsigned) const { return 0; } virtual void write(unsigned, uint8_t) const {} operator bool() const { return size(); } bool empty() const { return size() == 0; } bool end() const { return offset() >= size(); } uintmax_t readl(unsigned length = 1) const { uintmax_t data = 0, shift = 0; while(length--) { data |= read() << shift; shift += 8; } return data; } uintmax_t readm(unsigned length = 1) const { uintmax_t data = 0; while(length--) data = (data << 8) | read(); return data; } void read(uint8_t* data, unsigned length) const { while(length--) *data++ = read(); } string text() const { string buffer; buffer.resize(size() + 1); buffer[size()] = 0; seek(0); read((uint8_t*)buffer.data(), size()); return buffer; } void writel(uintmax_t data, unsigned length = 1) const { while(length--) { write(data); data >>= 8; } } void writem(uintmax_t data, unsigned length = 1) const { uintmax_t shift = 8 * length; while(length--) { shift -= 8; write(data >> shift); } } void write(const uint8_t* data, unsigned length) const { while(length--) write(*data++); } struct byte { operator uint8_t() const { return s.read(offset); } byte& operator=(uint8_t data) { s.write(offset, data); return *this; } byte(const stream& s, unsigned offset) : s(s), offset(offset) {} private: const stream& s; const unsigned offset; }; byte operator[](unsigned offset) const { return byte(*this, offset); } stream() {} virtual ~stream() {} stream(const stream&) = delete; stream& operator=(const stream&) = delete; }; } #endif ananke/Makefile000664 001750 001750 00000003273 12651764221 014612 0ustar00sergiosergio000000 000000 include ../nall/Makefile include ../phoenix/Makefile path := /usr/local/lib flags := $(flags) -O3 -fomit-frame-pointer -I.. all: $(compiler) $(cppflags) $(flags) -fPIC -o obj/ananke.o -c ananke.cpp ifeq ($(platform),windows) $(compiler) $(phoenixflags) -fPIC -o obj/phoenix.o -c ../phoenix/phoenix.cpp $(compiler) $(link) -shared -o phoenix.dll obj/phoenix.o $(phoenixlink) $(compiler) $(link) -shared -o ananke.dll obj/ananke.o -L. -lphoenix else ifeq ($(platform),macosx) $(compiler) $(link) -shared -dynamiclib -undefined suppress -flat_namespace -o libananke.dylib obj/ananke.o else $(compiler) $(link) -shared -Wl,-soname,libananke.so.1 -o libananke.so obj/ananke.o endif resource: force sourcery resource/resource.bml resource/resource.cpp resource/resource.hpp clean: -@$(call delete,obj/*.o) -@$(call delete,*.dll) -@$(call delete,*.so) install: uninstall ifeq ($(platform),windows) else ifeq ($(platform),macosx) if [ ! -d ~/Library/Application\ Support/ananke ]; then mkdir ~/Library/Application\ Support/ananke; fi sudo cp libananke.dylib $(path)/libananke.1.dylib sudo ln -s $(path)/libananke.1.dylib $(path)/libananke.dylib else if [ ! -d ~/.config/ananke ]; then mkdir ~/.config/ananke; fi sudo cp libananke.so $(path)/libananke.so.1 sudo ln -s $(path)/libananke.so.1 $(path)/libananke.so endif uninstall: ifeq ($(platform),windows) else ifeq ($(platform),macosx) if [ -f $(path)/libananke.dylib ]; then sudo rm $(path)/libananke.dylib; fi if [ -f $(path)/libananke.1.dylib ]; then sudo rm $(path)/libananke.1.dylib; fi else if [ -f $(path)/libananke.so ]; then sudo rm $(path)/libananke.so; fi if [ -f $(path)/libananke.so.1 ]; then sudo rm $(path)/libananke.so.1; fi endif force: sfc/alt/ppu-performance/window/window.cpp000664 001750 001750 00000005626 12651764221 021701 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP void PPU::LayerWindow::render(bool screen) { uint8* output; if(screen == 0) { output = main; if(main_enable == false) { memset(output, 0, 256); return; } } else { output = sub; if(sub_enable == false) { memset(output, 0, 256); return; } } if(one_enable == false && two_enable == false) { memset(output, 0, 256); return; } if(one_enable == true && two_enable == false) { bool set = 1 ^ one_invert, clr = !set; for(unsigned x = 0; x < 256; x++) { output[x] = (x >= ppu.regs.window_one_left && x <= ppu.regs.window_one_right) ? set : clr; } return; } if(one_enable == false && two_enable == true) { bool set = 1 ^ two_invert, clr = !set; for(unsigned x = 0; x < 256; x++) { output[x] = (x >= ppu.regs.window_two_left && x <= ppu.regs.window_two_right) ? set : clr; } return; } for(unsigned x = 0; x < 256; x++) { bool one_mask = (x >= ppu.regs.window_one_left && x <= ppu.regs.window_one_right) ^ one_invert; bool two_mask = (x >= ppu.regs.window_two_left && x <= ppu.regs.window_two_right) ^ two_invert; switch(mask) { case 0: output[x] = (one_mask | two_mask); break; case 1: output[x] = (one_mask & two_mask); break; case 2: output[x] = (one_mask ^ two_mask); break; case 3: output[x] = !(one_mask ^ two_mask); break; } } } // void PPU::ColorWindow::render(bool screen) { uint8* output = (screen == 0 ? main : sub); bool set = 1, clr = 0; switch(screen == 0 ? main_mask : sub_mask) { case 0: memset(output, 1, 256); return; //always case 1: set = 1, clr = 0; break; //inside window only case 2: set = 0, clr = 1; break; //outside window only case 3: memset(output, 0, 256); return; //never } if(one_enable == false && two_enable == false) { memset(output, clr, 256); return; } if(one_enable == true && two_enable == false) { if(one_invert) { set ^= 1; clr ^= 1; } for(unsigned x = 0; x < 256; x++) { output[x] = (x >= ppu.regs.window_one_left && x <= ppu.regs.window_one_right) ? set : clr; } return; } if(one_enable == false && two_enable == true) { if(two_invert) { set ^= 1; clr ^= 1; } for(unsigned x = 0; x < 256; x++) { output[x] = (x >= ppu.regs.window_two_left && x <= ppu.regs.window_two_right) ? set : clr; } return; } for(unsigned x = 0; x < 256; x++) { bool one_mask = (x >= ppu.regs.window_one_left && x <= ppu.regs.window_one_right) ^ one_invert; bool two_mask = (x >= ppu.regs.window_two_left && x <= ppu.regs.window_two_right) ^ two_invert; switch(mask) { case 0: output[x] = (one_mask | two_mask) ? set : clr; break; case 1: output[x] = (one_mask & two_mask) ? set : clr; break; case 2: output[x] = (one_mask ^ two_mask) ? set : clr; break; case 3: output[x] = !(one_mask ^ two_mask) ? set : clr; break; } } } #endif sfc/alt/smp/core/op_rmw.b000664 001750 001750 00000002704 12651764221 016443 0ustar00sergiosergio000000 000000 inc_a(0xbc, inc, a), inc_x(0x3d, inc, x), inc_y(0xfc, inc, y), dec_a(0x9c, dec, a), dec_x(0x1d, dec, x), dec_y(0xdc, dec, y), asl_a(0x1c, asl, a), lsr_a(0x5c, lsr, a), rol_a(0x3c, rol, a), ror_a(0x7c, ror, a) { 1:op_io(); regs.$2 = op_$1(regs.$2); } inc_dp(0xab, inc), dec_dp(0x8b, dec), asl_dp(0x0b, asl), lsr_dp(0x4b, lsr), rol_dp(0x2b, rol), ror_dp(0x6b, ror) { 1:dp = op_readpc(); 2:rd = op_readdp(dp); 3:rd = op_$1(rd); op_writedp(dp, rd); } inc_dpx(0xbb, inc), dec_dpx(0x9b, dec), asl_dpx(0x1b, asl), lsr_dpx(0x5b, lsr), rol_dpx(0x3b, rol), ror_dpx(0x7b, ror) { 1:dp = op_readpc(); 2:op_io(); 3:rd = op_readdp(dp + regs.x); 4:rd = op_$1(rd); op_writedp(dp + regs.x, rd); } inc_addr(0xac, inc), dec_addr(0x8c, dec), asl_addr(0x0c, asl), lsr_addr(0x4c, lsr), rol_addr(0x2c, rol), ror_addr(0x6c, ror) { 1:dp = op_readpc(); 2:dp |= op_readpc() << 8; 3:rd = op_readaddr(dp); 4:rd = op_$1(rd); op_writeaddr(dp, rd); } tset_addr_a(0x0e, |), tclr_addr_a(0x4e, &~) { 1:dp = op_readpc(); 2:dp |= op_readpc() << 8; 3:rd = op_readaddr(dp); regs.p.n = !!((regs.a - rd) & 0x80); regs.p.z = ((regs.a - rd) == 0); 4:op_readaddr(dp); 5:op_writeaddr(dp, rd $1 regs.a); } incw_dp(0x3a, ++), decw_dp(0x1a, --) { 1:dp = op_readpc(); 2:rd = op_readdp(dp); rd$1; 3:op_writedp(dp++, rd); 4:rd += op_readdp(dp) << 8; 5:op_writedp(dp, rd >> 8); regs.p.n = !!(rd & 0x8000); regs.p.z = (rd == 0); } sfc/profile-balanced.hpp000664 001750 001750 00000000175 12651764221 016366 0ustar00sergiosergio000000 000000 #include #include #include #include sfc/alt/ppu-balanced/render/windows.cpp000664 001750 001750 00000004521 12651764221 021255 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP //screen: 0 = main, 1 = sub void PPU::build_window_table(uint8 bg, bool screen) { bool set = 1, clr = 0; uint8* table = (screen == 0 ? window[bg].main : window[bg].sub); if(bg != COL) { if(screen == 0 && regs.window_enabled[bg] == false) { memset(table, 0, 256); return; } if(screen == 1 && regs.sub_window_enabled[bg] == false) { memset(table, 0, 256); return; } } else { switch(screen == 0 ? regs.color_mask : regs.colorsub_mask) { case 0: memset(table, 1, 256); return; //always case 3: memset(table, 0, 256); return; //never case 1: set = 1, clr = 0; break; //inside window only case 2: set = 0, clr = 1; break; //outside window only } } const uint16 window1_left = regs.window1_left; const uint16 window1_right = regs.window1_right; const uint16 window2_left = regs.window2_left; const uint16 window2_right = regs.window2_right; if(regs.window1_enabled[bg] == false && regs.window2_enabled[bg] == false) { memset(table, clr, 256); return; } if(regs.window1_enabled[bg] == true && regs.window2_enabled[bg] == false) { if(regs.window1_invert[bg] == true) { bool tmp = set; set = clr; clr = tmp; } for(unsigned x = 0; x < 256; x++) { table[x] = (x >= window1_left && x <= window1_right) ? set : clr; } return; } if(regs.window1_enabled[bg] == false && regs.window2_enabled[bg] == true) { if(regs.window2_invert[bg] == true) { bool tmp = set; set = clr; clr = tmp; } for(unsigned x = 0; x < 256; x++) { table[x] = (x >= window2_left && x <= window2_right) ? set : clr; } return; } for(unsigned x = 0; x < 256; x++) { bool w1_mask = (x >= window1_left && x <= window1_right) ^ regs.window1_invert[bg]; bool w2_mask = (x >= window2_left && x <= window2_right) ^ regs.window2_invert[bg]; switch(regs.window_mask[bg]) { case 0: table[x] = (w1_mask | w2_mask) == 1 ? set : clr; break; //or case 1: table[x] = (w1_mask & w2_mask) == 1 ? set : clr; break; //and case 2: table[x] = (w1_mask ^ w2_mask) == 1 ? set : clr; break; //xor case 3: table[x] = (w1_mask ^ w2_mask) == 0 ? set : clr; break; //xnor } } } void PPU::build_window_tables(uint8 bg) { build_window_table(bg, 0); build_window_table(bg, 1); } #endif ruby/video/opengl/bind.hpp000664 001750 001750 00000010603 12651764221 016710 0ustar00sergiosergio000000 000000 #if defined(PLATFORM_MACOSX) static bool OpenGLBind() { return true; } #else PFNGLCREATEPROGRAMPROC glCreateProgram = nullptr; PFNGLDELETEPROGRAMPROC glDeleteProgram = nullptr; PFNGLUSEPROGRAMPROC glUseProgram = nullptr; PFNGLCREATESHADERPROC glCreateShader = nullptr; PFNGLDELETESHADERPROC glDeleteShader = nullptr; PFNGLSHADERSOURCEPROC glShaderSource = nullptr; PFNGLCOMPILESHADERPROC glCompileShader = nullptr; PFNGLGETSHADERIVPROC glGetShaderiv = nullptr; PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog = nullptr; PFNGLATTACHSHADERPROC glAttachShader = nullptr; PFNGLDETACHSHADERPROC glDetachShader = nullptr; PFNGLLINKPROGRAMPROC glLinkProgram = nullptr; PFNGLVALIDATEPROGRAMPROC glValidateProgram = nullptr; PFNGLGETPROGRAMIVPROC glGetProgramiv = nullptr; PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog = nullptr; PFNGLGENVERTEXARRAYSPROC glGenVertexArrays = nullptr; PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays = nullptr; PFNGLBINDVERTEXARRAYPROC glBindVertexArray = nullptr; PFNGLGENBUFFERSPROC glGenBuffers = nullptr; PFNGLDELETEBUFFERSPROC glDeleteBuffers = nullptr; PFNGLBINDBUFFERPROC glBindBuffer = nullptr; PFNGLBUFFERDATAPROC glBufferData = nullptr; PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation = nullptr; PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer = nullptr; PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray = nullptr; PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray = nullptr; PFNGLBINDFRAGDATALOCATIONPROC glBindFragDataLocation = nullptr; PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation = nullptr; PFNGLGETUNIFORMIVPROC glGetUniformiv = nullptr; PFNGLUNIFORM1IPROC glUniform1i = nullptr; PFNGLUNIFORM1FPROC glUniform1f = nullptr; PFNGLUNIFORM2FPROC glUniform2f = nullptr; PFNGLUNIFORM2FVPROC glUniform2fv = nullptr; PFNGLUNIFORM4FPROC glUniform4f = nullptr; PFNGLUNIFORM4FVPROC glUniform4fv = nullptr; PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv = nullptr; PFNGLGENFRAMEBUFFERSPROC glGenFramebuffers = nullptr; PFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers = nullptr; PFNGLBINDFRAMEBUFFERPROC glBindFramebuffer = nullptr; PFNGLFRAMEBUFFERTEXTURE2DPROC glFramebufferTexture2D = nullptr; PFNGLACTIVETEXTUREPROC glActiveTexture = nullptr; static bool OpenGLBind() { #define bind(prototype, function) \ function = (prototype)glGetProcAddress(#function); \ if(function == nullptr) return false bind(PFNGLCREATEPROGRAMPROC, glCreateProgram); bind(PFNGLDELETEPROGRAMPROC, glDeleteProgram); bind(PFNGLUSEPROGRAMPROC, glUseProgram); bind(PFNGLCREATESHADERPROC, glCreateShader); bind(PFNGLDELETESHADERPROC, glDeleteShader); bind(PFNGLSHADERSOURCEPROC, glShaderSource); bind(PFNGLCOMPILESHADERPROC, glCompileShader); bind(PFNGLGETSHADERIVPROC, glGetShaderiv); bind(PFNGLGETSHADERINFOLOGPROC, glGetShaderInfoLog); bind(PFNGLATTACHSHADERPROC, glAttachShader); bind(PFNGLDETACHSHADERPROC, glDetachShader); bind(PFNGLLINKPROGRAMPROC, glLinkProgram); bind(PFNGLVALIDATEPROGRAMPROC, glValidateProgram); bind(PFNGLGETPROGRAMIVPROC, glGetProgramiv); bind(PFNGLGETPROGRAMINFOLOGPROC, glGetProgramInfoLog); bind(PFNGLGENVERTEXARRAYSPROC, glGenVertexArrays); bind(PFNGLDELETEVERTEXARRAYSPROC, glDeleteVertexArrays); bind(PFNGLBINDVERTEXARRAYPROC, glBindVertexArray); bind(PFNGLGENBUFFERSPROC, glGenBuffers); bind(PFNGLDELETEBUFFERSPROC, glDeleteBuffers); bind(PFNGLBINDBUFFERPROC, glBindBuffer); bind(PFNGLBUFFERDATAPROC, glBufferData); bind(PFNGLGETATTRIBLOCATIONPROC, glGetAttribLocation); bind(PFNGLVERTEXATTRIBPOINTERPROC, glVertexAttribPointer); bind(PFNGLENABLEVERTEXATTRIBARRAYPROC, glEnableVertexAttribArray); bind(PFNGLDISABLEVERTEXATTRIBARRAYPROC, glDisableVertexAttribArray); bind(PFNGLBINDFRAGDATALOCATIONPROC, glBindFragDataLocation); bind(PFNGLGETUNIFORMLOCATIONPROC, glGetUniformLocation); bind(PFNGLGETUNIFORMIVPROC, glGetUniformiv); bind(PFNGLUNIFORM1IPROC, glUniform1i); bind(PFNGLUNIFORM1FPROC, glUniform1f); bind(PFNGLUNIFORM2FPROC, glUniform2f); bind(PFNGLUNIFORM2FVPROC, glUniform2fv); bind(PFNGLUNIFORM4FPROC, glUniform4f); bind(PFNGLUNIFORM4FVPROC, glUniform4fv); bind(PFNGLUNIFORMMATRIX4FVPROC, glUniformMatrix4fv); bind(PFNGLGENFRAMEBUFFERSPROC, glGenFramebuffers); bind(PFNGLDELETEFRAMEBUFFERSPROC, glDeleteFramebuffers); bind(PFNGLBINDFRAMEBUFFERPROC, glBindFramebuffer); bind(PFNGLFRAMEBUFFERTEXTURE2DPROC, glFramebufferTexture2D); bind(PFNGLACTIVETEXTUREPROC, glActiveTexture); #undef bind return true; } #endif sfc/dsp/dsp.cpp000664 001750 001750 00000013136 12651764221 014547 0ustar00sergiosergio000000 000000 #include #define DSP_CPP namespace SuperFamicom { DSP dsp; #define REG(n) state.regs[r_##n] #define VREG(n) state.regs[v.vidx + v_##n] #include "serialization.cpp" #include "gaussian.cpp" #include "counter.cpp" #include "envelope.cpp" #include "brr.cpp" #include "misc.cpp" #include "voice.cpp" #include "echo.cpp" /* timing */ void DSP::step(unsigned clocks) { clock += clocks; } void DSP::synchronize_smp() { if(SMP::Threaded == true) { if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(smp.thread); } else { while(clock >= 0) smp.enter(); } } void DSP::Enter() { dsp.enter(); } void DSP::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } voice_5(voice[0]); voice_2(voice[1]); tick(); voice_6(voice[0]); voice_3(voice[1]); tick(); voice_7(voice[0]); voice_4(voice[1]); voice_1(voice[3]); tick(); voice_8(voice[0]); voice_5(voice[1]); voice_2(voice[2]); tick(); voice_9(voice[0]); voice_6(voice[1]); voice_3(voice[2]); tick(); voice_7(voice[1]); voice_4(voice[2]); voice_1(voice[4]); tick(); voice_8(voice[1]); voice_5(voice[2]); voice_2(voice[3]); tick(); voice_9(voice[1]); voice_6(voice[2]); voice_3(voice[3]); tick(); voice_7(voice[2]); voice_4(voice[3]); voice_1(voice[5]); tick(); voice_8(voice[2]); voice_5(voice[3]); voice_2(voice[4]); tick(); voice_9(voice[2]); voice_6(voice[3]); voice_3(voice[4]); tick(); voice_7(voice[3]); voice_4(voice[4]); voice_1(voice[6]); tick(); voice_8(voice[3]); voice_5(voice[4]); voice_2(voice[5]); tick(); voice_9(voice[3]); voice_6(voice[4]); voice_3(voice[5]); tick(); voice_7(voice[4]); voice_4(voice[5]); voice_1(voice[7]); tick(); voice_8(voice[4]); voice_5(voice[5]); voice_2(voice[6]); tick(); voice_9(voice[4]); voice_6(voice[5]); voice_3(voice[6]); tick(); voice_1(voice[0]); voice_7(voice[5]); voice_4(voice[6]); tick(); voice_8(voice[5]); voice_5(voice[6]); voice_2(voice[7]); tick(); voice_9(voice[5]); voice_6(voice[6]); voice_3(voice[7]); tick(); voice_1(voice[1]); voice_7(voice[6]); voice_4(voice[7]); tick(); voice_8(voice[6]); voice_5(voice[7]); voice_2(voice[0]); tick(); voice_3a(voice[0]); voice_9(voice[6]); voice_6(voice[7]); echo_22(); tick(); voice_7(voice[7]); echo_23(); tick(); voice_8(voice[7]); echo_24(); tick(); voice_3b(voice[0]); voice_9(voice[7]); echo_25(); tick(); echo_26(); tick(); misc_27(); echo_27(); tick(); misc_28(); echo_28(); tick(); misc_29(); echo_29(); tick(); misc_30(); voice_3c(voice[0]); echo_30(); tick(); voice_4(voice[0]); voice_1(voice[2]); tick(); } } void DSP::tick() { step(3 * 8); synchronize_smp(); } /* register interface for S-SMP $00f2,$00f3 */ bool DSP::mute() { return state.regs[r_flg] & 0x40; } uint8 DSP::read(uint8 addr) { return state.regs[addr]; } void DSP::write(uint8 addr, uint8 data) { state.regs[addr] = data; if((addr & 0x0f) == v_envx) { state.envx_buf = data; } else if((addr & 0x0f) == v_outx) { state.outx_buf = data; } else if(addr == r_kon) { state.new_kon = data; } else if(addr == r_endx) { //always cleared, regardless of data written state.endx_buf = 0; state.regs[r_endx] = 0; } } /* initialization */ void DSP::power() { memset(&state.regs, 0, sizeof state.regs); state.echo_hist_pos = 0; state.every_other_sample = false; state.kon = 0; state.noise = 0; state.counter = 0; state.echo_offset = 0; state.echo_length = 0; state.new_kon = 0; state.endx_buf = 0; state.envx_buf = 0; state.outx_buf = 0; state.t_pmon = 0; state.t_non = 0; state.t_eon = 0; state.t_dir = 0; state.t_koff = 0; state.t_brr_next_addr = 0; state.t_adsr0 = 0; state.t_brr_header = 0; state.t_brr_byte = 0; state.t_srcn = 0; state.t_esa = 0; state.t_echo_disabled = 0; state.t_dir_addr = 0; state.t_pitch = 0; state.t_output = 0; state.t_looped = 0; state.t_echo_ptr = 0; state.t_main_out[0] = state.t_main_out[1] = 0; state.t_echo_out[0] = state.t_echo_out[1] = 0; state.t_echo_in[0] = state.t_echo_in[1] = 0; for(unsigned i = 0; i < 8; i++) { voice[i].buf_pos = 0; voice[i].interp_pos = 0; voice[i].brr_addr = 0; voice[i].brr_offset = 1; voice[i].vbit = 1 << i; voice[i].vidx = i * 0x10; voice[i].kon_delay = 0; voice[i].env_mode = env_release; voice[i].env = 0; voice[i].t_envx_out = 0; voice[i].hidden_env = 0; } } void DSP::reset() { create(Enter, system.apu_frequency()); REG(flg) = 0xe0; state.noise = 0x4000; state.echo_hist_pos = 0; state.every_other_sample = 1; state.echo_offset = 0; state.counter = 0; } DSP::DSP() { static_assert(sizeof(int) >= 32 / 8, "int >= 32-bits"); static_assert((int8)0x80 == -0x80, "8-bit sign extension"); static_assert((int16)0x8000 == -0x8000, "16-bit sign extension"); static_assert((uint16)0xffff0000 == 0, "16-bit unsigned clip"); static_assert((-1 >> 1) == -1, "arithmetic shift right"); //-0x8000 <= n <= +0x7fff assert(sclamp<16>(+0x8000) == +0x7fff); assert(sclamp<16>(-0x8001) == -0x8000); } DSP::~DSP() { } #undef REG #undef VREG } nall/mosaic/000700 001750 001750 00000000000 12656700342 014074 5ustar00sergiosergio000000 000000 nall/hid.hpp000664 001750 001750 00000005062 12651764221 014116 0ustar00sergiosergio000000 000000 #ifndef NALL_HID_HPP #define NALL_HID_HPP namespace nall { namespace HID { struct Input { string name; int16_t value = 0; Input() {} Input(const string& name) : name(name) {} }; struct Group { string name; vector input; Group() {} Group(const string& name) : name(name) {} void append(const string& name) { input.append({name}); } optional find(const string& name) { for(unsigned id = 0; id < input.size(); id++) { if(input[id].name == name) return {true, id}; } return false; } }; struct Device { uint64_t id = 0; string name; vector group; uint32_t pathID() const { return (uint32_t)(id >> 32); } uint32_t deviceID() const { return (uint32_t)(id >> 0); } uint16_t vendorID() const { return (uint16_t)(id >> 16); } uint16_t productID() const { return (uint16_t)(id >> 0); } virtual bool isNull() const { return false; } virtual bool isKeyboard() const { return false; } virtual bool isMouse() const { return false; } virtual bool isJoypad() const { return false; } void append(const string& name) { group.append({name}); } optional find(const string& name) { for(unsigned id = 0; id < group.size(); id++) { if(group[id].name == name) return {true, id}; } return false; } }; struct Null : Device { Null() { name = "Null"; } bool isNull() const { return true; } }; struct Keyboard : Device { enum GroupID : unsigned { Button }; Group& button() { return group[GroupID::Button]; } Keyboard() { name = "Keyboard"; append("Button"); } bool isKeyboard() const { return true; } }; struct Mouse : Device { enum GroupID : unsigned { Axis, Button }; Group& axis() { return group[GroupID::Axis]; } Group& button() { return group[GroupID::Button]; } Mouse() { name = "Mouse"; append("Axis"); append("Button"); } bool isMouse() const { return true; } }; struct Joypad : Device { enum GroupID : unsigned { Axis, Hat, Trigger, Button }; Group& axis() { return group[GroupID::Axis]; } Group& hat() { return group[GroupID::Hat]; } Group& trigger() { return group[GroupID::Trigger]; } Group& button() { return group[GroupID::Button]; } bool rumble = false; Joypad() { name = "Joypad"; append("Axis"); append("Hat"); append("Trigger"); append("Button"); } bool isJoypad() const { return true; } }; } } #endif gba/cpu/mmio.cpp000664 001750 001750 00000024371 12651764221 014704 0ustar00sergiosergio000000 000000 uint8 CPU::read(uint32 addr) { uint8 result = 0; switch(addr) { //DMA0CNT_H //DMA1CNT_H //DMA2CNT_H //DMA3CNT_H case 0x040000ba: case 0x040000bb: case 0x040000c6: case 0x040000c7: case 0x040000d2: case 0x040000d3: case 0x040000de: case 0x040000df: { auto& dma = regs.dma[(addr - 0x040000ba) / 12]; unsigned shift = (addr & 1) * 8; return dma.control >> shift; } //TM0CNT_L //TM1CNT_L //TM2CNT_L //TM3CNT_L case 0x04000100: case 0x04000101: case 0x04000104: case 0x04000105: case 0x04000108: case 0x04000109: case 0x0400010c: case 0x0400010d: { auto& timer = regs.timer[(addr >> 2) & 3]; unsigned shift = (addr & 1) * 8; return timer.period >> shift; } //TIM0CNT_H case 0x04000102: case 0x04000103: case 0x04000106: case 0x04000107: case 0x0400010a: case 0x0400010b: case 0x0400010e: case 0x0400010f: { auto& timer = regs.timer[(addr >> 2) & 3]; unsigned shift = (addr & 1) * 8; return timer.control >> shift; } //SIOMULTI0 (SIODATA32_L) //SIOMULTI1 (SIODATA32_H) //SIOMULTI2 //SIOMULTI3 case 0x04000120: case 0x04000121: case 0x04000122: case 0x04000123: case 0x04000124: case 0x04000125: case 0x04000126: case 0x04000127: { if(auto data = player.read()) return data() >> ((addr & 3) << 3); unsigned shift = (addr & 1) * 8; auto& data = regs.serial.data[(addr >> 1) & 3]; return data >> shift; } //SIOCNT case 0x04000128: return regs.serial.control >> 0; case 0x04000129: return regs.serial.control >> 8; //SIOMLT_SEND (SIODATA8) case 0x0400012a: return regs.serial.data8; case 0x0400012b: return 0u; //KEYINPUT case 0x04000130: if(auto result = player.keyinput()) return result() >> 0; for(unsigned n = 0; n < 8; n++) result |= interface->inputPoll(0, 0, n) << n; if((result & 0xc0) == 0xc0) result &= ~0xc0; //up+down cannot be pressed simultaneously if((result & 0x30) == 0x30) result &= ~0x30; //left+right cannot be pressed simultaneously return result ^ 0xff; case 0x04000131: if(auto result = player.keyinput()) return result() >> 8; result |= interface->inputPoll(0, 0, 8) << 0; result |= interface->inputPoll(0, 0, 9) << 1; return result ^ 0x03; //KEYCNT case 0x04000132: return regs.keypad.control >> 0; case 0x04000133: return regs.keypad.control >> 8; //RCNT case 0x04000134: return regs.joybus.settings >> 0; case 0x04000135: return regs.joybus.settings >> 8; //JOYCNT case 0x04000140: return regs.joybus.control >> 0; case 0x04000141: return regs.joybus.control >> 8; //JOY_RECV_L //JOY_RECV_H case 0x04000150: return regs.joybus.receive >> 0; case 0x04000151: return regs.joybus.receive >> 8; case 0x04000152: return regs.joybus.receive >> 16; case 0x04000153: return regs.joybus.receive >> 24; //JOY_TRANS_L //JOY_TRANS_H case 0x04000154: return regs.joybus.transmit >> 0; case 0x04000155: return regs.joybus.transmit >> 8; case 0x04000156: return regs.joybus.transmit >> 16; case 0x04000157: return regs.joybus.transmit >> 24; //JOYSTAT case 0x04000158: return regs.joybus.status >> 0; case 0x04000159: return regs.joybus.status >> 8; //IE case 0x04000200: return regs.irq.enable >> 0; case 0x04000201: return regs.irq.enable >> 8; //IF case 0x04000202: return regs.irq.flag >> 0; case 0x04000203: return regs.irq.flag >> 8; //WAITCNT case 0x04000204: return regs.wait.control >> 0; case 0x04000205: return regs.wait.control >> 8; //IME case 0x04000208: return regs.ime; case 0x04000209: return 0u; //POSTFLG + HALTCNT case 0x04000300: return regs.postboot; case 0x04000301: return 0u; //MEMCNT_L case 0x04000800: return regs.memory.control >> 0; case 0x04000801: return regs.memory.control >> 8; //MEMCNT_H case 0x04000802: return regs.memory.control >> 16; case 0x04000803: return regs.memory.control >> 24; } return 0u; } void CPU::write(uint32 addr, uint8 byte) { switch(addr) { //DMA0SAD //DMA1SAD //DMA2SAD //DMA3SAD case 0x040000b0: case 0x040000b1: case 0x040000b2: case 0x040000b3: case 0x040000bc: case 0x040000bd: case 0x040000be: case 0x040000bf: case 0x040000c8: case 0x040000c9: case 0x040000ca: case 0x040000cb: case 0x040000d4: case 0x040000d5: case 0x040000d6: case 0x040000d7: { auto& dma = regs.dma[(addr - 0x040000b0) / 12]; unsigned shift = (addr & 3) * 8; dma.source = (dma.source & ~(255 << shift)) | (byte << shift); return; } //DMA0DAD //DMA1DAD //DMA2DAD //DMA3DAD case 0x040000b4: case 0x040000b5: case 0x040000b6: case 0x040000b7: case 0x040000c0: case 0x040000c1: case 0x040000c2: case 0x040000c3: case 0x040000cc: case 0x040000cd: case 0x040000ce: case 0x040000cf: case 0x040000d8: case 0x040000d9: case 0x040000da: case 0x040000db: { auto& dma = regs.dma[(addr - 0x040000b4) / 12]; unsigned shift = (addr & 3) * 8; dma.target = (dma.target & ~(255 << shift)) | (byte << shift); return; } //DMA0CNT_L //DMA1CNT_L //DMA2CNT_L //DMA3CNT_L case 0x040000b8: case 0x040000b9: case 0x040000c4: case 0x040000c5: case 0x040000d0: case 0x040000d1: case 0x040000dc: case 0x040000dd: { auto& dma = regs.dma[(addr - 0x040000b8) / 12]; unsigned shift = (addr & 1) * 8; dma.length = (dma.length & ~(255 << shift)) | (byte << shift); return; } //DMA0CNT_H //DMA1CNT_H //DMA2CNT_H //DMA3CNT_H case 0x040000ba: case 0x040000bb: case 0x040000c6: case 0x040000c7: case 0x040000d2: case 0x040000d3: case 0x040000de: case 0x040000df: { auto& dma = regs.dma[(addr - 0x040000ba) / 12]; unsigned shift = (addr & 1) * 8; bool enable = dma.control.enable; dma.control = (dma.control & ~(255 << shift)) | (byte << shift); if(enable == 0 && dma.control.enable) { if(dma.control.timingmode == 0) dma.pending = true; //immediate transfer mode dma.run.target = dma.target; dma.run.source = dma.source; dma.run.length = dma.length; } else if(dma.control.enable == 0) { dma.pending = false; } return; } //TM0CNT_L //TM1CNT_L //TM2CNT_L //TM3CNT_L case 0x04000100: case 0x04000101: case 0x04000104: case 0x04000105: case 0x04000108: case 0x04000109: case 0x0400010c: case 0x0400010d: { auto& timer = regs.timer[(addr >> 2) & 3]; unsigned shift = (addr & 1) * 8; timer.reload = (timer.reload & ~(255 << shift)) | (byte << shift); return; } //TM0CNT_H //TM1CNT_H //TM2CNT_H //TM3CNT_H case 0x04000102: case 0x04000106: case 0x0400010a: case 0x0400010e: { auto& timer = regs.timer[(addr >> 2) & 3]; bool enable = timer.control.enable; timer.control = byte; if(enable == 0 && timer.control.enable == 1) { timer.period = timer.reload; } return; } //SIOMULTI0 (SIODATA32_L) //SIOMULTI1 (SIODATA32_H) //SIOMULTI2 //SIOMULTI3 case 0x04000120: case 0x04000121: case 0x04000122: case 0x04000123: case 0x04000124: case 0x04000125: case 0x04000126: case 0x04000127: { player.write(byte, addr & 3); auto& data = regs.serial.data[(addr >> 1) & 3]; unsigned shift = (addr & 1) * 8; data = (data & ~(255 << shift)) | (byte << shift); return; } //SIOCNT case 0x04000128: regs.serial.control = (regs.serial.control & 0xff00) | (byte << 0); return; case 0x04000129: regs.serial.control = (regs.serial.control & 0x00ff) | (byte << 8); return; //SIOMLT_SEND (SIODATA8) case 0x0400012a: regs.serial.data8 = byte; return; case 0x0400012b: return; //KEYCNT case 0x04000132: regs.keypad.control = (regs.keypad.control & 0xff00) | (byte << 0); return; case 0x04000133: regs.keypad.control = (regs.keypad.control & 0x00ff) | (byte << 8); return; //RCNT case 0x04000134: regs.joybus.settings = (regs.joybus.settings & 0xff00) | (byte << 0); return; case 0x04000135: regs.joybus.settings = (regs.joybus.settings & 0x00ff) | (byte << 8); return; //JOYCNT case 0x04000140: regs.joybus.control = (regs.joybus.control & 0xff00) | (byte << 0); return; case 0x04000141: regs.joybus.control = (regs.joybus.control & 0x00ff) | (byte << 8); return; //JOY_RECV_L //JOY_RECV_H case 0x04000150: regs.joybus.receive = (regs.joybus.receive & 0xffffff00) | (byte << 0); return; case 0x04000151: regs.joybus.receive = (regs.joybus.receive & 0xffff00ff) | (byte << 8); return; case 0x04000152: regs.joybus.receive = (regs.joybus.receive & 0xff00ffff) | (byte << 16); return; case 0x04000153: regs.joybus.receive = (regs.joybus.receive & 0x00ffffff) | (byte << 24); return; //JOY_TRANS_L //JOY_TRANS_H case 0x04000154: regs.joybus.transmit = (regs.joybus.transmit & 0xffffff00) | (byte << 0); return; case 0x04000155: regs.joybus.transmit = (regs.joybus.transmit & 0xffff00ff) | (byte << 8); return; case 0x04000156: regs.joybus.transmit = (regs.joybus.transmit & 0xff00ffff) | (byte << 16); return; case 0x04000157: regs.joybus.transmit = (regs.joybus.transmit & 0x00ffffff) | (byte << 24); return; //JOYSTAT case 0x04000158: regs.joybus.status = (regs.joybus.status & 0xff00) | (byte << 0); return; case 0x04000159: regs.joybus.status = (regs.joybus.status & 0x00ff) | (byte << 8); return; //IE case 0x04000200: regs.irq.enable = (regs.irq.enable & 0xff00) | (byte << 0); return; case 0x04000201: regs.irq.enable = (regs.irq.enable & 0x00ff) | (byte << 8); return; //IF case 0x04000202: regs.irq.flag = regs.irq.flag & ~(byte << 0); return; case 0x04000203: regs.irq.flag = regs.irq.flag & ~(byte << 8); return; //WAITCNT case 0x04000204: regs.wait.control = (regs.wait.control & 0xff00) | ((byte & 0xff) << 0); return; case 0x04000205: regs.wait.control = (regs.wait.control & 0x00ff) | ((byte & 0x7f) << 8); return; //IME case 0x04000208: regs.ime = byte >> 0; return; case 0x04000209: return; //POSTFLG, HALTCNT case 0x04000300: regs.postboot |= byte >> 0; return; case 0x04000301: regs.mode = byte & 0x80 ? Registers::Mode::Stop : Registers::Mode::Halt; return; //MEMCNT_L //MEMCNT_H case 0x04000800: regs.memory.control = (regs.memory.control & 0xffffff00) | (byte << 0); return; case 0x04000801: regs.memory.control = (regs.memory.control & 0xffff00ff) | (byte << 8); return; case 0x04000802: regs.memory.control = (regs.memory.control & 0xff00ffff) | (byte << 16); return; case 0x04000803: regs.memory.control = (regs.memory.control & 0x00ffffff) | (byte << 24); return; } } sfc/alt/dsp/dsp.cpp000664 001750 001750 00000002520 12651764221 015322 0ustar00sergiosergio000000 000000 #include #define DSP_CPP namespace SuperFamicom { DSP dsp; #include "serialization.cpp" #include "SPC_DSP.cpp" void DSP::step(unsigned clocks) { clock += clocks; } void DSP::synchronize_smp() { if(SMP::Threaded == true) { if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(smp.thread); } else { while(clock >= 0) smp.enter(); } } void DSP::enter() { spc_dsp.run(1); step(24); signed count = spc_dsp.sample_count(); if(count > 0) { for(unsigned n = 0; n < count; n += 2) audio.sample(samplebuffer[n + 0], samplebuffer[n + 1]); spc_dsp.set_output(samplebuffer, 8192); } } bool DSP::mute() { return spc_dsp.mute(); } uint8 DSP::read(uint8 addr) { return spc_dsp.read(addr); } void DSP::write(uint8 addr, uint8 data) { spc_dsp.write(addr, data); } void DSP::power() { spc_dsp.init(smp.apuram); spc_dsp.reset(); spc_dsp.set_output(samplebuffer, 8192); } void DSP::reset() { spc_dsp.soft_reset(); spc_dsp.set_output(samplebuffer, 8192); } void DSP::channel_enable(unsigned channel, bool enable) { channel_enabled[channel & 7] = enable; unsigned mask = 0; for(unsigned i = 0; i < 8; i++) { if(channel_enabled[i] == false) mask |= 1 << i; } spc_dsp.mute_voices(mask); } DSP::DSP() { for(unsigned i = 0; i < 8; i++) channel_enabled[i] = true; } } nall/string/allocator/copy-on-write.hpp000664 001750 001750 00000004124 12651764221 021352 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP /* copy on write (COW) allocator sizeof(string) == 24 (amd64) utilizes a shared_ptr to reference count strings allows string copies to execute as fast as string moves requires extra computations, which will be slower for all string sizes pros: * lower memory usage * pass-by-value does not require heap allocation; obviates pass-by-const-reference cons: * added overhead to fetch data() * added heap allocation for reference-count pool * no potential for in-place resize (always copies) * larger sizeof(string) */ namespace nall { char* string::data() { if(!_data.unique()) _copy(); return _data.get(); } const char* string::data() const { if(!_data) return ""; return _data.get(); } //copy _data (to make unique or to grow in size) void string::_copy() { auto copy = new char[_capacity + 1]; if(_data.get()) memcpy(copy, _data.get(), min(_capacity, _size)); copy[_size] = 0; copy[_capacity] = 0; _data.reset(copy); } //amortize growth to O(log n) //allocate one extra byte to always store null-terminator for libc usage void string::reserve(unsigned capacity) { if(capacity > _capacity) { _capacity = bit::round(capacity + 1) - 1; _copy(); } } void string::resize(unsigned size) { reserve(size); data()[_size = size] = 0; } void string::reset() { _data.reset(); _capacity = 0; _size = 0; } string& string::operator=(const string& source) { if(&source == this) return *this; reset(); _data = source._data; _capacity = source._capacity; _size = source._size; return *this; } string& string::operator=(string&& source) { if(&source == this) return *this; reset(); _data = std::move(source._data); _capacity = source._capacity; _size = source._size; source._capacity = 0; source._size = 0; return *this; } template string::string(T&& source, Args&&... args) { construct(); sprint(*this, std::forward(source), std::forward(args)...); } string::string() { construct(); } string::~string() { reset(); } void string::construct() { _capacity = 0; _size = 0; } } #endif phoenix/windows/settings.cpp000664 001750 001750 00000000075 12651764221 017422 0ustar00sergiosergio000000 000000 namespace phoenix { static Settings* settings = nullptr; } fc/apu/apu.hpp000664 001750 001750 00000002632 12651764221 014366 0ustar00sergiosergio000000 000000 struct APU : Thread { static void Main(); void main(); void tick(); void set_irq_line(); void set_sample(int16 sample); void power(); void reset(); uint8 read(uint16 addr); void write(uint16 addr, uint8 data); void serialize(serializer&); APU(); struct Filter { enum : signed { HiPassStrong = 225574, HiPassWeak = 57593, LoPass = 86322413 }; int64 hipass_strong; int64 hipass_weak; int64 lopass; signed run_hipass_strong(signed sample); signed run_hipass_weak(signed sample); signed run_lopass(signed sample); void serialize(serializer&); } filter; #include "envelope.hpp" #include "sweep.hpp" #include "pulse.hpp" #include "triangle.hpp" #include "noise.hpp" #include "dmc.hpp" struct FrameCounter { enum : unsigned { NtscPeriod = 14915 }; //~(21.477MHz / 6 / 240hz) bool irq_pending; uint2 mode; uint2 counter; signed divider; void serialize(serializer&); } frame; void clock_frame_counter(); void clock_frame_counter_divider(); uint8 enabled_channels; int16 cartridge_sample; int16 pulse_dac[32]; int16 dmc_triangle_noise_dac[128][16][16]; static const uint8 length_counter_table[32]; static const uint16 ntsc_dmc_period_table[16]; static const uint16 pal_dmc_period_table[16]; static const uint16 ntsc_noise_period_table[16]; static const uint16 pal_noise_period_table[16]; }; extern APU apu; ruby/video/directdraw.cpp000664 001750 001750 00000011316 12651764221 016635 0ustar00sergiosergio000000 000000 #include namespace ruby { class pVideoDD { public: LPDIRECTDRAW lpdd; LPDIRECTDRAW7 lpdd7; LPDIRECTDRAWSURFACE7 screen, raster; LPDIRECTDRAWCLIPPER clipper; DDSURFACEDESC2 ddsd; DDSCAPS2 ddscaps; unsigned iwidth, iheight; struct { HWND handle; bool synchronize; unsigned width; unsigned height; } settings; bool cap(const string& name) { if(name == Video::Handle) return true; if(name == Video::Synchronize) return true; return false; } any get(const string& name) { if(name == Video::Handle) return (uintptr_t)settings.handle; if(name == Video::Synchronize) return settings.synchronize; return false; } bool set(const string& name, const any& value) { if(name == Video::Handle) { settings.handle = (HWND)any_cast(value); return true; } if(name == Video::Synchronize) { settings.synchronize = any_cast(value); return true; } return false; } void resize(unsigned width, unsigned height) { if(iwidth >= width && iheight >= height) return; iwidth = max(width, iwidth); iheight = max(height, iheight); if(raster) raster->Release(); screen->GetSurfaceDesc(&ddsd); int depth = ddsd.ddpfPixelFormat.dwRGBBitCount; if(depth == 32) goto try_native_surface; memset(&ddsd, 0, sizeof(DDSURFACEDESC2)); ddsd.dwSize = sizeof(DDSURFACEDESC2); ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; //DDSCAPS_SYSTEMMEMORY ddsd.dwWidth = iwidth; ddsd.dwHeight = iheight; ddsd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; ddsd.ddpfPixelFormat.dwRGBBitCount = 32; ddsd.ddpfPixelFormat.dwRBitMask = 0xff0000; ddsd.ddpfPixelFormat.dwGBitMask = 0x00ff00; ddsd.ddpfPixelFormat.dwBBitMask = 0x0000ff; if(lpdd7->CreateSurface(&ddsd, &raster, 0) == DD_OK) return clear(); try_native_surface: memset(&ddsd, 0, sizeof(DDSURFACEDESC2)); ddsd.dwSize = sizeof(DDSURFACEDESC2); ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; //DDSCAPS_SYSTEMMEMORY ddsd.dwWidth = iwidth; ddsd.dwHeight = iheight; if(lpdd7->CreateSurface(&ddsd, &raster, 0) == DD_OK) return clear(); } void clear() { DDBLTFX fx; fx.dwSize = sizeof(DDBLTFX); fx.dwFillColor = 0x00000000; screen->Blt(0, 0, 0, DDBLT_WAIT | DDBLT_COLORFILL, &fx); raster->Blt(0, 0, 0, DDBLT_WAIT | DDBLT_COLORFILL, &fx); } bool lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) { if(width != settings.width || height != settings.height) { resize(settings.width = width, settings.height = height); } if(raster->Lock(0, &ddsd, DDLOCK_WAIT, 0) != DD_OK) { raster->Restore(); if(raster->Lock(0, &ddsd, DDLOCK_WAIT, 0) != DD_OK) return false; } pitch = ddsd.lPitch; return data = (uint32_t*)ddsd.lpSurface; } void unlock() { raster->Unlock(0); } void refresh() { if(settings.synchronize) { while(true) { BOOL in_vblank; lpdd7->GetVerticalBlankStatus(&in_vblank); if(in_vblank == true) break; } } HRESULT hr; RECT rd, rs; SetRect(&rs, 0, 0, settings.width, settings.height); POINT p = {0, 0}; ClientToScreen(settings.handle, &p); GetClientRect(settings.handle, &rd); OffsetRect(&rd, p.x, p.y); if(screen->Blt(&rd, raster, &rs, DDBLT_WAIT, 0) == DDERR_SURFACELOST) { screen->Restore(); raster->Restore(); } } bool init() { term(); DirectDrawCreate(0, &lpdd, 0); lpdd->QueryInterface(IID_IDirectDraw7, (void**)&lpdd7); if(lpdd) { lpdd->Release(); lpdd = 0; } lpdd7->SetCooperativeLevel(settings.handle, DDSCL_NORMAL); memset(&ddsd, 0, sizeof(DDSURFACEDESC2)); ddsd.dwSize = sizeof(DDSURFACEDESC2); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; lpdd7->CreateSurface(&ddsd, &screen, 0); lpdd7->CreateClipper(0, &clipper, 0); clipper->SetHWnd(0, settings.handle); screen->SetClipper(clipper); raster = 0; iwidth = 0; iheight = 0; resize(settings.width = 256, settings.height = 256); return true; } void term() { if(clipper) { clipper->Release(); clipper = 0; } if(raster) { raster->Release(); raster = 0; } if(screen) { screen->Release(); screen = 0; } if(lpdd7) { lpdd7->Release(); lpdd7 = 0; } if(lpdd) { lpdd->Release(); lpdd = 0; } } pVideoDD() { lpdd = 0; lpdd7 = 0; screen = 0; raster = 0; clipper = 0; settings.handle = 0; } }; DeclareVideo(DD) }; phoenix/cocoa/browser-window.hpp000664 001750 001750 00000000321 12651764221 020143 0ustar00sergiosergio000000 000000 namespace phoenix { struct pBrowserWindow { static string directory(BrowserWindow::State& state); static string open(BrowserWindow::State& state); static string save(BrowserWindow::State& state); }; } target-ethos/settings/advanced.cpp000664 001750 001750 00000005742 12651764221 020437 0ustar00sergiosergio000000 000000 AdvancedSettings* advancedSettings = nullptr; AdvancedSettings::AdvancedSettings() { driverTitle.setFont(program->boldFont); driverTitle.setText("Driver Selection:"); videoLabel.setText("Video:"); audioLabel.setText("Audio:"); inputLabel.setText("Input:"); libraryTitle.setFont(program->boldFont); libraryTitle.setText("Game Library:"); libraryLabel.setText("Path:"); libraryPath.setEditable(false); libraryPath.setText(utility->libraryPath()); libraryBrowse.setText("Browse ..."); libraryShowOnStartup.setChecked(config->library.showOnStartup); libraryShowOnStartup.setText("Show game library on program start"); information.setText("Note: changing advanced settings requires program restart to take effect."); infoLabel.setFont(program->boldFont); infoLabel.setText({ Emulator::Name, " v", Emulator::Version, "\n", " ", Emulator::Profile, " Profile\n", " Author: ", Emulator::Author, "\n", " License: ", Emulator::License, "\n", " Website: ", Emulator::Website }); lstring list; list.split(";", video.availableDrivers()); for(unsigned n = 0; n < list.size(); n++) { videoDriver.append(list[n]); if(list[n] == config->video.driver) videoDriver.setSelection(n); } list.split(";", audio.availableDrivers()); for(unsigned n = 0; n < list.size(); n++) { audioDriver.append(list[n]); if(list[n] == config->audio.driver) audioDriver.setSelection(n); } list.split(";", input.availableDrivers()); for(unsigned n = 0; n < list.size(); n++) { inputDriver.append(list[n]); if(list[n] == config->input.driver) inputDriver.setSelection(n); } append(driverTitle, {~0, 0}); append(driverLayout, {~0, 0}, 15); driverLayout.append(videoLabel, {0, 0}, 5); driverLayout.append(videoDriver, {~0, 0}, 5); driverLayout.append(audioLabel, {0, 0}, 5); driverLayout.append(audioDriver, {~0, 0}, 5); driverLayout.append(inputLabel, {0, 0}, 5); driverLayout.append(inputDriver, {~0, 0}); append(libraryTitle, {~0, 0}); append(libraryLayout, {~0, 0}); libraryLayout.append(libraryLabel, {0, 0}, 5); libraryLayout.append(libraryPath, {~0, 0}, 5); libraryLayout.append(libraryBrowse, {80, 0}); append(libraryShowOnStartup, {~0, 0}, 15); append(information, {~0, 0}, 15); if(Intrinsics::platform() != Intrinsics::Platform::MacOSX) { append(spacer, {~0, ~0}); append(infoLabel, {~0, 0}); } videoDriver.onChange = [&] { config->video.driver = videoDriver.text(); }; audioDriver.onChange = [&] { config->audio.driver = audioDriver.text(); }; inputDriver.onChange = [&] { config->input.driver = inputDriver.text(); }; libraryBrowse.onActivate = [&] { string path = BrowserWindow().setParent(*settings).setPath(userpath()).directory(); if(path.empty()) return; file::write({configpath(), "higan/library.bml"}, {"Path: ", path, "\n"}); libraryPath.setText(path); }; libraryShowOnStartup.onToggle = [&] { config->library.showOnStartup = libraryShowOnStartup.checked(); }; } phoenix/cocoa/widget/radio-button.cpp000664 001750 001750 00000004523 12651764221 021050 0ustar00sergiosergio000000 000000 @implementation CocoaRadioButton : NSButton -(id) initWith:(phoenix::RadioButton&)radioButtonReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { radioButton = &radioButtonReference; [self setTarget:self]; [self setAction:@selector(activate:)]; [self setBezelStyle:NSRegularSquareBezelStyle]; [self setButtonType:NSOnOffButton]; } return self; } -(IBAction) activate:(id)sender { bool wasChecked = radioButton->state.checked; radioButton->setChecked(); if(wasChecked == false) { if(radioButton->onActivate) radioButton->onActivate(); } } @end namespace phoenix { Size pRadioButton::minimumSize() { Size size = Font::size(radioButton.font(), radioButton.state.text); if(radioButton.state.orientation == Orientation::Horizontal) { size.width += radioButton.state.image.width; size.height = max(radioButton.state.image.height, size.height); } if(radioButton.state.orientation == Orientation::Vertical) { size.width = max(radioButton.state.image.width, size.width); size.height += radioButton.state.image.height; } return {size.width + 20, size.height + 4}; } void pRadioButton::setChecked() { @autoreleasepool { for(auto& button : radioButton.state.group) { auto state = (&button == &radioButton) ? NSOnState : NSOffState; [button.p.cocoaView setState:state]; } } } void pRadioButton::setGeometry(Geometry geometry) { pWidget::setGeometry({ geometry.x - 2, geometry.y - 2, geometry.width + 4, geometry.height + 4 }); } void pRadioButton::setGroup(const group& group) { } void pRadioButton::setImage(const image& image, Orientation orientation) { @autoreleasepool { if(image.empty()) { [cocoaView setImage:nil]; return; } [cocoaView setImage:NSMakeImage(image)]; if(orientation == Orientation::Horizontal) [cocoaView setImagePosition:NSImageLeft]; if(orientation == Orientation::Vertical ) [cocoaView setImagePosition:NSImageAbove]; } } void pRadioButton::setText(string text) { @autoreleasepool { [cocoaView setTitle:[NSString stringWithUTF8String:text]]; } } void pRadioButton::constructor() { @autoreleasepool { cocoaView = cocoaRadioButton = [[CocoaRadioButton alloc] initWith:radioButton]; } } void pRadioButton::destructor() { @autoreleasepool { [cocoaView release]; } } } gb/ppu/serialization.cpp000664 001750 001750 00000002575 12651764221 016476 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP void PPU::serialize(serializer& s) { Thread::serialize(s); s.array(vram); s.array(oam); s.array(bgp); s.array(obp[0]); s.array(obp[1]); s.array(bgpd); s.array(obpd); s.integer(status.lx); s.integer(status.display_enable); s.integer(status.window_tilemap_select); s.integer(status.window_display_enable); s.integer(status.bg_tiledata_select); s.integer(status.bg_tilemap_select); s.integer(status.ob_size); s.integer(status.ob_enable); s.integer(status.bg_enable); s.integer(status.interrupt_lyc); s.integer(status.interrupt_oam); s.integer(status.interrupt_vblank); s.integer(status.interrupt_hblank); s.integer(status.scy); s.integer(status.scx); s.integer(status.ly); s.integer(status.lyc); s.integer(status.wy); s.integer(status.wx); s.integer(status.vram_bank); s.integer(status.bgpi_increment); s.integer(status.bgpi); s.integer(status.obpi_increment); s.integer(status.obpi); s.array(screen); s.integer(bg.color); s.integer(bg.palette); s.integer(bg.priority); s.integer(ob.color); s.integer(ob.palette); s.integer(ob.priority); for(auto& o : sprite) { s.integer(o.x); s.integer(o.y); s.integer(o.tile); s.integer(o.attr); } s.integer(sprites); s.integer(background.attr); s.integer(background.data); s.integer(window.attr); s.integer(window.data); } #endif gba/cpu/memory.cpp000664 001750 001750 00000003154 12651764221 015247 0ustar00sergiosergio000000 000000 uint32 CPU::iwram_read(uint32 addr, uint32 size) { if(regs.memory.control.disable) return cpu.pipeline.fetch.instruction; if(size == Word) return iwram_read(addr &~ 2, Half) << 0 | iwram_read(addr | 2, Half) << 16; if(size == Half) return iwram_read(addr &~ 1, Byte) << 0 | iwram_read(addr | 1, Byte) << 8; return iwram[addr & 0x7fff]; } void CPU::iwram_write(uint32 addr, uint32 size, uint32 word) { if(regs.memory.control.disable) return; if(size == Word) { iwram_write(addr &~2, Half, word >> 0); iwram_write(addr | 2, Half, word >> 16); return; } if(size == Half) { iwram_write(addr &~1, Byte, word >> 0); iwram_write(addr | 1, Byte, word >> 8); return; } iwram[addr & 0x7fff] = word; } uint32 CPU::ewram_read(uint32 addr, uint32 size) { if(regs.memory.control.disable) return cpu.pipeline.fetch.instruction; if(regs.memory.control.ewram == false) return iwram_read(addr, size); if(size == Word) return ewram_read(addr &~ 2, Half) << 0 | ewram_read(addr | 2, Half) << 16; if(size == Half) return ewram_read(addr &~ 1, Byte) << 0 | ewram_read(addr | 1, Byte) << 8; return ewram[addr & 0x3ffff]; } void CPU::ewram_write(uint32 addr, uint32 size, uint32 word) { if(regs.memory.control.disable) return; if(regs.memory.control.ewram == false) return iwram_write(addr, size, word); if(size == Word) { ewram_write(addr &~2, Half, word >> 0); ewram_write(addr | 2, Half, word >> 16); return; } if(size == Half) { ewram_write(addr &~1, Byte, word >> 0); ewram_write(addr | 1, Byte, word >> 8); return; } ewram[addr & 0x3ffff] = word; } sfc/chip/spc7110/spc7110.hpp000664 001750 001750 00000006504 12651764221 016320 0ustar00sergiosergio000000 000000 struct Decompressor; struct SPC7110 : Coprocessor { MappedRAM prom; //program ROM MappedRAM drom; //data ROM MappedRAM ram; static void Enter(); void enter(); void init(); void load(); void unload(); void power(); void reset(); void add_clocks(unsigned clocks); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); uint8 mcurom_read(unsigned addr); void mcurom_write(unsigned addr, uint8 data); uint8 mcuram_read(unsigned addr); void mcuram_write(unsigned addr, uint8 data); void serialize(serializer&); SPC7110(); ~SPC7110(); //dcu.cpp void dcu_load_address(); void dcu_begin_transfer(); uint8 dcu_read(); void deinterleave_1bpp(unsigned length); void deinterleave_2bpp(unsigned length); void deinterleave_4bpp(unsigned length); //data.cpp uint8 datarom_read(unsigned addr); unsigned data_offset(); unsigned data_adjust(); unsigned data_stride(); void set_data_offset(unsigned addr); void set_data_adjust(unsigned addr); void data_port_read(); void data_port_increment_4810(); void data_port_increment_4814(); void data_port_increment_4815(); void data_port_increment_481a(); //alu.cpp void alu_multiply(); void alu_divide(); private: //================== //decompression unit //================== uint8 r4801; //compression table B0 uint8 r4802; //compression table B1 uint7 r4803; //compression table B2 uint8 r4804; //compression table index uint8 r4805; //adjust length B0 uint8 r4806; //adjust length B1 uint8 r4807; //stride length uint8 r4809; //compression counter B0 uint8 r480a; //compression counter B1 uint8 r480b; //decompression settings uint8 r480c; //decompression status bool dcu_pending; uint2 dcu_mode; uint23 dcu_addr; unsigned dcu_offset; uint8 dcu_tile[32]; Decompressor* decompressor; //============== //data port unit //============== uint8 r4810; //data port read + seek uint8 r4811; //data offset B0 uint8 r4812; //data offset B1 uint7 r4813; //data offset B2 uint8 r4814; //data adjust B0 uint8 r4815; //data adjust B1 uint8 r4816; //data stride B0 uint8 r4817; //data stride B1 uint8 r4818; //data port settings uint8 r481a; //data port seek //===================== //arithmetic logic unit //===================== uint8 r4820; //16-bit multiplicand B0, 32-bit dividend B0 uint8 r4821; //16-bit multiplicand B1, 32-bit dividend B1 uint8 r4822; //32-bit dividend B2 uint8 r4823; //32-bit dividend B3 uint8 r4824; //16-bit multiplier B0 uint8 r4825; //16-bit multiplier B1 uint8 r4826; //16-bit divisor B0 uint8 r4827; //16-bit divisor B1 uint8 r4828; //32-bit product B0, 32-bit quotient B0 uint8 r4829; //32-bit product B1, 32-bit quotient B1 uint8 r482a; //32-bit product B2, 32-bit quotient B2 uint8 r482b; //32-bit product B3, 32-bit quotient B3 uint8 r482c; //16-bit remainder B0 uint8 r482d; //16-bit remainder B1 uint8 r482e; //math settings uint8 r482f; //math status bool mul_pending; bool div_pending; //=================== //memory control unit //=================== uint8 r4830; //bank 0 mapping + SRAM write enable uint8 r4831; //bank 1 mapping uint8 r4832; //bank 2 mapping uint8 r4833; //bank 3 mapping uint8 r4834; //bank mapping settings }; extern SPC7110 spc7110; phoenix/windows/timer.cpp000664 001750 001750 00000001312 12651764221 016675 0ustar00sergiosergio000000 000000 namespace phoenix { static vector timers; static void CALLBACK Timer_timeoutProc(HWND hwnd, UINT msg, UINT_PTR timerID, DWORD time) { for(auto& timer : timers) { if(timer->htimer == timerID) { if(timer->timer.onActivate) timer->timer.onActivate(); return; } } } void pTimer::setEnabled(bool enabled) { if(htimer) { KillTimer(NULL, htimer); htimer = 0; } if(enabled == true) { htimer = SetTimer(NULL, 0u, timer.state.interval, Timer_timeoutProc); } } void pTimer::setInterval(unsigned interval) { //destroy and recreate timer if interval changed setEnabled(timer.state.enabled); } void pTimer::constructor() { timers.append(this); htimer = 0; } } phoenix/cocoa/font.hpp000664 001750 001750 00000000527 12651764221 016131 0ustar00sergiosergio000000 000000 namespace phoenix { struct pFont { static string serif(unsigned size, string style); static string sans(unsigned size, string style); static string monospace(unsigned size, string style); static Size size(string font, string text); static NSFont* cocoaFont(string description); static Size size(NSFont* font, string text); }; } sfc/ppu/background/000700 001750 001750 00000000000 12656700342 015371 5ustar00sergiosergio000000 000000 gba/memory/memory.hpp000664 001750 001750 00000001264 12651764221 015775 0ustar00sergiosergio000000 000000 struct Memory { virtual uint32 read(uint32 addr, uint32 size) = 0; virtual void write(uint32 addr, uint32 size, uint32 word) = 0; }; struct MMIO : Memory { virtual uint8 read(uint32 addr) = 0; virtual void write(uint32 addr, uint8 data) = 0; uint32 read(uint32 addr, uint32 size); void write(uint32 addr, uint32 size, uint32 word); }; struct Bus : Memory { Memory* mmio[0x400]; bool idleflag; static uint32 mirror(uint32 addr, uint32 size); uint32 speed(uint32 addr, uint32 size); void idle(uint32 addr); uint32 read(uint32 addr, uint32 size); void write(uint32 addr, uint32 size, uint32 word); void power(); void serialize(serializer&); }; extern Bus bus; nall/dsp/settings.hpp000664 001750 001750 00000002633 12651764221 016001 0ustar00sergiosergio000000 000000 #ifdef NALL_DSP_INTERNAL_HPP void DSP::setChannels(unsigned channels) { assert(channels > 0); buffer.setChannels(channels); output.setChannels(channels); settings.channels = channels; } void DSP::setPrecision(unsigned precision) { settings.precision = precision; settings.intensity = 1 << (settings.precision - 1); settings.intensityInverse = 1.0 / settings.intensity; } void DSP::setFrequency(real frequency) { settings.frequency = frequency; resampler->setFrequency(); } void DSP::setVolume(real volume) { settings.volume = volume; } void DSP::setBalance(real balance) { settings.balance = balance; } void DSP::setResampler(ResampleEngine engine) { if(resampler) delete resampler; switch(engine) { case ResampleEngine::Nearest: resampler = new ResampleNearest(*this); return; case ResampleEngine::Linear: resampler = new ResampleLinear (*this); return; case ResampleEngine::Cosine: resampler = new ResampleCosine (*this); return; case ResampleEngine::Cubic: resampler = new ResampleCubic (*this); return; case ResampleEngine::Hermite: resampler = new ResampleHermite(*this); return; case ResampleEngine::Average: resampler = new ResampleAverage(*this); return; case ResampleEngine::Sinc: resampler = new ResampleSinc (*this); return; } throw; } void DSP::setResamplerFrequency(real frequency) { resampler->frequency = frequency; resampler->setFrequency(); } #endif sfc/chip/spc7110/decompressor.cpp000664 001750 001750 00000014151 12651764221 017717 0ustar00sergiosergio000000 000000 //SPC7110 decompressor //original implementation: neviksti //optimized implementation: cydrak struct Decompressor { SPC7110& spc7110; Decompressor(SPC7110& spc7110) : spc7110(spc7110) {} uint8 read() { return spc7110.datarom_read(offset++); } //inverse morton code transform: unpack big-endian packed pixels //returns odd bits in lower half; even bits in upper half uint32 deinterleave(uint64 data, unsigned bits) { data = data & (1ull << bits) - 1; data = 0x5555555555555555ull & (data << bits | data >> 1); data = 0x3333333333333333ull & (data | data >> 1); data = 0x0f0f0f0f0f0f0f0full & (data | data >> 2); data = 0x00ff00ff00ff00ffull & (data | data >> 4); data = 0x0000ffff0000ffffull & (data | data >> 8); return data | data >> 16; } //extract a nibble and move it to the low four bits uint64 moveToFront(uint64 list, unsigned nibble) { for(uint64 n = 0, mask = ~15; n < 64; n += 4, mask <<= 4) { if((list >> n & 15) != nibble) continue; return list = (list & mask) + (list << 4 & ~mask) + nibble; } return list; } void initialize(unsigned mode, unsigned origin) { for(auto &root : context) for(auto &node : root) node = {0, 0}; bpp = 1 << mode; offset = origin; bits = 8; range = Max + 1; input = read(); input = input << 8 | read(); output = 0; pixels = 0; colormap = 0xfedcba9876543210ull; } void decode() { for(unsigned pixel = 0; pixel < 8; pixel++) { uint64 map = colormap; unsigned diff = 0; if(bpp > 1) { unsigned pa = (bpp == 2 ? pixels >> 2 & 3 : pixels >> 0 & 15); unsigned pb = (bpp == 2 ? pixels >> 14 & 3 : pixels >> 28 & 15); unsigned pc = (bpp == 2 ? pixels >> 16 & 3 : pixels >> 32 & 15); if(pa != pb || pb != pc) { unsigned match = pa ^ pb ^ pc; diff = 4; //no match; all pixels differ if((match ^ pc) == 0) diff = 3; //a == b; pixel c differs if((match ^ pb) == 0) diff = 2; //c == a; pixel b differs if((match ^ pa) == 0) diff = 1; //b == c; pixel a differs } colormap = moveToFront(colormap, pa); map = moveToFront(map, pc); map = moveToFront(map, pb); map = moveToFront(map, pa); } for(unsigned plane = 0; plane < bpp; plane++) { unsigned bit = bpp > 1 ? 1 << plane : 1 << (pixel & 3); unsigned history = bit - 1 & output; unsigned set = 0; if(bpp == 1) set = pixel >= 4; if(bpp == 2) set = diff; if(plane >= 2 && history <= 1) set = diff; auto& ctx = context[set][bit + history - 1]; auto& model = evolution[ctx.prediction]; uint8 lps_offset = range - model.probability; bool symbol = input >= (lps_offset << 8); //test only the MSB output = output << 1 | (symbol ^ ctx.swap); if(symbol == MPS) { //[0 ... range-p] range = lps_offset; //range = range-p } else { //[range-p+1 ... range] range -= lps_offset; //range = p-1, with p < 0.75 input -= lps_offset << 8; //therefore, always rescale } while(range <= Max / 2) { //scale back into [0.75 ... 1.5] ctx.prediction = model.next[symbol]; range <<= 1; input <<= 1; if(--bits == 0) { bits = 8; input += read(); } } if(symbol == LPS && model.probability > Half) ctx.swap ^= 1; } unsigned index = output & (1 << bpp) - 1; if(bpp == 1) index ^= pixels >> 15 & 1; pixels = pixels << bpp | (map >> 4 * index & 15); } if(bpp == 1) result = pixels; if(bpp == 2) result = deinterleave(pixels, 16); if(bpp == 4) result = deinterleave(deinterleave(pixels, 32), 32); } void serialize(serializer& s) { for(auto& root : context) { for(auto& node : root) { s.integer(node.prediction); s.integer(node.swap); } } s.integer(bpp); s.integer(offset); s.integer(bits); s.integer(range); s.integer(input); s.integer(output); s.integer(pixels); s.integer(colormap); s.integer(result); } enum : unsigned { MPS = 0, LPS = 1 }; enum : unsigned { One = 0xaa, Half = 0x55, Max = 0xff }; struct ModelState { uint8 probability; //of the more probable symbol (MPS) uint8 next[2]; //next state after output {MPS, LPS} }; static ModelState evolution[53]; struct Context { uint8 prediction; //current model state uint8 swap; //if 1, exchange the role of MPS and LPS } context[5][15]; //not all 75 contexts exists; this simplifies the code unsigned bpp; //bits per pixel (1bpp = 1; 2bpp = 2; 4bpp = 4) unsigned offset; //SPC7110 data ROM read offset unsigned bits; //bits remaining in input uint16 range; //arithmetic range: technically 8-bits, but Max+1 = 256 uint16 input; //input data from SPC7110 data ROM uint8 output; uint64 pixels; uint64 colormap; //most recently used list uint32 result; //decompressed word after calling decode() }; Decompressor::ModelState Decompressor::evolution[53] = { {0x5a, { 1, 1}}, {0x25, { 2, 6}}, {0x11, { 3, 8}}, {0x08, { 4,10}}, {0x03, { 5,12}}, {0x01, { 5,15}}, {0x5a, { 7, 7}}, {0x3f, { 8,19}}, {0x2c, { 9,21}}, {0x20, {10,22}}, {0x17, {11,23}}, {0x11, {12,25}}, {0x0c, {13,26}}, {0x09, {14,28}}, {0x07, {15,29}}, {0x05, {16,31}}, {0x04, {17,32}}, {0x03, {18,34}}, {0x02, { 5,35}}, {0x5a, {20,20}}, {0x48, {21,39}}, {0x3a, {22,40}}, {0x2e, {23,42}}, {0x26, {24,44}}, {0x1f, {25,45}}, {0x19, {26,46}}, {0x15, {27,25}}, {0x11, {28,26}}, {0x0e, {29,26}}, {0x0b, {30,27}}, {0x09, {31,28}}, {0x08, {32,29}}, {0x07, {33,30}}, {0x05, {34,31}}, {0x04, {35,33}}, {0x04, {36,33}}, {0x03, {37,34}}, {0x02, {38,35}}, {0x02, { 5,36}}, {0x58, {40,39}}, {0x4d, {41,47}}, {0x43, {42,48}}, {0x3b, {43,49}}, {0x34, {44,50}}, {0x2e, {45,51}}, {0x29, {46,44}}, {0x25, {24,45}}, {0x56, {48,47}}, {0x4f, {49,47}}, {0x47, {50,48}}, {0x41, {51,49}}, {0x3c, {52,50}}, {0x37, {43,51}}, }; ruby/input/joypad/udev.cpp000664 001750 001750 00000021535 12651764221 016773 0ustar00sergiosergio000000 000000 #ifndef RUBY_INPUT_JOYPAD_UDEV #define RUBY_INPUT_JOYPAD_UDEV namespace ruby { struct InputJoypadUdev { udev* context = nullptr; udev_monitor* monitor = nullptr; udev_enumerate* enumerator = nullptr; udev_list_entry* devices = nullptr; udev_list_entry* item = nullptr; struct JoypadInput { signed code = 0; unsigned id = 0; int16_t value = 0; input_absinfo info; JoypadInput() {} JoypadInput(signed code) : code(code) {} JoypadInput(signed code, unsigned id) : code(code), id(id) {} bool operator< (const JoypadInput& source) const { return code < source.code; } bool operator==(const JoypadInput& source) const { return code == source.code; } }; struct Joypad { HID::Joypad hid; int fd = -1; dev_t device = 0; string deviceName; string deviceNode; uint8_t evbit[(EV_MAX + 7) / 8] = {0}; uint8_t keybit[(KEY_MAX + 7) / 8] = {0}; uint8_t absbit[(ABS_MAX + 7) / 8] = {0}; uint8_t ffbit[(FF_MAX + 7) / 8] = {0}; unsigned effects = 0; string name; string manufacturer; string product; string serial; string vendorID; string productID; set axes; set hats; set buttons; bool rumble = false; unsigned effectID = 0; }; vector joypads; void assign(HID::Joypad& hid, unsigned groupID, unsigned inputID, int16_t value) { auto& group = hid.group[groupID]; if(group.input[inputID].value == value) return; if(input.onChange) input.onChange(hid, groupID, inputID, group.input[inputID].value, value); group.input[inputID].value = value; } void poll(vector& devices) { while(hotplugDevicesAvailable()) hotplugDevice(); for(auto& jp : joypads) { input_event events[32]; signed length = 0; while((length = read(jp.fd, events, sizeof(events))) > 0) { length /= sizeof(input_event); for(unsigned i = 0; i < length; i++) { signed code = events[i].code; signed type = events[i].type; signed value = events[i].value; if(type == EV_ABS) { if(auto input = jp.axes.find({code})) { signed range = input().info.maximum - input().info.minimum; value = (value - input().info.minimum) * 65535ll / range - 32767; assign(jp.hid, HID::Joypad::GroupID::Axis, input().id, sclamp<16>(value)); } else if(auto input = jp.hats.find({code})) { signed range = input().info.maximum - input().info.minimum; value = (value - input().info.minimum) * 65535ll / range - 32767; assign(jp.hid, HID::Joypad::GroupID::Hat, input().id, sclamp<16>(value)); } } else if(type == EV_KEY) { if(code >= BTN_MISC) { if(auto input = jp.buttons.find({code})) { assign(jp.hid, HID::Joypad::GroupID::Button, input().id, (bool)value); } } } } } devices.append(&jp.hid); } } bool rumble(uint64_t id, bool enable) { for(auto& jp : joypads) { if(jp.hid.id != id) continue; if(jp.hid.rumble == false) continue; input_event play; memset(&play, 0, sizeof(input_event)); play.type = EV_FF; play.code = jp.effectID; play.value = enable; write(jp.fd, &play, sizeof(input_event)); return true; } return false; } bool init() { context = udev_new(); if(context == nullptr) return false; monitor = udev_monitor_new_from_netlink(context, "udev"); if(monitor) { udev_monitor_filter_add_match_subsystem_devtype(monitor, "input", nullptr); udev_monitor_enable_receiving(monitor); } enumerator = udev_enumerate_new(context); if(enumerator) { udev_enumerate_add_match_property(enumerator, "ID_INPUT_JOYSTICK", "1"); udev_enumerate_scan_devices(enumerator); devices = udev_enumerate_get_list_entry(enumerator); for(udev_list_entry* item = devices; item != nullptr; item = udev_list_entry_get_next(item)) { string name = udev_list_entry_get_name(item); udev_device* device = udev_device_new_from_syspath(context, name); string deviceNode = udev_device_get_devnode(device); if(deviceNode) createJoypad(device, deviceNode); udev_device_unref(device); } } return true; } void term() { if(enumerator) { udev_enumerate_unref(enumerator); enumerator = nullptr; } } private: bool hotplugDevicesAvailable() { pollfd fd = {0}; fd.fd = udev_monitor_get_fd(monitor); fd.events = POLLIN; return (::poll(&fd, 1, 0) == 1) && (fd.revents & POLLIN); } void hotplugDevice() { udev_device* device = udev_monitor_receive_device(monitor); if(device == nullptr) return; string value = udev_device_get_property_value(device, "ID_INPUT_JOYSTICK"); string action = udev_device_get_action(device); string deviceNode = udev_device_get_devnode(device); if(value == "1") { if(action == "add") { createJoypad(device, deviceNode); } if(action == "remove") { removeJoypad(device, deviceNode); } } } void createJoypad(udev_device* device, const string& deviceNode) { Joypad jp; jp.deviceNode = deviceNode; struct stat st; if(stat(deviceNode, &st) < 0) return; jp.device = st.st_rdev; jp.fd = open(deviceNode, O_RDWR | O_NONBLOCK); if(jp.fd < 0) return; uint8_t evbit[(EV_MAX + 7) / 8] = {0}; uint8_t keybit[(KEY_MAX + 7) / 8] = {0}; uint8_t absbit[(ABS_MAX + 7) / 8] = {0}; ioctl(jp.fd, EVIOCGBIT(0, sizeof(jp.evbit)), jp.evbit); ioctl(jp.fd, EVIOCGBIT(EV_KEY, sizeof(jp.keybit)), jp.keybit); ioctl(jp.fd, EVIOCGBIT(EV_ABS, sizeof(jp.absbit)), jp.absbit); ioctl(jp.fd, EVIOCGBIT(EV_FF, sizeof(jp.ffbit)), jp.ffbit); ioctl(jp.fd, EVIOCGEFFECTS, &jp.effects); #define testBit(buffer, bit) (buffer[(bit) >> 3] & 1 << ((bit) & 7)) if(testBit(jp.evbit, EV_KEY)) { if(udev_device* parent = udev_device_get_parent_with_subsystem_devtype(device, "input", nullptr)) { jp.name = udev_device_get_sysattr_value(parent, "name"); jp.vendorID = udev_device_get_sysattr_value(parent, "id/vendor"); jp.productID = udev_device_get_sysattr_value(parent, "id/product"); if(udev_device* root = udev_device_get_parent_with_subsystem_devtype(parent, "usb", "usb_device")) { if(jp.vendorID == udev_device_get_sysattr_value(root, "idVendor") && jp.productID == udev_device_get_sysattr_value(root, "idProduct") ) { jp.deviceName = udev_device_get_devpath(root); jp.manufacturer = udev_device_get_sysattr_value(root, "manufacturer"); jp.product = udev_device_get_sysattr_value(root, "product"); jp.serial = udev_device_get_sysattr_value(root, "serial"); } } } unsigned axes = 0; unsigned hats = 0; unsigned buttons = 0; for(signed i = 0; i < ABS_MISC; i++) { if(testBit(jp.absbit, i)) { if(i >= ABS_HAT0X && i <= ABS_HAT3Y) { if(auto hat = jp.hats.insert({i, hats++})) { ioctl(jp.fd, EVIOCGABS(i), &hat().info); } } else { if(auto axis = jp.axes.insert({i, axes++})) { ioctl(jp.fd, EVIOCGABS(i), &axis().info); } } } } for(signed i = BTN_JOYSTICK; i < KEY_MAX; i++) { if(testBit(jp.keybit, i)) { jp.buttons.insert({i, buttons++}); } } for(signed i = BTN_MISC; i < BTN_JOYSTICK; i++) { if(testBit(jp.keybit, i)) { jp.buttons.insert({i, buttons++}); } } jp.rumble = jp.effects >= 2 && testBit(jp.ffbit, FF_RUMBLE); if(jp.rumble) { ff_effect effect; memset(&effect, 0, sizeof(ff_effect)); effect.type = FF_RUMBLE; effect.id = -1; effect.u.rumble.strong_magnitude = 65535; effect.u.rumble.weak_magnitude = 65535; ioctl(jp.fd, EVIOCSFF, &effect); jp.effectID = effect.id; } createJoypadHID(jp); joypads.append(jp); } #undef testBit } void createJoypadHID(Joypad& jp) { uint64_t pathID = crc32_calculate((const uint8_t*)jp.deviceName.data(), jp.deviceName.size()); jp.hid.id = pathID << 32 | hex(jp.vendorID) << 16 | hex(jp.productID) << 0; for(unsigned n = 0; n < jp.axes.size(); n++) jp.hid.axis().append({n}); for(unsigned n = 0; n < jp.hats.size(); n++) jp.hid.hat().append({n}); for(unsigned n = 0; n < jp.buttons.size(); n++) jp.hid.button().append({n}); jp.hid.rumble = jp.rumble; } void removeJoypad(udev_device* device, const string& deviceNode) { for(unsigned n = 0; n < joypads.size(); n++) { if(joypads[n].deviceNode == deviceNode) { close(joypads[n].fd); joypads.remove(n); return; } } } }; } #endif phoenix/cocoa/application.cpp000664 001750 001750 00000005405 12651764221 017461 0ustar00sergiosergio000000 000000 @implementation CocoaDelegate : NSObject -(NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication*)sender { using phoenix::Application; if(Application::Cocoa::onQuit) Application::Cocoa::onQuit(); else Application::quit(); return NSTerminateCancel; } -(BOOL) applicationShouldHandleReopen:(NSApplication*)application hasVisibleWindows:(BOOL)flag { using phoenix::Application; if(Application::Cocoa::onActivate) Application::Cocoa::onActivate(); return NO; } -(void) run:(NSTimer*)timer { using phoenix::Application; if(Application::main) Application::main(); } -(void) updateInDock:(NSTimer*)timer { NSArray* windows = [NSApp windows]; for(unsigned n = 0; n < [windows count]; n++) { NSWindow* window = [windows objectAtIndex:n]; if([window isMiniaturized]) { [window updateInDock]; } } } @end CocoaDelegate* cocoaDelegate = nullptr; namespace phoenix { void pApplication::run() { //NSTimer* timer = [NSTimer scheduledTimerWithTimeInterval:0.1667 target:cocoaDelegate selector:@selector(updateInDock:) userInfo:nil repeats:YES]; if(Application::main) { NSTimer* timer = [NSTimer scheduledTimerWithTimeInterval:0.0 target:cocoaDelegate selector:@selector(run:) userInfo:nil repeats:YES]; //below line is needed to run application during window resize; however it has a large performance penalty on the resize smoothness //[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSEventTrackingRunLoopMode]; } @autoreleasepool { [NSApp run]; } } bool pApplication::pendingEvents() { bool result = false; @autoreleasepool { NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:NO]; if(event != nil) result = true; } return result; } void pApplication::processEvents() { @autoreleasepool { while(applicationState.quit == false) { NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES]; if(event == nil) break; [event retain]; [NSApp sendEvent:event]; [event release]; } } } void pApplication::quit() { @autoreleasepool { [NSApp stop:nil]; NSEvent* event = [NSEvent otherEventWithType:NSApplicationDefined location:NSMakePoint(0, 0) modifierFlags:0 timestamp:0.0 windowNumber:0 context:nil subtype:0 data1:0 data2:0]; [NSApp postEvent:event atStart:true]; } } void pApplication::initialize() { @autoreleasepool { [NSApplication sharedApplication]; cocoaDelegate = [[CocoaDelegate alloc] init]; [NSApp setDelegate:cocoaDelegate]; //every window has the default application menu; call this so it is displayed at startup [NSApp setMainMenu:[pWindow::none().p.cocoaWindow menu]]; } } } shaders/Scanline.shader/manifest.bml000664 001750 001750 00000000100 12651764221 020633 0ustar00sergiosergio000000 000000 program filter: linear wrap: border fragment: scanline.fs phoenix/windows/monitor.cpp000664 001750 001750 00000002344 12651764221 017252 0ustar00sergiosergio000000 000000 namespace phoenix { struct MonitorInfo { unsigned monitor = 0; unsigned primary = 0; unsigned index = 0; Geometry geometry; }; static BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) { MonitorInfo& info = *(MonitorInfo*)dwData; MONITORINFOEX mi; memset(&mi, 0, sizeof(MONITORINFOEX)); mi.cbSize = sizeof(MONITORINFOEX); GetMonitorInfo(hMonitor, &mi); string displayName = (const char*)utf8_t(mi.szDevice); if(displayName.beginsWith(R"(\\.\DISPLAYV)")) return TRUE; //ignore pseudo-monitors if(mi.dwFlags & MONITORINFOF_PRIMARY) info.primary = info.index; if(info.monitor == info.index) { info.geometry = {lprcMonitor->left, lprcMonitor->top, lprcMonitor->right - lprcMonitor->left, lprcMonitor->bottom - lprcMonitor->top}; } info.index++; return TRUE; } unsigned pMonitor::count() { return GetSystemMetrics(SM_CMONITORS); } Geometry pMonitor::geometry(unsigned monitor) { MonitorInfo info; info.monitor = monitor; EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, (LPARAM)&info); return info.geometry; } unsigned pMonitor::primary() { MonitorInfo info; EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, (LPARAM)&info); return info.primary; } } phoenix/cocoa/action/check-item.cpp000664 001750 001750 00000002063 12651764221 020441 0ustar00sergiosergio000000 000000 @implementation CocoaCheckItem : NSMenuItem -(id) initWith:(phoenix::CheckItem&)checkItemReference { if(self = [super initWithTitle:@"" action:@selector(activate) keyEquivalent:@""]) { checkItem = &checkItemReference; [self setTarget:self]; } return self; } -(void) activate { checkItem->state.checked = !checkItem->state.checked; auto state = checkItem->state.checked ? NSOnState : NSOffState; [self setState:state]; if(checkItem->onToggle) checkItem->onToggle(); } @end namespace phoenix { void pCheckItem::setChecked(bool checked) { @autoreleasepool { auto state = checked ? NSOnState : NSOffState; [cocoaAction setState:state]; } } void pCheckItem::setText(string text) { @autoreleasepool { [cocoaAction setTitle:[NSString stringWithUTF8String:text]]; } } void pCheckItem::constructor() { @autoreleasepool { cocoaAction = cocoaCheckItem = [[CocoaCheckItem alloc] initWith:checkItem]; setText(checkItem.state.text); } } void pCheckItem::destructor() { @autoreleasepool { [cocoaAction release]; } } } sfc/chip/icd2/icd2.hpp000664 001750 001750 00000000752 12651764221 015565 0ustar00sergiosergio000000 000000 struct ICD2 : Emulator::Interface::Bind, GameBoy::Interface::Hook, Coprocessor { unsigned revision; static void Enter(); void enter(); void init(); void load(); void unload(); void power(); void reset(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); void serialize(serializer&); private: Emulator::Interface::Bind* bind; GameBoy::Interface::Hook* hook; #include "interface/interface.hpp" #include "mmio/mmio.hpp" }; extern ICD2 icd2; phoenix/reference/widget/check-label.cpp000664 001750 001750 00000000274 12651764221 021444 0ustar00sergiosergio000000 000000 namespace phoenix { void pCheckLabel::setChecked(bool checked) { } void pCheckLabel::setText(string text) { } void pCheckLabel::constructor() { } void pCheckLabel::destructor() { } } sfc/ppu/screen/000700 001750 001750 00000000000 12656700342 014531 5ustar00sergiosergio000000 000000 nall/dsp/buffer.hpp000664 001750 001750 00000002026 12651764221 015406 0ustar00sergiosergio000000 000000 #ifdef NALL_DSP_INTERNAL_HPP struct Buffer { double** sample = nullptr; uint16_t rdoffset = 0; uint16_t wroffset = 0; unsigned channels = 0; void setChannels(unsigned channels) { if(sample) { for(unsigned c = 0; c < this->channels; c++) { if(sample[c]) delete[] sample[c]; } delete[] sample; } this->channels = channels; if(channels == 0) return; sample = new double*[channels]; for(unsigned c = 0; c < channels; c++) { sample[c] = new double[65536](); } } inline double& read(unsigned channel, signed offset = 0) { return sample[channel][(uint16_t)(rdoffset + offset)]; } inline double& write(unsigned channel, signed offset = 0) { return sample[channel][(uint16_t)(wroffset + offset)]; } inline void clear() { for(unsigned c = 0; c < channels; c++) { for(unsigned n = 0; n < 65536; n++) { sample[c][n] = 0; } } rdoffset = 0; wroffset = 0; } Buffer() { } ~Buffer() { setChannels(0); } }; #endif gb/cartridge/mbc3/mbc3.hpp000664 001750 001750 00000001042 12651764221 016422 0ustar00sergiosergio000000 000000 struct MBC3 : MMIO { bool ram_enable; //$0000-1fff uint8 rom_select; //$2000-3fff uint8 ram_select; //$4000-5fff bool rtc_latch; //$6000-7fff bool rtc_halt; unsigned rtc_second; unsigned rtc_minute; unsigned rtc_hour; unsigned rtc_day; bool rtc_day_carry; unsigned rtc_latch_second; unsigned rtc_latch_minute; unsigned rtc_latch_hour; unsigned rtc_latch_day; unsigned rtc_latch_day_carry; void second(); uint8 mmio_read(uint16 addr); void mmio_write(uint16 addr, uint8 data); void power(); } mbc3; gba/apu/registers.hpp000664 001750 001750 00000005163 12651764221 015753 0ustar00sergiosergio000000 000000 struct Registers { struct SoundBias { uint10 level; uint2 amplitude; operator uint16() const; uint16 operator=(uint16 source); SoundBias& operator=(const SoundBias&) = delete; } bias; unsigned clock; } regs; struct Sweep { uint3 shift; uint1 direction; uint3 frequency; uint1 enable; uint1 negate; uint3 period; }; struct Envelope { uint3 frequency; uint1 direction; uint4 volume; uint3 period; inline bool dacenable() const { return volume || direction; } }; struct Square { Envelope envelope; uint1 enable; uint6 length; uint2 duty; uint11 frequency; uint1 counter; uint1 initialize; signed shadowfrequency; uint1 signal; uint4 output; unsigned period; uint3 phase; uint4 volume; void run(); void clocklength(); void clockenvelope(); }; struct Square1 : Square { Sweep sweep; void runsweep(bool update); void clocksweep(); uint8 read(unsigned addr) const; void write(unsigned addr, uint8 byte); void power(); } square1; struct Square2 : Square { uint8 read(unsigned addr) const; void write(unsigned addr, uint8 byte); void power(); } square2; struct Wave { uint1 mode; uint1 bank; uint1 dacenable; uint8 length; uint3 volume; uint11 frequency; uint1 counter; uint1 initialize; uint4 pattern[32]; uint1 enable; uint4 output; uint4 patternaddr; uint1 patternbank; uint4 patternsample; unsigned period; void run(); void clocklength(); uint8 read(unsigned addr) const; void write(unsigned addr, uint8 byte); uint8 readram(unsigned addr) const; void writeram(unsigned addr, uint8 byte); void power(); } wave; struct Noise { Envelope envelope; uint6 length; uint3 divisor; uint1 narrowlfsr; uint4 frequency; uint1 counter; uint1 initialize; uint1 enable; uint15 lfsr; uint4 output; unsigned period; uint4 volume; unsigned divider() const; void run(); void clocklength(); void clockenvelope(); uint8 read(unsigned addr) const; void write(unsigned addr, uint8 byte); void power(); } noise; struct Sequencer { uint2 volume; uint3 lvolume; uint3 rvolume; uint1 lenable[4]; uint1 renable[4]; uint1 enable[4]; uint1 masterenable; uint12 base; uint3 step; int16 lsample; int16 rsample; uint8 read(unsigned addr) const; void write(unsigned addr, uint8 byte); void power(); } sequencer; struct FIFO { int8 sample[32]; int8 output; uint5 rdoffset; uint5 wroffset; uint6 size; uint1 volume; //0 = 50%, 1 = 100% uint1 lenable; uint1 renable; uint1 timer; void read(); void write(int8 byte); void reset(); void power(); } fifo[2]; phoenix/windows/widget/button.cpp000664 001750 001750 00000006420 12651764221 020360 0ustar00sergiosergio000000 000000 namespace phoenix { #ifndef Button_SetImageList //MinGW/32-bit has painfully outdated platform headers ... typedef struct { HIMAGELIST himl; RECT margin; UINT uAlign; } BUTTON_IMAGELIST, *PBUTTON_IMAGELIST; #define BUTTON_IMAGELIST_ALIGN_LEFT 0 #define BUTTON_IMAGELIST_ALIGN_RIGHT 1 #define BUTTON_IMAGELIST_ALIGN_TOP 2 #define BUTTON_IMAGELIST_ALIGN_BOTTOM 3 #define BUTTON_IMAGELIST_ALIGN_CENTER 4 #define BCM_FIRST 0x1600 #define BCM_SETIMAGELIST (BCM_FIRST+2) #define Button_SetImageList(hwnd, pbuttonImagelist) (WINBOOL)SNDMSG((hwnd),BCM_SETIMAGELIST,0,(LPARAM)(pbuttonImagelist)) #endif Size pButton::minimumSize() { Size size = pFont::size(hfont, button.state.text); if(button.state.orientation == Orientation::Horizontal) { size.width += button.state.image.width; size.height = max(button.state.image.height, size.height); } if(button.state.orientation == Orientation::Vertical) { size.width = max(button.state.image.width, size.width); size.height += button.state.image.height; } return {size.width + 20, size.height + 10}; } void pButton::setImage(const image& image, Orientation orientation) { nall::image nallImage = image; nallImage.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0); if(hbitmap) { DeleteObject(hbitmap); hbitmap = 0; } if(himagelist) { ImageList_Destroy(himagelist); himagelist = 0; } //Windows XP and earlier do not support translucent images //so we must blend with the button background color (which does not look great with XP gradient-button themes) if(OsVersion() < WindowsVista) nallImage.alphaBlend(GetSysColor(COLOR_BTNFACE)); hbitmap = CreateBitmap(nallImage); himagelist = ImageList_Create(nallImage.width, nallImage.height, ILC_COLOR32, 1, 0); ImageList_Add(himagelist, hbitmap, NULL); BUTTON_IMAGELIST list; list.himl = himagelist; switch(orientation) { case Orientation::Horizontal: SetRect(&list.margin, 5, 0, 0, 0); list.uAlign = BUTTON_IMAGELIST_ALIGN_LEFT; break; case Orientation::Vertical: SetRect(&list.margin, 0, 5, 0, 0); list.uAlign = BUTTON_IMAGELIST_ALIGN_TOP; break; } Button_SetImageList(hwnd, &list); setText(button.state.text); //update text to display nicely with image (or lack thereof) } void pButton::setText(string text) { if(text.empty()) { //bitmaps will not show up if text is empty SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | BS_BITMAP); } else { //text will not show up if BS_BITMAP is set SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~BS_BITMAP); } SetWindowText(hwnd, utf16_t(text)); } void pButton::constructor() { hwnd = CreateWindow(L"BUTTON", L"", WS_CHILD | WS_TABSTOP, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&button); setDefaultFont(); setImage(button.state.image, button.state.orientation); //setText(button.state.text); //called by setImage(); synchronize(); } void pButton::destructor() { if(hbitmap) { DeleteObject(hbitmap); hbitmap = 0; } if(himagelist) { ImageList_Destroy(himagelist); himagelist = 0; } DestroyWindow(hwnd); } void pButton::orphan() { destructor(); constructor(); } void pButton::onActivate() { if(button.onActivate) button.onActivate(); } } ruby/input/000700 001750 001750 00000000000 12656700342 014013 5ustar00sergiosergio000000 000000 profile/Famicom.sys/manifest.bml000664 001750 001750 00000000024 12651764221 020036 0ustar00sergiosergio000000 000000 system name:Famicom sfc/ppu/serialization.cpp000664 001750 001750 00000015257 12651764221 016662 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP void PPUcounter::serialize(serializer& s) { s.integer(status.interlace); s.integer(status.field); s.integer(status.vcounter); s.integer(status.hcounter); s.array(history.field); s.array(history.vcounter); s.array(history.hcounter); s.integer(history.index); } void PPU::serialize(serializer& s) { Thread::serialize(s); PPUcounter::serialize(s); s.array(vram); s.array(oam); s.array(cgram); s.integer(ppu1_version); s.integer(ppu2_version); s.integer(display.interlace); s.integer(display.overscan); s.integer(regs.ppu1_mdr); s.integer(regs.ppu2_mdr); s.integer(regs.vram_readbuffer); s.integer(regs.oam_latchdata); s.integer(regs.cgram_latchdata); s.integer(regs.bgofs_latchdata); s.integer(regs.mode7_latchdata); s.integer(regs.counters_latched); s.integer(regs.latch_hcounter); s.integer(regs.latch_vcounter); s.integer(regs.oam_iaddr); s.integer(regs.cgram_iaddr); s.integer(regs.display_disable); s.integer(regs.display_brightness); s.integer(regs.oam_baseaddr); s.integer(regs.oam_addr); s.integer(regs.oam_priority); s.integer(regs.bg3_priority); s.integer(regs.bgmode); s.integer(regs.mode7_hoffset); s.integer(regs.mode7_voffset); s.integer(regs.vram_incmode); s.integer(regs.vram_mapping); s.integer(regs.vram_incsize); s.integer(regs.vram_addr); s.integer(regs.mode7_repeat); s.integer(regs.mode7_vflip); s.integer(regs.mode7_hflip); s.integer(regs.m7a); s.integer(regs.m7b); s.integer(regs.m7c); s.integer(regs.m7d); s.integer(regs.m7x); s.integer(regs.m7y); s.integer(regs.cgram_addr); s.integer(regs.mode7_extbg); s.integer(regs.pseudo_hires); s.integer(regs.overscan); s.integer(regs.interlace); s.integer(regs.hcounter); s.integer(regs.vcounter); bg1.serialize(s); bg2.serialize(s); bg3.serialize(s); bg4.serialize(s); sprite.serialize(s); window.serialize(s); screen.serialize(s); } void PPU::Background::serialize(serializer& s) { s.integer(id); s.integer(regs.tiledata_addr); s.integer(regs.screen_addr); s.integer(regs.screen_size); s.integer(regs.mosaic); s.integer(regs.tile_size); s.integer(regs.mode); s.integer(regs.priority0); s.integer(regs.priority1); s.integer(regs.main_enable); s.integer(regs.sub_enable); s.integer(regs.hoffset); s.integer(regs.voffset); s.integer(cache.hoffset); s.integer(cache.voffset); s.integer(output.main.priority); s.integer(output.main.palette); s.integer(output.main.tile); s.integer(output.sub.priority); s.integer(output.sub.palette); s.integer(output.sub.tile); s.integer(x); s.integer(y); s.integer(mosaic.priority); s.integer(mosaic.palette); s.integer(mosaic.tile); s.integer(mosaic.vcounter); s.integer(mosaic.voffset); s.integer(mosaic.hcounter); s.integer(mosaic.hoffset); s.integer(tile_counter); s.integer(tile); s.integer(priority); s.integer(palette_number); s.integer(palette_index); s.array(data); } void PPU::Sprite::serialize(serializer& s) { for(unsigned i = 0; i < 128; i++) { s.integer(list[i].x); s.integer(list[i].y); s.integer(list[i].character); s.integer(list[i].nameselect); s.integer(list[i].vflip); s.integer(list[i].hflip); s.integer(list[i].priority); s.integer(list[i].palette); s.integer(list[i].size); } s.integer(t.x); s.integer(t.y); s.integer(t.item_count); s.integer(t.tile_count); s.integer(t.active); for(unsigned n = 0; n < 2; n++) { s.array(t.item[n]); for(unsigned i = 0; i < 34; i++) { s.integer(t.tile[n][i].x); s.integer(t.tile[n][i].priority); s.integer(t.tile[n][i].palette); s.integer(t.tile[n][i].hflip); s.integer(t.tile[n][i].d0); s.integer(t.tile[n][i].d1); s.integer(t.tile[n][i].d2); s.integer(t.tile[n][i].d3); } } s.integer(regs.main_enable); s.integer(regs.sub_enable); s.integer(regs.interlace); s.integer(regs.base_size); s.integer(regs.nameselect); s.integer(regs.tiledata_addr); s.integer(regs.first_sprite); s.integer(regs.priority0); s.integer(regs.priority1); s.integer(regs.priority2); s.integer(regs.priority3); s.integer(regs.time_over); s.integer(regs.range_over); s.integer(output.main.priority); s.integer(output.main.palette); s.integer(output.sub.priority); s.integer(output.sub.palette); } void PPU::Window::serialize(serializer& s) { s.integer(regs.bg1_one_enable); s.integer(regs.bg1_one_invert); s.integer(regs.bg1_two_enable); s.integer(regs.bg1_two_invert); s.integer(regs.bg2_one_enable); s.integer(regs.bg2_one_invert); s.integer(regs.bg2_two_enable); s.integer(regs.bg2_two_invert); s.integer(regs.bg3_one_enable); s.integer(regs.bg3_one_invert); s.integer(regs.bg3_two_enable); s.integer(regs.bg3_two_invert); s.integer(regs.bg4_one_enable); s.integer(regs.bg4_one_invert); s.integer(regs.bg4_two_enable); s.integer(regs.bg4_two_invert); s.integer(regs.oam_one_enable); s.integer(regs.oam_one_invert); s.integer(regs.oam_two_enable); s.integer(regs.oam_two_invert); s.integer(regs.col_one_enable); s.integer(regs.col_one_invert); s.integer(regs.col_two_enable); s.integer(regs.col_two_invert); s.integer(regs.one_left); s.integer(regs.one_right); s.integer(regs.two_left); s.integer(regs.two_right); s.integer(regs.bg1_mask); s.integer(regs.bg2_mask); s.integer(regs.bg3_mask); s.integer(regs.bg4_mask); s.integer(regs.oam_mask); s.integer(regs.col_mask); s.integer(regs.bg1_main_enable); s.integer(regs.bg1_sub_enable); s.integer(regs.bg2_main_enable); s.integer(regs.bg2_sub_enable); s.integer(regs.bg3_main_enable); s.integer(regs.bg3_sub_enable); s.integer(regs.bg4_main_enable); s.integer(regs.bg4_sub_enable); s.integer(regs.oam_main_enable); s.integer(regs.oam_sub_enable); s.integer(regs.col_main_mask); s.integer(regs.col_sub_mask); s.integer(output.main.color_enable); s.integer(output.sub.color_enable); s.integer(x); s.integer(one); s.integer(two); } void PPU::Screen::serialize(serializer& s) { s.integer(regs.addsub_mode); s.integer(regs.direct_color); s.integer(regs.color_mode); s.integer(regs.color_halve); s.integer(regs.bg1_color_enable); s.integer(regs.bg2_color_enable); s.integer(regs.bg3_color_enable); s.integer(regs.bg4_color_enable); s.integer(regs.oam_color_enable); s.integer(regs.back_color_enable); s.integer(regs.color_b); s.integer(regs.color_g); s.integer(regs.color_r); s.integer(math.main.color); s.integer(math.main.color_enable); s.integer(math.sub.color); s.integer(math.sub.color_enable); s.integer(math.transparent); s.integer(math.addsub_mode); s.integer(math.color_halve); } #endif sfc/000700 001750 001750 00000000000 12656700342 012446 5ustar00sergiosergio000000 000000 ruby/video/opengl/surface.hpp000664 001750 001750 00000007456 12651764221 017440 0ustar00sergiosergio000000 000000 void OpenGLSurface::allocate() { glGenVertexArrays(1, &vao); glBindVertexArray(vao); glGenBuffers(3, &vbo[0]); } void OpenGLSurface::size(unsigned w, unsigned h) { if(width == w && height == h) return; width = w, height = h; w = glrSize(w), h = glrSize(h); if(texture) { glDeleteTextures(1, &texture); texture = 0; } if(buffer) { delete[] buffer; buffer = nullptr; } buffer = new uint32_t[w * h](); glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0, getFormat(), getType(), buffer); if(framebuffer) { glBindFramebuffer(GL_DRAW_FRAMEBUFFER, framebuffer); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); delete[] buffer; buffer = nullptr; } } void OpenGLSurface::release() { if(vbo[0]) { glDeleteBuffers(3, &vbo[0]); for(auto &o : vbo) o = 0; } if(vao) { glDeleteVertexArrays(1, &vao); vao = 0; } if(vertex) { glDetachShader(program, vertex); glDeleteShader(vertex); vertex = 0; } if(geometry) { glDetachShader(program, geometry); glDeleteShader(geometry); geometry = 0; } if(fragment) { glDetachShader(program, fragment); glDeleteShader(fragment); fragment = 0; } if(texture) { glDeleteTextures(1, &texture); texture = 0; } if(framebuffer) { glDeleteFramebuffers(1, &framebuffer); framebuffer = 0; } if(program) { glDeleteProgram(program); program = 0; } width = 0, height = 0; } void OpenGLSurface::render(unsigned sourceWidth, unsigned sourceHeight, unsigned targetWidth, unsigned targetHeight) { glViewport(0, 0, targetWidth, targetHeight); float w = (float)sourceWidth / (float)glrSize(sourceWidth); float h = (float)sourceHeight / (float)glrSize(sourceHeight); float u = (float)targetWidth, v = (float)targetHeight; GLint location; GLfloat modelView[] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, }; GLfloat projection[] = { 2.0f/u, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f/v, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, -1.0f, -1.0f, 0.0f, 1.0f, }; GLfloat modelViewProjection[4 * 4]; Matrix::Multiply(modelViewProjection, modelView, 4, 4, projection, 4, 4); GLfloat vertices[] = { 0, 0, 0, 1, u, 0, 0, 1, 0, v, 0, 1, u, v, 0, 1, }; GLfloat positions[4 * 4]; for(unsigned n = 0; n < 16; n += 4) { Matrix::Multiply(&positions[n], &vertices[n], 1, 4, modelViewProjection, 4, 4); } GLfloat texCoords[] = { 0, 0, w, 0, 0, h, w, h, }; glrUniformMatrix4fv("modelView", modelView); glrUniformMatrix4fv("projection", projection); glrUniformMatrix4fv("modelViewProjection", modelViewProjection); glBindVertexArray(vao); glBindBuffer(GL_ARRAY_BUFFER, vbo[0]); glBufferData(GL_ARRAY_BUFFER, 16 * sizeof(GLfloat), vertices, GL_STATIC_DRAW); GLuint locationVertex = glGetAttribLocation(program, "vertex"); glEnableVertexAttribArray(locationVertex); glVertexAttribPointer(locationVertex, 4, GL_FLOAT, GL_FALSE, 0, 0); glBindBuffer(GL_ARRAY_BUFFER, vbo[1]); glBufferData(GL_ARRAY_BUFFER, 16 * sizeof(GLfloat), positions, GL_STATIC_DRAW); GLuint locationPosition = glGetAttribLocation(program, "position"); glEnableVertexAttribArray(locationPosition); glVertexAttribPointer(locationPosition, 4, GL_FLOAT, GL_FALSE, 0, 0); glBindBuffer(GL_ARRAY_BUFFER, vbo[2]); glBufferData(GL_ARRAY_BUFFER, 8 * sizeof(GLfloat), texCoords, GL_STATIC_DRAW); GLuint locationTexCoord = glGetAttribLocation(program, "texCoord"); glEnableVertexAttribArray(locationTexCoord); glVertexAttribPointer(locationTexCoord, 2, GL_FLOAT, GL_FALSE, 0, 0); glBindFragDataLocation(program, 0, "fragColor"); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glDisableVertexAttribArray(locationVertex); glDisableVertexAttribArray(locationPosition); glDisableVertexAttribArray(locationTexCoord); } profile/Game Boy Color.sys/boot.rom000664 001750 001750 00000004000 12651764221 020263 0ustar00sergiosergio000000 000000 1>|@SB*M~|1nJERJS||ff s nٙgcnܙ3>Gu&!" !L {4 r"# >O>@!ND͑O!B # !4x, p>P!"l(* !ˆF(!>0> /7G>/O~G*2Gyw>0>hjk* J Ci* !?@J>&>%>w$!0"/ by8 O!>8"O!C~̉y0y}(!~" y  xb(d {>( =yʑ ‘&Jb >O>AO>!Q !@ ~(!/ =(2 .>O!"#"# ͏ ͏ r#" !˜>"  O!˜>"< .( !8 !@> > b!K~3 .D0* I.K* >.4*G !*( yO yA8!_7W~( yO^8!3 ~~ ! G@ " H " P(+"" !d!O @  B J ++D `*!O   <=( x(!*(x -x> Vz_!:"{wz_! :"{w(C(L(>L>l!{J!zG* ?~|>~>>|><ߟ?><>?>>|||?>|>||6<=\X>pYi5u4oK9INCh )跆Rq]mg?kF('afj BEFAARBEKEK R-URAR INAILICE R|K ehf0<donnoonLn|jn-+dm`r|||eld@ hp x 8 HPX     @(((` 0 2cyB1nJEBRJ)/B=t~gwk-~Ku!S_JR~O~L:_%j#_ )  ~|?~ ?B~|a||@AB !"y|ruby/audio/alsa.cpp000664 001750 001750 00000014045 12651764221 015422 0ustar00sergiosergio000000 000000 //audio.alsa (2009-11-30) //authors: BearOso, byuu, Nach, RedDwarf #include namespace ruby { class pAudioALSA { public: struct { snd_pcm_t* handle; snd_pcm_format_t format; snd_pcm_uframes_t buffer_size; snd_pcm_uframes_t period_size; int channels; const char* name; } device; struct { uint32_t* data; unsigned length; } buffer; struct { bool synchronize; unsigned frequency; unsigned latency; } settings; bool cap(const string& name) { if(name == Audio::Synchronize) return true; if(name == Audio::Frequency) return true; if(name == Audio::Latency) return true; return false; } any get(const string& name) { if(name == Audio::Synchronize) return settings.synchronize; if(name == Audio::Frequency) return settings.frequency; if(name == Audio::Latency) return settings.latency; return false; } bool set(const string& name, const any& value) { if(name == Audio::Synchronize) { if(settings.synchronize != any_cast(value)) { settings.synchronize = any_cast(value); if(device.handle) init(); } return true; } if(name == Audio::Frequency) { if(settings.frequency != any_cast(value)) { settings.frequency = any_cast(value); if(device.handle) init(); } return true; } if(name == Audio::Latency) { if(settings.latency != any_cast(value)) { settings.latency = any_cast(value); if(device.handle) init(); } return true; } return false; } void sample(uint16_t left, uint16_t right) { if(!device.handle) return; buffer.data[buffer.length++] = left + (right << 16); if(buffer.length < device.period_size) return; snd_pcm_sframes_t avail; do { avail = snd_pcm_avail_update(device.handle); if(avail < 0) snd_pcm_recover(device.handle, avail, 1); if(avail < buffer.length) { if(settings.synchronize == false) { buffer.length = 0; return; } int error = snd_pcm_wait(device.handle, -1); if(error < 0) snd_pcm_recover(device.handle, error, 1); } } while(avail < buffer.length); //below code has issues with PulseAudio sound server #if 0 if(settings.synchronize == false) { snd_pcm_sframes_t avail = snd_pcm_avail_update(device.handle); if(avail < device.period_size) { buffer.length = 0; return; } } #endif uint32_t* buffer_ptr = buffer.data; int i = 4; while((buffer.length > 0) && i--) { snd_pcm_sframes_t written = snd_pcm_writei(device.handle, buffer_ptr, buffer.length); if(written < 0) { //no samples written snd_pcm_recover(device.handle, written, 1); } else if(written <= buffer.length) { buffer.length -= written; buffer_ptr += written; } } if(i < 0) { if(buffer.data == buffer_ptr) { buffer.length--; buffer_ptr++; } memmove(buffer.data, buffer_ptr, buffer.length * sizeof(uint32_t)); } } void clear() { } bool init() { term(); if(snd_pcm_open(&device.handle, device.name, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) { term(); return false; } //below code will not work with 24khz frequency rate (ALSA library bug) #if 0 if(snd_pcm_set_params(device.handle, device.format, SND_PCM_ACCESS_RW_INTERLEAVED, device.channels, settings.frequency, 1, settings.latency * 1000) < 0) { //failed to set device parameters term(); return false; } if(snd_pcm_get_params(device.handle, &device.buffer_size, &device.period_size) < 0) { device.period_size = settings.latency * 1000 * 1e-6 * settings.frequency / 4; } #endif snd_pcm_hw_params_t* hwparams; snd_pcm_sw_params_t* swparams; unsigned rate = settings.frequency; unsigned buffer_time = settings.latency * 1000; unsigned period_time = settings.latency * 1000 / 4; snd_pcm_hw_params_alloca(&hwparams); if(snd_pcm_hw_params_any(device.handle, hwparams) < 0) { term(); return false; } if(snd_pcm_hw_params_set_access(device.handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED) < 0 || snd_pcm_hw_params_set_format(device.handle, hwparams, device.format) < 0 || snd_pcm_hw_params_set_channels(device.handle, hwparams, device.channels) < 0 || snd_pcm_hw_params_set_rate_near(device.handle, hwparams, &rate, 0) < 0 || snd_pcm_hw_params_set_period_time_near(device.handle, hwparams, &period_time, 0) < 0 || snd_pcm_hw_params_set_buffer_time_near(device.handle, hwparams, &buffer_time, 0) < 0 ) { term(); return false; } if(snd_pcm_hw_params(device.handle, hwparams) < 0) { term(); return false; } if(snd_pcm_get_params(device.handle, &device.buffer_size, &device.period_size) < 0) { term(); return false; } snd_pcm_sw_params_alloca(&swparams); if(snd_pcm_sw_params_current(device.handle, swparams) < 0) { term(); return false; } if(snd_pcm_sw_params_set_start_threshold(device.handle, swparams, (device.buffer_size / device.period_size) * device.period_size) < 0 ) { term(); return false; } if(snd_pcm_sw_params(device.handle, swparams) < 0) { term(); return false; } buffer.data = new uint32_t[device.period_size]; return true; } void term() { if(device.handle) { //snd_pcm_drain(device.handle); //prevents popping noise; but causes multi-second lag snd_pcm_close(device.handle); device.handle = 0; } if(buffer.data) { delete[] buffer.data; buffer.data = 0; } } pAudioALSA() { device.handle = 0; device.format = SND_PCM_FORMAT_S16_LE; device.channels = 2; device.name = "default"; buffer.data = 0; buffer.length = 0; settings.synchronize = false; settings.frequency = 22050; settings.latency = 60; } ~pAudioALSA() { term(); } }; DeclareAudio(ALSA) }; libco/sjlj.c000664 001750 001750 00000004507 12651764221 014114 0ustar00sergiosergio000000 000000 /* libco.sjlj (2008-01-28) author: Nach license: public domain */ /* * Note this was designed for UNIX systems. Based on ideas expressed in a paper * by Ralf Engelschall. * For SJLJ on other systems, one would want to rewrite springboard() and * co_create() and hack the jmb_buf stack pointer. */ #define LIBCO_C #include "libco.h" #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct { sigjmp_buf context; void (*coentry)(void); void *stack; } cothread_struct; static thread_local cothread_struct co_primary; static thread_local cothread_struct *creating, *co_running = 0; static void springboard(int ignored) { if(sigsetjmp(creating->context, 0)) co_running->coentry(); } cothread_t co_active(void) { if (!co_running) co_running = &co_primary; return (cothread_t)co_running; } cothread_t co_create(unsigned int size, void (*coentry)(void)) { if(!co_running) co_running = &co_primary; cothread_struct *thread = (cothread_struct*)malloc(sizeof(cothread_struct)); if(thread) { struct sigaction handler; struct sigaction old_handler; stack_t stack; stack_t old_stack; thread->coentry = thread->stack = 0; stack.ss_flags = 0; stack.ss_size = size; thread->stack = stack.ss_sp = malloc(size); if(stack.ss_sp && !sigaltstack(&stack, &old_stack)) { handler.sa_handler = springboard; handler.sa_flags = SA_ONSTACK; sigemptyset(&handler.sa_mask); creating = thread; if(!sigaction(SIGUSR1, &handler, &old_handler)) { if(!raise(SIGUSR1)) thread->coentry = coentry; sigaltstack(&old_stack, 0); sigaction(SIGUSR1, &old_handler, 0); } } if(thread->coentry != coentry) { co_delete(thread); thread = 0; } } return (cothread_t)thread; } void co_delete(cothread_t cothread) { if(cothread) { if(((cothread_struct*)cothread)->stack) free(((cothread_struct*)cothread)->stack); free(cothread); } } void co_switch(cothread_t cothread) { if(!sigsetjmp(co_running->context, 0)) { co_running = (cothread_struct*)cothread; siglongjmp(co_running->context, 1); } } #ifdef __cplusplus } #endif phoenix/reference/widget/canvas.cpp000664 001750 001750 00000000334 12651764221 020562 0ustar00sergiosergio000000 000000 namespace phoenix { void pCanvas::setDroppable(bool droppable) { } void pCanvas::setMode(Canvas::Mode mode) { } void pCanvas::setSize(Size size) { } void pCanvas::constructor() { } void pCanvas::destructor() { } } gba/cartridge/serialization.cpp000664 001750 001750 00000000251 12651764221 017764 0ustar00sergiosergio000000 000000 void Cartridge::serialize(serializer& s) { if(has_sram) s.array(ram.data, ram.size); if(has_eeprom) eeprom.serialize(s); if(has_flashrom) flashrom.serialize(s); } nall/string/markup/bml.hpp000664 001750 001750 00000007466 12651764221 016743 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP //BML v1.0 parser //revision 0.03 namespace nall { namespace BML { struct Node : Markup::Node { protected: //test to verify if a valid character for a node name bool valid(char p) const { //A-Z, a-z, 0-9, -. return p - 'A' < 26u || p - 'a' < 26u || p - '0' < 10u || p - '-' < 2u; } //determine indentation level, without incrementing pointer unsigned readDepth(const char* p) { unsigned depth = 0; while(p[depth] == '\t' || p[depth] == ' ') depth++; return depth; } //determine indentation level unsigned parseDepth(const char*& p) { unsigned depth = readDepth(p); p += depth; return depth; } //read name void parseName(const char*& p) { unsigned length = 0; while(valid(p[length])) length++; if(length == 0) throw "Invalid node name"; name = substr(p, 0, length); p += length; } void parseData(const char*& p) { if(*p == '=' && *(p + 1) == '\"') { unsigned length = 2; while(p[length] && p[length] != '\n' && p[length] != '\"') length++; if(p[length] != '\"') throw "Unescaped value"; data = {substr(p, 2, length - 2), "\n"}; p += length + 1; } else if(*p == '=') { unsigned length = 1; while(p[length] && p[length] != '\n' && p[length] != '\"' && p[length] != ' ') length++; if(p[length] == '\"') throw "Illegal character in value"; data = {substr(p, 1, length - 1), "\n"}; p += length; } else if(*p == ':') { unsigned length = 1; while(p[length] && p[length] != '\n') length++; data = {substr(p, 1, length - 1), "\n"}; p += length; } } //read all attributes for a node void parseAttributes(const char*& p) { while(*p && *p != '\n') { if(*p != ' ') throw "Invalid node name"; while(*p == ' ') p++; //skip excess spaces if(*(p + 0) == '/' && *(p + 1) == '/') break; //skip comments Node node; node.attribute = true; unsigned length = 0; while(valid(p[length])) length++; if(length == 0) throw "Invalid attribute name"; node.name = substr(p, 0, length); node.parseData(p += length); node.data.rtrim<1>("\n"); children.append(node); } } //read a node and all of its child nodes void parseNode(const lstring& text, unsigned& y) { const char* p = text[y++]; level = parseDepth(p); parseName(p); parseData(p); parseAttributes(p); while(y < text.size()) { unsigned depth = readDepth(text[y]); if(depth <= level) break; if(text[y][depth] == ':') { data.append(substr(text[y++], depth + 1), "\n"); continue; } Node node; node.parseNode(text, y); children.append(node); } data.rtrim<1>("\n"); } //read top-level nodes void parse(const string& document) { lstring text = string{document}.replace("\r", "").split("\n"); //remove empty lines and comment lines for(unsigned y = 0; y < text.size();) { unsigned x = 0; bool empty = true; while(x < text[y].size()) { if(text[y][x] == ' ' || text[y][x] == '\t') { x++; continue; } empty = (text[y][x + 0] == '/' && text[y][x + 1] == '/'); break; } if(empty) text.remove(y); else y++; } unsigned y = 0; while(y < text.size()) { Node node; node.parseNode(text, y); if(node.level > 0) throw "Root nodes cannot be indented"; children.append(node); } } friend class Document; }; struct Document : Node { string error; bool load(const string& document) { name = "", data = ""; try { parse(document); } catch(const char* error) { this->error = error; children.reset(); return false; } return true; } Document(const string& document = "") { load(document); } }; } } #endif sfc/alt/ppu-performance/screen/screen.cpp000664 001750 001750 00000007645 12651764221 021624 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP unsigned PPU::Screen::get_palette(unsigned color) { #if defined(ARCH_LSB) return ((uint16*)ppu.cgram)[color]; #else color <<= 1; return (ppu.cgram[color + 0] << 0) + (ppu.cgram[color + 1] << 8); #endif } unsigned PPU::Screen::get_direct_color(unsigned p, unsigned t) { return ((t & 7) << 2) | ((p & 1) << 1) | (((t >> 3) & 7) << 7) | (((p >> 1) & 1) << 6) | ((t >> 6) << 13) | ((p >> 2) << 12); } uint16 PPU::Screen::addsub(unsigned x, unsigned y, bool halve) { if(!regs.color_mode) { if(!halve) { unsigned sum = x + y; unsigned carry = (sum - ((x ^ y) & 0x0421)) & 0x8420; return (sum - carry) | (carry - (carry >> 5)); } else { return (x + y - ((x ^ y) & 0x0421)) >> 1; } } else { unsigned diff = x - y + 0x8420; unsigned borrow = (diff - ((x ^ y) & 0x8420)) & 0x8420; if(!halve) { return (diff - borrow) & (borrow - (borrow >> 5)); } else { return (((diff - borrow) & (borrow - (borrow >> 5))) & 0x7bde) >> 1; } } } void PPU::Screen::scanline() { unsigned main_color = get_palette(0); unsigned sub_color = (self.regs.pseudo_hires == false && self.regs.bgmode != 5 && self.regs.bgmode != 6) ? regs.color : main_color; for(unsigned x = 0; x < 256; x++) { output.main[x].color = main_color; output.main[x].priority = 0; output.main[x].source = 6; output.sub[x].color = sub_color; output.sub[x].priority = 0; output.sub[x].source = 6; } window.render(0); window.render(1); } void PPU::Screen::render_black() { uint32* data = self.output + self.vcounter() * 1024; if(self.interlace() && self.field()) data += 512; memset(data, 0, self.display.width << 2); } uint16 PPU::Screen::get_pixel_main(unsigned x) { auto main = output.main[x]; auto sub = output.sub[x]; if(!regs.addsub_mode) { sub.source = 6; sub.color = regs.color; } if(!window.main[x]) { if(!window.sub[x]) { return 0x0000; } main.color = 0x0000; } if(main.source != 5 && regs.color_enable[main.source] && window.sub[x]) { bool halve = false; if(regs.color_halve && window.main[x]) { if(!regs.addsub_mode || sub.source != 6) halve = true; } return addsub(main.color, sub.color, halve); } return main.color; } uint16 PPU::Screen::get_pixel_sub(unsigned x) { auto main = output.sub[x]; auto sub = output.main[x]; if(!regs.addsub_mode) { sub.source = 6; sub.color = regs.color; } if(!window.main[x]) { if(!window.sub[x]) { return 0x0000; } main.color = 0x0000; } if(main.source != 5 && regs.color_enable[main.source] && window.sub[x]) { bool halve = false; if(regs.color_halve && window.main[x]) { if(!regs.addsub_mode || sub.source != 6) halve = true; } return addsub(main.color, sub.color, halve); } return main.color; } void PPU::Screen::render() { uint32* data = self.output + self.vcounter() * 1024; if(self.interlace() && self.field()) data += 512; if(!self.regs.pseudo_hires && self.regs.bgmode != 5 && self.regs.bgmode != 6) { for(unsigned i = 0; i < 256; i++) { data[i] = self.regs.display_brightness << 15 | get_pixel_main(i); } } else { for(unsigned i = 0; i < 256; i++) { *data++ = self.regs.display_brightness << 15 | get_pixel_sub(i); *data++ = self.regs.display_brightness << 15 | get_pixel_main(i); } } } PPU::Screen::Screen(PPU& self) : self(self) { } PPU::Screen::~Screen() { } void PPU::Screen::Output::plot_main(unsigned x, unsigned color, unsigned priority, unsigned source) { if(priority > main[x].priority) { main[x].color = color; main[x].priority = priority; main[x].source = source; } } void PPU::Screen::Output::plot_sub(unsigned x, unsigned color, unsigned priority, unsigned source) { if(priority > sub[x].priority) { sub[x].color = color; sub[x].priority = priority; sub[x].source = source; } } #endif nall/dsp/resample/cosine.hpp000664 001750 001750 00000001521 12651764221 017224 0ustar00sergiosergio000000 000000 #ifdef NALL_DSP_INTERNAL_HPP struct ResampleCosine : Resampler { inline void setFrequency(); inline void clear(); inline void sample(); ResampleCosine(DSP& dsp) : Resampler(dsp) {} real fraction; real step; }; void ResampleCosine::setFrequency() { fraction = 0.0; step = dsp.settings.frequency / frequency; } void ResampleCosine::clear() { fraction = 0.0; } void ResampleCosine::sample() { while(fraction <= 1.0) { real channel[dsp.settings.channels]; for(unsigned n = 0; n < dsp.settings.channels; n++) { real a = dsp.buffer.read(n, -1); real b = dsp.buffer.read(n, -0); real mu = fraction; mu = (1.0 - cos(mu * 3.14159265)) / 2.0; channel[n] = a * (1.0 - mu) + b * mu; } dsp.write(channel); fraction += step; } dsp.buffer.rdoffset++; fraction -= 1.0; } #endif phoenix/cocoa/widget/horizontal-slider.cpp000664 001750 001750 00000002521 12651764221 022106 0ustar00sergiosergio000000 000000 @implementation CocoaHorizontalSlider : NSSlider -(id) initWith:(phoenix::HorizontalSlider&)horizontalSliderReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 1, 0)]) { horizontalSlider = &horizontalSliderReference; [self setTarget:self]; [self setAction:@selector(activate:)]; [self setMinValue:0]; } return self; } -(IBAction) activate:(id)sender { horizontalSlider->state.position = [self doubleValue]; if(horizontalSlider->onChange) horizontalSlider->onChange(); } @end namespace phoenix { Size pHorizontalSlider::minimumSize() { return {48, 20}; } void pHorizontalSlider::setGeometry(Geometry geometry) { pWidget::setGeometry({ geometry.x - 2, geometry.y, geometry.width + 4, geometry.height }); } void pHorizontalSlider::setLength(unsigned length) { @autoreleasepool { [cocoaView setMaxValue:length]; } } void pHorizontalSlider::setPosition(unsigned position) { @autoreleasepool { [cocoaView setDoubleValue:position]; } } void pHorizontalSlider::constructor() { @autoreleasepool { cocoaView = cocoaHorizontalSlider = [[CocoaHorizontalSlider alloc] initWith:horizontalSlider]; setLength(horizontalSlider.state.length); setPosition(horizontalSlider.state.position); } } void pHorizontalSlider::destructor() { @autoreleasepool { [cocoaView release]; } } } processor/arm/instructions-thumb.hpp000664 001750 001750 00000001420 12651764221 021075 0ustar00sergiosergio000000 000000 void thumb_step(); void thumb_opcode(uint4 opcode, uint4 d, uint4 s); void thumb_op_adjust_register(); void thumb_op_adjust_immediate(); void thumb_op_shift_immediate(); void thumb_op_immediate(); void thumb_op_alu(); void thumb_op_branch_exchange(); void thumb_op_alu_hi(); void thumb_op_load_literal(); void thumb_op_move_register_offset(); void thumb_op_move_word_immediate(); void thumb_op_move_byte_immediate(); void thumb_op_move_half_immediate(); void thumb_op_move_stack(); void thumb_op_add_register_hi(); void thumb_op_adjust_stack(); void thumb_op_stack_multiple(); void thumb_op_move_multiple(); void thumb_op_software_interrupt(); void thumb_op_branch_conditional(); void thumb_op_branch_short(); void thumb_op_branch_long_prefix(); void thumb_op_branch_long_suffix(); target-ethos/tools/cheat-editor.cpp000664 001750 001750 00000011463 12651764221 020537 0ustar00sergiosergio000000 000000 CheatEditor* cheatEditor = nullptr; CheatEditor::CheatEditor() { cheatList.setHeaderText({"Slot", "Code", "Description"}); cheatList.setHeaderVisible(); cheatList.setCheckable(); for(unsigned n = 0; n < Codes; n++) cheatList.append({"", "", ""}); codeLabel.setText("Code(s):"); descLabel.setText("Description:"); findButton.setText("Find Codes ..."); resetButton.setText("Reset"); eraseButton.setText("Erase"); unsigned width = max( Font::size(program->normalFont, "Codes(s)" ).width, Font::size(program->normalFont, "Description:").width ); append(cheatList, {~0, ~0}, 5); append(codeLayout, {~0, 0}, 5); codeLayout.append(codeLabel, {width, 0}, 5); codeLayout.append(codeEdit, {~0, 0}); append(descLayout, {~0, 0}, 5); descLayout.append(descLabel, {width, 0}, 5); descLayout.append(descEdit, {~0, 0}); append(controlLayout, {~0, 0}); controlLayout.append(findButton, {0, 0}, 5); controlLayout.append(spacer, {~0, 0}); controlLayout.append(resetButton, {80, 0}, 5); controlLayout.append(eraseButton, {80, 0}); cheatList.onChange = {&CheatEditor::synchronize, this}; cheatList.onToggle = [&](unsigned) { update(); }; codeEdit.onChange = {&CheatEditor::updateCode, this}; descEdit.onChange = {&CheatEditor::updateDesc, this}; findButton.onActivate = {&CheatDatabase::findCodes, cheatDatabase}; resetButton.onActivate = [&] { if(MessageWindow().setParent(*tools).setText("All codes will be erased. Are you sure you want to do this?") .question() == MessageWindow::Response::Yes) reset(); }; eraseButton.onActivate = {&CheatEditor::erase, this}; cheatList.setSelection(0); synchronize(); } void CheatEditor::synchronize() { setEnabled(program->active); if(cheatList.selected()) { unsigned n = cheatList.selection(); codeEdit.setText(cheat[n].code); descEdit.setText(cheat[n].desc); codeEdit.setEnabled(true); descEdit.setEnabled(true); eraseButton.setEnabled(true); } else { codeEdit.setText(""); descEdit.setText(""); codeEdit.setEnabled(false); descEdit.setEnabled(false); eraseButton.setEnabled(false); } } void CheatEditor::refresh() { for(unsigned n = 0; n < Codes; n++) { string code = cheat[n].code; string desc = cheat[n].code.empty() && cheat[n].desc.empty() ? "(empty)" : cheat[n].desc; lstring codes = code.split("+"); if(codes.size() > 1) code = {codes[0], "+..."}; cheatList.setText(n, {format<3>(1 + n), code, desc}); } cheatList.autoSizeColumns(); } void CheatEditor::update() { lstring codes; for(unsigned n = 0; n < Codes; n++) { string code = cheat[n].code; if(cheatList.checked(n) && !code.empty()) codes.append(code); } system().cheatSet(codes); } void CheatEditor::reset() { for(unsigned n = 0; n < Codes; n++) { cheatList.setChecked(n, false); cheat[n].code = ""; cheat[n].desc = ""; } codeEdit.setText(""); descEdit.setText(""); refresh(); update(); } void CheatEditor::erase() { unsigned n = cheatList.selection(); cheatList.setChecked(n, false); cheat[n].code = ""; cheat[n].desc = ""; codeEdit.setText(""); descEdit.setText(""); refresh(); update(); } void CheatEditor::updateCode() { unsigned n = cheatList.selection(); cheat[n].code = codeEdit.text(); refresh(); update(); } void CheatEditor::updateDesc() { unsigned n = cheatList.selection(); cheat[n].desc = descEdit.text(); refresh(); } bool CheatEditor::load(string filename) { string data = string::read(filename); if(data.empty()) return false; unsigned n = 0; auto document = Markup::Document(data); for(auto& node : document["cartridge"]) { if(node.name != "cheat") continue; cheatList.setChecked(n, node["enabled"].exists()); cheat[n].code = node["code"].text(); cheat[n].desc = node["description"].text(); if(++n >= Codes) break; } refresh(); update(); return true; } bool CheatEditor::save(string filename) { signed lastSave = -1; for(signed n = 127; n >= 0; n--) { if(!cheat[n].code.empty() || !cheat[n].desc.empty()) { lastSave = n; break; } } if(lastSave == -1) { file::remove(filename); return true; } file fp; if(fp.open(filename, file::mode::write) == false) return false; fp.print("cartridge sha256:", system().sha256(), "\n"); for(unsigned n = 0; n <= lastSave; n++) { fp.print(" cheat", cheatList.checked(n) ? " enabled\n" : "\n"); fp.print(" description:", cheat[n].desc, "\n"); fp.print(" code:", cheat[n].code, "\n"); } fp.close(); return true; } bool CheatEditor::import(string code, string desc) { for(unsigned n = 0; n < Codes; n++) { if(cheat[n].code.empty() && cheat[n].desc.empty()) { cheatList.setChecked(n, false); cheat[n].code = code; cheat[n].desc = desc; return true; } } return false; } sfc/chip/dsp3/dsp3.cpp000664 001750 001750 00000001073 12651764221 015635 0ustar00sergiosergio000000 000000 #include #define DSP3_CPP namespace SuperFamicom { DSP3 dsp3; namespace DSP3i { #define bool8 uint8 #include "dsp3emu.c" #undef bool8 }; void DSP3::init() { } void DSP3::load() { } void DSP3::unload() { } void DSP3::power() { } void DSP3::reset() { DSP3i::DSP3_Reset(); } uint8 DSP3::read(unsigned addr) { DSP3i::dsp3_address = addr & 0xffff; DSP3i::DSP3GetByte(); return DSP3i::dsp3_byte; } void DSP3::write(unsigned addr, uint8 data) { DSP3i::dsp3_address = addr & 0xffff; DSP3i::dsp3_byte = data; DSP3i::DSP3SetByte(); } } fc/cartridge/board/konami-vrc6.cpp000664 001750 001750 00000002057 12651764221 020177 0ustar00sergiosergio000000 000000 struct KonamiVRC6 : Board { VRC6 vrc6; uint8 prg_read(unsigned addr) { if((addr & 0xe000) == 0x6000) return vrc6.ram_read(addr); if(addr & 0x8000) return prgrom.read(vrc6.prg_addr(addr)); return cpu.mdr(); } void prg_write(unsigned addr, uint8 data) { if((addr & 0xe000) == 0x6000) return vrc6.ram_write(addr, data); if(addr & 0x8000) { addr = (addr & 0xf003); if(prgram.size) addr = (addr & ~3) | ((addr & 2) >> 1) | ((addr & 1) << 1); return vrc6.reg_write(addr, data); } } uint8 chr_read(unsigned addr) { if(addr & 0x2000) return ppu.ciram_read(vrc6.ciram_addr(addr)); return Board::chr_read(vrc6.chr_addr(addr)); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) return ppu.ciram_write(vrc6.ciram_addr(addr), data); return Board::chr_write(vrc6.chr_addr(addr), data); } void serialize(serializer& s) { Board::serialize(s); vrc6.serialize(s); } void main() { vrc6.main(); } void power() { vrc6.power(); } void reset() { vrc6.reset(); } KonamiVRC6(Markup::Node& document) : Board(document), vrc6(*this) { } }; sfc/chip/sa1/mmio/mmio.hpp000664 001750 001750 00000011115 12651764221 016504 0ustar00sergiosergio000000 000000 uint8 mmio_read(unsigned addr); void mmio_write(unsigned addr, uint8 data); struct MMIO { //$2200 CCNT bool sa1_irq; bool sa1_rdyb; bool sa1_resb; bool sa1_nmi; uint8 smeg; //$2201 SIE bool cpu_irqen; bool chdma_irqen; //$2202 SIC bool cpu_irqcl; bool chdma_irqcl; //$2203,$2204 CRV uint16 crv; //$2205,$2206 CNV uint16 cnv; //$2207,$2208 CIV uint16 civ; //$2209 SCNT bool cpu_irq; bool cpu_ivsw; bool cpu_nvsw; uint8 cmeg; //$220a CIE bool sa1_irqen; bool timer_irqen; bool dma_irqen; bool sa1_nmien; //$220b CIC bool sa1_irqcl; bool timer_irqcl; bool dma_irqcl; bool sa1_nmicl; //$220c,$220d SNV uint16 snv; //$220e,$220f SIV uint16 siv; //$2210 TMC bool hvselb; bool ven; bool hen; //$2212,$2213 uint16 hcnt; //$2214,$2215 uint16 vcnt; //$2220 CXB bool cbmode; unsigned cb; //$2221 DXB bool dbmode; unsigned db; //$2222 EXB bool ebmode; unsigned eb; //$2223 FXB bool fbmode; unsigned fb; //$2224 BMAPS uint8 sbm; //$2225 BMAP bool sw46; uint8 cbm; //$2226 SBWE bool swen; //$2227 CBWE bool cwen; //$2228 BWPA uint8 bwp; //$2229 SIWP uint8 siwp; //$222a CIWP uint8 ciwp; //$2230 DCNT bool dmaen; bool dprio; bool cden; bool cdsel; bool dd; uint8 sd; //$2231 CDMA bool chdend; uint8 dmasize; uint8 dmacb; //$2232-$2234 SDA uint32 dsa; //$2235-$2237 DDA uint32 dda; //$2238,$2239 DTC uint16 dtc; //$223f BBF bool bbf; //$2240-224f BRF uint8 brf[16]; //$2250 MCNT bool acm; bool md; //$2251,$2252 MA uint16 ma; //$2253,$2254 MB uint16 mb; //$2258 VBD bool hl; uint8 vb; //$2259-$225b VDA uint32 va; uint8 vbit; //$2300 SFR bool cpu_irqfl; bool chdma_irqfl; //$2301 CFR bool sa1_irqfl; bool timer_irqfl; bool dma_irqfl; bool sa1_nmifl; //$2302,$2303 HCR uint16 hcr; //$2304,$2305 VCR uint16 vcr; //$2306-230a MR uint64 mr; //$230b OF bool overflow; } mmio; void mmio_w2200(uint8); //CCNT void mmio_w2201(uint8); //SIE void mmio_w2202(uint8); //SIC void mmio_w2203(uint8); //CRVL void mmio_w2204(uint8); //CRVH void mmio_w2205(uint8); //CNVL void mmio_w2206(uint8); //CNVH void mmio_w2207(uint8); //CIVL void mmio_w2208(uint8); //CIVH void mmio_w2209(uint8); //SCNT void mmio_w220a(uint8); //CIE void mmio_w220b(uint8); //CIC void mmio_w220c(uint8); //SNVL void mmio_w220d(uint8); //SNVH void mmio_w220e(uint8); //SIVL void mmio_w220f(uint8); //SIVH void mmio_w2210(uint8); //TMC void mmio_w2211(uint8); //CTR void mmio_w2212(uint8); //HCNTL void mmio_w2213(uint8); //HCNTH void mmio_w2214(uint8); //VCNTL void mmio_w2215(uint8); //VCNTH void mmio_w2220(uint8); //CXB void mmio_w2221(uint8); //DXB void mmio_w2222(uint8); //EXB void mmio_w2223(uint8); //FXB void mmio_w2224(uint8); //BMAPS void mmio_w2225(uint8); //BMAP void mmio_w2226(uint8); //SBWE void mmio_w2227(uint8); //CBWE void mmio_w2228(uint8); //BWPA void mmio_w2229(uint8); //SIWP void mmio_w222a(uint8); //CIWP void mmio_w2230(uint8); //DCNT void mmio_w2231(uint8); //CDMA void mmio_w2232(uint8); //SDAL void mmio_w2233(uint8); //SDAH void mmio_w2234(uint8); //SDAB void mmio_w2235(uint8); //DDAL void mmio_w2236(uint8); //DDAH void mmio_w2237(uint8); //DDAB void mmio_w2238(uint8); //DTCL void mmio_w2239(uint8); //DTCH void mmio_w223f(uint8); //BBF void mmio_w2240(uint8); //BRF0 void mmio_w2241(uint8); //BRF1 void mmio_w2242(uint8); //BRF2 void mmio_w2243(uint8); //BRF3 void mmio_w2244(uint8); //BRF4 void mmio_w2245(uint8); //BRF5 void mmio_w2246(uint8); //BRF6 void mmio_w2247(uint8); //BRF7 void mmio_w2248(uint8); //BRF8 void mmio_w2249(uint8); //BRF9 void mmio_w224a(uint8); //BRFA void mmio_w224b(uint8); //BRFB void mmio_w224c(uint8); //BRFC void mmio_w224d(uint8); //BRFD void mmio_w224e(uint8); //BRFE void mmio_w224f(uint8); //BRFF void mmio_w2250(uint8); //MCNT void mmio_w2251(uint8); //MAL void mmio_w2252(uint8); //MAH void mmio_w2253(uint8); //MBL void mmio_w2254(uint8); //MBH void mmio_w2258(uint8); //VBD void mmio_w2259(uint8); //VDAL void mmio_w225a(uint8); //VDAH void mmio_w225b(uint8); //VDAB uint8 mmio_r2300(); //SFR uint8 mmio_r2301(); //CFR uint8 mmio_r2302(); //HCRL uint8 mmio_r2303(); //HCRH uint8 mmio_r2304(); //VCRL uint8 mmio_r2305(); //VCRH uint8 mmio_r2306(); //MR [00-07] uint8 mmio_r2307(); //MR [08-15] uint8 mmio_r2308(); //MR [16-23] uint8 mmio_r2309(); //MR [24-31] uint8 mmio_r230a(); //MR [32-40] uint8 mmio_r230b(); //OF uint8 mmio_r230c(); //VDPL uint8 mmio_r230d(); //VDPH uint8 mmio_r230e(); //VC sfc/alt/ppu-balanced/memory/memory.hpp000664 001750 001750 00000000424 12651764221 021127 0ustar00sergiosergio000000 000000 uint16 get_vram_address(); uint8 vram_mmio_read(uint16 addr); void vram_mmio_write(uint16 addr, uint8 data); uint8 oam_mmio_read(uint16 addr); void oam_mmio_write(uint16 addr, uint8 data); uint8 cgram_mmio_read(uint16 addr); void cgram_mmio_write(uint16 addr, uint8 data); nall/Makefile000664 001750 001750 00000005365 12651764221 014307 0ustar00sergiosergio000000 000000 # Makefile # author: byuu # license: public domain [A-Z] = A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [a-z] = a b c d e f g h i j k l m n o p q r s t u v w x y z [0-9] = 0 1 2 3 4 5 6 7 8 9 [markup] = ` ~ ! @ \# $$ % ^ & * ( ) - _ = + [ { ] } \ | ; : ' " , < . > / ? # Some editors need this for proper syntax highlighting: ' [all] = $([A-Z]) $([a-z]) $([0-9]) $([markup]) [space] := [space] += # platform detection ifeq ($(platform),) uname := $(shell uname -s) ifeq ($(uname),) platform := windows else ifneq ($(findstring Windows,$(uname)),) platform := windows else ifneq ($(findstring CYGWIN,$(uname)),) platform := windows else ifneq ($(findstring MINGW,$(uname)),) platform := windows else ifneq ($(findstring Darwin,$(uname)),) platform := macosx else ifneq ($(findstring BSD,$(uname)),) platform := bsd else platform := linux endif endif ifeq ($(platform),windows) delete = del /F /Q $(subst /,\,$1) else delete = rm -f $1 endif # compiler detection ifeq ($(compiler),) ifeq ($(platform),windows) compiler := g++ flags := link := else ifeq ($(platform),macosx) compiler := clang++ flags := -w -stdlib=libc++ link := -lc++ -lobjc else ifeq ($(platform),bsd) compiler := clang++ flags := -w -I/usr/local/include else compiler := g++ flags := link := endif cflags := -x c -std=c99 objcflags := -x objective-c -std=c99 cppflags := -x c++ -std=c++11 objcppflags := -x objective-c++ -std=c++11 endif # cross-compilation support ifeq ($(arch),x86) flags := -m32 $(flags) link := -m32 $(link) endif ifeq ($(prefix),) prefix := /usr/local endif # function rwildcard(directory, pattern) rwildcard = \ $(strip \ $(filter $(if $2,$2,%), \ $(foreach f, \ $(wildcard $1*), \ $(eval t = $(call rwildcard,$f/)) \ $(if $t,$t,$f) \ ) \ ) \ ) # function strtr(source, from, to) strtr = \ $(eval __temp := $1) \ $(strip \ $(foreach c, \ $(join $(addsuffix :,$2),$3), \ $(eval __temp := \ $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)),$(__temp)) \ ) \ ) \ $(__temp) \ ) # function strupper(source) strupper = $(call strtr,$1,$([a-z]),$([A-Z])) # function strlower(source) strlower = $(call strtr,$1,$([A-Z]),$([a-z])) # function strlen(source) strlen = \ $(eval __temp := $(subst $([space]),_,$1)) \ $(words \ $(strip \ $(foreach c, \ $([all]), \ $(eval __temp := \ $(subst $c,$c ,$(__temp)) \ ) \ ) \ $(__temp) \ ) \ ) # function streq(source) streq = $(if $(filter-out xx,x$(subst $1,,$2)$(subst $2,,$1)x),,1) # function strne(source) strne = $(if $(filter-out xx,x$(subst $1,,$2)$(subst $2,,$1)x),1,) nall/unzip.hpp000664 001750 001750 00000005522 12651764221 014520 0ustar00sergiosergio000000 000000 #ifndef NALL_UNZIP_HPP #define NALL_UNZIP_HPP #include #include #include #include namespace nall { struct unzip { struct File { string name; const uint8_t* data; unsigned size; unsigned csize; unsigned cmode; //0 = uncompressed, 8 = deflate unsigned crc32; }; inline bool open(const string& filename) { close(); if(fm.open(filename, filemap::mode::read) == false) return false; if(open(fm.data(), fm.size()) == false) { fm.close(); return false; } return true; } inline bool open(const uint8_t* data, unsigned size) { if(size < 22) return false; filedata = data; filesize = size; file.reset(); const uint8_t* footer = data + size - 22; while(true) { if(footer <= data + 22) return false; if(read(footer, 4) == 0x06054b50) { unsigned commentlength = read(footer + 20, 2); if(footer + 22 + commentlength == data + size) break; } footer--; } const uint8_t* directory = data + read(footer + 16, 4); while(true) { unsigned signature = read(directory + 0, 4); if(signature != 0x02014b50) break; File file; file.cmode = read(directory + 10, 2); file.crc32 = read(directory + 16, 4); file.csize = read(directory + 20, 4); file.size = read(directory + 24, 4); unsigned namelength = read(directory + 28, 2); unsigned extralength = read(directory + 30, 2); unsigned commentlength = read(directory + 32, 2); char* filename = new char[namelength + 1]; memcpy(filename, directory + 46, namelength); filename[namelength] = 0; file.name = filename; delete[] filename; unsigned offset = read(directory + 42, 4); unsigned offsetNL = read(data + offset + 26, 2); unsigned offsetEL = read(data + offset + 28, 2); file.data = data + offset + 30 + offsetNL + offsetEL; directory += 46 + namelength + extralength + commentlength; this->file.append(file); } return true; } inline vector extract(File& file) { vector buffer; if(file.cmode == 0) { buffer.resize(file.size); memcpy(buffer.data(), file.data, file.size); } if(file.cmode == 8) { buffer.resize(file.size); if(inflate(buffer.data(), buffer.size(), file.data, file.csize) == false) { buffer.reset(); } } return buffer; } inline void close() { if(fm.open()) fm.close(); } ~unzip() { close(); } protected: filemap fm; const uint8_t* filedata; unsigned filesize; unsigned read(const uint8_t* data, unsigned size) { unsigned result = 0, shift = 0; while(size--) { result |= *data++ << shift; shift += 8; } return result; } public: vector file; }; } #endif target-ethos/utility/000700 001750 001750 00000000000 12656700342 016004 5ustar00sergiosergio000000 000000 sfc/cheat/000700 001750 001750 00000000000 12656700342 013532 5ustar00sergiosergio000000 000000 fc/cartridge/board/nes-nrom.cpp000664 001750 001750 00000001741 12651764221 017600 0ustar00sergiosergio000000 000000 //NES-NROM-128 //NES-NROM-256 struct NES_NROM : Board { struct Settings { bool mirror; //0 = horizontal, 1 = vertical } settings; uint8 prg_read(unsigned addr) { if(addr & 0x8000) return prgrom.read(addr); return cpu.mdr(); } void prg_write(unsigned addr, uint8 data) { } uint8 chr_read(unsigned addr) { if(addr & 0x2000) { if(settings.mirror == 0) addr = ((addr & 0x0800) >> 1) | (addr & 0x03ff); return ppu.ciram_read(addr & 0x07ff); } if(chrram.size) return chrram.read(addr); return chrrom.read(addr); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) { if(settings.mirror == 0) addr = ((addr & 0x0800) >> 1) | (addr & 0x03ff); return ppu.ciram_write(addr & 0x07ff, data); } if(chrram.size) return chrram.write(addr, data); } void serialize(serializer& s) { Board::serialize(s); } NES_NROM(Markup::Node& document) : Board(document) { settings.mirror = document["cartridge"]["mirror"]["mode"].data == "vertical" ? 1 : 0; } }; processor/upd96050/000700 001750 001750 00000000000 12656700342 015106 5ustar00sergiosergio000000 000000 profile/Game Boy Color.sys/manifest.bml000664 001750 001750 00000000101 12651764221 021101 0ustar00sergiosergio000000 000000 system name:Game Boy Color cpu rom name=boot.rom size=2048 sfc/system/input.hpp000664 001750 001750 00000001411 12651764221 015654 0ustar00sergiosergio000000 000000 struct Input { enum class Device : unsigned { Joypad, Multitap, Mouse, SuperScope, Justifier, Justifiers, USART, None, }; enum class JoypadID : unsigned { B = 0, Y = 1, Select = 2, Start = 3, Up = 4, Down = 5, Left = 6, Right = 7, A = 8, X = 9, L = 10, R = 11, }; enum class MouseID : unsigned { X = 0, Y = 1, Left = 2, Right = 3, }; enum class SuperScopeID : unsigned { X = 0, Y = 1, Trigger = 2, Cursor = 3, Turbo = 4, Pause = 5, }; enum class JustifierID : unsigned { X = 0, Y = 1, Trigger = 2, Start = 3, }; Controller* port1 = nullptr; Controller* port2 = nullptr; void connect(bool port, Input::Device id); Input(); ~Input(); }; extern Input input; phoenix/cocoa/widget/radio-label.cpp000664 001750 001750 00000002633 12651764221 020614 0ustar00sergiosergio000000 000000 @implementation CocoaRadioLabel : NSButton -(id) initWith:(phoenix::RadioLabel&)radioLabelReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { radioLabel = &radioLabelReference; [self setTarget:self]; [self setAction:@selector(activate:)]; [self setButtonType:NSRadioButton]; } return self; } -(IBAction) activate:(id)sender { radioLabel->setChecked(); if(radioLabel->onActivate) radioLabel->onActivate(); } @end namespace phoenix { Size pRadioLabel::minimumSize() { Size size = Font::size(radioLabel.font(), radioLabel.state.text); return {size.width + 22, size.height}; } void pRadioLabel::setChecked() { @autoreleasepool { for(auto& item : radioLabel.state.group) { auto state = (&item == &radioLabel) ? NSOnState : NSOffState; [item.p.cocoaView setState:state]; } } } void pRadioLabel::setGeometry(Geometry geometry) { pWidget::setGeometry({ geometry.x - 1, geometry.y, geometry.width + 2, geometry.height }); } void pRadioLabel::setGroup(const group& group) { } void pRadioLabel::setText(string text) { @autoreleasepool { [cocoaView setTitle:[NSString stringWithUTF8String:text]]; } } void pRadioLabel::constructor() { @autoreleasepool { cocoaView = cocoaRadioLabel = [[CocoaRadioLabel alloc] initWith:radioLabel]; } } void pRadioLabel::destructor() { @autoreleasepool { [cocoaView release]; } } } phoenix/cocoa/widget/combo-button.cpp000664 001750 001750 00000003446 12651764221 021054 0ustar00sergiosergio000000 000000 @implementation CocoaComboButton : NSPopUpButton -(id) initWith:(phoenix::ComboButton&)comboButtonReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0) pullsDown:NO]) { comboButton = &comboButtonReference; [self setTarget:self]; [self setAction:@selector(activate:)]; } return self; } -(IBAction) activate:(id)sender { comboButton->state.selection = [self indexOfSelectedItem]; if(comboButton->onChange) comboButton->onChange(); } @end namespace phoenix { void pComboButton::append(string text) { @autoreleasepool { [cocoaView addItemWithTitle:[NSString stringWithUTF8String:text]]; } } Size pComboButton::minimumSize() { unsigned maximumWidth = 0; for(auto& text : comboButton.state.text) maximumWidth = max(maximumWidth, Font::size(comboButton.font(), text).width); Size size = Font::size(comboButton.font(), " "); return {maximumWidth + 36, size.height + 6}; } void pComboButton::remove(unsigned selection) { @autoreleasepool { [cocoaView removeItemAtIndex:selection]; } } void pComboButton::reset() { @autoreleasepool { [cocoaView removeAllItems]; } } void pComboButton::setGeometry(Geometry geometry) { pWidget::setGeometry({ geometry.x - 2, geometry.y, geometry.width + 4, geometry.height }); } void pComboButton::setSelection(unsigned selection) { @autoreleasepool { [cocoaView selectItemAtIndex:selection]; } } void pComboButton::setText(unsigned selection, string text) { @autoreleasepool { [[cocoaView itemAtIndex:selection] setTitle:[NSString stringWithUTF8String:text]]; } } void pComboButton::constructor() { @autoreleasepool { cocoaView = cocoaComboButton = [[CocoaComboButton alloc] initWith:comboButton]; } } void pComboButton::destructor() { @autoreleasepool { [cocoaView release]; } } } fc/video/video.hpp000664 001750 001750 00000000365 12651764221 015231 0ustar00sergiosergio000000 000000 struct Video { uint32_t* palette = nullptr; void generate_palette(Emulator::Interface::PaletteMode mode); Video(); ~Video(); private: uint32_t generate_color(unsigned, double, double, double, double, double); }; extern Video video; shaders/Scanline.shader/000700 001750 001750 00000000000 12656700342 016325 5ustar00sergiosergio000000 000000 target-ethos/settings/server.hpp000664 001750 001750 00000000453 12651764221 020177 0ustar00sergiosergio000000 000000 struct ServerSettings : SettingsLayout { HorizontalLayout hostLayout; Label hostLabel; LineEdit hostEdit; HorizontalLayout userLayout; Label userLabel; LineEdit userEdit; Label passLabel; LineEdit passEdit; ServerSettings(); }; extern ServerSettings* serverSettings; sfc/chip/hsu1/hsu1.hpp000664 001750 001750 00000000506 12651764221 015660 0ustar00sergiosergio000000 000000 struct HSU1 { void init(); void load(); void unload(); void power(); void reset(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); void serialize(serializer&); private: bool txbusy; bool rxbusy; bool txlatch; vector txbuffer; vector rxbuffer; }; extern HSU1 hsu1; sfc/system/video.cpp000664 001750 001750 00000011125 12651764221 015621 0ustar00sergiosergio000000 000000 #ifdef SYSTEM_CPP Video video; void Video::generate_palette(Emulator::Interface::PaletteMode mode) { for(unsigned color = 0; color < (1 << 19); color++) { if(mode == Emulator::Interface::PaletteMode::Literal) { palette[color] = color; continue; } unsigned l = (color >> 15) & 15; unsigned b = (color >> 10) & 31; unsigned g = (color >> 5) & 31; unsigned r = (color >> 0) & 31; if(mode == Emulator::Interface::PaletteMode::Channel) { l = image::normalize(l, 4, 16); r = image::normalize(r, 5, 16); g = image::normalize(g, 5, 16); b = image::normalize(b, 5, 16); palette[color] = interface->videoColor(color, l, r, g, b); continue; } if(mode == Emulator::Interface::PaletteMode::Emulation) { r = gamma_ramp[r]; g = gamma_ramp[g]; b = gamma_ramp[b]; } else { r = image::normalize(r, 5, 8); g = image::normalize(g, 5, 8); b = image::normalize(b, 5, 8); } double L = (1.0 + l) / 16.0; if(l == 0) L *= 0.5; unsigned R = L * image::normalize(r, 8, 16); unsigned G = L * image::normalize(g, 8, 16); unsigned B = L * image::normalize(b, 8, 16); palette[color] = interface->videoColor(color, 0, R, G, B); } } Video::Video() { palette = new uint32_t[1 << 19](); } Video::~Video() { delete[] palette; } //internal const uint8_t Video::gamma_ramp[32] = { 0x00, 0x01, 0x03, 0x06, 0x0a, 0x0f, 0x15, 0x1c, 0x24, 0x2d, 0x37, 0x42, 0x4e, 0x5b, 0x69, 0x78, 0x88, 0x90, 0x98, 0xa0, 0xa8, 0xb0, 0xb8, 0xc0, 0xc8, 0xd0, 0xd8, 0xe0, 0xe8, 0xf0, 0xf8, 0xff, }; const uint8_t Video::cursor[15 * 15] = { 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0, 0,0,0,0,1,1,2,2,2,1,1,0,0,0,0, 0,0,0,1,2,2,1,2,1,2,2,1,0,0,0, 0,0,1,2,1,1,0,1,0,1,1,2,1,0,0, 0,1,2,1,0,0,0,1,0,0,0,1,2,1,0, 0,1,2,1,0,0,1,2,1,0,0,1,2,1,0, 1,2,1,0,0,1,1,2,1,1,0,0,1,2,1, 1,2,2,1,1,2,2,2,2,2,1,1,2,2,1, 1,2,1,0,0,1,1,2,1,1,0,0,1,2,1, 0,1,2,1,0,0,1,2,1,0,0,1,2,1,0, 0,1,2,1,0,0,0,1,0,0,0,1,2,1,0, 0,0,1,2,1,1,0,1,0,1,1,2,1,0,0, 0,0,0,1,2,2,1,2,1,2,2,1,0,0,0, 0,0,0,0,1,1,2,2,2,1,1,0,0,0,0, 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0, }; void Video::draw_cursor(uint16_t color, int x, int y) { uint32_t* data = (uint32_t*)ppu.output; if(ppu.interlace() && ppu.field()) data += 512; for(int cy = 0; cy < 15; cy++) { int vy = y + cy - 7; if(vy <= 0 || vy >= 240) continue; //do not draw offscreen bool hires = (line_width[vy] == 512); for(int cx = 0; cx < 15; cx++) { int vx = x + cx - 7; if(vx < 0 || vx >= 256) continue; //do not draw offscreen uint8_t pixel = cursor[cy * 15 + cx]; if(pixel == 0) continue; uint32_t pixelcolor = (15 << 15) | ((pixel == 1) ? 0 : color); if(hires == false) { *((uint32_t*)data + vy * 1024 + vx) = palette[pixelcolor]; } else { *((uint32_t*)data + vy * 1024 + vx * 2 + 0) = palette[pixelcolor]; *((uint32_t*)data + vy * 1024 + vx * 2 + 1) = palette[pixelcolor]; } } } } void Video::update() { switch(configuration.controller_port2) { case Input::Device::SuperScope: if(dynamic_cast(input.port2)) { SuperScope &device = (SuperScope&)*input.port2; draw_cursor(0x7c00, device.x, device.y); } break; case Input::Device::Justifier: case Input::Device::Justifiers: if(dynamic_cast(input.port2)) { Justifier &device = (Justifier&)*input.port2; draw_cursor(0x001f, device.player1.x, device.player1.y); if(device.chained == false) break; draw_cursor(0x02e0, device.player2.x, device.player2.y); } break; default: break; } uint32_t* data = (uint32_t*)ppu.output; if(ppu.interlace() && ppu.field()) data += 512; if(hires) { //normalize line widths for(unsigned y = 0; y < 240; y++) { if(line_width[y] == 512) continue; uint32_t *buffer = data + y * 1024; for(signed x = 255; x >= 0; x--) { buffer[(x * 2) + 0] = buffer[(x * 2) + 1] = buffer[x]; } } } //overscan: when disabled, shift image down (by scrolling video buffer up) to center image onscreen //(memory before ppu.output is filled with black scanlines) interface->videoRefresh( video.palette, ppu.output - (ppu.overscan() ? 0 : 7 * 1024), 4 * (1024 >> ppu.interlace()), 256 << hires, 240 << ppu.interlace() ); hires = false; } void Video::scanline() { unsigned y = cpu.vcounter(); if(y >= 240) return; hires |= ppu.hires(); unsigned width = (ppu.hires() == false ? 256 : 512); line_width[y] = width; } void Video::init() { hires = false; for(auto& n : line_width) n = 256; } #endif ananke/resource/up.png000664 001750 001750 00000001214 12651764221 016124 0ustar00sergiosergio000000 000000 PNG  IHDRasBIT|dtEXtSoftwarewww.inkscape.org<IDAT8OhAƿ73ٍzhLт@*ՊhDbE-rkJIbREOBM*^DPC)*4&Q!|ߛ!5ɛ|fvn<IuL:.O <WLFfG ฼ʼns֖ǖ% Ep74HK: ]"GJ a2Wk =<؎Ql*eh :}6.N_ +XR"K(u@AVqE؟~ԋ+U?cjJZۆ25|I=/b1 lܺ?n%&Fs'0۶К"IENDB`sfc/alt/smp/core/opcycle_read.cpp000664 001750 001750 00000055707 12651764221 020145 0ustar00sergiosergio000000 000000 case 0x88: { switch(opcode_cycle++) { case 1: rd = op_readpc(); regs.a = op_adc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x28: { switch(opcode_cycle++) { case 1: rd = op_readpc(); regs.a = op_and(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x68: { switch(opcode_cycle++) { case 1: rd = op_readpc(); regs.a = op_cmp(regs.a, rd); opcode_cycle = 0; break; } break; } case 0xc8: { switch(opcode_cycle++) { case 1: rd = op_readpc(); regs.x = op_cmp(regs.x, rd); opcode_cycle = 0; break; } break; } case 0xad: { switch(opcode_cycle++) { case 1: rd = op_readpc(); regs.y = op_cmp(regs.y, rd); opcode_cycle = 0; break; } break; } case 0x48: { switch(opcode_cycle++) { case 1: rd = op_readpc(); regs.a = op_eor(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x08: { switch(opcode_cycle++) { case 1: rd = op_readpc(); regs.a = op_or(regs.a, rd); opcode_cycle = 0; break; } break; } case 0xa8: { switch(opcode_cycle++) { case 1: rd = op_readpc(); regs.a = op_sbc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x86: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: rd = op_readdp(regs.x); regs.a = op_adc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x26: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: rd = op_readdp(regs.x); regs.a = op_and(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x66: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: rd = op_readdp(regs.x); regs.a = op_cmp(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x46: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: rd = op_readdp(regs.x); regs.a = op_eor(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x06: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: rd = op_readdp(regs.x); regs.a = op_or(regs.a, rd); opcode_cycle = 0; break; } break; } case 0xa6: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: rd = op_readdp(regs.x); regs.a = op_sbc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x84: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); regs.a = op_adc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x24: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); regs.a = op_and(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x64: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); regs.a = op_cmp(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x3e: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); regs.x = op_cmp(regs.x, rd); opcode_cycle = 0; break; } break; } case 0x7e: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); regs.y = op_cmp(regs.y, rd); opcode_cycle = 0; break; } break; } case 0x44: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); regs.a = op_eor(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x04: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); regs.a = op_or(regs.a, rd); opcode_cycle = 0; break; } break; } case 0xa4: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); regs.a = op_sbc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x94: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: rd = op_readdp(dp + regs.x); regs.a = op_adc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x34: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: rd = op_readdp(dp + regs.x); regs.a = op_and(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x74: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: rd = op_readdp(dp + regs.x); regs.a = op_cmp(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x54: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: rd = op_readdp(dp + regs.x); regs.a = op_eor(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x14: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: rd = op_readdp(dp + regs.x); regs.a = op_or(regs.a, rd); opcode_cycle = 0; break; } break; } case 0xb4: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: rd = op_readdp(dp + regs.x); regs.a = op_sbc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x85: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); regs.a = op_adc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x25: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); regs.a = op_and(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x65: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); regs.a = op_cmp(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x1e: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); regs.x = op_cmp(regs.x, rd); opcode_cycle = 0; break; } break; } case 0x5e: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); regs.y = op_cmp(regs.y, rd); opcode_cycle = 0; break; } break; } case 0x45: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); regs.a = op_eor(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x05: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); regs.a = op_or(regs.a, rd); opcode_cycle = 0; break; } break; } case 0xa5: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: rd = op_readaddr(dp); regs.a = op_sbc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x95: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: rd = op_readaddr(dp + regs.x); regs.a = op_adc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x96: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: rd = op_readaddr(dp + regs.y); regs.a = op_adc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x35: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: rd = op_readaddr(dp + regs.x); regs.a = op_and(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x36: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: rd = op_readaddr(dp + regs.y); regs.a = op_and(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x75: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: rd = op_readaddr(dp + regs.x); regs.a = op_cmp(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x76: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: rd = op_readaddr(dp + regs.y); regs.a = op_cmp(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x55: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: rd = op_readaddr(dp + regs.x); regs.a = op_eor(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x56: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: rd = op_readaddr(dp + regs.y); regs.a = op_eor(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x15: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: rd = op_readaddr(dp + regs.x); regs.a = op_or(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x16: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: rd = op_readaddr(dp + regs.y); regs.a = op_or(regs.a, rd); opcode_cycle = 0; break; } break; } case 0xb5: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: rd = op_readaddr(dp + regs.x); regs.a = op_sbc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0xb6: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: op_io(); break; case 4: rd = op_readaddr(dp + regs.y); regs.a = op_sbc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x87: { switch(opcode_cycle++) { case 1: dp = op_readpc() + regs.x; break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: rd = op_readaddr(sp); regs.a = op_adc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x27: { switch(opcode_cycle++) { case 1: dp = op_readpc() + regs.x; break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: rd = op_readaddr(sp); regs.a = op_and(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x67: { switch(opcode_cycle++) { case 1: dp = op_readpc() + regs.x; break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: rd = op_readaddr(sp); regs.a = op_cmp(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x47: { switch(opcode_cycle++) { case 1: dp = op_readpc() + regs.x; break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: rd = op_readaddr(sp); regs.a = op_eor(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x07: { switch(opcode_cycle++) { case 1: dp = op_readpc() + regs.x; break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: rd = op_readaddr(sp); regs.a = op_or(regs.a, rd); opcode_cycle = 0; break; } break; } case 0xa7: { switch(opcode_cycle++) { case 1: dp = op_readpc() + regs.x; break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: rd = op_readaddr(sp); regs.a = op_sbc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x97: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: rd = op_readaddr(sp + regs.y); regs.a = op_adc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x37: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: rd = op_readaddr(sp + regs.y); regs.a = op_and(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x77: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: rd = op_readaddr(sp + regs.y); regs.a = op_cmp(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x57: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: rd = op_readaddr(sp + regs.y); regs.a = op_eor(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x17: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: rd = op_readaddr(sp + regs.y); regs.a = op_or(regs.a, rd); opcode_cycle = 0; break; } break; } case 0xb7: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: op_io(); break; case 3: sp = op_readdp(dp); break; case 4: sp |= op_readdp(dp + 1) << 8; break; case 5: rd = op_readaddr(sp + regs.y); regs.a = op_sbc(regs.a, rd); opcode_cycle = 0; break; } break; } case 0x99: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: rd = op_readdp(regs.y); break; case 3: wr = op_readdp(regs.x); wr = op_adc(wr, rd); break; case 4: (1) ? op_writedp(regs.x, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x39: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: rd = op_readdp(regs.y); break; case 3: wr = op_readdp(regs.x); wr = op_and(wr, rd); break; case 4: (1) ? op_writedp(regs.x, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x79: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: rd = op_readdp(regs.y); break; case 3: wr = op_readdp(regs.x); wr = op_cmp(wr, rd); break; case 4: (0) ? op_writedp(regs.x, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x59: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: rd = op_readdp(regs.y); break; case 3: wr = op_readdp(regs.x); wr = op_eor(wr, rd); break; case 4: (1) ? op_writedp(regs.x, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x19: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: rd = op_readdp(regs.y); break; case 3: wr = op_readdp(regs.x); wr = op_or(wr, rd); break; case 4: (1) ? op_writedp(regs.x, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0xb9: { switch(opcode_cycle++) { case 1: op_io(); break; case 2: rd = op_readdp(regs.y); break; case 3: wr = op_readdp(regs.x); wr = op_sbc(wr, rd); break; case 4: (1) ? op_writedp(regs.x, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x89: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: rd = op_readdp(sp); break; case 3: dp = op_readpc(); break; case 4: wr = op_readdp(dp); break; case 5: wr = op_adc(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x29: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: rd = op_readdp(sp); break; case 3: dp = op_readpc(); break; case 4: wr = op_readdp(dp); break; case 5: wr = op_and(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x69: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: rd = op_readdp(sp); break; case 3: dp = op_readpc(); break; case 4: wr = op_readdp(dp); break; case 5: wr = op_cmp(wr, rd); (0) ? op_writedp(dp, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x49: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: rd = op_readdp(sp); break; case 3: dp = op_readpc(); break; case 4: wr = op_readdp(dp); break; case 5: wr = op_eor(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x09: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: rd = op_readdp(sp); break; case 3: dp = op_readpc(); break; case 4: wr = op_readdp(dp); break; case 5: wr = op_or(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0xa9: { switch(opcode_cycle++) { case 1: sp = op_readpc(); break; case 2: rd = op_readdp(sp); break; case 3: dp = op_readpc(); break; case 4: wr = op_readdp(dp); break; case 5: wr = op_sbc(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x98: { switch(opcode_cycle++) { case 1: rd = op_readpc(); break; case 2: dp = op_readpc(); break; case 3: wr = op_readdp(dp); break; case 4: wr = op_adc(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x38: { switch(opcode_cycle++) { case 1: rd = op_readpc(); break; case 2: dp = op_readpc(); break; case 3: wr = op_readdp(dp); break; case 4: wr = op_and(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x78: { switch(opcode_cycle++) { case 1: rd = op_readpc(); break; case 2: dp = op_readpc(); break; case 3: wr = op_readdp(dp); break; case 4: wr = op_cmp(wr, rd); (0) ? op_writedp(dp, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x58: { switch(opcode_cycle++) { case 1: rd = op_readpc(); break; case 2: dp = op_readpc(); break; case 3: wr = op_readdp(dp); break; case 4: wr = op_eor(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x18: { switch(opcode_cycle++) { case 1: rd = op_readpc(); break; case 2: dp = op_readpc(); break; case 3: wr = op_readdp(dp); break; case 4: wr = op_or(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0xb8: { switch(opcode_cycle++) { case 1: rd = op_readpc(); break; case 2: dp = op_readpc(); break; case 3: wr = op_readdp(dp); break; case 4: wr = op_sbc(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); opcode_cycle = 0; break; } break; } case 0x7a: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: op_io(); break; case 4: rd |= op_readdp(dp + 1) << 8; regs.ya = op_addw(regs.ya, rd); opcode_cycle = 0; break; } break; } case 0x9a: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: op_io(); break; case 4: rd |= op_readdp(dp + 1) << 8; regs.ya = op_subw(regs.ya, rd); opcode_cycle = 0; break; } break; } case 0x5a: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: rd = op_readdp(dp); break; case 3: rd |= op_readdp(dp + 1) << 8; op_cmpw(regs.ya, rd); opcode_cycle = 0; break; } break; } case 0x4a: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); regs.p.c = regs.p.c & !!(rd & (1 << bit)); opcode_cycle = 0; break; } break; } case 0x6a: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); regs.p.c = regs.p.c & !(rd & (1 << bit)); opcode_cycle = 0; break; } break; } case 0x8a: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); break; case 4: op_io(); regs.p.c = regs.p.c ^ !!(rd & (1 << bit)); opcode_cycle = 0; break; } break; } case 0xea: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); rd ^= (1 << bit); break; case 4: op_writeaddr(dp, rd); opcode_cycle = 0; break; } break; } case 0x0a: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); break; case 4: op_io(); regs.p.c = regs.p.c | !!(rd & (1 << bit)); opcode_cycle = 0; break; } break; } case 0x2a: { switch(opcode_cycle++) { case 1: dp = op_readpc(); break; case 2: dp |= op_readpc() << 8; break; case 3: bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); break; case 4: op_io(); regs.p.c = regs.p.c | !(rd & (1 << bit)); opcode_cycle = 0; break; } break; } sfc/chip/superfx/disassembler/000700 001750 001750 00000000000 12656700342 017542 5ustar00sergiosergio000000 000000 sfc/controller/mouse/000700 001750 001750 00000000000 12656700342 015761 5ustar00sergiosergio000000 000000 gb/gb.hpp000664 001750 001750 00000002343 12651764221 013403 0ustar00sergiosergio000000 000000 #ifndef GB_HPP #define GB_HPP #include #include namespace GameBoy { namespace Info { static const char Name[] = "bgb"; static const unsigned SerializerVersion = 4; } } /* bgb - Game Boy, Super Game Boy, and Game Boy Color emulator author: byuu license: GPLv3 project started: 2010-12-27 */ #include namespace GameBoy { struct Thread { cothread_t thread; unsigned frequency; int64_t clock; inline void create(void (*entrypoint)(), unsigned frequency) { if(thread) co_delete(thread); thread = co_create(65536 * sizeof(void*), entrypoint); this->frequency = frequency; clock = 0; } inline void serialize(serializer& s) { s.integer(frequency); s.integer(clock); } inline Thread() : thread(nullptr) { } inline ~Thread() { if(thread) co_delete(thread); } }; #include #include #include #include #include #include #include #include #include }; #endif phoenix/qt/action/separator.cpp000664 001750 001750 00000000402 12651764221 017763 0ustar00sergiosergio000000 000000 namespace phoenix { void pSeparator::constructor() { qtAction = new QAction(0); qtAction->setSeparator(true); } void pSeparator::destructor() { if(action.state.menu) action.state.menu->remove(separator); delete qtAction; qtAction = nullptr; } } gba/cartridge/cartridge.hpp000664 001750 001750 00000001425 12651764221 017064 0ustar00sergiosergio000000 000000 struct Cartridge : property { #include "memory.hpp" readonly loaded; readonly sha256; readonly has_sram; readonly has_eeprom; readonly has_flashrom; struct Information { string markup; string title; } information; string title(); struct Media { unsigned id; string name; }; vector memory; void load(); void unload(); void power(); uint8* ram_data(); unsigned ram_size(); uint32 read(uint8* data, uint32 addr, uint32 size); void write(uint8* data, uint32 addr, uint32 size, uint32 word); uint32 read(uint32 addr, uint32 size); void write(uint32 addr, uint32 size, uint32 word); void serialize(serializer&); Cartridge(); ~Cartridge(); }; extern Cartridge cartridge; phoenix/qt/action/000700 001750 001750 00000000000 12656700342 015246 5ustar00sergiosergio000000 000000 sfc/dsp/misc.cpp000664 001750 001750 00000001314 12651764221 014707 0ustar00sergiosergio000000 000000 #ifdef DSP_CPP void DSP::misc_27() { state.t_pmon = REG(pmon) & ~1; //voice 0 doesn't support PMON } void DSP::misc_28() { state.t_non = REG(non); state.t_eon = REG(eon); state.t_dir = REG(dir); } void DSP::misc_29() { state.every_other_sample ^= 1; if(state.every_other_sample) { state.new_kon &= ~state.kon; //clears KON 63 clocks after it was last read } } void DSP::misc_30() { if(state.every_other_sample) { state.kon = state.new_kon; state.t_koff = REG(koff); } counter_tick(); //noise if(counter_poll(REG(flg) & 0x1f) == true) { int feedback = (state.noise << 13) ^ (state.noise << 14); state.noise = (feedback & 0x4000) ^ (state.noise >> 1); } } #endif phoenix/gtk/action/separator.cpp000664 001750 001750 00000000346 12651764221 020133 0ustar00sergiosergio000000 000000 namespace phoenix { void pSeparator::constructor() { widget = gtk_separator_menu_item_new(); } void pSeparator::destructor() { gtk_widget_destroy(widget); } void pSeparator::orphan() { destructor(); constructor(); } } nall/image/load.hpp000664 001750 001750 00000005247 12651764221 015360 0ustar00sergiosergio000000 000000 #ifndef NALL_IMAGE_LOAD_HPP #define NALL_IMAGE_LOAD_HPP namespace nall { bool image::loadBMP(const string& filename) { uint32_t* outputData; unsigned outputWidth, outputHeight; if(bmp::read(filename, outputData, outputWidth, outputHeight) == false) return false; allocate(outputWidth, outputHeight); const uint32_t* sp = outputData; uint8_t* dp = data; for(unsigned y = 0; y < outputHeight; y++) { for(unsigned x = 0; x < outputWidth; x++) { uint32_t color = *sp++; uint64_t a = normalize((uint8_t)(color >> 24), 8, alpha.depth); uint64_t r = normalize((uint8_t)(color >> 16), 8, red.depth); uint64_t g = normalize((uint8_t)(color >> 8), 8, green.depth); uint64_t b = normalize((uint8_t)(color >> 0), 8, blue.depth); write(dp, (a << alpha.shift) | (r << red.shift) | (g << green.shift) | (b << blue.shift)); dp += stride; } } delete[] outputData; return true; } bool image::loadPNG(const string& filename) { if(!file::exists(filename)) return false; auto buffer = file::read(filename); return loadPNG(buffer.data(), buffer.size()); } bool image::loadPNG(const uint8_t* pngData, unsigned pngSize) { png source; if(source.decode(pngData, pngSize) == false) return false; allocate(source.info.width, source.info.height); const uint8_t* sp = source.data; uint8_t* dp = data; auto decode = [&]() -> uint64_t { uint64_t p, r, g, b, a; switch(source.info.colorType) { case 0: //L r = g = b = source.readbits(sp); a = (1 << source.info.bitDepth) - 1; break; case 2: //R,G,B r = source.readbits(sp); g = source.readbits(sp); b = source.readbits(sp); a = (1 << source.info.bitDepth) - 1; break; case 3: //P p = source.readbits(sp); r = source.info.palette[p][0]; g = source.info.palette[p][1]; b = source.info.palette[p][2]; a = (1 << source.info.bitDepth) - 1; break; case 4: //L,A r = g = b = source.readbits(sp); a = source.readbits(sp); break; case 6: //R,G,B,A r = source.readbits(sp); g = source.readbits(sp); b = source.readbits(sp); a = source.readbits(sp); break; } a = normalize(a, source.info.bitDepth, alpha.depth); r = normalize(r, source.info.bitDepth, red.depth); g = normalize(g, source.info.bitDepth, green.depth); b = normalize(b, source.info.bitDepth, blue.depth); return (a << alpha.shift) | (r << red.shift) | (g << green.shift) | (b << blue.shift); }; for(unsigned y = 0; y < height; y++) { for(unsigned x = 0; x < width; x++) { write(dp, decode()); dp += stride; } } return true; } } #endif gb/system/system.cpp000664 001750 001750 00000004011 12651764221 015650 0ustar00sergiosergio000000 000000 #include #define SYSTEM_CPP namespace GameBoy { #include "serialization.cpp" System system; void System::run() { scheduler.sync = Scheduler::SynchronizeMode::None; scheduler.enter(); if(scheduler.exit_reason() == Scheduler::ExitReason::FrameEvent) { interface->videoRefresh(video.palette, ppu.screen, 4 * 160, 160, 144); } } void System::runtosave() { scheduler.sync = Scheduler::SynchronizeMode::CPU; runthreadtosave(); scheduler.sync = Scheduler::SynchronizeMode::All; scheduler.active_thread = ppu.thread; runthreadtosave(); scheduler.sync = Scheduler::SynchronizeMode::All; scheduler.active_thread = apu.thread; runthreadtosave(); scheduler.sync = Scheduler::SynchronizeMode::None; } void System::runthreadtosave() { while(true) { scheduler.enter(); if(scheduler.exit_reason() == Scheduler::ExitReason::SynchronizeEvent) break; if(scheduler.exit_reason() == Scheduler::ExitReason::FrameEvent) { interface->videoRefresh(video.palette, ppu.screen, 4 * 160, 160, 144); } } } void System::init() { assert(interface != nullptr); } void System::load(Revision revision) { this->revision = revision; serialize_init(); if(revision == Revision::SuperGameBoy) return; //Super Famicom core loads boot ROM for SGB string manifest = string::read({interface->path(ID::System), "manifest.bml"}); auto document = Markup::Document(manifest); interface->loadRequest( revision == Revision::GameBoy ? ID::GameBoyBootROM : ID::GameBoyColorBootROM, document["system/cpu/rom/name"].data ); if(!file::exists({interface->path(ID::System), document["system/cpu/rom/name"].data})) { interface->notify("Error: required Game Boy firmware boot.rom not found.\n"); } } void System::power() { bus.power(); cartridge.power(); cpu.power(); ppu.power(); apu.power(); scheduler.init(); clocks_executed = 0; } System::System() { for(auto& byte : bootROM.dmg) byte = 0; for(auto& byte : bootROM.sgb) byte = 0; for(auto& byte : bootROM.cgb) byte = 0; } } fc/apu/dmc.hpp000664 001750 001750 00000000736 12651764221 014347 0ustar00sergiosergio000000 000000 struct DMC { unsigned length_counter; bool irq_pending; uint4 period; unsigned period_counter; bool irq_enable; bool loop_mode; uint8 dac_latch; uint8 addr_latch; uint8 length_latch; uint15 read_addr; unsigned dma_delay_counter; uint3 bit_counter; bool have_dma_buffer; uint8 dma_buffer; bool have_sample; uint8 sample; void start(); void stop(); uint8 clock(); void power(); void reset(); void serialize(serializer&); } dmc; gb/apu/wave/wave.cpp000664 001750 001750 00000003625 12651764221 015503 0ustar00sergiosergio000000 000000 #ifdef APU_CPP void APU::Wave::run() { if(period && --period == 0) { period = 1 * (2048 - frequency); pattern_sample = pattern[++pattern_offset]; } uint4 sample = pattern_sample >> volume_shift; if(enable == false) sample = 0; output = sample; } void APU::Wave::clock_length() { if(enable && counter) { if(++length == 0) enable = false; } } void APU::Wave::write(unsigned r, uint8 data) { if(r == 0) { //$ff1a NR30 dac_enable = data & 0x80; if(dac_enable == false) enable = false; } if(r == 1) { //$ff1b NR31 length = data; } if(r == 2) { //$ff1c NR32 switch((data >> 5) & 3) { case 0: volume_shift = 4; break; // 0% case 1: volume_shift = 0; break; //100% case 2: volume_shift = 1; break; // 50% case 3: volume_shift = 2; break; // 25% } } if(r == 3) { //$ff1d NR33 frequency = (frequency & 0x0700) | data; } if(r == 4) { //$ff1e NR34 bool initialize = data & 0x80; counter = data & 0x40; frequency = ((data & 7) << 8) | (frequency & 0x00ff); if(initialize) { enable = dac_enable; period = 1 * (2048 - frequency); pattern_offset = 0; } } } void APU::Wave::write_pattern(unsigned p, uint8 data) { p <<= 1; pattern[p + 0] = (data >> 4) & 15; pattern[p + 1] = (data >> 0) & 15; } void APU::Wave::power() { enable = 0; dac_enable = 0; volume_shift = 0; frequency = 0; counter = 0; LinearFeedbackShiftRegisterGenerator r; for(auto& n : pattern) n = r() & 15; output = 0; length = 0; period = 0; pattern_offset = 0; pattern_sample = 0; } void APU::Wave::serialize(serializer& s) { s.integer(enable); s.integer(dac_enable); s.integer(volume_shift); s.integer(frequency); s.integer(counter); s.array(pattern); s.integer(output); s.integer(length); s.integer(period); s.integer(pattern_offset); s.integer(pattern_sample); } #endif processor/hg51b/000700 001750 001750 00000000000 12656700342 014620 5ustar00sergiosergio000000 000000 gb/video/video.hpp000664 001750 001750 00000000603 12651764221 015224 0ustar00sergiosergio000000 000000 struct Video { uint32_t* palette = nullptr; void generate_palette(Emulator::Interface::PaletteMode mode); Video(); ~Video(); private: Emulator::Interface::PaletteMode mode; static const uint16 monochrome[4][3]; uint32_t palette_dmg(unsigned color) const; uint32_t palette_sgb(unsigned color) const; uint32_t palette_cgb(unsigned color) const; }; extern Video video; phoenix/qt/widget/text-edit.cpp000664 001750 001750 00000002755 12651764221 017715 0ustar00sergiosergio000000 000000 namespace phoenix { void pTextEdit::setCursorPosition(unsigned position) { QTextCursor cursor = qtTextEdit->textCursor(); unsigned lastCharacter = strlen(qtTextEdit->toPlainText().toUtf8().constData()); cursor.setPosition(min(position, lastCharacter)); qtTextEdit->setTextCursor(cursor); } void pTextEdit::setEditable(bool editable) { qtTextEdit->setTextInteractionFlags(editable ? Qt::TextEditorInteraction : Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse); } void pTextEdit::setText(string text) { qtTextEdit->setPlainText(QString::fromUtf8(text)); } void pTextEdit::setWordWrap(bool wordWrap) { qtTextEdit->setWordWrapMode(wordWrap ? QTextOption::WordWrap : QTextOption::NoWrap); qtTextEdit->setHorizontalScrollBarPolicy(wordWrap ? Qt::ScrollBarAlwaysOff : Qt::ScrollBarAlwaysOn); qtTextEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); } string pTextEdit::text() { return qtTextEdit->toPlainText().toUtf8().constData(); } void pTextEdit::constructor() { qtWidget = qtTextEdit = new QTextEdit; connect(qtTextEdit, SIGNAL(textChanged()), SLOT(onChange())); pWidget::synchronizeState(); setEditable(textEdit.state.editable); setText(textEdit.state.text); setWordWrap(textEdit.state.wordWrap); } void pTextEdit::destructor() { delete qtTextEdit; qtWidget = qtTextEdit = nullptr; } void pTextEdit::orphan() { destructor(); constructor(); } void pTextEdit::onChange() { textEdit.state.text = text(); if(textEdit.onChange) textEdit.onChange(); } } sfc/memory/memory.hpp000664 001750 001750 00000004471 12651764221 016022 0ustar00sergiosergio000000 000000 #ifdef __LIBRETRO__ #include "../../target-libretro/libretro.h" #endif struct Memory { virtual inline unsigned size() const; virtual uint8 read(unsigned addr) = 0; virtual void write(unsigned addr, uint8 data) = 0; virtual uint8* data() { return NULL; } }; struct StaticRAM : Memory { inline uint8* data(); inline unsigned size() const; inline uint8 read(unsigned addr); inline void write(unsigned addr, uint8 n); inline uint8& operator[](unsigned addr); inline const uint8& operator[](unsigned addr) const; inline StaticRAM(unsigned size); inline ~StaticRAM(); private: uint8* data_; unsigned size_; }; struct MappedRAM : Memory { inline void reset(); inline void map(uint8*, unsigned); inline void copy(const stream& memory); inline void read(const stream& memory); inline void write_protect(bool status); inline uint8* data(); inline unsigned size() const; inline uint8 read(unsigned addr); inline void write(unsigned addr, uint8 n); inline const uint8& operator[](unsigned addr) const; inline MappedRAM(); private: uint8* data_; unsigned size_; bool write_protect_; }; struct Bus { alwaysinline static unsigned mirror(unsigned addr, unsigned size); alwaysinline static unsigned reduce(unsigned addr, unsigned mask); alwaysinline uint8 read(unsigned addr); alwaysinline void write(unsigned addr, uint8 data); unsigned idcount; function reader[256]; function writer[256]; static const uint32 fast_page_size_bits = 13;//keep at 13 or lower so the RAM mirrors can be on the fast path static const uint32 fast_page_size = (1 << fast_page_size_bits); static const uint32 fast_page_size_mask = (fast_page_size - 1); uint8* fast_read[0x1000000>>fast_page_size_bits]; uint8* fast_write[0x1000000>>fast_page_size_bits]; void map( const function& reader, const function& writer, unsigned banklo, unsigned bankhi, unsigned addrlo, unsigned addrhi, unsigned size = 0, unsigned base = 0, unsigned mask = 0, unsigned fastmode = 0, uint8* fast_ptr = NULL ); void map_reset(); void map_xml(); #ifdef __LIBRETRO__ vector libretro_mem_map; #endif uint8 lookup[16 * 1024 * 1024]; uint32 target[16 * 1024 * 1024]; }; extern Bus bus; sfc/slot/sufamiturbo/sufamiturbo.cpp000664 001750 001750 00000000436 12651764221 021053 0ustar00sergiosergio000000 000000 #include #define SUFAMITURBO_CPP namespace SuperFamicom { #include "serialization.cpp" SufamiTurboCartridge sufamiturboA; SufamiTurboCartridge sufamiturboB; void SufamiTurboCartridge::load() { } void SufamiTurboCartridge::unload() { rom.reset(); ram.reset(); } } nall/intrinsics.hpp000664 001750 001750 00000006464 12651764221 015546 0ustar00sergiosergio000000 000000 #ifndef NALL_INTRINSICS_HPP #define NALL_INTRINSICS_HPP namespace nall { struct Intrinsics { enum class Compiler : unsigned { Clang, GCC, VisualCPP, Unknown }; enum class Platform : unsigned { Windows, MacOSX, X, Unknown }; //X = Linux, BSD, etc enum class Architecture : unsigned { x86, amd64, ARM, Unknown }; enum class Endian : unsigned { LSB, MSB, Unknown }; static inline Compiler compiler(); static inline Platform platform(); static inline Architecture architecture(); static inline Endian endian(); }; /* Compiler detection */ #if defined(__clang__) #define COMPILER_CLANG Intrinsics::Compiler Intrinsics::compiler() { return Intrinsics::Compiler::Clang; } #elif defined(__GNUC__) #define COMPILER_GCC Intrinsics::Compiler Intrinsics::compiler() { return Intrinsics::Compiler::GCC; } #elif defined(_MSC_VER) #define COMPILER_VISUALCPP Intrinsics::Compiler Intrinsics::compiler() { return Intrinsics::Compiler::VisualCPP; } #else #warning "unable to detect compiler" #define COMPILER_UNKNOWN Intrinsics::Compiler Intrinsics::compiler() { return Intrinsics::Compiler::Unknown; } #endif /* Platform detection */ #if defined(_WIN32) #define PLATFORM_WINDOWS Intrinsics::Platform Intrinsics::platform() { return Intrinsics::Platform::Windows; } #elif defined(__APPLE__) #define PLATFORM_MACOSX Intrinsics::Platform Intrinsics::platform() { return Intrinsics::Platform::MacOSX; } #elif defined(linux) || defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__GNU__) #define PLATFORM_X Intrinsics::Platform Intrinsics::platform() { return Intrinsics::Platform::X; } #else #warning "unable to detect platform" #define PLATFORM_UNKNOWN Intrinsics::Platform Intrinsics::platform() { return Intrinsics::Platform::Unknown; } #endif /* Architecture Detection */ #if defined(__i386__) || defined(_M_IX86) #define ARCH_X86 Intrinsics::Architecture Intrinsics::architecture() { return Intrinsics::Architecture::x86; } #elif defined(__amd64__) || defined(_M_AMD64) #define ARCH_AMD64 Intrinsics::Architecture Intrinsics::architecture() { return Intrinsics::Architecture::amd64; } #elif defined(__arm__) || defined(__ARM_EABI__) #define ARCH_ARM Intrinsics::Architecture Intrinsics::architecture() { return Intrinsics::Architecture::ARM; } #else #warning "unable to detect architecture" #define ARCH_UNKNOWN Intrinsics::Architecture Intrinsics::architecture() { return Intrinsics::Architecture::Unknown; } #endif /* Endian detection */ #if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__) || defined(__i386__) || defined(__amd64__) || defined(_M_IX86) || defined(_M_AMD64) || defined(__ARM_EABI__) || defined(__arm__) #define ENDIAN_LSB Intrinsics::Endian Intrinsics::endian() { return Intrinsics::Endian::LSB; } #elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && __BYTE_ORDER == __BIG_ENDIAN) || defined(__BIG_ENDIAN__) || defined(__powerpc__) || defined(_M_PPC) #define ENDIAN_MSB Intrinsics::Endian Intrinsics::endian() { return Intrinsics::Endian::MSB; } #else #warning "unable to detect endian" #define ENDIAN_UNKNOWN Intrinsics::Endian Intrinsics::endian() { return Intrinsics::Endian::Unknown; } #endif } #endif phoenix/gtk/widget/text-edit.cpp000664 001750 001750 00000004553 12651764221 020054 0ustar00sergiosergio000000 000000 namespace phoenix { static void TextEdit_change(TextEdit* self) { self->state.text = self->text(); if(self->p.locked == false && self->onChange) self->onChange(); } bool pTextEdit::focused() { return GTK_WIDGET_HAS_FOCUS(subWidget); } void pTextEdit::setCursorPosition(unsigned position) { GtkTextMark* mark = gtk_text_buffer_get_mark(textBuffer, "insert"); GtkTextIter iter; gtk_text_buffer_get_end_iter(textBuffer, &iter); gtk_text_iter_set_offset(&iter, min(position, gtk_text_iter_get_offset(&iter))); gtk_text_buffer_place_cursor(textBuffer, &iter); gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(subWidget), mark); } void pTextEdit::setEditable(bool editable) { gtk_text_view_set_editable(GTK_TEXT_VIEW(subWidget), editable); } void pTextEdit::setText(string text) { locked = true; gtk_text_buffer_set_text(textBuffer, text, -1); locked = false; } void pTextEdit::setWordWrap(bool wordWrap) { gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(subWidget), wordWrap ? GTK_WRAP_WORD_CHAR : GTK_WRAP_NONE); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(gtkWidget), wordWrap ? GTK_POLICY_NEVER : GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS); } string pTextEdit::text() { GtkTextIter start, end; gtk_text_buffer_get_start_iter(textBuffer, &start); gtk_text_buffer_get_end_iter(textBuffer, &end); char* temp = gtk_text_buffer_get_text(textBuffer, &start, &end, true); string text = temp; g_free(temp); return text; } void pTextEdit::constructor() { gtkWidget = gtk_scrolled_window_new(0, 0); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(gtkWidget), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(gtkWidget), GTK_SHADOW_ETCHED_IN); subWidget = gtk_text_view_new(); gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(subWidget), GTK_WRAP_WORD_CHAR); gtk_container_add(GTK_CONTAINER(gtkWidget), subWidget); textBuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(subWidget)); g_signal_connect_swapped(G_OBJECT(textBuffer), "changed", G_CALLBACK(TextEdit_change), (gpointer)&textEdit); gtk_widget_show(subWidget); setEditable(textEdit.state.editable); setText(textEdit.state.text); setWordWrap(textEdit.state.wordWrap); } void pTextEdit::destructor() { gtk_widget_destroy(subWidget); gtk_widget_destroy(gtkWidget); } void pTextEdit::orphan() { destructor(); constructor(); } } phoenix/reference/action/000700 001750 001750 00000000000 12656700342 016560 5ustar00sergiosergio000000 000000 phoenix/gtk/action/item.cpp000664 001750 001750 00000001521 12651764221 017065 0ustar00sergiosergio000000 000000 namespace phoenix { static void Item_activate(Item* self) { if(self->onActivate) self->onActivate(); } void pItem::setImage(const image& image) { if(image.empty() == false) { GtkImage* gtkImage = CreateImage(image, true); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(widget), (GtkWidget*)gtkImage); } else { gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(widget), nullptr); } } void pItem::setText(string text) { gtk_menu_item_set_label(GTK_MENU_ITEM(widget), mnemonic(text)); } void pItem::constructor() { widget = gtk_image_menu_item_new_with_mnemonic(""); g_signal_connect_swapped(G_OBJECT(widget), "activate", G_CALLBACK(Item_activate), (gpointer)&item); setText(item.state.text); } void pItem::destructor() { gtk_widget_destroy(widget); } void pItem::orphan() { destructor(); constructor(); } } profile/Game Boy.sys/boot.rom000664 001750 001750 00000000400 12651764221 017224 0ustar00sergiosergio000000 000000 1!2| !&>2 >2>ww>G!͕͖{4 "# >!/ =(2 .g>dWB>@ D  $|b(d { >BB  O O "#"#ff s nٙgcnܙ3>Psfc/alt/ppu-performance/cache/000700 001750 001750 00000000000 12656700342 017374 5ustar00sergiosergio000000 000000 phoenix/qt/widget/widget.cpp000664 001750 001750 00000003042 12651764221 017257 0ustar00sergiosergio000000 000000 namespace phoenix { QWidget* pWidget::container(Widget& widget) { return nullptr; } bool pWidget::focused() { return qtWidget->hasFocus(); } Size pWidget::minimumSize() { return {0, 0}; } void pWidget::setEnabled(bool enabled) { if(!widget.parent()) enabled = false; if(widget.state.abstract) enabled = false; if(!widget.enabledToAll()) enabled = false; qtWidget->setEnabled(enabled); } void pWidget::setFocused() { qtWidget->setFocus(Qt::OtherFocusReason); } void pWidget::setFont(string font) { qtWidget->setFont(pFont::create(font)); } void pWidget::setGeometry(Geometry geometry) { Position displacement = GetDisplacement(&widget); geometry.x -= displacement.x; geometry.y -= displacement.y; qtWidget->setGeometry(geometry.x, geometry.y, geometry.width, geometry.height); if(widget.onSize) widget.onSize(); } void pWidget::setVisible(bool visible) { if(!widget.parent()) visible = false; if(widget.state.abstract) visible = false; if(!widget.visibleToAll()) visible = false; qtWidget->setVisible(visible); } void pWidget::constructor() { if(widget.state.abstract) qtWidget = new QWidget; } //pWidget::constructor() called before p{Derived}::constructor(); ergo qtWidget is not yet valid //pWidget::synchronizeState() is called to finish construction of p{Derived}::constructor() void pWidget::synchronizeState() { setFont(widget.font()); } void pWidget::destructor() { if(widget.state.abstract) { delete qtWidget; qtWidget = nullptr; } } void pWidget::orphan() { destructor(); constructor(); } } processor/lr35902/lr35902.cpp000664 001750 001750 00000046222 12651764221 016501 0ustar00sergiosergio000000 000000 #include #include "lr35902.hpp" namespace Processor { #include "instructions.cpp" #include "disassembler.cpp" #include "serialization.cpp" void LR35902::power() { r.halt = false; r.stop = false; r.ei = false; r.ime = false; } void LR35902::exec() { uint8 opcode = op_read(r[PC]++); switch(opcode) { case 0x00: return op_nop(); case 0x01: return op_ld_rr_nn(); case 0x02: return op_ld_rr_a(); case 0x03: return op_inc_rr(); case 0x04: return op_inc_r(); case 0x05: return op_dec_r(); case 0x06: return op_ld_r_n(); case 0x07: return op_rlca(); case 0x08: return op_ld_nn_sp(); case 0x09: return op_add_hl_rr(); case 0x0a: return op_ld_a_rr(); case 0x0b: return op_dec_rr(); case 0x0c: return op_inc_r(); case 0x0d: return op_dec_r(); case 0x0e: return op_ld_r_n(); case 0x0f: return op_rrca(); case 0x10: return op_stop(); case 0x11: return op_ld_rr_nn(); case 0x12: return op_ld_rr_a(); case 0x13: return op_inc_rr(); case 0x14: return op_inc_r(); case 0x15: return op_dec_r(); case 0x16: return op_ld_r_n(); case 0x17: return op_rla(); case 0x18: return op_jr_n(); case 0x19: return op_add_hl_rr(); case 0x1a: return op_ld_a_rr(); case 0x1b: return op_dec_rr(); case 0x1c: return op_inc_r(); case 0x1d: return op_dec_r(); case 0x1e: return op_ld_r_n(); case 0x1f: return op_rra(); case 0x20: return op_jr_f_n(); case 0x21: return op_ld_rr_nn(); case 0x22: return op_ldi_hl_a(); case 0x23: return op_inc_rr(); case 0x24: return op_inc_r(); case 0x25: return op_dec_r(); case 0x26: return op_ld_r_n(); case 0x27: return op_daa(); case 0x28: return op_jr_f_n(); case 0x29: return op_add_hl_rr(); case 0x2a: return op_ldi_a_hl(); case 0x2b: return op_dec_rr(); case 0x2c: return op_inc_r(); case 0x2d: return op_dec_r(); case 0x2e: return op_ld_r_n(); case 0x2f: return op_cpl(); case 0x30: return op_jr_f_n(); case 0x31: return op_ld_rr_nn(); case 0x32: return op_ldd_hl_a(); case 0x33: return op_inc_rr(); case 0x34: return op_inc_hl(); case 0x35: return op_dec_hl(); case 0x36: return op_ld_hl_n(); case 0x37: return op_scf(); case 0x38: return op_jr_f_n(); case 0x39: return op_add_hl_rr(); case 0x3a: return op_ldd_a_hl(); case 0x3b: return op_dec_rr(); case 0x3c: return op_inc_r(); case 0x3d: return op_dec_r(); case 0x3e: return op_ld_r_n(); case 0x3f: return op_ccf(); case 0x40: return op_ld_r_r(); case 0x41: return op_ld_r_r(); case 0x42: return op_ld_r_r(); case 0x43: return op_ld_r_r(); case 0x44: return op_ld_r_r(); case 0x45: return op_ld_r_r(); case 0x46: return op_ld_r_hl(); case 0x47: return op_ld_r_r(); case 0x48: return op_ld_r_r(); case 0x49: return op_ld_r_r(); case 0x4a: return op_ld_r_r(); case 0x4b: return op_ld_r_r(); case 0x4c: return op_ld_r_r(); case 0x4d: return op_ld_r_r(); case 0x4e: return op_ld_r_hl(); case 0x4f: return op_ld_r_r(); case 0x50: return op_ld_r_r(); case 0x51: return op_ld_r_r(); case 0x52: return op_ld_r_r(); case 0x53: return op_ld_r_r(); case 0x54: return op_ld_r_r(); case 0x55: return op_ld_r_r(); case 0x56: return op_ld_r_hl(); case 0x57: return op_ld_r_r(); case 0x58: return op_ld_r_r(); case 0x59: return op_ld_r_r(); case 0x5a: return op_ld_r_r(); case 0x5b: return op_ld_r_r(); case 0x5c: return op_ld_r_r(); case 0x5d: return op_ld_r_r(); case 0x5e: return op_ld_r_hl(); case 0x5f: return op_ld_r_r(); case 0x60: return op_ld_r_r(); case 0x61: return op_ld_r_r(); case 0x62: return op_ld_r_r(); case 0x63: return op_ld_r_r(); case 0x64: return op_ld_r_r(); case 0x65: return op_ld_r_r(); case 0x66: return op_ld_r_hl(); case 0x67: return op_ld_r_r(); case 0x68: return op_ld_r_r(); case 0x69: return op_ld_r_r(); case 0x6a: return op_ld_r_r(); case 0x6b: return op_ld_r_r(); case 0x6c: return op_ld_r_r(); case 0x6d: return op_ld_r_r(); case 0x6e: return op_ld_r_hl(); case 0x6f: return op_ld_r_r(); case 0x70: return op_ld_hl_r(); case 0x71: return op_ld_hl_r(); case 0x72: return op_ld_hl_r(); case 0x73: return op_ld_hl_r(); case 0x74: return op_ld_hl_r(); case 0x75: return op_ld_hl_r(); case 0x76: return op_halt(); case 0x77: return op_ld_hl_r(); case 0x78: return op_ld_r_r(); case 0x79: return op_ld_r_r(); case 0x7a: return op_ld_r_r(); case 0x7b: return op_ld_r_r(); case 0x7c: return op_ld_r_r(); case 0x7d: return op_ld_r_r(); case 0x7e: return op_ld_r_hl(); case 0x7f: return op_ld_r_r(); case 0x80: return op_add_a_r(); case 0x81: return op_add_a_r(); case 0x82: return op_add_a_r(); case 0x83: return op_add_a_r(); case 0x84: return op_add_a_r(); case 0x85: return op_add_a_r(); case 0x86: return op_add_a_hl(); case 0x87: return op_add_a_r(); case 0x88: return op_adc_a_r(); case 0x89: return op_adc_a_r(); case 0x8a: return op_adc_a_r(); case 0x8b: return op_adc_a_r(); case 0x8c: return op_adc_a_r(); case 0x8d: return op_adc_a_r(); case 0x8e: return op_adc_a_hl(); case 0x8f: return op_adc_a_r(); case 0x90: return op_sub_a_r(); case 0x91: return op_sub_a_r(); case 0x92: return op_sub_a_r(); case 0x93: return op_sub_a_r(); case 0x94: return op_sub_a_r(); case 0x95: return op_sub_a_r(); case 0x96: return op_sub_a_hl(); case 0x97: return op_sub_a_r(); case 0x98: return op_sbc_a_r(); case 0x99: return op_sbc_a_r(); case 0x9a: return op_sbc_a_r(); case 0x9b: return op_sbc_a_r(); case 0x9c: return op_sbc_a_r(); case 0x9d: return op_sbc_a_r(); case 0x9e: return op_sbc_a_hl(); case 0x9f: return op_sbc_a_r(); case 0xa0: return op_and_a_r(); case 0xa1: return op_and_a_r(); case 0xa2: return op_and_a_r(); case 0xa3: return op_and_a_r(); case 0xa4: return op_and_a_r(); case 0xa5: return op_and_a_r(); case 0xa6: return op_and_a_hl(); case 0xa7: return op_and_a_r(); case 0xa8: return op_xor_a_r(); case 0xa9: return op_xor_a_r(); case 0xaa: return op_xor_a_r(); case 0xab: return op_xor_a_r(); case 0xac: return op_xor_a_r(); case 0xad: return op_xor_a_r(); case 0xae: return op_xor_a_hl(); case 0xaf: return op_xor_a_r(); case 0xb0: return op_or_a_r(); case 0xb1: return op_or_a_r(); case 0xb2: return op_or_a_r(); case 0xb3: return op_or_a_r(); case 0xb4: return op_or_a_r(); case 0xb5: return op_or_a_r(); case 0xb6: return op_or_a_hl(); case 0xb7: return op_or_a_r(); case 0xb8: return op_cp_a_r(); case 0xb9: return op_cp_a_r(); case 0xba: return op_cp_a_r(); case 0xbb: return op_cp_a_r(); case 0xbc: return op_cp_a_r(); case 0xbd: return op_cp_a_r(); case 0xbe: return op_cp_a_hl(); case 0xbf: return op_cp_a_r(); case 0xc0: return op_ret_f(); case 0xc1: return op_pop_rr(); case 0xc2: return op_jp_f_nn(); case 0xc3: return op_jp_nn(); case 0xc4: return op_call_f_nn(); case 0xc5: return op_push_rr(); case 0xc6: return op_add_a_n(); case 0xc7: return op_rst_n<0x00>(); case 0xc8: return op_ret_f(); case 0xc9: return op_ret(); case 0xca: return op_jp_f_nn(); case 0xcb: return op_cb(); case 0xcc: return op_call_f_nn(); case 0xcd: return op_call_nn(); case 0xce: return op_adc_a_n(); case 0xcf: return op_rst_n<0x08>(); case 0xd0: return op_ret_f(); case 0xd1: return op_pop_rr(); case 0xd2: return op_jp_f_nn(); case 0xd3: return op_xx(); case 0xd4: return op_call_f_nn(); case 0xd5: return op_push_rr(); case 0xd6: return op_sub_a_n(); case 0xd7: return op_rst_n<0x10>(); case 0xd8: return op_ret_f(); case 0xd9: return op_reti(); case 0xda: return op_jp_f_nn(); case 0xdb: return op_xx(); case 0xdc: return op_call_f_nn(); case 0xdd: return op_xx(); case 0xde: return op_sbc_a_n(); case 0xdf: return op_rst_n<0x18>(); case 0xe0: return op_ld_ffn_a(); case 0xe1: return op_pop_rr(); case 0xe2: return op_ld_ffc_a(); case 0xe3: return op_xx(); case 0xe4: return op_xx(); case 0xe5: return op_push_rr(); case 0xe6: return op_and_a_n(); case 0xe7: return op_rst_n<0x20>(); case 0xe8: return op_add_sp_n(); case 0xe9: return op_jp_hl(); case 0xea: return op_ld_nn_a(); case 0xeb: return op_xx(); case 0xec: return op_xx(); case 0xed: return op_xx(); case 0xee: return op_xor_a_n(); case 0xef: return op_rst_n<0x28>(); case 0xf0: return op_ld_a_ffn(); case 0xf1: return op_pop_rr(); case 0xf2: return op_ld_a_ffc(); case 0xf3: return op_di(); case 0xf4: return op_xx(); case 0xf5: return op_push_rr(); case 0xf6: return op_or_a_n(); case 0xf7: return op_rst_n<0x30>(); case 0xf8: return op_ld_hl_sp_n(); case 0xf9: return op_ld_sp_hl(); case 0xfa: return op_ld_a_nn(); case 0xfb: return op_ei(); case 0xfc: return op_xx(); case 0xfd: return op_xx(); case 0xfe: return op_cp_a_n(); case 0xff: return op_rst_n<0x38>(); } } void LR35902::exec_cb() { uint8 opcode = op_read(r[PC]++); switch(opcode) { case 0x00: return op_rlc_r(); case 0x01: return op_rlc_r(); case 0x02: return op_rlc_r(); case 0x03: return op_rlc_r(); case 0x04: return op_rlc_r(); case 0x05: return op_rlc_r(); case 0x06: return op_rlc_hl(); case 0x07: return op_rlc_r(); case 0x08: return op_rrc_r(); case 0x09: return op_rrc_r(); case 0x0a: return op_rrc_r(); case 0x0b: return op_rrc_r(); case 0x0c: return op_rrc_r(); case 0x0d: return op_rrc_r(); case 0x0e: return op_rrc_hl(); case 0x0f: return op_rrc_r(); case 0x10: return op_rl_r(); case 0x11: return op_rl_r(); case 0x12: return op_rl_r(); case 0x13: return op_rl_r(); case 0x14: return op_rl_r(); case 0x15: return op_rl_r(); case 0x16: return op_rl_hl(); case 0x17: return op_rl_r(); case 0x18: return op_rr_r(); case 0x19: return op_rr_r(); case 0x1a: return op_rr_r(); case 0x1b: return op_rr_r(); case 0x1c: return op_rr_r(); case 0x1d: return op_rr_r(); case 0x1e: return op_rr_hl(); case 0x1f: return op_rr_r(); case 0x20: return op_sla_r(); case 0x21: return op_sla_r(); case 0x22: return op_sla_r(); case 0x23: return op_sla_r(); case 0x24: return op_sla_r(); case 0x25: return op_sla_r(); case 0x26: return op_sla_hl(); case 0x27: return op_sla_r(); case 0x28: return op_sra_r(); case 0x29: return op_sra_r(); case 0x2a: return op_sra_r(); case 0x2b: return op_sra_r(); case 0x2c: return op_sra_r(); case 0x2d: return op_sra_r(); case 0x2e: return op_sra_hl(); case 0x2f: return op_sra_r(); case 0x30: return op_swap_r(); case 0x31: return op_swap_r(); case 0x32: return op_swap_r(); case 0x33: return op_swap_r(); case 0x34: return op_swap_r(); case 0x35: return op_swap_r(); case 0x36: return op_swap_hl(); case 0x37: return op_swap_r(); case 0x38: return op_srl_r(); case 0x39: return op_srl_r(); case 0x3a: return op_srl_r(); case 0x3b: return op_srl_r(); case 0x3c: return op_srl_r(); case 0x3d: return op_srl_r(); case 0x3e: return op_srl_hl(); case 0x3f: return op_srl_r(); case 0x40: return op_bit_n_r<0, B>(); case 0x41: return op_bit_n_r<0, C>(); case 0x42: return op_bit_n_r<0, D>(); case 0x43: return op_bit_n_r<0, E>(); case 0x44: return op_bit_n_r<0, H>(); case 0x45: return op_bit_n_r<0, L>(); case 0x46: return op_bit_n_hl<0>(); case 0x47: return op_bit_n_r<0, A>(); case 0x48: return op_bit_n_r<1, B>(); case 0x49: return op_bit_n_r<1, C>(); case 0x4a: return op_bit_n_r<1, D>(); case 0x4b: return op_bit_n_r<1, E>(); case 0x4c: return op_bit_n_r<1, H>(); case 0x4d: return op_bit_n_r<1, L>(); case 0x4e: return op_bit_n_hl<1>(); case 0x4f: return op_bit_n_r<1, A>(); case 0x50: return op_bit_n_r<2, B>(); case 0x51: return op_bit_n_r<2, C>(); case 0x52: return op_bit_n_r<2, D>(); case 0x53: return op_bit_n_r<2, E>(); case 0x54: return op_bit_n_r<2, H>(); case 0x55: return op_bit_n_r<2, L>(); case 0x56: return op_bit_n_hl<2>(); case 0x57: return op_bit_n_r<2, A>(); case 0x58: return op_bit_n_r<3, B>(); case 0x59: return op_bit_n_r<3, C>(); case 0x5a: return op_bit_n_r<3, D>(); case 0x5b: return op_bit_n_r<3, E>(); case 0x5c: return op_bit_n_r<3, H>(); case 0x5d: return op_bit_n_r<3, L>(); case 0x5e: return op_bit_n_hl<3>(); case 0x5f: return op_bit_n_r<3, A>(); case 0x60: return op_bit_n_r<4, B>(); case 0x61: return op_bit_n_r<4, C>(); case 0x62: return op_bit_n_r<4, D>(); case 0x63: return op_bit_n_r<4, E>(); case 0x64: return op_bit_n_r<4, H>(); case 0x65: return op_bit_n_r<4, L>(); case 0x66: return op_bit_n_hl<4>(); case 0x67: return op_bit_n_r<4, A>(); case 0x68: return op_bit_n_r<5, B>(); case 0x69: return op_bit_n_r<5, C>(); case 0x6a: return op_bit_n_r<5, D>(); case 0x6b: return op_bit_n_r<5, E>(); case 0x6c: return op_bit_n_r<5, H>(); case 0x6d: return op_bit_n_r<5, L>(); case 0x6e: return op_bit_n_hl<5>(); case 0x6f: return op_bit_n_r<5, A>(); case 0x70: return op_bit_n_r<6, B>(); case 0x71: return op_bit_n_r<6, C>(); case 0x72: return op_bit_n_r<6, D>(); case 0x73: return op_bit_n_r<6, E>(); case 0x74: return op_bit_n_r<6, H>(); case 0x75: return op_bit_n_r<6, L>(); case 0x76: return op_bit_n_hl<6>(); case 0x77: return op_bit_n_r<6, A>(); case 0x78: return op_bit_n_r<7, B>(); case 0x79: return op_bit_n_r<7, C>(); case 0x7a: return op_bit_n_r<7, D>(); case 0x7b: return op_bit_n_r<7, E>(); case 0x7c: return op_bit_n_r<7, H>(); case 0x7d: return op_bit_n_r<7, L>(); case 0x7e: return op_bit_n_hl<7>(); case 0x7f: return op_bit_n_r<7, A>(); case 0x80: return op_res_n_r<0, B>(); case 0x81: return op_res_n_r<0, C>(); case 0x82: return op_res_n_r<0, D>(); case 0x83: return op_res_n_r<0, E>(); case 0x84: return op_res_n_r<0, H>(); case 0x85: return op_res_n_r<0, L>(); case 0x86: return op_res_n_hl<0>(); case 0x87: return op_res_n_r<0, A>(); case 0x88: return op_res_n_r<1, B>(); case 0x89: return op_res_n_r<1, C>(); case 0x8a: return op_res_n_r<1, D>(); case 0x8b: return op_res_n_r<1, E>(); case 0x8c: return op_res_n_r<1, H>(); case 0x8d: return op_res_n_r<1, L>(); case 0x8e: return op_res_n_hl<1>(); case 0x8f: return op_res_n_r<1, A>(); case 0x90: return op_res_n_r<2, B>(); case 0x91: return op_res_n_r<2, C>(); case 0x92: return op_res_n_r<2, D>(); case 0x93: return op_res_n_r<2, E>(); case 0x94: return op_res_n_r<2, H>(); case 0x95: return op_res_n_r<2, L>(); case 0x96: return op_res_n_hl<2>(); case 0x97: return op_res_n_r<2, A>(); case 0x98: return op_res_n_r<3, B>(); case 0x99: return op_res_n_r<3, C>(); case 0x9a: return op_res_n_r<3, D>(); case 0x9b: return op_res_n_r<3, E>(); case 0x9c: return op_res_n_r<3, H>(); case 0x9d: return op_res_n_r<3, L>(); case 0x9e: return op_res_n_hl<3>(); case 0x9f: return op_res_n_r<3, A>(); case 0xa0: return op_res_n_r<4, B>(); case 0xa1: return op_res_n_r<4, C>(); case 0xa2: return op_res_n_r<4, D>(); case 0xa3: return op_res_n_r<4, E>(); case 0xa4: return op_res_n_r<4, H>(); case 0xa5: return op_res_n_r<4, L>(); case 0xa6: return op_res_n_hl<4>(); case 0xa7: return op_res_n_r<4, A>(); case 0xa8: return op_res_n_r<5, B>(); case 0xa9: return op_res_n_r<5, C>(); case 0xaa: return op_res_n_r<5, D>(); case 0xab: return op_res_n_r<5, E>(); case 0xac: return op_res_n_r<5, H>(); case 0xad: return op_res_n_r<5, L>(); case 0xae: return op_res_n_hl<5>(); case 0xaf: return op_res_n_r<5, A>(); case 0xb0: return op_res_n_r<6, B>(); case 0xb1: return op_res_n_r<6, C>(); case 0xb2: return op_res_n_r<6, D>(); case 0xb3: return op_res_n_r<6, E>(); case 0xb4: return op_res_n_r<6, H>(); case 0xb5: return op_res_n_r<6, L>(); case 0xb6: return op_res_n_hl<6>(); case 0xb7: return op_res_n_r<6, A>(); case 0xb8: return op_res_n_r<7, B>(); case 0xb9: return op_res_n_r<7, C>(); case 0xba: return op_res_n_r<7, D>(); case 0xbb: return op_res_n_r<7, E>(); case 0xbc: return op_res_n_r<7, H>(); case 0xbd: return op_res_n_r<7, L>(); case 0xbe: return op_res_n_hl<7>(); case 0xbf: return op_res_n_r<7, A>(); case 0xc0: return op_set_n_r<0, B>(); case 0xc1: return op_set_n_r<0, C>(); case 0xc2: return op_set_n_r<0, D>(); case 0xc3: return op_set_n_r<0, E>(); case 0xc4: return op_set_n_r<0, H>(); case 0xc5: return op_set_n_r<0, L>(); case 0xc6: return op_set_n_hl<0>(); case 0xc7: return op_set_n_r<0, A>(); case 0xc8: return op_set_n_r<1, B>(); case 0xc9: return op_set_n_r<1, C>(); case 0xca: return op_set_n_r<1, D>(); case 0xcb: return op_set_n_r<1, E>(); case 0xcc: return op_set_n_r<1, H>(); case 0xcd: return op_set_n_r<1, L>(); case 0xce: return op_set_n_hl<1>(); case 0xcf: return op_set_n_r<1, A>(); case 0xd0: return op_set_n_r<2, B>(); case 0xd1: return op_set_n_r<2, C>(); case 0xd2: return op_set_n_r<2, D>(); case 0xd3: return op_set_n_r<2, E>(); case 0xd4: return op_set_n_r<2, H>(); case 0xd5: return op_set_n_r<2, L>(); case 0xd6: return op_set_n_hl<2>(); case 0xd7: return op_set_n_r<2, A>(); case 0xd8: return op_set_n_r<3, B>(); case 0xd9: return op_set_n_r<3, C>(); case 0xda: return op_set_n_r<3, D>(); case 0xdb: return op_set_n_r<3, E>(); case 0xdc: return op_set_n_r<3, H>(); case 0xdd: return op_set_n_r<3, L>(); case 0xde: return op_set_n_hl<3>(); case 0xdf: return op_set_n_r<3, A>(); case 0xe0: return op_set_n_r<4, B>(); case 0xe1: return op_set_n_r<4, C>(); case 0xe2: return op_set_n_r<4, D>(); case 0xe3: return op_set_n_r<4, E>(); case 0xe4: return op_set_n_r<4, H>(); case 0xe5: return op_set_n_r<4, L>(); case 0xe6: return op_set_n_hl<4>(); case 0xe7: return op_set_n_r<4, A>(); case 0xe8: return op_set_n_r<5, B>(); case 0xe9: return op_set_n_r<5, C>(); case 0xea: return op_set_n_r<5, D>(); case 0xeb: return op_set_n_r<5, E>(); case 0xec: return op_set_n_r<5, H>(); case 0xed: return op_set_n_r<5, L>(); case 0xee: return op_set_n_hl<5>(); case 0xef: return op_set_n_r<5, A>(); case 0xf0: return op_set_n_r<6, B>(); case 0xf1: return op_set_n_r<6, C>(); case 0xf2: return op_set_n_r<6, D>(); case 0xf3: return op_set_n_r<6, E>(); case 0xf4: return op_set_n_r<6, H>(); case 0xf5: return op_set_n_r<6, L>(); case 0xf6: return op_set_n_hl<6>(); case 0xf7: return op_set_n_r<6, A>(); case 0xf8: return op_set_n_r<7, B>(); case 0xf9: return op_set_n_r<7, C>(); case 0xfa: return op_set_n_r<7, D>(); case 0xfb: return op_set_n_r<7, E>(); case 0xfc: return op_set_n_r<7, H>(); case 0xfd: return op_set_n_r<7, L>(); case 0xfe: return op_set_n_hl<7>(); case 0xff: return op_set_n_r<7, A>(); } } } nall/base64.hpp000664 001750 001750 00000006143 12651764221 014437 0ustar00sergiosergio000000 000000 #ifndef NALL_BASE64_HPP #define NALL_BASE64_HPP #include #include #include namespace nall { struct Base64 { enum class Format : unsigned { MIME, URI }; inline static string encode(const uint8_t* data, unsigned size, Format format = Format::MIME); inline static string encode(const vector& buffer, Format format = Format::MIME); inline static string encode(const string& text, Format format = Format::MIME); inline static vector decode(const string& text); private: inline static void table(char* data, Format format); inline static uint8_t value(char data); }; string Base64::encode(const uint8_t* data, unsigned size, Format format) { vector result; char lookup[65]; table(lookup, format); unsigned overflow = (3 - (size % 3)) % 3; //bytes to round to nearest multiple of 3 uint8_t buffer; for(unsigned i = 0; i < size; i++) { switch(i % 3) { case 0: buffer = data[i] >> 2; result.append(lookup[buffer]); buffer = (data[i] & 3) << 4; result.append(lookup[buffer]); break; case 1: buffer |= data[i] >> 4; result.last() = lookup[buffer]; buffer = (data[i] & 15) << 2; result.append(lookup[buffer]); break; case 2: buffer |= data[i] >> 6; result.last() = lookup[buffer]; buffer = (data[i] & 63); result.append(lookup[buffer]); break; } } if(lookup[64]) { if(overflow >= 1) result.append(lookup[64]); if(overflow >= 2) result.append(lookup[64]); } return result; } string Base64::encode(const vector& buffer, Format format) { return encode(buffer.data(), buffer.size(), format); } string Base64::encode(const string& text, Format format) { return encode((const uint8_t*)text.data(), text.size(), format); } vector Base64::decode(const string& text) { vector result; uint8_t buffer, output; for(unsigned i = 0; i < text.size(); i++) { uint8_t buffer = value(text[i]); if(buffer == 0) break; switch(i & 3) { case 0: output = buffer << 2; break; case 1: result.append(output | buffer >> 4); output = (buffer & 15) << 4; break; case 2: result.append(output | buffer >> 2); output = (buffer & 3) << 6; break; case 3: result.append(output | buffer); break; } } return result; } void Base64::table(char* data, Format format) { for(unsigned n = 0; n < 26; n++) data[ 0 + n] = 'A' + n; for(unsigned n = 0; n < 26; n++) data[26 + n] = 'a' + n; for(unsigned n = 0; n < 10; n++) data[52 + n] = '0' + n; switch(format) { case Format::MIME: data[62] = '+'; data[63] = '/'; data[64] = '='; break; case Format::URI: data[62] = '-'; data[63] = '_'; data[64] = 0; break; } } uint8_t Base64::value(char n) { if(n >= 'A' && n <= 'Z') return n - 'A' + 0; if(n >= 'a' && n <= 'z') return n - 'a' + 26; if(n >= '0' && n <= '9') return n - '0' + 52; if(n == '+' || n == '-') return 62; if(n == '/' || n == '_') return 63; return 0; } } #endif target-ethos/settings/timing.cpp000664 001750 001750 00000007162 12651764221 020157 0ustar00sergiosergio000000 000000 TimingSettings* timingSettings = nullptr; TimingAdjustment::TimingAdjustment() { assign.setEnabled(false); assign.setText("Assign"); analyze.setText("Analyze"); stop.setEnabled(false); stop.setText("Stop"); append(name, {40, 0}); append(value, {100, 0}, 5); append(assign, {80, 0}, 5); append(spacer, {~0, 0}); append(analyze, {80, 0}, 5); append(stop, {80, 0}); } TimingSettings::TimingSettings() { videoAdjust.name.setText("Video:"); videoAdjust.value.setText({config->timing.video}); audioAdjust.name.setText("Audio:"); audioAdjust.value.setText({config->timing.audio}); append(videoAdjust, {~0, 0}, 5); append(audioAdjust, {~0, 0}, 5); videoAdjust.value.onChange = [&] { videoAdjust.assign.setEnabled(true); }; audioAdjust.value.onChange = [&] { audioAdjust.assign.setEnabled(true); }; videoAdjust.assign.onActivate = [&] { config->timing.video = atof(videoAdjust.value.text()); videoAdjust.value.setText({config->timing.video}); videoAdjust.assign.setEnabled(false); utility->synchronizeDSP(); }; audioAdjust.assign.onActivate = [&] { config->timing.audio = atof(audioAdjust.value.text()); audioAdjust.value.setText({config->timing.audio}); audioAdjust.assign.setEnabled(false); utility->synchronizeDSP(); }; videoAdjust.analyze.onActivate = {&TimingSettings::analyzeVideoFrequency, this}; audioAdjust.analyze.onActivate = {&TimingSettings::analyzeAudioFrequency, this}; videoAdjust.stop.onActivate = audioAdjust.stop.onActivate = [&] { analysis.stop = true; }; } void TimingSettings::analyzeVideoFrequency() { video.set(Video::Synchronize, true); audio.set(Audio::Synchronize, false); videoAdjust.stop.setEnabled(true); analyzeStart(); do { uint32_t* output; unsigned pitch; if(video.lock(output, pitch, 16, 16)) { pitch >>= 2; for(unsigned y = 0; y < 16; y++) memset(output + y * pitch, 0, 4 * 16); video.unlock(); video.refresh(); } } while(analyzeTick("Video")); analyzeStop(); } void TimingSettings::analyzeAudioFrequency() { video.set(Video::Synchronize, false); audio.set(Audio::Synchronize, true); audioAdjust.stop.setEnabled(true); analyzeStart(); do { audio.sample(0, 0); } while(analyzeTick("Audio")); analyzeStop(); } void TimingSettings::analyzeStart() { audio.clear(); //settings->panels.setEnabled(false); videoAdjust.analyze.setEnabled(false); audioAdjust.analyze.setEnabled(false); settings->setStatusText("Initializing ..."); Application::processEvents(); analysis.stop = false; analysis.seconds = 0; analysis.counter = 0; analysis.sample.reset(); analysis.systemTime = time(0); } bool TimingSettings::analyzeTick(string type) { analysis.counter++; time_t systemTime = time(0); if(systemTime > analysis.systemTime) { analysis.systemTime = systemTime; Application::processEvents(); if(analysis.seconds < 3) { analysis.seconds++; } else { analysis.sample.append(analysis.counter); uintmax_t sum = 0; for(auto& point : analysis.sample) sum += point; settings->setStatusText({ type, " sample rate: ", (double)sum / analysis.sample.size(), "hz", " (", analysis.sample.size(), " sample points)" }); } analysis.counter = 0; } return !analysis.stop; } void TimingSettings::analyzeStop() { video.set(Video::Synchronize, config->video.synchronize); audio.set(Audio::Synchronize, config->audio.synchronize); //settings->panels.setEnabled(true); videoAdjust.analyze.setEnabled(true); audioAdjust.analyze.setEnabled(true); videoAdjust.stop.setEnabled(false); audioAdjust.stop.setEnabled(false); } sfc/chip/sa1/bus/bus.cpp000664 001750 001750 00000001315 12651764221 016160 0ustar00sergiosergio000000 000000 #ifdef SA1_CPP //ROM / RAM access from the S-CPU unsigned SA1::CPUIRAM::size() const { return sa1.iram.size(); } uint8 SA1::CPUIRAM::read(unsigned addr) { cpu.synchronize_coprocessors(); return sa1.iram.read(addr & 0x07ff); } void SA1::CPUIRAM::write(unsigned addr, uint8 data) { cpu.synchronize_coprocessors(); sa1.iram.write(addr & 0x07ff, data); } unsigned SA1::CPUBWRAM::size() const { return sa1.bwram.size(); } uint8 SA1::CPUBWRAM::read(unsigned addr) { cpu.synchronize_coprocessors(); if(dma) return sa1.dma_cc1_read(addr); return sa1.bwram.read(addr); } void SA1::CPUBWRAM::write(unsigned addr, uint8 data) { cpu.synchronize_coprocessors(); sa1.bwram.write(addr, data); } #endif nall/image/000700 001750 001750 00000000000 12656700342 013703 5ustar00sergiosergio000000 000000 target-ethos/resource/server.png000664 001750 001750 00000000630 12651764221 020160 0ustar00sergiosergio000000 000000 PNG  IHDRabKGDC pHYs  ~tIME 6 %IDAT8˝=KP\?. &R "8J*P?_ cn.8֪R ayyν=A:X_V7skP,7/0M W B CbN1 '<b8LydEVzo8Fa{JRfu]?:Gyv*e][m&5MidbRj1en(#˄Q Ya@޶vvM0̝LX|習e|U BIENDB`sfc/chip/superfx/memory/000700 001750 001750 00000000000 12656700342 016375 5ustar00sergiosergio000000 000000 sfc/ppu/counter/counter-inline.hpp000664 001750 001750 00000006362 12651764221 020421 0ustar00sergiosergio000000 000000 //this should only be called by CPU::PPUcounter::tick(); //keeps track of previous counter positions in history table void PPUcounter::tick() { status.hcounter += 2; //increment by smallest unit of time if(status.hcounter >= 1360 && status.hcounter == lineclocks()) { status.hcounter = 0; vcounter_tick(); } history.index = (history.index + 1) & 2047; history.field [history.index] = status.field; history.vcounter[history.index] = status.vcounter; history.hcounter[history.index] = status.hcounter; } //this should only be called by PPU::PPUcounter::tick(n); //allows stepping by more than the smallest unit of time void PPUcounter::tick(unsigned clocks) { status.hcounter += clocks; if(status.hcounter >= lineclocks()) { status.hcounter -= lineclocks(); vcounter_tick(); } } //internal void PPUcounter::vcounter_tick() { if(++status.vcounter == 128) status.interlace = ppu.interlace(); if((system.region() == System::Region::NTSC && status.interlace == false && status.vcounter == 262) || (system.region() == System::Region::NTSC && status.interlace == true && status.vcounter == 263) || (system.region() == System::Region::NTSC && status.interlace == true && status.vcounter == 262 && status.field == 1) || (system.region() == System::Region::PAL && status.interlace == false && status.vcounter == 312) || (system.region() == System::Region::PAL && status.interlace == true && status.vcounter == 313) || (system.region() == System::Region::PAL && status.interlace == true && status.vcounter == 312 && status.field == 1) ) { status.vcounter = 0; status.field = !status.field; } if(scanline) scanline(); } bool PPUcounter::field () const { return status.field; } uint16 PPUcounter::vcounter() const { return status.vcounter; } uint16 PPUcounter::hcounter() const { return status.hcounter; } bool PPUcounter::field (unsigned offset) const { return history.field [(history.index - (offset >> 1)) & 2047]; } uint16 PPUcounter::vcounter(unsigned offset) const { return history.vcounter[(history.index - (offset >> 1)) & 2047]; } uint16 PPUcounter::hcounter(unsigned offset) const { return history.hcounter[(history.index - (offset >> 1)) & 2047]; } //one PPU dot = 4 CPU clocks // //PPU dots 323 and 327 are 6 CPU clocks long. //this does not apply to NTSC non-interlace scanline 240 on odd fields. this is //because the PPU skips one dot to alter the color burst phase of the video signal. // //dot 323 range = { 1292, 1294, 1296 } //dot 327 range = { 1310, 1312, 1314 } uint16 PPUcounter::hdot() const { if(system.region() == System::Region::NTSC && status.interlace == false && vcounter() == 240 && field() == 1) { return (hcounter() >> 2); } else { return (hcounter() - ((hcounter() > 1292) << 1) - ((hcounter() > 1310) << 1)) >> 2; } } uint16 PPUcounter::lineclocks() const { if(system.region() == System::Region::NTSC && status.interlace == false && vcounter() == 240 && field() == 1) return 1360; return 1364; } void PPUcounter::reset() { status.interlace = false; status.field = 0; status.vcounter = 0; status.hcounter = 0; history.index = 0; for(unsigned i = 0; i < 2048; i++) { history.field [i] = 0; history.vcounter[i] = 0; history.hcounter[i] = 0; } } fc/scheduler/scheduler.cpp000664 001750 001750 00000000701 12651764221 016736 0ustar00sergiosergio000000 000000 #include namespace Famicom { Scheduler scheduler; void Scheduler::enter() { host_thread = co_active(); co_switch(thread); } void Scheduler::exit(ExitReason reason) { exit_reason = reason; thread = co_active(); co_switch(host_thread); } void Scheduler::power() { } void Scheduler::reset() { host_thread = co_active(); thread = cpu.thread; sync = SynchronizeMode::None; exit_reason = ExitReason::UnknownEvent; } } ruby/audio/xaudio2.hpp000664 001750 001750 00000031652 12651764221 016065 0ustar00sergiosergio000000 000000 /* xaudio2.hpp (2010-08-14) author: OV2 ruby-specific header to provide mingw-friendly xaudio2 interfaces */ #ifndef XAUDIO2_RUBY_H #define XAUDIO2_RUBY_H //64-bit GCC fix #define GUID_EXT EXTERN_C #define GUID_SECT #include #define DEFINE_GUID_X(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} #define DEFINE_CLSID_X(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ DEFINE_GUID_X(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8) #define DEFINE_IID_X(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ DEFINE_GUID_X(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8) #define X2DEFAULT(x) =x DEFINE_CLSID_X(XAudio2, e21a7345, eb21, 468e, be, 50, 80, 4d, b9, 7c, f7, 08); DEFINE_CLSID_X(XAudio2_Debug, f7a76c21, 53d4, 46bb, ac, 53, 8b, 45, 9c, ae, 46, bd); DEFINE_IID_X(IXAudio2, 8bcf1f58, 9fe7, 4583, 8a, c6, e2, ad, c4, 65, c8, bb); DECLARE_INTERFACE(IXAudio2Voice); #define XAUDIO2_COMMIT_NOW 0 #define XAUDIO2_DEFAULT_CHANNELS 0 #define XAUDIO2_DEFAULT_SAMPLERATE 0 #define XAUDIO2_DEFAULT_FREQ_RATIO 4.0f #define XAUDIO2_DEBUG_ENGINE 0x0001 #define XAUDIO2_VOICE_NOSRC 0x0004 typedef struct { WAVEFORMATEX Format; union { WORD wValidBitsPerSample; WORD wSamplesPerBlock; WORD wReserved; } Samples; DWORD dwChannelMask; GUID SubFormat; } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE, *LPPWAVEFORMATEXTENSIBLE; typedef const WAVEFORMATEXTENSIBLE* LPCWAVEFORMATEXTENSIBLE; typedef enum XAUDIO2_DEVICE_ROLE { NotDefaultDevice = 0x0, DefaultConsoleDevice = 0x1, DefaultMultimediaDevice = 0x2, DefaultCommunicationsDevice = 0x4, DefaultGameDevice = 0x8, GlobalDefaultDevice = 0xf, InvalidDeviceRole = ~GlobalDefaultDevice } XAUDIO2_DEVICE_ROLE; typedef struct XAUDIO2_DEVICE_DETAILS { WCHAR DeviceID[256]; WCHAR DisplayName[256]; XAUDIO2_DEVICE_ROLE Role; WAVEFORMATEXTENSIBLE OutputFormat; } XAUDIO2_DEVICE_DETAILS; typedef struct XAUDIO2_VOICE_DETAILS { UINT32 CreationFlags; UINT32 InputChannels; UINT32 InputSampleRate; } XAUDIO2_VOICE_DETAILS; typedef enum XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER { Processor1 = 0x00000001, Processor2 = 0x00000002, Processor3 = 0x00000004, Processor4 = 0x00000008, Processor5 = 0x00000010, Processor6 = 0x00000020, Processor7 = 0x00000040, Processor8 = 0x00000080, Processor9 = 0x00000100, Processor10 = 0x00000200, Processor11 = 0x00000400, Processor12 = 0x00000800, Processor13 = 0x00001000, Processor14 = 0x00002000, Processor15 = 0x00004000, Processor16 = 0x00008000, Processor17 = 0x00010000, Processor18 = 0x00020000, Processor19 = 0x00040000, Processor20 = 0x00080000, Processor21 = 0x00100000, Processor22 = 0x00200000, Processor23 = 0x00400000, Processor24 = 0x00800000, Processor25 = 0x01000000, Processor26 = 0x02000000, Processor27 = 0x04000000, Processor28 = 0x08000000, Processor29 = 0x10000000, Processor30 = 0x20000000, Processor31 = 0x40000000, Processor32 = 0x80000000, XAUDIO2_ANY_PROCESSOR = 0xffffffff, XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR } XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER, XAUDIO2_PROCESSOR; typedef struct XAUDIO2_VOICE_SENDS { UINT32 OutputCount; IXAudio2Voice** pOutputVoices; } XAUDIO2_VOICE_SENDS; typedef struct XAUDIO2_EFFECT_DESCRIPTOR { IUnknown* pEffect; BOOL InitialState; UINT32 OutputChannels; } XAUDIO2_EFFECT_DESCRIPTOR; typedef struct XAUDIO2_EFFECT_CHAIN { UINT32 EffectCount; const XAUDIO2_EFFECT_DESCRIPTOR* pEffectDescriptors; } XAUDIO2_EFFECT_CHAIN; typedef enum XAUDIO2_FILTER_TYPE { LowPassFilter, BandPassFilter, HighPassFilter } XAUDIO2_FILTER_TYPE; typedef struct XAUDIO2_FILTER_PARAMETERS { XAUDIO2_FILTER_TYPE Type; float Frequency; float OneOverQ; } XAUDIO2_FILTER_PARAMETERS; typedef struct XAUDIO2_BUFFER { UINT32 Flags; UINT32 AudioBytes; const BYTE* pAudioData; UINT32 PlayBegin; UINT32 PlayLength; UINT32 LoopBegin; UINT32 LoopLength; UINT32 LoopCount; void* pContext; } XAUDIO2_BUFFER; typedef struct XAUDIO2_BUFFER_WMA { const UINT32* pDecodedPacketCumulativeBytes; UINT32 PacketCount; } XAUDIO2_BUFFER_WMA; typedef struct XAUDIO2_VOICE_STATE { void* pCurrentBufferContext; UINT32 BuffersQueued; UINT64 SamplesPlayed; } XAUDIO2_VOICE_STATE; typedef struct XAUDIO2_PERFORMANCE_DATA { UINT64 AudioCyclesSinceLastQuery; UINT64 TotalCyclesSinceLastQuery; UINT32 MinimumCyclesPerQuantum; UINT32 MaximumCyclesPerQuantum; UINT32 MemoryUsageInBytes; UINT32 CurrentLatencyInSamples; UINT32 GlitchesSinceEngineStarted; UINT32 ActiveSourceVoiceCount; UINT32 TotalSourceVoiceCount; UINT32 ActiveSubmixVoiceCount; UINT32 TotalSubmixVoiceCount; UINT32 ActiveXmaSourceVoices; UINT32 ActiveXmaStreams; } XAUDIO2_PERFORMANCE_DATA; typedef struct XAUDIO2_DEBUG_CONFIGURATION { UINT32 TraceMask; UINT32 BreakMask; BOOL LogThreadID; BOOL LogFileline; BOOL LogFunctionName; BOOL LogTiming; } XAUDIO2_DEBUG_CONFIGURATION; DECLARE_INTERFACE(IXAudio2EngineCallback) { STDMETHOD_(void, OnProcessingPassStart) (THIS) PURE; STDMETHOD_(void, OnProcessingPassEnd) (THIS) PURE; STDMETHOD_(void, OnCriticalError) (THIS_ HRESULT Error) PURE; }; DECLARE_INTERFACE(IXAudio2VoiceCallback) { STDMETHOD_(void, OnVoiceProcessingPassStart) (THIS_ UINT32 BytesRequired) PURE; STDMETHOD_(void, OnVoiceProcessingPassEnd) (THIS) PURE; STDMETHOD_(void, OnStreamEnd) (THIS) PURE; STDMETHOD_(void, OnBufferStart) (THIS_ void* pBufferContext) PURE; STDMETHOD_(void, OnBufferEnd) (THIS_ void* pBufferContext) PURE; STDMETHOD_(void, OnLoopEnd) (THIS_ void* pBufferContext) PURE; STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) PURE; }; DECLARE_INTERFACE(IXAudio2Voice) { #define Declare_IXAudio2Voice_Methods() \ STDMETHOD_(void, GetVoiceDetails) (THIS_ XAUDIO2_VOICE_DETAILS* pVoiceDetails) PURE; \ STDMETHOD(SetOutputVoices) (THIS_ const XAUDIO2_VOICE_SENDS* pSendList) PURE; \ STDMETHOD(SetEffectChain) (THIS_ const XAUDIO2_EFFECT_CHAIN* pEffectChain) PURE; \ STDMETHOD(EnableEffect) (THIS_ UINT32 EffectIndex, \ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ STDMETHOD(DisableEffect) (THIS_ UINT32 EffectIndex, \ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ STDMETHOD_(void, GetEffectState) (THIS_ UINT32 EffectIndex, BOOL* pEnabled) PURE; \ STDMETHOD(SetEffectParameters) (THIS_ UINT32 EffectIndex, \ const void* pParameters, \ UINT32 ParametersByteSize, \ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ STDMETHOD(GetEffectParameters) (THIS_ UINT32 EffectIndex, void* pParameters, \ UINT32 ParametersByteSize) PURE; \ STDMETHOD(SetFilterParameters) (THIS_ const XAUDIO2_FILTER_PARAMETERS* pParameters, \ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ STDMETHOD_(void, GetFilterParameters) (THIS_ XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \ STDMETHOD(SetVolume) (THIS_ float Volume, \ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ STDMETHOD_(void, GetVolume) (THIS_ float* pVolume) PURE; \ STDMETHOD(SetChannelVolumes) (THIS_ UINT32 Channels, const float* pVolumes, \ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ STDMETHOD_(void, GetChannelVolumes) (THIS_ UINT32 Channels, float* pVolumes) PURE; \ STDMETHOD(SetOutputMatrix) (THIS_ IXAudio2Voice* pDestinationVoice, \ UINT32 SourceChannels, UINT32 DestinationChannels, \ const float* pLevelMatrix, \ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ STDMETHOD_(void, GetOutputMatrix) (THIS_ IXAudio2Voice* pDestinationVoice, \ UINT32 SourceChannels, UINT32 DestinationChannels, \ float* pLevelMatrix) PURE; \ STDMETHOD_(void, DestroyVoice) (THIS) PURE Declare_IXAudio2Voice_Methods(); }; DECLARE_INTERFACE_(IXAudio2MasteringVoice, IXAudio2Voice) { Declare_IXAudio2Voice_Methods(); }; DECLARE_INTERFACE_(IXAudio2SubmixVoice, IXAudio2Voice) { Declare_IXAudio2Voice_Methods(); }; DECLARE_INTERFACE_(IXAudio2SourceVoice, IXAudio2Voice) { Declare_IXAudio2Voice_Methods(); STDMETHOD(Start) (THIS_ UINT32 Flags, UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; STDMETHOD(Stop) (THIS_ UINT32 Flags, UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; STDMETHOD(SubmitSourceBuffer) (THIS_ const XAUDIO2_BUFFER* pBuffer, const XAUDIO2_BUFFER_WMA* pBufferWMA X2DEFAULT(NULL)) PURE; STDMETHOD(FlushSourceBuffers) (THIS) PURE; STDMETHOD(Discontinuity) (THIS) PURE; STDMETHOD(ExitLoop) (THIS_ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; STDMETHOD_(void, GetState) (THIS_ XAUDIO2_VOICE_STATE* pVoiceState) PURE; STDMETHOD(SetFrequencyRatio) (THIS_ float Ratio, UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; STDMETHOD_(void, GetFrequencyRatio) (THIS_ float* pRatio) PURE; }; DECLARE_INTERFACE_(IXAudio2, IUnknown) { STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvInterface) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; STDMETHOD(GetDeviceCount) (THIS_ UINT32* pCount) PURE; STDMETHOD(GetDeviceDetails) (THIS_ UINT32 Index, XAUDIO2_DEVICE_DETAILS* pDeviceDetails) PURE; STDMETHOD(Initialize) (THIS_ UINT32 Flags X2DEFAULT(0), XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)) PURE; STDMETHOD(RegisterForCallbacks) (IXAudio2EngineCallback* pCallback) PURE; STDMETHOD_(void, UnregisterForCallbacks) (IXAudio2EngineCallback* pCallback) PURE; STDMETHOD(CreateSourceVoice) (THIS_ IXAudio2SourceVoice** ppSourceVoice, const WAVEFORMATEX* pSourceFormat, UINT32 Flags X2DEFAULT(0), float MaxFrequencyRatio X2DEFAULT(XAUDIO2_DEFAULT_FREQ_RATIO), IXAudio2VoiceCallback* pCallback X2DEFAULT(NULL), const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL), const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE; STDMETHOD(CreateSubmixVoice) (THIS_ IXAudio2SubmixVoice** ppSubmixVoice, UINT32 InputChannels, UINT32 InputSampleRate, UINT32 Flags X2DEFAULT(0), UINT32 ProcessingStage X2DEFAULT(0), const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL), const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE; STDMETHOD(CreateMasteringVoice) (THIS_ IXAudio2MasteringVoice** ppMasteringVoice, UINT32 InputChannels X2DEFAULT(XAUDIO2_DEFAULT_CHANNELS), UINT32 InputSampleRate X2DEFAULT(XAUDIO2_DEFAULT_SAMPLERATE), UINT32 Flags X2DEFAULT(0), UINT32 DeviceIndex X2DEFAULT(0), const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE; STDMETHOD(StartEngine) (THIS) PURE; STDMETHOD_(void, StopEngine) (THIS) PURE; STDMETHOD(CommitChanges) (THIS_ UINT32 OperationSet) PURE; STDMETHOD_(void, GetPerformanceData) (THIS_ XAUDIO2_PERFORMANCE_DATA* pPerfData) PURE; STDMETHOD_(void, SetDebugConfiguration) (THIS_ const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration, void* pReserved X2DEFAULT(NULL)) PURE; }; __inline HRESULT XAudio2Create(IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0), XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)) { IXAudio2* pXAudio2; HRESULT hr = CoCreateInstance((Flags & XAUDIO2_DEBUG_ENGINE) ? CLSID_XAudio2_Debug : CLSID_XAudio2, NULL, CLSCTX_INPROC_SERVER, IID_IXAudio2, (void**)&pXAudio2); if (SUCCEEDED(hr)) { hr = pXAudio2->Initialize(Flags, XAudio2Processor); if (SUCCEEDED(hr)) { *ppXAudio2 = pXAudio2; } else { pXAudio2->Release(); } } return hr; } #endif sfc/chip/dsp3/dsp3emu.c000664 001750 001750 00000060133 12651764221 016006 0ustar00sergiosergio000000 000000 #ifdef DSP3_CPP //DSP-3 emulator code //Copyright (c) 2003-2006 John Weidman, Kris Bleakley, Lancer, z80 gaiden uint16 DSP3_DataROM[1024] = { 0x8000, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, 0x0100, 0x0080, 0x0040, 0x0020, 0x0010, 0x0008, 0x0004, 0x0002, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0000, 0x000f, 0x0400, 0x0200, 0x0140, 0x0400, 0x0200, 0x0040, 0x007d, 0x007e, 0x007e, 0x007b, 0x007c, 0x007d, 0x007b, 0x007c, 0x0002, 0x0020, 0x0030, 0x0000, 0x000d, 0x0019, 0x0026, 0x0032, 0x003e, 0x004a, 0x0056, 0x0062, 0x006d, 0x0079, 0x0084, 0x008e, 0x0098, 0x00a2, 0x00ac, 0x00b5, 0x00be, 0x00c6, 0x00ce, 0x00d5, 0x00dc, 0x00e2, 0x00e7, 0x00ec, 0x00f1, 0x00f5, 0x00f8, 0x00fb, 0x00fd, 0x00ff, 0x0100, 0x0100, 0x0100, 0x00ff, 0x00fd, 0x00fb, 0x00f8, 0x00f5, 0x00f1, 0x00ed, 0x00e7, 0x00e2, 0x00dc, 0x00d5, 0x00ce, 0x00c6, 0x00be, 0x00b5, 0x00ac, 0x00a2, 0x0099, 0x008e, 0x0084, 0x0079, 0x006e, 0x0062, 0x0056, 0x004a, 0x003e, 0x0032, 0x0026, 0x0019, 0x000d, 0x0000, 0xfff3, 0xffe7, 0xffdb, 0xffce, 0xffc2, 0xffb6, 0xffaa, 0xff9e, 0xff93, 0xff87, 0xff7d, 0xff72, 0xff68, 0xff5e, 0xff54, 0xff4b, 0xff42, 0xff3a, 0xff32, 0xff2b, 0xff25, 0xff1e, 0xff19, 0xff14, 0xff0f, 0xff0b, 0xff08, 0xff05, 0xff03, 0xff01, 0xff00, 0xff00, 0xff00, 0xff01, 0xff03, 0xff05, 0xff08, 0xff0b, 0xff0f, 0xff13, 0xff18, 0xff1e, 0xff24, 0xff2b, 0xff32, 0xff3a, 0xff42, 0xff4b, 0xff54, 0xff5d, 0xff67, 0xff72, 0xff7c, 0xff87, 0xff92, 0xff9e, 0xffa9, 0xffb5, 0xffc2, 0xffce, 0xffda, 0xffe7, 0xfff3, 0x002b, 0x007f, 0x0020, 0x00ff, 0xff00, 0xffbe, 0x0000, 0x0044, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffc1, 0x0001, 0x0002, 0x0045, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffc5, 0x0003, 0x0004, 0x0005, 0x0047, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffca, 0x0006, 0x0007, 0x0008, 0x0009, 0x004a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffd0, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x004e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffd7, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0053, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffdf, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x0059, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe8, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0060, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff2, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x0068, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfffd, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0071, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffc7, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x007b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffd4, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x0044, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe2, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0050, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff1, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x005d, 0x0000, 0x0000, 0x0000, 0x0000, 0xffcb, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x006b, 0x0000, 0x0000, 0x0000, 0xffdc, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0044, 0x0000, 0x0000, 0xffee, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0054, 0x0000, 0xffee, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0065, 0xffbe, 0x0000, 0xfeac, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffc1, 0x0001, 0x0002, 0xfead, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffc5, 0x0003, 0x0004, 0x0005, 0xfeaf, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffca, 0x0006, 0x0007, 0x0008, 0x0009, 0xfeb2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffd0, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0xfeb6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffd7, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0xfebb, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffdf, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0xfec1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe8, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0xfec8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff2, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0xfed0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfffd, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0xfed9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffc7, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0xfee3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffd4, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0xfeac, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe2, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0xfeb8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff1, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0xfec5, 0x0000, 0x0000, 0x0000, 0x0000, 0xffcb, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0xfed3, 0x0000, 0x0000, 0x0000, 0xffdc, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0xfeac, 0x0000, 0x0000, 0xffee, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0xfebc, 0x0000, 0xffee, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0xfecd, 0x0154, 0x0218, 0x0110, 0x00b0, 0x00cc, 0x00b0, 0x0088, 0x00b0, 0x0044, 0x00b0, 0x0000, 0x00b0, 0x00fe, 0xff07, 0x0002, 0x00ff, 0x00f8, 0x0007, 0x00fe, 0x00ee, 0x07ff, 0x0200, 0x00ef, 0xf800, 0x0700, 0x00ee, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0xffff, 0xffff, 0x0000, 0xffff, 0x0001, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0xffff, 0x0001, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000, 0x0000, 0x0044, 0x0088, 0x00cc, 0x0110, 0x0154, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; void (*SetDSP3)(); void DSP3_Command(); uint16 DSP3_DR; uint16 DSP3_SR; uint16 DSP3_MemoryIndex; void DSP3_Reset() { DSP3_DR = 0x0080; DSP3_SR = 0x0084; SetDSP3 = &DSP3_Command; } void DSP3_MemorySize() { DSP3_DR = 0x0300; SetDSP3 = &DSP3_Reset; } void DSP3_TestMemory() { DSP3_DR = 0x0000; SetDSP3 = &DSP3_Reset; } void DSP3_DumpDataROM() { DSP3_DR = DSP3_DataROM[DSP3_MemoryIndex++]; if (DSP3_MemoryIndex == 1024) SetDSP3 = &DSP3_Reset; } void DSP3_MemoryDump() { DSP3_MemoryIndex = 0; SetDSP3 = &DSP3_DumpDataROM; DSP3_DumpDataROM(); } int16 DSP3_WinLo; int16 DSP3_WinHi; void DSP3_OP06() { DSP3_WinLo = (uint8)(DSP3_DR); DSP3_WinHi = (uint8)(DSP3_DR >> 8); DSP3_Reset(); } void DSP3_OP03() { int16 Lo = (uint8)(DSP3_DR); int16 Hi = (uint8)(DSP3_DR >> 8); int16 Ofs = (DSP3_WinLo * Hi << 1) + (Lo << 1); DSP3_DR = Ofs >> 1; SetDSP3 = &DSP3_Reset; } int16 DSP3_AddLo; int16 DSP3_AddHi; void DSP3_OP07_B() { int16 Ofs = (DSP3_WinLo * DSP3_AddHi << 1) + (DSP3_AddLo << 1); DSP3_DR = Ofs >> 1; SetDSP3 = &DSP3_Reset; } void DSP3_OP07_A() { int16 Lo = (uint8)(DSP3_DR); int16 Hi = (uint8)(DSP3_DR >> 8); if (Lo & 1) Hi += (DSP3_AddLo & 1); DSP3_AddLo += Lo; DSP3_AddHi += Hi; if (DSP3_AddLo < 0) DSP3_AddLo += DSP3_WinLo; else if (DSP3_AddLo >= DSP3_WinLo) DSP3_AddLo -= DSP3_WinLo; if (DSP3_AddHi < 0) DSP3_AddHi += DSP3_WinHi; else if (DSP3_AddHi >= DSP3_WinHi) DSP3_AddHi -= DSP3_WinHi; DSP3_DR = DSP3_AddLo | (DSP3_AddHi << 8) | ((DSP3_AddHi >> 8) & 0xff); SetDSP3 = &DSP3_OP07_B; } void DSP3_OP07() { uint32 dataOfs = ((DSP3_DR << 1) + 0x03b2) & 0x03ff; DSP3_AddHi = DSP3_DataROM[dataOfs]; DSP3_AddLo = DSP3_DataROM[dataOfs + 1]; SetDSP3 = &DSP3_OP07_A; DSP3_SR = 0x0080; } uint16 DSP3_Codewords; uint16 DSP3_Outwords; uint16 DSP3_Symbol; uint16 DSP3_BitCount; uint16 DSP3_Index; uint16 DSP3_Codes[512]; uint16 DSP3_BitsLeft; uint16 DSP3_ReqBits; uint16 DSP3_ReqData; uint16 DSP3_BitCommand; uint8 DSP3_BaseLength; uint16 DSP3_BaseCodes; uint16 DSP3_BaseCode; uint8 DSP3_CodeLengths[8]; uint16 DSP3_CodeOffsets[8]; uint16 DSP3_LZCode; uint8 DSP3_LZLength; uint16 DSP3_X; uint16 DSP3_Y; void DSP3_Coordinate() { DSP3_Index++; switch (DSP3_Index) { case 3: { if (DSP3_DR == 0xffff) DSP3_Reset(); break; } case 4: { DSP3_X = DSP3_DR; break; } case 5: { DSP3_Y = DSP3_DR; DSP3_DR = 1; break; } case 6: { DSP3_DR = DSP3_X; break; } case 7: { DSP3_DR = DSP3_Y; DSP3_Index = 0; break; } } } uint8 DSP3_Bitmap[8]; uint8 DSP3_Bitplane[8]; uint16 DSP3_BMIndex; uint16 DSP3_BPIndex; uint16 DSP3_Count; void DSP3_Convert_A() { if (DSP3_BMIndex < 8) { DSP3_Bitmap[DSP3_BMIndex++] = (uint8) (DSP3_DR); DSP3_Bitmap[DSP3_BMIndex++] = (uint8) (DSP3_DR >> 8); if (DSP3_BMIndex == 8) { short i, j; for (i=0; i < 8; i++) for (j=0; j < 8; j++) { DSP3_Bitplane[j] <<= 1; DSP3_Bitplane[j] |= (DSP3_Bitmap[i] >> j) & 1; } DSP3_BPIndex = 0; DSP3_Count--; } } if (DSP3_BMIndex == 8) { if (DSP3_BPIndex == 8) { if (!DSP3_Count) DSP3_Reset(); DSP3_BMIndex = 0; } else { DSP3_DR = DSP3_Bitplane[DSP3_BPIndex++]; DSP3_DR |= DSP3_Bitplane[DSP3_BPIndex++] << 8; } } } void DSP3_Convert() { DSP3_Count = DSP3_DR; DSP3_BMIndex = 0; SetDSP3 = &DSP3_Convert_A; } bool DSP3_GetBits(uint8 Count) { if (!DSP3_BitsLeft) { DSP3_BitsLeft = Count; DSP3_ReqBits = 0; } do { if (!DSP3_BitCount) { DSP3_SR = 0xC0; return false; } DSP3_ReqBits <<= 1; if (DSP3_ReqData & 0x8000) DSP3_ReqBits++; DSP3_ReqData <<= 1; DSP3_BitCount--; DSP3_BitsLeft--; } while (DSP3_BitsLeft); return true; } void DSP3_Decode_Data() { if (!DSP3_BitCount) { if (DSP3_SR & 0x40) { DSP3_ReqData = DSP3_DR; DSP3_BitCount += 16; } else { DSP3_SR = 0xC0; return; } } if (DSP3_LZCode == 1) { if (!DSP3_GetBits(1)) return; if (DSP3_ReqBits) DSP3_LZLength = 12; else DSP3_LZLength = 8; DSP3_LZCode++; } if (DSP3_LZCode == 2) { if (!DSP3_GetBits(DSP3_LZLength)) return; DSP3_LZCode = 0; DSP3_Outwords--; if (!DSP3_Outwords) SetDSP3 = &DSP3_Reset; DSP3_SR = 0x80; DSP3_DR = DSP3_ReqBits; return; } if (DSP3_BaseCode == 0xffff) { if (!DSP3_GetBits(DSP3_BaseLength)) return; DSP3_BaseCode = DSP3_ReqBits; } if (!DSP3_GetBits(DSP3_CodeLengths[DSP3_BaseCode])) return; DSP3_Symbol = DSP3_Codes[DSP3_CodeOffsets[DSP3_BaseCode] + DSP3_ReqBits]; DSP3_BaseCode = 0xffff; if (DSP3_Symbol & 0xff00) { DSP3_Symbol += 0x7f02; DSP3_LZCode++; } else { DSP3_Outwords--; if (!DSP3_Outwords) SetDSP3 = &DSP3_Reset; } DSP3_SR = 0x80; DSP3_DR = DSP3_Symbol; } void DSP3_Decode_Tree() { if (!DSP3_BitCount) { DSP3_ReqData = DSP3_DR; DSP3_BitCount += 16; } if (!DSP3_BaseCodes) { DSP3_GetBits(1); if (DSP3_ReqBits) { DSP3_BaseLength = 3; DSP3_BaseCodes = 8; } else { DSP3_BaseLength = 2; DSP3_BaseCodes = 4; } } while (DSP3_BaseCodes) { if (!DSP3_GetBits(3)) return; DSP3_ReqBits++; DSP3_CodeLengths[DSP3_Index] = (uint8) DSP3_ReqBits; DSP3_CodeOffsets[DSP3_Index] = DSP3_Symbol; DSP3_Index++; DSP3_Symbol += 1 << DSP3_ReqBits; DSP3_BaseCodes--; } DSP3_BaseCode = 0xffff; DSP3_LZCode = 0; SetDSP3 = &DSP3_Decode_Data; if (DSP3_BitCount) DSP3_Decode_Data(); } void DSP3_Decode_Symbols() { DSP3_ReqData = DSP3_DR; DSP3_BitCount += 16; do { if (DSP3_BitCommand == 0xffff) { if (!DSP3_GetBits(2)) return; DSP3_BitCommand = DSP3_ReqBits; } switch (DSP3_BitCommand) { case 0: { if (!DSP3_GetBits(9)) return; DSP3_Symbol = DSP3_ReqBits; break; } case 1: { DSP3_Symbol++; break; } case 2: { if (!DSP3_GetBits(1)) return; DSP3_Symbol += 2 + DSP3_ReqBits; break; } case 3: { if (!DSP3_GetBits(4)) return; DSP3_Symbol += 4 + DSP3_ReqBits; break; } } DSP3_BitCommand = 0xffff; DSP3_Codes[DSP3_Index++] = DSP3_Symbol; DSP3_Codewords--; } while (DSP3_Codewords); DSP3_Index = 0; DSP3_Symbol = 0; DSP3_BaseCodes = 0; SetDSP3 = &DSP3_Decode_Tree; if (DSP3_BitCount) DSP3_Decode_Tree(); } void DSP3_Decode_A() { DSP3_Outwords = DSP3_DR; SetDSP3 = &DSP3_Decode_Symbols; DSP3_BitCount = 0; DSP3_BitsLeft = 0; DSP3_Symbol = 0; DSP3_Index = 0; DSP3_BitCommand = 0xffff; DSP3_SR = 0xC0; } void DSP3_Decode() { DSP3_Codewords = DSP3_DR; SetDSP3 = &DSP3_Decode_A; } // Opcodes 1E/3E bit-perfect to 'dsp3-intro' log // src: adapted from SD Gundam X/G-Next int16 op3e_x; int16 op3e_y; int16 op1e_terrain[0x2000]; int16 op1e_cost[0x2000]; int16 op1e_weight[0x2000]; int16 op1e_cell; int16 op1e_turn; int16 op1e_search; int16 op1e_x; int16 op1e_y; int16 op1e_min_radius; int16 op1e_max_radius; int16 op1e_max_search_radius; int16 op1e_max_path_radius; int16 op1e_lcv_radius; int16 op1e_lcv_steps; int16 op1e_lcv_turns; void DSP3_OP3E() { op3e_x = (uint8)(DSP3_DR & 0x00ff); op3e_y = (uint8)((DSP3_DR & 0xff00)>>8); DSP3_OP03(); op1e_terrain[ DSP3_DR ] = 0x00; op1e_cost[ DSP3_DR ] = 0xff; op1e_weight[ DSP3_DR ] = 0; op1e_max_search_radius = 0; op1e_max_path_radius = 0; } void DSP3_OP1E_A(); void DSP3_OP1E_A1(); void DSP3_OP1E_A2(); void DSP3_OP1E_A3(); void DSP3_OP1E_B(); void DSP3_OP1E_B1(); void DSP3_OP1E_B2(); void DSP3_OP1E_C(); void DSP3_OP1E_C1(); void DSP3_OP1E_C2(); void DSP3_OP1E_D( int16, int16 *, int16 * ); void DSP3_OP1E_D1( int16 move, int16 *lo, int16 *hi ); void DSP3_OP1E() { int lcv; op1e_min_radius = (uint8)(DSP3_DR & 0x00ff); op1e_max_radius = (uint8)((DSP3_DR & 0xff00)>>8); if( op1e_min_radius == 0 ) op1e_min_radius++; if( op1e_max_search_radius >= op1e_min_radius ) op1e_min_radius = op1e_max_search_radius+1; if( op1e_max_radius > op1e_max_search_radius ) op1e_max_search_radius = op1e_max_radius; op1e_lcv_radius = op1e_min_radius; op1e_lcv_steps = op1e_min_radius; op1e_lcv_turns = 6; op1e_turn = 0; op1e_x = op3e_x; op1e_y = op3e_y; for( lcv = 0; lcv < op1e_min_radius; lcv++ ) DSP3_OP1E_D( op1e_turn, &op1e_x, &op1e_y ); DSP3_OP1E_A(); } void DSP3_OP1E_A() { int lcv; if( op1e_lcv_steps == 0 ) { op1e_lcv_radius++; op1e_lcv_steps = op1e_lcv_radius; op1e_x = op3e_x; op1e_y = op3e_y; for( lcv = 0; lcv < op1e_lcv_radius; lcv++ ) DSP3_OP1E_D( op1e_turn, &op1e_x, &op1e_y ); } if( op1e_lcv_radius > op1e_max_radius ) { op1e_turn++; op1e_lcv_turns--; op1e_lcv_radius = op1e_min_radius; op1e_lcv_steps = op1e_min_radius; op1e_x = op3e_x; op1e_y = op3e_y; for( lcv = 0; lcv < op1e_min_radius; lcv++ ) DSP3_OP1E_D( op1e_turn, &op1e_x, &op1e_y ); } if( op1e_lcv_turns == 0 ) { DSP3_DR = 0xffff; DSP3_SR = 0x0080; SetDSP3 = &DSP3_OP1E_B; return; } DSP3_DR = (uint8)(op1e_x) | ((uint8)(op1e_y)<<8); DSP3_OP03(); op1e_cell = DSP3_DR; DSP3_SR = 0x0080; SetDSP3 = &DSP3_OP1E_A1; } void DSP3_OP1E_A1() { DSP3_SR = 0x0084; SetDSP3 = &DSP3_OP1E_A2; } void DSP3_OP1E_A2() { op1e_terrain[ op1e_cell ] = (uint8)(DSP3_DR & 0x00ff); DSP3_SR = 0x0084; SetDSP3 = &DSP3_OP1E_A3; } void DSP3_OP1E_A3() { op1e_cost[ op1e_cell ] = (uint8)(DSP3_DR & 0x00ff); if( op1e_lcv_radius == 1 ) { if( op1e_terrain[ op1e_cell ] & 1 ) { op1e_weight[ op1e_cell ] = 0xff; } else { op1e_weight[ op1e_cell ] = op1e_cost[ op1e_cell ]; } } else { op1e_weight[ op1e_cell ] = 0xff; } DSP3_OP1E_D( (int16)(op1e_turn+2), &op1e_x, &op1e_y ); op1e_lcv_steps--; DSP3_SR = 0x0080; DSP3_OP1E_A(); } void DSP3_OP1E_B() { op1e_x = op3e_x; op1e_y = op3e_y; op1e_lcv_radius = 1; op1e_search = 0; DSP3_OP1E_B1(); SetDSP3 = &DSP3_OP1E_C; } void DSP3_OP1E_B1() { while( op1e_lcv_radius < op1e_max_radius ) { op1e_y--; op1e_lcv_turns = 6; op1e_turn = 5; while( op1e_lcv_turns ) { op1e_lcv_steps = op1e_lcv_radius; while( op1e_lcv_steps ) { DSP3_OP1E_D1( op1e_turn, &op1e_x, &op1e_y ); if( 0 <= op1e_y && op1e_y < DSP3_WinHi && 0 <= op1e_x && op1e_x < DSP3_WinLo ) { DSP3_DR = (uint8)(op1e_x) | ((uint8)(op1e_y)<<8); DSP3_OP03(); op1e_cell = DSP3_DR; if( op1e_cost[ op1e_cell ] < 0x80 && op1e_terrain[ op1e_cell ] < 0x40 ) { DSP3_OP1E_B2(); } // end cell perimeter } op1e_lcv_steps--; } // end search line op1e_turn--; if( op1e_turn == 0 ) op1e_turn = 6; op1e_lcv_turns--; } // end circle search op1e_lcv_radius++; } // end radius search } void DSP3_OP1E_B2() { int16 cell; int16 path; int16 x,y; int16 lcv_turns; path = 0xff; lcv_turns = 6; while( lcv_turns ) { x = op1e_x; y = op1e_y; DSP3_OP1E_D1( lcv_turns, &x, &y ); DSP3_DR = (uint8)(x) | ((uint8)(y)<<8); DSP3_OP03(); cell = DSP3_DR; if( 0 <= y && y < DSP3_WinHi && 0 <= x && x < DSP3_WinLo ) { if( op1e_terrain[ cell ] < 0x80 || op1e_weight[ cell ] == 0 ) { if( op1e_weight[ cell ] < path ) { path = op1e_weight[ cell ]; } } } // end step travel lcv_turns--; } // end while turns if( path != 0xff ) { op1e_weight[ op1e_cell ] = path + op1e_cost[ op1e_cell ]; } } void DSP3_OP1E_C() { int lcv; op1e_min_radius = (uint8)(DSP3_DR & 0x00ff); op1e_max_radius = (uint8)((DSP3_DR & 0xff00)>>8); if( op1e_min_radius == 0 ) op1e_min_radius++; if( op1e_max_path_radius >= op1e_min_radius ) op1e_min_radius = op1e_max_path_radius+1; if( op1e_max_radius > op1e_max_path_radius ) op1e_max_path_radius = op1e_max_radius; op1e_lcv_radius = op1e_min_radius; op1e_lcv_steps = op1e_min_radius; op1e_lcv_turns = 6; op1e_turn = 0; op1e_x = op3e_x; op1e_y = op3e_y; for( lcv = 0; lcv < op1e_min_radius; lcv++ ) DSP3_OP1E_D( op1e_turn, &op1e_x, &op1e_y ); DSP3_OP1E_C1(); } void DSP3_OP1E_C1() { int lcv; if( op1e_lcv_steps == 0 ) { op1e_lcv_radius++; op1e_lcv_steps = op1e_lcv_radius; op1e_x = op3e_x; op1e_y = op3e_y; for( lcv = 0; lcv < op1e_lcv_radius; lcv++ ) DSP3_OP1E_D( op1e_turn, &op1e_x, &op1e_y ); } if( op1e_lcv_radius > op1e_max_radius ) { op1e_turn++; op1e_lcv_turns--; op1e_lcv_radius = op1e_min_radius; op1e_lcv_steps = op1e_min_radius; op1e_x = op3e_x; op1e_y = op3e_y; for( lcv = 0; lcv < op1e_min_radius; lcv++ ) DSP3_OP1E_D( op1e_turn, &op1e_x, &op1e_y ); } if( op1e_lcv_turns == 0 ) { DSP3_DR = 0xffff; DSP3_SR = 0x0080; SetDSP3 = &DSP3_Reset; return; } DSP3_DR = (uint8)(op1e_x) | ((uint8)(op1e_y)<<8); DSP3_OP03(); op1e_cell = DSP3_DR; DSP3_SR = 0x0080; SetDSP3 = &DSP3_OP1E_C2; } void DSP3_OP1E_C2() { DSP3_DR = op1e_weight[ op1e_cell ]; DSP3_OP1E_D( (int16)(op1e_turn+2), &op1e_x, &op1e_y ); op1e_lcv_steps--; DSP3_SR = 0x0084; SetDSP3 = &DSP3_OP1E_C1; } void DSP3_OP1E_D( int16 move, int16 *lo, int16 *hi ) { uint32 dataOfs = ((move << 1) + 0x03b2) & 0x03ff; int16 Lo; int16 Hi; DSP3_AddHi = DSP3_DataROM[dataOfs]; DSP3_AddLo = DSP3_DataROM[dataOfs + 1]; Lo = (uint8)(*lo); Hi = (uint8)(*hi); if (Lo & 1) Hi += (DSP3_AddLo & 1); DSP3_AddLo += Lo; DSP3_AddHi += Hi; if (DSP3_AddLo < 0) DSP3_AddLo += DSP3_WinLo; else if (DSP3_AddLo >= DSP3_WinLo) DSP3_AddLo -= DSP3_WinLo; if (DSP3_AddHi < 0) DSP3_AddHi += DSP3_WinHi; else if (DSP3_AddHi >= DSP3_WinHi) DSP3_AddHi -= DSP3_WinHi; *lo = DSP3_AddLo; *hi = DSP3_AddHi; } void DSP3_OP1E_D1( int16 move, int16 *lo, int16 *hi ) { //uint32 dataOfs = ((move << 1) + 0x03b2) & 0x03ff; int16 Lo; int16 Hi; const unsigned short HiAdd[] = { 0x00, 0xFF, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0xFF, 0x00 }; const unsigned short LoAdd[] = { 0x00, 0x00, 0x01, 0x01, 0x00, 0xFF, 0xFF, 0x00 }; if( (*lo) & 1 ) DSP3_AddHi = HiAdd[ move + 8 ]; else DSP3_AddHi = HiAdd[ move + 0 ]; DSP3_AddLo = LoAdd[ move ]; Lo = (uint8)(*lo); Hi = (uint8)(*hi); if (Lo & 1) Hi += (DSP3_AddLo & 1); DSP3_AddLo += Lo; DSP3_AddHi += Hi; *lo = DSP3_AddLo; *hi = DSP3_AddHi; } void DSP3_OP10() { if( DSP3_DR == 0xffff ) { DSP3_Reset(); } else { // absorb 2 bytes DSP3_DR = DSP3_DR; } } void DSP3_OP0C_A() { // absorb 2 bytes DSP3_DR = 0; SetDSP3 = &DSP3_Reset; } void DSP3_OP0C() { // absorb 2 bytes DSP3_DR = 0; //SetDSP3 = &DSP3_OP0C_A; SetDSP3 = &DSP3_Reset; } void DSP3_OP1C_C() { // return 2 bytes DSP3_DR = 0; SetDSP3 = &DSP3_Reset; } void DSP3_OP1C_B() { // absorb 2 bytes // return 2 bytes DSP3_DR = 0; SetDSP3 = &DSP3_OP1C_C; } void DSP3_OP1C_A() { // absorb 2 bytes SetDSP3 = &DSP3_OP1C_B; } void DSP3_OP1C() { // absorb 2 bytes SetDSP3 = &DSP3_OP1C_A; } void DSP3_Command() { if (DSP3_DR < 0x40) { switch (DSP3_DR) { case 0x02: SetDSP3 = &DSP3_Coordinate; break; case 0x03: SetDSP3 = &DSP3_OP03; break; case 0x06: SetDSP3 = &DSP3_OP06; break; case 0x07: SetDSP3 = &DSP3_OP07; return; case 0x0c: SetDSP3 = &DSP3_OP0C; break; case 0x0f: SetDSP3 = &DSP3_TestMemory; break; case 0x10: SetDSP3 = &DSP3_OP10; break; case 0x18: SetDSP3 = &DSP3_Convert; break; case 0x1c: SetDSP3 = &DSP3_OP1C; break; case 0x1e: SetDSP3 = &DSP3_OP1E; break; case 0x1f: SetDSP3 = &DSP3_MemoryDump; break; case 0x38: SetDSP3 = &DSP3_Decode; break; case 0x3e: SetDSP3 = &DSP3_OP3E; break; default: return; } DSP3_SR = 0x0080; DSP3_Index = 0; } } uint8 dsp3_byte; uint16 dsp3_address; void DSP3SetByte() { if (dsp3_address < 0xC000) { if (DSP3_SR & 0x04) { DSP3_DR = (DSP3_DR & 0xff00) + dsp3_byte; (*SetDSP3)(); } else { DSP3_SR ^= 0x10; if (DSP3_SR & 0x10) DSP3_DR = (DSP3_DR & 0xff00) + dsp3_byte; else { DSP3_DR = (DSP3_DR & 0x00ff) + (dsp3_byte << 8); (*SetDSP3)(); } } } } void DSP3GetByte() { if (dsp3_address < 0xC000) { if (DSP3_SR & 0x04) { dsp3_byte = (uint8) DSP3_DR; (*SetDSP3)(); } else { DSP3_SR ^= 0x10; if (DSP3_SR & 0x10) dsp3_byte = (uint8) (DSP3_DR); else { dsp3_byte = (uint8) (DSP3_DR >> 8); (*SetDSP3)(); } } } else { dsp3_byte = (uint8) DSP3_SR; } } void InitDSP3() { DSP3_Reset(); } #endif sfc/alt/cpu/memory.cpp000664 001750 001750 00000001474 12651764221 016054 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP uint8 CPU::pio() { return status.pio; } bool CPU::joylatch() { return status.joypad_strobe_latch; } bool CPU::interrupt_pending() { return false; } uint8 CPU::port_read(uint8 port) { return port_data[port & 3]; } void CPU::port_write(uint8 port, uint8 data) { port_data[port & 3] = data; } void CPU::op_io() { add_clocks(6); } uint8 CPU::op_read(unsigned addr) { regs.mdr = bus.read(addr); add_clocks(speed(addr)); return regs.mdr; } void CPU::op_write(unsigned addr, uint8 data) { add_clocks(speed(addr)); bus.write(addr, regs.mdr = data); } unsigned CPU::speed(unsigned addr) const { if(addr & 0x408000) { if(addr & 0x800000) return status.rom_speed; return 8; } if((addr + 0x6000) & 0x4000) return 8; if((addr - 0x4000) & 0x7e00) return 6; return 12; } #endif gb/interface/000700 001750 001750 00000000000 12656700342 014223 5ustar00sergiosergio000000 000000 phoenix/gtk/window.cpp000664 001750 001750 00000032747 12651764221 016177 0ustar00sergiosergio000000 000000 namespace phoenix { static gint Window_close(GtkWidget* widget, GdkEvent* event, Window* window) { if(window->onClose) window->onClose(); else window->setVisible(false); if(window->state.modal && !window->visible()) window->setModal(false); return true; } static gboolean Window_expose(GtkWidget* widget, GdkEvent* event, Window* window) { if(window->state.backgroundColorOverride == false) return false; cairo_t* context = gdk_cairo_create(widget->window); Color color = window->backgroundColor(); double red = (double)color.red / 255.0; double green = (double)color.green / 255.0; double blue = (double)color.blue / 255.0; double alpha = (double)color.alpha / 255.0; if(gdk_screen_is_composited(gdk_screen_get_default()) && gdk_screen_get_rgba_colormap(gdk_screen_get_default()) ) { cairo_set_source_rgba(context, red, green, blue, alpha); } else { cairo_set_source_rgb(context, red, green, blue); } cairo_set_operator(context, CAIRO_OPERATOR_SOURCE); cairo_paint(context); cairo_destroy(context); return false; } static gboolean Window_configure(GtkWidget* widget, GdkEvent* event, Window* window) { if(gtk_widget_get_realized(window->p.widget) == false) return false; if(window->visible() == false) return false; GdkWindow *gdkWindow = gtk_widget_get_window(widget); GdkRectangle border, client; gdk_window_get_frame_extents(gdkWindow, &border); gdk_window_get_geometry(gdkWindow, nullptr, nullptr, &client.width, &client.height, nullptr); gdk_window_get_origin(gdkWindow, &client.x, &client.y); if(window->state.fullScreen == false) { //update geometry settings settings->geometry.frameX = client.x - border.x; settings->geometry.frameY = client.y - border.y; settings->geometry.frameWidth = border.width - client.width; settings->geometry.frameHeight = border.height - client.height; if(window->state.backgroundColorOverride == false) { GdkColor color = widget->style->bg[GTK_STATE_NORMAL]; settings->window.backgroundColor = ((uint8_t)(color.red >> 8) << 16) + ((uint8_t)(color.green >> 8) << 8) + ((uint8_t)(color.blue >> 8) << 0); } settings->save(); } Geometry geometry = { client.x, client.y + window->p.menuHeight(), client.width, client.height - window->p.menuHeight() - window->p.statusHeight() }; //move if(geometry.x != window->state.geometry.x || geometry.y != window->state.geometry.y) { if(window->state.fullScreen == false) { window->state.geometry.x = geometry.x; window->state.geometry.y = geometry.y; } if(window->p.locked == false && window->onMove) window->onMove(); } //size if(geometry.width != window->state.geometry.width || geometry.height != window->state.geometry.height) { window->p.onSizePending = true; } return false; } static void Window_drop(GtkWidget* widget, GdkDragContext* context, gint x, gint y, GtkSelectionData* data, guint type, guint timestamp, Window* window) { if(window->state.droppable == false) return; lstring paths = DropPaths(data); if(paths.empty()) return; if(window->onDrop) window->onDrop(paths); } static gboolean Window_keyPress(GtkWidget* widget, GdkEventKey* event, Window* window) { Keyboard::Keycode key = Keysym(event->keyval); if(key != Keyboard::Keycode::None && window->onKeyPress) window->onKeyPress(key); return false; } static gboolean Window_keyRelease(GtkWidget* widget, GdkEventKey* event, Window* window) { Keyboard::Keycode key = Keysym(event->keyval); if(key != Keyboard::Keycode::None && window->onKeyRelease) window->onKeyRelease(key); return false; } static void Window_sizeAllocate(GtkWidget* widget, GtkAllocation* allocation, Window* window) { //size-allocate sent from gtk_fixed_move(); detect if layout unchanged and return if(allocation->width == window->p.lastAllocation.width && allocation->height == window->p.lastAllocation.height) return; window->state.geometry.width = allocation->width; window->state.geometry.height = allocation->height; for(auto& layout : window->state.layout) { Geometry geometry = window->geometry(); geometry.x = geometry.y = 0; layout.setGeometry(geometry); } if(window->p.onSizePending && window->p.locked == false && window->onSize) { window->p.onSizePending = false; window->onSize(); } window->p.lastAllocation = *allocation; } static void Window_sizeRequest(GtkWidget* widget, GtkRequisition* requisition, Window* window) { requisition->width = window->state.geometry.width; requisition->height = window->state.geometry.height; } Window& pWindow::none() { static Window* window = nullptr; if(window == nullptr) window = new Window; return *window; } void pWindow::append(Layout& layout) { Geometry geometry = this->geometry(); geometry.x = geometry.y = 0; layout.setGeometry(geometry); } void pWindow::append(Menu& menu) { if(window.state.menuFont) menu.p.setFont(window.state.menuFont); else menu.p.setFont(Font::sans(8)); gtk_menu_shell_append(GTK_MENU_SHELL(this->menu), menu.p.widget); gtk_widget_show(menu.p.widget); } void pWindow::append(Widget& widget) { if(widget.font().empty() && !window.state.widgetFont.empty()) { widget.setFont(window.state.widgetFont); } if(GetParentWidget(&widget)) { widget.p.gtkParent = GetParentWidget(&widget)->p.container(widget); } else { widget.p.gtkParent = formContainer; } gtk_fixed_put(GTK_FIXED(widget.p.gtkParent), widget.p.gtkWidget, 0, 0); if(widget.state.font) widget.p.setFont(widget.state.font); else if(window.state.widgetFont) widget.p.setFont(window.state.widgetFont); else widget.p.setFont(Font::sans(8)); widget.setVisible(widget.visible()); } Geometry pWindow::frameMargin() { if(window.state.fullScreen) return { 0, menuHeight(), 0, menuHeight() + statusHeight() }; return { settings->geometry.frameX, settings->geometry.frameY + menuHeight(), settings->geometry.frameWidth, settings->geometry.frameHeight + menuHeight() + statusHeight() }; } bool pWindow::focused() { return gtk_window_is_active(GTK_WINDOW(widget)); } Geometry pWindow::geometry() { if(window.state.fullScreen) { int x, y, width, height; gtk_window_get_position(GTK_WINDOW(widget), &x, &y); gtk_window_get_size(GTK_WINDOW(widget), &width, &height); return {x, y + menuHeight(), width, height - menuHeight() - statusHeight()}; } return window.state.geometry; } void pWindow::remove(Layout& layout) { } void pWindow::remove(Menu& menu) { menu.p.orphan(); } void pWindow::remove(Widget& widget) { widget.p.orphan(); } void pWindow::setBackgroundColor(Color color) { GdkColor gdkColor = CreateColor(color.red, color.green, color.blue); gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &gdkColor); } void pWindow::setDroppable(bool droppable) { gtk_drag_dest_set(widget, GTK_DEST_DEFAULT_ALL, nullptr, 0, GDK_ACTION_COPY); if(droppable) gtk_drag_dest_add_uri_targets(widget); } void pWindow::setFocused() { gtk_window_present(GTK_WINDOW(widget)); } void pWindow::setFullScreen(bool fullScreen) { if(fullScreen == false) { gtk_window_unfullscreen(GTK_WINDOW(widget)); } else { gtk_window_fullscreen(GTK_WINDOW(widget)); /*unsigned monitor = gdk_screen_get_monitor_at_window(gdk_screen_get_default(), gtk_widget_get_window(widget)); GdkRectangle rectangle = {0}; gdk_screen_get_monitor_geometry(gdk_screen_get_default(), monitor, &rectangle); gtk_window_set_decorated(GTK_WINDOW(widget), false); gtk_window_move(GTK_WINDOW(widget), rectangle.x, rectangle.y); gtk_window_resize(GTK_WINDOW(widget), rectangle.width, rectangle.height); gtk_widget_set_size_request(formContainer, rectangle.width, rectangle.height);*/ } } void pWindow::setGeometry(Geometry geometry) { Geometry margin = frameMargin(); gtk_window_move(GTK_WINDOW(widget), geometry.x - margin.x, geometry.y - margin.y); GdkGeometry geom; geom.min_width = window.state.resizable ? 1 : window.state.geometry.width; geom.min_height = window.state.resizable ? 1 : window.state.geometry.height; gtk_window_set_geometry_hints(GTK_WINDOW(widget), GTK_WIDGET(widget), &geom, GDK_HINT_MIN_SIZE); //gtk_window_set_policy(GTK_WINDOW(widget), true, true, false); gtk_widget_set_size_request(formContainer, geometry.width, geometry.height); gtk_window_resize(GTK_WINDOW(widget), geometry.width, geometry.height + menuHeight() + statusHeight()); for(auto& layout : window.state.layout) { Geometry layoutGeometry = geometry; layoutGeometry.x = layoutGeometry.y = 0; layout.setGeometry(layoutGeometry); } } void pWindow::setMenuFont(string font) { for(auto& item : window.state.menu) item.p.setFont(font); } void pWindow::setMenuVisible(bool visible) { gtk_widget_set_visible(menu, visible); } void pWindow::setModal(bool modal) { if(modal == true) { gtk_window_set_modal(GTK_WINDOW(widget), true); while(window.state.modal) { Application::processEvents(); usleep(20 * 1000); } gtk_window_set_modal(GTK_WINDOW(widget), false); } } void pWindow::setResizable(bool resizable) { gtk_window_set_resizable(GTK_WINDOW(widget), resizable); gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(status), resizable); } void pWindow::setStatusFont(string font) { pFont::setFont(status, font); } void pWindow::setStatusText(string text) { gtk_statusbar_pop(GTK_STATUSBAR(status), 1); gtk_statusbar_push(GTK_STATUSBAR(status), 1, text); } void pWindow::setStatusVisible(bool visible) { gtk_widget_set_visible(status, visible); } void pWindow::setTitle(string text) { gtk_window_set_title(GTK_WINDOW(widget), text); } void pWindow::setVisible(bool visible) { gtk_widget_set_visible(widget, visible); if(visible) { if(gtk_widget_get_visible(menu)) { GtkAllocation allocation; gtk_widget_get_allocation(menu, &allocation); settings->geometry.menuHeight = allocation.height; } if(gtk_widget_get_visible(status)) { GtkAllocation allocation; gtk_widget_get_allocation(status, &allocation); settings->geometry.statusHeight = allocation.height; } } } void pWindow::setWidgetFont(string font) { } void pWindow::constructor() { lastAllocation.width = 0; lastAllocation.height = 0; onSizePending = false; widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); //if program was given a name, try and set the window taskbar icon from one of the pixmaps folders if(applicationState.name.empty() == false) { string filename = {"/usr/share/pixmaps/", applicationState.name, ".png"}; if(!file::exists(filename)) filename = {"/usr/local/share/pixmaps/", applicationState.name, ".png"}; if(file::exists(filename)) { //maximum image size supported by GTK+ is 256x256; so we must scale larger images ourselves nall::image icon(filename); icon.scale(min(256u, icon.width), min(256u, icon.height), Interpolation::Hermite); GdkPixbuf* pixbuf = CreatePixbuf(icon); gtk_window_set_icon(GTK_WINDOW(widget), pixbuf); g_object_unref(G_OBJECT(pixbuf)); } } GdkColormap* colormap = gdk_screen_get_rgba_colormap(gdk_screen_get_default()); if(!colormap) colormap = gdk_screen_get_rgb_colormap(gdk_screen_get_default()); if(colormap) gtk_widget_set_colormap(widget, colormap); gtk_window_set_resizable(GTK_WINDOW(widget), true); #if GTK_MAJOR_VERSION >= 3 gtk_window_set_has_resize_grip(GTK_WINDOW(widget), false); #endif gtk_widget_set_app_paintable(widget, true); gtk_widget_add_events(widget, GDK_CONFIGURE); menuContainer = gtk_vbox_new(false, 0); gtk_container_add(GTK_CONTAINER(widget), menuContainer); gtk_widget_show(menuContainer); menu = gtk_menu_bar_new(); gtk_box_pack_start(GTK_BOX(menuContainer), menu, false, false, 0); formContainer = gtk_fixed_new(); gtk_box_pack_start(GTK_BOX(menuContainer), formContainer, true, true, 0); gtk_widget_show(formContainer); statusContainer = gtk_event_box_new(); status = gtk_statusbar_new(); gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(status), true); gtk_container_add(GTK_CONTAINER(statusContainer), status); gtk_box_pack_start(GTK_BOX(menuContainer), statusContainer, false, false, 0); gtk_widget_show(statusContainer); setTitle(""); setResizable(window.state.resizable); setGeometry(window.state.geometry); setMenuFont(Font::sans(8)); setStatusFont(Font::sans(8)); g_signal_connect(G_OBJECT(widget), "delete-event", G_CALLBACK(Window_close), (gpointer)&window); g_signal_connect(G_OBJECT(widget), "expose-event", G_CALLBACK(Window_expose), (gpointer)&window); g_signal_connect(G_OBJECT(widget), "configure-event", G_CALLBACK(Window_configure), (gpointer)&window); g_signal_connect(G_OBJECT(widget), "drag-data-received", G_CALLBACK(Window_drop), (gpointer)&window); g_signal_connect(G_OBJECT(widget), "key-press-event", G_CALLBACK(Window_keyPress), (gpointer)&window); g_signal_connect(G_OBJECT(widget), "key-release-event", G_CALLBACK(Window_keyPress), (gpointer)&window); g_signal_connect(G_OBJECT(formContainer), "size-allocate", G_CALLBACK(Window_sizeAllocate), (gpointer)&window); g_signal_connect(G_OBJECT(formContainer), "size-request", G_CALLBACK(Window_sizeRequest), (gpointer)&window); window.state.backgroundColor = Color( (uint8_t)(settings->window.backgroundColor >> 16), (uint8_t)(settings->window.backgroundColor >> 8), (uint8_t)(settings->window.backgroundColor >> 0) ); } unsigned pWindow::menuHeight() { return window.state.menuVisible ? settings->geometry.menuHeight : 0; } unsigned pWindow::statusHeight() { return window.state.statusVisible ? settings->geometry.statusHeight : 0; } } processor/arm/instructions-arm.cpp000664 001750 001750 00000040702 12651764221 020536 0ustar00sergiosergio000000 000000 #ifdef PROCESSOR_ARM_HPP void ARM::arm_step() { if(pipeline.reload) { pipeline.reload = false; r(15).data &= ~3; sequential() = false; pipeline.fetch.address = r(15) & ~3; pipeline.fetch.instruction = read(pipeline.fetch.address, Word); pipeline_step(); } pipeline_step(); if(processor.irqline && cpsr().i == 0) { vector(0x00000018, Processor::Mode::IRQ); return; } instructions++; if(trace) { print(disassemble_registers(), "\n"); print(disassemble_arm_instruction(pipeline.execute.address), "\n"); usleep(100000); } if(condition(instruction() >> 28) == false) return; #define decode(pattern, execute) if( \ (instruction() & std::integral_constant::value) \ == std::integral_constant::value \ ) return arm_op_ ## execute() decode("???? 0001 0010 ++++ ++++ ++++ 0001 ????", branch_exchange_register); decode("???? 0000 00?? ???? ???? ???? 1001 ????", multiply); decode("???? 0000 1??? ???? ???? ???? 1001 ????", multiply_long); decode("???? 0001 0?00 ++++ ???? ---- 0000 ----", move_to_register_from_status); decode("???? 0001 0?00 ???? ???? ---- 1001 ????", memory_swap); decode("???? 0001 0?10 ???? ++++ ---- 0000 ????", move_to_status_from_register); decode("???? 0011 0?10 ???? ++++ ???? ???? ????", move_to_status_from_immediate); decode("???? 000? ?0?1 ???? ???? ---- 11?1 ????", load_register); decode("???? 000? ?1?1 ???? ???? ???? 11?1 ????", load_immediate); decode("???? 000? ?0?? ???? ???? ---- 1011 ????", move_half_register); decode("???? 000? ?1?? ???? ???? ???? 1011 ????", move_half_immediate); decode("???? 000? ???? ???? ???? ???? ???0 ????", data_immediate_shift); decode("???? 000? ???? ???? ???? ???? 0??1 ????", data_register_shift); decode("???? 001? ???? ???? ???? ???? ???? ????", data_immediate); decode("???? 010? ???? ???? ???? ???? ???? ????", move_immediate_offset); decode("???? 011? ???? ???? ???? ???? ???0 ????", move_register_offset); decode("???? 100? ???? ???? ???? ???? ???? ????", move_multiple); decode("???? 101? ???? ???? ???? ???? ???? ????", branch); decode("???? 1111 ???? ???? ???? ???? ???? ????", software_interrupt); #undef decode crash = true; } void ARM::arm_opcode(uint32 rm) { uint4 opcode = instruction() >> 21; uint1 save = instruction() >> 20; uint4 n = instruction() >> 16; uint4 d = instruction() >> 12; uint32 rn = r(n); switch(opcode) { case 0: r(d) = bit(rn & rm); break; //AND case 1: r(d) = bit(rn ^ rm); break; //EOR case 2: r(d) = sub(rn, rm, 1); break; //SUB case 3: r(d) = sub(rm, rn, 1); break; //RSB case 4: r(d) = add(rn, rm, 0); break; //ADD case 5: r(d) = add(rn, rm, cpsr().c); break; //ADC case 6: r(d) = sub(rn, rm, cpsr().c); break; //SBC case 7: r(d) = sub(rm, rn, cpsr().c); break; //RSC case 8: bit(rn & rm); break; //TST case 9: bit(rn ^ rm); break; //TEQ case 10: sub(rn, rm, 1); break; //CMP case 11: add(rn, rm, 0); break; //CMN case 12: r(d) = bit(rn | rm); break; //ORR case 13: r(d) = bit(rm); break; //MOV case 14: r(d) = bit(rn & ~rm); break; //BIC case 15: r(d) = bit(~rm); break; //MVN } if(exceptionmode() && d == 15 && save) { cpsr() = spsr(); processor.setMode((Processor::Mode)cpsr().m); } } void ARM::arm_move_to_status(uint32 rm) { uint1 source = instruction() >> 22; uint4 field = instruction() >> 16; if(source == 1) { if(mode() == Processor::Mode::USR) return; if(mode() == Processor::Mode::SYS) return; } PSR &psr = source ? spsr() : cpsr(); if(field & 1) { if(source == 1 || privilegedmode()) { psr.i = rm & 0x00000080; psr.f = rm & 0x00000040; psr.t = rm & 0x00000020; psr.m = rm & 0x0000001f; if(source == 0) processor.setMode((Processor::Mode)psr.m); } } if(field & 8) { psr.n = rm & 0x80000000; psr.z = rm & 0x40000000; psr.c = rm & 0x20000000; psr.v = rm & 0x10000000; } } //mul{condition}{s} rd,rm,rs //mla{condition}{s} rd,rm,rs,rn //cccc 0000 00as dddd nnnn ssss 1001 mmmm //c = condition //a = accumulate //s = save flags //d = rd //n = rn //s = rs //m = rm void ARM::arm_op_multiply() { uint1 accumulate = instruction() >> 21; uint1 save = instruction() >> 20; uint4 d = instruction() >> 16; uint4 n = instruction() >> 12; uint4 s = instruction() >> 8; uint4 m = instruction(); step(1); r(d) = mul(accumulate ? r(n) : 0u, r(m), r(s)); } //(u,s)mull{condition}{s} rdlo,rdhi,rm,rs //(u,s)mlal{condition}{s} rdlo,rdhi,rm,rs //cccc 0000 1sas hhhh llll ssss 1001 mmmm //c = condition //s = sign-extend //a = accumulate //s = save flags //h = rdhi //l = rdlo //s = rs //m = rm void ARM::arm_op_multiply_long() { uint1 signextend = instruction() >> 22; uint1 accumulate = instruction() >> 21; uint1 save = instruction() >> 20; uint4 dhi = instruction() >> 16; uint4 dlo = instruction() >> 12; uint4 s = instruction() >> 8; uint4 m = instruction(); uint64 rm = r(m); uint64 rs = r(s); if(signextend) { rm = (int32)rm; rs = (int32)rs; } uint64 rd = rm * rs; if(accumulate) rd += ((uint64)r(dhi) << 32) + ((uint64)r(dlo) << 0); r(dhi) = rd >> 32; r(dlo) = rd >> 0; if(save) { cpsr().n = r(dhi) >> 31; cpsr().z = r(dhi) == 0 && r(dlo) == 0; //cpsr().c = 0; //(undefined) //cpsr().v = 0; //(undefined) } } //swp{condition}{b} rd,rm,[rn] //cccc 0001 0b00 nnnn dddd ---- 1001 mmmm //c = condition //b = byte (0 = word) //n = rn //d = rd //m = rm void ARM::arm_op_memory_swap() { uint1 byte = instruction() >> 22; uint4 n = instruction() >> 16; uint4 d = instruction() >> 12; uint4 m = instruction(); uint32 word = load(r(n), byte ? Byte : Word); store(r(n), byte ? Byte : Word, r(m)); r(d) = word; } //(ldr,str){condition}h rd,[rn,rm]{!} //(ldr,str){condition}h rd,[rn],rm //cccc 000p u0wl nnnn dddd ---- 1011 mmmm //c = condition //p = pre (0 = post) //u = up //w = writeback //l = load (0 = save) //n = rn //d = rd //m = rm void ARM::arm_op_move_half_register() { uint1 pre = instruction() >> 24; uint1 up = instruction() >> 23; uint1 writeback = instruction() >> 21; uint1 l = instruction() >> 20; uint4 n = instruction() >> 16; uint4 d = instruction() >> 12; uint4 m = instruction(); uint32 rn = r(n); uint32 rm = r(m); if(pre == 1) rn = up ? rn + rm : rn - rm; if(l == 1) r(d) = load(rn, Half); if(l == 0) store(rn, Half, r(d)); if(pre == 0) rn = up ? rn + rm : rn - rm; if(pre == 0 || writeback == 1) r(n) = rn; } //(ldr,str){condition}h rd,[rn{,+/-offset}]{!} //(ldr,str){condition}h rd,[rn]{,+/-offset} //cccc 000p u1wl nnnn dddd iiii 1011 iiii //c = condition //p = pre (0 = post) //u = up //w = writeback //l = load (0 = save) //n = rn //d = rd //i = immediate hi //i = immediate lo void ARM::arm_op_move_half_immediate() { uint1 pre = instruction() >> 24; uint1 up = instruction() >> 23; uint1 writeback = instruction() >> 21; uint1 l = instruction() >> 20; uint4 n = instruction() >> 16; uint4 d = instruction() >> 12; uint4 ih = instruction() >> 8; uint4 il = instruction(); uint32 rn = r(n); uint8 immediate = (ih << 4) + (il << 0); if(pre == 1) rn = up ? rn + immediate : rn - immediate; if(l == 1) r(d) = load(rn, Half); if(l == 0) store(rn, Half, r(d)); if(pre == 0) rn = up ? rn + immediate : rn - immediate; if(pre == 0 || writeback == 1) r(n) = rn; } //ldr{condition}s(h,b) rd,[rn,rm]{!} //ldr{condition}s(h,b) rd,[rn],rm //cccc 000p u0w1 nnnn dddd ---- 11h1 mmmm //c = condition //p = pre (0 = post) //u = up //w = writeback //n = rn //d = rd //h = half (0 = byte) //m = rm void ARM::arm_op_load_register() { uint1 pre = instruction() >> 24; uint1 up = instruction() >> 23; uint1 writeback = instruction() >> 21; uint4 n = instruction() >> 16; uint4 d = instruction() >> 12; uint1 half = instruction() >> 5; uint4 m = instruction(); uint32 rn = r(n); uint32 rm = r(m); if(pre == 1) rn = up ? rn + rm : rn - rm; uint32 word = load(rn, half ? Half : Byte); r(d) = half ? (int16)word : (int8)word; if(pre == 0) rn = up ? rn + rm : rn - rm; if(pre == 0 || writeback == 1) r(n) = rn; } //ldr{condition}s(h,b) rd,[rn{,+/-offset}]{!} //ldr{condition}s(h,b) rd,[rn]{,+/-offset} //cccc 000p u1w1 nnnn dddd iiii 11h1 iiii //c = condition //p = pre (0 = post) //u = up //w = writeback //n = rn //d = rd //i = immediate hi //h = half (0 = byte) //i = immediate lo void ARM::arm_op_load_immediate() { uint1 pre = instruction() >> 24; uint1 up = instruction() >> 23; uint1 writeback = instruction() >> 21; uint4 n = instruction() >> 16; uint4 d = instruction() >> 12; uint4 ih = instruction() >> 8; uint1 half = instruction() >> 5; uint4 il = instruction(); uint32 rn = r(n); uint8 immediate = (ih << 4) + (il << 0); if(pre == 1) rn = up ? rn + immediate : rn - immediate; uint32 word = load(rn, half ? Half : Byte); r(d) = half ? (int16)word : (int8)word; if(pre == 0) rn = up ? rn + immediate : rn - immediate; if(pre == 0 || writeback == 1) r(n) = rn; } //mrs{condition} rd,(c,s)psr //cccc 0001 0r00 ++++ dddd ---- 0000 ---- //c = condition //r = SPSR (0 = CPSR) //d = rd void ARM::arm_op_move_to_register_from_status() { uint1 source = instruction() >> 22; uint4 d = instruction() >> 12; if(source) { if(mode() == Processor::Mode::USR) return; if(mode() == Processor::Mode::SYS) return; } r(d) = source ? spsr() : cpsr(); } //msr{condition} (c,s)psr:{fields},rm //cccc 0001 0r10 ffff ++++ ---- 0000 mmmm //c = condition //r = SPSR (0 = CPSR) //f = field mask //m = rm void ARM::arm_op_move_to_status_from_register() { uint4 m = instruction(); arm_move_to_status(r(m)); } //bx{condition} rm //cccc 0001 0010 ++++ ++++ ++++ 0001 mmmm //c = condition //m = rm void ARM::arm_op_branch_exchange_register() { uint4 m = instruction(); cpsr().t = r(m) & 1; r(15) = r(m); } //msr{condition} (c,s)psr:{fields},#immediate //cccc 0011 0r10 ffff ++++ rrrr iiii iiii //c = condition //r = SPSR (0 = CPSR) //f = field mask //r = rotate //i = immediate void ARM::arm_op_move_to_status_from_immediate() { uint4 rotate = instruction() >> 8; uint8 immediate = instruction(); uint32 rm = immediate; if(rotate) rm = ror(rm, 2 * rotate); arm_move_to_status(rm); } //{opcode}{condition}{s} rd,rm {shift} #immediate //{opcode}{condition} rn,rm {shift} #immediate //{opcode}{condition}{s} rd,rn,rm {shift} #immediate //cccc 000o ooos nnnn dddd llll lss0 mmmm //c = condition //o = opcode //s = save flags //n = rn //d = rd //l = shift immediate //s = shift //m = rm void ARM::arm_op_data_immediate_shift() { uint1 save = instruction() >> 20; uint5 shift = instruction() >> 7; uint2 mode = instruction() >> 5; uint4 m = instruction(); uint32 rs = shift; uint32 rm = r(m); carryout() = cpsr().c; if(mode == 0) rm = lsl(rm, rs); if(mode == 1) rm = lsr(rm, rs ? rs : 32); if(mode == 2) rm = asr(rm, rs ? rs : 32); if(mode == 3) rm = rs ? ror(rm, rs) : rrx(rm); arm_opcode(rm); } //{opcode}{condition}{s} rd,rm {shift} rs //{opcode}{condition} rn,rm {shift} rs //{opcode}{condition}{s} rd,rn,rm {shift} rs //cccc 000o ooos nnnn dddd ssss 0ss1 mmmm //c = condition //o = opcode //s = save flags //n = rn //d = rd //s = rs //s = shift //m = rm void ARM::arm_op_data_register_shift() { uint1 save = instruction() >> 20; uint4 s = instruction() >> 8; uint2 mode = instruction() >> 5; uint4 m = instruction(); uint8 rs = r(s); uint32 rm = r(m); carryout() = cpsr().c; if(mode == 0 ) rm = lsl(rm, rs < 33 ? rs : 33); if(mode == 1 ) rm = lsr(rm, rs < 33 ? rs : 33); if(mode == 2 ) rm = asr(rm, rs < 32 ? rs : 32); if(mode == 3 && rs) rm = ror(rm, (rs & 31) == 0 ? 32 : rs & 31); arm_opcode(rm); } //{opcode}{condition}{s} rd,#immediate //{opcode}{condition} rn,#immediate //{opcode}{condition}{s} rd,rn,#immediate //cccc 001o ooos nnnn dddd ssss iiii iiii //c = condition //o = opcode //s = save flags //n = rn //d = rd //s = shift immediate //i = immediate void ARM::arm_op_data_immediate() { uint1 save = instruction() >> 20; uint4 shift = instruction() >> 8; uint8 immediate = instruction(); uint32 rm = immediate; carryout() = cpsr().c; if(shift) rm = ror(immediate, 2 * shift); arm_opcode(rm); } //(ldr,str){condition}{b} rd,[rn{,+/-offset}]{!} //(ldr,str){condition}{b} rd,[rn]{,+/-offset} //cccc 010p ubwl nnnn dddd iiii iiii iiii //c = condition //p = pre (0 = post-indexed addressing) //u = up (add/sub offset to base) //b = byte (1 = word) //w = writeback //l = load (0 = save) //n = rn //d = rd //i = immediate void ARM::arm_op_move_immediate_offset() { uint1 pre = instruction() >> 24; uint1 up = instruction() >> 23; uint1 byte = instruction() >> 22; uint1 writeback = instruction() >> 21; uint1 l = instruction() >> 20; uint4 n = instruction() >> 16; uint4 d = instruction() >> 12; uint12 rm = instruction(); uint32 rn = r(n); auto& rd = r(d); if(pre == 1) rn = up ? rn + rm : rn - rm; if(l == 1) rd = load(rn, byte ? Byte : Word); if(l == 0) store(rn, byte ? Byte : Word, rd); if(pre == 0) rn = up ? rn + rm : rn - rm; if(pre == 0 || writeback == 1) r(n) = rn; } //(ldr,str){condition}{b} rd,[rn,rm {mode} #immediate]{!} //(ldr,str){condition}{b} rd,[rn],rm {mode} #immediate //cccc 011p ubwl nnnn dddd llll lss0 mmmm //c = condition //p = pre (0 = post-indexed addressing) //u = up //b = byte (1 = word) //w = writeback //l = load (0 = save) //n = rn //d = rd //l = shift immediate //s = shift mode //m = rm void ARM::arm_op_move_register_offset() { uint1 pre = instruction() >> 24; uint1 up = instruction() >> 23; uint1 byte = instruction() >> 22; uint1 writeback = instruction() >> 21; uint1 l = instruction() >> 20; uint4 n = instruction() >> 16; uint4 d = instruction() >> 12; uint5 immediate = instruction() >> 7; uint2 mode = instruction() >> 5; uint4 m = instruction(); uint32 rn = r(n); auto& rd = r(d); uint32 rs = immediate; uint32 rm = r(m); bool c = cpsr().c; if(mode == 0) rm = lsl(rm, rs); if(mode == 1) rm = lsr(rm, rs ? rs : 32); if(mode == 2) rm = asr(rm, rs ? rs : 32); if(mode == 3) rm = rs ? ror(rm, rs) : rrx(rm); if(pre == 1) rn = up ? rn + rm : rn - rm; if(l == 1) rd = load(rn, byte ? Byte : Word); if(l == 0) store(rn, byte ? Byte : Word, rd); if(pre == 0) rn = up ? rn + rm : rn - rm; if(pre == 0 || writeback == 1) r(n) = rn; } //(ldm,stm){condition}{mode} rn{!},{r...} //cccc 100p uswl nnnn llll llll llll llll //c = condition //p = pre (0 = post-indexed addressing) //u = up (add/sub offset to base) //s = spsr copy -or- usr register copy //w = writeback //l = load (0 = save) //n = rn //l = register list void ARM::arm_op_move_multiple() { uint1 pre = instruction() >> 24; uint1 up = instruction() >> 23; uint1 s = instruction() >> 22; uint1 writeback = instruction() >> 21; uint1 l = instruction() >> 20; uint4 n = instruction() >> 16; uint16 list = instruction(); uint32 rn = r(n); if(pre == 0 && up == 1) rn = rn + 0; //IA if(pre == 1 && up == 1) rn = rn + 4; //IB if(pre == 1 && up == 0) rn = rn - bit::count(list) * 4 + 0; //DB if(pre == 0 && up == 0) rn = rn - bit::count(list) * 4 + 4; //DA Processor::Mode pmode = mode(); bool usr = false; if(s && l == 1 && (list & 0x8000) == 0) usr = true; if(s && l == 0) usr = true; if(usr) processor.setMode(Processor::Mode::USR); sequential() = false; for(unsigned m = 0; m < 16; m++) { if(list & (1 << m)) { if(l == 1) r(m) = read(rn, Word); if(l == 0) write(rn, Word, r(m)); rn += 4; } } if(usr) processor.setMode(pmode); if(l == 1) { idle(); if(s && (list & 0x8000)) { if(mode() != Processor::Mode::USR && mode() != Processor::Mode::SYS) { cpsr() = spsr(); processor.setMode((Processor::Mode)cpsr().m); } } } if(writeback) { if(up == 1) r(n) = r(n) + bit::count(list) * 4; //IA, IB if(up == 0) r(n) = r(n) - bit::count(list) * 4; //DA, DB } } //b{l}{condition} address //cccc 101l dddd dddd dddd dddd dddd dddd //c = condition //l = link //d = displacement (24-bit signed) void ARM::arm_op_branch() { uint1 link = instruction() >> 24; int24 displacement = instruction(); if(link) r(14) = r(15) - 4; r(15) += displacement * 4; } //swi #immediate //cccc 1111 iiii iiii iiii iiii iiii iiii //c = condition //i = immediate void ARM::arm_op_software_interrupt() { uint24 immediate = instruction(); vector(0x00000008, Processor::Mode::SVC); } #endif gba/ppu/registers.hpp000664 001750 001750 00000004064 12651764221 015771 0ustar00sergiosergio000000 000000 enum : unsigned { OBJ = 0, BG0 = 1, BG1 = 2, BG2 = 3, BG3 = 4, SFX = 5 }; enum : unsigned { In0 = 0, In1 = 1, Obj = 2, Out = 3 }; struct Registers { struct Control { uint3 bgmode; uint1 cgbmode; uint1 frame; uint1 hblank; uint1 objmapping; uint1 forceblank; uint1 enable[5]; uint1 enablewindow[3]; operator uint16() const; uint16 operator=(uint16 source); Control& operator=(const Control&) = delete; } control; uint1 greenswap; struct Status { uint1 vblank; uint1 hblank; uint1 vcoincidence; uint1 irqvblank; uint1 irqhblank; uint1 irqvcoincidence; uint8 vcompare; operator uint16() const; uint16 operator=(uint16 source); Status& operator=(const Status&) = delete; } status; uint16 vcounter; struct BackgroundControl { uint2 priority; uint2 characterbaseblock; uint1 mosaic; uint1 colormode; uint5 screenbaseblock; uint1 affinewrap; //BG2,3 only uint2 screensize; operator uint16() const; uint16 operator=(uint16 source); BackgroundControl& operator=(const BackgroundControl&) = delete; }; struct Background { BackgroundControl control; uint9 hoffset; uint9 voffset; //BG2,3 only int16 pa, pb, pc, pd; int28 x, y; //internal int28 lx, ly; unsigned vmosaic; unsigned hmosaic; unsigned id; } bg[4]; struct WindowFlags { uint1 enable[6]; operator uint8() const; uint8 operator=(uint8 source); WindowFlags& operator=(const WindowFlags&) = delete; }; struct Window { uint8 x1, x2; uint8 y1, y2; } window[2]; WindowFlags windowflags[4]; struct Mosaic { uint4 bghsize; uint4 bgvsize; uint4 objhsize; uint4 objvsize; } mosaic; struct BlendControl { uint1 above[6]; uint1 below[6]; uint2 mode; operator uint16() const; uint16 operator=(uint16 source); BlendControl& operator=(const BlendControl&) = delete; }; struct Blend { BlendControl control; uint5 eva; uint5 evb; uint5 evy; } blend; } regs; gb/cpu/cpu.hpp000664 001750 001750 00000004415 12651764221 014373 0ustar00sergiosergio000000 000000 struct CPU : Processor::LR35902, Thread, MMIO { enum class Interrupt : unsigned { Vblank, Stat, Timer, Serial, Joypad, }; struct Status { unsigned clock; //$ff00 JOYP bool p15; bool p14; uint8 joyp; uint8 mlt_req; //$ff01 SB uint8 serial_data; unsigned serial_bits; //$ff02 SC bool serial_transfer; bool serial_clock; //$ff04 DIV uint8 div; //$ff05 TIMA uint8 tima; //$ff06 TMA uint8 tma; //$ff07 TAC bool timer_enable; unsigned timer_clock; //$ff0f IF bool interrupt_request_joypad; bool interrupt_request_serial; bool interrupt_request_timer; bool interrupt_request_stat; bool interrupt_request_vblank; //$ff4d KEY1 bool speed_double; bool speed_switch; //$ff51,$ff52 HDMA1,HDMA2 uint16 dma_source; //$ff53,$ff54 HDMA3,HDMA4 uint16 dma_target; //$ff55 HDMA5 bool dma_mode; uint16 dma_length; bool dma_completed; //$ff6c ??? uint8 ff6c; //$ff70 SVBK uint3 wram_bank; //$ff72-$ff75 ??? uint8 ff72; uint8 ff73; uint8 ff74; uint8 ff75; //$ffff IE bool interrupt_enable_joypad; bool interrupt_enable_serial; bool interrupt_enable_timer; bool interrupt_enable_stat; bool interrupt_enable_vblank; } status; struct OAMDMA { bool active; uint8 bank; uint8 offset; } oamdma; uint8 wram[32768]; //GB=8192, GBC=32768 uint8 hram[128]; static void Main(); void main(); void interrupt_raise(Interrupt id); void interrupt_test(); void interrupt_exec(uint16 pc); bool stop(); void power(); void serialize(serializer&); //mmio.cpp unsigned wram_addr(uint16 addr) const; void mmio_joyp_poll(); uint8 mmio_read(uint16 addr); void mmio_write(uint16 addr, uint8 data); //memory.cpp void op_io(); uint8 op_read(uint16 addr); void op_write(uint16 addr, uint8 data); void cycle_edge(); uint8 dma_read(uint16 addr); void dma_write(uint16 addr, uint8 data); uint8 debugger_read(uint16 addr); //timing.cpp void add_clocks(unsigned clocks); void timer_262144hz(); void timer_65536hz(); void timer_16384hz(); void timer_8192hz(); void timer_4096hz(); void hblank(); }; extern CPU cpu; phoenix/windows/phoenix.rc000664 001750 001750 00000000030 12651764221 017045 0ustar00sergiosergio000000 000000 1 24 "phoenix.Manifest" phoenix/cocoa/widget/check-label.cpp000664 001750 001750 00000002551 12651764221 020572 0ustar00sergiosergio000000 000000 @implementation CocoaCheckLabel : NSButton -(id) initWith:(phoenix::CheckLabel&)checkLabelReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { checkLabel = &checkLabelReference; [self setTarget:self]; [self setAction:@selector(activate:)]; [self setButtonType:NSSwitchButton]; } return self; } -(IBAction) activate:(id)sender { checkLabel->state.checked = [self state] != NSOffState; if(checkLabel->onToggle) checkLabel->onToggle(); } @end namespace phoenix { Size pCheckLabel::minimumSize() { Size size = Font::size(checkLabel.font(), checkLabel.state.text); return {size.width + 20, size.height}; } void pCheckLabel::setChecked(bool checked) { @autoreleasepool { [cocoaView setState:checked ? NSOnState : NSOffState]; } } void pCheckLabel::setGeometry(Geometry geometry) { pWidget::setGeometry({ geometry.x - 2, geometry.y, geometry.width + 4, geometry.height }); } void pCheckLabel::setText(string text) { @autoreleasepool { [cocoaView setTitle:[NSString stringWithUTF8String:text]]; } } void pCheckLabel::constructor() { @autoreleasepool { cocoaView = cocoaCheckLabel = [[CocoaCheckLabel alloc] initWith:checkLabel]; setChecked(checkLabel.state.checked); setText(checkLabel.state.text); } } void pCheckLabel::destructor() { @autoreleasepool { [cocoaView release]; } } } ananke/heuristics/game-boy-advance.hpp000664 001750 001750 00000004165 12651764221 021145 0ustar00sergiosergio000000 000000 #ifndef NALL_EMULATION_GAME_BOY_ADVANCE_HPP #define NALL_EMULATION_GAME_BOY_ADVANCE_HPP #include #include #include namespace nall { struct GameBoyAdvanceCartridge { string markup; string identifiers; inline GameBoyAdvanceCartridge(const uint8_t *data, unsigned size); }; GameBoyAdvanceCartridge::GameBoyAdvanceCartridge(const uint8_t *data, unsigned size) { struct Identifier { string name; unsigned size; }; vector idlist; idlist.append({"SRAM_V", 6}); idlist.append({"SRAM_F_V", 8}); idlist.append({"EEPROM_V", 8}); idlist.append({"FLASH_V", 7}); idlist.append({"FLASH512_V", 10}); idlist.append({"FLASH1M_V", 9}); lstring list; for(auto &id : idlist) { for(signed n = 0; n < size - 16; n++) { if(!memcmp(data + n, (const char*)id.name, id.size)) { const char *p = (const char*)data + n + id.size; if(p[0] >= '0' && p[0] <= '9' && p[1] >= '0' && p[1] <= '9' && p[2] >= '0' && p[2] <= '9' ) { char text[16]; memcpy(text, data + n, id.size + 3); text[id.size + 3] = 0; list.appendOnce(text); } } } } identifiers = list.merge(","); markup = ""; markup.append("cartridge\n"); markup.append(" rom name=program.rom size=0x", hex(size), "\n"); if(0); else if(identifiers.beginsWith("SRAM_V" )) markup.append(" ram name=save.ram type=SRAM size=0x8000\n"); else if(identifiers.beginsWith("SRAM_F_V" )) markup.append(" ram name=save.ram type=FRAM size=0x8000\n"); else if(identifiers.beginsWith("EEPROM_V" )) markup.append(" ram name=save.ram type=EEPROM size=0x0\n"); else if(identifiers.beginsWith("FLASH_V" )) markup.append(" ram name=save.ram type=FlashROM size=0x10000\n"); else if(identifiers.beginsWith("FLASH512_V")) markup.append(" ram name=save.ram type=FlashROM size=0x10000\n"); else if(identifiers.beginsWith("FLASH1M_V" )) markup.append(" ram name=save.ram type=FlashROM size=0x20000\n"); //if(identifiers.empty() == false) markup.append(" #detected: ", identifiers, "\n"); } } #endif phoenix/reference/widget/frame.cpp000664 001750 001750 00000000175 12651764221 020404 0ustar00sergiosergio000000 000000 namespace phoenix { void pFrame::setText(string text) { } void pFrame::constructor() { } void pFrame::destructor() { } } phoenix/reference/widget/vertical-scroller.hpp000664 001750 001750 00000000537 12651764221 022755 0ustar00sergiosergio000000 000000 namespace phoenix { struct pVerticalScroller : public pWidget { VerticalScroller& verticalScroller; void setLength(unsigned length); void setPosition(unsigned position); pVerticalScroller(VerticalScroller& verticalScroller) : pWidget(verticalScroller), verticalScroller(verticalScroller) {} void constructor(); void destructor(); }; } shaders/Edge Detection.shader/manifest.bml000664 001750 001750 00000000104 12651764221 021646 0ustar00sergiosergio000000 000000 program filter: linear wrap: edge fragment: edge-detection.fs sfc/cartridge/cartridge.cpp000664 001750 001750 00000016356 12651764221 017112 0ustar00sergiosergio000000 000000 #include #define CARTRIDGE_CPP namespace SuperFamicom { #include "markup.cpp" #include "serialization.cpp" Cartridge cartridge; string Cartridge::title() { if(information.title.gameBoy.empty() == false) { return {information.title.cartridge, " + ", information.title.gameBoy}; } if(information.title.satellaview.empty() == false) { return {information.title.cartridge, " + ", information.title.satellaview}; } if(information.title.sufamiTurboA.empty() == false) { if(information.title.sufamiTurboB.empty() == true) { return {information.title.cartridge, " + ", information.title.sufamiTurboA}; } else { return {information.title.cartridge, " + ", information.title.sufamiTurboA, " + ", information.title.sufamiTurboB}; } } return information.title.cartridge; } void Cartridge::load() { region = Region::NTSC; has_gb_slot = false; has_bs_cart = false; has_bs_slot = false; has_st_slots = false; has_nss_dip = false; has_event = false; has_sa1 = false; has_superfx = false; has_armdsp = false; has_hitachidsp = false; has_necdsp = false; has_epsonrtc = false; has_sharprtc = false; has_spc7110 = false; has_sdd1 = false; has_obc1 = false; has_hsu1 = false; has_msu1 = false; has_dsp1 = false; has_dsp2 = false; has_dsp3 = false; has_dsp4 = false; has_cx4 = false; has_st0010 = false; has_sgbexternal = false; information.markup.cartridge = ""; information.markup.gameBoy = ""; information.markup.satellaview = ""; information.markup.sufamiTurboA = ""; information.markup.sufamiTurboB = ""; information.title.cartridge = ""; information.title.gameBoy = ""; information.title.satellaview = ""; information.title.sufamiTurboA = ""; information.title.sufamiTurboB = ""; interface->loadRequest(ID::Manifest, "manifest.bml"); parse_markup(information.markup.cartridge); //Super Game Boy if(cartridge.has_gb_slot()) { sha256 = nall::sha256(GameBoy::cartridge.romdata, GameBoy::cartridge.romsize); } //Broadcast Satellaview else if(cartridge.has_bs_cart() && cartridge.has_bs_slot()) { sha256 = nall::sha256(satellaviewcartridge.memory.data(), satellaviewcartridge.memory.size()); } //Sufami Turbo else if(cartridge.has_st_slots()) { sha256_ctx sha; uint8_t hash[32]; sha256_init(&sha); sha256_chunk(&sha, sufamiturboA.rom.data(), sufamiturboA.rom.size()); sha256_chunk(&sha, sufamiturboB.rom.data(), sufamiturboB.rom.size()); sha256_final(&sha); sha256_hash(&sha, hash); string result; for(auto& byte : hash) result.append(hex<2>(byte)); sha256 = result; } //Super Famicom else { sha256_ctx sha; uint8_t hash[32]; vector buffer; sha256_init(&sha); //hash each ROM image that exists; any with size() == 0 is ignored by sha256_chunk() sha256_chunk(&sha, rom.data(), rom.size()); sha256_chunk(&sha, bsxcartridge.rom.data(), bsxcartridge.rom.size()); sha256_chunk(&sha, sa1.rom.data(), sa1.rom.size()); sha256_chunk(&sha, superfx.rom.data(), superfx.rom.size()); sha256_chunk(&sha, hitachidsp.rom.data(), hitachidsp.rom.size()); sha256_chunk(&sha, spc7110.prom.data(), spc7110.prom.size()); sha256_chunk(&sha, spc7110.drom.data(), spc7110.drom.size()); sha256_chunk(&sha, sdd1.rom.data(), sdd1.rom.size()); //hash all firmware that exists buffer = armdsp.firmware(); sha256_chunk(&sha, buffer.data(), buffer.size()); buffer = hitachidsp.firmware(); sha256_chunk(&sha, buffer.data(), buffer.size()); buffer = necdsp.firmware(); sha256_chunk(&sha, buffer.data(), buffer.size()); //finalize hash sha256_final(&sha); sha256_hash(&sha, hash); string result; for(auto& byte : hash) result.append(hex<2>(byte)); sha256 = result; } rom.write_protect(true); ram.write_protect(false); system.load(); loaded = true; } void Cartridge::load_super_game_boy() { interface->loadRequest(ID::SuperGameBoyManifest, "manifest.bml"); auto document = Markup::Document(information.markup.gameBoy); information.title.gameBoy = document["information/title"].text(); auto rom = document["cartridge/rom"]; auto ram = document["cartridge/ram"]; GameBoy::cartridge.information.markup = information.markup.gameBoy; GameBoy::cartridge.load(GameBoy::System::Revision::SuperGameBoy); if(rom["name"].exists()) interface->loadRequest(ID::SuperGameBoyROM, rom["name"].data); if(ram["name"].exists()) interface->loadRequest(ID::SuperGameBoyRAM, ram["name"].data); if(ram["name"].exists()) memory.append({ID::SuperGameBoyRAM, ram["name"].data}); } void Cartridge::load_satellaview() { interface->loadRequest(ID::SatellaviewManifest, "manifest.bml"); auto document = Markup::Document(information.markup.satellaview); information.title.satellaview = document["information/title"].text(); auto rom = document["cartridge/rom"]; if(rom["name"].exists()) { unsigned size = numeral(rom["size"].data); satellaviewcartridge.memory.map(allocate(size, 0xff), size); interface->loadRequest(ID::SatellaviewROM, rom["name"].data); satellaviewcartridge.readonly = (rom["type"].text() == "MaskROM"); } } void Cartridge::load_sufami_turbo_a() { interface->loadRequest(ID::SufamiTurboSlotAManifest, "manifest.bml"); auto document = Markup::Document(information.markup.sufamiTurboA); information.title.sufamiTurboA = document["information/title"].text(); auto rom = document["cartridge/rom"]; auto ram = document["cartridge/ram"]; if(rom["name"].exists()) { unsigned size = numeral(rom["size"].data); sufamiturboA.rom.map(allocate(size, 0xff), size); interface->loadRequest(ID::SufamiTurboSlotAROM, rom["name"].data); } if(ram["name"].exists()) { unsigned size = numeral(ram["size"].data); sufamiturboA.ram.map(allocate(size, 0xff), size); interface->loadRequest(ID::SufamiTurboSlotARAM, ram["name"].data); memory.append({ID::SufamiTurboSlotARAM, ram["name"].data}); } if(document["cartridge/linkable"].exists()) { interface->loadRequest(ID::SufamiTurboSlotB, "Sufami Turbo - Slot B", "st"); } } void Cartridge::load_sufami_turbo_b() { interface->loadRequest(ID::SufamiTurboSlotBManifest, "manifest.bml"); auto document = Markup::Document(information.markup.sufamiTurboB); information.title.sufamiTurboB = document["information/title"].text(); auto rom = document["cartridge/rom"]; auto ram = document["cartridge/ram"]; if(rom["name"].exists()) { unsigned size = numeral(rom["size"].data); sufamiturboB.rom.map(allocate(size, 0xff), size); interface->loadRequest(ID::SufamiTurboSlotBROM, rom["name"].data); } if(ram["name"].exists()) { unsigned size = numeral(ram["size"].data); sufamiturboB.ram.map(allocate(size, 0xff), size); interface->loadRequest(ID::SufamiTurboSlotBRAM, ram["name"].data); memory.append({ID::SufamiTurboSlotBRAM, ram["name"].data}); } } void Cartridge::unload() { if(loaded == false) return; system.unload(); rom.reset(); ram.reset(); loaded = false; memory.reset(); } Cartridge::Cartridge() { loaded = false; } Cartridge::~Cartridge() { unload(); } } gba/system/system.cpp000664 001750 001750 00000003175 12651764221 016023 0ustar00sergiosergio000000 000000 #include namespace GameBoyAdvance { #include "bios.cpp" #include "serialization.cpp" BIOS bios; System system; void System::init() { } void System::term() { } void System::power() { bus.power(); player.power(); cpu.power(); ppu.power(); apu.power(); cartridge.power(); scheduler.power(); } void System::load() { string manifest = string::read({interface->path(ID::System), "manifest.bml"}); auto document = Markup::Document(manifest); interface->loadRequest(ID::BIOS, document["system/cpu/rom/name"].data); if(!file::exists({interface->path(ID::System), document["system/cpu/rom/name"].data})) { interface->notify("Error: required Game Boy Advance firmware bios.rom not found.\n"); } serialize_init(); } void System::run() { while(true) { scheduler.enter(); if(scheduler.exit_reason() == Scheduler::ExitReason::FrameEvent) break; } interface->videoRefresh(video.palette, ppu.output, 4 * 240, 240, 160); } void System::runtosave() { scheduler.sync = Scheduler::SynchronizeMode::CPU; runthreadtosave(); scheduler.sync = Scheduler::SynchronizeMode::All; scheduler.active = ppu.thread; runthreadtosave(); scheduler.sync = Scheduler::SynchronizeMode::All; scheduler.active = apu.thread; runthreadtosave(); scheduler.sync = Scheduler::SynchronizeMode::None; } void System::runthreadtosave() { while(true) { scheduler.enter(); if(scheduler.exit_reason() == Scheduler::ExitReason::SynchronizeEvent) break; if(scheduler.exit_reason() == Scheduler::ExitReason::FrameEvent) { interface->videoRefresh(video.palette, ppu.output, 4 * 240, 240, 160); } } } } gb/apu/noise/noise.hpp000664 001750 001750 00000000723 12651764221 016032 0ustar00sergiosergio000000 000000 struct Noise { bool enable; uint4 envelope_volume; bool envelope_direction; uint3 envelope_frequency; uint4 frequency; bool narrow_lfsr; unsigned divisor; bool counter; int16 output; uint6 length; uint3 envelope_period; uint4 volume; unsigned period; uint15 lfsr; bool dac_enable(); void run(); void clock_length(); void clock_envelope(); void write(unsigned r, uint8 data); void power(); void serialize(serializer&); }; target-ethos/input/input.hpp000664 001750 001750 00000003514 12651764221 017330 0ustar00sergiosergio000000 000000 extern HID::Null hidNull; struct AbstractInput { string name; string mapping; bool logic = 0; //0 = OR, 1 = AND bool state = 0; struct Input { HID::Device* device = nullptr; uint64_t id = 0; unsigned group = 0; unsigned input = 0; enum class Qualifier : unsigned { None, Lo, Hi } qualifier; }; vector inputList; void bind(); bool append(string mapping); virtual bool bind(HID::Device& device, unsigned group, unsigned input, int16_t oldValue, int16_t newValue) { return false; } virtual int16_t poll() { return 0; } virtual void rumble(bool enable) {} }; struct DigitalInput : AbstractInput { using AbstractInput::bind; bool bind(HID::Device& device, unsigned group, unsigned input, int16_t oldValue, int16_t newValue); int16_t poll(); }; struct RelativeInput : AbstractInput { using AbstractInput::bind; bool bind(HID::Device& device, unsigned group, unsigned input, int16_t oldValue, int16_t newValue); int16_t poll(); }; struct RumbleInput : AbstractInput { using AbstractInput::bind; bool bind(HID::Device& device, unsigned group, unsigned input, int16_t oldValue, int16_t newValue); void rumble(bool enable); }; struct HotkeyInput : DigitalInput { function press; function release; HotkeyInput(); }; struct InputManager { vector devices; vector inputMap; vector hotkeyMap; string sanitize(string mapping, string concatenate) const; void onChange(HID::Device& device, unsigned group, unsigned input, int16_t oldValue, int16_t newValue); HID::Device* findMouse(); void bind(); void poll(); void saveConfiguration(); void bootstrap(); InputManager(); //hotkeys.cpp void appendHotkeys(); void pollHotkeys(); private: Configuration::Document config; }; extern InputManager* inputManager; fc/cartridge/chip/mmc3.cpp000664 001750 001750 00000010356 12651764221 016537 0ustar00sergiosergio000000 000000 struct MMC3 : Chip { bool chr_mode; bool prg_mode; uint3 bank_select; uint8 prg_bank[2]; uint8 chr_bank[6]; bool mirror; bool ram_enable; bool ram_write_protect; uint8 irq_latch; uint8 irq_counter; bool irq_enable; unsigned irq_delay; bool irq_line; uint16 chr_abus; void main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(irq_delay) irq_delay--; cpu.set_irq_line(irq_line); tick(); } } void irq_test(unsigned addr) { if(!(chr_abus & 0x1000) && (addr & 0x1000)) { if(irq_delay == 0) { if(irq_counter == 0) { irq_counter = irq_latch; } else if(--irq_counter == 0) { if(irq_enable) irq_line = 1; } } irq_delay = 6; } chr_abus = addr; } unsigned prg_addr(unsigned addr) const { switch((addr >> 13) & 3) { case 0: if(prg_mode == 1) return (0x3e << 13) | (addr & 0x1fff); return (prg_bank[0] << 13) | (addr & 0x1fff); case 1: return (prg_bank[1] << 13) | (addr & 0x1fff); case 2: if(prg_mode == 0) return (0x3e << 13) | (addr & 0x1fff); return (prg_bank[0] << 13) | (addr & 0x1fff); case 3: return (0x3f << 13) | (addr & 0x1fff); } } unsigned chr_addr(unsigned addr) const { if(chr_mode == 0) { if(addr <= 0x07ff) return (chr_bank[0] << 10) | (addr & 0x07ff); if(addr <= 0x0fff) return (chr_bank[1] << 10) | (addr & 0x07ff); if(addr <= 0x13ff) return (chr_bank[2] << 10) | (addr & 0x03ff); if(addr <= 0x17ff) return (chr_bank[3] << 10) | (addr & 0x03ff); if(addr <= 0x1bff) return (chr_bank[4] << 10) | (addr & 0x03ff); if(addr <= 0x1fff) return (chr_bank[5] << 10) | (addr & 0x03ff); } else { if(addr <= 0x03ff) return (chr_bank[2] << 10) | (addr & 0x03ff); if(addr <= 0x07ff) return (chr_bank[3] << 10) | (addr & 0x03ff); if(addr <= 0x0bff) return (chr_bank[4] << 10) | (addr & 0x03ff); if(addr <= 0x0fff) return (chr_bank[5] << 10) | (addr & 0x03ff); if(addr <= 0x17ff) return (chr_bank[0] << 10) | (addr & 0x07ff); if(addr <= 0x1fff) return (chr_bank[1] << 10) | (addr & 0x07ff); } } unsigned ciram_addr(unsigned addr) const { if(mirror == 0) return ((addr & 0x0400) >> 0) | (addr & 0x03ff); if(mirror == 1) return ((addr & 0x0800) >> 1) | (addr & 0x03ff); } uint8 ram_read(unsigned addr) { if(ram_enable) return board.prgram.data[addr & 0x1fff]; return 0x00; } void ram_write(unsigned addr, uint8 data) { if(ram_enable && !ram_write_protect) board.prgram.data[addr & 0x1fff] = data; } void reg_write(unsigned addr, uint8 data) { switch(addr & 0xe001) { case 0x8000: chr_mode = data & 0x80; prg_mode = data & 0x40; bank_select = data & 0x07; break; case 0x8001: switch(bank_select) { case 0: chr_bank[0] = data & ~1; break; case 1: chr_bank[1] = data & ~1; break; case 2: chr_bank[2] = data; break; case 3: chr_bank[3] = data; break; case 4: chr_bank[4] = data; break; case 5: chr_bank[5] = data; break; case 6: prg_bank[0] = data & 0x3f; break; case 7: prg_bank[1] = data & 0x3f; break; } break; case 0xa000: mirror = data & 0x01; break; case 0xa001: ram_enable = data & 0x80; ram_write_protect = data & 0x40; break; case 0xc000: irq_latch = data; break; case 0xc001: irq_counter = 0; break; case 0xe000: irq_enable = false; irq_line = 0; break; case 0xe001: irq_enable = true; break; } } void power() { } void reset() { chr_mode = 0; prg_mode = 0; bank_select = 0; prg_bank[0] = 0; prg_bank[1] = 0; chr_bank[0] = 0; chr_bank[1] = 0; chr_bank[2] = 0; chr_bank[3] = 0; chr_bank[4] = 0; chr_bank[5] = 0; mirror = 0; ram_enable = 1; ram_write_protect = 0; irq_latch = 0; irq_counter = 0; irq_enable = false; irq_delay = 0; irq_line = 0; chr_abus = 0; } void serialize(serializer& s) { s.integer(chr_mode); s.integer(prg_mode); s.integer(bank_select); s.array(prg_bank); s.array(chr_bank); s.integer(mirror); s.integer(ram_enable); s.integer(ram_write_protect); s.integer(irq_latch); s.integer(irq_counter); s.integer(irq_enable); s.integer(irq_delay); s.integer(irq_line); s.integer(chr_abus); } MMC3(Board& board) : Chip(board) { } }; gb/apu/master/000700 001750 001750 00000000000 12656700342 014343 5ustar00sergiosergio000000 000000 changes.diff000664 001750 001750 00000204671 12651764221 014164 0ustar00sergiosergio000000 000000 Only in bsneshle094/ananke/obj: .gitignore Only in bsneshle094: changes.diff Only in bsneshle094: changes-libretro.diff Only in bsneshle094: diff.sh Only in bsneshle094: e.log diff -ru higan_v094-source/emulator/emulator.hpp bsneshle094/emulator/emulator.hpp --- higan_v094-source/emulator/emulator.hpp 2014-01-20 07:36:22.000000000 +0100 +++ bsneshle094/emulator/emulator.hpp 2014-04-26 16:20:16.498065832 +0200 @@ -143,7 +143,7 @@ typedef uint30_t uint30; typedef uint31_t uint31; typedef uint32_t uint32; -typedef uint_t<33> uint33; +typedef nall::uint_t<33> uint33; typedef uint64_t uint64; typedef varuint_t varuint; diff -ru higan_v094-source/emulator/interface.hpp bsneshle094/emulator/interface.hpp --- higan_v094-source/emulator/interface.hpp 2013-12-23 08:39:57.000000000 +0100 +++ bsneshle094/emulator/interface.hpp 2014-08-19 14:54:43.757727345 +0200 @@ -59,6 +59,7 @@ virtual string path(unsigned) { return ""; } virtual string server() { return ""; } virtual void notify(string text) { print(text, "\n"); } + virtual unsigned altImplementation(unsigned) { return 0; } }; Bind* bind = nullptr; Only in bsneshle094: .git Only in bsneshle094: install.sh Only in higan_v094-source: libco Only in bsneshle094: libretro-sdk Only in bsneshle094: LICENSE diff -ru higan_v094-source/Makefile bsneshle094/Makefile --- higan_v094-source/Makefile 2013-10-20 14:39:14.000000000 +0200 +++ bsneshle094/Makefile 2015-06-25 17:48:26.523991971 +0200 @@ -1,20 +1,40 @@ include nall/Makefile +ifeq ($(platform),win) + override platform = windows +else ifeq ($(platform),mingw) + override platform = windows +else ifeq ($(platform),osx) + override platform = macosx +else ifeq ($(platform),unix) + override platform = linux +else ifeq ($(platform),x) + override platform = linux +endif + fc := fc sfc := sfc gb := gb gba := gba profile := accuracy -target := ethos +target := libretro # options += debugger # arch := x86 # console := true # compiler -flags += -I. -O3 -fomit-frame-pointer -link += + +ifneq ($(debug),) + flags := -I. -O0 -g +else + flags := -I. -O3 -fomit-frame-pointer +endif + +cflags := -std=gnu99 -xc +cppflags := -std=gnu++0x + objects := libco # profile-guided optimization mode @@ -28,34 +48,64 @@ flags += -fprofile-use endif -# platform -ifeq ($(platform),windows) - ifeq ($(arch),x86) - flags += -m32 - link += -m32 - endif - ifeq ($(console),true) - link += -mconsole +ifeq ($(compiler),) + ifneq ($(CXX),) + compiler := $(CXX) else - link += -mwindows + compiler := g++ endif - link += -s -mthreads -luuid -lkernel32 -luser32 -lgdi32 -lcomctl32 -lcomdlg32 -lshell32 -lole32 -lws2_32 - link += -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -else ifeq ($(platform),macosx) - flags += -march=native -else ifeq ($(platform),linux) - flags += -march=native - link += -s -Wl,-export-dynamic -lX11 -lXext -ldl -else ifeq ($(platform),bsd) - flags += -march=native - link += -s -Wl,-export-dynamic -lX11 -lXext -else - $(error unsupported platform.) endif +# platform ui := target-$(target) +ifeq ($(findstring libretro,$(ui)),) + ifeq ($(platform),windows) + ifeq ($(arch),x86) + flags += -m32 + link += -m32 + endif + ifeq ($(console),true) + link += -mconsole + else + link += -mwindows + endif + link += -mthreads -luuid -lkernel32 -luser32 -lgdi32 -lcomctl32 -lcomdlg32 -lshell32 -lole32 -lws2_32 + link += -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc + else ifeq ($(platform),macosx) + flags += -march=native + else ifeq ($(platform),linux) + flags += -march=native + link += -Wl,-export-dynamic -lX11 -lXext -ldl + else ifeq ($(platform),bsd) + flags += -march=native + link += -Wl,-export-dynamic -lX11 -lXext + else + $(error unsupported platform.) + endif +endif + +ifeq ($(platform),macosx) + ifndef ($(NOUNIVERSAL)) + flags += $(ARCHFLAGS) + link += $(ARCHFLAGS) + endif +endif + + # implicit rules +compile-profile = \ + $(strip \ + $(if $(filter %.c,$<), \ + $(compiler) $(cflags) $(flags) $(profflags) $1 -c $< -o $@, \ + $(if $(filter %.cpp,$<), \ + $(compiler) $(cppflags) $(flags) $(profflags) $1 -c $< -o $@ \ + ) \ + ) \ + ) + +%-$(profile).o: $<; $(call compile-profile) + compile = \ $(strip \ $(if $(filter %.c,$<), \ @@ -107,3 +157,9 @@ endif help:; + +#this must be last because other things may have altered $(flags) +ifneq ($(lto),) + flags += -flto + link += $(flags) +endif Only in bsneshle094: make.sh diff -ru higan_v094-source/nall/directory.hpp bsneshle094/nall/directory.hpp --- higan_v094-source/nall/directory.hpp 2014-01-20 07:37:12.000000000 +0100 +++ bsneshle094/nall/directory.hpp 2015-02-21 10:47:18.286028379 +0100 @@ -187,7 +187,7 @@ struct dirent* ep; dp = opendir(pathname); if(dp) { - while(ep = readdir(dp)) { + while((ep = readdir(dp))) { if(!strcmp(ep->d_name, ".")) continue; if(!strcmp(ep->d_name, "..")) continue; bool is_directory = ep->d_type & DT_DIR; @@ -212,7 +212,7 @@ struct dirent* ep; dp = opendir(pathname); if(dp) { - while(ep = readdir(dp)) { + while((ep = readdir(dp))) { if(!strcmp(ep->d_name, ".")) continue; if(!strcmp(ep->d_name, "..")) continue; if((ep->d_type & DT_DIR) == 0) { diff -ru higan_v094-source/nall/dsp/core.hpp bsneshle094/nall/dsp/core.hpp --- higan_v094-source/nall/dsp/core.hpp 2014-01-20 07:37:12.000000000 +0100 +++ bsneshle094/nall/dsp/core.hpp 2015-02-21 10:47:18.286028379 +0100 @@ -19,6 +19,7 @@ virtual void clear() = 0; virtual void sample() = 0; Resampler(DSP& dsp) : dsp(dsp) {} + virtual ~Resampler() {} }; struct DSP { diff -ru higan_v094-source/nall/dsp/resample/lib/sinc.hpp bsneshle094/nall/dsp/resample/lib/sinc.hpp --- higan_v094-source/nall/dsp/resample/lib/sinc.hpp 2014-01-20 07:37:12.000000000 +0100 +++ bsneshle094/nall/dsp/resample/lib/sinc.hpp 2015-02-21 10:47:18.286028379 +0100 @@ -11,8 +11,11 @@ #if defined(__SSE__) #define SINCRESAMPLE_USE_SSE 1 #ifndef __x86_64__ - #undef RESAMPLE_SSEREGPARM - #define RESAMPLE_SSEREGPARM __attribute__((sseregparm)) + // clang may not have this extension (Apple's certainly doesn't) + #ifndef __clang__ + #undef RESAMPLE_SSEREGPARM + #define RESAMPLE_SSEREGPARM __attribute__((sseregparm)) + #endif #endif #else // TODO: altivec here diff -ru higan_v094-source/nall/file.hpp bsneshle094/nall/file.hpp --- higan_v094-source/nall/file.hpp 2014-01-20 07:37:12.000000000 +0100 +++ bsneshle094/nall/file.hpp 2015-02-21 10:47:18.286028379 +0100 @@ -9,6 +9,10 @@ #include #include +#ifdef __APPLE__ +#include "TargetConditionals.h" +#endif + namespace nall { inline FILE* fopen_utf8(const string& filename, const string& mode) { @@ -191,10 +195,14 @@ uintmax_t req_offset = file_offset; switch(index_) { case index::absolute: req_offset = offset; break; - case index::relative: req_offset += offset; break; + case index::relative: + if (offset < 0 && -offset > req_offset) + req_offset = 0; //cannot seek before start of file + else + req_offset += offset; + break; } - if(req_offset < 0) req_offset = 0; //cannot seek before start of file if(req_offset > file_size) { if(file_mode == mode::read) { //cannot seek past end of file req_offset = file_size; @@ -232,7 +240,10 @@ } static bool exists(const string& filename) { - #if !defined(_WIN32) + #if defined(__APPLE__) && TARGET_OS_IPHONE + struct stat data; + if(stat(filename, &data) != 0) return false; + #elif !defined(_WIN32) struct stat data; if(stat(filename, &data) != 0) return false; #else @@ -244,7 +255,10 @@ } static uintmax_t size(const string& filename) { - #if !defined(_WIN32) + #if defined(__APPLE__) && TARGET_OS_IPHONE + struct stat data; + if(stat(filename, &data) != 0) return false; + #elif !defined(_WIN32) struct stat data; stat(filename, &data); #else @@ -255,7 +269,10 @@ } static time_t timestamp(const string& filename, file::time mode = file::time::create) { - #if !defined(_WIN32) + #if defined(__APPLE__) && TARGET_OS_IPHONE + struct stat data; + if(stat(filename, &data) != 0) return false; + #elif !defined(_WIN32) struct stat data; stat(filename, &data); #else diff -ru higan_v094-source/nall/intrinsics.hpp bsneshle094/nall/intrinsics.hpp --- higan_v094-source/nall/intrinsics.hpp 2014-01-20 07:37:12.000000000 +0100 +++ bsneshle094/nall/intrinsics.hpp 2014-05-27 22:37:16.697326984 +0200 @@ -6,7 +6,7 @@ struct Intrinsics { enum class Compiler : unsigned { Clang, GCC, VisualCPP, Unknown }; enum class Platform : unsigned { Windows, MacOSX, X, Unknown }; //X = Linux, BSD, etc - enum class Architecture : unsigned { x86, amd64, Unknown }; + enum class Architecture : unsigned { x86, amd64, ARM, Unknown }; enum class Endian : unsigned { LSB, MSB, Unknown }; static inline Compiler compiler(); @@ -57,6 +57,9 @@ #elif defined(__amd64__) || defined(_M_AMD64) #define ARCH_AMD64 Intrinsics::Architecture Intrinsics::architecture() { return Intrinsics::Architecture::amd64; } +#elif defined(__arm__) || defined(__ARM_EABI__) + #define ARCH_ARM + Intrinsics::Architecture Intrinsics::architecture() { return Intrinsics::Architecture::ARM; } #else #warning "unable to detect architecture" #define ARCH_UNKNOWN @@ -65,7 +68,7 @@ /* Endian detection */ -#if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__) || defined(__i386__) || defined(__amd64__) || defined(_M_IX86) || defined(_M_AMD64) +#if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__) || defined(__i386__) || defined(__amd64__) || defined(_M_IX86) || defined(_M_AMD64) || defined(__ARM_EABI__) || defined(__arm__) #define ENDIAN_LSB Intrinsics::Endian Intrinsics::endian() { return Intrinsics::Endian::LSB; } #elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && __BYTE_ORDER == __BIG_ENDIAN) || defined(__BIG_ENDIAN__) || defined(__powerpc__) || defined(_M_PPC) diff -ru higan_v094-source/nall/Makefile bsneshle094/nall/Makefile --- higan_v094-source/nall/Makefile 2014-01-20 07:37:12.000000000 +0100 +++ bsneshle094/nall/Makefile 2015-04-23 17:11:57.475859018 +0200 @@ -6,6 +6,7 @@ [a-z] = a b c d e f g h i j k l m n o p q r s t u v w x y z [0-9] = 0 1 2 3 4 5 6 7 8 9 [markup] = ` ~ ! @ \# $$ % ^ & * ( ) - _ = + [ { ] } \ | ; : ' " , < . > / ? +# Some editors need this for proper syntax highlighting: ' [all] = $([A-Z]) $([a-z]) $([0-9]) $([markup]) [space] := [space] += @@ -15,25 +16,27 @@ uname := $(shell uname -s) ifeq ($(uname),) platform := windows - delete = del $(subst /,\,$1) else ifneq ($(findstring Windows,$(uname)),) platform := windows - delete = del $(subst /,\,$1) else ifneq ($(findstring CYGWIN,$(uname)),) platform := windows - delete = del $(subst /,\,$1) + else ifneq ($(findstring MINGW,$(uname)),) + platform := windows else ifneq ($(findstring Darwin,$(uname)),) platform := macosx - delete = rm -f $1 else ifneq ($(findstring BSD,$(uname)),) platform := bsd - delete = rm -f $1 else platform := linux - delete = rm -f $1 endif endif +ifeq ($(platform),windows) + delete = del /F /Q $(subst /,\,$1) +else + delete = rm -f $1 +endif + # compiler detection ifeq ($(compiler),) ifeq ($(platform),windows) diff -ru higan_v094-source/nall/platform.hpp bsneshle094/nall/platform.hpp --- higan_v094-source/nall/platform.hpp 2014-01-20 07:37:12.000000000 +0100 +++ bsneshle094/nall/platform.hpp 2014-11-14 23:01:04.933698821 +0100 @@ -41,7 +41,11 @@ #undef interface #define dllexport __declspec(dllexport) #else +#ifdef __APPLE__ + #include +#else #include +#endif #include #include #define dllexport diff -ru higan_v094-source/nall/string/char/convert.hpp bsneshle094/nall/string/char/convert.hpp --- higan_v094-source/nall/string/char/convert.hpp 2014-01-20 07:37:13.000000000 +0100 +++ bsneshle094/nall/string/char/convert.hpp 2015-02-21 10:47:18.286028379 +0100 @@ -30,6 +30,7 @@ if(quoted == false && *s >= 'A' && *s <= 'Z') *s += 0x20; s++; } + return s; } char* qstrupper(char* s) { @@ -40,6 +41,7 @@ if(quoted == false && *s >= 'a' && *s <= 'z') *s -= 0x20; s++; } + return s; } char* strtr(char* dest, const char* before, const char* after) { diff -ru higan_v094-source/nall/string/eval/evaluator.hpp bsneshle094/nall/string/eval/evaluator.hpp --- higan_v094-source/nall/string/eval/evaluator.hpp 2014-01-20 07:37:13.000000000 +0100 +++ bsneshle094/nall/string/eval/evaluator.hpp 2015-02-21 10:47:18.286028379 +0100 @@ -31,10 +31,9 @@ } return result.rtrim<1>(", ").append(")"); } + default: throw "invalid operator"; } #undef p - - throw "invalid operator"; } inline int64_t evaluateInteger(Node* node) { @@ -87,10 +86,9 @@ case Node::Type::AssignBitwiseAnd: return p(0) & p(1); case Node::Type::AssignBitwiseOr: return p(0) | p(1); case Node::Type::AssignBitwiseXor: return p(0) ^ p(1); + default: throw "invalid operator"; } #undef p - - throw "invalid operator"; } inline optional integer(const string& expression) { @@ -132,10 +130,10 @@ case Node::Type::AssignDivide: return p(0) / p(1); case Node::Type::AssignAdd: return p(0) + p(1); case Node::Type::AssignSubtract: return p(0) - p(1); + default: throw "invalid operator"; } #undef p - throw "invalid operator"; } inline optional real(const string& expression) { diff -ru higan_v094-source/nall/string/markup/node.hpp bsneshle094/nall/string/markup/node.hpp --- higan_v094-source/nall/string/markup/node.hpp 2014-01-20 07:37:13.000000000 +0100 +++ bsneshle094/nall/string/markup/node.hpp 2015-02-21 10:47:18.286028379 +0100 @@ -59,6 +59,7 @@ case Comparator::LE: side = rule.split<1>("<="); break; case Comparator::GT: side = rule.split<1> (">"); break; case Comparator::GE: side = rule.split<1>(">="); break; + default: break; } string data = text(); @@ -75,8 +76,10 @@ case Comparator::LE: if(numeral(data) <= numeral(side(1))) continue; break; case Comparator::GT: if(numeral(data) > numeral(side(1))) continue; break; case Comparator::GE: if(numeral(data) >= numeral(side(1))) continue; break; + default: break; } + // NOT REACHED return false; } Only in bsneshle094/obj: gb-apu.o Only in bsneshle094/obj: gb-cartridge.o Only in bsneshle094/obj: gb-cheat.o Only in bsneshle094/obj: gb-cpu.o Only in bsneshle094/obj: gb-interface.o Only in bsneshle094/obj: gb-memory.o Only in bsneshle094/obj: gb-ppu.o Only in bsneshle094/obj: gb-scheduler.o Only in bsneshle094/obj: gb-system.o Only in bsneshle094/obj: gb-video.o Only in bsneshle094/obj: .gitignore Only in bsneshle094/obj: libco.o Only in bsneshle094/obj: libretro-accuracy.o Only in bsneshle094/obj: processor-arm.o Only in bsneshle094/obj: processor-gsu.o Only in bsneshle094/obj: processor-hg51b.o Only in bsneshle094/obj: processor-lr35902.o Only in bsneshle094/obj: processor-r65816.o Only in bsneshle094/obj: processor-spc700.o Only in bsneshle094/obj: processor-upd96050.o Only in bsneshle094/obj: sfc-armdsp-accuracy.o Only in bsneshle094/obj: sfc-bsx-accuracy.o Only in bsneshle094/obj: sfc-cartridge-accuracy.o Only in bsneshle094/obj: sfc-cheat-accuracy.o Only in bsneshle094/obj: sfc-controller-accuracy.o Only in bsneshle094/obj: sfc-cpu-accuracy.o Only in bsneshle094/obj: sfc-dsp-accuracy.o Only in bsneshle094/obj: sfc-epsonrtc-accuracy.o Only in bsneshle094/obj: sfc-event-accuracy.o Only in bsneshle094/obj: sfc-hitachidsp-accuracy.o Only in bsneshle094/obj: sfc-hlecx4-accuracy.o Only in bsneshle094/obj: sfc-hledsp1-accuracy.o Only in bsneshle094/obj: sfc-hledsp2-accuracy.o Only in bsneshle094/obj: sfc-hledsp3-accuracy.o Only in bsneshle094/obj: sfc-hledsp4-accuracy.o Only in bsneshle094/obj: sfc-hlest0010-accuracy.o Only in bsneshle094/obj: sfc-hsu1-accuracy.o Only in bsneshle094/obj: sfc-icd2-accuracy.o Only in bsneshle094/obj: sfc-interface-accuracy.o Only in bsneshle094/obj: sfc-memory-accuracy.o Only in bsneshle094/obj: sfc-msu1-accuracy.o Only in bsneshle094/obj: sfc-necdsp-accuracy.o Only in bsneshle094/obj: sfc-nss-accuracy.o Only in bsneshle094/obj: sfc-obc1-accuracy.o Only in bsneshle094/obj: sfc-ppu-accuracy.o Only in bsneshle094/obj: sfc-sa1-accuracy.o Only in bsneshle094/obj: sfc-satellaviewbase-accuracy.o Only in bsneshle094/obj: sfc-satellaviewcart-accuracy.o Only in bsneshle094/obj: sfc-sdd1-accuracy.o Only in bsneshle094/obj: sfc-sgbexternal-accuracy.o Only in bsneshle094/obj: sfc-sharprtc-accuracy.o Only in bsneshle094/obj: sfc-smp-accuracy.o Only in bsneshle094/obj: sfc-spc7110-accuracy.o Only in bsneshle094/obj: sfc-sufamiturbo-accuracy.o Only in bsneshle094/obj: sfc-superfx-accuracy.o Only in bsneshle094/obj: sfc-system-accuracy.o Only in bsneshle094/out: bsnes_mercury_accuracy_libretro.so Only in bsneshle094/out: .gitignore Only in bsneshle094/out: libsupergameboy.so diff -ru higan_v094-source/processor/arm/algorithms.cpp bsneshle094/processor/arm/algorithms.cpp --- higan_v094-source/processor/arm/algorithms.cpp 2012-04-15 03:34:45.000000000 +0200 +++ bsneshle094/processor/arm/algorithms.cpp 2015-02-21 10:47:18.286028379 +0100 @@ -17,6 +17,9 @@ case 14: return true; //AL (always) case 15: return false; //NV (never) } + + // NOT REACHED + return false; } uint32 ARM::bit(uint32 result) { @@ -59,7 +62,7 @@ carryout() = cpsr().c; if(shift == 0) return source; - carryout() = shift > 32 ? 0 : source & (1 << 32 - shift); + carryout() = shift > 32 ? 0 : source & (1 << (32 - shift)); source = shift > 31 ? 0 : source << shift; return source; } @@ -68,7 +71,7 @@ carryout() = cpsr().c; if(shift == 0) return source; - carryout() = shift > 32 ? 0 : source & (1 << shift - 1); + carryout() = shift > 32 ? 0 : source & (1 << (shift - 1)); source = shift > 31 ? 0 : source >> shift; return source; } @@ -77,7 +80,7 @@ carryout() = cpsr().c; if(shift == 0) return source; - carryout() = shift > 32 ? source & (1 << 31) : source & (1 << shift - 1); + carryout() = shift > 32 ? source & (1 << 31) : source & (1 << (shift - 1)); source = shift > 31 ? (int32)source >> 31 : (int32)source >> shift; return source; } @@ -86,8 +89,8 @@ carryout() = cpsr().c; if(shift == 0) return source; - if(shift &= 31) - source = source << 32 - shift | source >> shift; + if((shift &= 31)) + source = source << (32 - shift) | source >> shift; carryout() = source & (1 << 31); return source; } diff -ru higan_v094-source/processor/arm/instructions-arm.cpp bsneshle094/processor/arm/instructions-arm.cpp --- higan_v094-source/processor/arm/instructions-arm.cpp 2013-05-05 07:00:41.000000000 +0200 +++ bsneshle094/processor/arm/instructions-arm.cpp 2015-02-21 10:47:18.286028379 +0100 @@ -441,7 +441,7 @@ if(mode == 0 ) rm = lsl(rm, rs < 33 ? rs : 33); if(mode == 1 ) rm = lsr(rm, rs < 33 ? rs : 33); if(mode == 2 ) rm = asr(rm, rs < 32 ? rs : 32); - if(mode == 3 && rs) rm = ror(rm, rs & 31 == 0 ? 32 : rs & 31); + if(mode == 3 && rs) rm = ror(rm, (rs & 31) == 0 ? 32 : rs & 31); arm_opcode(rm); } diff -ru higan_v094-source/processor/r65816/opcode_misc.cpp bsneshle094/processor/r65816/opcode_misc.cpp --- higan_v094-source/processor/r65816/opcode_misc.cpp 2012-04-28 10:17:50.000000000 +0200 +++ bsneshle094/processor/r65816/opcode_misc.cpp 2015-02-21 10:47:18.286028379 +0100 @@ -70,7 +70,7 @@ } void R65816::op_stp() { - while(regs.wai = true) { + while((regs.wai = true)) { L op_io(); } } Only in bsneshle094: README diff -ru higan_v094-source/sfc/alt/cpu/cpu.cpp bsneshle094/sfc/alt/cpu/cpu.cpp --- higan_v094-source/sfc/alt/cpu/cpu.cpp 2013-05-05 08:00:10.000000000 +0200 +++ bsneshle094/sfc/alt/cpu/cpu.cpp 2014-05-03 20:02:34.275109688 +0200 @@ -99,9 +99,9 @@ reader = [](unsigned addr) { return cpu.wram[addr]; }; writer = [](unsigned addr, uint8 data) { cpu.wram[addr] = data; }; - bus.map(reader, writer, 0x00, 0x3f, 0x0000, 0x1fff, 0x002000); - bus.map(reader, writer, 0x80, 0xbf, 0x0000, 0x1fff, 0x002000); - bus.map(reader, writer, 0x7e, 0x7f, 0x0000, 0xffff, 0x020000); + bus.map(reader, writer, 0x00, 0x3f, 0x0000, 0x1fff, 0x002000, 0,0, Cartridge::Mapping::fastmode_readwrite, cpu.wram); + bus.map(reader, writer, 0x80, 0xbf, 0x0000, 0x1fff, 0x002000, 0,0, Cartridge::Mapping::fastmode_readwrite, cpu.wram); + bus.map(reader, writer, 0x7e, 0x7f, 0x0000, 0xffff, 0x020000, 0,0, Cartridge::Mapping::fastmode_readwrite, cpu.wram); } void CPU::power() { diff -ru higan_v094-source/sfc/alt/ppu-balanced/render/windows.cpp bsneshle094/sfc/alt/ppu-balanced/render/windows.cpp --- higan_v094-source/sfc/alt/ppu-balanced/render/windows.cpp 2013-05-05 08:11:18.000000000 +0200 +++ bsneshle094/sfc/alt/ppu-balanced/render/windows.cpp 2015-02-21 10:47:18.286028379 +0100 @@ -34,7 +34,11 @@ } if(regs.window1_enabled[bg] == true && regs.window2_enabled[bg] == false) { - if(regs.window1_invert[bg] == true) set ^= clr ^= set ^= clr; + if(regs.window1_invert[bg] == true) { + bool tmp = set; + set = clr; + clr = tmp; + } for(unsigned x = 0; x < 256; x++) { table[x] = (x >= window1_left && x <= window1_right) ? set : clr; } @@ -42,7 +46,11 @@ } if(regs.window1_enabled[bg] == false && regs.window2_enabled[bg] == true) { - if(regs.window2_invert[bg] == true) set ^= clr ^= set ^= clr; + if(regs.window2_invert[bg] == true) { + bool tmp = set; + set = clr; + clr = tmp; + } for(unsigned x = 0; x < 256; x++) { table[x] = (x >= window2_left && x <= window2_right) ? set : clr; } diff -ru higan_v094-source/sfc/alt/ppu-performance/cache/cache.cpp bsneshle094/sfc/alt/ppu-performance/cache/cache.cpp --- higan_v094-source/sfc/alt/ppu-performance/cache/cache.cpp 2013-05-05 08:14:41.000000000 +0200 +++ bsneshle094/sfc/alt/ppu-performance/cache/cache.cpp 2015-02-21 10:47:18.286028379 +0100 @@ -109,6 +109,9 @@ case 1: return tile_4bpp(tile); case 2: return tile_8bpp(tile); } + + // NOT REACHED + return 0; } PPU::Cache::Cache(PPU& self) : self(self) { diff -ru higan_v094-source/sfc/alt/ppu-performance/window/window.cpp bsneshle094/sfc/alt/ppu-performance/window/window.cpp --- higan_v094-source/sfc/alt/ppu-performance/window/window.cpp 2013-05-05 08:23:15.000000000 +0200 +++ bsneshle094/sfc/alt/ppu-performance/window/window.cpp 2015-02-21 10:47:18.286028379 +0100 @@ -41,10 +41,10 @@ bool one_mask = (x >= ppu.regs.window_one_left && x <= ppu.regs.window_one_right) ^ one_invert; bool two_mask = (x >= ppu.regs.window_two_left && x <= ppu.regs.window_two_right) ^ two_invert; switch(mask) { - case 0: output[x] = one_mask | two_mask == 1; break; - case 1: output[x] = one_mask & two_mask == 1; break; - case 2: output[x] = one_mask ^ two_mask == 1; break; - case 3: output[x] = one_mask ^ two_mask == 0; break; + case 0: output[x] = (one_mask | two_mask); break; + case 1: output[x] = (one_mask & two_mask); break; + case 2: output[x] = (one_mask ^ two_mask); break; + case 3: output[x] = !(one_mask ^ two_mask); break; } } } @@ -87,10 +87,10 @@ bool one_mask = (x >= ppu.regs.window_one_left && x <= ppu.regs.window_one_right) ^ one_invert; bool two_mask = (x >= ppu.regs.window_two_left && x <= ppu.regs.window_two_right) ^ two_invert; switch(mask) { - case 0: output[x] = one_mask | two_mask == 1 ? set : clr; break; - case 1: output[x] = one_mask & two_mask == 1 ? set : clr; break; - case 2: output[x] = one_mask ^ two_mask == 1 ? set : clr; break; - case 3: output[x] = one_mask ^ two_mask == 0 ? set : clr; break; + case 0: output[x] = (one_mask | two_mask) ? set : clr; break; + case 1: output[x] = (one_mask & two_mask) ? set : clr; break; + case 2: output[x] = (one_mask ^ two_mask) ? set : clr; break; + case 3: output[x] = !(one_mask ^ two_mask) ? set : clr; break; } } } diff -ru higan_v094-source/sfc/cartridge/cartridge.cpp bsneshle094/sfc/cartridge/cartridge.cpp --- higan_v094-source/sfc/cartridge/cartridge.cpp 2013-05-05 08:31:39.000000000 +0200 +++ bsneshle094/sfc/cartridge/cartridge.cpp 2014-08-19 15:44:56.053783897 +0200 @@ -49,6 +49,14 @@ has_hsu1 = false; has_msu1 = false; + has_dsp1 = false; + has_dsp2 = false; + has_dsp3 = false; + has_dsp4 = false; + has_cx4 = false; + has_st0010 = false; + has_sgbexternal = false; + information.markup.cartridge = ""; information.markup.gameBoy = ""; information.markup.satellaview = ""; diff -ru higan_v094-source/sfc/cartridge/cartridge.hpp bsneshle094/sfc/cartridge/cartridge.hpp --- higan_v094-source/sfc/cartridge/cartridge.hpp 2013-01-22 23:52:43.000000000 +0100 +++ bsneshle094/sfc/cartridge/cartridge.hpp 2014-08-19 15:45:47.797784868 +0200 @@ -39,6 +39,13 @@ readonly has_obc1; readonly has_hsu1; readonly has_msu1; + readonly has_dsp1; + readonly has_dsp2; + readonly has_dsp3; + readonly has_dsp4; + readonly has_cx4; + readonly has_st0010; + readonly has_sgbexternal; struct Mapping { function reader; @@ -48,6 +55,9 @@ unsigned base; unsigned mask; + enum fastmode_t { fastmode_slow, fastmode_readonly, fastmode_readwrite } fastmode; + uint8* fastptr; + Mapping(); Mapping(const function&, const function&); Mapping(SuperFamicom::Memory&); @@ -116,6 +126,10 @@ void parse_markup_obc1(Markup::Node); void parse_markup_hsu1(Markup::Node); void parse_markup_msu1(Markup::Node); + + void parse_markup_hitachidsp_hle(Markup::Node); + void parse_markup_necdsp_hle(Markup::Node); + bool parse_markup_icd2_external(Markup::Node); friend class Interface; }; diff -ru higan_v094-source/sfc/cartridge/markup.cpp bsneshle094/sfc/cartridge/markup.cpp --- higan_v094-source/sfc/cartridge/markup.cpp 2013-12-06 21:58:46.000000000 +0100 +++ bsneshle094/sfc/cartridge/markup.cpp 2014-08-19 16:45:00.909851573 +0200 @@ -64,6 +64,8 @@ Mapping m(rom); parse_markup_map(m, node); if(m.size == 0) m.size = rom.size(); + m.fastmode = Mapping::fastmode_readonly; + m.fastptr = rom.data(); mapping.append(m); } @@ -71,6 +73,8 @@ Mapping m(ram); parse_markup_map(m, node); if(m.size == 0) m.size = ram.size(); + m.fastmode = Mapping::fastmode_readwrite; + m.fastptr = ram.data(); mapping.append(m); } } @@ -78,6 +82,10 @@ void Cartridge::parse_markup_icd2(Markup::Node root) { if(root.exists() == false) return; + if(interface->bind->altImplementation(Alt::ForSuperGameBoy)==Alt::SuperGameBoy::External) + { + if (parse_markup_icd2_external(root)) return; + } has_gb_slot = true; icd2.revision = max(1, numeral(root["revision"].data)); @@ -340,6 +348,12 @@ void Cartridge::parse_markup_hitachidsp(Markup::Node root, unsigned roms) { if(root.exists() == false) return; + if(interface->bind->altImplementation(Alt::ForDSP) == Alt::DSP::HLE) + { + //this is after checking existence because we don't want to ask which DSP to use and then use none of them + parse_markup_hitachidsp_hle(root); + return; + } has_hitachidsp = true; parse_markup_memory(hitachidsp.rom, root["rom[0]"], ID::HitachiDSPROM, false); @@ -387,6 +401,11 @@ void Cartridge::parse_markup_necdsp(Markup::Node root) { if(root.exists() == false) return; + if(interface->bind->altImplementation(Alt::ForDSP)==Alt::DSP::HLE) + { + parse_markup_necdsp_hle(root); + return; + } has_necdsp = true; for(auto& word : necdsp.programROM) word = 0x000000; @@ -586,20 +605,112 @@ } } +void Cartridge::parse_markup_hitachidsp_hle(Markup::Node root) { + //root.exists() is known true in the HLE chip handlers + parse_markup_cartridge(root); + + has_cx4 = true; + for(auto& node : root) { + if(node.name != "map" || node["id"].data != "io") continue; + Mapping m({&Cx4::read, &cx4}, {&Cx4::write, &cx4}); + parse_markup_map(m, node); + mapping.append(m); + } +} + +void Cartridge::parse_markup_necdsp_hle(Markup::Node root) { + if (root["model"].data == "uPD7725") { + Mapping m; + unsigned int select=0; + unsigned int * selectaddr=NULL; + for(auto& node : root) { + if (node.name == "rom" && node["id"].data == "program") { + if (node["name"].data == "dsp1.program.rom" || node["name"].data == "dsp1b.program.rom") { + has_dsp1 = true; + m.reader = {&DSP1::read, &dsp1}; + m.writer = {&DSP1::write, &dsp1}; + selectaddr = &dsp1.Select; + } + if (node["name"].data == "dsp2.program.rom") { + has_dsp2 = true; + m.reader = {&DSP2::read, &dsp2}; + m.writer = {&DSP2::write, &dsp2}; + selectaddr = &dsp2.Select; + } + if (node["name"].data == "dsp3.program.rom") { + has_dsp3 = true; + m.reader = {&DSP3::read, &dsp3}; + m.writer = {&DSP3::write, &dsp3}; + //some of the chips hardcode the Select value + } + if (node["name"].data == "dsp4.program.rom") { + has_dsp4 = true; + m.reader = {&DSP4::read, &dsp4}; + m.writer = {&DSP4::write, &dsp4}; + } + } + if (node.name == "map" && node["id"].data == "io") { + parse_markup_map(m, node); + select = numeral(node["select"].data); + } + } + if (selectaddr) *selectaddr=select; + mapping.append(m); + } else { + Mapping m({&ST0010::read, &st0010}, {&ST0010::write, &st0010}); + for(auto& node : root) { + if(node.name != "map") continue; + + parse_markup_map(m, node); + mapping.append(m); + } + } +} + +bool Cartridge::parse_markup_icd2_external(Markup::Node root) { + //root.exists() is known true here + if (!sgbExternal.load_library("/home/alcaro/Desktop/minir/cores/bsnes_v073/supergameboy/libsupergameboy.so")) + { + interface->bind->notify("Couldn't load external GB emulator, falling back to internal"); + return false; + } + + has_sgbexternal = true; + sgbExternal.revision = max(1, numeral(root["revision"].data)); + + GameBoy::cartridge.load_empty(GameBoy::System::Revision::SuperGameBoy); + interface->loadRequest(ID::SuperGameBoy, "Game Boy", "gb"); + + for(auto& node : root) { + if(node.name != "map") continue; + + if(node["id"].data == "io") { + Mapping m({&SGBExternal::read, &sgbExternal}, {&SGBExternal::write, &sgbExternal}); + parse_markup_map(m, node); + mapping.append(m); + } + } + + return true; +} + Cartridge::Mapping::Mapping() { size = base = mask = 0; + fastmode = Mapping::fastmode_slow; } Cartridge::Mapping::Mapping(SuperFamicom::Memory& memory) { reader = {&SuperFamicom::Memory::read, &memory}; writer = {&SuperFamicom::Memory::write, &memory}; size = base = mask = 0; + fastmode = Mapping::fastmode_slow; } Cartridge::Mapping::Mapping(const function& reader, const function& writer) { this->reader = reader; this->writer = writer; size = base = mask = 0; + fastmode = Mapping::fastmode_slow; } #endif diff -ru higan_v094-source/sfc/chip/armdsp/armdsp.cpp bsneshle094/sfc/chip/armdsp/armdsp.cpp --- higan_v094-source/sfc/chip/armdsp/armdsp.cpp 2012-10-15 18:43:08.000000000 +0200 +++ bsneshle094/sfc/chip/armdsp/armdsp.cpp 2015-02-21 10:47:18.286028379 +0100 @@ -39,7 +39,7 @@ } void ArmDSP::step(unsigned clocks) { - if(bridge.timer && --bridge.timer == 0); + if(bridge.timer) --bridge.timer; Coprocessor::step(clocks); synchronize_cpu(); } diff -ru higan_v094-source/sfc/chip/armdsp/memory.cpp bsneshle094/sfc/chip/armdsp/memory.cpp --- higan_v094-source/sfc/chip/armdsp/memory.cpp 2012-04-17 02:47:16.000000000 +0200 +++ bsneshle094/sfc/chip/armdsp/memory.cpp 2015-02-21 10:47:18.286028379 +0100 @@ -15,6 +15,9 @@ case Byte: return memory[addr]; } + + // NOT REACHED + return 0; }; switch(addr & 0xe0000000) { diff -ru higan_v094-source/sfc/chip/bsx/bsx.cpp bsneshle094/sfc/chip/bsx/bsx.cpp --- higan_v094-source/sfc/chip/bsx/bsx.cpp 2013-05-05 08:39:50.000000000 +0200 +++ bsneshle094/sfc/chip/bsx/bsx.cpp 2015-02-21 10:47:18.286028379 +0100 @@ -31,6 +31,9 @@ uint8 BSXCartridge::memory_access(bool write, Memory& memory, unsigned addr, uint8 data) { if(write == 0) return memory_read(memory, addr); memory_write(memory, addr, data); + + // byuu returned nothing here (causing C++ to return 0) + return 0; } uint8 BSXCartridge::memory_read(Memory& memory, unsigned addr) { diff -ru higan_v094-source/sfc/chip/chip.hpp bsneshle094/sfc/chip/chip.hpp --- higan_v094-source/sfc/chip/chip.hpp 2013-01-21 07:09:43.000000000 +0100 +++ bsneshle094/sfc/chip/chip.hpp 2014-08-19 15:29:02.525765996 +0200 @@ -25,6 +25,16 @@ #include #include +#include +#include +#include +#include + +#include +#include + +#include + void Coprocessor::step(unsigned clocks) { clock += clocks * (uint64)cpu.frequency; } Only in bsneshle094/sfc/chip: cx4 Only in bsneshle094/sfc/chip: dsp1 Only in bsneshle094/sfc/chip: dsp2 Only in bsneshle094/sfc/chip: dsp3 Only in bsneshle094/sfc/chip: dsp4 diff -ru higan_v094-source/sfc/chip/epsonrtc/epsonrtc.cpp bsneshle094/sfc/chip/epsonrtc/epsonrtc.cpp --- higan_v094-source/sfc/chip/epsonrtc/epsonrtc.cpp 2013-05-05 08:40:40.000000000 +0200 +++ bsneshle094/sfc/chip/epsonrtc/epsonrtc.cpp 2015-02-21 10:47:18.286028379 +0100 @@ -165,6 +165,9 @@ if(addr == 2) { return ready << 7; } + + // TODO: byuu returned nothing if addr == 3 + return 0; } void EpsonRTC::write(unsigned addr, uint8 data) { diff -ru higan_v094-source/sfc/chip/hitachidsp/memory.cpp bsneshle094/sfc/chip/hitachidsp/memory.cpp --- higan_v094-source/sfc/chip/hitachidsp/memory.cpp 2012-11-06 03:57:30.000000000 +0100 +++ bsneshle094/sfc/chip/hitachidsp/memory.cpp 2015-02-21 10:47:18.290028379 +0100 @@ -38,7 +38,7 @@ addr &= 0x1fff; //Data RAM - if((addr >= 0x0000 && addr <= 0x0bff) || (addr >= 0x1000 && addr <= 0x1bff)) { + if(addr <= 0x0bff || (addr >= 0x1000 && addr <= 0x1bff)) { return dataRAM[addr & 0x0fff]; } @@ -88,7 +88,7 @@ addr &= 0x1fff; //Data RAM - if((addr >= 0x0000 && addr <= 0x0bff) || (addr >= 0x1000 && addr <= 0x1bff)) { + if(addr <= 0x0bff || (addr >= 0x1000 && addr <= 0x1bff)) { dataRAM[addr & 0x0fff] = data; return; } diff -ru higan_v094-source/sfc/chip/msu1/msu1.cpp bsneshle094/sfc/chip/msu1/msu1.cpp --- higan_v094-source/sfc/chip/msu1/msu1.cpp 2013-05-05 08:47:03.000000000 +0200 +++ bsneshle094/sfc/chip/msu1/msu1.cpp 2015-02-21 10:47:18.290028379 +0100 @@ -133,6 +133,9 @@ case 0x2006: return 'U'; case 0x2007: return '1'; } + + // NOT REACHED + return 0; } void MSU1::mmio_write(unsigned addr, uint8 data) { diff -ru higan_v094-source/sfc/chip/sa1/dma/dma.cpp bsneshle094/sfc/chip/sa1/dma/dma.cpp --- higan_v094-source/sfc/chip/sa1/dma/dma.cpp 2013-05-05 08:50:25.000000000 +0200 +++ bsneshle094/sfc/chip/sa1/dma/dma.cpp 2015-02-21 10:47:18.290028379 +0100 @@ -32,16 +32,13 @@ break; } - switch(mmio.dd) { - case DMA::DestBWRAM: + if (mmio.dd == DMA::DestBWRAM) { if((dda & 0x40e000) == 0x006000 || (dda & 0xf00000) == 0x400000) { bus_write(dda, data); } - break; - - case DMA::DestIRAM: + } else { + // mmio.dd == DMA::DestIRAM iram.write(dda & 0x07ff, data); - break; } } diff -ru higan_v094-source/sfc/chip/sa1/memory/memory.cpp bsneshle094/sfc/chip/sa1/memory/memory.cpp --- higan_v094-source/sfc/chip/sa1/memory/memory.cpp 2013-10-20 14:48:17.000000000 +0200 +++ bsneshle094/sfc/chip/sa1/memory/memory.cpp 2015-02-21 10:47:18.290028379 +0100 @@ -99,6 +99,9 @@ if((addr & 0x40f800) == 0x003000) { //$00-3f|80-bf:3000-37ff return iram.read(addr & 2047); } + + // TODO: invalid address, what does real hardware do here? + return 0; } //ROM, I-RAM and MMIO registers are accessed at ~10.74MHz (2 clock ticks) @@ -252,6 +255,9 @@ case 3: return (bwram.read(addr) >> 6) & 3; } } + + // NOT REACHED + return 0; } void SA1::bitmap_write(unsigned addr, uint8 data) { diff -ru higan_v094-source/sfc/chip/sdd1/decomp.cpp bsneshle094/sfc/chip/sdd1/decomp.cpp --- higan_v094-source/sfc/chip/sdd1/decomp.cpp 2013-05-05 08:57:02.000000000 +0200 +++ bsneshle094/sfc/chip/sdd1/decomp.cpp 2015-02-21 10:47:18.290028379 +0100 @@ -253,6 +253,9 @@ } return r1; } + + // NOT REACHED + return 0; } //core Only in bsneshle094/sfc/chip: sgb-external Only in bsneshle094/sfc/chip: st0010 diff -ru higan_v094-source/sfc/chip/superfx/memory/memory.cpp bsneshle094/sfc/chip/superfx/memory/memory.cpp --- higan_v094-source/sfc/chip/superfx/memory/memory.cpp 2012-07-09 06:59:32.000000000 +0200 +++ bsneshle094/sfc/chip/superfx/memory/memory.cpp 2015-02-21 10:47:18.290028379 +0100 @@ -24,6 +24,9 @@ } return ram.read(addr & ram_mask); } + + // TODO: invalid address, what does real hardware do? + return 0; } void SuperFX::bus_write(unsigned addr, uint8 data) { diff -ru higan_v094-source/sfc/controller/controller.cpp bsneshle094/sfc/controller/controller.cpp --- higan_v094-source/sfc/controller/controller.cpp 2012-04-28 12:25:51.000000000 +0200 +++ bsneshle094/sfc/controller/controller.cpp 2015-02-21 10:47:18.290028379 +0100 @@ -33,17 +33,17 @@ } bool Controller::iobit() { - switch(port) { - case Controller::Port1: return cpu.pio() & 0x40; - case Controller::Port2: return cpu.pio() & 0x80; - } + if (port == Controller::Port1) + return cpu.pio() & 0x40; + else + return cpu.pio() & 0x80; } void Controller::iobit(bool data) { - switch(port) { - case Controller::Port1: bus.write(0x4201, (cpu.pio() & ~0x40) | (data << 6)); break; - case Controller::Port2: bus.write(0x4201, (cpu.pio() & ~0x80) | (data << 7)); break; - } + if (port == Controller::Port1) + bus.write(0x4201, (cpu.pio() & ~0x40) | (data << 6)); + else + bus.write(0x4201, (cpu.pio() & ~0x80) | (data << 7)); } Controller::Controller(bool port) : port(port) { diff -ru higan_v094-source/sfc/controller/justifier/justifier.cpp bsneshle094/sfc/controller/justifier/justifier.cpp --- higan_v094-source/sfc/controller/justifier/justifier.cpp 2012-05-03 22:48:59.000000000 +0200 +++ bsneshle094/sfc/controller/justifier/justifier.cpp 2015-02-21 10:47:18.290028379 +0100 @@ -91,6 +91,9 @@ case 30: return 0; case 31: return 0; } + + // NOT REACHED + return 0; } void Justifier::latch(bool data) { diff -ru higan_v094-source/sfc/controller/superscope/superscope.cpp bsneshle094/sfc/controller/superscope/superscope.cpp --- higan_v094-source/sfc/controller/superscope/superscope.cpp 2012-04-28 17:39:56.000000000 +0200 +++ bsneshle094/sfc/controller/superscope/superscope.cpp 2015-02-21 10:47:18.290028379 +0100 @@ -92,6 +92,9 @@ case 6: return offscreen; case 7: return 0; //noise (1 = yes) } + + // NOT REACHED + return 0; } void SuperScope::latch(bool data) { diff -ru higan_v094-source/sfc/cpu/cpu.cpp bsneshle094/sfc/cpu/cpu.cpp --- higan_v094-source/sfc/cpu/cpu.cpp 2013-11-09 06:38:15.000000000 +0100 +++ bsneshle094/sfc/cpu/cpu.cpp 2014-05-03 20:02:53.027110040 +0200 @@ -114,9 +114,9 @@ reader = [](unsigned addr) { return cpu.wram[addr]; }; writer = [](unsigned addr, uint8 data) { cpu.wram[addr] = data; }; - bus.map(reader, writer, 0x00, 0x3f, 0x0000, 0x1fff, 0x002000); - bus.map(reader, writer, 0x80, 0xbf, 0x0000, 0x1fff, 0x002000); - bus.map(reader, writer, 0x7e, 0x7f, 0x0000, 0xffff, 0x020000); + bus.map(reader, writer, 0x00, 0x3f, 0x0000, 0x1fff, 0x002000, 0,0, Cartridge::Mapping::fastmode_readwrite, cpu.wram); + bus.map(reader, writer, 0x80, 0xbf, 0x0000, 0x1fff, 0x002000, 0,0, Cartridge::Mapping::fastmode_readwrite, cpu.wram); + bus.map(reader, writer, 0x7e, 0x7f, 0x0000, 0xffff, 0x020000, 0,0, Cartridge::Mapping::fastmode_readwrite, cpu.wram); } void CPU::power() { diff -ru higan_v094-source/sfc/cpu/timing/timing.cpp bsneshle094/sfc/cpu/timing/timing.cpp --- higan_v094-source/sfc/cpu/timing/timing.cpp 2012-02-12 07:25:08.000000000 +0100 +++ bsneshle094/sfc/cpu/timing/timing.cpp 2015-02-12 22:56:36.541886387 +0100 @@ -8,6 +8,7 @@ } void CPU::add_clocks(unsigned clocks) { +again: status.irq_lock = false; unsigned ticks = clocks >> 1; while(ticks--) { @@ -25,7 +26,8 @@ if(status.dram_refreshed == false && hcounter() >= status.dram_refresh_position) { status.dram_refreshed = true; - add_clocks(40); + clocks = 40; + goto again; } #if defined(DEBUGGER) diff -ru higan_v094-source/sfc/cpu/timing/timing.hpp bsneshle094/sfc/cpu/timing/timing.hpp --- higan_v094-source/sfc/cpu/timing/timing.hpp 2010-12-26 16:16:47.000000000 +0100 +++ bsneshle094/sfc/cpu/timing/timing.hpp 2015-02-12 22:36:02.421886534 +0100 @@ -1,7 +1,7 @@ //timing.cpp unsigned dma_counter(); -void add_clocks(unsigned clocks); +alwaysinline void add_clocks(unsigned clocks); void scanline(); alwaysinline void alu_edge(); diff -ru higan_v094-source/sfc/interface/interface.hpp bsneshle094/sfc/interface/interface.hpp --- higan_v094-source/sfc/interface/interface.hpp 2013-12-17 05:31:06.000000000 +0100 +++ bsneshle094/sfc/interface/interface.hpp 2014-08-19 15:43:19.689782088 +0200 @@ -88,6 +88,25 @@ }; }; +struct Alt { + enum : unsigned { + ForDSP, + ForSuperGameBoy, + }; + struct DSP { + enum : unsigned { + LLE, + HLE, + }; + }; + struct SuperGameBoy { + enum : unsigned { + Internal, + External, + }; + }; +}; + struct Interface : Emulator::Interface { string title(); double videoFrequency(); diff -ru higan_v094-source/sfc/Makefile bsneshle094/sfc/Makefile --- higan_v094-source/sfc/Makefile 2013-01-23 00:07:55.000000000 +0100 +++ bsneshle094/sfc/Makefile 2015-04-23 17:11:57.475859018 +0200 @@ -9,22 +9,24 @@ sfc_objects += sfc-spc7110 sfc-sdd1 sfc-obc1 sfc_objects += sfc-hsu1 sfc-msu1 sfc_objects += sfc-satellaviewcart sfc-sufamiturbo -objects += $(sfc_objects) +sfc_objects += sfc-hledsp1 sfc-hledsp2 sfc-hledsp3 sfc-hledsp4 +sfc_objects += sfc-hlecx4 sfc-hlest0010 +sfc_objects += sfc-sgbexternal ifeq ($(profile),accuracy) - flags += -DPROFILE_ACCURACY + profflags := -DPROFILE_ACCURACY sfccpu := $(sfc)/cpu sfcsmp := $(sfc)/smp sfcdsp := $(sfc)/dsp sfcppu := $(sfc)/ppu else ifeq ($(profile),balanced) - flags += -DPROFILE_BALANCED + profflags := -DPROFILE_BALANCED sfccpu := $(sfc)/cpu sfcsmp := $(sfc)/smp sfcdsp := $(sfc)/alt/dsp sfcppu := $(sfc)/alt/ppu-balanced else ifeq ($(profile),performance) - flags += -DPROFILE_PERFORMANCE + profflags := -DPROFILE_PERFORMANCE sfccpu := $(sfc)/alt/cpu sfcsmp := $(sfc)/alt/smp sfcdsp := $(sfc)/alt/dsp @@ -33,40 +35,50 @@ $(error unknown profile.) endif -obj/sfc-interface.o: $(sfc)/interface/interface.cpp $(call rwildcard,$(sfc)/interface) -obj/sfc-system.o: $(sfc)/system/system.cpp $(call rwildcard,$(sfc)/system/) -obj/sfc-controller.o: $(sfc)/controller/controller.cpp $(call rwildcard,$(sfc)/controller/) -obj/sfc-cartridge.o: $(sfc)/cartridge/cartridge.cpp $(sfc)/cartridge/* -obj/sfc-cheat.o: $(sfc)/cheat/cheat.cpp $(sfc)/cheat/* -obj/sfc-memory.o: $(sfc)/memory/memory.cpp $(call rwildcard,$(sfc)/memory/) -obj/sfc-cpu.o: $(sfccpu)/cpu.cpp $(call rwildcard,$(sfccpu)/) -obj/sfc-smp.o: $(sfcsmp)/smp.cpp $(call rwildcard,$(sfcsmp)/) -obj/sfc-dsp.o: $(sfcdsp)/dsp.cpp $(call rwildcard,$(sfcdsp)/) -obj/sfc-ppu.o: $(sfcppu)/ppu.cpp $(call rwildcard,$(sfcppu)/) - -obj/sfc-satellaviewbase.o: $(sfc)/base/satellaview/satellaview.cpp $(call rwildcard,$(sfc)/base/satellaview/) - -obj/sfc-icd2.o: $(sfc)/chip/icd2/icd2.cpp $(call rwildcard,$(sfc)/chip/icd2/) -obj/sfc-bsx.o: $(sfc)/chip/bsx/bsx.cpp $(call rwildcard,$(sfc)/chip/bsx/) -obj/sfc-nss.o: $(sfc)/chip/nss/nss.cpp $(call rwildcard,$(sfc)/chip/nss/) -obj/sfc-event.o: $(sfc)/chip/event/event.cpp $(call rwildcard,$(sfc)/chip/event/) - -obj/sfc-sa1.o: $(sfc)/chip/sa1/sa1.cpp $(call rwildcard,$(sfc)/chip/sa1/) -obj/sfc-superfx.o: $(sfc)/chip/superfx/superfx.cpp $(call rwildcard,$(sfc)/chip/superfx/) - -obj/sfc-armdsp.o: $(sfc)/chip/armdsp/armdsp.cpp $(call rwildcard,$(sfc)/chip/armdsp/) -obj/sfc-hitachidsp.o: $(sfc)/chip/hitachidsp/hitachidsp.cpp $(call rwildcard,$(sfc)/chip/hitachidsp/) -obj/sfc-necdsp.o: $(sfc)/chip/necdsp/necdsp.cpp $(call rwildcard,$(sfc)/chip/necdsp/) - -obj/sfc-epsonrtc.o: $(sfc)/chip/epsonrtc/epsonrtc.cpp $(call rwildcard,$(sfc)/chip/epsonrtc/) -obj/sfc-sharprtc.o: $(sfc)/chip/sharprtc/sharprtc.cpp $(call rwildcard,$(sfc)/chip/sharprtc/) - -obj/sfc-spc7110.o: $(sfc)/chip/spc7110/spc7110.cpp $(sfc)/chip/spc7110/* -obj/sfc-sdd1.o: $(sfc)/chip/sdd1/sdd1.cpp $(sfc)/chip/sdd1/* -obj/sfc-obc1.o: $(sfc)/chip/obc1/obc1.cpp $(sfc)/chip/obc1/* +obj/sfc-interface-$(profile).o: $(sfc)/interface/interface.cpp $(call rwildcard,$(sfc)/interface) +obj/sfc-system-$(profile).o: $(sfc)/system/system.cpp $(call rwildcard,$(sfc)/system/) +obj/sfc-controller-$(profile).o: $(sfc)/controller/controller.cpp $(call rwildcard,$(sfc)/controller/) +obj/sfc-cartridge-$(profile).o: $(sfc)/cartridge/cartridge.cpp $(sfc)/cartridge/* +obj/sfc-cheat-$(profile).o: $(sfc)/cheat/cheat.cpp $(sfc)/cheat/* +obj/sfc-memory-$(profile).o: $(sfc)/memory/memory.cpp $(call rwildcard,$(sfc)/memory/) +obj/sfc-cpu-$(profile).o: $(sfccpu)/cpu.cpp $(call rwildcard,$(sfccpu)/) +obj/sfc-smp-$(profile).o: $(sfcsmp)/smp.cpp $(call rwildcard,$(sfcsmp)/) +obj/sfc-dsp-$(profile).o: $(sfcdsp)/dsp.cpp $(call rwildcard,$(sfcdsp)/) +obj/sfc-ppu-$(profile).o: $(sfcppu)/ppu.cpp $(call rwildcard,$(sfcppu)/) + +obj/sfc-satellaviewbase-$(profile).o: $(sfc)/base/satellaview/satellaview.cpp $(call rwildcard,$(sfc)/base/satellaview/) + +obj/sfc-icd2-$(profile).o: $(sfc)/chip/icd2/icd2.cpp $(call rwildcard,$(sfc)/chip/icd2/) +obj/sfc-bsx-$(profile).o: $(sfc)/chip/bsx/bsx.cpp $(call rwildcard,$(sfc)/chip/bsx/) +obj/sfc-nss-$(profile).o: $(sfc)/chip/nss/nss.cpp $(call rwildcard,$(sfc)/chip/nss/) +obj/sfc-event-$(profile).o: $(sfc)/chip/event/event.cpp $(call rwildcard,$(sfc)/chip/event/) + +obj/sfc-sa1-$(profile).o: $(sfc)/chip/sa1/sa1.cpp $(call rwildcard,$(sfc)/chip/sa1/) +obj/sfc-superfx-$(profile).o: $(sfc)/chip/superfx/superfx.cpp $(call rwildcard,$(sfc)/chip/superfx/) + +obj/sfc-armdsp-$(profile).o: $(sfc)/chip/armdsp/armdsp.cpp $(call rwildcard,$(sfc)/chip/armdsp/) +obj/sfc-hitachidsp-$(profile).o: $(sfc)/chip/hitachidsp/hitachidsp.cpp $(call rwildcard,$(sfc)/chip/hitachidsp/) +obj/sfc-necdsp-$(profile).o: $(sfc)/chip/necdsp/necdsp.cpp $(call rwildcard,$(sfc)/chip/necdsp/) + +obj/sfc-epsonrtc-$(profile).o: $(sfc)/chip/epsonrtc/epsonrtc.cpp $(call rwildcard,$(sfc)/chip/epsonrtc/) +obj/sfc-sharprtc-$(profile).o: $(sfc)/chip/sharprtc/sharprtc.cpp $(call rwildcard,$(sfc)/chip/sharprtc/) + +obj/sfc-spc7110-$(profile).o: $(sfc)/chip/spc7110/spc7110.cpp $(sfc)/chip/spc7110/* +obj/sfc-sdd1-$(profile).o: $(sfc)/chip/sdd1/sdd1.cpp $(sfc)/chip/sdd1/* +obj/sfc-obc1-$(profile).o: $(sfc)/chip/obc1/obc1.cpp $(sfc)/chip/obc1/* + +obj/sfc-hsu1-$(profile).o: $(sfc)/chip/hsu1/hsu1.cpp $(sfc)/chip/hsu1/* +obj/sfc-msu1-$(profile).o: $(sfc)/chip/msu1/msu1.cpp $(sfc)/chip/msu1/* + +obj/sfc-satellaviewcart-$(profile).o: $(sfc)/slot/satellaview/satellaview.cpp $(call rwildcard,$(sfc)/slot/satellaview/) +obj/sfc-sufamiturbo-$(profile).o: $(sfc)/slot/sufamiturbo/sufamiturbo.cpp $(call rwildcard,$(sfc)/slot/sufamiturbo/) + +obj/sfc-hledsp1-$(profile).o: $(sfc)/chip/dsp1/dsp1.cpp $(sfc)/chip/dsp1/* +obj/sfc-hledsp2-$(profile).o: $(sfc)/chip/dsp2/dsp2.cpp $(sfc)/chip/dsp2/* +obj/sfc-hledsp3-$(profile).o: $(sfc)/chip/dsp3/dsp3.cpp $(sfc)/chip/dsp3/* +obj/sfc-hledsp4-$(profile).o: $(sfc)/chip/dsp4/dsp4.cpp $(sfc)/chip/dsp4/* -obj/sfc-hsu1.o: $(sfc)/chip/hsu1/hsu1.cpp $(sfc)/chip/hsu1/* -obj/sfc-msu1.o: $(sfc)/chip/msu1/msu1.cpp $(sfc)/chip/msu1/* +obj/sfc-hlecx4-$(profile).o: $(sfc)/chip/cx4/cx4.cpp $(sfc)/chip/cx4/* +obj/sfc-hlest0010-$(profile).o: $(sfc)/chip/st0010/st0010.cpp $(sfc)/chip/st0010/* -obj/sfc-satellaviewcart.o: $(sfc)/slot/satellaview/satellaview.cpp $(call rwildcard,$(sfc)/slot/satellaview/) -obj/sfc-sufamiturbo.o: $(sfc)/slot/sufamiturbo/sufamiturbo.cpp $(call rwildcard,$(sfc)/slot/sufamiturbo/) +obj/sfc-sgbexternal-$(profile).o: $(sfc)/chip/sgb-external/sgb-external.cpp $(sfc)/chip/sgb-external/* diff -ru higan_v094-source/sfc/memory/memory.cpp bsneshle094/sfc/memory/memory.cpp --- higan_v094-source/sfc/memory/memory.cpp 2013-05-05 09:29:50.000000000 +0200 +++ bsneshle094/sfc/memory/memory.cpp 2014-06-05 22:10:02.955293881 +0200 @@ -1,6 +1,7 @@ #include #define MEMORY_CPP + namespace SuperFamicom { Bus bus; @@ -10,22 +11,73 @@ const function& writer, unsigned banklo, unsigned bankhi, unsigned addrlo, unsigned addrhi, - unsigned size, unsigned base, unsigned mask + unsigned size, unsigned base, unsigned mask, + unsigned fastmode, uint8* fastptr ) { assert(banklo <= bankhi && banklo <= 0xff); assert(addrlo <= addrhi && addrlo <= 0xffff); assert(idcount < 255); + bool do_fast=(size%(addrhi+1-addrlo)==0 && !((mask|addrlo|addrhi|size)&fast_page_size_mask)); + bool do_fast_read =(fastmode!=Cartridge::Mapping::fastmode_slow && do_fast); + bool do_fast_write=(fastmode==Cartridge::Mapping::fastmode_readwrite && do_fast); + for(unsigned bank = banklo; bank <= bankhi; bank++) { + for(unsigned addr = addrlo&~fast_page_size_mask; addr<=addrhi; addr+=fast_page_size) { + unsigned origpos = (bank << 16 | addr); + unsigned fastoffset = origpos >> fast_page_size_bits; + + unsigned accesspos = reduce(origpos, mask); + if(size) accesspos = base + mirror(accesspos, size - base); + if(do_fast_read) fast_read[fastoffset] = fastptr - origpos + accesspos; + else fast_read[fastoffset] = NULL; + if(do_fast_write) fast_write[fastoffset] = fastptr - origpos + accesspos; + else fast_write[fastoffset] = NULL; + } + } + +#ifdef __LIBRETRO__ + if (((banklo&-banklo)|0x01000000)>(bankhi-banklo) && (bankhi&(bankhi+1)&~banklo)==0 && + ((addrlo&-addrlo)|0x01000000)>(addrhi-addrlo) && (addrhi&(addrhi+1)&~addrlo)==0) + { + retro_memory_descriptor desc; + desc.flags=(fastmode==Cartridge::Mapping::fastmode_readwrite ? 0 : RETRO_MEMDESC_CONST); + desc.ptr=fastptr; + desc.offset=0; + desc.start=banklo<<16 | addrlo; + desc.select=(banklo<<16 | addrlo) ^ (bankhi<<16 | addrhi) ^ 0xFFFFFF; + desc.disconnect=mask; + desc.len=size; + if (!size) desc.len=0x01000000; + desc.addrspace=NULL; + libretro_mem_map.append(desc); + } +#endif + unsigned id = idcount++; this->reader[id] = reader; this->writer[id] = writer; - for(unsigned bank = banklo; bank <= bankhi; bank++) { - for(unsigned addr = addrlo; addr <= addrhi; addr++) { - unsigned offset = reduce(bank << 16 | addr, mask); - if(size) offset = base + mirror(offset, size - base); - lookup[bank << 16 | addr] = id; - target[bank << 16 | addr] = offset; + if (!(mask & (addrlo^addrhi)) && size%(addrhi+1-addrlo)==0) { + //fastpath for common cases + for(unsigned bank = banklo; bank <= bankhi; bank++) { + unsigned offset = reduce(bank << 16 | addrlo, mask); + if (size) offset = base + mirror(offset, size - base); + unsigned pos = (bank<<16 | addrlo); + unsigned end = (bank<<16 | addrhi); + while (pos <= end) { + lookup[pos] = id; + target[pos] = offset++; + pos++; + } + } + } else { + for(unsigned bank = banklo; bank <= bankhi; bank++) { + for(unsigned addr = addrlo; addr <= addrhi; addr++) { + unsigned offset = reduce(bank << 16 | addr, mask); + if(size) offset = base + mirror(offset, size - base); + lookup[bank << 16 | addr] = id; + target[bank << 16 | addr] = offset; + } } } } @@ -34,6 +86,10 @@ function reader = [](unsigned) { return cpu.regs.mdr; }; function writer = [](unsigned, uint8) {}; +#ifdef __LIBRETRO__ + libretro_mem_map.reset(); +#endif + idcount = 0; map(reader, writer, 0x00, 0xff, 0x0000, 0xffff); } @@ -51,7 +107,7 @@ unsigned bankhi = hex(bankpart(1, bankpart(0))); unsigned addrlo = hex(addrpart(0)); unsigned addrhi = hex(addrpart(1, addrpart(0))); - map(m.reader, m.writer, banklo, bankhi, addrlo, addrhi, m.size, m.base, m.mask); + map(m.reader, m.writer, banklo, bankhi, addrlo, addrhi, m.size, m.base, m.mask, m.fastmode, m.fastptr); } } } diff -ru higan_v094-source/sfc/memory/memory.hpp bsneshle094/sfc/memory/memory.hpp --- higan_v094-source/sfc/memory/memory.hpp 2013-05-05 09:30:28.000000000 +0200 +++ bsneshle094/sfc/memory/memory.hpp 2014-06-05 21:25:47.259294198 +0200 @@ -1,7 +1,12 @@ +#ifdef __LIBRETRO__ +#include "../../target-libretro/libretro.h" +#endif + struct Memory { virtual inline unsigned size() const; virtual uint8 read(unsigned addr) = 0; virtual void write(unsigned addr, uint8 data) = 0; + virtual uint8* data() { return NULL; } }; struct StaticRAM : Memory { @@ -56,12 +61,19 @@ function reader[256]; function writer[256]; + static const uint32 fast_page_size_bits = 13;//keep at 13 or lower so the RAM mirrors can be on the fast path + static const uint32 fast_page_size = (1 << fast_page_size_bits); + static const uint32 fast_page_size_mask = (fast_page_size - 1); + uint8* fast_read[0x1000000>>fast_page_size_bits]; + uint8* fast_write[0x1000000>>fast_page_size_bits]; + void map( const function& reader, const function& writer, unsigned banklo, unsigned bankhi, unsigned addrlo, unsigned addrhi, - unsigned size = 0, unsigned base = 0, unsigned mask = 0 + unsigned size = 0, unsigned base = 0, unsigned mask = 0, + unsigned fastmode = 0, uint8* fast_ptr = NULL ); void map_reset(); @@ -69,6 +81,10 @@ Bus(); ~Bus(); + +#ifdef __LIBRETRO__ + vector libretro_mem_map; +#endif }; extern Bus bus; diff -ru higan_v094-source/sfc/memory/memory-inline.hpp bsneshle094/sfc/memory/memory-inline.hpp --- higan_v094-source/sfc/memory/memory-inline.hpp 2014-01-13 07:27:34.000000000 +0100 +++ bsneshle094/sfc/memory/memory-inline.hpp 2014-05-13 17:48:18.379765481 +0200 @@ -73,26 +73,38 @@ return base; } -unsigned Bus::reduce(unsigned addr, unsigned mask) { - unsigned result = 0, length = 0; - for(unsigned n = 0; n < 24; n++) { - unsigned bit = 1 << n; - if(mask & bit) continue; - result |= (bool)(addr & bit) << length++; +unsigned Bus::reduce(unsigned addr, unsigned mask) +{ + while (mask) + { + //extract the bits to keep + //set everything below the lowest set bit; 0x018000 -> 0x007FFF + unsigned tmp=((mask-1)&(~mask)); + + //shift everything above that + addr=(addr&tmp)|((addr>>1)&~tmp); + + //adjust the mask + mask=(mask&(mask-1))>>1; } - return result; + return addr; } uint8 Bus::read(unsigned addr) { - uint8 data = reader[lookup[addr]](target[addr]); + uint8 data; + if (fast_read[addr>>fast_page_size_bits]) data = fast_read[addr>>fast_page_size_bits][addr]; + else data = reader[lookup[addr]](target[addr]); +#ifndef __LIBRETRO__ if(cheat.enable()) { if(auto result = cheat.find(addr, data)) return result(); } +#endif return data; } void Bus::write(unsigned addr, uint8 data) { - return writer[lookup[addr]](target[addr], data); + if (fast_write[addr>>fast_page_size_bits]) fast_write[addr>>fast_page_size_bits][addr] = data; + else writer[lookup[addr]](target[addr], data); } diff -ru higan_v094-source/sfc/ppu/background/background.hpp bsneshle094/sfc/ppu/background/background.hpp --- higan_v094-source/sfc/ppu/background/background.hpp 2013-05-05 09:31:28.000000000 +0200 +++ bsneshle094/sfc/ppu/background/background.hpp 2014-05-03 23:18:53.731330831 +0200 @@ -60,21 +60,21 @@ uint8 data[8]; }; - void frame(); - void scanline(); - void begin(); - void run(bool screen); - void reset(); + inline void frame(); + inline void scanline(); + inline void begin(); + inline void run(bool screen); + inline void reset(); - void get_tile(); - unsigned get_tile_color(); - unsigned get_tile(unsigned x, unsigned y); - signed clip(signed n); - void begin_mode7(); - void run_mode7(); + inline void get_tile(); + inline unsigned get_tile_color(); + inline unsigned get_tile(unsigned x, unsigned y); + inline signed clip(signed n); + inline void begin_mode7(); + inline void run_mode7(); - void serialize(serializer&); - Background(PPU& self, unsigned id); + inline void serialize(serializer&); + inline Background(PPU& self, unsigned id); PPU& self; friend class PPU; diff -ru higan_v094-source/sfc/ppu/screen/screen.cpp bsneshle094/sfc/ppu/screen/screen.cpp --- higan_v094-source/sfc/ppu/screen/screen.cpp 2013-12-17 04:58:08.000000000 +0100 +++ bsneshle094/sfc/ppu/screen/screen.cpp 2015-02-21 10:47:18.290028379 +0100 @@ -56,7 +56,8 @@ priority = self.sprite.output.sub.priority; math.sub.color = get_color(self.sprite.output.sub.palette); } - if(math.transparent = (priority == 0)) math.sub.color = get_color(0); + math.transparent = (priority == 0); + if(math.transparent) math.sub.color = get_color(0); if(!hires) return 0; if(!math.sub.color_enable) return math.main.color_enable ? math.sub.color : 0; diff -ru higan_v094-source/sfc/ppu/screen/screen.hpp bsneshle094/sfc/ppu/screen/screen.hpp --- higan_v094-source/sfc/ppu/screen/screen.hpp 2013-05-05 09:36:42.000000000 +0200 +++ bsneshle094/sfc/ppu/screen/screen.hpp 2014-05-03 23:19:20.659331336 +0200 @@ -29,19 +29,19 @@ bool color_halve; } math; - void scanline(); - void run(); - void reset(); + inline void scanline(); + inline void run(); + inline void reset(); - uint16 get_pixel_sub(bool hires); - uint16 get_pixel_main(); - uint16 addsub(unsigned x, unsigned y); - uint16 get_color(unsigned palette); - uint16 get_direct_color(unsigned palette, unsigned tile); - uint16 fixed_color() const; + inline uint16 get_pixel_sub(bool hires); + inline uint16 get_pixel_main(); + inline uint16 addsub(unsigned x, unsigned y); + inline uint16 get_color(unsigned palette); + inline uint16 get_direct_color(unsigned palette, unsigned tile); + inline uint16 fixed_color() const; - void serialize(serializer&); - Screen(PPU& self); + inline void serialize(serializer&); + inline Screen(PPU& self); PPU& self; friend class PPU; diff -ru higan_v094-source/sfc/ppu/sprite/sprite.hpp bsneshle094/sfc/ppu/sprite/sprite.hpp --- higan_v094-source/sfc/ppu/sprite/sprite.hpp 2013-05-05 09:37:44.000000000 +0200 +++ bsneshle094/sfc/ppu/sprite/sprite.hpp 2014-05-03 23:18:08.691329985 +0200 @@ -60,22 +60,22 @@ } output; //list.cpp - void update(unsigned addr, uint8 data); - void synchronize(); + inline void update(unsigned addr, uint8 data); + inline void synchronize(); //sprite.cpp - void address_reset(); - void set_first_sprite(); - void frame(); - void scanline(); - void run(); - void tilefetch(); - void reset(); + inline void address_reset(); + inline void set_first_sprite(); + inline void frame(); + inline void scanline(); + inline void run(); + inline void tilefetch(); + inline void reset(); - bool on_scanline(SpriteItem&); + inline bool on_scanline(SpriteItem&); - void serialize(serializer&); - Sprite(PPU& self); + inline void serialize(serializer&); + inline Sprite(PPU& self); PPU& self; friend class PPU; diff -ru higan_v094-source/sfc/ppu/window/window.hpp bsneshle094/sfc/ppu/window/window.hpp --- higan_v094-source/sfc/ppu/window/window.hpp 2013-05-05 09:40:42.000000000 +0200 +++ bsneshle094/sfc/ppu/window/window.hpp 2014-05-03 23:19:37.315331649 +0200 @@ -69,19 +69,19 @@ bool two; }; - void scanline(); - void run(); - void reset(); + inline void scanline(); + inline void run(); + inline void reset(); - void test( + inline void test( bool& main, bool& sub, bool one_enable, bool one_invert, bool two_enable, bool two_invert, uint8 mask, bool main_enable, bool sub_enable ); - void serialize(serializer&); - Window(PPU& self); + inline void serialize(serializer&); + inline Window(PPU& self); PPU& self; friend class PPU; diff -ru higan_v094-source/sfc/system/input.cpp bsneshle094/sfc/system/input.cpp --- higan_v094-source/sfc/system/input.cpp 2013-11-09 06:34:32.000000000 +0100 +++ bsneshle094/sfc/system/input.cpp 2015-02-21 10:47:18.290028379 +0100 @@ -20,10 +20,10 @@ case Device::USART: controller = new USART(port); break; } - switch(port) { - case Controller::Port1: configuration.controller_port1 = id; break; - case Controller::Port2: configuration.controller_port2 = id; break; - } + if (port == Controller::Port1) + configuration.controller_port1 = id; + else + configuration.controller_port2 = id; } Input::Input() { diff -ru higan_v094-source/sfc/system/serialization.cpp bsneshle094/sfc/system/serialization.cpp --- higan_v094-source/sfc/system/serialization.cpp 2013-05-05 09:48:32.000000000 +0200 +++ bsneshle094/sfc/system/serialization.cpp 2014-08-19 16:07:51.405809717 +0200 @@ -73,6 +73,13 @@ if(cartridge.has_hsu1()) hsu1.serialize(s); if(cartridge.has_msu1()) msu1.serialize(s); if(cartridge.has_st_slots()) sufamiturboA.serialize(s), sufamiturboB.serialize(s); + if(cartridge.has_dsp1()) dsp1.serialize(s); + if(cartridge.has_dsp2()) dsp2.serialize(s); + //if(cartridge.has_dsp3()) dsp3.serialize(s); + //if(cartridge.has_dsp4()) dsp4.serialize(s); + if(cartridge.has_cx4()) cx4.serialize(s); + if(cartridge.has_st0010()) st0010.serialize(s); + if(cartridge.has_sgbexternal()) sgbExternal.serialize(s); } //perform dry-run state save: diff -ru higan_v094-source/sfc/system/system.cpp bsneshle094/sfc/system/system.cpp --- higan_v094-source/sfc/system/system.cpp 2014-01-13 07:06:55.000000000 +0100 +++ bsneshle094/sfc/system/system.cpp 2014-08-19 17:20:40.337891738 +0200 @@ -83,6 +83,14 @@ msu1.init(); satellaviewcartridge.init(); + dsp1.init(); + dsp2.init(); + dsp3.init(); + dsp4.init(); + cx4.init(); + st0010.init(); + sgbExternal.init(); + video.init(); audio.init(); @@ -94,6 +102,9 @@ } void System::load() { +#ifdef __LIBRETRO__ + interface->loadRequest(ID::IPLROM, ""); +#else string manifest = string::read({interface->path(ID::System), "manifest.bml"}); auto document = Markup::Document(manifest); @@ -101,6 +112,7 @@ if(!file::exists({interface->path(ID::System), document["system/smp/rom/name"].data})) { interface->notify("Error: required Super Famicom firmware ipl.rom not found.\n"); } +#endif region = configuration.region; expansion = configuration.expansion_port; @@ -138,6 +150,13 @@ if(cartridge.has_msu1()) msu1.load(); if(cartridge.has_bs_slot()) satellaviewcartridge.load(); if(cartridge.has_st_slots()) sufamiturboA.load(), sufamiturboB.load(); + if(cartridge.has_dsp1()) dsp1.load(); + if(cartridge.has_dsp2()) dsp2.load(); + if(cartridge.has_dsp3()) dsp3.load(); + if(cartridge.has_dsp4()) dsp4.load(); + if(cartridge.has_cx4()) cx4.load(); + if(cartridge.has_st0010()) st0010.load(); + if(cartridge.has_sgbexternal()) sgbExternal.load(); serialize_init(); } @@ -162,6 +181,14 @@ if(cartridge.has_msu1()) msu1.unload(); if(cartridge.has_bs_slot()) satellaviewcartridge.unload(); if(cartridge.has_st_slots()) sufamiturboA.unload(), sufamiturboB.unload(); + + if(cartridge.has_dsp1()) dsp1.unload(); + if(cartridge.has_dsp2()) dsp2.unload(); + if(cartridge.has_dsp3()) dsp3.unload(); + if(cartridge.has_dsp4()) dsp4.unload(); + if(cartridge.has_cx4()) cx4.unload(); + if(cartridge.has_st0010()) st0010.unload(); + if(cartridge.has_sgbexternal()) sgbExternal.unload(); } void System::power() { @@ -191,6 +218,14 @@ if(cartridge.has_msu1()) msu1.power(); if(cartridge.has_bs_slot()) satellaviewcartridge.power(); + if(cartridge.has_dsp1()) dsp1.power(); + if(cartridge.has_dsp2()) dsp2.power(); + if(cartridge.has_dsp3()) dsp3.power(); + if(cartridge.has_dsp4()) dsp4.power(); + if(cartridge.has_cx4()) cx4.power(); + if(cartridge.has_st0010()) st0010.power(); + if(cartridge.has_sgbexternal()) sgbExternal.power(); + reset(); } @@ -231,6 +266,15 @@ if(cartridge.has_spc7110()) cpu.coprocessors.append(&spc7110); if(cartridge.has_msu1()) cpu.coprocessors.append(&msu1); + if(cartridge.has_dsp1()) dsp1.reset(); + if(cartridge.has_dsp2()) dsp2.reset(); + if(cartridge.has_dsp3()) dsp3.reset(); + if(cartridge.has_dsp4()) dsp4.reset(); + if(cartridge.has_cx4()) cx4.reset(); + if(cartridge.has_st0010()) st0010.reset(); + if(cartridge.has_sgbexternal()) sgbExternal.reset(); + if(cartridge.has_sgbexternal()) cpu.coprocessors.append(&sgbExternal); + scheduler.init(); input.connect(0, configuration.controller_port1); input.connect(1, configuration.controller_port2); diff -ru higan_v094-source/sfc/system/video.cpp bsneshle094/sfc/system/video.cpp --- higan_v094-source/sfc/system/video.cpp 2013-12-21 07:49:58.000000000 +0100 +++ bsneshle094/sfc/system/video.cpp 2015-02-21 10:47:18.290028379 +0100 @@ -121,6 +121,8 @@ draw_cursor(0x02e0, device.player2.x, device.player2.y); } break; + default: + break; } uint32_t* data = (uint32_t*)ppu.output; diff -ru higan_v094-source/target-ethos/Makefile bsneshle094/target-ethos/Makefile --- higan_v094-source/target-ethos/Makefile 2014-01-13 06:26:29.000000000 +0100 +++ bsneshle094/target-ethos/Makefile 2015-04-23 17:11:57.475859018 +0200 @@ -43,6 +43,8 @@ # rules objects := $(ui_objects) $(objects) objects := $(patsubst %,obj/%.o,$(objects)) +sfc_objects := $(patsubst %,obj/%-$(profile).o,$(sfc_objects)) +objects += $(sfc_objects) obj/ui-ethos.o: $(ui)/ethos.cpp $(call rwildcard,$(ui)/) obj/ui-configuration.o: $(ui)/configuration/configuration.cpp $(call rwildcard,$(ui)/) Only in bsneshle094: target-libretro sfc/chip/bsx/bsx.cpp000664 001750 001750 00000007365 12651764221 015515 0ustar00sergiosergio000000 000000 #include #define BSX_CPP namespace SuperFamicom { #include "serialization.cpp" BSXCartridge bsxcartridge; void BSXCartridge::init() { } void BSXCartridge::load() { } void BSXCartridge::unload() { rom.reset(); ram.reset(); psram.reset(); } void BSXCartridge::power() { } void BSXCartridge::reset() { for(unsigned i = 0; i < 16; i++) r[i] = 0x00; r[0x07] = 0x80; r[0x08] = 0x80; mmio_commit(); } uint8 BSXCartridge::memory_access(bool write, Memory& memory, unsigned addr, uint8 data) { if(write == 0) return memory_read(memory, addr); memory_write(memory, addr, data); // byuu returned nothing here (causing C++ to return 0) return 0; } uint8 BSXCartridge::memory_read(Memory& memory, unsigned addr) { addr = bus.mirror(addr, memory.size()); return memory.read(addr); } void BSXCartridge::memory_write(Memory& memory, unsigned addr, uint8 data) { addr = bus.mirror(addr, memory.size()); return memory.write(addr, data); } //mcu_access() allows mcu_read() and mcu_write() to share decoding logic uint8 BSXCartridge::mcu_access(bool write, unsigned addr, uint8 data) { if((addr & 0xe08000) == 0x008000) { //$00-1f:8000-ffff if(r07 == 1) { addr = ((addr & 0x1f0000) >> 1) | (addr & 0x7fff); return memory_access(write, rom, addr, data); } } if((addr & 0xe08000) == 0x808000) { //$80-9f:8000-ffff if(r08 == 1) { addr = ((addr & 0x1f0000) >> 1) | (addr & 0x7fff); return memory_access(write, rom, addr, data); } } if((addr & 0xe0e000) == 0x206000) { //$20-3f:6000-7fff return memory_access(write, psram, addr, data); } if((addr & 0xf00000) == 0x400000) { //$40-4f:0000-ffff if(r05 == 0) return memory_access(write, psram, addr & 0x0fffff, data); } if((addr & 0xf00000) == 0x500000) { //$50-5f:0000-ffff if(r06 == 0) return memory_access(write, psram, addr & 0x0fffff, data); } if((addr & 0xf00000) == 0x600000) { //$60-6f:0000-ffff if(r03 == 1) return memory_access(write, psram, addr & 0x0fffff, data); } if((addr & 0xf80000) == 0x700000) { //$70-77:0000-ffff return memory_access(write, psram, addr & 0x07ffff, data); } if(((addr & 0x408000) == 0x008000) //$00-3f|80-bf:8000-ffff || ((addr & 0x400000) == 0x400000) //$40-7f|c0-ff:0000-ffff ) { if(r02 == 0) addr = ((addr & 0x7f0000) >> 1) | (addr & 0x7fff); Memory& memory = (r01 == 0 ? (Memory&)satellaviewcartridge : (Memory&)psram); return memory_access(write, memory, addr & 0x7fffff, data); } return cpu.regs.mdr; } uint8 BSXCartridge::mcu_read(unsigned addr) { return mcu_access(0, addr); } void BSXCartridge::mcu_write(unsigned addr, uint8 data) { mcu_access(1, addr, data); } uint8 BSXCartridge::mmio_read(unsigned addr) { if((addr & 0xf0ffff) == 0x005000) { //$00-0f:5000 uint8 n = (addr >> 16) & 15; return r[n]; } if((addr & 0xf8f000) == 0x105000) { //$10-17:5000-5fff return memory_read(ram, ((addr >> 16) & 7) * 0x1000 + (addr & 0xfff)); } return 0x00; } void BSXCartridge::mmio_write(unsigned addr, uint8 data) { if((addr & 0xf0ffff) == 0x005000) { //$00-0f:5000 uint8 n = (addr >> 16) & 15; r[n] = data; if(n == 0x0e && data & 0x80) mmio_commit(); return; } if((addr & 0xf8f000) == 0x105000) { //$10-17:5000-5fff return memory_write(ram, ((addr >> 16) & 7) * 0x1000 + (addr & 0xfff), data); } } void BSXCartridge::mmio_commit() { r00 = r[0x00] & 0x80; r01 = r[0x01] & 0x80; r02 = r[0x02] & 0x80; r03 = r[0x03] & 0x80; r04 = r[0x04] & 0x80; r05 = r[0x05] & 0x80; r06 = r[0x06] & 0x80; r07 = r[0x07] & 0x80; r08 = r[0x08] & 0x80; r09 = r[0x09] & 0x80; r0a = r[0x0a] & 0x80; r0b = r[0x0b] & 0x80; r0c = r[0x0c] & 0x80; r0d = r[0x0d] & 0x80; r0e = r[0x0e] & 0x80; r0f = r[0x0f] & 0x80; } } phoenix/cocoa/widget/frame.cpp000664 001750 001750 00000003132 12651764221 017526 0ustar00sergiosergio000000 000000 @implementation CocoaFrame : NSBox -(id) initWith:(phoenix::Frame&)frameReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { frame = &frameReference; [self setTitle:@""]; } return self; } @end namespace phoenix { void pFrame::setEnabled(bool enabled) { if(frame.state.layout) frame.state.layout->setEnabled(frame.state.layout->enabled()); pWidget::setEnabled(enabled); } void pFrame::setFont(string font) { @autoreleasepool { [cocoaView setTitleFont:pFont::cocoaFont(font)]; } } void pFrame::setGeometry(Geometry geometry) { bool empty = frame.state.text.empty(); Size size = Font::size(frame.font(), frame.state.text); pWidget::setGeometry({ geometry.x - 3, geometry.y - (empty ? size.height - 2 : 1), geometry.width + 6, geometry.height + (empty ? size.height + 2 : 5) }); if(frame.state.layout == nullptr) return; geometry.x += 1, geometry.y += (empty ? 1 : size.height - 2); geometry.width -= 2, geometry.height -= (empty ? 1 : size.height - 1); frame.state.layout->setGeometry(geometry); } void pFrame::setText(string text) { @autoreleasepool { [cocoaView setTitle:[NSString stringWithUTF8String:text]]; } } void pFrame::setVisible(bool visible) { if(frame.state.layout) frame.state.layout->setVisible(frame.state.layout->visible()); pWidget::setVisible(visible); } void pFrame::constructor() { @autoreleasepool { cocoaView = cocoaFrame = [[CocoaFrame alloc] initWith:frame]; } } void pFrame::destructor() { @autoreleasepool { [cocoaView release]; } } void pFrame::orphan() { destructor(); constructor(); } } sfc/chip/msu1/000700 001750 001750 00000000000 12656700342 014256 5ustar00sergiosergio000000 000000 phoenix/qt/widget/check-button.cpp000664 001750 001750 00000003474 12651764221 020373 0ustar00sergiosergio000000 000000 namespace phoenix { Size pCheckButton::minimumSize() { Size size = pFont::size(qtWidget->font(), checkButton.state.text); if(checkButton.state.orientation == Orientation::Horizontal) { size.width += checkButton.state.image.width; size.height = max(checkButton.state.image.height, size.height); } if(checkButton.state.orientation == Orientation::Vertical) { size.width = max(checkButton.state.image.width, size.width); size.height += checkButton.state.image.height; } return {size.width + 20, size.height + 12}; } void pCheckButton::setChecked(bool checked) { locked = true; qtCheckButton->setChecked(checked); locked = false; } void pCheckButton::setImage(const image& image, Orientation orientation) { qtCheckButton->setIconSize(QSize(image.width, image.height)); qtCheckButton->setIcon(CreateIcon(image)); qtCheckButton->setStyleSheet("text-align: top;"); switch(orientation) { case Orientation::Horizontal: qtCheckButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); break; case Orientation::Vertical: qtCheckButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); break; } } void pCheckButton::setText(string text) { qtCheckButton->setText(QString::fromUtf8(text)); } void pCheckButton::constructor() { qtWidget = qtCheckButton = new QToolButton; qtCheckButton->setCheckable(true); qtCheckButton->setToolButtonStyle(Qt::ToolButtonTextOnly); connect(qtCheckButton, SIGNAL(toggled(bool)), SLOT(onToggle(bool))); pWidget::synchronizeState(); setChecked(checkButton.state.checked); setText(checkButton.state.text); } void pCheckButton::destructor() { } void pCheckButton::orphan() { destructor(); constructor(); } void pCheckButton::onToggle(bool checked) { checkButton.state.checked = checked; if(!locked && checkButton.onToggle) checkButton.onToggle(); } } sfc/alt/smp/core/op_pc.cpp000664 001750 001750 00000021510 12651764221 016575 0ustar00sergiosergio000000 000000 case 0x2f: { rd = op_readpc(); if(0)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0xf0: { rd = op_readpc(); if(!regs.p.z)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0xd0: { rd = op_readpc(); if(regs.p.z)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0xb0: { rd = op_readpc(); if(!regs.p.c)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x90: { rd = op_readpc(); if(regs.p.c)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x70: { rd = op_readpc(); if(!regs.p.v)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x50: { rd = op_readpc(); if(regs.p.v)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x30: { rd = op_readpc(); if(!regs.p.n)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x10: { rd = op_readpc(); if(regs.p.n)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x03: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x01) != 0x01)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x13: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x01) == 0x01)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x23: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x02) != 0x02)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x33: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x02) == 0x02)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x43: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x04) != 0x04)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x53: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x04) == 0x04)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x63: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x08) != 0x08)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x73: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x08) == 0x08)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x83: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x10) != 0x10)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x93: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x10) == 0x10)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0xa3: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x20) != 0x20)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0xb3: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x20) == 0x20)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0xc3: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x40) != 0x40)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0xd3: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x40) == 0x40)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0xe3: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x80) != 0x80)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0xf3: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if((sp & 0x80) == 0x80)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x2e: { dp = op_readpc(); sp = op_readdp(dp); rd = op_readpc(); op_io(); if(regs.a == sp)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0xde: { dp = op_readpc(); op_io(); sp = op_readdp(dp + regs.x); rd = op_readpc(); op_io(); if(regs.a == sp)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x6e: { dp = op_readpc(); wr = op_readdp(dp); op_writedp(dp, --wr); rd = op_readpc(); if(wr == 0x00)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0xfe: { rd = op_readpc(); op_io(); regs.y--; op_io(); if(regs.y == 0x00)break; op_io(); op_io(); regs.pc += (int8)rd; break; } case 0x5f: { rd = op_readpc(); rd |= op_readpc() << 8; regs.pc = rd; break; } case 0x1f: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); dp += regs.x; rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; regs.pc = rd; break; } case 0x3f: { rd = op_readpc(); rd |= op_readpc() << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0x4f: { rd = op_readpc(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = 0xff00 | rd; break; } case 0x01: { dp = 0xffde - (0 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0x11: { dp = 0xffde - (1 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0x21: { dp = 0xffde - (2 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0x31: { dp = 0xffde - (3 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0x41: { dp = 0xffde - (4 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0x51: { dp = 0xffde - (5 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0x61: { dp = 0xffde - (6 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0x71: { dp = 0xffde - (7 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0x81: { dp = 0xffde - (8 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0x91: { dp = 0xffde - (9 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0xa1: { dp = 0xffde - (10 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0xb1: { dp = 0xffde - (11 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0xc1: { dp = 0xffde - (12 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0xd1: { dp = 0xffde - (13 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0xe1: { dp = 0xffde - (14 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0xf1: { dp = 0xffde - (15 << 1); rd = op_readaddr(dp); rd |= op_readaddr(dp + 1) << 8; op_io(); op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); regs.pc = rd; break; } case 0x0f: { rd = op_readaddr(0xffde); rd |= op_readaddr(0xffdf) << 8; op_io(); op_io(); op_writestack(regs.pc >> 8); op_writestack(regs.pc); op_writestack(regs.p); regs.pc = rd; regs.p.b = 1; regs.p.i = 0; break; } case 0x6f: { rd = op_readstack(); rd |= op_readstack() << 8; op_io(); op_io(); regs.pc = rd; break; } case 0x7f: { regs.p = op_readstack(); rd = op_readstack(); rd |= op_readstack() << 8; op_io(); op_io(); regs.pc = rd; break; } phoenix/gtk/action/000700 001750 001750 00000000000 12656700342 015407 5ustar00sergiosergio000000 000000 phoenix/cocoa/mouse.cpp000664 001750 001750 00000000211 12651764221 016274 0ustar00sergiosergio000000 000000 namespace phoenix { Position pMouse::position() { return {0, 0}; } bool pMouse::pressed(Mouse::Button button) { return false; } } gba/cpu/serialization.cpp000664 001750 001750 00000007035 12651764221 016616 0ustar00sergiosergio000000 000000 void CPU::serialize(serializer& s) { ARM::serialize(s); Thread::serialize(s); s.array(iwram, 32 * 1024); s.array(ewram, 256 * 1024); for(auto& dma : regs.dma) { s.integer(dma.source); s.integer(dma.target); s.integer(dma.length); s.integer(dma.control.targetmode); s.integer(dma.control.sourcemode); s.integer(dma.control.repeat); s.integer(dma.control.size); s.integer(dma.control.drq); s.integer(dma.control.timingmode); s.integer(dma.control.irq); s.integer(dma.control.enable); s.integer(dma.run.target); s.integer(dma.run.source); s.integer(dma.run.length); } for(auto& timer : regs.timer) { s.integer(timer.period); s.integer(timer.reload); s.integer(timer.control.frequency); s.integer(timer.control.cascade); s.integer(timer.control.irq); s.integer(timer.control.enable); } for(auto& value : regs.serial.data) s.integer(value); s.integer(regs.serial.control.shiftclockselect); s.integer(regs.serial.control.shiftclockfrequency); s.integer(regs.serial.control.transferenablereceive); s.integer(regs.serial.control.transferenablesend); s.integer(regs.serial.control.startbit); s.integer(regs.serial.control.transferlength); s.integer(regs.serial.control.irqenable); s.integer(regs.serial.data8); for(auto& flag : regs.keypad.control.flag) s.integer(flag); s.integer(regs.keypad.control.enable); s.integer(regs.keypad.control.condition); s.integer(regs.joybus.settings.sc); s.integer(regs.joybus.settings.sd); s.integer(regs.joybus.settings.si); s.integer(regs.joybus.settings.so); s.integer(regs.joybus.settings.scmode); s.integer(regs.joybus.settings.sdmode); s.integer(regs.joybus.settings.simode); s.integer(regs.joybus.settings.somode); s.integer(regs.joybus.settings.irqenable); s.integer(regs.joybus.settings.mode); s.integer(regs.joybus.control.resetsignal); s.integer(regs.joybus.control.receivecomplete); s.integer(regs.joybus.control.sendcomplete); s.integer(regs.joybus.control.irqenable); s.integer(regs.joybus.receive); s.integer(regs.joybus.transmit); s.integer(regs.joybus.status.receiveflag); s.integer(regs.joybus.status.sendflag); s.integer(regs.joybus.status.generalflag); s.integer(regs.ime); s.integer(regs.irq.enable.vblank); s.integer(regs.irq.enable.hblank); s.integer(regs.irq.enable.vcoincidence); for(auto& flag : regs.irq.enable.timer) s.integer(flag); s.integer(regs.irq.enable.serial); for(auto& flag : regs.irq.enable.dma) s.integer(flag); s.integer(regs.irq.enable.keypad); s.integer(regs.irq.enable.cartridge); s.integer(regs.irq.flag.vblank); s.integer(regs.irq.flag.hblank); s.integer(regs.irq.flag.vcoincidence); for(auto& flag : regs.irq.flag.timer) s.integer(flag); s.integer(regs.irq.flag.serial); for(auto& flag : regs.irq.flag.dma) s.integer(flag); s.integer(regs.irq.flag.keypad); s.integer(regs.irq.flag.cartridge); for(auto& flag : regs.wait.control.nwait) s.integer(flag); for(auto& flag : regs.wait.control.swait) s.integer(flag); s.integer(regs.wait.control.phi); s.integer(regs.wait.control.prefetch); s.integer(regs.wait.control.gametype); s.integer(regs.memory.control.disable); s.integer(regs.memory.control.unknown1); s.integer(regs.memory.control.ewram); s.integer(regs.memory.control.ewramwait); s.integer(regs.memory.control.unknown2); s.integer(regs.postboot); s.integer((unsigned&)regs.mode); s.integer(regs.clock); s.integer(pending.dma.vblank); s.integer(pending.dma.hblank); s.integer(pending.dma.hdma); } libco/libco.h000664 001750 001750 00000000740 12651764221 014242 0ustar00sergiosergio000000 000000 /* libco version: 0.16 (2010-12-24) license: public domain */ #ifndef LIBCO_H #define LIBCO_H #ifdef LIBCO_C #ifdef LIBCO_MP #define thread_local __thread #else #define thread_local #endif #endif #ifdef __cplusplus extern "C" { #endif typedef void* cothread_t; cothread_t co_active(void); cothread_t co_create(unsigned int, void (*)(void)); void co_delete(cothread_t); void co_switch(cothread_t); #ifdef __cplusplus } #endif /* ifndef LIBCO_H */ #endif processor/upd96050/serialization.cpp000664 001750 001750 00000002020 12651764221 020476 0ustar00sergiosergio000000 000000 void uPD96050::serialize(serializer& s) { s.array(dataRAM); s.array(regs.stack); s.integer(regs.pc); s.integer(regs.rp); s.integer(regs.dp); s.integer(regs.sp); s.integer(regs.k); s.integer(regs.l); s.integer(regs.m); s.integer(regs.n); s.integer(regs.a); s.integer(regs.b); s.integer(regs.flaga.s1); s.integer(regs.flaga.s0); s.integer(regs.flaga.c); s.integer(regs.flaga.z); s.integer(regs.flaga.ov1); s.integer(regs.flaga.ov0); s.integer(regs.flagb.s1); s.integer(regs.flagb.s0); s.integer(regs.flagb.c); s.integer(regs.flagb.z); s.integer(regs.flagb.ov1); s.integer(regs.flagb.ov0); s.integer(regs.tr); s.integer(regs.trb); s.integer(regs.sr.rqm); s.integer(regs.sr.usf1); s.integer(regs.sr.usf0); s.integer(regs.sr.drs); s.integer(regs.sr.dma); s.integer(regs.sr.drc); s.integer(regs.sr.soc); s.integer(regs.sr.sic); s.integer(regs.sr.ei); s.integer(regs.sr.p1); s.integer(regs.sr.p0); s.integer(regs.dr); s.integer(regs.si); s.integer(regs.so); } fc/cpu/timing.cpp000664 001750 001750 00000002524 12651764221 015065 0ustar00sergiosergio000000 000000 uint8 CPU::op_read(uint16 addr) { if(status.oam_dma_pending) { status.oam_dma_pending = false; op_read(addr); oam_dma(); } while(status.rdy_line == 0) { regs.mdr = bus.read(status.rdy_addr_valid ? status.rdy_addr_value : addr); add_clocks(12); } regs.mdr = bus.read(addr); add_clocks(12); return regs.mdr; } void CPU::op_write(uint16 addr, uint8 data) { bus.write(addr, regs.mdr = data); add_clocks(12); } void CPU::last_cycle() { status.interrupt_pending = ((status.irq_line | status.irq_apu_line) & ~regs.p.i) | status.nmi_pending; } void CPU::nmi(uint16 &vector) { if(status.nmi_pending) { status.nmi_pending = false; vector = 0xfffa; } } void CPU::oam_dma() { for(unsigned n = 0; n < 256; n++) { uint8 data = op_read((status.oam_dma_page << 8) + n); op_write(0x2004, data); } } void CPU::set_nmi_line(bool line) { //edge-sensitive (0->1) if(!status.nmi_line && line) status.nmi_pending = true; status.nmi_line = line; } void CPU::set_irq_line(bool line) { //level-sensitive status.irq_line = line; } void CPU::set_irq_apu_line(bool line) { //level-sensitive status.irq_apu_line = line; } void CPU::set_rdy_line(bool line) { status.rdy_line = line; } void CPU::set_rdy_addr(bool valid, uint16 value) { status.rdy_addr_valid = valid; status.rdy_addr_value = value; } processor/upd96050/memory.cpp000664 001750 001750 00000002337 12651764221 017144 0ustar00sergiosergio000000 000000 uint8 uPD96050::sr_read() { return regs.sr >> 8; } void uPD96050::sr_write(uint8 data) { } uint8 uPD96050::dr_read() { if(regs.sr.drc == 0) { //16-bit if(regs.sr.drs == 0) { regs.sr.drs = 1; return regs.dr >> 0; } else { regs.sr.rqm = 0; regs.sr.drs = 0; return regs.dr >> 8; } } else { //8-bit regs.sr.rqm = 0; return regs.dr >> 0; } } void uPD96050::dr_write(uint8 data) { if(regs.sr.drc == 0) { //16-bit if(regs.sr.drs == 0) { regs.sr.drs = 1; regs.dr = (regs.dr & 0xff00) | (data << 0); } else { regs.sr.rqm = 0; regs.sr.drs = 0; regs.dr = (data << 8) | (regs.dr & 0x00ff); } } else { //8-bit regs.sr.rqm = 0; regs.dr = (regs.dr & 0xff00) | (data << 0); } } uint8 uPD96050::dp_read(uint12 addr) { bool hi = addr & 1; addr = (addr >> 1) & 2047; if(hi == false) { return dataRAM[addr] >> 0; } else { return dataRAM[addr] >> 8; } } void uPD96050::dp_write(uint12 addr, uint8 data) { bool hi = addr & 1; addr = (addr >> 1) & 2047; if(hi == false) { dataRAM[addr] = (dataRAM[addr] & 0xff00) | (data << 0); } else { dataRAM[addr] = (dataRAM[addr] & 0x00ff) | (data << 8); } } nall/string/char/000700 001750 001750 00000000000 12656700342 015044 5ustar00sergiosergio000000 000000 libco/libco.c000664 001750 001750 00000001147 12651764221 014237 0ustar00sergiosergio000000 000000 /* libco auto-selection module license: public domain */ #if (defined(__GNUC__) && defined(__i386__)) || (defined(_MSC_VER) && defined(_M_IX86)) #include "x86.c" #elif (defined(__GNUC__) && defined(__amd64__)) || (defined(_MSC_VER) && defined(_M_AMD64)) #include "amd64.c" #elif defined(__GNUC__) && defined(_ARCH_PPC) #include "ppc.c" #elif defined(__GNUC__) && (defined(__ARM_EABI__) || defined(__arm__)) #include "armeabi.c" #elif defined(__GNUC__) #include "sjlj.c" #elif defined(_MSC_VER) #include "fiber.c" #else #error "libco: unsupported processor, compiler or operating system" #endif sfc/alt/ppu-performance/background/background.hpp000664 001750 001750 00000002424 12651764221 023317 0ustar00sergiosergio000000 000000 class Background { struct ID { enum { BG1, BG2, BG3, BG4 }; }; struct Mode { enum { BPP2, BPP4, BPP8, Mode7, Inactive }; }; struct ScreenSize { enum { Size32x32, Size32x64, Size64x32, Size64x64 }; }; struct TileSize { enum { Size8x8, Size16x16 }; }; bool priority0_enable; bool priority1_enable; struct Regs { unsigned mode; unsigned priority0; unsigned priority1; bool tile_size; unsigned mosaic; unsigned screen_addr; unsigned screen_size; unsigned tiledata_addr; unsigned hoffset; unsigned voffset; bool main_enable; bool sub_enable; } regs; uint16 **mosaic_table; const unsigned id; unsigned opt_valid_bit; bool hires; signed width; unsigned tile_width; unsigned tile_height; unsigned mask_x; unsigned mask_y; unsigned scx; unsigned scy; unsigned hscroll; unsigned vscroll; unsigned mosaic_vcounter; unsigned mosaic_voffset; LayerWindow window; alwaysinline unsigned get_tile(unsigned hoffset, unsigned voffset); void offset_per_tile(unsigned x, unsigned y, unsigned& hoffset, unsigned& voffset); void scanline(); void render(); void render_mode7(); void serialize(serializer&); Background(PPU& self, unsigned id); ~Background(); PPU& self; friend class PPU; }; sfc/chip/cx4/data.cpp000664 001750 001750 00000027217 12651764221 015532 0ustar00sergiosergio000000 000000 #ifdef CX4_CPP const uint8 Cx4::immediate_data[48] = { 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x80, 0xff, 0xff, 0x7f, 0x00, 0x80, 0x00, 0xff, 0x7f, 0x00, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0xff, 0x00, 0x00, 0x01, 0xff, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0xfe, 0x00 }; const uint16 Cx4::wave_data[40] = { 0x0000, 0x0002, 0x0004, 0x0006, 0x0008, 0x000a, 0x000c, 0x000e, 0x0200, 0x0202, 0x0204, 0x0206, 0x0208, 0x020a, 0x020c, 0x020e, 0x0400, 0x0402, 0x0404, 0x0406, 0x0408, 0x040a, 0x040c, 0x040e, 0x0600, 0x0602, 0x0604, 0x0606, 0x0608, 0x060a, 0x060c, 0x060e, 0x0800, 0x0802, 0x0804, 0x0806, 0x0808, 0x080a, 0x080c, 0x080e }; const uint32 Cx4::sin_table[256] = { 0x000000, 0x000324, 0x000648, 0x00096c, 0x000c8f, 0x000fb2, 0x0012d5, 0x0015f6, 0x001917, 0x001c37, 0x001f56, 0x002273, 0x002590, 0x0028aa, 0x002bc4, 0x002edb, 0x0031f1, 0x003505, 0x003817, 0x003b26, 0x003e33, 0x00413e, 0x004447, 0x00474d, 0x004a50, 0x004d50, 0x00504d, 0x005347, 0x00563e, 0x005931, 0x005c22, 0x005f0e, 0x0061f7, 0x0064dc, 0x0067bd, 0x006a9b, 0x006d74, 0x007049, 0x007319, 0x0075e5, 0x0078ad, 0x007b70, 0x007e2e, 0x0080e7, 0x00839c, 0x00864b, 0x0088f5, 0x008b9a, 0x008e39, 0x0090d3, 0x009368, 0x0095f6, 0x00987f, 0x009b02, 0x009d7f, 0x009ff6, 0x00a267, 0x00a4d2, 0x00a736, 0x00a994, 0x00abeb, 0x00ae3b, 0x00b085, 0x00b2c8, 0x00b504, 0x00b73a, 0x00b968, 0x00bb8f, 0x00bdae, 0x00bfc7, 0x00c1d8, 0x00c3e2, 0x00c5e4, 0x00c7de, 0x00c9d1, 0x00cbbb, 0x00cd9f, 0x00cf7a, 0x00d14d, 0x00d318, 0x00d4db, 0x00d695, 0x00d848, 0x00d9f2, 0x00db94, 0x00dd2d, 0x00debe, 0x00e046, 0x00e1c5, 0x00e33c, 0x00e4aa, 0x00e60f, 0x00e76b, 0x00e8bf, 0x00ea09, 0x00eb4b, 0x00ec83, 0x00edb2, 0x00eed8, 0x00eff5, 0x00f109, 0x00f213, 0x00f314, 0x00f40b, 0x00f4fa, 0x00f5de, 0x00f6ba, 0x00f78b, 0x00f853, 0x00f912, 0x00f9c7, 0x00fa73, 0x00fb14, 0x00fbac, 0x00fc3b, 0x00fcbf, 0x00fd3a, 0x00fdab, 0x00fe13, 0x00fe70, 0x00fec4, 0x00ff0e, 0x00ff4e, 0x00ff84, 0x00ffb1, 0x00ffd3, 0x00ffec, 0x00fffb, 0x000000, 0xfffcdb, 0xfff9b7, 0xfff693, 0xfff370, 0xfff04d, 0xffed2a, 0xffea09, 0xffe6e8, 0xffe3c8, 0xffe0a9, 0xffdd8c, 0xffda6f, 0xffd755, 0xffd43b, 0xffd124, 0xffce0e, 0xffcafa, 0xffc7e8, 0xffc4d9, 0xffc1cc, 0xffbec1, 0xffbbb8, 0xffb8b2, 0xffb5af, 0xffb2af, 0xffafb2, 0xffacb8, 0xffa9c1, 0xffa6ce, 0xffa3dd, 0xffa0f1, 0xff9e08, 0xff9b23, 0xff9842, 0xff9564, 0xff928b, 0xff8fb6, 0xff8ce6, 0xff8a1a, 0xff8752, 0xff848f, 0xff81d1, 0xff7f18, 0xff7c63, 0xff79b4, 0xff770a, 0xff7465, 0xff71c6, 0xff6f2c, 0xff6c97, 0xff6a09, 0xff6780, 0xff64fd, 0xff6280, 0xff6009, 0xff5d98, 0xff5b2d, 0xff58c9, 0xff566b, 0xff5414, 0xff51c4, 0xff4f7a, 0xff4d37, 0xff4afb, 0xff48c5, 0xff4697, 0xff4470, 0xff4251, 0xff4038, 0xff3e27, 0xff3c1e, 0xff3a1b, 0xff3821, 0xff362e, 0xff3444, 0xff3260, 0xff3085, 0xff2eb2, 0xff2ce7, 0xff2b24, 0xff296a, 0xff27b7, 0xff260d, 0xff246b, 0xff22d2, 0xff2141, 0xff1fb9, 0xff1e3a, 0xff1cc3, 0xff1b55, 0xff19f0, 0xff1894, 0xff1740, 0xff15f6, 0xff14b4, 0xff137c, 0xff124d, 0xff1127, 0xff100a, 0xff0ef6, 0xff0dec, 0xff0ceb, 0xff0bf4, 0xff0b05, 0xff0a21, 0xff0945, 0xff0874, 0xff07ac, 0xff06ed, 0xff0638, 0xff058d, 0xff04eb, 0xff0453, 0xff03c4, 0xff0340, 0xff02c5, 0xff0254, 0xff01ec, 0xff018f, 0xff013b, 0xff00f1, 0xff00b1, 0xff007b, 0xff004e, 0xff002c, 0xff0013, 0xff0004 }; const int16 Cx4::SinTable[512] = { 0, 402, 804, 1206, 1607, 2009, 2410, 2811, 3211, 3611, 4011, 4409, 4808, 5205, 5602, 5997, 6392, 6786, 7179, 7571, 7961, 8351, 8739, 9126, 9512, 9896, 10278, 10659, 11039, 11416, 11793, 12167, 12539, 12910, 13278, 13645, 14010, 14372, 14732, 15090, 15446, 15800, 16151, 16499, 16846, 17189, 17530, 17869, 18204, 18537, 18868, 19195, 19519, 19841, 20159, 20475, 20787, 21097, 21403, 21706, 22005, 22301, 22594, 22884, 23170, 23453, 23732, 24007, 24279, 24547, 24812, 25073, 25330, 25583, 25832, 26077, 26319, 26557, 26790, 27020, 27245, 27466, 27684, 27897, 28106, 28310, 28511, 28707, 28898, 29086, 29269, 29447, 29621, 29791, 29956, 30117, 30273, 30425, 30572, 30714, 30852, 30985, 31114, 31237, 31357, 31471, 31581, 31685, 31785, 31881, 31971, 32057, 32138, 32214, 32285, 32351, 32413, 32469, 32521, 32568, 32610, 32647, 32679, 32706, 32728, 32745, 32758, 32765, 32767, 32765, 32758, 32745, 32728, 32706, 32679, 32647, 32610, 32568, 32521, 32469, 32413, 32351, 32285, 32214, 32138, 32057, 31971, 31881, 31785, 31685, 31581, 31471, 31357, 31237, 31114, 30985, 30852, 30714, 30572, 30425, 30273, 30117, 29956, 29791, 29621, 29447, 29269, 29086, 28898, 28707, 28511, 28310, 28106, 27897, 27684, 27466, 27245, 27020, 26790, 26557, 26319, 26077, 25832, 25583, 25330, 25073, 24812, 24547, 24279, 24007, 23732, 23453, 23170, 22884, 22594, 22301, 22005, 21706, 21403, 21097, 20787, 20475, 20159, 19841, 19519, 19195, 18868, 18537, 18204, 17869, 17530, 17189, 16846, 16499, 16151, 15800, 15446, 15090, 14732, 14372, 14010, 13645, 13278, 12910, 12539, 12167, 11793, 11416, 11039, 10659, 10278, 9896, 9512, 9126, 8739, 8351, 7961, 7571, 7179, 6786, 6392, 5997, 5602, 5205, 4808, 4409, 4011, 3611, 3211, 2811, 2410, 2009, 1607, 1206, 804, 402, 0, -402, -804, -1206, -1607, -2009, -2410, -2811, -3211, -3611, -4011, -4409, -4808, -5205, -5602, -5997, -6392, -6786, -7179, -7571, -7961, -8351, -8739, -9126, -9512, -9896, -10278, -10659, -11039, -11416, -11793, -12167, -12539, -12910, -13278, -13645, -14010, -14372, -14732, -15090, -15446, -15800, -16151, -16499, -16846, -17189, -17530, -17869, -18204, -18537, -18868, -19195, -19519, -19841, -20159, -20475, -20787, -21097, -21403, -21706, -22005, -22301, -22594, -22884, -23170, -23453, -23732, -24007, -24279, -24547, -24812, -25073, -25330, -25583, -25832, -26077, -26319, -26557, -26790, -27020, -27245, -27466, -27684, -27897, -28106, -28310, -28511, -28707, -28898, -29086, -29269, -29447, -29621, -29791, -29956, -30117, -30273, -30425, -30572, -30714, -30852, -30985, -31114, -31237, -31357, -31471, -31581, -31685, -31785, -31881, -31971, -32057, -32138, -32214, -32285, -32351, -32413, -32469, -32521, -32568, -32610, -32647, -32679, -32706, -32728, -32745, -32758, -32765, -32767, -32765, -32758, -32745, -32728, -32706, -32679, -32647, -32610, -32568, -32521, -32469, -32413, -32351, -32285, -32214, -32138, -32057, -31971, -31881, -31785, -31685, -31581, -31471, -31357, -31237, -31114, -30985, -30852, -30714, -30572, -30425, -30273, -30117, -29956, -29791, -29621, -29447, -29269, -29086, -28898, -28707, -28511, -28310, -28106, -27897, -27684, -27466, -27245, -27020, -26790, -26557, -26319, -26077, -25832, -25583, -25330, -25073, -24812, -24547, -24279, -24007, -23732, -23453, -23170, -22884, -22594, -22301, -22005, -21706, -21403, -21097, -20787, -20475, -20159, -19841, -19519, -19195, -18868, -18537, -18204, -17869, -17530, -17189, -16846, -16499, -16151, -15800, -15446, -15090, -14732, -14372, -14010, -13645, -13278, -12910, -12539, -12167, -11793, -11416, -11039, -10659, -10278, -9896, -9512, -9126, -8739, -8351, -7961, -7571, -7179, -6786, -6392, -5997, -5602, -5205, -4808, -4409, -4011, -3611, -3211, -2811, -2410, -2009, -1607, -1206, -804, -402 }; const int16 Cx4::CosTable[512] = { 32767, 32765, 32758, 32745, 32728, 32706, 32679, 32647, 32610, 32568, 32521, 32469, 32413, 32351, 32285, 32214, 32138, 32057, 31971, 31881, 31785, 31685, 31581, 31471, 31357, 31237, 31114, 30985, 30852, 30714, 30572, 30425, 30273, 30117, 29956, 29791, 29621, 29447, 29269, 29086, 28898, 28707, 28511, 28310, 28106, 27897, 27684, 27466, 27245, 27020, 26790, 26557, 26319, 26077, 25832, 25583, 25330, 25073, 24812, 24547, 24279, 24007, 23732, 23453, 23170, 22884, 22594, 22301, 22005, 21706, 21403, 21097, 20787, 20475, 20159, 19841, 19519, 19195, 18868, 18537, 18204, 17869, 17530, 17189, 16846, 16499, 16151, 15800, 15446, 15090, 14732, 14372, 14010, 13645, 13278, 12910, 12539, 12167, 11793, 11416, 11039, 10659, 10278, 9896, 9512, 9126, 8739, 8351, 7961, 7571, 7179, 6786, 6392, 5997, 5602, 5205, 4808, 4409, 4011, 3611, 3211, 2811, 2410, 2009, 1607, 1206, 804, 402, 0, -402, -804, -1206, -1607, -2009, -2410, -2811, -3211, -3611, -4011, -4409, -4808, -5205, -5602, -5997, -6392, -6786, -7179, -7571, -7961, -8351, -8739, -9126, -9512, -9896, -10278, -10659, -11039, -11416, -11793, -12167, -12539, -12910, -13278, -13645, -14010, -14372, -14732, -15090, -15446, -15800, -16151, -16499, -16846, -17189, -17530, -17869, -18204, -18537, -18868, -19195, -19519, -19841, -20159, -20475, -20787, -21097, -21403, -21706, -22005, -22301, -22594, -22884, -23170, -23453, -23732, -24007, -24279, -24547, -24812, -25073, -25330, -25583, -25832, -26077, -26319, -26557, -26790, -27020, -27245, -27466, -27684, -27897, -28106, -28310, -28511, -28707, -28898, -29086, -29269, -29447, -29621, -29791, -29956, -30117, -30273, -30425, -30572, -30714, -30852, -30985, -31114, -31237, -31357, -31471, -31581, -31685, -31785, -31881, -31971, -32057, -32138, -32214, -32285, -32351, -32413, -32469, -32521, -32568, -32610, -32647, -32679, -32706, -32728, -32745, -32758, -32765, -32767, -32765, -32758, -32745, -32728, -32706, -32679, -32647, -32610, -32568, -32521, -32469, -32413, -32351, -32285, -32214, -32138, -32057, -31971, -31881, -31785, -31685, -31581, -31471, -31357, -31237, -31114, -30985, -30852, -30714, -30572, -30425, -30273, -30117, -29956, -29791, -29621, -29447, -29269, -29086, -28898, -28707, -28511, -28310, -28106, -27897, -27684, -27466, -27245, -27020, -26790, -26557, -26319, -26077, -25832, -25583, -25330, -25073, -24812, -24547, -24279, -24007, -23732, -23453, -23170, -22884, -22594, -22301, -22005, -21706, -21403, -21097, -20787, -20475, -20159, -19841, -19519, -19195, -18868, -18537, -18204, -17869, -17530, -17189, -16846, -16499, -16151, -15800, -15446, -15090, -14732, -14372, -14010, -13645, -13278, -12910, -12539, -12167, -11793, -11416, -11039, -10659, -10278, -9896, -9512, -9126, -8739, -8351, -7961, -7571, -7179, -6786, -6392, -5997, -5602, -5205, -4808, -4409, -4011, -3611, -3211, -2811, -2410, -2009, -1607, -1206, -804, -402, 0, 402, 804, 1206, 1607, 2009, 2410, 2811, 3211, 3611, 4011, 4409, 4808, 5205, 5602, 5997, 6392, 6786, 7179, 7571, 7961, 8351, 8739, 9126, 9512, 9896, 10278, 10659, 11039, 11416, 11793, 12167, 12539, 12910, 13278, 13645, 14010, 14372, 14732, 15090, 15446, 15800, 16151, 16499, 16846, 17189, 17530, 17869, 18204, 18537, 18868, 19195, 19519, 19841, 20159, 20475, 20787, 21097, 21403, 21706, 22005, 22301, 22594, 22884, 23170, 23453, 23732, 24007, 24279, 24547, 24812, 25073, 25330, 25583, 25832, 26077, 26319, 26557, 26790, 27020, 27245, 27466, 27684, 27897, 28106, 28310, 28511, 28707, 28898, 29086, 29269, 29447, 29621, 29791, 29956, 30117, 30273, 30425, 30572, 30714, 30852, 30985, 31114, 31237, 31357, 31471, 31581, 31685, 31785, 31881, 31971, 32057, 32138, 32214, 32285, 32351, 32413, 32469, 32521, 32568, 32610, 32647, 32679, 32706, 32728, 32745, 32758, 32765 }; #endif sfc/ppu/background/mode7.cpp000664 001750 001750 00000005332 12651764221 017130 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP signed PPU::Background::clip(signed n) { //13-bit sign extend: --s---nnnnnnnnnn -> ssssssnnnnnnnnnn return n & 0x2000 ? (n | ~1023) : (n & 1023); } //H = 28 void PPU::Background::begin_mode7() { cache.hoffset = self.regs.mode7_hoffset; cache.voffset = self.regs.mode7_voffset; } void PPU::Background::run_mode7() { signed a = sclip<16>(self.regs.m7a); signed b = sclip<16>(self.regs.m7b); signed c = sclip<16>(self.regs.m7c); signed d = sclip<16>(self.regs.m7d); signed cx = sclip<13>(self.regs.m7x); signed cy = sclip<13>(self.regs.m7y); signed hoffset = sclip<13>(cache.hoffset); signed voffset = sclip<13>(cache.voffset); if(Background::x++ & ~255) return; unsigned x = mosaic.hoffset; unsigned y = self.bg1.mosaic.voffset; //BG2 vertical mosaic uses BG1 mosaic size if(--mosaic.hcounter == 0) { mosaic.hcounter = regs.mosaic + 1; mosaic.hoffset += regs.mosaic + 1; } if(self.regs.mode7_hflip) x = 255 - x; if(self.regs.mode7_vflip) y = 255 - y; signed psx = ((a * clip(hoffset - cx)) & ~63) + ((b * clip(voffset - cy)) & ~63) + ((b * y) & ~63) + (cx << 8); signed psy = ((c * clip(hoffset - cx)) & ~63) + ((d * clip(voffset - cy)) & ~63) + ((d * y) & ~63) + (cy << 8); signed px = psx + (a * x); signed py = psy + (c * x); //mask pseudo-FP bits px >>= 8; py >>= 8; unsigned tile; unsigned palette; switch(self.regs.mode7_repeat) { //screen repetition outside of screen area case 0: case 1: px &= 1023; py &= 1023; tile = ppu.vram[((py >> 3) * 128 + (px >> 3)) << 1]; palette = ppu.vram[(((tile << 6) + ((py & 7) << 3) + (px & 7)) << 1) + 1]; break; //palette color 0 outside of screen area case 2: if((px | py) & ~1023) { palette = 0; } else { px &= 1023; py &= 1023; tile = ppu.vram[((py >> 3) * 128 + (px >> 3)) << 1]; palette = ppu.vram[(((tile << 6) + ((py & 7) << 3) + (px & 7)) << 1) + 1]; } break; //character 0 repetition outside of screen area case 3: if((px | py) & ~1023) { tile = 0; } else { px &= 1023; py &= 1023; tile = ppu.vram[((py >> 3) * 128 + (px >> 3)) << 1]; } palette = ppu.vram[(((tile << 6) + ((py & 7) << 3) + (px & 7)) << 1) + 1]; break; } unsigned priority; if(id == ID::BG1) { priority = regs.priority0; } else if(id == ID::BG2) { priority = (palette & 0x80 ? regs.priority1 : regs.priority0); palette &= 0x7f; } if(palette == 0) return; if(regs.main_enable) { output.main.palette = palette; output.main.priority = priority; output.main.tile = 0; } if(regs.sub_enable) { output.sub.palette = palette; output.sub.priority = priority; output.sub.tile = 0; } } #endif processor/hg51b/hg51b.cpp000664 001750 001750 00000000753 12651764221 016254 0ustar00sergiosergio000000 000000 #include #include "hg51b.hpp" namespace Processor { #include "registers.cpp" #include "instructions.cpp" #include "serialization.cpp" void HG51B::exec(uint24 addr) { if(regs.halt) return; addr = addr + regs.pc * 2; opcode = bus_read(addr++) << 0; opcode |= bus_read(addr++) << 8; regs.pc = (regs.pc & 0xffff00) | ((regs.pc + 1) & 0x0000ff); instruction(); } void HG51B::power() { regs.halt = true; regs.n = 0; regs.z = 0; regs.c = 0; } } fc/cartridge/board/nes-axrom.cpp000664 001750 001750 00000001672 12651764221 017756 0ustar00sergiosergio000000 000000 //NES-AMROM //NES-ANROM //NES-AN1ROM //NES-AOROM struct NES_AxROM : Board { uint4 prg_bank; bool mirror_select; uint8 prg_read(unsigned addr) { if(addr & 0x8000) return prgrom.read((prg_bank << 15) | (addr & 0x7fff)); return cpu.mdr(); } void prg_write(unsigned addr, uint8 data) { if(addr & 0x8000) { prg_bank = data & 0x0f; mirror_select = data & 0x10; } } uint8 chr_read(unsigned addr) { if(addr & 0x2000) return ppu.ciram_read((mirror_select << 10) | (addr & 0x03ff)); return Board::chr_read(addr); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) return ppu.ciram_write((mirror_select << 10) | (addr & 0x03ff), data); return Board::chr_write(addr, data); } void power() { } void reset() { prg_bank = 0x0f; mirror_select = 0; } void serialize(serializer& s) { Board::serialize(s); s.integer(prg_bank); s.integer(mirror_select); } NES_AxROM(Markup::Node& document) : Board(document) { } }; nall/emulation/super-famicom-usart.hpp000664 001750 001750 00000004514 12651764221 021253 0ustar00sergiosergio000000 000000 #ifndef NALL_EMULATION_SUPER_FAMICOM_USART_HPP #define NALL_EMULATION_SUPER_FAMICOM_USART_HPP #include #include #include #include #include #include #include #define usartproc dllexport static nall::function usart_quit; static nall::function usart_usleep; static nall::function usart_readable; static nall::function usart_read; static nall::function usart_writable; static nall::function usart_write; extern "C" usartproc void usart_init( nall::function quit, nall::function usleep, nall::function readable, nall::function read, nall::function writable, nall::function write ) { usart_quit = quit; usart_usleep = usleep; usart_readable = readable; usart_read = read; usart_writable = writable; usart_write = write; } extern "C" usartproc void usart_main(int, char**); // static nall::serial usart; static bool usart_is_virtual = true; static bool usart_sigint = false; static bool usart_virtual() { return usart_is_virtual; } // static bool usarthw_quit() { return usart_sigint; } static void usarthw_usleep(unsigned milliseconds) { usleep(milliseconds); } static bool usarthw_readable() { return usart.readable(); } static uint8_t usarthw_read() { while(true) { uint8_t buffer[1]; signed length = usart.read((uint8_t*)&buffer, 1); if(length > 0) return buffer[0]; } } static bool usarthw_writable() { return usart.writable(); } static void usarthw_write(uint8_t data) { uint8_t buffer[1] = { data }; usart.write((uint8_t*)&buffer, 1); } static void sigint(int) { signal(SIGINT, SIG_DFL); usart_sigint = true; } int main(int argc, char** argv) { setpriority(PRIO_PROCESS, 0, -20); //requires superuser privileges; otherwise priority = +0 signal(SIGINT, sigint); if(usart.open("/dev/ttyACM0", 57600, true) == false) { printf("error: unable to open USART hardware device\n"); return 0; } usart_is_virtual = false; usart_init(usarthw_quit, usarthw_usleep, usarthw_readable, usarthw_read, usarthw_writable, usarthw_write); usart_main(argc, argv); usart.close(); return 0; } #endif target-ethos/tools/tools.hpp000664 001750 001750 00000000374 12651764221 017333 0ustar00sergiosergio000000 000000 struct ToolsLayout : VerticalLayout { ToolsLayout(); }; #include "cheat-database.hpp" #include "cheat-editor.hpp" #include "state-manager.hpp" struct Tools : Window { VerticalLayout layout; TabFrame panels; Tools(); }; extern Tools* tools; fc/system/000700 001750 001750 00000000000 12656700342 013607 5ustar00sergiosergio000000 000000 fc/cartridge/board/nes-sxrom.cpp000664 001750 001750 00000003677 12651764221 020007 0ustar00sergiosergio000000 000000 struct NES_SxROM : Board { enum class Revision : unsigned { SAROM, SBROM, SCROM, SC1ROM, SEROM, SFROM, SGROM, SHROM, SH1ROM, SIROM, SJROM, SKROM, SLROM, SL1ROM, SL2ROM, SL3ROM, SLRROM, SMROM, SNROM, SOROM, SUROM, SXROM, } revision; MMC1 mmc1; void main() { return mmc1.main(); } unsigned ram_addr(unsigned addr) { unsigned bank = 0; if(revision == Revision::SOROM) bank = (mmc1.chr_bank[0] & 0x08) >> 3; if(revision == Revision::SUROM) bank = (mmc1.chr_bank[0] & 0x0c) >> 2; if(revision == Revision::SXROM) bank = (mmc1.chr_bank[0] & 0x0c) >> 2; return (bank << 13) | (addr & 0x1fff); } uint8 prg_read(unsigned addr) { if((addr & 0xe000) == 0x6000) { if(revision == Revision::SNROM) { if(mmc1.chr_bank[0] & 0x10) return cpu.mdr(); } if(mmc1.ram_disable) return 0x00; return prgram.read(ram_addr(addr)); } if(addr & 0x8000) { addr = mmc1.prg_addr(addr); if(revision == Revision::SXROM) { addr |= ((mmc1.chr_bank[0] & 0x10) >> 4) << 18; } return prgrom.read(addr); } return cpu.mdr(); } void prg_write(unsigned addr, uint8 data) { if((addr & 0xe000) == 0x6000) { if(revision == Revision::SNROM) { if(mmc1.chr_bank[0] & 0x10) return; } if(mmc1.ram_disable) return; return prgram.write(ram_addr(addr), data); } if(addr & 0x8000) return mmc1.mmio_write(addr, data); } uint8 chr_read(unsigned addr) { if(addr & 0x2000) return ppu.ciram_read(mmc1.ciram_addr(addr)); return Board::chr_read(mmc1.chr_addr(addr)); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) return ppu.ciram_write(mmc1.ciram_addr(addr), data); return Board::chr_write(mmc1.chr_addr(addr), data); } void power() { mmc1.power(); } void reset() { mmc1.reset(); } void serialize(serializer& s) { Board::serialize(s); mmc1.serialize(s); } NES_SxROM(Markup::Node& document) : Board(document), mmc1(*this) { revision = Revision::SXROM; } }; sfc/system/serialization.cpp000664 001750 001750 00000005654 12651764221 017402 0ustar00sergiosergio000000 000000 #ifdef SYSTEM_CPP serializer System::serialize() { serializer s(serialize_size); unsigned signature = 0x31545342, version = Info::SerializerVersion; char hash[64], description[512], profile[16]; memcpy(&hash, (const char*)cartridge.sha256(), 64); memset(&description, 0, sizeof description); memset(&profile, 0, sizeof profile); strmcpy(profile, Emulator::Profile, sizeof profile); s.integer(signature); s.integer(version); s.array(hash); s.array(description); s.array(profile); serialize_all(s); return s; } bool System::unserialize(serializer& s) { unsigned signature, version; char hash[64], description[512], profile[16]; s.integer(signature); s.integer(version); s.array(hash); s.array(description); s.array(profile); if(signature != 0x31545342) return false; if(version != Info::SerializerVersion) return false; if(strcmp(profile, Emulator::Profile)) return false; power(); serialize_all(s); return true; } //======== //internal //======== void System::serialize(serializer& s) { s.integer((unsigned&)region); s.integer((unsigned&)expansion); } void System::serialize_all(serializer& s) { cartridge.serialize(s); system.serialize(s); random.serialize(s); cpu.serialize(s); smp.serialize(s); ppu.serialize(s); dsp.serialize(s); if(cartridge.has_gb_slot()) icd2.serialize(s); if(cartridge.has_bs_cart()) bsxcartridge.serialize(s); if(cartridge.has_event()) event.serialize(s); if(cartridge.has_sa1()) sa1.serialize(s); if(cartridge.has_superfx()) superfx.serialize(s); if(cartridge.has_armdsp()) armdsp.serialize(s); if(cartridge.has_hitachidsp()) hitachidsp.serialize(s); if(cartridge.has_necdsp()) necdsp.serialize(s); if(cartridge.has_epsonrtc()) epsonrtc.serialize(s); if(cartridge.has_sharprtc()) sharprtc.serialize(s); if(cartridge.has_spc7110()) spc7110.serialize(s); if(cartridge.has_sdd1()) sdd1.serialize(s); if(cartridge.has_obc1()) obc1.serialize(s); if(cartridge.has_hsu1()) hsu1.serialize(s); if(cartridge.has_msu1()) msu1.serialize(s); if(cartridge.has_st_slots()) sufamiturboA.serialize(s), sufamiturboB.serialize(s); if(cartridge.has_dsp1()) dsp1.serialize(s); if(cartridge.has_dsp2()) dsp2.serialize(s); //if(cartridge.has_dsp3()) dsp3.serialize(s); //if(cartridge.has_dsp4()) dsp4.serialize(s); if(cartridge.has_cx4()) cx4.serialize(s); if(cartridge.has_st0010()) st0010.serialize(s); if(cartridge.has_sgbexternal()) sgbExternal.serialize(s); } //perform dry-run state save: //determines exactly how many bytes are needed to save state for this cartridge, //as amount varies per game (eg different RAM sizes, special chips, etc.) void System::serialize_init() { serializer s; unsigned signature = 0, version = 0; char hash[64], profile[16], description[512]; s.integer(signature); s.integer(version); s.array(hash); s.array(profile); s.array(description); serialize_all(s); serialize_size = s.size(); } #endif profile/Game Boy Advance.sys/000700 001750 001750 00000000000 12656700342 017055 5ustar00sergiosergio000000 000000 gb/interface/interface.cpp000664 001750 001750 00000007706 12651764221 016716 0ustar00sergiosergio000000 000000 #include namespace GameBoy { Interface* interface = nullptr; void Interface::lcdScanline() { if(hook) hook->lcdScanline(); } void Interface::joypWrite(bool p15, bool p14) { if(hook) hook->joypWrite(p15, p14); } string Interface::title() { return cartridge.title(); } double Interface::videoFrequency() { return 4194304.0 / (154.0 * 456.0); } double Interface::audioFrequency() { return 4194304.0 / 2.0; } bool Interface::loaded() { return cartridge.loaded(); } string Interface::sha256() { return cartridge.sha256(); } unsigned Interface::group(unsigned id) { switch(id) { case ID::GameBoyBootROM: case ID::SuperGameBoyBootROM: case ID::GameBoyColorBootROM: return 0; case ID::Manifest: case ID::ROM: case ID::RAM: switch(system.revision) { case System::Revision::GameBoy: return ID::GameBoy; case System::Revision::SuperGameBoy: return ID::SuperGameBoy; case System::Revision::GameBoyColor: return ID::GameBoyColor; } throw; } throw; } void Interface::load(unsigned id) { if(id == ID::GameBoy) cartridge.load(System::Revision::GameBoy); if(id == ID::SuperGameBoy) cartridge.load(System::Revision::SuperGameBoy); if(id == ID::GameBoyColor) cartridge.load(System::Revision::GameBoyColor); } void Interface::save() { for(auto& memory : cartridge.memory) { interface->saveRequest(memory.id, memory.name); } } void Interface::load(unsigned id, const stream& stream) { if(id == ID::GameBoyBootROM) { stream.read(system.bootROM.dmg, min( 256u, stream.size())); } if(id == ID::SuperGameBoyBootROM) { stream.read(system.bootROM.sgb, min( 256u, stream.size())); } if(id == ID::GameBoyColorBootROM) { stream.read(system.bootROM.cgb, min(2048u, stream.size())); } if(id == ID::Manifest) cartridge.information.markup = stream.text(); if(id == ID::ROM) { stream.read(cartridge.romdata, min(cartridge.romsize, stream.size())); } if(id == ID::RAM) { stream.read(cartridge.ramdata, min(stream.size(), cartridge.ramsize)); } } void Interface::save(unsigned id, const stream& stream) { if(id == ID::RAM) { stream.write(cartridge.ramdata, cartridge.ramsize); } } void Interface::unload() { save(); cartridge.unload(); } void Interface::power() { system.power(); } void Interface::reset() { system.power(); } void Interface::run() { system.run(); } serializer Interface::serialize() { system.runtosave(); return system.serialize(); } bool Interface::unserialize(serializer& s) { return system.unserialize(s); } void Interface::cheatSet(const lstring& list) { cheat.reset(); for(auto& codeset : list) { lstring codes = codeset.split("+"); for(auto& code : codes) { lstring part = code.split("/"); if(part.size() == 2) cheat.append(hex(part[0]), hex(part[1])); if(part.size() == 3) cheat.append(hex(part[0]), hex(part[1]), hex(part[2])); } } } void Interface::paletteUpdate(PaletteMode mode) { video.generate_palette(mode); } Interface::Interface() { interface = this; hook = nullptr; information.name = "Game Boy"; information.width = 160; information.height = 144; information.overscan = false; information.aspectRatio = 1.0; information.resettable = false; information.capability.states = true; information.capability.cheats = true; media.append({ID::GameBoy, "Game Boy", "gb" , true}); media.append({ID::GameBoyColor, "Game Boy Color", "gbc", true}); { Device device{0, ID::Device, "Controller"}; device.input.append({0, 0, "Up" }); device.input.append({1, 0, "Down" }); device.input.append({2, 0, "Left" }); device.input.append({3, 0, "Right" }); device.input.append({4, 0, "B" }); device.input.append({5, 0, "A" }); device.input.append({6, 0, "Select"}); device.input.append({7, 0, "Start" }); device.order = {0, 1, 2, 3, 4, 5, 6, 7}; this->device.append(device); } port.append({0, "Device", {device[0]}}); } } phoenix/cocoa/widget/000700 001750 001750 00000000000 12656700342 015714 5ustar00sergiosergio000000 000000 sfc/cartridge/markup.cpp000664 001750 001750 00000052063 12651764221 016440 0ustar00sergiosergio000000 000000 #ifdef CARTRIDGE_CPP void Cartridge::parse_markup(const char* markup) { auto document = Markup::Document(markup); information.title.cartridge = document["information/title"].text(); auto cartridge = document["cartridge"]; region = cartridge["region"].data != "PAL" ? Region::NTSC : Region::PAL; mapping.reset(); parse_markup_cartridge(cartridge); parse_markup_icd2(cartridge["icd2"]); parse_markup_bsx(cartridge["bsx"]); parse_markup_satellaview(cartridge["satellaview"]); parse_markup_sufamiturbo(cartridge["sufamiturbo[0]"], 0); parse_markup_sufamiturbo(cartridge["sufamiturbo[1]"], 1); parse_markup_nss(cartridge["nss"]); parse_markup_event(cartridge["event"]); parse_markup_sa1(cartridge["sa1"]); parse_markup_superfx(cartridge["superfx"]); parse_markup_armdsp(cartridge["armdsp"]); parse_markup_hitachidsp(cartridge["hitachidsp"], cartridge["board/type"].data.match("2DC*") ? 2 : 1); parse_markup_necdsp(cartridge["necdsp"]); parse_markup_epsonrtc(cartridge["epsonrtc"]); parse_markup_sharprtc(cartridge["sharprtc"]); parse_markup_spc7110(cartridge["spc7110"]); parse_markup_sdd1(cartridge["sdd1"]); parse_markup_obc1(cartridge["obc1"]); parse_markup_hsu1(cartridge["hsu1"]); parse_markup_msu1(cartridge["msu1"]); } // void Cartridge::parse_markup_map(Mapping& m, Markup::Node map) { m.addr = map["address"].data; m.size = numeral(map["size"].data); m.base = numeral(map["base"].data); m.mask = numeral(map["mask"].data); } void Cartridge::parse_markup_memory(MappedRAM& ram, Markup::Node node, unsigned id, bool writable) { string name = node["name"].data; unsigned size = numeral(node["size"].data); ram.map(allocate(size, 0xff), size); if(name.empty() == false) { interface->loadRequest(id, name); if(writable) memory.append({id, name}); } } // void Cartridge::parse_markup_cartridge(Markup::Node root) { if(root.exists() == false) return; parse_markup_memory(rom, root["rom"], ID::ROM, false); parse_markup_memory(ram, root["ram"], ID::RAM, true); for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "rom") { Mapping m(rom); parse_markup_map(m, node); if(m.size == 0) m.size = rom.size(); m.fastmode = Mapping::fastmode_readonly; m.fastptr = rom.data(); mapping.append(m); } if(node["id"].data == "ram") { Mapping m(ram); parse_markup_map(m, node); if(m.size == 0) m.size = ram.size(); m.fastmode = Mapping::fastmode_readwrite; m.fastptr = ram.data(); mapping.append(m); } } } void Cartridge::parse_markup_icd2(Markup::Node root) { if(root.exists() == false) return; if(interface->bind->altImplementation(Alt::ForSuperGameBoy)==Alt::SuperGameBoy::External) { if (parse_markup_icd2_external(root)) return; } has_gb_slot = true; icd2.revision = max(1, numeral(root["revision"].data)); GameBoy::cartridge.load_empty(GameBoy::System::Revision::SuperGameBoy); interface->loadRequest(ID::SuperGameBoy, "Game Boy", "gb"); string bootROMName = root["rom"]["name"].data; interface->loadRequest(ID::SuperGameBoyBootROM, bootROMName); for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&ICD2::read, &icd2}, {&ICD2::write, &icd2}); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_bsx(Markup::Node root) { if(root.exists() == false) return; has_bs_cart = true; has_bs_slot = true; interface->loadRequest(ID::Satellaview, "BS-X Satellaview", "bs"); parse_markup_memory(bsxcartridge.rom, root["rom"], ID::BsxROM, false); parse_markup_memory(bsxcartridge.ram, root["ram"], ID::BsxRAM, true); parse_markup_memory(bsxcartridge.psram, root["psram"], ID::BsxPSRAM, true); for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "rom" || node["id"].data == "ram") { Mapping m({&BSXCartridge::mcu_read, &bsxcartridge}, {&BSXCartridge::mcu_write, &bsxcartridge}); parse_markup_map(m, node); mapping.append(m); } if(node["id"].data == "io") { Mapping m({&BSXCartridge::mmio_read, &bsxcartridge}, {&BSXCartridge::mmio_write, &bsxcartridge}); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_satellaview(Markup::Node root) { if(root.exists() == false) return; has_bs_slot = true; interface->loadRequest(ID::Satellaview, "BS-X Satellaview", "bs"); for(auto& node : root.find("map")) { if(node["id"].data == "rom") { if(satellaviewcartridge.memory.size() == 0) continue; Mapping m(satellaviewcartridge); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_sufamiturbo(Markup::Node root, bool slot) { if(root.exists() == false) return; has_st_slots = true; if(slot == 0) { //load required slot A (will request slot B if slot A cartridge is linkable) interface->loadRequest(ID::SufamiTurboSlotA, "Sufami Turbo - Slot A", "st"); } for(auto& node : root.find("map")) { SufamiTurboCartridge &cart = (slot == 0 ? sufamiturboA : sufamiturboB); if(node["id"].data == "rom") { if(cart.rom.size() == 0) continue; Mapping m(cart.rom); parse_markup_map(m, node); if(m.size == 0) m.size = cart.rom.size(); if(m.size) mapping.append(m); } if(node["id"].data == "ram") { if(cart.ram.size() == 0) continue; Mapping m(cart.ram); parse_markup_map(m, node); if(m.size == 0) m.size = cart.ram.size(); if(m.size) mapping.append(m); } } } void Cartridge::parse_markup_nss(Markup::Node root) { if(root.exists() == false) return; has_nss_dip = true; nss.dip = interface->dipSettings(root); for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&NSS::read, &nss}, {&NSS::write, &nss}); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_event(Markup::Node root) { if(root.exists() == false) return; has_event = true; for(auto& node : root) { if(node.name != "rom") continue; unsigned id = numeral(node["id"].data); if(id > 3) continue; parse_markup_memory(event.rom[id], node, ID::EventROM0 + id, false); } parse_markup_memory(event.ram, root["ram"], ID::EventRAM, true); event.board = Event::Board::CampusChallenge92; if(root["name"].data == "Campus Challenge '92") event.board = Event::Board::CampusChallenge92; if(root["name"].data == "Powerfest '94") event.board = Event::Board::Powerfest94; event.revision = root["revision"].data == "B" ? 2 : 1; lstring part = root["timer"].data.split<1>(":"); if(part.size() == 1) event.timer = decimal(part(0)); if(part.size() == 2) event.timer = decimal(part(0)) * 60 + decimal(part(1)); for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "rom") { Mapping m({&Event::rom_read, &event}, [](unsigned, uint8) {}); parse_markup_map(m, node); mapping.append(m); } if(node["id"].data == "ram") { Mapping m({&Event::ram_read, &event}, {&Event::ram_write, &event}); parse_markup_map(m, node); mapping.append(m); } if(node["id"].data == "dr") { Mapping m([](unsigned) -> uint8 { return cpu.regs.mdr; }, {&Event::dr, &event}); parse_markup_map(m, node); mapping.append(m); } if(node["id"].data == "sr") { Mapping m({&Event::sr, &event}, [](unsigned, uint8) {}); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_sa1(Markup::Node root) { if(root.exists() == false) return; has_sa1 = true; parse_markup_memory(sa1.rom, root["rom"], ID::SA1ROM, false); parse_markup_memory(sa1.bwram, root["ram[0]"], ID::SA1BWRAM, true); parse_markup_memory(sa1.iram, root["ram[1]"], ID::SA1IRAM, true); for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&SA1::mmio_read, &sa1}, {&SA1::mmio_write, &sa1}); parse_markup_map(m, node); mapping.append(m); } if(node["id"].data == "rom") { Mapping m({&SA1::mmcrom_read, &sa1}, {&SA1::mmcrom_write, &sa1}); parse_markup_map(m, node); mapping.append(m); } if(node["id"].data == "bwram") { Mapping m({&SA1::mmcbwram_read, &sa1}, {&SA1::mmcbwram_write, &sa1}); parse_markup_map(m, node); mapping.append(m); } if(node["id"].data == "iram") { Mapping m(sa1.cpuiram); parse_markup_map(m, node); if(m.size == 0) m.size = sa1.cpuiram.size(); mapping.append(m); } } } void Cartridge::parse_markup_superfx(Markup::Node root) { if(root.exists() == false) return; has_superfx = true; parse_markup_memory(superfx.rom, root["rom"], ID::SuperFXROM, false); parse_markup_memory(superfx.ram, root["ram"], ID::SuperFXRAM, true); for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&SuperFX::mmio_read, &superfx}, {&SuperFX::mmio_write, &superfx}); parse_markup_map(m, node); mapping.append(m); } if(node["id"].data == "rom") { Mapping m(superfx.cpurom); parse_markup_map(m, node); if(m.size == 0) m.size = superfx.rom.size(); mapping.append(m); } if(node["id"].data == "ram") { Mapping m(superfx.cpuram); parse_markup_map(m, node); if(m.size == 0) m.size = superfx.ram.size(); mapping.append(m); } } } void Cartridge::parse_markup_armdsp(Markup::Node root) { if(root.exists() == false) return; has_armdsp = true; string programROMName = root["rom[0]/name"].data; string dataROMName = root["rom[1]/name"].data; string dataRAMName = root["ram/name"].data; interface->loadRequest(ID::ArmDSPPROM, programROMName); interface->loadRequest(ID::ArmDSPDROM, dataROMName); if(dataRAMName.empty() == false) { interface->loadRequest(ID::ArmDSPRAM, dataRAMName); memory.append({ID::ArmDSPRAM, dataRAMName}); } for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&ArmDSP::mmio_read, &armdsp}, {&ArmDSP::mmio_write, &armdsp}); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_hitachidsp(Markup::Node root, unsigned roms) { if(root.exists() == false) return; if(interface->bind->altImplementation(Alt::ForDSP) == Alt::DSP::HLE) { //this is after checking existence because we don't want to ask which DSP to use and then use none of them parse_markup_hitachidsp_hle(root); return; } has_hitachidsp = true; parse_markup_memory(hitachidsp.rom, root["rom[0]"], ID::HitachiDSPROM, false); parse_markup_memory(hitachidsp.ram, root["ram[0]"], ID::HitachiDSPRAM, true); for(auto& word : hitachidsp.dataROM) word = 0x000000; for(auto& word : hitachidsp.dataRAM) word = 0x00; hitachidsp.Frequency = numeral(root["frequency"].data); if(hitachidsp.Frequency == 0) hitachidsp.frequency = 20000000; hitachidsp.Roms = roms; string dataROMName = root["rom[1]/name"].data; string dataRAMName = root["ram[1]/name"].data; interface->loadRequest(ID::HitachiDSPDROM, dataROMName); if(dataRAMName.empty() == false) { interface->loadRequest(ID::HitachiDSPDRAM, dataRAMName); } for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&HitachiDSP::dsp_read, &hitachidsp}, {&HitachiDSP::dsp_write, &hitachidsp}); parse_markup_map(m, node); mapping.append(m); } if(node["id"].data == "rom") { Mapping m({&HitachiDSP::rom_read, &hitachidsp}, {&HitachiDSP::rom_write, &hitachidsp}); parse_markup_map(m, node); if(m.size == 0) m.size = hitachidsp.rom.size(); mapping.append(m); } if(node["id"].data == "ram") { Mapping m({&HitachiDSP::ram_read, &hitachidsp}, {&HitachiDSP::ram_write, &hitachidsp}); parse_markup_map(m, node); if(m.size == 0) m.size = hitachidsp.ram.size(); mapping.append(m); } } } void Cartridge::parse_markup_necdsp(Markup::Node root) { if(root.exists() == false) return; if(interface->bind->altImplementation(Alt::ForDSP)==Alt::DSP::HLE) { parse_markup_necdsp_hle(root); return; } has_necdsp = true; for(auto& word : necdsp.programROM) word = 0x000000; for(auto& word : necdsp.dataROM) word = 0x0000; for(auto& word : necdsp.dataRAM) word = 0x0000; necdsp.frequency = numeral(root["frequency"].data); if(necdsp.frequency == 0) necdsp.frequency = 8000000; necdsp.revision = root["model"].data == "uPD7725" ? NECDSP::Revision::uPD7725 : root["model"].data == "uPD96050" ? NECDSP::Revision::uPD96050 : NECDSP::Revision::uPD7725; string programROMName = root["rom[0]/name"].data; string dataROMName = root["rom[1]/name"].data; string dataRAMName = root["ram/name"].data; if(necdsp.revision == NECDSP::Revision::uPD7725) { interface->loadRequest(ID::Nec7725DSPPROM, programROMName); interface->loadRequest(ID::Nec7725DSPDROM, dataROMName); if(dataRAMName.empty() == false) { interface->loadRequest(ID::Nec7725DSPRAM, dataRAMName); memory.append({ID::Nec7725DSPRAM, dataRAMName}); } } if(necdsp.revision == NECDSP::Revision::uPD96050) { interface->loadRequest(ID::Nec96050DSPPROM, programROMName); interface->loadRequest(ID::Nec96050DSPDROM, dataROMName); if(dataRAMName.empty() == false) { interface->loadRequest(ID::Nec96050DSPRAM, dataRAMName); memory.append({ID::Nec96050DSPRAM, dataRAMName}); } } for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&NECDSP::read, &necdsp}, {&NECDSP::write, &necdsp}); parse_markup_map(m, node); mapping.append(m); necdsp.Select = numeral(node["select"].data); } if(node["id"].data == "ram") { Mapping m({&NECDSP::ram_read, &necdsp}, {&NECDSP::ram_write, &necdsp}); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_epsonrtc(Markup::Node root) { if(root.exists() == false) return; has_epsonrtc = true; string name = root["ram"]["name"].data; interface->loadRequest(ID::EpsonRTC, name); memory.append({ID::EpsonRTC, name}); for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&EpsonRTC::read, &epsonrtc}, {&EpsonRTC::write, &epsonrtc}); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_sharprtc(Markup::Node root) { if(root.exists() == false) return; has_sharprtc = true; string name = root["ram"]["name"].data; interface->loadRequest(ID::SharpRTC, name); memory.append({ID::SharpRTC, name}); for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&SharpRTC::read, &sharprtc}, {&SharpRTC::write, &sharprtc}); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_spc7110(Markup::Node root) { if(root.exists() == false) return; has_spc7110 = true; parse_markup_memory(spc7110.prom, root["rom[0]"], ID::SPC7110PROM, false); parse_markup_memory(spc7110.drom, root["rom[1]"], ID::SPC7110DROM, false); parse_markup_memory(spc7110.ram, root["ram"], ID::SPC7110RAM, true); for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&SPC7110::read, &spc7110}, {&SPC7110::write, &spc7110}); parse_markup_map(m, node); mapping.append(m); } if(node["id"].data == "rom") { Mapping m({&SPC7110::mcurom_read, &spc7110}, {&SPC7110::mcurom_write, &spc7110}); parse_markup_map(m, node); mapping.append(m); } if(node["id"].data == "ram") { Mapping m({&SPC7110::mcuram_read, &spc7110}, {&SPC7110::mcuram_write, &spc7110}); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_sdd1(Markup::Node root) { if(root.exists() == false) return; has_sdd1 = true; parse_markup_memory(sdd1.rom, root["rom"], ID::SDD1ROM, false); parse_markup_memory(sdd1.ram, root["ram"], ID::SDD1RAM, true); for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&SDD1::read, &sdd1}, {&SDD1::write, &sdd1}); parse_markup_map(m, node); mapping.append(m); } if(node["id"].data == "rom") { Mapping m({&SDD1::mcurom_read, &sdd1}, {&SDD1::mcurom_write, &sdd1}); parse_markup_map(m, node); mapping.append(m); } if(node["id"].data == "ram") { Mapping m({&SDD1::mcuram_read, &sdd1}, {&SDD1::mcuram_write, &sdd1}); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_obc1(Markup::Node root) { if(root.exists() == false) return; has_obc1 = true; parse_markup_memory(obc1.ram, root["ram"], ID::OBC1RAM, true); for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&OBC1::read, &obc1}, {&OBC1::write, &obc1}); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_hsu1(Markup::Node root) { if(root.exists() == false) return; has_hsu1 = true; for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&HSU1::read, &hsu1}, {&HSU1::write, &hsu1}); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_msu1(Markup::Node root) { if(root.exists() == false) return; has_msu1 = true; for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&MSU1::mmio_read, &msu1}, {&MSU1::mmio_write, &msu1}); parse_markup_map(m, node); mapping.append(m); } } } void Cartridge::parse_markup_hitachidsp_hle(Markup::Node root) { //root.exists() is known true in the HLE chip handlers parse_markup_cartridge(root); has_cx4 = true; for(auto& node : root) { if(node.name != "map" || node["id"].data != "io") continue; Mapping m({&Cx4::read, &cx4}, {&Cx4::write, &cx4}); parse_markup_map(m, node); mapping.append(m); } } void Cartridge::parse_markup_necdsp_hle(Markup::Node root) { if (root["model"].data == "uPD7725") { Mapping m; unsigned int select=0; unsigned int * selectaddr=NULL; for(auto& node : root) { if (node.name == "rom" && node["id"].data == "program") { if (node["name"].data == "dsp1.program.rom" || node["name"].data == "dsp1b.program.rom") { has_dsp1 = true; m.reader = {&DSP1::read, &dsp1}; m.writer = {&DSP1::write, &dsp1}; selectaddr = &dsp1.Select; } if (node["name"].data == "dsp2.program.rom") { has_dsp2 = true; m.reader = {&DSP2::read, &dsp2}; m.writer = {&DSP2::write, &dsp2}; selectaddr = &dsp2.Select; } if (node["name"].data == "dsp3.program.rom") { has_dsp3 = true; m.reader = {&DSP3::read, &dsp3}; m.writer = {&DSP3::write, &dsp3}; //some of the chips hardcode the Select value } if (node["name"].data == "dsp4.program.rom") { has_dsp4 = true; m.reader = {&DSP4::read, &dsp4}; m.writer = {&DSP4::write, &dsp4}; } } if (node.name == "map" && node["id"].data == "io") { parse_markup_map(m, node); select = numeral(node["select"].data); } } if (selectaddr) *selectaddr=select; mapping.append(m); } else { Mapping m({&ST0010::read, &st0010}, {&ST0010::write, &st0010}); for(auto& node : root) { if(node.name != "map") continue; parse_markup_map(m, node); mapping.append(m); } } } bool Cartridge::parse_markup_icd2_external(Markup::Node root) { //root.exists() is known true here if (!sgbExternal.load_library("/home/alcaro/Desktop/minir/cores/bsnes_v073/supergameboy/libsupergameboy.so")) { interface->bind->notify("Couldn't load external GB emulator, falling back to internal"); return false; } has_sgbexternal = true; sgbExternal.revision = max(1, numeral(root["revision"].data)); GameBoy::cartridge.load_empty(GameBoy::System::Revision::SuperGameBoy); interface->loadRequest(ID::SuperGameBoy, "Game Boy", "gb"); for(auto& node : root) { if(node.name != "map") continue; if(node["id"].data == "io") { Mapping m({&SGBExternal::read, &sgbExternal}, {&SGBExternal::write, &sgbExternal}); parse_markup_map(m, node); mapping.append(m); } } return true; } Cartridge::Mapping::Mapping() { size = base = mask = 0; fastmode = Mapping::fastmode_slow; } Cartridge::Mapping::Mapping(SuperFamicom::Memory& memory) { reader = {&SuperFamicom::Memory::read, &memory}; writer = {&SuperFamicom::Memory::write, &memory}; size = base = mask = 0; fastmode = Mapping::fastmode_slow; } Cartridge::Mapping::Mapping(const function& reader, const function& writer) { this->reader = reader; this->writer = writer; size = base = mask = 0; fastmode = Mapping::fastmode_slow; } #endif ruby/input/udev.cpp000664 001750 001750 00000003425 12651764221 015503 0ustar00sergiosergio000000 000000 #include #include #include #include #include #include #include #include #include #include "keyboard/xlib.cpp" #include "mouse/xlib.cpp" #include "joypad/udev.cpp" namespace ruby { struct pInputUdev { InputKeyboardXlib xlibKeyboard; InputMouseXlib xlibMouse; InputJoypadUdev udev; struct Settings { uintptr_t handle = 0; } settings; bool cap(const string& name) { if(name == Input::Handle) return true; if(name == Input::KeyboardSupport) return true; if(name == Input::MouseSupport) return true; if(name == Input::JoypadSupport) return true; if(name == Input::JoypadRumbleSupport) return true; return false; } any get(const string& name) { if(name == Input::Handle) return (uintptr_t)settings.handle; return false; } bool set(const string& name, const any& value) { if(name == Input::Handle) { settings.handle = any_cast(value); return true; } return false; } bool acquire() { return xlibMouse.acquire(); } bool unacquire() { return xlibMouse.unacquire(); } bool acquired() { return xlibMouse.acquired(); } vector poll() { vector devices; xlibKeyboard.poll(devices); xlibMouse.poll(devices); udev.poll(devices); return devices; } bool rumble(uint64_t id, bool enable) { return udev.rumble(id, enable); } bool init() { if(xlibKeyboard.init() == false) return false; if(xlibMouse.init(settings.handle) == false) return false; if(udev.init() == false) return false; return true; } void term() { xlibKeyboard.term(); xlibMouse.term(); udev.term(); } }; DeclareInput(Udev) } sfc/base/000700 001750 001750 00000000000 12656700342 013360 5ustar00sergiosergio000000 000000 target-libretro/libretro.cpp000664 001750 001750 00000116233 12651764221 017352 0ustar00sergiosergio000000 000000 #include "libretro.h" #include #include #include #include "../ananke/heuristics/super-famicom.hpp" #include "../ananke/heuristics/game-boy.hpp" #include // Special memory types. #define RETRO_MEMORY_SNES_BSX_RAM ((1 << 8) | RETRO_MEMORY_SAVE_RAM) #define RETRO_MEMORY_SNES_BSX_PRAM ((2 << 8) | RETRO_MEMORY_SAVE_RAM) #define RETRO_MEMORY_SNES_SUFAMI_TURBO_A_RAM ((3 << 8) | RETRO_MEMORY_SAVE_RAM) #define RETRO_MEMORY_SNES_SUFAMI_TURBO_B_RAM ((4 << 8) | RETRO_MEMORY_SAVE_RAM) #define RETRO_MEMORY_SNES_GAME_BOY_RAM ((5 << 8) | RETRO_MEMORY_SAVE_RAM) #define RETRO_MEMORY_SNES_GAME_BOY_RTC ((6 << 8) | RETRO_MEMORY_RTC) // Special game types passed into retro_load_game_special(). // Only used when multiple ROMs are required. #define RETRO_GAME_TYPE_BSX 0x101 #define RETRO_GAME_TYPE_BSX_SLOTTED 0x102 #define RETRO_GAME_TYPE_SUFAMI_TURBO 0x103 #define RETRO_GAME_TYPE_SUPER_GAME_BOY 0x104 #define RETRO_DEVICE_JOYPAD_MULTITAP RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 0) #define RETRO_DEVICE_LIGHTGUN_SUPER_SCOPE RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_LIGHTGUN, 0) #define RETRO_DEVICE_LIGHTGUN_JUSTIFIER RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_LIGHTGUN, 1) #define RETRO_DEVICE_LIGHTGUN_JUSTIFIERS RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_LIGHTGUN, 2) using namespace nall; const uint8 iplrom[64] = { /*ffc0*/ 0xcd, 0xef, //mov x,#$ef /*ffc2*/ 0xbd, //mov sp,x /*ffc3*/ 0xe8, 0x00, //mov a,#$00 /*ffc5*/ 0xc6, //mov (x),a /*ffc6*/ 0x1d, //dec x /*ffc7*/ 0xd0, 0xfc, //bne $ffc5 /*ffc9*/ 0x8f, 0xaa, 0xf4, //mov $f4,#$aa /*ffcc*/ 0x8f, 0xbb, 0xf5, //mov $f5,#$bb /*ffcf*/ 0x78, 0xcc, 0xf4, //cmp $f4,#$cc /*ffd2*/ 0xd0, 0xfb, //bne $ffcf /*ffd4*/ 0x2f, 0x19, //bra $ffef /*ffd6*/ 0xeb, 0xf4, //mov y,$f4 /*ffd8*/ 0xd0, 0xfc, //bne $ffd6 /*ffda*/ 0x7e, 0xf4, //cmp y,$f4 /*ffdc*/ 0xd0, 0x0b, //bne $ffe9 /*ffde*/ 0xe4, 0xf5, //mov a,$f5 /*ffe0*/ 0xcb, 0xf4, //mov $f4,y /*ffe2*/ 0xd7, 0x00, //mov ($00)+y,a /*ffe4*/ 0xfc, //inc y /*ffe5*/ 0xd0, 0xf3, //bne $ffda /*ffe7*/ 0xab, 0x01, //inc $01 /*ffe9*/ 0x10, 0xef, //bpl $ffda /*ffeb*/ 0x7e, 0xf4, //cmp y,$f4 /*ffed*/ 0x10, 0xeb, //bpl $ffda /*ffef*/ 0xba, 0xf6, //movw ya,$f6 /*fff1*/ 0xda, 0x00, //movw $00,ya /*fff3*/ 0xba, 0xf4, //movw ya,$f4 /*fff5*/ 0xc4, 0xf4, //mov $f4,a /*fff7*/ 0xdd, //mov a,y /*fff8*/ 0x5d, //mov x,a /*fff9*/ 0xd0, 0xdb, //bne $ffd6 /*fffb*/ 0x1f, 0x00, 0x00, //jmp ($0000+x) /*fffe*/ 0xc0, 0xff //reset vector location ($ffc0) }; static void retro_log_default(enum retro_log_level level, const char *fmt, ...) { fprintf(stderr, "[bsnes]: "); va_list args; va_start(args, fmt); vfprintf(stderr, fmt, args); va_end(args); } static retro_log_printf_t output; static const char * read_opt(const char * name, const char * defval); struct Callbacks : Emulator::Interface::Bind { retro_video_refresh_t pvideo_refresh; retro_audio_sample_batch_t paudio; retro_input_poll_t pinput_poll; retro_input_state_t pinput_state; retro_environment_t penviron; bool overscan; bool manifest; bool load_request_error; const uint8_t *rom_data; unsigned rom_size; const uint8_t *gb_rom_data; unsigned gb_rom_size; string xmlrom; string xmlrom_gb; void *sram; unsigned sram_size; Emulator::Interface *iface; string basename; bool input_polled; static unsigned snes_to_retro(unsigned device) { switch ((SuperFamicom::Input::Device)device) { default: case SuperFamicom::Input::Device::None: return RETRO_DEVICE_NONE; case SuperFamicom::Input::Device::Joypad: return RETRO_DEVICE_JOYPAD; case SuperFamicom::Input::Device::Multitap: return RETRO_DEVICE_JOYPAD_MULTITAP; case SuperFamicom::Input::Device::Mouse: return RETRO_DEVICE_MOUSE; case SuperFamicom::Input::Device::SuperScope: return RETRO_DEVICE_LIGHTGUN_SUPER_SCOPE; case SuperFamicom::Input::Device::Justifier: return RETRO_DEVICE_LIGHTGUN_JUSTIFIER; case SuperFamicom::Input::Device::Justifiers: return RETRO_DEVICE_LIGHTGUN_JUSTIFIERS; } } // TODO: Properly map Mouse/Lightguns. static unsigned snes_to_retro(unsigned, unsigned id) { return id; } static SuperFamicom::Input::Device retro_to_snes(unsigned device) { switch (device) { default: case RETRO_DEVICE_NONE: return SuperFamicom::Input::Device::None; case RETRO_DEVICE_JOYPAD: return SuperFamicom::Input::Device::Joypad; case RETRO_DEVICE_ANALOG: return SuperFamicom::Input::Device::Joypad; case RETRO_DEVICE_JOYPAD_MULTITAP: return SuperFamicom::Input::Device::Multitap; case RETRO_DEVICE_MOUSE: return SuperFamicom::Input::Device::Mouse; case RETRO_DEVICE_LIGHTGUN_SUPER_SCOPE: return SuperFamicom::Input::Device::SuperScope; case RETRO_DEVICE_LIGHTGUN_JUSTIFIER: return SuperFamicom::Input::Device::Justifier; case RETRO_DEVICE_LIGHTGUN_JUSTIFIERS: return SuperFamicom::Input::Device::Justifiers; } } enum { video_fmt_32, video_fmt_16, video_fmt_15 } video_fmt; union { uint32_t video_buffer[512 * 480]; uint16_t video_buffer_16[512 * 480]; }; void videoRefresh(const uint32_t* palette, const uint32_t* data, unsigned pitch, unsigned width, unsigned height) override { if (!overscan) { data += 8 * 1024; if (height == 240) height = 224; else if (height == 480) height = 448; } if (video_fmt == video_fmt_32) { uint32_t *ptr = video_buffer; for (unsigned y = 0; y < height; y++, data += pitch >> 2, ptr += width) for (unsigned x = 0; x < width; x++) ptr[x] = palette[data[x]]; pvideo_refresh(video_buffer, width, height, width*sizeof(uint32_t)); } else { uint16_t *ptr = video_buffer_16; for (unsigned y = 0; y < height; y++, data += pitch >> 2, ptr += width) for (unsigned x = 0; x < width; x++) ptr[x] = palette[data[x]]; pvideo_refresh(video_buffer_16, width, height, width*sizeof(uint16_t)); } } int16_t sampleBuf[128]; unsigned int sampleBufPos; void audioSample(int16_t left, int16_t right) override { sampleBuf[sampleBufPos++] = left; sampleBuf[sampleBufPos++] = right; if(sampleBufPos==128) { paudio(sampleBuf, 64); sampleBufPos = 0; } } int16_t inputPoll(unsigned port, unsigned device, unsigned id) override { if(id > 11) return 0; if (!input_polled) { pinput_poll(); input_polled=true; } return pinput_state(port, snes_to_retro(device), 0, snes_to_retro(device, id)); } void saveRequest(unsigned id, string p) override { if (manifest) { output(RETRO_LOG_INFO, "[Save]: ID %u, Request \"%s\".\n", id, (const char*)p); string save_path = {path(0), p}; filestream stream(save_path, file::mode::write); iface->save(id, stream); } } void loadFile(unsigned id, string p) { // Look for BIOS in system directory as well. const char *dir = 0; penviron(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir); string load_path = {path(0), p}; if(manifest || file::exists(load_path)) { filestream stream(load_path, file::mode::read); iface->load(id, stream); } else if(dir) { load_path = {dir, "/", p}; if(file::exists(load_path)) { mmapstream stream(load_path); iface->load(id, stream); } else { output(RETRO_LOG_ERROR, "Cannot find requested file in system directory: \"%s\".\n", (const char*)load_path); load_request_error = true; } } else { output(RETRO_LOG_ERROR, "Cannot find requested file: \"%s\" in ROM directory nor system directory.\n", (const char*)p); load_request_error = true; } } void loadROM(unsigned id) { memorystream stream(rom_data, rom_size); iface->load(id, stream); } void loadManifest(unsigned id) { memorystream stream((const uint8_t*)(const char*)xmlrom, xmlrom.length()); iface->load(id, stream); } void loadSGBROMManifest(unsigned id) { memorystream stream((const uint8_t*)(const char*)xmlrom_gb, xmlrom_gb.length()); iface->load(SuperFamicom::ID::SuperGameBoyManifest, stream); } void loadSGBROM(unsigned id) { memorystream stream(gb_rom_data, gb_rom_size); iface->load(id, stream); } void loadIPLROM(unsigned id) { memorystream stream(iplrom, sizeof(iplrom)); iface->load(id, stream); } void loadRequestManifest(unsigned id, const string& p) { output(RETRO_LOG_INFO, "[Manifest]: ID %u, Request \"%s\".\n", id, (const char*)p); switch(id) { case SuperFamicom::ID::IPLROM: loadIPLROM(id); break; case SuperFamicom::ID::Manifest: loadManifest(id); break; default: loadFile(id, p); break; } } void loadRequestMemory(unsigned id, const string& p) { output(RETRO_LOG_INFO, "[Memory]: ID %u, Request \"%s\".\n", id, (const char*)p); switch(id) { case SuperFamicom::ID::Manifest: loadManifest(id); break; case SuperFamicom::ID::SuperGameBoyManifest: loadSGBROMManifest(id); break; case SuperFamicom::ID::ROM: case SuperFamicom::ID::SuperFXROM: case SuperFamicom::ID::SA1ROM: case SuperFamicom::ID::SDD1ROM: case SuperFamicom::ID::HitachiDSPROM: case SuperFamicom::ID::SPC7110PROM: output(RETRO_LOG_INFO, "Load ROM.\n"); loadROM(id); break; case SuperFamicom::ID::SuperGameBoyROM: loadSGBROM(id); break; // SRAM. Have to special case for all chips ... case SuperFamicom::ID::RAM: sram = SuperFamicom::cartridge.ram.data(); sram_size = SuperFamicom::cartridge.ram.size(); break; case SuperFamicom::ID::SuperFXRAM: sram = SuperFamicom::superfx.ram.data(); sram_size = SuperFamicom::superfx.ram.size(); break; case SuperFamicom::ID::SA1BWRAM: sram = SuperFamicom::sa1.bwram.data(); sram_size = SuperFamicom::sa1.bwram.size(); break; case SuperFamicom::ID::SDD1RAM: sram = SuperFamicom::sdd1.ram.data(); sram_size = SuperFamicom::sdd1.ram.size(); break; case SuperFamicom::ID::OBC1RAM: sram = SuperFamicom::obc1.ram.data(); sram_size = SuperFamicom::obc1.ram.size(); break; case SuperFamicom::ID::HitachiDSPRAM: sram = SuperFamicom::hitachidsp.ram.data(); sram_size = SuperFamicom::hitachidsp.ram.size(); break; case SuperFamicom::ID::ArmDSPRAM: sram = SuperFamicom::armdsp.programRAM; sram_size = 16 * 1024 * sizeof(SuperFamicom::armdsp.programRAM[0]); break; case SuperFamicom::ID::Nec96050DSPRAM: sram = SuperFamicom::necdsp.dataRAM; sram_size = sizeof(SuperFamicom::necdsp.dataRAM); break; case SuperFamicom::ID::SPC7110RAM: sram = SuperFamicom::spc7110.ram.data(); sram_size = SuperFamicom::spc7110.ram.size(); break; // SGB RAM is handled explicitly. case SuperFamicom::ID::SuperGameBoyRAM: break; case SuperFamicom::ID::IPLROM: loadIPLROM(id); break; default: output(RETRO_LOG_INFO, "Load BIOS.\n"); loadFile(id, p); break; } } void loadRequest(unsigned id, string p) override { if (manifest) loadRequestManifest(id, p); else loadRequestMemory(id, p); output(RETRO_LOG_INFO, "Complete load request.\n"); } void loadRequest(unsigned id, string p, string manifest) override { switch (id) { case SuperFamicom::ID::SuperGameBoy: output(RETRO_LOG_INFO, "Loading GB ROM.\n"); loadSGBROMManifest(id); break; default: output(RETRO_LOG_INFO, "Didn't do anything with loadRequest (3 arg).\n"); } } string path(unsigned) override { return string(basename); } uint32_t videoColor(unsigned, uint16_t, uint16_t r, uint16_t g, uint16_t b) override { r >>= 8; g >>= 8; b >>= 8; if (video_fmt == video_fmt_32) return (r << 16) | (g << 8) | (b << 0); if (video_fmt == video_fmt_16) return (r>>3 << 11) | (g>>2 << 5) | (b>>3 << 0); if (video_fmt == video_fmt_15) return (r>>3 << 10) | (g>>3 << 5) | (b>>3 << 0); } void notify(string text) { output(RETRO_LOG_ERROR, "%s\n", (const char*)text); } unsigned altImplementation(unsigned item) override { if (item==SuperFamicom::Alt::ForDSP) { if (!strcmp(read_opt("bsnes_chip_hle", "LLE"), "HLE")) return SuperFamicom::Alt::DSP::HLE; else return SuperFamicom::Alt::DSP::LLE; } #ifdef EXPERIMENTAL_FEATURES if (item==SuperFamicom::Alt::ForSuperGameBoy) { if (!strcmp(read_opt("bsnes_sgb_core", "Internal"), "Gambatte")) return SuperFamicom::Alt::SuperGameBoy::External; else return SuperFamicom::Alt::SuperGameBoy::Internal; } #endif return 0; } }; static Callbacks core_bind; static const char * read_opt(const char * name, const char * defval) { struct retro_variable allowvar = { "bsnes_violate_accuracy", "No" }; core_bind.penviron(RETRO_ENVIRONMENT_GET_VARIABLE, (void*)&allowvar); if (!strcmp(allowvar.value, "Yes")) { struct retro_variable var = {name, defval}; core_bind.penviron(RETRO_ENVIRONMENT_GET_VARIABLE, (void*)&var); return var.value; } else return defval; } struct Interface : public SuperFamicom::Interface { SuperFamicomCartridge::Mode mode; void setCheats(const lstring &list = lstring()); Interface(); void init() { SuperFamicom::video.generate_palette(Emulator::Interface::PaletteMode::Standard); } }; struct GBInterface : public GameBoy::Interface { GBInterface() { bind = &core_bind; } void init() { SuperFamicom::video.generate_palette(Emulator::Interface::PaletteMode::Standard); } }; static Interface core_interface; static GBInterface core_gb_interface; Interface::Interface() { bind = &core_bind; core_bind.iface = &core_interface; } void Interface::setCheats(const lstring &) { #if 0 if(core_interface.mode == SuperFamicomCartridge::ModeSuperGameBoy) { GameBoy::cheat.reset(); for(auto &code : list) { lstring codelist; codelist.split("+", code); for(auto &part : codelist) { unsigned addr, data, comp; if(GameBoy::Cheat::decode(part, addr, data, comp)) { GameBoy::cheat.append({addr, data, comp}); } } } GameBoy::cheat.synchronize(); return; } SuperFamicom::cheat.reset(); for(auto &code : list) { lstring codelist; codelist.split("+", code); for(auto &part : codelist) { unsigned addr, data; if(SuperFamicom::Cheat::decode(part, addr, data)) { SuperFamicom::cheat.append({addr, data}); } } } SuperFamicom::cheat.synchronize(); #endif } unsigned retro_api_version(void) { return RETRO_API_VERSION; } static unsigned superfx_freq_orig; void retro_set_environment(retro_environment_t environ_cb) { core_bind.penviron = environ_cb; static const struct retro_variable vars[] = { { "bsnes_violate_accuracy", "Respect accuracy-impacting settings; No|Yes" }, { "bsnes_chip_hle", "Special chip accuracy; LLE|HLE" }, { "bsnes_superfx_overclock", "SuperFX speed; 100%|150%|200%|300%|400%|500%|1000%" }, //Any integer is usable here, but there is no such thing as "any integer" in core options. #ifdef EXPERIMENTAL_FEATURES { "bsnes_sgb_core", "Super Game Boy core; Internal|Gambatte" }, #endif { NULL, NULL }, }; core_bind.penviron(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)vars); static struct retro_log_callback log={retro_log_default}; core_bind.penviron(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, (void*)&log); output=log.log; static const retro_subsystem_memory_info sgb_memory[] = { { "srm", RETRO_MEMORY_SNES_GAME_BOY_RAM }, { "rtc", RETRO_MEMORY_SNES_GAME_BOY_RTC }, }; static const struct retro_subsystem_rom_info sgb_roms[] = { { "GameBoy", "gb|gbc", false, false, true, sgb_memory, 2 }, { "Super GameBoy BIOS", "sfc|smc", false, false, true, NULL, 0 }, }; static const retro_subsystem_memory_info sufami_a_memory[] = { { "srm", RETRO_MEMORY_SNES_SUFAMI_TURBO_A_RAM }, }; static const retro_subsystem_memory_info sufami_b_memory[] = { { "srm", RETRO_MEMORY_SNES_SUFAMI_TURBO_B_RAM }, }; static const struct retro_subsystem_rom_info sufami_roms[] = { { "Sufami A", "sfc|smc", false, false, false, sufami_a_memory, 1 }, { "Sufami B", "sfc|smc", false, false, false, sufami_b_memory, 1 }, { "Sufami BIOS", "sfc|smc", false, false, true, NULL, 0 }, }; static const retro_subsystem_memory_info bsx_memory[] = { { "srm", RETRO_MEMORY_SNES_BSX_RAM }, { "psrm", RETRO_MEMORY_SNES_BSX_PRAM }, }; static const struct retro_subsystem_rom_info bsx_roms[] = { { "BSX ROM", "bs", false, false, true, bsx_memory, 2 }, { "BSX BIOS", "sfc|smc", false, false, true, NULL, 0 }, }; // OR in 0x1000 on types to remain ABI compat with the older-style retro_load_game_special(). static const struct retro_subsystem_info subsystems[] = { { "Super GameBoy", "sgb", sgb_roms, 2, RETRO_GAME_TYPE_SUPER_GAME_BOY | 0x1000 }, // Super Gameboy { "Sufami Turbo", "sufami", sufami_roms, 3, RETRO_GAME_TYPE_SUFAMI_TURBO | 0x1000 }, // Sufami Turbo { "BSX", "bsx", bsx_roms, 2, RETRO_GAME_TYPE_BSX | 0x1000 }, // BSX { "BSX slotted", "bsxslot", bsx_roms, 2, RETRO_GAME_TYPE_BSX_SLOTTED | 0x1000 }, // BSX slotted { NULL }, }; environ_cb(RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO, (void*)subsystems); static const struct retro_controller_description port_1[] = { { "SNES Joypad", RETRO_DEVICE_JOYPAD }, { "SNES Mouse", RETRO_DEVICE_MOUSE }, }; static const struct retro_controller_description port_2[] = { { "SNES Joypad", RETRO_DEVICE_JOYPAD }, { "SNES Mouse", RETRO_DEVICE_MOUSE }, { "Multitap", RETRO_DEVICE_JOYPAD_MULTITAP }, { "SuperScope", RETRO_DEVICE_LIGHTGUN_SUPER_SCOPE }, { "Justifier", RETRO_DEVICE_LIGHTGUN_JUSTIFIER }, { "Justifiers", RETRO_DEVICE_LIGHTGUN_JUSTIFIERS }, }; static const struct retro_controller_info ports[] = { { port_1, 2 }, { port_2, 6 }, { 0 }, }; environ_cb(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports); } static void update_variables(void) { if (SuperFamicom::cartridge.has_superfx()) { const char * speed=read_opt("bsnes_superfx_overclock", "100%"); unsigned percent=strtoul(speed, NULL, 10);//we can assume that the input is one of our advertised options SuperFamicom::superfx.frequency=(uint64)superfx_freq_orig*percent/100; } } void retro_set_video_refresh(retro_video_refresh_t cb) { core_bind.pvideo_refresh = cb; } void retro_set_audio_sample(retro_audio_sample_t) { } void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb) { core_bind.paudio = cb; } void retro_set_input_poll(retro_input_poll_t cb) { core_bind.pinput_poll = cb; } void retro_set_input_state(retro_input_state_t cb) { core_bind.pinput_state = cb; } void retro_set_controller_port_device(unsigned port, unsigned device) { if (port < 2) SuperFamicom::input.connect(port, Callbacks::retro_to_snes(device)); } void retro_init(void) { SuperFamicom::interface = &core_interface; GameBoy::interface = &core_gb_interface; core_interface.init(); core_gb_interface.init(); core_bind.sampleBufPos = 0; SuperFamicom::system.init(); SuperFamicom::input.connect(SuperFamicom::Controller::Port1, SuperFamicom::Input::Device::Joypad); SuperFamicom::input.connect(SuperFamicom::Controller::Port2, SuperFamicom::Input::Device::Joypad); } void retro_deinit(void) { SuperFamicom::system.term(); } void retro_reset(void) { SuperFamicom::system.reset(); } void retro_run(void) { core_bind.input_polled=false; bool updated = false; if (core_bind.penviron(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated) update_variables(); SuperFamicom::system.run(); if(core_bind.sampleBufPos) { core_bind.paudio(core_bind.sampleBuf, core_bind.sampleBufPos/2); core_bind.sampleBufPos = 0; } } size_t retro_serialize_size(void) { return SuperFamicom::system.serialize_size(); } bool retro_serialize(void *data, size_t size) { SuperFamicom::system.runtosave(); serializer s = SuperFamicom::system.serialize(); if(s.size() > size) return false; memcpy(data, s.data(), s.size()); return true; } bool retro_unserialize(const void *data, size_t size) { serializer s((const uint8_t*)data, size); return SuperFamicom::system.unserialize(s); } #if 0 struct CheatList { bool enable; string code; CheatList() : enable(false) {} }; static vector cheatList; #endif void retro_cheat_reset(void) { #if 0 cheatList.reset(); core_interface.setCheats(); #endif } void retro_cheat_set(unsigned index, bool enable, const char *code) { #if 0 cheatList.reserve(index+1); cheatList[index].enable = enable; cheatList[index].code = code; lstring list; for(unsigned n = 0; n < cheatList.size(); n++) { if(cheatList[n].enable) list.append(cheatList[n].code); } core_interface.setCheats(list); #endif } void retro_get_system_info(struct retro_system_info *info) { static string version("v", Emulator::Version, " (", Emulator::Profile, ")"); info->library_name = "bsnes-mercury"; info->library_version = version; info->valid_extensions = "sfc|smc|bml"; info->need_fullpath = false; } void retro_get_system_av_info(struct retro_system_av_info *info) { struct retro_system_timing timing = { 0.0, 32040.5 }; timing.fps = retro_get_region() == RETRO_REGION_NTSC ? 21477272.0 / 357366.0 : 21281370.0 / 425568.0; if (!core_bind.penviron(RETRO_ENVIRONMENT_GET_OVERSCAN, &core_bind.overscan)) core_bind.overscan = false; unsigned base_width = 256; unsigned base_height = core_bind.overscan ? 240 : 224; struct retro_game_geometry geom = { base_width, base_height, base_width << 1, base_height << 1, 4.0 / 3.0 }; info->timing = timing; info->geometry = geom; enum retro_pixel_format fmt; fmt = RETRO_PIXEL_FORMAT_XRGB8888; if (core_bind.penviron(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) core_bind.video_fmt = Callbacks::video_fmt_32; else { fmt = RETRO_PIXEL_FORMAT_RGB565; if (core_bind.penviron(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) core_bind.video_fmt = Callbacks::video_fmt_16; else { //this one is always supported core_bind.video_fmt = Callbacks::video_fmt_15; } SuperFamicom::video.generate_palette(Emulator::Interface::PaletteMode::Standard); } } static void output_multiline(enum retro_log_level level, char * data) { while (true) { char* data_linebreak=strchr(data, '\n'); if (data_linebreak) *data_linebreak='\0'; if (*data) output(level, "%s\n", data); if (!data_linebreak) break; *data_linebreak='\n'; data=data_linebreak+1; } } static bool snes_load_cartridge_normal( const char *rom_xml, const uint8_t *rom_data, unsigned rom_size ) { string xmlrom = (rom_xml && *rom_xml) ? string(rom_xml) : SuperFamicomCartridge(rom_data, rom_size).markup; core_bind.rom_data = rom_data; core_bind.rom_size = rom_size; core_bind.xmlrom = xmlrom; output(RETRO_LOG_INFO, "BML map:\n"); output_multiline(RETRO_LOG_INFO, xmlrom.data()); core_bind.iface->load(SuperFamicom::ID::SuperFamicom); SuperFamicom::system.power(); return !core_bind.load_request_error; } static bool snes_load_cartridge_bsx_slotted( const char *rom_xml, const uint8_t *rom_data, unsigned rom_size, const char *bsx_xml, const uint8_t *bsx_data, unsigned bsx_size ) { #if 0 string xmlrom = (rom_xml && *rom_xml) ? string(rom_xml) : SuperFamicomCartridge(rom_data, rom_size).markup; string xmlbsx = (bsx_xml && *bsx_xml) ? string(bsx_xml) : SuperFamicomCartridge(bsx_data, bsx_size).markup; SuperFamicom::bsxflash.memory.copy(memorystream(bsx_data, bsx_size)); SuperFamicom::cartridge.load(xmlrom, memorystream(rom_data, rom_size)); SuperFamicom::system.power(); return !core_bind.load_request_error; #endif return false; } static bool snes_load_cartridge_bsx( const char *rom_xml, const uint8_t *rom_data, unsigned rom_size, const char *bsx_xml, const uint8_t *bsx_data, unsigned bsx_size ) { #if 0 string xmlrom = (rom_xml && *rom_xml) ? string(rom_xml) : SuperFamicomCartridge(rom_data, rom_size).markup; string xmlbsx = (bsx_xml && *bsx_xml) ? string(bsx_xml) : SuperFamicomCartridge(bsx_data, bsx_size).markup; SuperFamicom::bsxflash.memory.copy(memorystream(bsx_data, bsx_size)); SuperFamicom::cartridge.load(xmlrom, memorystream(rom_data, rom_size)); SuperFamicom::system.power(); return !core_bind.load_request_error; #endif return false; } static bool snes_load_cartridge_sufami_turbo( const char *rom_xml, const uint8_t *rom_data, unsigned rom_size, const char *sta_xml, const uint8_t *sta_data, unsigned sta_size, const char *stb_xml, const uint8_t *stb_data, unsigned stb_size ) { #if 0 string xmlrom = (rom_xml && *rom_xml) ? string(rom_xml) : SuperFamicomCartridge(rom_data, rom_size).markup; string xmlsta = (sta_xml && *sta_xml) ? string(sta_xml) : SuperFamicomCartridge(sta_data, sta_size).markup; string xmlstb = (stb_xml && *stb_xml) ? string(stb_xml) : SuperFamicomCartridge(stb_data, stb_size).markup; if(sta_data) SuperFamicom::sufamiturbo.slotA.rom.copy(memorystream(sta_data, sta_size)); if(stb_data) SuperFamicom::sufamiturbo.slotB.rom.copy(memorystream(stb_data, stb_size)); SuperFamicom::cartridge.load(xmlrom, memorystream(rom_data, rom_size)); SuperFamicom::system.power(); return !core_bind.load_request_error; #endif return false; } static bool snes_load_cartridge_super_game_boy( const char *rom_xml, const uint8_t *rom_data, unsigned rom_size, const char *dmg_xml, const uint8_t *dmg_data, unsigned dmg_size ) { string xmlrom_sgb = (rom_xml && *rom_xml) ? string(rom_xml) : SuperFamicomCartridge(rom_data, rom_size).markup; string xmlrom_gb = (dmg_xml && *dmg_xml) ? string(dmg_xml) : GameBoyCartridge((uint8_t*)dmg_data, dmg_size).markup; output(RETRO_LOG_INFO, "Markup SGB:\n"); output_multiline(RETRO_LOG_INFO, xmlrom_sgb.data()); output(RETRO_LOG_INFO, "Markup GB:\n"); output_multiline(RETRO_LOG_INFO, xmlrom_gb.data()); core_bind.rom_data = rom_data; core_bind.rom_size = rom_size; core_bind.gb_rom_data = dmg_data; core_bind.gb_rom_size = dmg_size; core_bind.xmlrom = xmlrom_sgb; core_bind.xmlrom_gb = xmlrom_gb; core_bind.iface->load(SuperFamicom::ID::SuperFamicom); core_bind.iface->load(SuperFamicom::ID::SuperGameBoy); SuperFamicom::system.power(); return !core_bind.load_request_error; } static void init_descriptors(void) { struct retro_input_descriptor desc[] = { { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, { 1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, { 2, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, { 3, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" }, { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" }, { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" }, { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" }, { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" }, { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" }, { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" }, { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" }, { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" }, { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" }, { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" }, { 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" }, { 0 }, }; core_bind.penviron(RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS, desc); } bool retro_load_game(const struct retro_game_info *info) { // Support loading a manifest directly. core_bind.manifest = info->path && string(info->path).endsWith(".bml"); init_descriptors(); const uint8_t *data = (const uint8_t*)info->data; size_t size = info->size; if ((size & 0x7ffff) == 512) { size -= 512; data += 512; } retro_cheat_reset(); if (info->path) { core_bind.load_request_error = false; core_bind.basename = info->path; char *posix_slash = (char*)strrchr(core_bind.basename, '/'); char *win_slash = (char*)strrchr(core_bind.basename, '\\'); if (posix_slash && !win_slash) posix_slash[1] = '\0'; else if (win_slash && !posix_slash) win_slash[1] = '\0'; else if (posix_slash && win_slash) max(posix_slash, win_slash)[1] = '\0'; else core_bind.basename = "./"; } core_interface.mode = SuperFamicomCartridge::ModeNormal; std::string manifest; if (core_bind.manifest) manifest = std::string((const char*)info->data, info->size); // Might not be 0 terminated. bool ret=snes_load_cartridge_normal(core_bind.manifest ? manifest.data() : info->meta, data, size); if (ret) { SuperFamicom::bus.libretro_mem_map.reverse(); retro_memory_map map={SuperFamicom::bus.libretro_mem_map.data(), SuperFamicom::bus.libretro_mem_map.size()}; core_bind.penviron(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, (void*)&map); if (SuperFamicom::cartridge.has_superfx()) superfx_freq_orig=SuperFamicom::superfx.frequency; } return ret; } bool retro_load_game_special(unsigned game_type, const struct retro_game_info *info, size_t num_info) { core_bind.manifest = false; init_descriptors(); const uint8_t *data = (const uint8_t*)info[0].data; size_t size = info[0].size; if ((size & 0x7ffff) == 512) { size -= 512; data += 512; } retro_cheat_reset(); if (info[0].path) { core_bind.load_request_error = false; core_bind.basename = info[0].path; char *posix_slash = (char*)strrchr(core_bind.basename, '/'); char *win_slash = (char*)strrchr(core_bind.basename, '\\'); if (posix_slash && !win_slash) posix_slash[1] = '\0'; else if (win_slash && !posix_slash) win_slash[1] = '\0'; else if (posix_slash && win_slash) max(posix_slash, win_slash)[1] = '\0'; else core_bind.basename = "./"; } switch (game_type) { case RETRO_GAME_TYPE_BSX: core_interface.mode = SuperFamicomCartridge::ModeBsx; return num_info == 2 && snes_load_cartridge_bsx(info[0].meta, data, size, info[1].meta, (const uint8_t*)info[1].data, info[1].size); case RETRO_GAME_TYPE_BSX | 0x1000: core_interface.mode = SuperFamicomCartridge::ModeBsx; return num_info == 2 && snes_load_cartridge_bsx(info[1].meta, (const uint8_t*)info[1].data, info[1].size, info[0].meta, (const uint8_t*)info[0].data, info[0].size); case RETRO_GAME_TYPE_BSX_SLOTTED: core_interface.mode = SuperFamicomCartridge::ModeBsxSlotted; return num_info == 2 && snes_load_cartridge_bsx_slotted(info[0].meta, data, size, info[1].meta, (const uint8_t*)info[1].data, info[1].size); case RETRO_GAME_TYPE_BSX_SLOTTED | 0x1000: core_interface.mode = SuperFamicomCartridge::ModeBsxSlotted; return num_info == 2 && snes_load_cartridge_bsx(info[1].meta, (const uint8_t*)info[1].data, info[1].size, info[0].meta, (const uint8_t*)info[0].data, info[0].size); case RETRO_GAME_TYPE_SUPER_GAME_BOY: core_interface.mode = SuperFamicomCartridge::ModeSuperGameBoy; return num_info == 2 && snes_load_cartridge_super_game_boy(info[0].meta, data, size, info[1].meta, (const uint8_t*)info[1].data, info[1].size); case RETRO_GAME_TYPE_SUPER_GAME_BOY | 0x1000: core_interface.mode = SuperFamicomCartridge::ModeSuperGameBoy; return num_info == 2 && snes_load_cartridge_super_game_boy(info[1].meta, (const uint8_t*)info[1].data, info[1].size, info[0].meta, (const uint8_t*)info[0].data, info[0].size); case RETRO_GAME_TYPE_SUFAMI_TURBO: core_interface.mode = SuperFamicomCartridge::ModeSufamiTurbo; return num_info == 3 && snes_load_cartridge_sufami_turbo(info[0].meta, (const uint8_t*)info[0].data, info[0].size, info[1].meta, (const uint8_t*)info[1].data, info[1].size, info[2].meta, (const uint8_t*)info[2].data, info[2].size); case RETRO_GAME_TYPE_SUFAMI_TURBO | 0x1000: core_interface.mode = SuperFamicomCartridge::ModeSufamiTurbo; return num_info == 3 && snes_load_cartridge_sufami_turbo(info[2].meta, (const uint8_t*)info[2].data, info[2].size, info[0].meta, (const uint8_t*)info[0].data, info[0].size, info[1].meta, (const uint8_t*)info[1].data, info[1].size); default: return false; } } void retro_unload_game(void) { core_bind.iface->save(); SuperFamicom::cartridge.unload(); core_bind.sram = nullptr; core_bind.sram_size = 0; } unsigned retro_get_region(void) { return SuperFamicom::system.region() == SuperFamicom::System::Region::NTSC ? RETRO_REGION_NTSC : RETRO_REGION_PAL; } void* retro_get_memory_data(unsigned id) { if(SuperFamicom::cartridge.loaded() == false) return 0; if(core_bind.manifest) return 0; switch(id) { case RETRO_MEMORY_SAVE_RAM: return core_bind.sram; case RETRO_MEMORY_RTC: return nullptr; case RETRO_MEMORY_SNES_BSX_RAM: return nullptr; case RETRO_MEMORY_SNES_BSX_PRAM: if(core_interface.mode != SuperFamicomCartridge::ModeBsx) break; return SuperFamicom::bsxcartridge.psram.data(); case RETRO_MEMORY_SNES_SUFAMI_TURBO_A_RAM: if(core_interface.mode != SuperFamicomCartridge::ModeSufamiTurbo) break; return SuperFamicom::sufamiturboA.ram.data(); case RETRO_MEMORY_SNES_SUFAMI_TURBO_B_RAM: if(core_interface.mode != SuperFamicomCartridge::ModeSufamiTurbo) break; return SuperFamicom::sufamiturboB.ram.data(); case RETRO_MEMORY_SNES_GAME_BOY_RAM: if(core_interface.mode != SuperFamicomCartridge::ModeSuperGameBoy) break; return GameBoy::cartridge.ramdata; case RETRO_MEMORY_SYSTEM_RAM: return SuperFamicom::cpu.wram; case RETRO_MEMORY_VIDEO_RAM: return SuperFamicom::ppu.vram; } return nullptr; } size_t retro_get_memory_size(unsigned id) { if(SuperFamicom::cartridge.loaded() == false) return 0; if(core_bind.manifest) return 0; size_t size = 0; switch(id) { case RETRO_MEMORY_SAVE_RAM: size = core_bind.sram_size; output(RETRO_LOG_INFO, "SRAM memory size: %u.\n", (unsigned)size); break; case RETRO_MEMORY_RTC: size = 0; break; case RETRO_MEMORY_SNES_BSX_RAM: size = 0; break; case RETRO_MEMORY_SNES_BSX_PRAM: if(core_interface.mode != SuperFamicomCartridge::ModeBsx) break; size = SuperFamicom::bsxcartridge.psram.size(); break; case RETRO_MEMORY_SNES_SUFAMI_TURBO_A_RAM: if(core_interface.mode != SuperFamicomCartridge::ModeSufamiTurbo) break; size = SuperFamicom::sufamiturboA.ram.size(); break; case RETRO_MEMORY_SNES_SUFAMI_TURBO_B_RAM: if(core_interface.mode != SuperFamicomCartridge::ModeSufamiTurbo) break; size = SuperFamicom::sufamiturboB.ram.size(); break; case RETRO_MEMORY_SNES_GAME_BOY_RAM: if(core_interface.mode != SuperFamicomCartridge::ModeSuperGameBoy) break; size = GameBoy::cartridge.ramsize; break; case RETRO_MEMORY_SYSTEM_RAM: size = 128 * 1024; break; case RETRO_MEMORY_VIDEO_RAM: size = 64 * 1024; break; } if(size == -1U) size = 0; return size; } phoenix/qt/widget/button.cpp000664 001750 001750 00000002752 12651764221 017316 0ustar00sergiosergio000000 000000 namespace phoenix { Size pButton::minimumSize() { Size size = pFont::size(qtWidget->font(), button.state.text); if(button.state.orientation == Orientation::Horizontal) { size.width += button.state.image.width; size.height = max(button.state.image.height, size.height); } if(button.state.orientation == Orientation::Vertical) { size.width = max(button.state.image.width, size.width); size.height += button.state.image.height; } return {size.width + 20, size.height + 12}; } void pButton::setImage(const image& image, Orientation orientation) { qtButton->setIconSize(QSize(image.width, image.height)); qtButton->setIcon(CreateIcon(image)); qtButton->setStyleSheet("text-align: top;"); switch(orientation) { case Orientation::Horizontal: qtButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); break; case Orientation::Vertical: qtButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); break; } } void pButton::setText(string text) { qtButton->setText(QString::fromUtf8(text)); } void pButton::constructor() { qtWidget = qtButton = new QToolButton; qtButton->setToolButtonStyle(Qt::ToolButtonTextOnly); connect(qtButton, SIGNAL(released()), SLOT(onActivate())); pWidget::synchronizeState(); setText(button.state.text); } void pButton::destructor() { delete qtButton; qtWidget = qtButton = nullptr; } void pButton::orphan() { destructor(); constructor(); } void pButton::onActivate() { if(button.onActivate) button.onActivate(); } } phoenix/qt/widget/horizontal-scroller.cpp000664 001750 001750 00000002033 12651764221 022007 0ustar00sergiosergio000000 000000 namespace phoenix { Size pHorizontalScroller::minimumSize() { return {0, 15}; } void pHorizontalScroller::setLength(unsigned length) { length += length == 0; qtScroller->setRange(0, length - 1); qtScroller->setPageStep(length >> 3); } void pHorizontalScroller::setPosition(unsigned position) { qtScroller->setValue(position); } void pHorizontalScroller::constructor() { qtWidget = qtScroller = new QScrollBar(Qt::Horizontal); qtScroller->setRange(0, 100); qtScroller->setPageStep(101 >> 3); connect(qtScroller, SIGNAL(valueChanged(int)), SLOT(onChange())); pWidget::synchronizeState(); setLength(horizontalScroller.state.length); setPosition(horizontalScroller.state.position); } void pHorizontalScroller::destructor() { delete qtScroller; qtWidget = qtScroller = nullptr; } void pHorizontalScroller::orphan() { destructor(); constructor(); } void pHorizontalScroller::onChange() { horizontalScroller.state.position = qtScroller->value(); if(horizontalScroller.onChange) horizontalScroller.onChange(); } } ruby/video/opengl/shaders.hpp000664 001750 001750 00000003421 12651764221 017425 0ustar00sergiosergio000000 000000 static string OpenGLOutputVertexShader = R"( #version 150 uniform vec4 targetSize; uniform vec4 outputSize; in vec2 texCoord; out Vertex { vec2 texCoord; } vertexOut; void main() { //center image within output window if(gl_VertexID == 0 || gl_VertexID == 2) { gl_Position.x = -(targetSize.x / outputSize.x); } else { gl_Position.x = +(targetSize.x / outputSize.x); } //center and flip vertically (buffer[0, 0] = top-left; OpenGL[0, 0] = bottom-left) if(gl_VertexID == 0 || gl_VertexID == 1) { gl_Position.y = +(targetSize.y / outputSize.y); } else { gl_Position.y = -(targetSize.y / outputSize.y); } //align image to even pixel boundary to prevent aliasing vec2 align = fract((outputSize.xy + targetSize.xy) / 2.0) * 2.0; gl_Position.xy -= align / outputSize.xy; gl_Position.zw = vec2(0.0, 1.0); vertexOut.texCoord = texCoord; } )"; static string OpenGLVertexShader = R"( #version 150 in vec4 position; in vec2 texCoord; out Vertex { vec2 texCoord; } vertexOut; void main() { gl_Position = position; vertexOut.texCoord = texCoord; } )"; static string OpenGLGeometryShader = R"( #version 150 layout(triangles) in; layout(triangle_strip, max_vertices = 3) out; in Vertex { vec2 texCoord; } vertexIn[]; out Vertex { vec2 texCoord; }; void main() { for(int i = 0; i < gl_in.length(); i++) { gl_Position = gl_in[i].gl_Position; texCoord = vertexIn[i].texCoord; EmitVertex(); } EndPrimitive(); } )"; static string OpenGLFragmentShader = R"( #version 150 uniform sampler2D source[]; in Vertex { vec2 texCoord; }; out vec4 fragColor; void main() { fragColor = texture(source[0], texCoord); } )"; nall/string/list.hpp000664 001750 001750 00000003453 12651764221 015635 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { optional lstring::find(rstring key) const { for(unsigned i = 0; i < size(); i++) { if(operator[](i) == key) return {true, i}; } return false; } string lstring::merge(const string& separator) const { string output; for(unsigned i = 0; i < size(); i++) { output.append(operator[](i)); if(i < size() - 1) output.append(separator); } return output; } lstring& lstring::isort() { nall::sort(pool, objectsize, [](const string& x, const string& y) { return istrcmp(x, y) < 0; }); return *this; } lstring& lstring::strip() { for(unsigned n = 0; n < size(); n++) { operator[](n).strip(); } return *this; } template void lstring::append(const string& data, Args&&... args) { vector::append(data); append(std::forward(args)...); } bool lstring::operator==(const lstring& source) const { if(this == &source) return true; if(size() != source.size()) return false; for(unsigned n = 0; n < size(); n++) { if(operator[](n) != source[n]) return false; } return true; } bool lstring::operator!=(const lstring& source) const { return !operator==(source); } lstring& lstring::operator=(const lstring& source) { vector::operator=(source); return *this; } lstring& lstring::operator=(lstring& source) { vector::operator=(source); return *this; } lstring& lstring::operator=(lstring&& source) { vector::operator=(std::move(source)); return *this; } template lstring::lstring(Args&&... args) { append(std::forward(args)...); } lstring::lstring(const lstring& source) { vector::operator=(source); } lstring::lstring(lstring& source) { vector::operator=(source); } lstring::lstring(lstring&& source) { vector::operator=(std::move(source)); } } #endif phoenix/windows/widget/check-label.cpp000664 001750 001750 00000001763 12651764221 021204 0ustar00sergiosergio000000 000000 namespace phoenix { Size pCheckLabel::minimumSize() { Size size = pFont::size(hfont, checkLabel.state.text); return {size.width + 20, size.height + 4}; } void pCheckLabel::setChecked(bool checked) { SendMessage(hwnd, BM_SETCHECK, (WPARAM)checked, 0); } void pCheckLabel::setText(string text) { SetWindowText(hwnd, utf16_t(text)); } void pCheckLabel::constructor() { hwnd = CreateWindow( L"BUTTON", L"", WS_CHILD | WS_TABSTOP | BS_CHECKBOX, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&checkLabel); setDefaultFont(); setChecked(checkLabel.state.checked); setText(checkLabel.state.text); synchronize(); } void pCheckLabel::destructor() { DestroyWindow(hwnd); } void pCheckLabel::orphan() { destructor(); constructor(); } void pCheckLabel::onToggle() { checkLabel.state.checked = !checkLabel.state.checked; setChecked(checkLabel.state.checked); if(checkLabel.onToggle) checkLabel.onToggle(); } } phoenix/windows/utility.cpp000664 001750 001750 00000036174 12651764221 017276 0ustar00sergiosergio000000 000000 namespace phoenix { static const unsigned Windows2000 = 0x0500; static const unsigned WindowsXP = 0x0501; static const unsigned WindowsVista = 0x0600; static const unsigned Windows7 = 0x0601; static unsigned OsVersion() { OSVERSIONINFO versionInfo = {0}; versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&versionInfo); return (versionInfo.dwMajorVersion << 8) + (versionInfo.dwMajorVersion << 0); } static HBITMAP CreateBitmap(const image& image) { HDC hdc = GetDC(0); BITMAPINFO bitmapInfo; memset(&bitmapInfo, 0, sizeof(BITMAPINFO)); bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bitmapInfo.bmiHeader.biWidth = image.width; bitmapInfo.bmiHeader.biHeight = -image.height; //bitmaps are stored upside down unless we negate height bitmapInfo.bmiHeader.biPlanes = 1; bitmapInfo.bmiHeader.biBitCount = 32; bitmapInfo.bmiHeader.biCompression = BI_RGB; bitmapInfo.bmiHeader.biSizeImage = image.width * image.height * 4; void* bits = nullptr; HBITMAP hbitmap = CreateDIBSection(hdc, &bitmapInfo, DIB_RGB_COLORS, &bits, NULL, 0); if(bits) memcpy(bits, image.data, image.width * image.height * 4); ReleaseDC(0, hdc); return hbitmap; } static lstring DropPaths(WPARAM wparam) { auto dropList = HDROP(wparam); auto fileCount = DragQueryFile(dropList, ~0u, nullptr, 0); lstring paths; for(unsigned n = 0; n < fileCount; n++) { auto length = DragQueryFile(dropList, n, nullptr, 0); auto buffer = new wchar_t[length + 1]; if(DragQueryFile(dropList, n, buffer, length + 1)) { string path = (const char*)utf8_t(buffer); path.transform("\\", "/"); if(directory::exists(path) && !path.endsWith("/")) path.append("/"); paths.append(path); } delete[] buffer; } return paths; } static Layout* GetParentWidgetLayout(Sizable* sizable) { while(sizable) { if(sizable->state.parent && dynamic_cast(sizable->state.parent)) return (Layout*)sizable; sizable = sizable->state.parent; } return nullptr; } static Widget* GetParentWidget(Sizable* sizable) { while(sizable) { if(sizable->state.parent && dynamic_cast(sizable->state.parent)) return (Widget*)sizable->state.parent; sizable = sizable->state.parent; } return nullptr; } static unsigned GetWindowZOrder(HWND hwnd) { unsigned z = 0; for(HWND next = hwnd; next != NULL; next = GetWindow(next, GW_HWNDPREV)) z++; return z; } static void ImageList_Append(HIMAGELIST imageList, const nall::image& source, unsigned scale) { auto image = source; if(image.empty()) { image.allocate(scale, scale); image.fill(GetSysColor(COLOR_WINDOW)); } image.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0); image.scale(scale, scale); HBITMAP bitmap = CreateBitmap(image); ImageList_Add(imageList, bitmap, NULL); DeleteObject(bitmap); } static Keyboard::Keycode Keysym(unsigned keysym, unsigned keyflags) { #define pressed(keysym) (GetAsyncKeyState(keysym) & 0x8000) #define enabled(keysym) (GetKeyState(keysym)) #define shifted() (pressed(VK_LSHIFT) || pressed(VK_RSHIFT)) #define extended() (keyflags & (1 << 24)) switch(keysym) { case VK_ESCAPE: return Keyboard::Keycode::Escape; case VK_F1: return Keyboard::Keycode::F1; case VK_F2: return Keyboard::Keycode::F2; case VK_F3: return Keyboard::Keycode::F3; case VK_F4: return Keyboard::Keycode::F4; case VK_F5: return Keyboard::Keycode::F5; case VK_F6: return Keyboard::Keycode::F6; case VK_F7: return Keyboard::Keycode::F7; case VK_F8: return Keyboard::Keycode::F8; case VK_F9: return Keyboard::Keycode::F9; //Keyboard::Keycode::F10 (should be captured under VK_MENU from WM_SYSKEY(UP,DOWN); but this is not working...) case VK_F11: return Keyboard::Keycode::F11; case VK_F12: return Keyboard::Keycode::F12; //Keyboard::Keycode::PrintScreen //Keyboard::Keycode::SysRq case VK_SCROLL: return Keyboard::Keycode::ScrollLock; case VK_PAUSE: return Keyboard::Keycode::Pause; //Keyboard::Keycode::Break case VK_INSERT: return extended() ? Keyboard::Keycode::Insert : Keyboard::Keycode::KeypadInsert; case VK_DELETE: return extended() ? Keyboard::Keycode::Delete : Keyboard::Keycode::KeypadDelete; case VK_HOME: return extended() ? Keyboard::Keycode::Home : Keyboard::Keycode::KeypadHome; case VK_END: return extended() ? Keyboard::Keycode::End : Keyboard::Keycode::KeypadEnd; case VK_PRIOR: return extended() ? Keyboard::Keycode::PageUp : Keyboard::Keycode::KeypadPageUp; case VK_NEXT: return extended() ? Keyboard::Keycode::PageDown : Keyboard::Keycode::KeypadPageDown; case VK_UP: return extended() ? Keyboard::Keycode::Up : Keyboard::Keycode::KeypadUp; case VK_DOWN: return extended() ? Keyboard::Keycode::Down : Keyboard::Keycode::KeypadDown; case VK_LEFT: return extended() ? Keyboard::Keycode::Left : Keyboard::Keycode::KeypadLeft; case VK_RIGHT: return extended() ? Keyboard::Keycode::Right : Keyboard::Keycode::KeypadRight; case VK_OEM_3: return !shifted() ? Keyboard::Keycode::Grave : Keyboard::Keycode::Tilde; case '1': return !shifted() ? Keyboard::Keycode::Number1 : Keyboard::Keycode::Exclamation; case '2': return !shifted() ? Keyboard::Keycode::Number2 : Keyboard::Keycode::At; case '3': return !shifted() ? Keyboard::Keycode::Number3 : Keyboard::Keycode::Pound; case '4': return !shifted() ? Keyboard::Keycode::Number4 : Keyboard::Keycode::Dollar; case '5': return !shifted() ? Keyboard::Keycode::Number5 : Keyboard::Keycode::Percent; case '6': return !shifted() ? Keyboard::Keycode::Number6 : Keyboard::Keycode::Power; case '7': return !shifted() ? Keyboard::Keycode::Number7 : Keyboard::Keycode::Ampersand; case '8': return !shifted() ? Keyboard::Keycode::Number8 : Keyboard::Keycode::Asterisk; case '9': return !shifted() ? Keyboard::Keycode::Number9 : Keyboard::Keycode::ParenthesisLeft; case '0': return !shifted() ? Keyboard::Keycode::Number0 : Keyboard::Keycode::ParenthesisRight; case VK_OEM_MINUS: return !shifted() ? Keyboard::Keycode::Minus : Keyboard::Keycode::Underscore; case VK_OEM_PLUS: return !shifted() ? Keyboard::Keycode::Equal : Keyboard::Keycode::Plus; case VK_BACK: return Keyboard::Keycode::Backspace; case VK_OEM_4: return !shifted() ? Keyboard::Keycode::BracketLeft : Keyboard::Keycode::BraceLeft; case VK_OEM_6: return !shifted() ? Keyboard::Keycode::BracketRight : Keyboard::Keycode::BraceRight; case VK_OEM_5: return !shifted() ? Keyboard::Keycode::Backslash : Keyboard::Keycode::Pipe; case VK_OEM_1: return !shifted() ? Keyboard::Keycode::Semicolon : Keyboard::Keycode::Colon; case VK_OEM_7: return !shifted() ? Keyboard::Keycode::Apostrophe : Keyboard::Keycode::Quote; case VK_OEM_COMMA: return !shifted() ? Keyboard::Keycode::Comma : Keyboard::Keycode::CaretLeft; case VK_OEM_PERIOD: return !shifted() ? Keyboard::Keycode::Period : Keyboard::Keycode::CaretRight; case VK_OEM_2: return !shifted() ? Keyboard::Keycode::Slash : Keyboard::Keycode::Question; case VK_TAB: return Keyboard::Keycode::Tab; case VK_CAPITAL: return Keyboard::Keycode::CapsLock; case VK_RETURN: return !extended() ? Keyboard::Keycode::Return : Keyboard::Keycode::Enter; case VK_SHIFT: return !pressed(VK_RSHIFT) ? Keyboard::Keycode::ShiftLeft : Keyboard::Keycode::ShiftRight; case VK_CONTROL: return !pressed(VK_RCONTROL) ? Keyboard::Keycode::ControlLeft : Keyboard::Keycode::ControlRight; case VK_LWIN: return Keyboard::Keycode::SuperLeft; case VK_RWIN: return Keyboard::Keycode::SuperRight; case VK_MENU: if(keyflags & (1 << 24)) return Keyboard::Keycode::AltRight; return Keyboard::Keycode::AltLeft; case VK_SPACE: return Keyboard::Keycode::Space; case VK_APPS: return Keyboard::Keycode::Menu; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': if(enabled(VK_CAPITAL)) { if(shifted()) { return (Keyboard::Keycode)((unsigned)Keyboard::Keycode::a + keysym - 'A'); } else { return (Keyboard::Keycode)((unsigned)Keyboard::Keycode::A + keysym - 'A'); } } else { if(shifted()) { return (Keyboard::Keycode)((unsigned)Keyboard::Keycode::A + keysym - 'A'); } else { return (Keyboard::Keycode)((unsigned)Keyboard::Keycode::a + keysym - 'A'); } } break; case VK_NUMLOCK: return Keyboard::Keycode::NumLock; case VK_DIVIDE: return Keyboard::Keycode::Divide; case VK_MULTIPLY: return Keyboard::Keycode::Multiply; case VK_SUBTRACT: return Keyboard::Keycode::Subtract; case VK_ADD: return Keyboard::Keycode::Add; case VK_DECIMAL: return Keyboard::Keycode::Point; case VK_NUMPAD1: return Keyboard::Keycode::Keypad1; case VK_NUMPAD2: return Keyboard::Keycode::Keypad2; case VK_NUMPAD3: return Keyboard::Keycode::Keypad3; case VK_NUMPAD4: return Keyboard::Keycode::Keypad4; case VK_NUMPAD5: return Keyboard::Keycode::Keypad5; case VK_NUMPAD6: return Keyboard::Keycode::Keypad6; case VK_NUMPAD7: return Keyboard::Keycode::Keypad7; case VK_NUMPAD8: return Keyboard::Keycode::Keypad8; case VK_NUMPAD9: return Keyboard::Keycode::Keypad9; case VK_NUMPAD0: return Keyboard::Keycode::Keypad0; case VK_CLEAR: return Keyboard::Keycode::KeypadCenter; } return Keyboard::Keycode::None; #undef pressed #undef enabled #undef shifted #undef extended } static unsigned ScrollEvent(HWND hwnd, WPARAM wparam) { SCROLLINFO info; memset(&info, 0, sizeof(SCROLLINFO)); info.cbSize = sizeof(SCROLLINFO); info.fMask = SIF_ALL; GetScrollInfo(hwnd, SB_CTL, &info); switch(LOWORD(wparam)) { case SB_LEFT: info.nPos = info.nMin; break; case SB_RIGHT: info.nPos = info.nMax; break; case SB_LINELEFT: info.nPos--; break; case SB_LINERIGHT: info.nPos++; break; case SB_PAGELEFT: info.nPos -= info.nMax >> 3; break; case SB_PAGERIGHT: info.nPos += info.nMax >> 3; break; case SB_THUMBTRACK: info.nPos = info.nTrackPos; break; } info.fMask = SIF_POS; SetScrollInfo(hwnd, SB_CTL, &info, TRUE); //Windows may clamp position to scroller range GetScrollInfo(hwnd, SB_CTL, &info); return info.nPos; } static LRESULT CALLBACK Shared_windowProc(WindowProc windowProc, HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { Object* object = (Object*)GetWindowLongPtr(hwnd, GWLP_USERDATA); if(object == nullptr) return DefWindowProc(hwnd, msg, wparam, lparam); Window& window = dynamic_cast(object) ? *(Window*)object : *((Widget*)object)->Sizable::state.window; bool process = true; if(!pWindow::modal.empty() && !pWindow::modal.find(&window.p)) process = false; if(applicationState.quit) process = false; if(process == false) return DefWindowProc(hwnd, msg, wparam, lparam); switch(msg) { case WM_CTLCOLORBTN: case WM_CTLCOLORSTATIC: { Object* object = (Object*)GetWindowLongPtr((HWND)lparam, GWLP_USERDATA); if(object == nullptr) break; if(dynamic_cast(object) || dynamic_cast(object) || dynamic_cast(object)) { //text edit controls, when disabled, use CTLCOLORSTATIC instead of CTLCOLOREDIT //override this behavior: we do not want read-only edit controls to use the parent window background color return windowProc(hwnd, WM_CTLCOLOREDIT, wparam, lparam); } else if(!GetParentWidget((Sizable*)object) && window.p.brush) { SetBkColor((HDC)wparam, window.p.brushColor); return (INT_PTR)window.p.brush; } break; } case WM_DRAWITEM: { unsigned id = LOWORD(wparam); HWND control = GetDlgItem(hwnd, id); Object* object = (Object*)GetWindowLongPtr(control, GWLP_USERDATA); if(object == nullptr) break; if(dynamic_cast(object)) { ((TabFrame*)object)->p.onDrawItem(lparam); return TRUE; } break; } case WM_COMMAND: { unsigned id = LOWORD(wparam); HWND control = GetDlgItem(hwnd, id); Object* object = control ? (Object*)GetWindowLongPtr(control, GWLP_USERDATA) : pObject::find(id); if(object == nullptr) break; if(dynamic_cast(object)) { ((Item*)object)->p.onActivate(); return FALSE; } if(dynamic_cast(object)) { ((CheckItem*)object)->p.onToggle(); return FALSE; } if(dynamic_cast(object)) { ((RadioItem*)object)->p.onActivate(); return FALSE; } if(dynamic_cast(object)) { ((Button*)object)->p.onActivate(); return FALSE; } if(dynamic_cast(object)) { ((CheckButton*)object)->p.onToggle(); return FALSE; } if(dynamic_cast(object)) { ((CheckLabel*)object)->p.onToggle(); return FALSE; } if(dynamic_cast(object) && HIWORD(wparam) == CBN_SELCHANGE) { ((ComboButton*)object)->p.onChange(); return FALSE; } if(dynamic_cast(object) && HIWORD(wparam) == EN_CHANGE) { ((LineEdit*)object)->p.onChange(); return FALSE; } if(dynamic_cast(object)) { ((RadioButton*)object)->p.onActivate(); return FALSE; } if(dynamic_cast(object)) { ((RadioLabel*)object)->p.onActivate(); return FALSE; } if(dynamic_cast(object) && HIWORD(wparam) == EN_CHANGE) { ((TextEdit*)object)->p.onChange(); return FALSE; } break; } case WM_NOTIFY: { unsigned id = LOWORD(wparam); HWND control = GetDlgItem(hwnd, id); Object* object = (Object*)GetWindowLongPtr(control, GWLP_USERDATA); if(object == nullptr) break; if(dynamic_cast(object) && ((LPNMHDR)lparam)->code == LVN_ITEMACTIVATE) { ((ListView*)object)->p.onActivate(lparam); break; } if(dynamic_cast(object) && ((LPNMHDR)lparam)->code == LVN_ITEMCHANGED) { ((ListView*)object)->p.onChange(lparam); break; } if(dynamic_cast(object) && ((LPNMHDR)lparam)->code == NM_CUSTOMDRAW) { return ((ListView*)object)->p.onCustomDraw(lparam); } if(dynamic_cast(object) && ((LPNMHDR)lparam)->code == TCN_SELCHANGE) { ((TabFrame*)object)->p.onChange(); break; } break; } case WM_APP + AppMessage::ListView_onActivate: { ListView* listView = (ListView*)lparam; if(listView && listView->onActivate) listView->onActivate(); break; } case WM_HSCROLL: case WM_VSCROLL: { Object* object = nullptr; if(lparam) { object = (Object*)GetWindowLongPtr((HWND)lparam, GWLP_USERDATA); } else { unsigned id = LOWORD(wparam); HWND control = GetDlgItem(hwnd, id); object = (Object*)GetWindowLongPtr(control, GWLP_USERDATA); } if(object == nullptr) break; if(dynamic_cast(object)) { ((HorizontalScroller*)object)->p.onChange(wparam); return TRUE; } if(dynamic_cast(object)) { ((VerticalScroller*)object)->p.onChange(wparam); return TRUE; } if(dynamic_cast(object)) { ((HorizontalSlider*)object)->p.onChange(); return TRUE; } if(dynamic_cast(object)) { ((VerticalSlider*)object)->p.onChange(); return TRUE; } break; } } return windowProc(hwnd, msg, wparam, lparam); } } target-ethos/resource/video.png000664 001750 001750 00000001226 12651764221 017762 0ustar00sergiosergio000000 000000 PNG  IHDRasBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<IDAT8jASUsmH2 b#& 6pc|7QP1|l\ "`&aH:.:A<*wΡn?:yWջNUo\&ygtn[_Z|ĩjmttIzQM"^(@ߧυc"Z,o=SS%QP DI6ggg1J=!cRf+;>aZ|X[czz$IpIP#l @T^ez4g8FbLAp$lhpOKEkIEQk#aLoš>EQqB(j8Q!F1"%smcſ)Ҝ t:j@ 0S8WV@Yi>̇WРʮ}B No]x*[[YyKKIop%2O#1fެ?mFk֚32nwF IENDB`phoenix/reference/action/separator.hpp000664 001750 001750 00000000325 12651764221 021306 0ustar00sergiosergio000000 000000 namespace phoenix { struct pSeparator : public pAction { Separator& separator; pSeparator(Separator& separator) : pAction(separator), separator(separator) {} void constructor(); void destructor(); }; } fc/cartridge/chip/vrc3.cpp000664 001750 001750 00000004064 12651764221 016554 0ustar00sergiosergio000000 000000 struct VRC3 : Chip { uint4 prg_bank; bool irq_mode; bool irq_enable; bool irq_acknowledge; uint16 irq_latch; struct { union { uint16 w; struct { uint8 order_lsb2(l, h); }; }; } irq_counter; bool irq_line; void main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(irq_enable) { if(irq_mode == 0) { //16-bit if(++irq_counter.w == 0) { irq_line = 1; irq_enable = irq_acknowledge; irq_counter.w = irq_latch; } } if(irq_mode == 1) { //8-bit if(++irq_counter.l == 0) { irq_line = 1; irq_enable = irq_acknowledge; irq_counter.l = irq_latch; } } } cpu.set_irq_line(irq_line); tick(); } } unsigned prg_addr(unsigned addr) const { unsigned bank = (addr < 0xc000 ? (unsigned)prg_bank : 0x0f); return (bank * 0x4000) + (addr & 0x3fff); } void reg_write(unsigned addr, uint8 data) { switch(addr & 0xf000) { case 0x8000: irq_latch = (irq_latch & 0xfff0) | ((data & 0x0f) << 0); break; case 0x9000: irq_latch = (irq_latch & 0xff0f) | ((data & 0x0f) << 4); break; case 0xa000: irq_latch = (irq_latch & 0xf0ff) | ((data & 0x0f) << 8); break; case 0xb000: irq_latch = (irq_latch & 0x0fff) | ((data & 0x0f) << 12); break; case 0xc000: irq_mode = data & 0x04; irq_enable = data & 0x02; irq_acknowledge = data & 0x01; if(irq_enable) irq_counter.w = irq_latch; break; case 0xd000: irq_line = 0; irq_enable = irq_acknowledge; break; case 0xf000: prg_bank = data & 0x0f; break; } } void power() { } void reset() { prg_bank = 0; irq_mode = 0; irq_enable = 0; irq_acknowledge = 0; irq_latch = 0; irq_counter.w = 0; irq_line = 0; } void serialize(serializer& s) { s.integer(prg_bank); s.integer(irq_mode); s.integer(irq_enable); s.integer(irq_acknowledge); s.integer(irq_latch); s.integer(irq_counter.w); s.integer(irq_line); } VRC3(Board& board) : Chip(board) { } }; phoenix/reference/widget/widget.hpp000664 001750 001750 00000000622 12651764221 020577 0ustar00sergiosergio000000 000000 namespace phoenix { struct pWidget : public pSizable { Widget& widget; bool enabled(); bool focused(); Size minimumSize(); void setEnabled(bool enabled); void setFocused(); void setFont(string font); void setGeometry(Geometry geometry); void setVisible(bool visible); pWidget(Widget& widget) : pSizable(widget), widget(widget) {} void constructor(); void destructor(); }; } sfc/alt/smp/disassembler.cpp000664 001750 001750 00000052136 12651764221 017232 0ustar00sergiosergio000000 000000 uint8 SMP::disassemble_read(uint16 addr) { if(addr >= 0xffc0) return smp.iplrom[addr & 0x3f]; return smp.apuram[addr]; } uint16 SMP::relb(int8 offset, int op_len) { uint16 pc = regs.pc + op_len; return pc + offset; } void SMP::disassemble_opcode(char* output, uint16 addr) { char* s; char t[512]; uint8 op, op0, op1; uint16 opw, opdp0, opdp1; s = output; sprintf(s, "..%.4x ", addr); op = disassemble_read(addr + 0); op0 = disassemble_read(addr + 1); op1 = disassemble_read(addr + 2); opw = (op0) | (op1 << 8); opdp0 = ((unsigned)regs.p.p << 8) + op0; opdp1 = ((unsigned)regs.p.p << 8) + op1; strcpy(t, " "); switch(op) { case 0x00: sprintf(t, "nop"); break; case 0x01: sprintf(t, "tcall 0"); break; case 0x02: sprintf(t, "set0 $%.3x", opdp0); break; case 0x03: sprintf(t, "bbs0 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x04: sprintf(t, "or a,$%.3x", opdp0); break; case 0x05: sprintf(t, "or a,$%.4x", opw); break; case 0x06: sprintf(t, "or a,(x)"); break; case 0x07: sprintf(t, "or a,($%.3x+x)", opdp0); break; case 0x08: sprintf(t, "or a,#$%.2x", op0); break; case 0x09: sprintf(t, "or $%.3x,$%.3x", opdp1, opdp0); break; case 0x0a: sprintf(t, "or1 c,$%.4x:%d", opw & 0x1fff, opw >> 13); break; case 0x0b: sprintf(t, "asl $%.3x", opdp0); break; case 0x0c: sprintf(t, "asl $%.4x", opw); break; case 0x0d: sprintf(t, "push p"); break; case 0x0e: sprintf(t, "tset $%.4x,a", opw); break; case 0x0f: sprintf(t, "brk"); break; case 0x10: sprintf(t, "bpl $%.4x", relb(op0, 2)); break; case 0x11: sprintf(t, "tcall 1"); break; case 0x12: sprintf(t, "clr0 $%.3x", opdp0); break; case 0x13: sprintf(t, "bbc0 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x14: sprintf(t, "or a,$%.3x+x", opdp0); break; case 0x15: sprintf(t, "or a,$%.4x+x", opw); break; case 0x16: sprintf(t, "or a,$%.4x+y", opw); break; case 0x17: sprintf(t, "or a,($%.3x)+y", opdp0); break; case 0x18: sprintf(t, "or $%.3x,#$%.2x", opdp1, op0); break; case 0x19: sprintf(t, "or (x),(y)"); break; case 0x1a: sprintf(t, "decw $%.3x", opdp0); break; case 0x1b: sprintf(t, "asl $%.3x+x", opdp0); break; case 0x1c: sprintf(t, "asl a"); break; case 0x1d: sprintf(t, "dec x"); break; case 0x1e: sprintf(t, "cmp x,$%.4x", opw); break; case 0x1f: sprintf(t, "jmp ($%.4x+x)", opw); break; case 0x20: sprintf(t, "clrp"); break; case 0x21: sprintf(t, "tcall 2"); break; case 0x22: sprintf(t, "set1 $%.3x", opdp0); break; case 0x23: sprintf(t, "bbs1 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x24: sprintf(t, "and a,$%.3x", opdp0); break; case 0x25: sprintf(t, "and a,$%.4x", opw); break; case 0x26: sprintf(t, "and a,(x)"); break; case 0x27: sprintf(t, "and a,($%.3x+x)", opdp0); break; case 0x28: sprintf(t, "and a,#$%.2x", op0); break; case 0x29: sprintf(t, "and $%.3x,$%.3x", opdp1, opdp0); break; case 0x2a: sprintf(t, "or1 c,!$%.4x:%d", opw & 0x1fff, opw >> 13); break; case 0x2b: sprintf(t, "rol $%.3x", opdp0); break; case 0x2c: sprintf(t, "rol $%.4x", opw); break; case 0x2d: sprintf(t, "push a"); break; case 0x2e: sprintf(t, "cbne $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x2f: sprintf(t, "bra $%.4x", relb(op0, 2)); break; case 0x30: sprintf(t, "bmi $%.4x", relb(op0, 2)); break; case 0x31: sprintf(t, "tcall 3"); break; case 0x32: sprintf(t, "clr1 $%.3x", opdp0); break; case 0x33: sprintf(t, "bbc1 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x34: sprintf(t, "and a,$%.3x+x", opdp0); break; case 0x35: sprintf(t, "and a,$%.4x+x", opw); break; case 0x36: sprintf(t, "and a,$%.4x+y", opw); break; case 0x37: sprintf(t, "and a,($%.3x)+y", opdp0); break; case 0x38: sprintf(t, "and $%.3x,#$%.2x", opdp1, op0); break; case 0x39: sprintf(t, "and (x),(y)"); break; case 0x3a: sprintf(t, "incw $%.3x", opdp0); break; case 0x3b: sprintf(t, "rol $%.3x+x", opdp0); break; case 0x3c: sprintf(t, "rol a"); break; case 0x3d: sprintf(t, "inc x"); break; case 0x3e: sprintf(t, "cmp x,$%.3x", opdp0); break; case 0x3f: sprintf(t, "call $%.4x", opw); break; case 0x40: sprintf(t, "setp"); break; case 0x41: sprintf(t, "tcall 4"); break; case 0x42: sprintf(t, "set2 $%.3x", opdp0); break; case 0x43: sprintf(t, "bbs2 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x44: sprintf(t, "eor a,$%.3x", opdp0); break; case 0x45: sprintf(t, "eor a,$%.4x", opw); break; case 0x46: sprintf(t, "eor a,(x)"); break; case 0x47: sprintf(t, "eor a,($%.3x+x)", opdp0); break; case 0x48: sprintf(t, "eor a,#$%.2x", op0); break; case 0x49: sprintf(t, "eor $%.3x,$%.3x", opdp1, opdp0); break; case 0x4a: sprintf(t, "and1 c,$%.4x:%d", opw & 0x1fff, opw >> 13); break; case 0x4b: sprintf(t, "lsr $%.3x", opdp0); break; case 0x4c: sprintf(t, "lsr $%.4x", opw); break; case 0x4d: sprintf(t, "push x"); break; case 0x4e: sprintf(t, "tclr $%.4x,a", opw); break; case 0x4f: sprintf(t, "pcall $ff%.2x", op0); break; case 0x50: sprintf(t, "bvc $%.4x", relb(op0, 2)); break; case 0x51: sprintf(t, "tcall 5"); break; case 0x52: sprintf(t, "clr2 $%.3x", opdp0); break; case 0x53: sprintf(t, "bbc2 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x54: sprintf(t, "eor a,$%.3x+x", opdp0); break; case 0x55: sprintf(t, "eor a,$%.4x+x", opw); break; case 0x56: sprintf(t, "eor a,$%.4x+y", opw); break; case 0x57: sprintf(t, "eor a,($%.3x)+y", opdp0); break; case 0x58: sprintf(t, "eor $%.3x,#$%.2x", opdp1, op0); break; case 0x59: sprintf(t, "eor (x),(y)"); break; case 0x5a: sprintf(t, "cmpw ya,$%.3x", opdp0); break; case 0x5b: sprintf(t, "lsr $%.3x+x", opdp0); break; case 0x5c: sprintf(t, "lsr a"); break; case 0x5d: sprintf(t, "mov x,a"); break; case 0x5e: sprintf(t, "cmp y,$%.4x", opw); break; case 0x5f: sprintf(t, "jmp $%.4x", opw); break; case 0x60: sprintf(t, "clrc"); break; case 0x61: sprintf(t, "tcall 6"); break; case 0x62: sprintf(t, "set3 $%.3x", opdp0); break; case 0x63: sprintf(t, "bbs3 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x64: sprintf(t, "cmp a,$%.3x", opdp0); break; case 0x65: sprintf(t, "cmp a,$%.4x", opw); break; case 0x66: sprintf(t, "cmp a,(x)"); break; case 0x67: sprintf(t, "cmp a,($%.3x+x)", opdp0); break; case 0x68: sprintf(t, "cmp a,#$%.2x", op0); break; case 0x69: sprintf(t, "cmp $%.3x,$%.3x", opdp1, opdp0); break; case 0x6a: sprintf(t, "and1 c,!$%.4x:%d", opw & 0x1fff, opw >> 13); break; case 0x6b: sprintf(t, "ror $%.3x", opdp0); break; case 0x6c: sprintf(t, "ror $%.4x", opw); break; case 0x6d: sprintf(t, "push y"); break; case 0x6e: sprintf(t, "dbnz $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x6f: sprintf(t, "ret"); break; case 0x70: sprintf(t, "bvs $%.4x", relb(op0, 2)); break; case 0x71: sprintf(t, "tcall 7"); break; case 0x72: sprintf(t, "clr3 $%.3x", opdp0); break; case 0x73: sprintf(t, "bbc3 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x74: sprintf(t, "cmp a,$%.3x+x", opdp0); break; case 0x75: sprintf(t, "cmp a,$%.4x+x", opw); break; case 0x76: sprintf(t, "cmp a,$%.4x+y", opw); break; case 0x77: sprintf(t, "cmp a,($%.3x)+y", opdp0); break; case 0x78: sprintf(t, "cmp $%.3x,#$%.2x", opdp1, op0); break; case 0x79: sprintf(t, "cmp (x),(y)"); break; case 0x7a: sprintf(t, "addw ya,$%.3x", opdp0); break; case 0x7b: sprintf(t, "ror $%.3x+x", opdp0); break; case 0x7c: sprintf(t, "ror a"); break; case 0x7d: sprintf(t, "mov a,x"); break; case 0x7e: sprintf(t, "cmp y,$%.3x", opdp0); break; case 0x7f: sprintf(t, "reti"); break; case 0x80: sprintf(t, "setc"); break; case 0x81: sprintf(t, "tcall 8"); break; case 0x82: sprintf(t, "set4 $%.3x", opdp0); break; case 0x83: sprintf(t, "bbs4 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x84: sprintf(t, "adc a,$%.3x", opdp0); break; case 0x85: sprintf(t, "adc a,$%.4x", opw); break; case 0x86: sprintf(t, "adc a,(x)"); break; case 0x87: sprintf(t, "adc a,($%.3x+x)", opdp0); break; case 0x88: sprintf(t, "adc a,#$%.2x", op0); break; case 0x89: sprintf(t, "adc $%.3x,$%.3x", opdp1, opdp0); break; case 0x8a: sprintf(t, "eor1 c,$%.4x:%d", opw & 0x1fff, opw >> 13); break; case 0x8b: sprintf(t, "dec $%.3x", opdp0); break; case 0x8c: sprintf(t, "dec $%.4x", opw); break; case 0x8d: sprintf(t, "mov y,#$%.2x", op0); break; case 0x8e: sprintf(t, "pop p"); break; case 0x8f: sprintf(t, "mov $%.3x,#$%.2x", opdp1, op0); break; case 0x90: sprintf(t, "bcc $%.4x", relb(op0, 2)); break; case 0x91: sprintf(t, "tcall 9"); break; case 0x92: sprintf(t, "clr4 $%.3x", opdp0); break; case 0x93: sprintf(t, "bbc4 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x94: sprintf(t, "adc a,$%.3x+x", opdp0); break; case 0x95: sprintf(t, "adc a,$%.4x+x", opw); break; case 0x96: sprintf(t, "adc a,$%.4x+y", opw); break; case 0x97: sprintf(t, "adc a,($%.3x)+y", opdp0); break; case 0x98: sprintf(t, "adc $%.3x,#$%.2x", opdp1, op0); break; case 0x99: sprintf(t, "adc (x),(y)"); break; case 0x9a: sprintf(t, "subw ya,$%.3x", opdp0); break; case 0x9b: sprintf(t, "dec $%.3x+x", opdp0); break; case 0x9c: sprintf(t, "dec a"); break; case 0x9d: sprintf(t, "mov x,sp"); break; case 0x9e: sprintf(t, "div ya,x"); break; case 0x9f: sprintf(t, "xcn a"); break; case 0xa0: sprintf(t, "ei"); break; case 0xa1: sprintf(t, "tcall 10"); break; case 0xa2: sprintf(t, "set5 $%.3x", opdp0); break; case 0xa3: sprintf(t, "bbs5 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0xa4: sprintf(t, "sbc a,$%.3x", opdp0); break; case 0xa5: sprintf(t, "sbc a,$%.4x", opw); break; case 0xa6: sprintf(t, "sbc a,(x)"); break; case 0xa7: sprintf(t, "sbc a,($%.3x+x)", opdp0); break; case 0xa8: sprintf(t, "sbc a,#$%.2x", op0); break; case 0xa9: sprintf(t, "sbc $%.3x,$%.3x", opdp1, opdp0); break; case 0xaa: sprintf(t, "mov1 c,$%.4x:%d", opw & 0x1fff, opw >> 13); break; case 0xab: sprintf(t, "inc $%.3x", opdp0); break; case 0xac: sprintf(t, "inc $%.4x", opw); break; case 0xad: sprintf(t, "cmp y,#$%.2x", op0); break; case 0xae: sprintf(t, "pop a"); break; case 0xaf: sprintf(t, "mov (x)+,a"); break; case 0xb0: sprintf(t, "bcs $%.4x", relb(op0, 2)); break; case 0xb1: sprintf(t, "tcall 11"); break; case 0xb2: sprintf(t, "clr5 $%.3x", opdp0); break; case 0xb3: sprintf(t, "bbc5 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0xb4: sprintf(t, "sbc a,$%.3x+x", opdp0); break; case 0xb5: sprintf(t, "sbc a,$%.4x+x", opw); break; case 0xb6: sprintf(t, "sbc a,$%.4x+y", opw); break; case 0xb7: sprintf(t, "sbc a,($%.3x)+y", opdp0); break; case 0xb8: sprintf(t, "sbc $%.3x,#$%.2x", opdp1, op0); break; case 0xb9: sprintf(t, "sbc (x),(y)"); break; case 0xba: sprintf(t, "movw ya,$%.3x", opdp0); break; case 0xbb: sprintf(t, "inc $%.3x+x", opdp0); break; case 0xbc: sprintf(t, "inc a"); break; case 0xbd: sprintf(t, "mov sp,x"); break; case 0xbe: sprintf(t, "das a"); break; case 0xbf: sprintf(t, "mov a,(x)+"); break; case 0xc0: sprintf(t, "di"); break; case 0xc1: sprintf(t, "tcall 12"); break; case 0xc2: sprintf(t, "set6 $%.3x", opdp0); break; case 0xc3: sprintf(t, "bbs6 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0xc4: sprintf(t, "mov $%.3x,a", opdp0); break; case 0xc5: sprintf(t, "mov $%.4x,a", opw); break; case 0xc6: sprintf(t, "mov (x),a"); break; case 0xc7: sprintf(t, "mov ($%.3x+x),a", opdp0); break; case 0xc8: sprintf(t, "cmp x,#$%.2x", op0); break; case 0xc9: sprintf(t, "mov $%.4x,x", opw); break; case 0xca: sprintf(t, "mov1 $%.4x:%d,c", opw & 0x1fff, opw >> 13); break; case 0xcb: sprintf(t, "mov $%.3x,y", opdp0); break; case 0xcc: sprintf(t, "mov $%.4x,y", opw); break; case 0xcd: sprintf(t, "mov x,#$%.2x", op0); break; case 0xce: sprintf(t, "pop x"); break; case 0xcf: sprintf(t, "mul ya"); break; case 0xd0: sprintf(t, "bne $%.4x", relb(op0, 2)); break; case 0xd1: sprintf(t, "tcall 13"); break; case 0xd2: sprintf(t, "clr6 $%.3x", opdp0); break; case 0xd3: sprintf(t, "bbc6 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0xd4: sprintf(t, "mov $%.3x+x,a", opdp0); break; case 0xd5: sprintf(t, "mov $%.4x+x,a", opw); break; case 0xd6: sprintf(t, "mov $%.4x+y,a", opw); break; case 0xd7: sprintf(t, "mov ($%.3x)+y,a", opdp0); break; case 0xd8: sprintf(t, "mov $%.3x,x", opdp0); break; case 0xd9: sprintf(t, "mov $%.3x+y,x", opdp0); break; case 0xda: sprintf(t, "movw $%.3x,ya", opdp0); break; case 0xdb: sprintf(t, "mov $%.3x+x,y", opdp0); break; case 0xdc: sprintf(t, "dec y"); break; case 0xdd: sprintf(t, "mov a,y"); break; case 0xde: sprintf(t, "cbne $%.3x+x,$%.4x", opdp0, relb(op1, 3)); break; case 0xdf: sprintf(t, "daa a"); break; case 0xe0: sprintf(t, "clrv"); break; case 0xe1: sprintf(t, "tcall 14"); break; case 0xe2: sprintf(t, "set7 $%.3x", opdp0); break; case 0xe3: sprintf(t, "bbs7 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0xe4: sprintf(t, "mov a,$%.3x", opdp0); break; case 0xe5: sprintf(t, "mov a,$%.4x", opw); break; case 0xe6: sprintf(t, "mov a,(x)"); break; case 0xe7: sprintf(t, "mov a,($%.3x+x)", opdp0); break; case 0xe8: sprintf(t, "mov a,#$%.2x", op0); break; case 0xe9: sprintf(t, "mov x,$%.4x", opw); break; case 0xea: sprintf(t, "not1 c,$%.4x:%d", opw & 0x1fff, opw >> 13); break; case 0xeb: sprintf(t, "mov y,$%.3x", opdp0); break; case 0xec: sprintf(t, "mov y,$%.4x", opw); break; case 0xed: sprintf(t, "notc"); break; case 0xee: sprintf(t, "pop y"); break; case 0xef: sprintf(t, "sleep"); break; case 0xf0: sprintf(t, "beq $%.4x", relb(op0, 2)); break; case 0xf1: sprintf(t, "tcall 15"); break; case 0xf2: sprintf(t, "clr7 $%.3x", opdp0); break; case 0xf3: sprintf(t, "bbc7 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0xf4: sprintf(t, "mov a,$%.3x+x", opdp0); break; case 0xf5: sprintf(t, "mov a,$%.4x+x", opw); break; case 0xf6: sprintf(t, "mov a,$%.4x+y", opw); break; case 0xf7: sprintf(t, "mov a,($%.3x)+y", opdp0); break; case 0xf8: sprintf(t, "mov x,$%.3x", opdp0); break; case 0xf9: sprintf(t, "mov x,$%.3x+y", opdp0); break; case 0xfa: sprintf(t, "mov $%.3x,$%.3x", opdp1, opdp0); break; case 0xfb: sprintf(t, "mov y,$%.3x+x", opdp0); break; case 0xfc: sprintf(t, "inc y"); break; case 0xfd: sprintf(t, "mov y,a"); break; case 0xfe: sprintf(t, "dbnz y,$%.4x", relb(op0, 2)); break; case 0xff: sprintf(t, "stop"); break; } t[strlen(t)] = ' '; strcat(s, t); sprintf(t, "A:%.2x X:%.2x Y:%.2x SP:01%.2x YA:%.4x ", regs.a, regs.x, regs.y, regs.sp, (uint16)regs.ya); strcat(s, t); sprintf(t, "%c%c%c%c%c%c%c%c", regs.p.n ? 'N' : 'n', regs.p.v ? 'V' : 'v', regs.p.p ? 'P' : 'p', regs.p.b ? 'B' : 'b', regs.p.h ? 'H' : 'h', regs.p.i ? 'I' : 'i', regs.p.z ? 'Z' : 'z', regs.p.c ? 'C' : 'c'); strcat(s, t); } sfc/slot/sufamiturbo/000700 001750 001750 00000000000 12656700342 015767 5ustar00sergiosergio000000 000000 sfc/chip/superfx/mmio/mmio.hpp000664 001750 001750 00000000114 12651764221 017511 0ustar00sergiosergio000000 000000 uint8 mmio_read(unsigned addr); void mmio_write(unsigned addr, uint8 data); phoenix/qt/widget/radio-button.cpp000664 001750 001750 00000004654 12651764221 020415 0ustar00sergiosergio000000 000000 namespace phoenix { Size pRadioButton::minimumSize() { Size size = pFont::size(qtWidget->font(), radioButton.state.text); if(radioButton.state.orientation == Orientation::Horizontal) { size.width += radioButton.state.image.width; size.height = max(radioButton.state.image.height, size.height); } if(radioButton.state.orientation == Orientation::Vertical) { size.width = max(radioButton.state.image.width, size.width); size.height += radioButton.state.image.height; } return {size.width + 20, size.height + 12}; } void pRadioButton::setChecked() { parent().locked = true; for(auto& item : radioButton.state.group) { bool checked = &item.p == this; item.p.qtRadioButton->setChecked(item.state.checked = checked); } parent().locked = false; } void pRadioButton::setGroup(const group& group) { parent().locked = true; for(auto& item : radioButton.state.group) { item.p.qtRadioButton->setChecked(item.state.checked); } parent().locked = false; } void pRadioButton::setImage(const image& image, Orientation orientation) { qtRadioButton->setIconSize(QSize(image.width, image.height)); qtRadioButton->setIcon(CreateIcon(image)); qtRadioButton->setStyleSheet("text-align: top;"); switch(orientation) { case Orientation::Horizontal: qtRadioButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); break; case Orientation::Vertical: qtRadioButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); break; } } void pRadioButton::setText(string text) { qtRadioButton->setText(QString::fromUtf8(text)); } pRadioButton& pRadioButton::parent() { if(radioButton.state.group.size()) return radioButton.state.group.first().p; return *this; } void pRadioButton::constructor() { qtWidget = qtRadioButton = new QToolButton; qtRadioButton->setCheckable(true); qtRadioButton->setToolButtonStyle(Qt::ToolButtonTextOnly); connect(qtRadioButton, SIGNAL(toggled(bool)), SLOT(onActivate())); pWidget::synchronizeState(); setGroup(radioButton.state.group); setText(radioButton.state.text); } void pRadioButton::destructor() { if(qtRadioButton) delete qtRadioButton; qtWidget = qtRadioButton = nullptr; } void pRadioButton::orphan() { destructor(); constructor(); } void pRadioButton::onActivate() { if(parent().locked) return; bool wasChecked = radioButton.state.checked; setChecked(); if(!wasChecked) { if(radioButton.onActivate) radioButton.onActivate(); } } } phoenix/reference/mouse.hpp000664 001750 001750 00000000166 12651764221 017164 0ustar00sergiosergio000000 000000 namespace phoenix { struct pMouse { static Position position(); static bool pressed(Mouse::Button button); }; } phoenix/reference/widget/text-edit.hpp000664 001750 001750 00000000556 12651764221 021231 0ustar00sergiosergio000000 000000 namespace phoenix { struct pTextEdit : public pWidget { TextEdit& textEdit; void setCursorPosition(unsigned position); void setEditable(bool editable); void setText(string text); void setWordWrap(bool wordWrap); string text(); pTextEdit(TextEdit& textEdit) : pWidget(textEdit), textEdit(textEdit) {} void constructor(); void destructor(); }; } profile/Game Boy.sys/000700 001750 001750 00000000000 12656700342 015533 5ustar00sergiosergio000000 000000 phoenix/reference/monitor.cpp000664 001750 001750 00000000273 12651764221 017515 0ustar00sergiosergio000000 000000 namespace phoenix { unsigned pMonitor::count() { return 1; } Geometry pMonitor::geometry(unsigned monitor) { return {0, 0, 0, 0}; } unsigned pMonitor::primary() { return 0; } } nall/dsp/resample/average.hpp000664 001750 001750 00000002762 12651764221 017366 0ustar00sergiosergio000000 000000 #ifdef NALL_DSP_INTERNAL_HPP struct ResampleAverage : Resampler { inline void setFrequency(); inline void clear(); inline void sample(); inline void sampleLinear(); ResampleAverage(DSP& dsp) : Resampler(dsp) {} real fraction; real step; }; void ResampleAverage::setFrequency() { fraction = 0.0; step = dsp.settings.frequency / frequency; } void ResampleAverage::clear() { fraction = 0.0; } void ResampleAverage::sample() { //can only average if input frequency >= output frequency if(step < 1.0) return sampleLinear(); fraction += 1.0; real scalar = 1.0; if(fraction > step) scalar = 1.0 - (fraction - step); for(unsigned c = 0; c < dsp.settings.channels; c++) { dsp.output.write(c) += dsp.buffer.read(c) * scalar; } if(fraction >= step) { for(unsigned c = 0; c < dsp.settings.channels; c++) { dsp.output.write(c) /= step; } dsp.output.wroffset++; fraction -= step; for(unsigned c = 0; c < dsp.settings.channels; c++) { dsp.output.write(c) = dsp.buffer.read(c) * fraction; } } dsp.buffer.rdoffset++; } void ResampleAverage::sampleLinear() { while(fraction <= 1.0) { real channel[dsp.settings.channels]; for(unsigned n = 0; n < dsp.settings.channels; n++) { real a = dsp.buffer.read(n, -1); real b = dsp.buffer.read(n, -0); real mu = fraction; channel[n] = a * (1.0 - mu) + b * mu; } dsp.write(channel); fraction += step; } dsp.buffer.rdoffset++; fraction -= 1.0; } #endif sfc/chip/nss/nss.hpp000664 001750 001750 00000000341 12651764221 015523 0ustar00sergiosergio000000 000000 struct NSS { uint8 dip; void init(); void load(); void unload(); void power(); void reset(); void set_dip(uint16 dip); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); }; extern NSS nss; sfc/alt/smp/smp.hpp000664 001750 001750 00000005356 12651764221 015363 0ustar00sergiosergio000000 000000 struct SMP : Thread { uint8 iplrom[64]; uint8* apuram; enum : bool { Threaded = false }; alwaysinline void synchronize_cpu(); alwaysinline void synchronize_dsp(); unsigned port_read(unsigned port); void port_write(unsigned port, unsigned data); unsigned mmio_read(unsigned addr); void mmio_write(unsigned addr, unsigned data); void enter(); void power(); void reset(); void serialize(serializer&); SMP(); ~SMP(); void disassemble_opcode(char *output, uint16 addr); //private: struct Flags { bool n, v, p, b, h, i, z, c; alwaysinline operator unsigned() const { return (n << 7) | (v << 6) | (p << 5) | (b << 4) | (h << 3) | (i << 2) | (z << 1) | (c << 0); }; alwaysinline unsigned operator=(unsigned data) { n = data & 0x80; v = data & 0x40; p = data & 0x20; b = data & 0x10; h = data & 0x08; i = data & 0x04; z = data & 0x02; c = data & 0x01; return data; } alwaysinline unsigned operator|=(unsigned data) { return operator=(operator unsigned() | data); } alwaysinline unsigned operator^=(unsigned data) { return operator=(operator unsigned() ^ data); } alwaysinline unsigned operator&=(unsigned data) { return operator=(operator unsigned() & data); } }; unsigned opcode_number; unsigned opcode_cycle; struct Regs { uint16 pc; uint8 sp; union { uint16 ya; struct { uint8 order_lsb2(a, y); }; }; uint8 x; Flags p; } regs; uint16 rd, wr, dp, sp, ya, bit; struct Status { //$00f1 bool iplrom_enable; //$00f2 unsigned dsp_addr; //$00f8,$00f9 unsigned ram00f8; unsigned ram00f9; } status; template struct Timer { bool enable; uint8 target; uint8 stage1_ticks; uint8 stage2_ticks; uint8 stage3_ticks; void tick(); void tick(unsigned clocks); }; Timer<128> timer0; Timer<128> timer1; Timer< 16> timer2; void tick(); alwaysinline void op_io(); alwaysinline uint8 op_read(uint16 addr); alwaysinline void op_write(uint16 addr, uint8 data); alwaysinline void op_step(); static const unsigned cycle_count_table[256]; uint64 cycle_table_cpu[256]; unsigned cycle_table_dsp[256]; uint64 cycle_step_cpu; uint8 op_adc (uint8 x, uint8 y); uint16 op_addw(uint16 x, uint16 y); uint8 op_and (uint8 x, uint8 y); uint8 op_cmp (uint8 x, uint8 y); uint16 op_cmpw(uint16 x, uint16 y); uint8 op_eor (uint8 x, uint8 y); uint8 op_inc (uint8 x); uint8 op_dec (uint8 x); uint8 op_or (uint8 x, uint8 y); uint8 op_sbc (uint8 x, uint8 y); uint16 op_subw(uint16 x, uint16 y); uint8 op_asl (uint8 x); uint8 op_lsr (uint8 x); uint8 op_rol (uint8 x); uint8 op_ror (uint8 x); }; extern SMP smp; nall/windows/utf8.hpp000664 001750 001750 00000003407 12651764221 015733 0ustar00sergiosergio000000 000000 #ifndef NALL_UTF8_HPP #define NALL_UTF8_HPP //UTF-8 <> UTF-16 conversion //used only for Win32; Linux, etc use UTF-8 internally #if defined(_WIN32) #undef UNICODE #undef _WIN32_WINNT #undef NOMINMAX #define UNICODE #define _WIN32_WINNT 0x0501 #define NOMINMAX #include #include #undef interface #if !defined(PATH_MAX) #define PATH_MAX 260 #endif namespace nall { //UTF-8 to UTF-16 struct utf16_t { operator wchar_t*() { return buffer; } operator const wchar_t*() const { return buffer; } utf16_t(const char* s = "") { if(!s) s = ""; unsigned length = MultiByteToWideChar(CP_UTF8, 0, s, -1, nullptr, 0); buffer = new wchar_t[length + 1](); MultiByteToWideChar(CP_UTF8, 0, s, -1, buffer, length); } ~utf16_t() { delete[] buffer; } private: wchar_t* buffer; }; //UTF-16 to UTF-8 struct utf8_t { operator char*() { return buffer; } operator const char*() const { return buffer; } utf8_t(const wchar_t* s = L"") { if(!s) s = L""; unsigned length = WideCharToMultiByte(CP_UTF8, 0, s, -1, nullptr, 0, nullptr, nullptr); buffer = new char[length + 1](); WideCharToMultiByte(CP_UTF8, 0, s, -1, buffer, length, nullptr, nullptr); } ~utf8_t() { delete[] buffer; } utf8_t(const utf8_t&) = delete; utf8_t& operator=(const utf8_t&) = delete; private: char* buffer; }; inline void utf8_args(int& argc, char**& argv) { wchar_t** wargv = CommandLineToArgvW(GetCommandLineW(), &argc); argv = new char*[argc]; for(unsigned i = 0; i < argc; i++) { argv[i] = new char[PATH_MAX]; strcpy(argv[i], nall::utf8_t(wargv[i])); } } } #endif //if defined(_WIN32) #endif sfc/chip/icd2/interface/interface.cpp000664 001750 001750 00000005561 12651764221 020642 0ustar00sergiosergio000000 000000 #ifdef ICD2_CPP //called on rendered lines 0-143 (not on Vblank lines 144-153) void ICD2::lcdScanline() { if((GameBoy::ppu.status.ly & 7) == 0) { lcd.row = (lcd.row + 1) & 3; } unsigned offset = (lcd.row * 160 * 8) + ((GameBoy::ppu.status.ly & 7) * 160); memcpy(lcd.buffer + offset, GameBoy::ppu.screen + GameBoy::ppu.status.ly * 160, 160 * sizeof(uint32)); } void ICD2::joypWrite(bool p15, bool p14) { //joypad handling if(p15 == 1 && p14 == 1) { if(joyp15lock == 0 && joyp14lock == 0) { joyp15lock = 1; joyp14lock = 1; joyp_id = (joyp_id + 1) & 3; } } if(p15 == 0 && p14 == 1) joyp15lock = 0; if(p15 == 1 && p14 == 0) joyp14lock = 0; //packet handling if(p15 == 0 && p14 == 0) { //pulse pulselock = false; packetoffset = 0; bitoffset = 0; strobelock = true; packetlock = false; return; } if(pulselock) return; if(p15 == 1 && p14 == 1) { strobelock = false; return; } if(strobelock) { if(p15 == 1 || p14 == 1) { //malformed packet packetlock = false; pulselock = true; bitoffset = 0; packetoffset = 0; } else { return; } } //p15:1, p14:0 = 0 //p15:0, p14:1 = 1 bool bit = (p15 == 0); strobelock = true; if(packetlock) { if(p15 == 1 && p14 == 0) { if((joyp_packet[0] >> 3) == 0x11) { mlt_req = joyp_packet[1] & 3; if(mlt_req == 2) mlt_req = 3; joyp_id = 0; } if(packetsize < 64) packet[packetsize++] = joyp_packet; packetlock = false; pulselock = true; } return; } bitdata = (bit << 7) | (bitdata >> 1); if(++bitoffset < 8) return; bitoffset = 0; joyp_packet[packetoffset] = bitdata; if(++packetoffset < 16) return; packetlock = true; } uint32_t ICD2::videoColor(unsigned source, uint16_t red, uint16_t green, uint16_t blue) { return source; } void ICD2::videoRefresh(const uint32_t* data, unsigned pitch, unsigned width, unsigned height) { } void ICD2::audioSample(int16_t left, int16_t right) { audio.coprocessor_sample(left, right); } int16_t ICD2::inputPoll(unsigned port, unsigned device, unsigned id) { GameBoy::cpu.status.mlt_req = joyp_id & mlt_req; unsigned data = 0x00; switch(joyp_id & mlt_req) { case 0: data = ~r6004; break; case 1: data = ~r6005; break; case 2: data = ~r6006; break; case 3: data = ~r6007; break; } switch((GameBoy::Input)id) { case GameBoy::Input::Start: return (bool)(data & 0x80); case GameBoy::Input::Select: return (bool)(data & 0x40); case GameBoy::Input::B: return (bool)(data & 0x20); case GameBoy::Input::A: return (bool)(data & 0x10); case GameBoy::Input::Down: return (bool)(data & 0x08); case GameBoy::Input::Up: return (bool)(data & 0x04); case GameBoy::Input::Left: return (bool)(data & 0x02); case GameBoy::Input::Right: return (bool)(data & 0x01); } return 0; } #endif sfc/system/system.cpp000664 001750 001750 00000021615 12651764221 016044 0ustar00sergiosergio000000 000000 #include #define SYSTEM_CPP namespace SuperFamicom { System system; Configuration configuration; Random random; #include "video.cpp" #include "audio.cpp" #include "input.cpp" #include "serialization.cpp" #include void System::run() { scheduler.sync = Scheduler::SynchronizeMode::None; scheduler.enter(); if(scheduler.exit_reason() == Scheduler::ExitReason::FrameEvent) { video.update(); } } void System::runtosave() { if(CPU::Threaded == true) { scheduler.sync = Scheduler::SynchronizeMode::CPU; runthreadtosave(); } if(SMP::Threaded == true) { scheduler.thread = smp.thread; runthreadtosave(); } if(PPU::Threaded == true) { scheduler.thread = ppu.thread; runthreadtosave(); } if(DSP::Threaded == true) { scheduler.thread = dsp.thread; runthreadtosave(); } for(unsigned i = 0; i < cpu.coprocessors.size(); i++) { auto& chip = *cpu.coprocessors[i]; scheduler.thread = chip.thread; runthreadtosave(); } } void System::runthreadtosave() { while(true) { scheduler.enter(); if(scheduler.exit_reason() == Scheduler::ExitReason::SynchronizeEvent) break; if(scheduler.exit_reason() == Scheduler::ExitReason::FrameEvent) { video.update(); } } } void System::init() { assert(interface != nullptr); satellaviewbaseunit.init(); icd2.init(); bsxcartridge.init(); nss.init(); event.init(); sa1.init(); superfx.init(); armdsp.init(); hitachidsp.init(); necdsp.init(); epsonrtc.init(); sharprtc.init(); spc7110.init(); sdd1.init(); obc1.init(); hsu1.init(); msu1.init(); satellaviewcartridge.init(); dsp1.init(); dsp2.init(); dsp3.init(); dsp4.init(); cx4.init(); st0010.init(); sgbExternal.init(); video.init(); audio.init(); input.connect(0, configuration.controller_port1); input.connect(1, configuration.controller_port2); } void System::term() { } void System::load() { #ifdef __LIBRETRO__ interface->loadRequest(ID::IPLROM, ""); #else string manifest = string::read({interface->path(ID::System), "manifest.bml"}); auto document = Markup::Document(manifest); interface->loadRequest(ID::IPLROM, document["system/smp/rom/name"].data); if(!file::exists({interface->path(ID::System), document["system/smp/rom/name"].data})) { interface->notify("Error: required Super Famicom firmware ipl.rom not found.\n"); } #endif region = configuration.region; expansion = configuration.expansion_port; if(region == Region::Autodetect) { region = (cartridge.region() == Cartridge::Region::NTSC ? Region::NTSC : Region::PAL); } cpu_frequency = region() == Region::NTSC ? 21477272 : 21281370; apu_frequency = 24607104; audio.coprocessor_enable(false); bus.map_reset(); bus.map_xml(); cpu.enable(); ppu.enable(); if(expansion() == ExpansionPortDevice::Satellaview) satellaviewbaseunit.load(); if(cartridge.has_gb_slot()) icd2.load(); if(cartridge.has_bs_cart()) bsxcartridge.load(); if(cartridge.has_nss_dip()) nss.load(); if(cartridge.has_event()) event.load(); if(cartridge.has_sa1()) sa1.load(); if(cartridge.has_superfx()) superfx.load(); if(cartridge.has_armdsp()) armdsp.load(); if(cartridge.has_hitachidsp()) hitachidsp.load(); if(cartridge.has_necdsp()) necdsp.load(); if(cartridge.has_epsonrtc()) epsonrtc.load(); if(cartridge.has_sharprtc()) sharprtc.load(); if(cartridge.has_spc7110()) spc7110.load(); if(cartridge.has_sdd1()) sdd1.load(); if(cartridge.has_obc1()) obc1.load(); if(cartridge.has_hsu1()) hsu1.load(); if(cartridge.has_msu1()) msu1.load(); if(cartridge.has_bs_slot()) satellaviewcartridge.load(); if(cartridge.has_st_slots()) sufamiturboA.load(), sufamiturboB.load(); if(cartridge.has_dsp1()) dsp1.load(); if(cartridge.has_dsp2()) dsp2.load(); if(cartridge.has_dsp3()) dsp3.load(); if(cartridge.has_dsp4()) dsp4.load(); if(cartridge.has_cx4()) cx4.load(); if(cartridge.has_st0010()) st0010.load(); if(cartridge.has_sgbexternal()) sgbExternal.load(); serialize_init(); } void System::unload() { if(expansion() == ExpansionPortDevice::Satellaview) satellaviewbaseunit.unload(); if(cartridge.has_gb_slot()) icd2.unload(); if(cartridge.has_bs_cart()) bsxcartridge.unload(); if(cartridge.has_nss_dip()) nss.unload(); if(cartridge.has_event()) event.unload(); if(cartridge.has_sa1()) sa1.unload(); if(cartridge.has_superfx()) superfx.unload(); if(cartridge.has_armdsp()) armdsp.unload(); if(cartridge.has_hitachidsp()) hitachidsp.unload(); if(cartridge.has_necdsp()) necdsp.unload(); if(cartridge.has_epsonrtc()) epsonrtc.unload(); if(cartridge.has_sharprtc()) sharprtc.unload(); if(cartridge.has_spc7110()) spc7110.unload(); if(cartridge.has_sdd1()) sdd1.unload(); if(cartridge.has_obc1()) obc1.unload(); if(cartridge.has_hsu1()) hsu1.unload(); if(cartridge.has_msu1()) msu1.unload(); if(cartridge.has_bs_slot()) satellaviewcartridge.unload(); if(cartridge.has_st_slots()) sufamiturboA.unload(), sufamiturboB.unload(); if(cartridge.has_dsp1()) dsp1.unload(); if(cartridge.has_dsp2()) dsp2.unload(); if(cartridge.has_dsp3()) dsp3.unload(); if(cartridge.has_dsp4()) dsp4.unload(); if(cartridge.has_cx4()) cx4.unload(); if(cartridge.has_st0010()) st0010.unload(); if(cartridge.has_sgbexternal()) sgbExternal.unload(); } void System::power() { random.seed((unsigned)time(0)); cpu.power(); smp.power(); dsp.power(); ppu.power(); if(expansion() == ExpansionPortDevice::Satellaview) satellaviewbaseunit.power(); if(cartridge.has_gb_slot()) icd2.power(); if(cartridge.has_bs_cart()) bsxcartridge.power(); if(cartridge.has_nss_dip()) nss.power(); if(cartridge.has_event()) event.power(); if(cartridge.has_sa1()) sa1.power(); if(cartridge.has_superfx()) superfx.power(); if(cartridge.has_armdsp()) armdsp.power(); if(cartridge.has_hitachidsp()) hitachidsp.power(); if(cartridge.has_necdsp()) necdsp.power(); if(cartridge.has_epsonrtc()) epsonrtc.power(); if(cartridge.has_sharprtc()) sharprtc.power(); if(cartridge.has_spc7110()) spc7110.power(); if(cartridge.has_sdd1()) sdd1.power(); if(cartridge.has_obc1()) obc1.power(); if(cartridge.has_hsu1()) hsu1.power(); if(cartridge.has_msu1()) msu1.power(); if(cartridge.has_bs_slot()) satellaviewcartridge.power(); if(cartridge.has_dsp1()) dsp1.power(); if(cartridge.has_dsp2()) dsp2.power(); if(cartridge.has_dsp3()) dsp3.power(); if(cartridge.has_dsp4()) dsp4.power(); if(cartridge.has_cx4()) cx4.power(); if(cartridge.has_st0010()) st0010.power(); if(cartridge.has_sgbexternal()) sgbExternal.power(); reset(); } void System::reset() { cpu.reset(); smp.reset(); dsp.reset(); ppu.reset(); if(expansion() == ExpansionPortDevice::Satellaview) satellaviewbaseunit.reset(); if(cartridge.has_gb_slot()) icd2.reset(); if(cartridge.has_bs_cart()) bsxcartridge.reset(); if(cartridge.has_nss_dip()) nss.reset(); if(cartridge.has_event()) event.reset(); if(cartridge.has_sa1()) sa1.reset(); if(cartridge.has_superfx()) superfx.reset(); if(cartridge.has_armdsp()) armdsp.reset(); if(cartridge.has_hitachidsp()) hitachidsp.reset(); if(cartridge.has_necdsp()) necdsp.reset(); if(cartridge.has_epsonrtc()) epsonrtc.reset(); if(cartridge.has_sharprtc()) sharprtc.reset(); if(cartridge.has_spc7110()) spc7110.reset(); if(cartridge.has_sdd1()) sdd1.reset(); if(cartridge.has_obc1()) obc1.reset(); if(cartridge.has_hsu1()) hsu1.reset(); if(cartridge.has_msu1()) msu1.reset(); if(cartridge.has_bs_slot()) satellaviewcartridge.reset(); if(cartridge.has_gb_slot()) cpu.coprocessors.append(&icd2); if(cartridge.has_event()) cpu.coprocessors.append(&event); if(cartridge.has_sa1()) cpu.coprocessors.append(&sa1); if(cartridge.has_superfx()) cpu.coprocessors.append(&superfx); if(cartridge.has_armdsp()) cpu.coprocessors.append(&armdsp); if(cartridge.has_hitachidsp()) cpu.coprocessors.append(&hitachidsp); if(cartridge.has_necdsp()) cpu.coprocessors.append(&necdsp); if(cartridge.has_epsonrtc()) cpu.coprocessors.append(&epsonrtc); if(cartridge.has_sharprtc()) cpu.coprocessors.append(&sharprtc); if(cartridge.has_spc7110()) cpu.coprocessors.append(&spc7110); if(cartridge.has_msu1()) cpu.coprocessors.append(&msu1); if(cartridge.has_dsp1()) dsp1.reset(); if(cartridge.has_dsp2()) dsp2.reset(); if(cartridge.has_dsp3()) dsp3.reset(); if(cartridge.has_dsp4()) dsp4.reset(); if(cartridge.has_cx4()) cx4.reset(); if(cartridge.has_st0010()) st0010.reset(); if(cartridge.has_sgbexternal()) sgbExternal.reset(); if(cartridge.has_sgbexternal()) cpu.coprocessors.append(&sgbExternal); scheduler.init(); input.connect(0, configuration.controller_port1); input.connect(1, configuration.controller_port2); } void System::scanline() { video.scanline(); if(cpu.vcounter() == 241) scheduler.exit(Scheduler::ExitReason::FrameEvent); } void System::frame() { } System::System() { region = Region::Autodetect; expansion = ExpansionPortDevice::Satellaview; } } nall/atoi.hpp000664 001750 001750 00000004476 12651764221 014316 0ustar00sergiosergio000000 000000 #ifndef NALL_ATOI_HPP #define NALL_ATOI_HPP #include namespace nall { constexpr inline uintmax_t binary_(const char* s, uintmax_t sum = 0) { return ( *s == '0' || *s == '1' ? binary_(s + 1, (sum << 1) | *s - '0') : *s == '\'' ? binary_(s + 1, sum) : sum ); } constexpr inline uintmax_t octal_(const char* s, uintmax_t sum = 0) { return ( *s >= '0' && *s <= '7' ? octal_(s + 1, (sum << 3) | *s - '0') : *s == '\'' ? octal_(s + 1, sum) : sum ); } constexpr inline uintmax_t decimal_(const char* s, uintmax_t sum = 0) { return ( *s >= '0' && *s <= '9' ? decimal_(s + 1, (sum * 10) + *s - '0') : *s == '\'' ? decimal_(s + 1, sum) : sum ); } constexpr inline uintmax_t hex_(const char* s, uintmax_t sum = 0) { return ( *s >= 'A' && *s <= 'F' ? hex_(s + 1, (sum << 4) | *s - 'A' + 10) : *s >= 'a' && *s <= 'f' ? hex_(s + 1, (sum << 4) | *s - 'a' + 10) : *s >= '0' && *s <= '9' ? hex_(s + 1, (sum << 4) | *s - '0') : *s == '\'' ? hex_(s + 1, sum) : sum ); } // constexpr inline uintmax_t binary(const char* s) { return ( *s == '0' && *(s + 1) == 'B' ? binary_(s + 2) : *s == '0' && *(s + 1) == 'b' ? binary_(s + 2) : *s == '%' ? binary_(s + 1) : binary_(s) ); } constexpr inline uintmax_t octal(const char* s) { return ( *s == '0' && *(s + 1) == 'O' ? octal_(s + 2) : *s == '0' && *(s + 1) == 'o' ? octal_(s + 2) : octal_(s) ); } constexpr inline intmax_t integer(const char* s) { return ( *s == '+' ? +decimal_(s + 1) : *s == '-' ? -decimal_(s + 1) : decimal_(s) ); } constexpr inline uintmax_t decimal(const char* s) { return ( decimal_(s) ); } constexpr inline uintmax_t hex(const char* s) { return ( *s == '0' && *(s + 1) == 'X' ? hex_(s + 2) : *s == '0' && *(s + 1) == 'x' ? hex_(s + 2) : *s == '$' ? hex_(s + 1) : hex_(s) ); } constexpr inline intmax_t numeral(const char* s) { return ( *s == '0' && *(s + 1) == 'X' ? hex_(s + 2) : *s == '0' && *(s + 1) == 'x' ? hex_(s + 2) : *s == '0' && *(s + 1) == 'B' ? binary_(s + 2) : *s == '0' && *(s + 1) == 'b' ? binary_(s + 2) : *s == '0' ? octal_(s + 1) : *s == '+' ? +decimal_(s + 1) : *s == '-' ? -decimal_(s + 1) : decimal_(s) ); } inline double real(const char* s) { return atof(s); } } #endif sfc/smp/smp.hpp000664 001750 001750 00000003344 12651764221 014576 0ustar00sergiosergio000000 000000 struct SMP : Processor::SPC700, Thread { uint8 iplrom[64]; uint8 apuram[64 * 1024]; enum : bool { Threaded = true }; alwaysinline void step(unsigned clocks); alwaysinline void synchronize_cpu(); alwaysinline void synchronize_dsp(); uint8 port_read(uint2 port) const; void port_write(uint2 port, uint8 data); void enter(); void power(); void reset(); void serialize(serializer&); SMP(); ~SMP(); privileged: struct { //timing unsigned clock_counter; unsigned dsp_counter; unsigned timer_step; //$00f0 uint8 clock_speed; uint8 timer_speed; bool timers_enable; bool ram_disable; bool ram_writable; bool timers_disable; //$00f1 bool iplrom_enable; //$00f2 uint8 dsp_addr; //$00f8,$00f9 uint8 ram00f8; uint8 ram00f9; } status; static void Enter(); friend class SMPcore; struct Debugger { hook op_exec; hook op_read; hook op_write; } debugger; //memory.cpp uint8 ram_read(uint16 addr); void ram_write(uint16 addr, uint8 data); uint8 op_busread(uint16 addr); void op_buswrite(uint16 addr, uint8 data); void op_io(); uint8 op_read(uint16 addr); void op_write(uint16 addr, uint8 data); uint8 disassembler_read(uint16 addr); //timing.cpp template struct Timer { uint8 stage0_ticks; uint8 stage1_ticks; uint8 stage2_ticks; uint4 stage3_ticks; bool current_line; bool enable; uint8 target; void tick(); void synchronize_stage1(); }; Timer<192> timer0; Timer<192> timer1; Timer< 24> timer2; alwaysinline void add_clocks(unsigned clocks); alwaysinline void cycle_edge(); }; extern SMP smp; fc/cartridge/board/konami-vrc1.cpp000664 001750 001750 00000001442 12651764221 020167 0ustar00sergiosergio000000 000000 struct KonamiVRC1 : Board { VRC1 vrc1; uint8 prg_read(unsigned addr) { if(addr & 0x8000) return prgrom.read(vrc1.prg_addr(addr)); return cpu.mdr(); } void prg_write(unsigned addr, uint8 data) { if(addr & 0x8000) return vrc1.reg_write(addr, data); } uint8 chr_read(unsigned addr) { if(addr & 0x2000) return ppu.ciram_read(vrc1.ciram_addr(addr)); return Board::chr_read(vrc1.chr_addr(addr)); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) return ppu.ciram_write(vrc1.ciram_addr(addr), data); return Board::chr_write(vrc1.chr_addr(addr), data); } void power() { vrc1.power(); } void reset() { vrc1.reset(); } void serialize(serializer& s) { Board::serialize(s); vrc1.serialize(s); } KonamiVRC1(Markup::Node& document) : Board(document), vrc1(*this) { } }; target-ethos/tools/state-manager.hpp000664 001750 001750 00000001362 12651764221 020721 0ustar00sergiosergio000000 000000 struct StateManager : ToolsLayout { ListView stateList; HorizontalLayout descLayout; Label descLabel; LineEdit descEdit; HorizontalLayout controlLayout; Button saveButton; Button loadButton; Widget spacer; Button resetButton; Button eraseButton; void reset(); bool load(string filename, unsigned revision); bool save(string filename, unsigned revision); void slotLoad(); void slotSave(); void slotErase(); string slotLoadDescription(unsigned id); void slotSaveDescription(); void refresh(); void synchronize(); StateManager(); private: enum : unsigned { Slots = 32, HeaderLength = 72, DescriptionLength = 512, }; serializer slot[Slots]; }; extern StateManager* stateManager; sfc/chip/dsp1/dsp1.cpp000664 001750 001750 00000002716 12651764221 015636 0ustar00sergiosergio000000 000000 #include #define DSP1_CPP namespace SuperFamicom { DSP1 dsp1; #include "serialization.cpp" #include "dsp1emu.cpp" static void out(const char * what) { static unsigned int i=0; if (i>20) return; i++; puts(what); } void DSP1::init() { } void DSP1::load() { } void DSP1::unload() { } void DSP1::power() { } void DSP1::reset() { dsp1.reset(); } uint8 DSP1::read(unsigned addr) { if (addr & Select) return dsp1.getSr(); else return dsp1.getDr(); } void DSP1::write(unsigned addr, uint8 data) { if (addr & Select) {} else dsp1.setDr(data); } } #if 0 #include #define DSP1_CPP namespace SNES { DSP1 dsp1; DSP1DR dsp1dr; DSP1SR dsp1sr; #include "serialization.cpp" #include "dsp1emu.cpp" void DSP1::init() { } void DSP1::enable() { } void DSP1::power() { reset(); } void DSP1::reset() { dsp1.reset(); } uint8 DSP1DR::read(unsigned addr) { return dsp1.dsp1.getDr(); } void DSP1DR::write(unsigned addr, uint8 data) { dsp1.dsp1.setDr(data); } uint8 DSP1SR::read(unsigned addr) { return dsp1.dsp1.getSr(); } void DSP1SR::write(unsigned addr, uint8 data) {} } uint8 NECDSP::read(unsigned addr) { cpu.synchronize_coprocessors(); if(addr & Select) { return uPD96050::sr_read(); } else { return uPD96050::dr_read(); } } void NECDSP::write(unsigned addr, uint8 data) { cpu.synchronize_coprocessors(); if(addr & Select) { return uPD96050::sr_write(data); } else { return uPD96050::dr_write(data); } } #endiftarget-ethos/general/library.cpp000664 001750 001750 00000021610 12651764221 020103 0ustar00sergiosergio000000 000000 LibraryManager* libraryManager = nullptr; LibraryBrowser::LibraryBrowser(Emulator::Interface& emulator) : emulator(emulator) { setMargin(5); informationType.setText({ "Title:\n", "Serial:" }); for(auto& media : emulator.media) { mediaMode.append(media.name); } unsigned height = Font::size(program->normalFont, " ").height; append(folders, {~0, ~0}, 5); append(informationLayout, {~0, 0}); informationLayout.append(informationType, {0, height * 2}, 5); informationLayout.append(information, {~0, height * 2}, 5); informationLayout.append(mediaMode, {0, 0}); folders.onActivate = {&LibraryBrowser::onActivate, this}; folders.onChange = {&LibraryBrowser::onChange, this}; mediaMode.onChange = {&LibraryBrowser::setMode, this}; } void LibraryBrowser::onActivate() { if(folders.selected() == false) return; if(libraryManager->loadButton.enabled() == false) return; unsigned selection = folders.selection(); string pathname = {this->pathname, folders.text(selection, 0), typeSuffix}; libraryManager->loaded.append(folders.text(selection, 0)); libraryManager->setInformation(false); if(libraryManager->slotLoad == false) { utility->loadMedia(pathname); } else { libraryManager->loadPathname = pathname; libraryManager->setModal(false); } } void LibraryBrowser::onChange() { if(folders.selected() == false) return information.setText(""); string manifest = {pathname, folders.text(folders.selection(), 0), typeSuffix, "manifest.bml"}; auto document = Markup::Document(file::read(manifest)); information.setText({ document["information/title"].text(), "\n", document["information/serial"].text() }); } void LibraryBrowser::refresh() { folders.reset(); lstring pathnames = directory::ifolders(pathname, typeMask); unsigned selection = 0; for(auto& pathname : pathnames) { folders.append(string{pathname}.rtrim<1>(typeSuffix)); folders.setImage(selection++, 0, {resource::game, sizeof resource::game}); } folders.setSelection(0); onChange(); } void LibraryBrowser::setMode() { config->library.mediaMode = mediaMode.selection(); auto& media = emulator.media[mediaMode.selection()]; pathname = {utility->libraryPath(), media.name, "/"}; type = media.type; typeMask = {"*.", type}; typeSuffix = {".", type, "/"}; refresh(); folders.setFocused(); libraryManager->synchronize(); } LibraryImport::LibraryImport() { setMargin(5); information.setText({ "higan manages games in a library. To play a game, you must first import the game.\n" "After doing so, the game will appear inside your library, and can then be loaded and played." }); importButton.setText("Import Game ..."); append(information, {~0, 0}, 5); append(importButton, {0, 0}); importButton.onActivate = {&LibraryImport::onImportActivate, this}; } void LibraryImport::onImportActivate() { if(program->ananke.open() == false) { MessageWindow().setText("ananke must be installed to use this feature").warning(); return; } function browse = program->ananke.sym("ananke_browse"); if(!browse) return; audio.clear(); //ananke's browser is modal string pathname = browse(); pathname.rtrim<1>("/"); if(pathname.empty()) return; //after importing game, take user to the relevant game list to show the newly imported title string type = extension(pathname); for(signed bootable = 1; bootable >= 0; bootable--) { unsigned selection = 0; for(auto& browser : libraryManager->browsers) { unsigned mode = 0; for(auto& media : browser->emulator.media) { if(type == media.type && media.bootable == bootable) { browser->mediaMode.setSelection(mode); libraryManager->libraryFrame.setSelection(selection); libraryManager->onChange(); //find game in list and select it string name = notdir(nall::basename(pathname)); for(unsigned n = 0; n < browser->folders.rows(); n++) { if(browser->folders.text(n, 0) == name) { browser->folders.setSelection(n); browser->onChange(); break; } } return; } mode++; } selection++; } } } LibraryManager::LibraryManager() { libraryManager = this; setTitle("Game Library"); setGeometry({128, 128, 640, 680}); windowManager->append(this, "LibraryManager"); layout.setMargin(5); bootstrap(); libraryFrame.append("Import"); libraryFrame.setLayout(browsers.size(), libraryImport); loadButton.setText("Load"); unsigned height = Font::size(program->normalFont, " ").height; append(layout); layout.append(libraryFrame, {~0, ~0}, 5); layout.append(informationLayout, {~0, 0}); informationLayout.append(information, {~0, height * 3}, 5); informationLayout.append(skipButton, {80, 0}, 5); informationLayout.append(loadButton, {80, 0}); onClose = skipButton.onActivate = [&] { setModal(false); setVisible(false); }; libraryFrame.onChange = {&LibraryManager::onChange, this}; loadButton.onActivate = {&LibraryManager::onLoad, this}; //initial config value of -1 defaults to import tab on first launch of higan if(config->library.selection < 0) config->library.selection = browsers.size(); libraryFrame.setSelection(config->library.selection); if(libraryFrame.selection() < browsers.size()) { browsers[libraryFrame.selection()]->mediaMode.setSelection(config->library.mediaMode); browsers[libraryFrame.selection()]->setMode(); } } void LibraryManager::bootstrap() { unsigned selection = 0; for(auto& emulator : program->emulator) { LibraryBrowser* browser = new LibraryBrowser(*emulator); libraryFrame.append(emulator->information.name); libraryFrame.setLayout(selection++, *browser); browsers.append(browser); } } string LibraryManager::load(const string& type) { requestedLoadType = type; unsigned selection = 0; for(auto& browser : browsers) { unsigned mode = 0; for(auto& media : browser->emulator.media) { if(type == media.type && media.bootable == false) { libraryFrame.setSelection(selection); browser->mediaMode.setSelection(mode); browser->setMode(); slotLoad = true; loadPathname = ""; show(); setModal(); slotLoad = false; browser->mediaMode.setSelection(config->library.mediaMode = 0); return loadPathname; } mode++; } selection++; } return ""; //should never occur } void LibraryManager::onChange() { unsigned selection = libraryFrame.selection(); config->library.selection = selection; if(selection < browsers.size()) { browsers[selection]->setMode(); } else { loadButton.setEnabled(false); } } void LibraryManager::onLoad() { unsigned selection = libraryFrame.selection(); if(selection < browsers.size()) browsers[selection]->onActivate(); } void LibraryManager::setInformation(bool load) { string text; if(loaded.size() == 0) { text = {" \nPlease select a game to load ...\n "}; } else if(loaded.size() == 1 && load == false) { text = {" \n", loaded[0], "\n "}; } else if(loaded.size() == 1 && load == true) { text = {loaded[0], " \nPlease select a slot game to load ...\n "}; } else if(loaded.size() == 2 && load == false) { text = {loaded[0], "\n", loaded[1], "\n "}; } else if(loaded.size() == 2 && load == true) { text = {loaded[0], "\n", loaded[1], "\nPlease select a slot game to load ..."}; } else if(loaded.size() == 3) { text = {loaded[0], "\n", loaded[1], "\n", loaded[2]}; } information.setText(text); } void LibraryManager::show() { if(slotLoad == false) { loaded.reset(); requestedLoadType.reset(); skipButton.setText("Cancel"); } else { skipButton.setText("Skip"); } setInformation(true); setVisible(); setFocused(); onChange(); } //set library to show a specific media type, and then show the library void LibraryManager::show(const string& type) { unsigned selection = 0; for(auto& browser : browsers) { unsigned mode = 0; for(auto& media : browser->emulator.media) { if(media.bootable && media.type == type) { libraryFrame.setSelection(selection); browser->mediaMode.setSelection(mode); browser->setMode(); return show(); } mode++; } selection++; } } void LibraryManager::synchronize() { if(libraryFrame.selection() < browsers.size()) { auto& emulator = browsers[libraryFrame.selection()]->emulator; auto& media = emulator.media[browsers[libraryFrame.selection()]->mediaMode.selection()]; if(requestedLoadType.empty()) { loadButton.setEnabled(media.bootable); } else { bool enabled = (requestedLoadType == media.type); //allow Super Game Boy to load Game Boy Color games if(requestedLoadType == "gb" && loaded.size() == 1 && media.type == "gbc") enabled = true; loadButton.setEnabled(enabled); } } else { loadButton.setEnabled(false); } } sfc/controller/superscope/superscope.hpp000664 001750 001750 00000000475 12651764221 021745 0ustar00sergiosergio000000 000000 struct SuperScope : Controller { void enter(); uint2 data(); void latch(bool data); SuperScope(bool port); //private: bool latched; unsigned counter; signed x, y; bool trigger; bool cursor; bool turbo; bool pause; bool offscreen; bool turbolock; bool triggerlock; bool pauselock; }; phoenix/reference/object.hpp000664 001750 001750 00000000320 12651764221 017272 0ustar00sergiosergio000000 000000 namespace phoenix { struct pObject { Object& object; bool locked; pObject(Object& object) : object(object), locked(locked) {} virtual ~pObject() {} void constructor(); void destructor(); }; } Makefile000664 001750 001750 00000006440 12651764221 013354 0ustar00sergiosergio000000 000000 include nall/Makefile ifeq ($(platform),win) override platform = windows else ifeq ($(platform),mingw) override platform = windows else ifeq ($(platform),osx) override platform = macosx else ifeq ($(platform),unix) override platform = linux else ifeq ($(platform),x) override platform = linux endif fc := fc sfc := sfc gb := gb gba := gba profile := accuracy target := libretro # options += debugger # arch := x86 # console := true # compiler ifneq ($(debug),) flags := -I. -O0 -g else flags := -I. -O3 -fomit-frame-pointer endif cflags := -std=gnu99 -xc cppflags := -std=gnu++0x objects := libco # profile-guided optimization mode # pgo := instrument # pgo := optimize ifeq ($(pgo),instrument) flags += -fprofile-generate link += -lgcov else ifeq ($(pgo),optimize) flags += -fprofile-use endif ifeq ($(compiler),) ifneq ($(CXX),) compiler := $(CXX) else compiler := g++ endif endif # platform ui := target-$(target) ifeq ($(findstring libretro,$(ui)),) ifeq ($(platform),windows) ifeq ($(arch),x86) flags += -m32 link += -m32 endif ifeq ($(console),true) link += -mconsole else link += -mwindows endif link += -mthreads -luuid -lkernel32 -luser32 -lgdi32 -lcomctl32 -lcomdlg32 -lshell32 -lole32 -lws2_32 link += -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc else ifeq ($(platform),macosx) flags += -march=native else ifeq ($(platform),linux) flags += -march=native link += -Wl,-export-dynamic -lX11 -lXext -ldl else ifeq ($(platform),bsd) flags += -march=native link += -Wl,-export-dynamic -lX11 -lXext else $(error unsupported platform.) endif endif ifeq ($(platform),macosx) ifndef ($(NOUNIVERSAL)) flags += $(ARCHFLAGS) link += $(ARCHFLAGS) endif endif # implicit rules compile-profile = \ $(strip \ $(if $(filter %.c,$<), \ $(compiler) $(cflags) $(flags) $(profflags) $1 -c $< -o $@, \ $(if $(filter %.cpp,$<), \ $(compiler) $(cppflags) $(flags) $(profflags) $1 -c $< -o $@ \ ) \ ) \ ) %-$(profile).o: $<; $(call compile-profile) compile = \ $(strip \ $(if $(filter %.c,$<), \ $(compiler) $(cflags) $(flags) $1 -c $< -o $@, \ $(if $(filter %.cpp,$<), \ $(compiler) $(cppflags) $(flags) $1 -c $< -o $@ \ ) \ ) \ ) %.o: $<; $(call compile) all: build; obj/libco.o: libco/libco.c libco/* include $(ui)/Makefile flags := $(flags) $(foreach o,$(call strupper,$(options)),-D$o) # targets clean: -@$(call delete,obj/*.o) -@$(call delete,obj/*.a) -@$(call delete,obj/*.so) -@$(call delete,obj/*.dylib) -@$(call delete,obj/*.dll) -@$(call delete,*.res) -@$(call delete,*.manifest) archive: if [ -f higan.tar.xz ]; then rm higan.tar.xz; fi tar -cJf higan.tar.xz `ls` sync: ifeq ($(shell id -un),byuu) if [ -d ./libco ]; then rm -r ./libco; fi if [ -d ./nall ]; then rm -r ./nall; fi if [ -d ./ruby ]; then rm -r ./ruby; fi if [ -d ./phoenix ]; then rm -r ./phoenix; fi cp -r ../libco ./libco cp -r ../nall ./nall cp -r ../ruby ./ruby cp -r ../phoenix ./phoenix rm -r libco/doc rm -r libco/.test rm -r nall/.test rm -r ruby/.test rm -r phoenix/.test endif help:; #this must be last because other things may have altered $(flags) ifneq ($(lto),) flags += -flto link += $(flags) endif phoenix/gtk/action/check-item.cpp000664 001750 001750 00000001601 12651764221 020137 0ustar00sergiosergio000000 000000 namespace phoenix { static void CheckItem_toggle(GtkCheckMenuItem* gtkCheckMenuItem, CheckItem* self) { self->state.checked = gtk_check_menu_item_get_active(gtkCheckMenuItem); if(!self->p.locked && self->onToggle) self->onToggle(); } void pCheckItem::setChecked(bool checked) { locked = true; gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), checked); locked = false; } void pCheckItem::setText(string text) { gtk_menu_item_set_label(GTK_MENU_ITEM(widget), mnemonic(text)); } void pCheckItem::constructor() { widget = gtk_check_menu_item_new_with_mnemonic(""); setChecked(checkItem.state.checked); setText(checkItem.state.text); g_signal_connect(G_OBJECT(widget), "toggled", G_CALLBACK(CheckItem_toggle), (gpointer)&checkItem); } void pCheckItem::destructor() { gtk_widget_destroy(widget); } void pCheckItem::orphan() { destructor(); constructor(); } } phoenix/gtk/platform.cpp000664 001750 001750 00000002315 12651764221 016500 0ustar00sergiosergio000000 000000 #include "platform.hpp" #include "utility.cpp" #include "settings.cpp" #include "desktop.cpp" #include "monitor.cpp" #include "keyboard.cpp" #include "mouse.cpp" #include "browser-window.cpp" #include "message-window.cpp" #include "font.cpp" #include "timer.cpp" #include "window.cpp" #include "action/action.cpp" #include "action/menu.cpp" #include "action/separator.cpp" #include "action/item.cpp" #include "action/check-item.cpp" #include "action/radio-item.cpp" #include "widget/widget.cpp" #include "widget/button.cpp" #include "widget/canvas.cpp" #include "widget/check-button.cpp" #include "widget/check-label.cpp" #include "widget/combo-button.cpp" #include "widget/console.cpp" #include "widget/frame.cpp" #include "widget/hex-edit.cpp" #include "widget/horizontal-scroller.cpp" #include "widget/horizontal-slider.cpp" #include "widget/label.cpp" #include "widget/line-edit.cpp" #include "widget/list-view.cpp" #include "widget/progress-bar.cpp" #include "widget/radio-button.cpp" #include "widget/radio-label.cpp" #include "widget/tab-frame.cpp" #include "widget/text-edit.cpp" #include "widget/vertical-scroller.cpp" #include "widget/vertical-slider.cpp" #include "widget/viewport.cpp" #include "application.cpp" sfc/slot/satellaview/satellaview.cpp000664 001750 001750 00000005171 12651764221 021014 0ustar00sergiosergio000000 000000 #include #define SATELLAVIEW_CARTRIDGE_CPP namespace SuperFamicom { SatellaviewCartridge satellaviewcartridge; void SatellaviewCartridge::init() { } void SatellaviewCartridge::load() { if(memory.size() == 0) { memory.map(allocate(1024 * 1024, 0xff), 1024 * 1024); } } void SatellaviewCartridge::unload() { memory.reset(); } void SatellaviewCartridge::power() { } void SatellaviewCartridge::reset() { regs.command = 0; regs.write_old = 0x00; regs.write_new = 0x00; regs.flash_enable = false; regs.read_enable = false; regs.write_enable = false; memory.write_protect(!regs.write_enable); } unsigned SatellaviewCartridge::size() const { return memory.size(); } uint8 SatellaviewCartridge::read(unsigned addr) { if(readonly) return memory.read(bus.mirror(addr, memory.size())); if(addr == 0x0002) { if(regs.flash_enable) return 0x80; } if(addr == 0x5555) { if(regs.flash_enable) return 0x80; } if(regs.read_enable && addr >= 0xff00 && addr <= 0xff13) { //read flash cartridge vendor information switch(addr - 0xff00) { case 0x00: return 0x4d; case 0x01: return 0x00; case 0x02: return 0x50; case 0x03: return 0x00; case 0x04: return 0x00; case 0x05: return 0x00; case 0x06: return 0x2a; //0x2a = 8mbit, 0x2b = 16mbit (not known to exist, though BIOS recognizes ID) case 0x07: return 0x00; default: return 0x00; } } return memory.read(addr); } void SatellaviewCartridge::write(unsigned addr, uint8 data) { if(readonly) return; if((addr & 0xff0000) == 0) { regs.write_old = regs.write_new; regs.write_new = data; if(regs.write_enable && regs.write_old == regs.write_new) { return memory.write(addr, data); } } else { if(regs.write_enable) { return memory.write(addr, data); } } if(addr == 0x0000) { regs.command <<= 8; regs.command |= data; if((regs.command & 0xffff) == 0x38d0) { regs.flash_enable = true; regs.read_enable = true; } } if(addr == 0x2aaa) { regs.command <<= 8; regs.command |= data; } if(addr == 0x5555) { regs.command <<= 8; regs.command |= data; if((regs.command & 0xffffff) == 0xaa5570) { regs.write_enable = false; } if((regs.command & 0xffffff) == 0xaa55a0) { regs.write_old = 0x00; regs.write_new = 0x00; regs.flash_enable = true; regs.write_enable = true; } if((regs.command & 0xffffff) == 0xaa55f0) { regs.flash_enable = false; regs.read_enable = false; regs.write_enable = false; } memory.write_protect(!regs.write_enable); } } } ruby/000700 001750 001750 00000000000 12656700342 012654 5ustar00sergiosergio000000 000000 sfc/chip/event/event.hpp000664 001750 001750 00000001432 12651764221 016361 0ustar00sergiosergio000000 000000 //SNES-EVENT board emulation: //* Campus Challenge '92 //* Powerfest '94 struct Event : Coprocessor { MappedRAM rom[4]; MappedRAM ram; static void Enter(); void enter(); void init(); void load(); void unload(); void power(); void reset(); void submitScore(); uint8 sr(unsigned); void dr(unsigned, uint8 data); uint8 rom_read(unsigned addr); uint8 ram_read(unsigned addr); void ram_write(unsigned addr, uint8 data); void serialize(serializer&); //private: enum class Board : unsigned { CampusChallenge92, Powerfest94 } board; unsigned revision; unsigned timer; uint8 status; uint8 select; bool timerActive; bool scoreActive; unsigned timerSecondsRemaining; unsigned scoreSecondsRemaining; bool usedSaveState; }; extern Event event; nall/string/char/match.hpp000664 001750 001750 00000002244 12651764221 016670 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { bool strmatch(const char* s, const char* p) { const char* cp = nullptr; const char* mp = nullptr; while(*s && *p != '*') { if(*p != '?' && *s != *p) return false; p++, s++; } while(*s) { if(*p == '*') { if(!*++p) return true; mp = p, cp = s + 1; } else if(*p == '?' || *p == *s) { p++, s++; } else { p = mp, s = cp++; } } while(*p == '*') p++; return !*p; } bool istrmatch(const char* s, const char* p) { const char* cp = nullptr; const char* mp = nullptr; while(*s && *p != '*') { if(*p != '?' && chrlower(*s) != chrlower(*p)) return false; p++, s++; } while(*s) { if(*p == '*') { if(!*++p) return true; mp = p, cp = s + 1; } else if(*p == '?' || chrlower(*p) == chrlower(*s)) { p++, s++; } else { p = mp, s = cp++; } } while(*p == '*') p++; return !*p; } bool tokenize(const char* s, const char* p) { while(*s) { if(*p == '*') { while(*s) if(tokenize(s++, p + 1)) return true; return !*++p; } if(*s++ != *p++) return false; } while(*p == '*') p++; return !*p; } } #endif target-ethos/general/presentation.cpp000664 001750 001750 00000023124 12651764221 021154 0ustar00sergiosergio000000 000000 Presentation* presentation = nullptr; void Presentation::synchronize() { for(auto& emulator : emulatorList) emulator->menu.setVisible(false); for(auto& emulator : emulatorList) { if(emulator->interface == program->active) { active = emulator; emulator->menu.setVisible(true); } } shaderNone.setChecked(); if(config->video.shader == "None") shaderNone.setChecked(); if(config->video.shader == "Blur") shaderBlur.setChecked(); if(config->video.shader == "Display Emulation") shaderEmulation.setChecked(); for(auto& shader : shaderList) { string name = notdir(config->video.shader.split<1>(".shader/")(0)); if(name == shader->text()) shader->setChecked(); } switch(config->video.scaleMode) { case 0: centerVideo.setChecked(); break; case 1: scaleVideo.setChecked(); break; case 2: stretchVideo.setChecked(); break; } aspectCorrection.setChecked(config->video.aspectCorrection); maskOverscan.setChecked(config->video.maskOverscan.enable); synchronizeVideo.setChecked(config->video.synchronize); synchronizeAudio.setChecked(config->audio.synchronize); muteAudio.setChecked(config->audio.mute); if(program->active == nullptr) { toolsMenu.setVisible(false); } else { toolsMenu.setVisible(true); saveStateMenu.setVisible(system().information.capability.states); loadStateMenu.setVisible(system().information.capability.states); stateMenuSeparator.setVisible(system().information.capability.states); resizeWindow.setVisible(config->video.scaleMode != 2); stateManager.setVisible(system().information.capability.states); cheatEditor.setVisible(system().information.capability.cheats); synchronizeTime.setVisible(system().rtc()); } } void Presentation::setSystemName(string name) { if(active) active->menu.setText(systemName = name); } Presentation::Presentation() { bootstrap(); loadShaders(); setGeometry({256, 256, 720, 480}); windowManager->append(this, "Presentation"); setTitle({::Emulator::Name, " v", ::Emulator::Version}); setBackgroundColor({0, 0, 0}); setMenuVisible(); setStatusVisible(); setDroppable(); viewport.setDroppable(); loadMenu.setText("Library"); settingsMenu.setText("Settings"); videoMenu.setText("Video"); centerVideo.setText("Center"); scaleVideo.setText("Scale"); stretchVideo.setText("Stretch"); RadioItem::group(centerVideo, scaleVideo, stretchVideo); aspectCorrection.setText("Aspect Correction"); maskOverscan.setText("Mask Overscan"); shaderMenu.setText("Shader"); shaderNone.setText("None"); shaderBlur.setText("Blur"); shaderEmulation.setText("Display Emulation"); synchronizeVideo.setText("Synchronize Video"); synchronizeAudio.setText("Synchronize Audio"); muteAudio.setText("Mute Audio"); configurationSettings.setText("Configuration ..."); toolsMenu.setText("Tools"); saveStateMenu.setText("Save State"); for(unsigned n = 0; n < 5; n++) saveStateItem[n].setText({"Slot ", 1 + n}); loadStateMenu.setText("Load State"); for(unsigned n = 0; n < 5; n++) loadStateItem[n].setText({"Slot ", 1 + n}); resizeWindow.setText("Resize Window"); stateManager.setText("State Manager"); cheatEditor.setText("Cheat Editor"); synchronizeTime.setText("Synchronize Time"); append(loadMenu); for(auto& item : loadBootableMedia) loadMenu.append(*item); for(auto& systemItem : emulatorList) append(systemItem->menu); append(settingsMenu); settingsMenu.append(videoMenu); videoMenu.append(centerVideo); videoMenu.append(scaleVideo); videoMenu.append(stretchVideo); videoMenu.append(*new Separator); videoMenu.append(aspectCorrection); videoMenu.append(maskOverscan); settingsMenu.append(shaderMenu); shaderMenu.append(shaderNone); shaderMenu.append(shaderBlur); if(config->video.driver == "OpenGL") shaderMenu.append(shaderEmulation); if(shaderList.size() > 0) { shaderMenu.append(*new Separator); for(auto& shader : shaderList) shaderMenu.append(*shader); } settingsMenu.append(*new Separator); settingsMenu.append(synchronizeVideo); settingsMenu.append(synchronizeAudio); settingsMenu.append(muteAudio); if(Intrinsics::platform() != Intrinsics::Platform::MacOSX) { settingsMenu.append(*new Separator); settingsMenu.append(configurationSettings); } append(toolsMenu); toolsMenu.append(saveStateMenu); for(unsigned n = 0; n < 5; n++) saveStateMenu.append(saveStateItem[n]); toolsMenu.append(loadStateMenu); for(unsigned n = 0; n < 5; n++) loadStateMenu.append(loadStateItem[n]); toolsMenu.append(stateMenuSeparator); toolsMenu.append(resizeWindow); toolsMenu.append(stateManager); toolsMenu.append(cheatEditor); toolsMenu.append(synchronizeTime); append(layout); layout.append(viewport, {0, 0, 1, 1}); onDrop = viewport.onDrop = [&](lstring paths) { if(paths.size() && directory::exists(paths[0])) { utility->loadMedia(paths[0]); setFocused(); } }; onSize = [&] { utility->resize(); }; onClose = [&] { setVisible(false); if(Intrinsics::platform() == Intrinsics::Platform::MacOSX) { utility->unload(); } else { Application::quit(); } }; shaderNone.onActivate = [&] { config->video.shader = "None"; utility->updateShader(); }; shaderBlur.onActivate = [&] { config->video.shader = "Blur"; utility->updateShader(); }; shaderEmulation.onActivate = [&] { config->video.shader = "Display Emulation"; utility->updateShader(); }; centerVideo.onActivate = [&] { config->video.scaleMode = 0; utility->resize(); }; scaleVideo.onActivate = [&] { config->video.scaleMode = 1; utility->resize(); }; stretchVideo.onActivate = [&] { config->video.scaleMode = 2; utility->resize(); }; aspectCorrection.onToggle = [&] { config->video.aspectCorrection = aspectCorrection.checked(); utility->resize(); }; maskOverscan.onToggle = [&] { config->video.maskOverscan.enable = maskOverscan.checked(); }; synchronizeVideo.onToggle = [&] { config->video.synchronize = synchronizeVideo.checked(); utility->synchronizeRuby(); }; synchronizeAudio.onToggle = [&] { config->audio.synchronize = synchronizeAudio.checked(); utility->synchronizeRuby(); }; muteAudio.onToggle = [&] { config->audio.mute = muteAudio.checked(); utility->synchronizeRuby(); }; configurationSettings.onActivate = [&] { settings->setVisible(); }; for(unsigned n = 0; n < 5; n++) saveStateItem[n].onActivate = [=] { utility->saveState(1 + n); }; for(unsigned n = 0; n < 5; n++) loadStateItem[n].onActivate = [=] { utility->loadState(1 + n); }; resizeWindow.onActivate = [&] { utility->resize(true); }; stateManager.onActivate = [&] { tools->panels.setSelection(1); tools->setVisible(); }; cheatEditor.onActivate = [&] { tools->panels.setSelection(0); tools->setVisible(); }; synchronizeTime.onActivate = [&] { system().rtcsync(); }; synchronize(); } void Presentation::bootstrap() { for(auto& emulator : program->emulator) { for(auto& media : emulator->media) { if(media.bootable == false) continue; Item* item = new Item; item->setText({media.name, " ..."}); item->onActivate = [=] { libraryManager->show(media.type); }; loadBootableMedia.append(item); } } for(auto& emulator : program->emulator) { auto iEmulator = new Emulator; iEmulator->interface = emulator; iEmulator->menu.setText(emulator->information.name); iEmulator->power.setText("Power"); iEmulator->reset.setText("Reset"); iEmulator->unload.setText("Unload"); for(auto& port : emulator->port) { auto iPort = new Emulator::Port; iPort->menu.setText(port.name); iEmulator->port.append(iPort); for(auto& device : port.device) { auto iDevice = new RadioItem; iDevice->setText(device.name); iDevice->onActivate = [=] { utility->connect(port.id, device.id); }; iPort->group.append(*iDevice); iPort->device.append(iDevice); } RadioItem::group(iPort->group); } iEmulator->menu.append(iEmulator->power); if(emulator->information.resettable) iEmulator->menu.append(iEmulator->reset); iEmulator->menu.append(*new Separator); unsigned visiblePorts = 0; for(auto& iPort : iEmulator->port) { iEmulator->menu.append(iPort->menu); if(iPort->device.size() <= 1) iPort->menu.setVisible(false); else visiblePorts++; for(auto& iDevice : iPort->device) { iPort->menu.append(*iDevice); } } iEmulator->menu.append(iEmulator->controllerSeparator); if(visiblePorts == 0) iEmulator->controllerSeparator.setVisible(false); iEmulator->menu.append(iEmulator->unload); iEmulator->power.onActivate = {&Utility::power, utility}; iEmulator->reset.onActivate = {&Utility::reset, utility}; iEmulator->unload.onActivate = {&Utility::unload, utility}; emulatorList.append(iEmulator); } } void Presentation::loadShaders() { //only the OpenGL driver has video shader support if(config->video.driver == "OpenGL") { string pathname = program->path("Video Shaders/"); lstring shaders = directory::folders(pathname, "*.shader"); for(auto& name : shaders) { auto shader = new RadioItem; shader->setText(name.split<1>(".shader/")(0)); shader->onActivate = [=] { config->video.shader = {pathname, name}; utility->updateShader(); }; shaderList.append(shader); } } nall::group group; group.append(shaderNone); group.append(shaderBlur); group.append(shaderEmulation); for(auto& shader : shaderList) group.append(*shader); RadioItem::group(group); } phoenix/qt/monitor.cpp000664 001750 001750 00000000606 12651764221 016203 0ustar00sergiosergio000000 000000 namespace phoenix { unsigned pMonitor::count() { return QApplication::desktop()->screenCount(); } Geometry pMonitor::geometry(unsigned monitor) { QRect rectangle = QApplication::desktop()->screenGeometry(monitor); return {rectangle.x(), rectangle.y(), rectangle.width(), rectangle.height()}; } unsigned pMonitor::primary() { return QApplication::desktop()->primaryScreen(); } } phoenix/reference/keyboard.hpp000664 001750 001750 00000000201 12651764221 017622 0ustar00sergiosergio000000 000000 namespace phoenix { struct pKeyboard { static bool pressed(Keyboard::Scancode scancode); static vector state(); }; } fc/memory/memory.hpp000664 001750 001750 00000000143 12651764221 015627 0ustar00sergiosergio000000 000000 struct Bus { uint8 read(uint16 addr); void write(uint16 addr, uint8 data); }; extern Bus bus; target-ethos/tools/cheat-database.cpp000664 001750 001750 00000004046 12651764221 021014 0ustar00sergiosergio000000 000000 CheatDatabase* cheatDatabase = nullptr; CheatDatabase::CheatDatabase() { setGeometry({256, 256, 600, 360}); windowManager->append(this, "CheatDatabase"); layout.setMargin(5); cheatList.setCheckable(); selectAllButton.setText("Select All"); unselectAllButton.setText("Unselect All"); acceptButton.setText("Add Codes"); append(layout); layout.append(cheatList, {~0, ~0}, 5); layout.append(controlLayout, {~0, 0}); controlLayout.append(selectAllButton, {100, 0}, 5); controlLayout.append(unselectAllButton, {100, 0}, 5); controlLayout.append(spacer, {~0, 0}); controlLayout.append(acceptButton, {80, 0}); selectAllButton.onActivate = [&] { for(unsigned n = 0; n < cheat.size(); n++) cheatList.setChecked(n, true); }; unselectAllButton.onActivate = [&] { for(unsigned n = 0; n < cheat.size(); n++) cheatList.setChecked(n, false); }; acceptButton.onActivate = {&CheatDatabase::addCodes, this}; } void CheatDatabase::findCodes() { const string sha256 = system().sha256(); cheatList.reset(); cheat.reset(); auto document = Markup::Document(string::read(program->path("cheats.bml"))); for(auto& node : document) { if(node.name != "cartridge") continue; if(node["sha256"].text() != sha256) continue; setTitle(node["name"].text()); for(auto& cheat : node) { if(cheat.name != "cheat") continue; cheatList.append(cheat["description"].text()); this->cheat.append({cheat["code"].text(), cheat["description"].text()}); } setVisible(); return; } MessageWindow().setParent(*tools).setText("Sorry, no cheat codes were found.").information(); } void CheatDatabase::addCodes() { for(unsigned n = 0; n < cheat.size(); n++) { if(cheatList.checked(n) == false) continue; if(cheatEditor->import(cheat[n].code, cheat[n].desc) == false) { MessageWindow().setParent(*this).setText("Ran out of empty slots for cheat codes.\nNot all cheat codes were added.").warning(); break; } } setVisible(false); cheatEditor->synchronize(); cheatEditor->refresh(); } gb/cartridge/000700 001750 001750 00000000000 12656700342 014227 5ustar00sergiosergio000000 000000 phoenix/gtk/header.hpp000664 001750 001750 00000000304 12651764221 016105 0ustar00sergiosergio000000 000000 #include #include #include #include #include #include #include #include phoenix/reference/widget/horizontal-scroller.cpp000664 001750 001750 00000000350 12651764221 023321 0ustar00sergiosergio000000 000000 namespace phoenix { void pHorizontalScroller::setLength(unsigned length) { } void pHorizontalScroller::setPosition(unsigned position) { } void pHorizontalScroller::constructor() { } void pHorizontalScroller::destructor() { } } phoenix/cocoa/widget/tab-frame.hpp000664 001750 001750 00000002222 12651764221 020276 0ustar00sergiosergio000000 000000 @interface CocoaTabFrame : NSTabView { @public phoenix::TabFrame* tabFrame; } -(id) initWith:(phoenix::TabFrame&)tabFrame; -(void) tabView:(NSTabView*)tabView didSelectTabViewItem:(NSTabViewItem*)tabViewItem; @end @interface CocoaTabFrameItem : NSTabViewItem { @public phoenix::TabFrame* tabFrame; CocoaTabFrame* cocoaTabFrame; } -(id) initWith:(phoenix::TabFrame&)tabFrame; -(NSSize) sizeOfLabel:(BOOL)shouldTruncateLabel; -(void) drawLabel:(BOOL)shouldTruncateLabel inRect:(NSRect)tabRect; @end namespace phoenix { struct pTabFrame : public pWidget { TabFrame& tabFrame; CocoaTabFrame* cocoaTabFrame = nullptr; vector tabs; void append(string text, const image& image); void remove(unsigned selection); void setEnabled(bool enabled); void setGeometry(Geometry geometry); void setImage(unsigned selection, const image& image); void setSelection(unsigned selection); void setText(unsigned selection, string text); void setVisible(bool visible); pTabFrame(TabFrame& tabFrame) : pWidget(tabFrame), tabFrame(tabFrame) {} void constructor(); void destructor(); void synchronizeLayout(); }; } processor/r65816/opcode_write.cpp000664 001750 001750 00000010406 12651764221 017772 0ustar00sergiosergio000000 000000 template void R65816::op_write_addr_b() { aa.l = op_readpc(); aa.h = op_readpc(); L op_writedbr(aa.w, regs.r[n]); } template void R65816::op_write_addr_w() { aa.l = op_readpc(); aa.h = op_readpc(); op_writedbr(aa.w + 0, regs.r[n] >> 0); L op_writedbr(aa.w + 1, regs.r[n] >> 8); } template void R65816::op_write_addrr_b() { aa.l = op_readpc(); aa.h = op_readpc(); op_io(); L op_writedbr(aa.w + regs.r[i], regs.r[n]); } template void R65816::op_write_addrr_w() { aa.l = op_readpc(); aa.h = op_readpc(); op_io(); op_writedbr(aa.w + regs.r[i] + 0, regs.r[n] >> 0); L op_writedbr(aa.w + regs.r[i] + 1, regs.r[n] >> 8); } template void R65816::op_write_longr_b() { aa.l = op_readpc(); aa.h = op_readpc(); aa.b = op_readpc(); L op_writelong(aa.d + regs.r[i], regs.a.l); } template void R65816::op_write_longr_w() { aa.l = op_readpc(); aa.h = op_readpc(); aa.b = op_readpc(); op_writelong(aa.d + regs.r[i] + 0, regs.a.l); L op_writelong(aa.d + regs.r[i] + 1, regs.a.h); } template void R65816::op_write_dp_b() { dp = op_readpc(); op_io_cond2(); L op_writedp(dp, regs.r[n]); } template void R65816::op_write_dp_w() { dp = op_readpc(); op_io_cond2(); op_writedp(dp + 0, regs.r[n] >> 0); L op_writedp(dp + 1, regs.r[n] >> 8); } template void R65816::op_write_dpr_b() { dp = op_readpc(); op_io_cond2(); op_io(); L op_writedp(dp + regs.r[i], regs.r[n]); } template void R65816::op_write_dpr_w() { dp = op_readpc(); op_io_cond2(); op_io(); op_writedp(dp + regs.r[i] + 0, regs.r[n] >> 0); L op_writedp(dp + regs.r[i] + 1, regs.r[n] >> 8); } void R65816::op_sta_idp_b() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); L op_writedbr(aa.w, regs.a.l); } void R65816::op_sta_idp_w() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); op_writedbr(aa.w + 0, regs.a.l); L op_writedbr(aa.w + 1, regs.a.h); } void R65816::op_sta_ildp_b() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); aa.b = op_readdp(dp + 2); L op_writelong(aa.d, regs.a.l); } void R65816::op_sta_ildp_w() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); aa.b = op_readdp(dp + 2); op_writelong(aa.d + 0, regs.a.l); L op_writelong(aa.d + 1, regs.a.h); } void R65816::op_sta_idpx_b() { dp = op_readpc(); op_io_cond2(); op_io(); aa.l = op_readdp(dp + regs.x.w + 0); aa.h = op_readdp(dp + regs.x.w + 1); L op_writedbr(aa.w, regs.a.l); } void R65816::op_sta_idpx_w() { dp = op_readpc(); op_io_cond2(); op_io(); aa.l = op_readdp(dp + regs.x.w + 0); aa.h = op_readdp(dp + regs.x.w + 1); op_writedbr(aa.w + 0, regs.a.l); L op_writedbr(aa.w + 1, regs.a.h); } void R65816::op_sta_idpy_b() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); op_io(); L op_writedbr(aa.w + regs.y.w, regs.a.l); } void R65816::op_sta_idpy_w() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); op_io(); op_writedbr(aa.w + regs.y.w + 0, regs.a.l); L op_writedbr(aa.w + regs.y.w + 1, regs.a.h); } void R65816::op_sta_ildpy_b() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); aa.b = op_readdp(dp + 2); L op_writelong(aa.d + regs.y.w, regs.a.l); } void R65816::op_sta_ildpy_w() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); aa.b = op_readdp(dp + 2); op_writelong(aa.d + regs.y.w + 0, regs.a.l); L op_writelong(aa.d + regs.y.w + 1, regs.a.h); } void R65816::op_sta_sr_b() { sp = op_readpc(); op_io(); L op_writesp(sp, regs.a.l); } void R65816::op_sta_sr_w() { sp = op_readpc(); op_io(); op_writesp(sp + 0, regs.a.l); L op_writesp(sp + 1, regs.a.h); } void R65816::op_sta_isry_b() { sp = op_readpc(); op_io(); aa.l = op_readsp(sp + 0); aa.h = op_readsp(sp + 1); op_io(); L op_writedbr(aa.w + regs.y.w, regs.a.l); } void R65816::op_sta_isry_w() { sp = op_readpc(); op_io(); aa.l = op_readsp(sp + 0); aa.h = op_readsp(sp + 1); op_io(); op_writedbr(aa.w + regs.y.w + 0, regs.a.l); L op_writedbr(aa.w + regs.y.w + 1, regs.a.h); } sfc/cpu/mmio/mmio.cpp000664 001750 001750 00000027311 12651764221 015664 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP uint8 CPU::pio() { return status.pio; } bool CPU::joylatch() { return status.joypad_strobe_latch; } //WMDATA uint8 CPU::mmio_r2180() { return bus.read(0x7e0000 | status.wram_addr++); } //WMDATA void CPU::mmio_w2180(uint8 data) { bus.write(0x7e0000 | status.wram_addr++, data); } //WMADDL void CPU::mmio_w2181(uint8 data) { status.wram_addr = (status.wram_addr & 0x01ff00) | (data << 0); } //WMADDM void CPU::mmio_w2182(uint8 data) { status.wram_addr = (status.wram_addr & 0x0100ff) | (data << 8); } //WMADDH void CPU::mmio_w2183(uint8 data) { status.wram_addr = (status.wram_addr & 0x00ffff) | (data << 16); } //JOYSER0 //bit 0 is shared between JOYSER0 and JOYSER1, therefore //strobing $4016.d0 affects both controller port latches. //$4017 bit 0 writes are ignored. void CPU::mmio_w4016(uint8 data) { input.port1->latch(data & 1); input.port2->latch(data & 1); } //JOYSER0 //7-2 = MDR //1-0 = Joypad serial data uint8 CPU::mmio_r4016() { uint8 r = regs.mdr & 0xfc; r |= input.port1->data(); return r; } //JOYSER1 //7-5 = MDR //4-2 = Always 1 (pins are connected to GND) //1-0 = Joypad serial data uint8 CPU::mmio_r4017() { uint8 r = (regs.mdr & 0xe0) | 0x1c; r |= input.port2->data(); return r; } //NMITIMEN void CPU::mmio_w4200(uint8 data) { status.auto_joypad_poll = data & 1; nmitimen_update(data); } //WRIO void CPU::mmio_w4201(uint8 data) { if((status.pio & 0x80) && !(data & 0x80)) ppu.latch_counters(); status.pio = data; } //WRMPYA void CPU::mmio_w4202(uint8 data) { status.wrmpya = data; } //WRMPYB void CPU::mmio_w4203(uint8 data) { status.rdmpy = 0; if(alu.mpyctr || alu.divctr) return; status.wrmpyb = data; status.rddiv = (status.wrmpyb << 8) | status.wrmpya; alu.mpyctr = 8; //perform multiplication over the next eight cycles alu.shift = status.wrmpyb; } //WRDIVL void CPU::mmio_w4204(uint8 data) { status.wrdiva = (status.wrdiva & 0xff00) | (data << 0); } //WRDIVH void CPU::mmio_w4205(uint8 data) { status.wrdiva = (status.wrdiva & 0x00ff) | (data << 8); } //WRDIVB void CPU::mmio_w4206(uint8 data) { status.rdmpy = status.wrdiva; if(alu.mpyctr || alu.divctr) return; status.wrdivb = data; alu.divctr = 16; //perform division over the next sixteen cycles alu.shift = status.wrdivb << 16; } //HTIMEL void CPU::mmio_w4207(uint8 data) { status.hirq_pos = (status.hirq_pos & 0x0100) | (data << 0); } //HTIMEH void CPU::mmio_w4208(uint8 data) { status.hirq_pos = (status.hirq_pos & 0x00ff) | (data << 8); } //VTIMEL void CPU::mmio_w4209(uint8 data) { status.virq_pos = (status.virq_pos & 0x0100) | (data << 0); } //VTIMEH void CPU::mmio_w420a(uint8 data) { status.virq_pos = (status.virq_pos & 0x00ff) | (data << 8); } //DMAEN void CPU::mmio_w420b(uint8 data) { for(unsigned i = 0; i < 8; i++) { channel[i].dma_enabled = data & (1 << i); } if(data) status.dma_pending = true; } //HDMAEN void CPU::mmio_w420c(uint8 data) { for(unsigned i = 0; i < 8; i++) { channel[i].hdma_enabled = data & (1 << i); } } //MEMSEL void CPU::mmio_w420d(uint8 data) { status.rom_speed = (data & 1 ? 6 : 8); } //RDNMI //7 = NMI acknowledge //6-4 = MDR //3-0 = CPU (5a22) version uint8 CPU::mmio_r4210() { uint8 r = (regs.mdr & 0x70); r |= (uint8)(rdnmi()) << 7; r |= (cpu_version & 0x0f); return r; } //TIMEUP //7 = IRQ acknowledge //6-0 = MDR uint8 CPU::mmio_r4211() { uint8 r = (regs.mdr & 0x7f); r |= (uint8)(timeup()) << 7; return r; } //HVBJOY //7 = VBLANK acknowledge //6 = HBLANK acknowledge //5-1 = MDR //0 = JOYPAD acknowledge uint8 CPU::mmio_r4212() { uint8 r = (regs.mdr & 0x3e); if(status.auto_joypad_active) r |= 0x01; if(hcounter() <= 2 || hcounter() >= 1096) r |= 0x40; //hblank if(vcounter() >= (ppu.overscan() == false ? 225 : 240)) r |= 0x80; //vblank return r; } //RDIO uint8 CPU::mmio_r4213() { return status.pio; } //RDDIVL uint8 CPU::mmio_r4214() { return status.rddiv >> 0; } //RDDIVH uint8 CPU::mmio_r4215() { return status.rddiv >> 8; } //RDMPYL uint8 CPU::mmio_r4216() { return status.rdmpy >> 0; } //RDMPYH uint8 CPU::mmio_r4217() { return status.rdmpy >> 8; } uint8 CPU::mmio_r4218() { return status.joy1 >> 0; } //JOY1L uint8 CPU::mmio_r4219() { return status.joy1 >> 8; } //JOY1H uint8 CPU::mmio_r421a() { return status.joy2 >> 0; } //JOY2L uint8 CPU::mmio_r421b() { return status.joy2 >> 8; } //JOY2H uint8 CPU::mmio_r421c() { return status.joy3 >> 0; } //JOY3L uint8 CPU::mmio_r421d() { return status.joy3 >> 8; } //JOY3H uint8 CPU::mmio_r421e() { return status.joy4 >> 0; } //JOY4L uint8 CPU::mmio_r421f() { return status.joy4 >> 8; } //JOY4H //DMAPx uint8 CPU::mmio_r43x0(uint8 i) { return (channel[i].direction << 7) | (channel[i].indirect << 6) | (channel[i].unused << 5) | (channel[i].reverse_transfer << 4) | (channel[i].fixed_transfer << 3) | (channel[i].transfer_mode << 0); } //BBADx uint8 CPU::mmio_r43x1(uint8 i) { return channel[i].dest_addr; } //A1TxL uint8 CPU::mmio_r43x2(uint8 i) { return channel[i].source_addr >> 0; } //A1TxH uint8 CPU::mmio_r43x3(uint8 i) { return channel[i].source_addr >> 8; } //A1Bx uint8 CPU::mmio_r43x4(uint8 i) { return channel[i].source_bank; } //DASxL //union { uint16 transfer_size; uint16 indirect_addr; }; uint8 CPU::mmio_r43x5(uint8 i) { return channel[i].transfer_size >> 0; } //DASxH //union { uint16 transfer_size; uint16 indirect_addr; }; uint8 CPU::mmio_r43x6(uint8 i) { return channel[i].transfer_size >> 8; } //DASBx uint8 CPU::mmio_r43x7(uint8 i) { return channel[i].indirect_bank; } //A2AxL uint8 CPU::mmio_r43x8(uint8 i) { return channel[i].hdma_addr >> 0; } //A2AxH uint8 CPU::mmio_r43x9(uint8 i) { return channel[i].hdma_addr >> 8; } //NTRLx uint8 CPU::mmio_r43xa(uint8 i) { return channel[i].line_counter; } //??? uint8 CPU::mmio_r43xb(uint8 i) { return channel[i].unknown; } //DMAPx void CPU::mmio_w43x0(uint8 i, uint8 data) { channel[i].direction = data & 0x80; channel[i].indirect = data & 0x40; channel[i].unused = data & 0x20; channel[i].reverse_transfer = data & 0x10; channel[i].fixed_transfer = data & 0x08; channel[i].transfer_mode = data & 0x07; } //DDBADx void CPU::mmio_w43x1(uint8 i, uint8 data) { channel[i].dest_addr = data; } //A1TxL void CPU::mmio_w43x2(uint8 i, uint8 data) { channel[i].source_addr = (channel[i].source_addr & 0xff00) | (data << 0); } //A1TxH void CPU::mmio_w43x3(uint8 i, uint8 data) { channel[i].source_addr = (channel[i].source_addr & 0x00ff) | (data << 8); } //A1Bx void CPU::mmio_w43x4(uint8 i, uint8 data) { channel[i].source_bank = data; } //DASxL //union { uint16 transfer_size; uint16 indirect_addr; }; void CPU::mmio_w43x5(uint8 i, uint8 data) { channel[i].transfer_size = (channel[i].transfer_size & 0xff00) | (data << 0); } //DASxH //union { uint16 transfer_size; uint16 indirect_addr; }; void CPU::mmio_w43x6(uint8 i, uint8 data) { channel[i].transfer_size = (channel[i].transfer_size & 0x00ff) | (data << 8); } //DASBx void CPU::mmio_w43x7(uint8 i, uint8 data) { channel[i].indirect_bank = data; } //A2AxL void CPU::mmio_w43x8(uint8 i, uint8 data) { channel[i].hdma_addr = (channel[i].hdma_addr & 0xff00) | (data << 0); } //A2AxH void CPU::mmio_w43x9(uint8 i, uint8 data) { channel[i].hdma_addr = (channel[i].hdma_addr & 0x00ff) | (data << 8); } //NTRLx void CPU::mmio_w43xa(uint8 i, uint8 data) { channel[i].line_counter = data; } //??? void CPU::mmio_w43xb(uint8 i, uint8 data) { channel[i].unknown = data; } void CPU::mmio_power() { } void CPU::mmio_reset() { //$2140-217f for(auto& port : status.port) port = 0x00; //$2181-$2183 status.wram_addr = 0x000000; //$4016-$4017 status.joypad_strobe_latch = 0; status.joypad1_bits = ~0; status.joypad2_bits = ~0; //$4200 status.nmi_enabled = false; status.hirq_enabled = false; status.virq_enabled = false; status.auto_joypad_poll = false; //$4201 status.pio = 0xff; //$4202-$4203 status.wrmpya = 0xff; status.wrmpyb = 0xff; //$4204-$4206 status.wrdiva = 0xffff; status.wrdivb = 0xff; //$4207-$420a status.hirq_pos = 0x01ff; status.virq_pos = 0x01ff; //$420d status.rom_speed = 8; //$4214-$4217 status.rddiv = 0x0000; status.rdmpy = 0x0000; //$4218-$421f status.joy1 = 0x0000; status.joy2 = 0x0000; status.joy3 = 0x0000; status.joy4 = 0x0000; //ALU alu.mpyctr = 0; alu.divctr = 0; alu.shift = 0; } uint8 CPU::mmio_read(unsigned addr) { addr &= 0xffff; //APU if((addr & 0xffc0) == 0x2140) { //$2140-$217f synchronize_smp(); return smp.port_read(addr); } //DMA if((addr & 0xff80) == 0x4300) { //$4300-$437f unsigned i = (addr >> 4) & 7; switch(addr & 0xf) { case 0x0: return mmio_r43x0(i); case 0x1: return mmio_r43x1(i); case 0x2: return mmio_r43x2(i); case 0x3: return mmio_r43x3(i); case 0x4: return mmio_r43x4(i); case 0x5: return mmio_r43x5(i); case 0x6: return mmio_r43x6(i); case 0x7: return mmio_r43x7(i); case 0x8: return mmio_r43x8(i); case 0x9: return mmio_r43x9(i); case 0xa: return mmio_r43xa(i); case 0xb: return mmio_r43xb(i); case 0xc: return regs.mdr; //unmapped case 0xd: return regs.mdr; //unmapped case 0xe: return regs.mdr; //unmapped case 0xf: return mmio_r43xb(i); //mirror of $43xb } } switch(addr) { case 0x2180: return mmio_r2180(); case 0x4016: return mmio_r4016(); case 0x4017: return mmio_r4017(); case 0x4210: return mmio_r4210(); case 0x4211: return mmio_r4211(); case 0x4212: return mmio_r4212(); case 0x4213: return mmio_r4213(); case 0x4214: return mmio_r4214(); case 0x4215: return mmio_r4215(); case 0x4216: return mmio_r4216(); case 0x4217: return mmio_r4217(); case 0x4218: return mmio_r4218(); case 0x4219: return mmio_r4219(); case 0x421a: return mmio_r421a(); case 0x421b: return mmio_r421b(); case 0x421c: return mmio_r421c(); case 0x421d: return mmio_r421d(); case 0x421e: return mmio_r421e(); case 0x421f: return mmio_r421f(); } return regs.mdr; } void CPU::mmio_write(unsigned addr, uint8 data) { addr &= 0xffff; //APU if((addr & 0xffc0) == 0x2140) { //$2140-$217f synchronize_smp(); port_write(addr, data); return; } //DMA if((addr & 0xff80) == 0x4300) { //$4300-$437f unsigned i = (addr >> 4) & 7; switch(addr & 0xf) { case 0x0: mmio_w43x0(i, data); return; case 0x1: mmio_w43x1(i, data); return; case 0x2: mmio_w43x2(i, data); return; case 0x3: mmio_w43x3(i, data); return; case 0x4: mmio_w43x4(i, data); return; case 0x5: mmio_w43x5(i, data); return; case 0x6: mmio_w43x6(i, data); return; case 0x7: mmio_w43x7(i, data); return; case 0x8: mmio_w43x8(i, data); return; case 0x9: mmio_w43x9(i, data); return; case 0xa: mmio_w43xa(i, data); return; case 0xb: mmio_w43xb(i, data); return; case 0xc: return; //unmapped case 0xd: return; //unmapped case 0xe: return; //unmapped case 0xf: mmio_w43xb(i, data); return; //mirror of $43xb } } switch(addr) { case 0x2180: mmio_w2180(data); return; case 0x2181: mmio_w2181(data); return; case 0x2182: mmio_w2182(data); return; case 0x2183: mmio_w2183(data); return; case 0x4016: mmio_w4016(data); return; case 0x4017: return; //unmapped case 0x4200: mmio_w4200(data); return; case 0x4201: mmio_w4201(data); return; case 0x4202: mmio_w4202(data); return; case 0x4203: mmio_w4203(data); return; case 0x4204: mmio_w4204(data); return; case 0x4205: mmio_w4205(data); return; case 0x4206: mmio_w4206(data); return; case 0x4207: mmio_w4207(data); return; case 0x4208: mmio_w4208(data); return; case 0x4209: mmio_w4209(data); return; case 0x420a: mmio_w420a(data); return; case 0x420b: mmio_w420b(data); return; case 0x420c: mmio_w420c(data); return; case 0x420d: mmio_w420d(data); return; } } #endif fc/cartridge/board/sunsoft-5b.cpp000664 001750 001750 00000012434 12651764221 020050 0ustar00sergiosergio000000 000000 //SUNSOFT-5B struct Sunsoft5B : Board { uint4 mmu_port; uint4 apu_port; uint8 prg_bank[4]; uint8 chr_bank[8]; uint2 mirror; bool irq_enable; bool irq_counter_enable; uint16 irq_counter; int16 dac[16]; struct Pulse { bool disable; uint12 frequency; uint4 volume; uint16 counter; //12-bit countdown + 4-bit phase uint1 duty; uint4 output; void clock() { if(--counter == 0) { counter = frequency << 4; duty ^= 1; } output = duty ? volume : (uint4)0; if(disable) output = 0; } void reset() { disable = 1; frequency = 1; volume = 0; counter = 0; duty = 0; output = 0; } void serialize(serializer& s) { s.integer(disable); s.integer(frequency); s.integer(volume); s.integer(counter); s.integer(duty); s.integer(output); } } pulse[3]; void main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(irq_counter_enable) { if(--irq_counter == 0xffff) { cpu.set_irq_line(irq_enable); } } pulse[0].clock(); pulse[1].clock(); pulse[2].clock(); int16 output = dac[pulse[0].output] + dac[pulse[1].output] + dac[pulse[2].output]; apu.set_sample(-output); tick(); } } uint8 prg_read(unsigned addr) { if(addr < 0x6000) return cpu.mdr(); uint8 bank = 0x3f; //((addr & 0xe000) == 0xe000 if((addr & 0xe000) == 0x6000) bank = prg_bank[0]; if((addr & 0xe000) == 0x8000) bank = prg_bank[1]; if((addr & 0xe000) == 0xa000) bank = prg_bank[2]; if((addr & 0xe000) == 0xc000) bank = prg_bank[3]; bool ram_enable = bank & 0x80; bool ram_select = bank & 0x40; bank &= 0x3f; if(ram_select) { if(ram_enable == false) return cpu.mdr(); return prgram.data[addr & 0x1fff]; } addr = (bank << 13) | (addr & 0x1fff); return prgrom.read(addr); } void prg_write(unsigned addr, uint8 data) { if((addr & 0xe000) == 0x6000) { prgram.data[addr & 0x1fff] = data; } if(addr == 0x8000) { mmu_port = data & 0x0f; } if(addr == 0xa000) { switch(mmu_port) { case 0: chr_bank[0] = data; break; case 1: chr_bank[1] = data; break; case 2: chr_bank[2] = data; break; case 3: chr_bank[3] = data; break; case 4: chr_bank[4] = data; break; case 5: chr_bank[5] = data; break; case 6: chr_bank[6] = data; break; case 7: chr_bank[7] = data; break; case 8: prg_bank[0] = data; break; case 9: prg_bank[1] = data; break; case 10: prg_bank[2] = data; break; case 11: prg_bank[3] = data; break; case 12: mirror = data & 3; break; case 13: irq_enable = data & 0x80; irq_counter_enable = data & 0x01; if(irq_enable == 0) cpu.set_irq_line(0); break; case 14: irq_counter = (irq_counter & 0xff00) | (data << 0); break; case 15: irq_counter = (irq_counter & 0x00ff) | (data << 8); break; } } if(addr == 0xc000) { apu_port = data & 0x0f; } if(addr == 0xe000) { switch(apu_port) { case 0: pulse[0].frequency = (pulse[0].frequency & 0xff00) | (data << 0); break; case 1: pulse[0].frequency = (pulse[0].frequency & 0x00ff) | (data << 8); break; case 2: pulse[1].frequency = (pulse[1].frequency & 0xff00) | (data << 0); break; case 3: pulse[1].frequency = (pulse[1].frequency & 0x00ff) | (data << 8); break; case 4: pulse[2].frequency = (pulse[2].frequency & 0xff00) | (data << 0); break; case 5: pulse[2].frequency = (pulse[2].frequency & 0x00ff) | (data << 8); break; case 7: pulse[0].disable = data & 0x01; pulse[1].disable = data & 0x02; pulse[2].disable = data & 0x04; break; case 8: pulse[0].volume = data & 0x0f; break; case 9: pulse[1].volume = data & 0x0f; break; case 10: pulse[2].volume = data & 0x0f; break; } } } unsigned chr_addr(unsigned addr) { uint8 bank = (addr >> 10) & 7; return (chr_bank[bank] << 10) | (addr & 0x03ff); } unsigned ciram_addr(unsigned addr) { switch(mirror) { case 0: return ((addr & 0x0400) >> 0) | (addr & 0x03ff); //vertical case 1: return ((addr & 0x0800) >> 1) | (addr & 0x03ff); //horizontal case 2: return 0x0000 | (addr & 0x03ff); //first case 3: return 0x0400 | (addr & 0x03ff); //second } } uint8 chr_read(unsigned addr) { if(addr & 0x2000) return ppu.ciram_read(ciram_addr(addr)); return Board::chr_read(chr_addr(addr)); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) return ppu.ciram_write(ciram_addr(addr), data); return Board::chr_write(chr_addr(addr), data); } void power() { for(signed n = 0; n < 16; n++) { double volume = 1.0 / pow(2, 1.0 / 2 * (15 - n)); dac[n] = volume * 8192.0; } } void reset() { mmu_port = 0; apu_port = 0; for(auto& n : prg_bank) n = 0; for(auto& n : chr_bank) n = 0; mirror = 0; irq_enable = 0; irq_counter_enable = 0; irq_counter = 0; pulse[0].reset(); pulse[1].reset(); pulse[2].reset(); } void serialize(serializer& s) { Board::serialize(s); s.integer(mmu_port); s.integer(apu_port); s.array(prg_bank); s.array(chr_bank); s.integer(mirror); s.integer(irq_enable); s.integer(irq_counter_enable); s.integer(irq_counter); pulse[0].serialize(s); pulse[1].serialize(s); pulse[2].serialize(s); } Sunsoft5B(Markup::Node& document) : Board(document) { } }; gb/ppu/mmio.cpp000664 001750 001750 00000010557 12651764221 014561 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP unsigned PPU::vram_addr(uint16 addr) const { return (status.vram_bank * 0x2000) + (addr & 0x1fff); } uint8 PPU::mmio_read(uint16 addr) { if(addr >= 0x8000 && addr <= 0x9fff) return vram[vram_addr(addr)]; if(addr >= 0xfe00 && addr <= 0xfe9f) return oam[addr & 0xff]; if(addr == 0xff40) { //LCDC return (status.display_enable << 7) | (status.window_tilemap_select << 6) | (status.window_display_enable << 5) | (status.bg_tiledata_select << 4) | (status.bg_tilemap_select << 3) | (status.ob_size << 2) | (status.ob_enable << 1) | (status.bg_enable << 0); } if(addr == 0xff41) { //STAT unsigned mode; if(status.ly >= 144) mode = 1; //Vblank else if(status.lx < 80) mode = 2; //OAM else if(status.lx < 252) mode = 3; //LCD else mode = 0; //Hblank return (status.interrupt_lyc << 6) | (status.interrupt_oam << 5) | (status.interrupt_vblank << 4) | (status.interrupt_hblank << 3) | ((status.ly == status.lyc) << 2) | (mode << 0); } if(addr == 0xff42) { //SCY return status.scy; } if(addr == 0xff43) { //SCX return status.scx; } if(addr == 0xff44) { //LY return status.ly; } if(addr == 0xff45) { //LYC return status.lyc; } if(addr == 0xff47) { //BGP return (bgp[3] << 6) | (bgp[2] << 4) | (bgp[1] << 2) | (bgp[0] << 0); } if(addr == 0xff48) { //OBP0 return (obp[0][3] << 6) | (obp[0][2] << 4) | (obp[0][1] << 2) | (obp[0][0] << 0); } if(addr == 0xff49) { //OBP1 return (obp[1][3] << 6) | (obp[1][2] << 4) | (obp[1][1] << 2) | (obp[1][0] << 0); } if(addr == 0xff4a) { //WY return status.wy; } if(addr == 0xff4b) { //WX return status.wx; } if(addr == 0xff69) { //BGPD return bgpd[status.bgpi]; } if(addr == 0xff6b) { //OBPD return obpd[status.obpi]; } return 0x00; } void PPU::mmio_write(uint16 addr, uint8 data) { if(addr >= 0x8000 && addr <= 0x9fff) { vram[vram_addr(addr)] = data; return; } if(addr >= 0xfe00 && addr <= 0xfe9f) { oam[addr & 0xff] = data; return; } if(addr == 0xff40) { //LCDC if(status.display_enable == false && (data & 0x80)) { status.lx = 0; //unverified behavior; fixes Super Mario Land 2 - Tree Zone } status.display_enable = data & 0x80; status.window_tilemap_select = data & 0x40; status.window_display_enable = data & 0x20; status.bg_tiledata_select = data & 0x10; status.bg_tilemap_select = data & 0x08; status.ob_size = data & 0x04; status.ob_enable = data & 0x02; status.bg_enable = data & 0x01; return; } if(addr == 0xff41) { //STAT status.interrupt_lyc = data & 0x40; status.interrupt_oam = data & 0x20; status.interrupt_vblank = data & 0x10; status.interrupt_hblank = data & 0x08; return; } if(addr == 0xff42) { //SCY status.scy = data; return; } if(addr == 0xff43) { //SCX status.scx = data; return; } if(addr == 0xff44) { //LY status.ly = 0; return; } if(addr == 0xff45) { //LYC status.lyc = data; return; } if(addr == 0xff47) { //BGP bgp[3] = (data >> 6) & 3; bgp[2] = (data >> 4) & 3; bgp[1] = (data >> 2) & 3; bgp[0] = (data >> 0) & 3; return; } if(addr == 0xff48) { //OBP0 obp[0][3] = (data >> 6) & 3; obp[0][2] = (data >> 4) & 3; obp[0][1] = (data >> 2) & 3; obp[0][0] = (data >> 0) & 3; return; } if(addr == 0xff49) { //OBP1 obp[1][3] = (data >> 6) & 3; obp[1][2] = (data >> 4) & 3; obp[1][1] = (data >> 2) & 3; obp[1][0] = (data >> 0) & 3; return; } if(addr == 0xff4a) { //WY status.wy = data; return; } if(addr == 0xff4b) { //WX status.wx = data; return; } if(addr == 0xff4f) { //VBK status.vram_bank = data & 1; return; } if(addr == 0xff68) { //BGPI status.bgpi_increment = data & 0x80; status.bgpi = data & 0x3f; return; } if(addr == 0xff69) { //BGPD bgpd[status.bgpi] = data; if(status.bgpi_increment) status.bgpi++; return; } if(addr == 0xff6a) { //OBPI status.obpi_increment = data & 0x80; status.obpi = data & 0x3f; } if(addr == 0xff6b) { //OBPD obpd[status.obpi] = data; if(status.obpi_increment) status.obpi++; } } #endif phoenix/reference/action/check-item.hpp000664 001750 001750 00000000424 12651764221 021317 0ustar00sergiosergio000000 000000 namespace phoenix { struct pCheckItem : public pAction { CheckItem& checkItem; void setChecked(bool checked); void setText(string text); pCheckItem(CheckItem& checkItem) : pAction(checkItem), checkItem(checkItem) {} void constructor(); void destructor(); }; } processor/r65816/opcode_misc.cpp000664 001750 001750 00000013775 12651764221 017607 0ustar00sergiosergio000000 000000 void R65816::op_nop() { L op_io_irq(); } void R65816::op_wdm() { L op_readpc(); } void R65816::op_xba() { op_io(); L op_io(); regs.a.l ^= regs.a.h; regs.a.h ^= regs.a.l; regs.a.l ^= regs.a.h; regs.p.n = (regs.a.l & 0x80); regs.p.z = (regs.a.l == 0); } template void R65816::op_move_b() { dp = op_readpc(); sp = op_readpc(); regs.db = dp; rd.l = op_readlong((sp << 16) | regs.x.w); op_writelong((dp << 16) | regs.y.w, rd.l); op_io(); regs.x.l += adjust; regs.y.l += adjust; L op_io(); if(regs.a.w--) regs.pc.w -= 3; } template void R65816::op_move_w() { dp = op_readpc(); sp = op_readpc(); regs.db = dp; rd.l = op_readlong((sp << 16) | regs.x.w); op_writelong((dp << 16) | regs.y.w, rd.l); op_io(); regs.x.w += adjust; regs.y.w += adjust; L op_io(); if(regs.a.w--) regs.pc.w -= 3; } template void R65816::op_interrupt_e() { op_readpc(); op_writestack(regs.pc.h); op_writestack(regs.pc.l); op_writestack(regs.p); rd.l = op_readlong(vectorE + 0); regs.pc.b = 0; regs.p.i = 1; regs.p.d = 0; L rd.h = op_readlong(vectorE + 1); regs.pc.w = rd.w; } template void R65816::op_interrupt_n() { op_readpc(); op_writestack(regs.pc.b); op_writestack(regs.pc.h); op_writestack(regs.pc.l); op_writestack(regs.p); rd.l = op_readlong(vectorN + 0); regs.pc.b = 0x00; regs.p.i = 1; regs.p.d = 0; L rd.h = op_readlong(vectorN + 1); regs.pc.w = rd.w; } void R65816::op_stp() { while((regs.wai = true)) { L op_io(); } } void R65816::op_wai() { regs.wai = true; while(regs.wai) { L op_io(); } op_io(); } void R65816::op_xce() { L op_io_irq(); bool carry = regs.p.c; regs.p.c = regs.e; regs.e = carry; if(regs.e) { regs.p |= 0x30; regs.s.h = 0x01; } if(regs.p.x) { regs.x.h = 0x00; regs.y.h = 0x00; } update_table(); } template void R65816::op_flag() { L op_io_irq(); regs.p = (regs.p & ~mask) | value; } template void R65816::op_pflag_e() { rd.l = op_readpc(); L op_io(); regs.p = (mode ? regs.p | rd.l : regs.p & ~rd.l); regs.p |= 0x30; if(regs.p.x) { regs.x.h = 0x00; regs.y.h = 0x00; } update_table(); } template void R65816::op_pflag_n() { rd.l = op_readpc(); L op_io(); regs.p = (mode ? regs.p | rd.l : regs.p & ~rd.l); if(regs.p.x) { regs.x.h = 0x00; regs.y.h = 0x00; } update_table(); } template void R65816::op_transfer_b() { L op_io_irq(); regs.r[to].l = regs.r[from].l; regs.p.n = (regs.r[to].l & 0x80); regs.p.z = (regs.r[to].l == 0); } template void R65816::op_transfer_w() { L op_io_irq(); regs.r[to].w = regs.r[from].w; regs.p.n = (regs.r[to].w & 0x8000); regs.p.z = (regs.r[to].w == 0); } void R65816::op_tcs_e() { L op_io_irq(); regs.s.l = regs.a.l; } void R65816::op_tcs_n() { L op_io_irq(); regs.s.w = regs.a.w; } void R65816::op_tsx_b() { L op_io_irq(); regs.x.l = regs.s.l; regs.p.n = (regs.x.l & 0x80); regs.p.z = (regs.x.l == 0); } void R65816::op_tsx_w() { L op_io_irq(); regs.x.w = regs.s.w; regs.p.n = (regs.x.w & 0x8000); regs.p.z = (regs.x.w == 0); } void R65816::op_txs_e() { L op_io_irq(); regs.s.l = regs.x.l; } void R65816::op_txs_n() { L op_io_irq(); regs.s.w = regs.x.w; } template void R65816::op_push_b() { op_io(); L op_writestack(regs.r[n].l); } template void R65816::op_push_w() { op_io(); op_writestack(regs.r[n].h); L op_writestack(regs.r[n].l); } void R65816::op_phd_e() { op_io(); op_writestackn(regs.d.h); L op_writestackn(regs.d.l); regs.s.h = 0x01; } void R65816::op_phd_n() { op_io(); op_writestackn(regs.d.h); L op_writestackn(regs.d.l); } void R65816::op_phb() { op_io(); L op_writestack(regs.db); } void R65816::op_phk() { op_io(); L op_writestack(regs.pc.b); } void R65816::op_php() { op_io(); L op_writestack(regs.p); } template void R65816::op_pull_b() { op_io(); op_io(); L regs.r[n].l = op_readstack(); regs.p.n = (regs.r[n].l & 0x80); regs.p.z = (regs.r[n].l == 0); } template void R65816::op_pull_w() { op_io(); op_io(); regs.r[n].l = op_readstack(); L regs.r[n].h = op_readstack(); regs.p.n = (regs.r[n].w & 0x8000); regs.p.z = (regs.r[n].w == 0); } void R65816::op_pld_e() { op_io(); op_io(); regs.d.l = op_readstackn(); L regs.d.h = op_readstackn(); regs.p.n = (regs.d.w & 0x8000); regs.p.z = (regs.d.w == 0); regs.s.h = 0x01; } void R65816::op_pld_n() { op_io(); op_io(); regs.d.l = op_readstackn(); L regs.d.h = op_readstackn(); regs.p.n = (regs.d.w & 0x8000); regs.p.z = (regs.d.w == 0); } void R65816::op_plb() { op_io(); op_io(); L regs.db = op_readstack(); regs.p.n = (regs.db & 0x80); regs.p.z = (regs.db == 0); } void R65816::op_plp_e() { op_io(); op_io(); L regs.p = op_readstack() | 0x30; if(regs.p.x) { regs.x.h = 0x00; regs.y.h = 0x00; } update_table(); } void R65816::op_plp_n() { op_io(); op_io(); L regs.p = op_readstack(); if(regs.p.x) { regs.x.h = 0x00; regs.y.h = 0x00; } update_table(); } void R65816::op_pea_e() { aa.l = op_readpc(); aa.h = op_readpc(); op_writestackn(aa.h); L op_writestackn(aa.l); regs.s.h = 0x01; } void R65816::op_pea_n() { aa.l = op_readpc(); aa.h = op_readpc(); op_writestackn(aa.h); L op_writestackn(aa.l); } void R65816::op_pei_e() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); op_writestackn(aa.h); L op_writestackn(aa.l); regs.s.h = 0x01; } void R65816::op_pei_n() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); op_writestackn(aa.h); L op_writestackn(aa.l); } void R65816::op_per_e() { aa.l = op_readpc(); aa.h = op_readpc(); op_io(); rd.w = regs.pc.d + (int16)aa.w; op_writestackn(rd.h); L op_writestackn(rd.l); regs.s.h = 0x01; } void R65816::op_per_n() { aa.l = op_readpc(); aa.h = op_readpc(); op_io(); rd.w = regs.pc.d + (int16)aa.w; op_writestackn(rd.h); L op_writestackn(rd.l); } phoenix/gtk/widget/horizontal-slider.cpp000664 001750 001750 00000002257 12651764221 021615 0ustar00sergiosergio000000 000000 namespace phoenix { static void HorizontalSlider_change(GtkRange* gtkRange, HorizontalSlider* self) { unsigned position = (unsigned)gtk_range_get_value(gtkRange); if(self->state.position == position) return; self->state.position = position; if(self->onChange) self->onChange(); } Size pHorizontalSlider::minimumSize() { return {0, 20}; } void pHorizontalSlider::setLength(unsigned length) { length += length == 0; gtk_range_set_range(GTK_RANGE(gtkWidget), 0, max(1u, length - 1)); gtk_range_set_increments(GTK_RANGE(gtkWidget), 1, length >> 3); } void pHorizontalSlider::setPosition(unsigned position) { gtk_range_set_value(GTK_RANGE(gtkWidget), position); } void pHorizontalSlider::constructor() { gtkWidget = gtk_hscale_new_with_range(0, 100, 1); gtk_scale_set_draw_value(GTK_SCALE(gtkWidget), false); g_signal_connect(G_OBJECT(gtkWidget), "value-changed", G_CALLBACK(HorizontalSlider_change), (gpointer)&horizontalSlider); setLength(horizontalSlider.state.length); setPosition(horizontalSlider.state.position); } void pHorizontalSlider::destructor() { gtk_widget_destroy(gtkWidget); } void pHorizontalSlider::orphan() { destructor(); constructor(); } } nall/image/static.hpp000664 001750 001750 00000001400 12651764221 015713 0ustar00sergiosergio000000 000000 #ifndef NALL_IMAGE_STATIC_HPP #define NALL_IMAGE_STATIC_HPP namespace nall { unsigned image::bitDepth(uint64_t color) { unsigned depth = 0; if(color) while((color & 1) == 0) color >>= 1; while((color & 1) == 1) { color >>= 1; depth++; } return depth; } unsigned image::bitShift(uint64_t color) { unsigned shift = 0; if(color) while((color & 1) == 0) { color >>= 1; shift++; } return shift; } uint64_t image::normalize(uint64_t color, unsigned sourceDepth, unsigned targetDepth) { if(sourceDepth == 0 || targetDepth == 0) return 0; while(sourceDepth < targetDepth) { color = (color << sourceDepth) | color; sourceDepth += sourceDepth; } if(targetDepth < sourceDepth) color >>= (sourceDepth - targetDepth); return color; } } #endif libco/ucontext.c000664 001750 001750 00000003444 12651764221 015022 0ustar00sergiosergio000000 000000 /* libco.ucontext (2008-01-28) author: Nach license: public domain */ /* * WARNING: the overhead of POSIX ucontext is very high, * assembly versions of libco or libco_sjlj should be much faster * * This library only exists for two reasons: * 1 - as an initial test for the viability of a ucontext implementation * 2 - to demonstrate the power and speed of libco over existing implementations, * such as pth (which defaults to wrapping ucontext on unix targets) * * Use this library only as a *last resort* */ #define LIBCO_C #include "libco.h" #include #include #ifdef __cplusplus extern "C" { #endif static thread_local ucontext_t co_primary; static thread_local ucontext_t *co_running = 0; cothread_t co_active(void) { if (!co_running) co_running = &co_primary; return (cothread_t)co_running; } cothread_t co_create(unsigned int heapsize, void (*coentry)(void)) { if (!co_running) co_running = &co_primary; ucontext_t *thread = (ucontext_t*)malloc(sizeof(ucontext_t)); if(thread) { if((!getcontext(thread) && !(thread->uc_stack.ss_sp = 0)) && (thread->uc_stack.ss_sp = malloc(heapsize))) { thread->uc_link = co_running; thread->uc_stack.ss_size = heapsize; makecontext(thread, coentry, 0); } else { co_delete((cothread_t)thread); thread = 0; } } return (cothread_t)thread; } void co_delete(cothread_t cothread) { if (!cothread) return; if(((ucontext_t*)cothread)->uc_stack.ss_sp) free(((ucontext_t*)cothread)->uc_stack.ss_sp); free(cothread); } void co_switch(cothread_t cothread) { ucontext_t *old_thread = co_running; co_running = (ucontext_t*)cothread; swapcontext(old_thread, co_running); } #ifdef __cplusplus } #endif sfc/chip/dsp4/dsp4.cpp000664 001750 001750 00000001720 12651764221 015636 0ustar00sergiosergio000000 000000 #include #define DSP4_CPP namespace SuperFamicom { DSP4 dsp4; void DSP4::init() { } void DSP4::load() { } void DSP4::unload() { } namespace DSP4i { inline uint16 READ_WORD(uint8 *addr) { return (addr[0]) + (addr[1] << 8); } inline uint32 READ_DWORD(uint8 *addr) { return (addr[0]) + (addr[1] << 8) + (addr[2] << 16) + (addr[3] << 24); } inline void WRITE_WORD(uint8 *addr, uint16 data) { addr[0] = data; addr[1] = data >> 8; } #define bool8 uint8 #include "dsp4emu.c" #undef bool8 }; void DSP4::power() { } void DSP4::reset() { DSP4i::InitDSP4(); } uint8 DSP4::read(unsigned addr) { addr &= 0xffff; if(addr < 0xc000) { DSP4i::dsp4_address = addr; DSP4i::DSP4GetByte(); return DSP4i::dsp4_byte; } return 0x80; } void DSP4::write(unsigned addr, uint8 data) { addr &= 0xffff; if(addr < 0xc000) { DSP4i::dsp4_address = addr; DSP4i::dsp4_byte = data; DSP4i::DSP4SetByte(); } } } phoenix/reference/000700 001750 001750 00000000000 12656700342 015303 5ustar00sergiosergio000000 000000 phoenix/reference/action/action.cpp000664 001750 001750 00000000260 12651764221 020554 0ustar00sergiosergio000000 000000 namespace phoenix { void pAction::setEnabled(bool enabled) { } void pAction::setVisible(bool visible) { } void pAction::constructor() { } void pAction::destructor() { } } phoenix/windows/action/item.cpp000664 001750 001750 00000001774 12651764221 020004 0ustar00sergiosergio000000 000000 namespace phoenix { void pItem::setImage(const image& image) { createBitmap(); if(parentWindow) parentWindow->p.updateMenu(); } void pItem::setText(string text) { if(parentWindow) parentWindow->p.updateMenu(); } void pItem::constructor() { createBitmap(); } void pItem::destructor() { if(hbitmap) { DeleteObject(hbitmap); hbitmap = 0; } if(parentMenu) parentMenu->remove(item); } void pItem::createBitmap() { if(hbitmap) { DeleteObject(hbitmap); hbitmap = 0; } if(item.state.image.width && item.state.image.height) { nall::image nallImage = item.state.image; nallImage.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0); nallImage.alphaBlend(GetSysColor(COLOR_MENU)); //Windows does not alpha blend menu icons properly (leaves black outline) nallImage.scale(GetSystemMetrics(SM_CXMENUCHECK), GetSystemMetrics(SM_CYMENUCHECK), Interpolation::Linear); hbitmap = CreateBitmap(nallImage); } } void pItem::onActivate() { if(item.onActivate) item.onActivate(); } } sfc/alt/dsp/000700 001750 001750 00000000000 12656700342 014014 5ustar00sergiosergio000000 000000 nall/traits.hpp000664 001750 001750 00000002115 12651764221 014654 0ustar00sergiosergio000000 000000 #ifndef NALL_TRAITS_HPP #define NALL_TRAITS_HPP #include namespace nall { template class has_default_constructor { template class receive_size{}; template static signed sfinae(receive_size*); template static char sfinae(...); public: enum : bool { value = sizeof(sfinae(0)) == sizeof(signed) }; }; template struct enable_if { typedef T type; }; template struct enable_if {}; template struct type_if { typedef T type; }; template struct type_if { typedef F type; }; template struct static_and { enum { value = false }; }; template<> struct static_and { enum { value = true }; }; template struct static_or { enum { value = false }; }; template<> struct static_or { enum { value = true }; }; template<> struct static_or { enum { value = true }; }; template<> struct static_or { enum { value = true }; }; } #endif phoenix/qt/widget/combo-button.cpp000664 001750 001750 00000003267 12651764221 020415 0ustar00sergiosergio000000 000000 namespace phoenix { void pComboButton::append(string text) { locked = true; qtComboButton->addItem(QString::fromUtf8(text)); locked = false; } Size pComboButton::minimumSize() { unsigned maximumWidth = 0; for(auto& text : comboButton.state.text) maximumWidth = max(maximumWidth, pFont::size(qtWidget->font(), text).width); Size size = pFont::size(qtWidget->font(), " "); return {maximumWidth + 32, size.height + 12}; } void pComboButton::remove(unsigned selection) { locked = true; qtComboButton->removeItem(selection); locked = false; if(selection == comboButton.state.selection) comboButton.setSelection(0); } void pComboButton::reset() { locked = true; while(qtComboButton->count()) qtComboButton->removeItem(0); locked = false; } void pComboButton::setSelection(unsigned selection) { locked = true; qtComboButton->setCurrentIndex(selection); locked = false; } void pComboButton::setText(unsigned selection, string text) { qtComboButton->setItemText(selection, text); } void pComboButton::constructor() { qtWidget = qtComboButton = new QComboBox; connect(qtComboButton, SIGNAL(currentIndexChanged(int)), SLOT(onChange())); pWidget::synchronizeState(); unsigned selection = comboButton.state.selection; locked = true; for(auto& text : comboButton.state.text) append(text); locked = false; comboButton.setSelection(selection); } void pComboButton::destructor() { delete qtComboButton; qtWidget = qtComboButton = nullptr; } void pComboButton::orphan() { destructor(); constructor(); } void pComboButton::onChange() { comboButton.state.selection = qtComboButton->currentIndex(); if(!locked && comboButton.onChange) comboButton.onChange(); } } fc/scheduler/000700 001750 001750 00000000000 12656700342 014241 5ustar00sergiosergio000000 000000 fc/cartridge/board/board.cpp000664 001750 001750 00000017031 12651764221 017130 0ustar00sergiosergio000000 000000 #include "bandai-fcg.cpp" #include "konami-vrc1.cpp" #include "konami-vrc2.cpp" #include "konami-vrc3.cpp" #include "konami-vrc4.cpp" #include "konami-vrc6.cpp" #include "konami-vrc7.cpp" #include "nes-axrom.cpp" #include "nes-bnrom.cpp" #include "nes-cnrom.cpp" #include "nes-exrom.cpp" #include "nes-fxrom.cpp" #include "nes-gxrom.cpp" #include "nes-hkrom.cpp" #include "nes-nrom.cpp" #include "nes-pxrom.cpp" #include "nes-sxrom.cpp" #include "nes-txrom.cpp" #include "nes-uxrom.cpp" #include "sunsoft-5b.cpp" uint8 Board::Memory::read(unsigned addr) const { return data[mirror(addr, size)]; } void Board::Memory::write(unsigned addr, uint8 byte) { if(writable) data[mirror(addr, size)] = byte; } unsigned Board::mirror(unsigned addr, unsigned size) { unsigned base = 0; if(size) { unsigned mask = 1 << 23; while(addr >= size) { while(!(addr & mask)) mask >>= 1; addr -= mask; if(size > mask) { size -= mask; base += mask; } mask >>= 1; } base += addr; } return base; } void Board::main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } cartridge.clock += 12 * 4095; tick(); } } void Board::tick() { cartridge.clock += 12; if(cartridge.clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cpu.thread); } uint8 Board::chr_read(unsigned addr) { if(chrram.size) return chrram.data[mirror(addr, chrram.size)]; if(chrrom.size) return chrrom.data[mirror(addr, chrrom.size)]; return 0u; } void Board::chr_write(unsigned addr, uint8 data) { if(chrram.size) chrram.data[mirror(addr, chrram.size)] = data; } void Board::power() { } void Board::reset() { } void Board::serialize(serializer& s) { if(prgram.size) s.array(prgram.data, prgram.size); if(chrram.size) s.array(chrram.data, chrram.size); } Board::Board(Markup::Node& document) { cartridge.board = this; auto cartridge = document["cartridge"]; information.type = cartridge["board/type"].data; information.battery = cartridge["prg/ram/name"].exists(); auto prom = cartridge["prg/rom"]; auto pram = cartridge["prg/ram"]; auto crom = cartridge["chr/rom"]; auto cram = cartridge["chr/ram"]; prgrom.size = numeral(prom["size"].data); prgram.size = numeral(pram["size"].data); chrrom.size = numeral(crom["size"].data); chrram.size = numeral(cram["size"].data); if(prgrom.size) prgrom.data = new uint8[prgrom.size](); if(prgram.size) prgram.data = new uint8[prgram.size](); if(chrrom.size) chrrom.data = new uint8[chrrom.size](); if(chrram.size) chrram.data = new uint8[chrram.size](); if(prom["name"].data) interface->loadRequest(ID::ProgramROM, prom["name"].data); if(pram["name"].data) interface->loadRequest(ID::ProgramRAM, pram["name"].data); if(crom["name"].data) interface->loadRequest(ID::CharacterROM, crom["name"].data); if(cram["name"].data) interface->loadRequest(ID::CharacterRAM, cram["name"].data); if(pram["name"].data) Famicom::cartridge.memory.append({ID::ProgramRAM, pram["name"].data}); if(cram["name"].data) Famicom::cartridge.memory.append({ID::CharacterRAM, cram["name"].data}); prgram.writable = true; chrram.writable = true; } Board::~Board() { } Board* Board::load(string manifest) { auto document = Markup::Document(manifest); cartridge.information.title = document["information/title"].text(); string type = document["cartridge/board/type"].text(); if(type == "BANDAI-FCG" ) return new BandaiFCG(document); if(type == "KONAMI-VRC-1") return new KonamiVRC1(document); if(type == "KONAMI-VRC-2") return new KonamiVRC2(document); if(type == "KONAMI-VRC-3") return new KonamiVRC3(document); if(type == "KONAMI-VRC-4") return new KonamiVRC4(document); if(type == "KONAMI-VRC-6") return new KonamiVRC6(document); if(type == "KONAMI-VRC-7") return new KonamiVRC7(document); if(type == "NES-AMROM" ) return new NES_AxROM(document); if(type == "NES-ANROM" ) return new NES_AxROM(document); if(type == "NES-AN1ROM" ) return new NES_AxROM(document); if(type == "NES-AOROM" ) return new NES_AxROM(document); if(type == "NES-BNROM" ) return new NES_BNROM(document); if(type == "NES-CNROM" ) return new NES_CNROM(document); if(type == "NES-EKROM" ) return new NES_ExROM(document); if(type == "NES-ELROM" ) return new NES_ExROM(document); if(type == "NES-ETROM" ) return new NES_ExROM(document); if(type == "NES-EWROM" ) return new NES_ExROM(document); if(type == "NES-FJROM" ) return new NES_FxROM(document); if(type == "NES-FKROM" ) return new NES_FxROM(document); if(type == "NES-GNROM" ) return new NES_GxROM(document); if(type == "NES-MHROM" ) return new NES_GxROM(document); if(type == "NES-HKROM" ) return new NES_HKROM(document); if(type == "NES-NROM" ) return new NES_NROM(document); if(type == "NES-NROM-128") return new NES_NROM(document); if(type == "NES-NROM-256") return new NES_NROM(document); if(type == "NES-PEEOROM" ) return new NES_PxROM(document); if(type == "NES-PNROM" ) return new NES_PxROM(document); if(type == "NES-SAROM" ) return new NES_SxROM(document); if(type == "NES-SBROM" ) return new NES_SxROM(document); if(type == "NES-SCROM" ) return new NES_SxROM(document); if(type == "NES-SC1ROM" ) return new NES_SxROM(document); if(type == "NES-SEROM" ) return new NES_SxROM(document); if(type == "NES-SFROM" ) return new NES_SxROM(document); if(type == "NES-SFEXPROM") return new NES_SxROM(document); if(type == "NES-SGROM" ) return new NES_SxROM(document); if(type == "NES-SHROM" ) return new NES_SxROM(document); if(type == "NES-SH1ROM" ) return new NES_SxROM(document); if(type == "NES-SIROM" ) return new NES_SxROM(document); if(type == "NES-SJROM" ) return new NES_SxROM(document); if(type == "NES-SKROM" ) return new NES_SxROM(document); if(type == "NES-SLROM" ) return new NES_SxROM(document); if(type == "NES-SL1ROM" ) return new NES_SxROM(document); if(type == "NES-SL2ROM" ) return new NES_SxROM(document); if(type == "NES-SL3ROM" ) return new NES_SxROM(document); if(type == "NES-SLRROM" ) return new NES_SxROM(document); if(type == "NES-SMROM" ) return new NES_SxROM(document); if(type == "NES-SNROM" ) return new NES_SxROM(document); if(type == "NES-SOROM" ) return new NES_SxROM(document); if(type == "NES-SUROM" ) return new NES_SxROM(document); if(type == "NES-SXROM" ) return new NES_SxROM(document); if(type == "NES-TBROM" ) return new NES_TxROM(document); if(type == "NES-TEROM" ) return new NES_TxROM(document); if(type == "NES-TFROM" ) return new NES_TxROM(document); if(type == "NES-TGROM" ) return new NES_TxROM(document); if(type == "NES-TKROM" ) return new NES_TxROM(document); if(type == "NES-TKSROM" ) return new NES_TxROM(document); if(type == "NES-TLROM" ) return new NES_TxROM(document); if(type == "NES-TL1ROM" ) return new NES_TxROM(document); if(type == "NES-TL2ROM" ) return new NES_TxROM(document); if(type == "NES-TLSROM" ) return new NES_TxROM(document); if(type == "NES-TNROM" ) return new NES_TxROM(document); if(type == "NES-TQROM" ) return new NES_TxROM(document); if(type == "NES-TR1ROM" ) return new NES_TxROM(document); if(type == "NES-TSROM" ) return new NES_TxROM(document); if(type == "NES-TVROM" ) return new NES_TxROM(document); if(type == "NES-UNROM" ) return new NES_UxROM(document); if(type == "NES-UOROM" ) return new NES_UxROM(document); if(type == "SUNSOFT-5B" ) return new Sunsoft5B(document); return nullptr; } gb/ppu/ppu.hpp000664 001750 001750 00000004046 12651764221 014425 0ustar00sergiosergio000000 000000 struct PPU : Thread, MMIO { uint8 vram[16384]; //GB = 8192, GBC = 16384 uint8 oam[160]; uint8 bgp[4]; uint8 obp[2][4]; uint8 bgpd[64]; uint8 obpd[64]; struct Status { unsigned lx; //$ff40 LCDC bool display_enable; bool window_tilemap_select; bool window_display_enable; bool bg_tiledata_select; bool bg_tilemap_select; bool ob_size; bool ob_enable; bool bg_enable; //$ff41 STAT bool interrupt_lyc; bool interrupt_oam; bool interrupt_vblank; bool interrupt_hblank; //$ff42 SCY uint8 scy; //$ff43 SCX uint8 scx; //$ff44 LY uint8 ly; //$ff45 LYC uint8 lyc; //$ff4a WY uint8 wy; //$ff4b WX uint8 wx; //$ff4f VBK bool vram_bank; //$ff68 BGPI bool bgpi_increment; uint6 bgpi; //$ff6a OBPI bool obpi_increment; uint8 obpi; } status; uint32 screen[160 * 144]; struct Pixel { uint16 color; uint8 palette; bool priority; }; Pixel bg; Pixel ob; struct Sprite { unsigned x; unsigned y; unsigned tile; unsigned attr; unsigned data; }; Sprite sprite[10]; unsigned sprites; unsigned px; struct Background { unsigned attr; unsigned data; }; Background background; Background window; static void Main(); void main(); void add_clocks(unsigned clocks); void scanline(); void frame(); unsigned hflip(unsigned data) const; //mmio.cpp unsigned vram_addr(uint16 addr) const; uint8 mmio_read(uint16 addr); void mmio_write(uint16 addr, uint8 data); //dmg.cpp void dmg_read_tile(bool select, unsigned x, unsigned y, unsigned& data); void dmg_scanline(); void dmg_run(); void dmg_run_bg(); void dmg_run_window(); void dmg_run_ob(); //cgb.cpp void cgb_read_tile(bool select, unsigned x, unsigned y, unsigned& attr, unsigned& data); void cgb_scanline(); void cgb_run(); void cgb_run_bg(); void cgb_run_window(); void cgb_run_ob(); void power(); void serialize(serializer&); PPU(); }; extern PPU ppu; nall/string/allocator/000700 001750 001750 00000000000 12656700342 016107 5ustar00sergiosergio000000 000000 ruby/video/opengl/program.hpp000664 001750 001750 00000007453 12651764221 017454 0ustar00sergiosergio000000 000000 void OpenGLProgram::bind(OpenGL* instance, const Markup::Node& node, const string& pathname) { filter = glrFilter(node["filter"].text()); wrap = glrWrap(node["wrap"].text()); modulo = glrModulo(node["modulo"].integer()); string w = node["width"].text(), h = node["height"].text(); if(w.endsWith("%")) relativeWidth = real(w.rtrim<1>("%")) / 100.0; else absoluteWidth = decimal(w); if(h.endsWith("%")) relativeHeight = real(h.rtrim<1>("%")) / 100.0; else absoluteHeight = decimal(h); format = glrFormat(node["format"].text()); program = glCreateProgram(); glGenFramebuffers(1, &framebuffer); if(file::exists({pathname, node["vertex"].text()})) { string source = file::read({pathname, node["vertex"].text()}); parse(instance, source); vertex = glrCreateShader(program, GL_VERTEX_SHADER, source); } else { vertex = glrCreateShader(program, GL_VERTEX_SHADER, OpenGLVertexShader); } if(file::exists({pathname, node["geometry"].text()})) { string source = file::read({pathname, node["geometry"].text()}); parse(instance, source); geometry = glrCreateShader(program, GL_GEOMETRY_SHADER, source); } else { //geometry shaders, when attached, must pass all vertex output through to the fragment shaders //geometry = glrCreateShader(program, GL_GEOMETRY_SHADER, OpenGLGeometryShader); } if(file::exists({pathname, node["fragment"].text()})) { string source = file::read({pathname, node["fragment"].text()}); parse(instance, source); fragment = glrCreateShader(program, GL_FRAGMENT_SHADER, source); } else { fragment = glrCreateShader(program, GL_FRAGMENT_SHADER, OpenGLFragmentShader); } for(auto& leaf : node.find("pixmap")) { nall::image image({pathname, leaf.text()}); image.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0); if(image.empty()) continue; GLuint texture; glGenTextures(1, &texture); unsigned n = pixmaps.size(); pixmaps(n).texture = texture; pixmaps(n).width = image.width; pixmaps(n).height = image.height; pixmaps(n).format = format; pixmaps(n).filter = filter; pixmaps(n).wrap = wrap; if(leaf["format"].exists()) pixmaps(n).format = glrFormat(leaf["format"].text()); if(leaf["filter"].exists()) pixmaps(n).filter = glrFilter(leaf["filter"].text()); if(leaf["wrap"].exists()) pixmaps(n).wrap = glrWrap(leaf["wrap"].text()); unsigned w = glrSize(image.width), h = glrSize(image.height); uint32_t* buffer = new uint32_t[w * h](); glBindTexture(GL_TEXTURE_2D, texture); glTexImage2D(GL_TEXTURE_2D, 0, pixmaps(n).format, w, h, 0, pixmaps(n).getFormat(), pixmaps(n).getType(), buffer); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, image.width, image.height, getFormat(), getType(), image.data); delete[] buffer; } OpenGLSurface::allocate(); glrLinkProgram(program); } //apply manifest settings to shader source #in tags void OpenGLProgram::parse(OpenGL* instance, string& source) { lstring lines = source.split("\n"); for(auto& line : lines) { string s = line; if(auto position = s.find("//")) s.resize(position()); //strip comments s.strip(); //remove extraneous whitespace if(s.match("#in ?*")) { s.ltrim<1>("#in ").strip(); if(auto setting = instance->settings.find({s})) { line = {"#define ", setting().name, " ", setting().value}; } else { line.reset(); //undefined variable (test in source with #ifdef) } } } source = lines.merge("\n"); } void OpenGLProgram::release() { OpenGLSurface::release(); for(auto& pixmap : pixmaps) glDeleteTextures(1, &pixmap.texture); pixmaps.reset(); width = 0; height = 0; format = GL_RGBA8; filter = GL_LINEAR; wrap = GL_CLAMP_TO_BORDER; phase = 0; modulo = 0; absoluteWidth = 0; absoluteHeight = 0; relativeWidth = 0; relativeHeight = 0; } sfc/chip/spc7110/000700 001750 001750 00000000000 12656700342 014467 5ustar00sergiosergio000000 000000 target-ethos/general/dip-switches.cpp000664 001750 001750 00000003162 12651764221 021044 0ustar00sergiosergio000000 000000 DipSwitches* dipSwitches = nullptr; DipSwitch::DipSwitch() { append(name, {100, 0}, 5); append(value, {~0, 0}); } DipSwitches::DipSwitches() { setTitle("DIP Switches"); layout.setMargin(5); accept.setText("Accept"); append(layout); for(auto& dipItem : dip) layout.append(dipItem, {~0, 0}, 5); layout.append(controlLayout, {~0, 0}); controlLayout.append(spacer, {~0, 0}); controlLayout.append(accept, {80, 0}); setGeometry({128, 128, 250, layout.minimumSize().height}); windowManager->append(this, "DipSwitches"); onClose = accept.onActivate = [&] { setModal(false); setVisible(false); }; } unsigned DipSwitches::run(const Markup::Node& node) { for(auto& dipItem : dip) { dipItem.name.setEnabled(false); dipItem.name.setText("(empty)"); dipItem.value.setEnabled(false); dipItem.value.reset(); dipItem.values.reset(); } unsigned index = 0; for(auto& setting : node) { if(setting.name != "setting") continue; dip[index].name.setEnabled(); dip[index].name.setText(setting["name"].data); dip[index].value.setEnabled(); for(auto& option : setting) { if(option.name != "option") continue; if(auto result = Eval::integer(option["value"].data)) { dip[index].value.append(option["name"].data); dip[index].values.append(result()); } } if(++index >= Slots) break; } setVisible(); accept.setFocused(); audio.clear(); setModal(); unsigned result = 0; for(auto& dipItem : dip) { if(dipItem.value.enabled() == false) continue; result |= dipItem.values[dipItem.value.selection()]; } return result; } phoenix/cocoa/action/item.hpp000664 001750 001750 00000000617 12651764221 017376 0ustar00sergiosergio000000 000000 @interface CocoaItem : NSMenuItem { @public phoenix::Item* item; } -(id) initWith:(phoenix::Item&)item; -(void) activate; @end namespace phoenix { struct pItem : public pAction { Item& item; CocoaItem* cocoaItem = nullptr; void setImage(const image& image); void setText(string text); pItem(Item& item) : pAction(item), item(item) {} void constructor(); void destructor(); }; } phoenix/reference/widget/button.hpp000664 001750 001750 00000000426 12651764221 020631 0ustar00sergiosergio000000 000000 namespace phoenix { struct pButton : public pWidget { Button& button; void setImage(const image& image, Orientation orientation); void setText(string text); pButton(Button& button) : pWidget(button), button(button) {} void constructor(); void destructor(); }; } nall/stream/zip.hpp000664 001750 001750 00000001317 12651764221 015446 0ustar00sergiosergio000000 000000 #ifndef NALL_STREAM_ZIP_HPP #define NALL_STREAM_ZIP_HPP #include namespace nall { struct zipstream : memorystream { using stream::read; using stream::write; zipstream(const stream& stream, const string& filter = "*") { unsigned size = stream.size(); uint8_t* data = new uint8_t[size]; stream.read(data, size); unzip archive; if(archive.open(data, size) == false) return; delete[] data; for(auto& file : archive.file) { if(file.name.match(filter)) { auto buffer = archive.extract(file); psize = buffer.size(); pdata = buffer.move(); return; } } } ~zipstream() { if(pdata) delete[] pdata; } }; } #endif nall/000700 001750 001750 00000000000 12656700342 012621 5ustar00sergiosergio000000 000000 phoenix/gtk/mouse.cpp000664 001750 001750 00000001372 12651764221 016006 0ustar00sergiosergio000000 000000 namespace phoenix { Position pMouse::position() { XlibWindow root, child; int rootx, rooty, winx, winy; unsigned int mask; XQueryPointer(pApplication::display, DefaultRootWindow(pApplication::display), &root, &child, &rootx, &rooty, &winx, &winy, &mask); return {rootx, rooty}; } bool pMouse::pressed(Mouse::Button button) { XlibWindow root, child; int rootx, rooty, winx, winy; unsigned int mask; XQueryPointer(pApplication::display, DefaultRootWindow(pApplication::display), &root, &child, &rootx, &rooty, &winx, &winy, &mask); switch(button) { case Mouse::Button::Left: return mask & Button1Mask; case Mouse::Button::Middle: return mask & Button2Mask; case Mouse::Button::Right: return mask & Button3Mask; } return false; } } profile/Super Famicom.sys/manifest.bml000664 001750 001750 00000000075 12651764221 021123 0ustar00sergiosergio000000 000000 system name:Super Famicom smp rom name=ipl.rom size=64 gba/cpu/state.hpp000664 001750 001750 00000000145 12651764221 015061 0ustar00sergiosergio000000 000000 struct Pending { struct DMA { bool vblank; bool hblank; bool hdma; } dma; } pending; phoenix/reference/message-window.cpp000664 001750 001750 00000000772 12651764221 020763 0ustar00sergiosergio000000 000000 namespace phoenix { MessageWindow::Response pMessageWindow::error(MessageWindow::State& state) { return MessageWindow::Response::Ok; } MessageWindow::Response pMessageWindow::information(MessageWindow::State& state) { return MessageWindow::Response::Ok; } MessageWindow::Response pMessageWindow::question(MessageWindow::State& state) { return MessageWindow::Response::Ok; } MessageWindow::Response pMessageWindow::warning(MessageWindow::State& state) { return MessageWindow::Response::Ok; } } fc/cartridge/board/000700 001750 001750 00000000000 12656700342 015316 5ustar00sergiosergio000000 000000 ruby/input/sdl.cpp000664 001750 001750 00000003077 12651764221 015325 0ustar00sergiosergio000000 000000 #include #include #include #include "keyboard/xlib.cpp" #include "mouse/xlib.cpp" #include "joypad/sdl.cpp" namespace ruby { struct pInputSDL { InputKeyboardXlib xlibKeyboard; InputMouseXlib xlibMouse; InputJoypadSDL sdl; struct Settings { uintptr_t handle = 0; } settings; bool cap(const string& name) { if(name == Input::Handle) return true; if(name == Input::KeyboardSupport) return true; if(name == Input::MouseSupport) return true; if(name == Input::JoypadSupport) return true; return false; } any get(const string& name) { if(name == Input::Handle) return (uintptr_t)settings.handle; return false; } bool set(const string& name, const any &value) { if(name == Input::Handle) { settings.handle = any_cast(value); return true; } return false; } bool acquire() { return xlibMouse.acquire(); } bool unacquire() { return xlibMouse.unacquire(); } bool acquired() { return xlibMouse.acquired(); } vector poll() { vector devices; xlibKeyboard.poll(devices); xlibMouse.poll(devices); sdl.poll(devices); return devices; } bool rumble(uint64_t id, bool enable) { return false; } bool init() { if(xlibKeyboard.init() == false) return false; if(xlibMouse.init(settings.handle) == false) return false; if(sdl.init() == false) return false; return true; } void term() { xlibKeyboard.term(); xlibMouse.term(); sdl.term(); } }; DeclareInput(SDL) } fc/cartridge/chip/chip.cpp000664 001750 001750 00000000434 12651764221 016617 0ustar00sergiosergio000000 000000 #include "mmc1.cpp" #include "mmc3.cpp" #include "mmc5.cpp" #include "mmc6.cpp" #include "vrc1.cpp" #include "vrc2.cpp" #include "vrc3.cpp" #include "vrc4.cpp" #include "vrc6.cpp" #include "vrc7.cpp" void Chip::tick() { board.tick(); } Chip::Chip(Board& board) : board(board) { } phoenix/qt/platform.cpp000664 001750 001750 00000002351 12651764221 016337 0ustar00sergiosergio000000 000000 #include "platform.moc.hpp" #include "platform.moc" #include "utility.cpp" #include "settings.cpp" #include "desktop.cpp" #include "monitor.cpp" #include "keyboard.cpp" #include "mouse.cpp" #include "browser-window.cpp" #include "message-window.cpp" #include "font.cpp" #include "timer.cpp" #include "window.cpp" #include "action/action.cpp" #include "action/menu.cpp" #include "action/separator.cpp" #include "action/item.cpp" #include "action/check-item.cpp" #include "action/radio-item.cpp" #include "widget/widget.cpp" #include "widget/button.cpp" #include "widget/canvas.cpp" #include "widget/check-button.cpp" #include "widget/check-label.cpp" #include "widget/combo-button.cpp" #include "widget/console.cpp" #include "widget/frame.cpp" #include "widget/hex-edit.cpp" #include "widget/horizontal-scroller.cpp" #include "widget/horizontal-slider.cpp" #include "widget/label.cpp" #include "widget/line-edit.cpp" #include "widget/list-view.cpp" #include "widget/progress-bar.cpp" #include "widget/radio-button.cpp" #include "widget/radio-label.cpp" #include "widget/tab-frame.cpp" #include "widget/text-edit.cpp" #include "widget/vertical-scroller.cpp" #include "widget/vertical-slider.cpp" #include "widget/viewport.cpp" #include "application.cpp" sfc/dsp/voice.cpp000664 001750 001750 00000007747 12651764221 015101 0ustar00sergiosergio000000 000000 #ifdef DSP_CPP inline void DSP::voice_output(voice_t& v, bool channel) { //apply left/right volume int amp = (state.t_output * (int8)VREG(voll + channel)) >> 7; //add to output total state.t_main_out[channel] += amp; state.t_main_out[channel] = sclamp<16>(state.t_main_out[channel]); //optionally add to echo total if(state.t_eon & v.vbit) { state.t_echo_out[channel] += amp; state.t_echo_out[channel] = sclamp<16>(state.t_echo_out[channel]); } } void DSP::voice_1(voice_t& v) { state.t_dir_addr = (state.t_dir << 8) + (state.t_srcn << 2); state.t_srcn = VREG(srcn); } void DSP::voice_2(voice_t& v) { //read sample pointer (ignored if not needed) uint16 addr = state.t_dir_addr; if(!v.kon_delay) addr += 2; uint8 lo = smp.apuram[(uint16)(addr + 0)]; uint8 hi = smp.apuram[(uint16)(addr + 1)]; state.t_brr_next_addr = ((hi << 8) + lo); state.t_adsr0 = VREG(adsr0); //read pitch, spread over two clocks state.t_pitch = VREG(pitchl); } void DSP::voice_3(voice_t& v) { voice_3a(v); voice_3b(v); voice_3c(v); } void DSP::voice_3a(voice_t& v) { state.t_pitch += (VREG(pitchh) & 0x3f) << 8; } void DSP::voice_3b(voice_t& v) { state.t_brr_byte = smp.apuram[(uint16)(v.brr_addr + v.brr_offset)]; state.t_brr_header = smp.apuram[(uint16)(v.brr_addr)]; } void DSP::voice_3c(voice_t& v) { //pitch modulation using previous voice's output if(state.t_pmon & v.vbit) { state.t_pitch += ((state.t_output >> 5) * state.t_pitch) >> 10; } if(v.kon_delay) { //get ready to start BRR decoding on next sample if(v.kon_delay == 5) { v.brr_addr = state.t_brr_next_addr; v.brr_offset = 1; v.buf_pos = 0; state.t_brr_header = 0; //header is ignored on this sample } //envelope is never run during KON v.env = 0; v.hidden_env = 0; //disable BRR decoding until last three samples v.interp_pos = 0; v.kon_delay--; if(v.kon_delay & 3) v.interp_pos = 0x4000; //pitch is never added during KON state.t_pitch = 0; } //gaussian interpolation int output = gaussian_interpolate(v); //noise if(state.t_non & v.vbit) { output = (int16)(state.noise << 1); } //apply envelope state.t_output = ((output * v.env) >> 11) & ~1; v.t_envx_out = v.env >> 4; //immediate silence due to end of sample or soft reset if(REG(flg) & 0x80 || (state.t_brr_header & 3) == 1) { v.env_mode = env_release; v.env = 0; } if(state.every_other_sample) { //KOFF if(state.t_koff & v.vbit) { v.env_mode = env_release; } //KON if(state.kon & v.vbit) { v.kon_delay = 5; v.env_mode = env_attack; } } //run envelope for next sample if(!v.kon_delay) envelope_run(v); } void DSP::voice_4(voice_t& v) { //decode BRR state.t_looped = 0; if(v.interp_pos >= 0x4000) { brr_decode(v); v.brr_offset += 2; if(v.brr_offset >= 9) { //start decoding next BRR block v.brr_addr = (uint16)(v.brr_addr + 9); if(state.t_brr_header & 1) { v.brr_addr = state.t_brr_next_addr; state.t_looped = v.vbit; } v.brr_offset = 1; } } //apply pitch v.interp_pos = (v.interp_pos & 0x3fff) + state.t_pitch; //keep from getting too far ahead (when using pitch modulation) if(v.interp_pos > 0x7fff) v.interp_pos = 0x7fff; //output left voice_output(v, 0); } void DSP::voice_5(voice_t& v) { //output right voice_output(v, 1); //ENDX, OUTX and ENVX won't update if you wrote to them 1-2 clocks earlier state.endx_buf = REG(endx) | state.t_looped; //clear bit in ENDX if KON just began if(v.kon_delay == 5) state.endx_buf &= ~v.vbit; } void DSP::voice_6(voice_t& v) { state.outx_buf = state.t_output >> 8; } void DSP::voice_7(voice_t& v) { //update ENDX REG(endx) = (uint8)state.endx_buf; state.envx_buf = v.t_envx_out; } void DSP::voice_8(voice_t& v) { //update OUTX VREG(outx) = (uint8)state.outx_buf; } void DSP::voice_9(voice_t& v) { //update ENVX VREG(envx) = (uint8)state.envx_buf; } #endif ruby/video/opengl/texture.hpp000664 001750 001750 00000000622 12651764221 017474 0ustar00sergiosergio000000 000000 GLuint OpenGLTexture::getFormat() const { if(format == GL_R32I) return GL_RED_INTEGER; if(format == GL_R32UI) return GL_RED_INTEGER; return GL_BGRA; } GLuint OpenGLTexture::getType() const { if(format == GL_R32I) return GL_UNSIGNED_INT; if(format == GL_R32UI) return GL_UNSIGNED_INT; if(format == GL_RGB10_A2) return GL_UNSIGNED_INT_2_10_10_10_REV; return GL_UNSIGNED_INT_8_8_8_8_REV; } phoenix/core/layout/fixed-layout.hpp000664 001750 001750 00000000727 12651764221 020760 0ustar00sergiosergio000000 000000 struct FixedLayout : Layout { void append(Sizable& sizable, Geometry geometry); void append(Sizable& sizable); Size minimumSize(); void remove(Sizable& sizable); void reset(); void setEnabled(bool enabled = true); void setGeometry(Geometry geometry); void setVisible(bool visible = true); void synchronizeLayout(); ~FixedLayout(); //private: struct Children { Sizable* sizable; Geometry geometry; }; nall::vector children; }; gb/cartridge/huc3/000700 001750 001750 00000000000 12656700342 015071 5ustar00sergiosergio000000 000000 gb/cartridge/huc1/000700 001750 001750 00000000000 12656700342 015067 5ustar00sergiosergio000000 000000 gba/video/video.cpp000664 001750 001750 00000004565 12651764221 015373 0ustar00sergiosergio000000 000000 #include namespace GameBoyAdvance { Video video; void Video::generate_palette(Emulator::Interface::PaletteMode mode) { for(unsigned color = 0; color < (1 << 15); color++) { if(mode == Emulator::Interface::PaletteMode::Literal) { palette[color] = color; continue; } unsigned B = (color >> 10) & 31; unsigned G = (color >> 5) & 31; unsigned R = (color >> 0) & 31; if(mode == Emulator::Interface::PaletteMode::Channel) { R = image::normalize(R, 5, 16); G = image::normalize(G, 5, 16); B = image::normalize(B, 5, 16); palette[color] = interface->videoColor(color, 0, R, G, B); continue; } if(mode == Emulator::Interface::PaletteMode::Standard) { R = image::normalize(R, 5, 16); G = image::normalize(G, 5, 16); B = image::normalize(B, 5, 16); palette[color] = interface->videoColor(color, 0, R, G, B); continue; } if(mode == Emulator::Interface::PaletteMode::Emulation) { R = curve[R]; G = curve[G]; B = curve[B]; unsigned Rr = R * 16; unsigned Gr = R * 4; unsigned Br = R * 4; unsigned Rg = G * 8; unsigned Gg = G * 16; unsigned Bg = G * 8; unsigned Rb = B * 0; //intentionally always zero unsigned Gb = B * 8; unsigned Bb = B * 16; if(Rr < Rg) std::swap(Rr, Rg); if(Rr < Rb) std::swap(Rr, Rb); if(Rg < Rb) std::swap(Rg, Rb); if(Gr < Gg) std::swap(Gr, Gg); if(Gr < Gb) std::swap(Gr, Gb); if(Gg < Gb) std::swap(Gg, Gb); if(Br < Bg) std::swap(Br, Bg); if(Br < Bb) std::swap(Br, Bb); if(Bg < Bb) std::swap(Bg, Bb); R = (((4 * Rr + 2 * Rg + Rb) * 160) >> 14) + 32; G = (((4 * Gr + 2 * Gg + Gb) * 160) >> 14) + 32; B = (((4 * Br + 2 * Bg + Bb) * 160) >> 14) + 32; R = image::normalize(R, 8, 16); G = image::normalize(G, 8, 16); B = image::normalize(B, 8, 16); palette[color] = interface->videoColor(color, 0, R, G, B); continue; } palette[color] = 0; } } Video::Video() { palette = new uint32_t[1 << 15](); } Video::~Video() { delete[] palette; } const uint8 Video::curve[32] = { 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1c, 0x20, 0x28, 0x38, 0x38, 0x40, 0x48, 0x50, 0x58, 0x60, 0x68, 0x70, 0x80, 0x88, 0x90, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0, }; } phoenix/cocoa/widget/canvas.hpp000664 001750 001750 00000002231 12651764221 017713 0ustar00sergiosergio000000 000000 @interface CocoaCanvas : NSImageView { @public phoenix::Canvas* canvas; } -(id) initWith:(phoenix::Canvas&)canvas; -(NSDragOperation) draggingEntered:(id)sender; -(BOOL) performDragOperation:(id)sender; -(void) mouseButton:(NSEvent*)event down:(BOOL)isDown; -(void) mouseExited:(NSEvent*)event; -(void) mouseMove:(NSEvent*)event; -(void) mouseDown:(NSEvent*)event; -(void) mouseUp:(NSEvent*)event; -(void) mouseDragged:(NSEvent*)event; -(void) rightMouseDown:(NSEvent*)event; -(void) rightMouseUp:(NSEvent*)event; -(void) rightMouseDragged:(NSEvent*)event; -(void) otherMouseDown:(NSEvent*)event; -(void) otherMouseUp:(NSEvent*)event; -(void) otherMouseDragged:(NSEvent*)event; @end namespace phoenix { struct pCanvas : public pWidget { Canvas& canvas; CocoaCanvas* cocoaCanvas = nullptr; unsigned surfaceWidth = 0; unsigned surfaceHeight = 0; void setDroppable(bool droppable); void setGeometry(Geometry geometry); void setMode(Canvas::Mode mode); void setSize(Size size); pCanvas(Canvas& canvas) : pWidget(canvas), canvas(canvas) {} void constructor(); void destructor(); void rasterize(); void redraw(); }; } sfc/chip/st0010/data.hpp000664 001750 001750 00000024540 12651764221 015764 0ustar00sergiosergio000000 000000 #ifdef ST0010_CPP const int16 ST0010::sin_table[256] = { 0x0000, 0x0324, 0x0648, 0x096a, 0x0c8c, 0x0fab, 0x12c8, 0x15e2, 0x18f9, 0x1c0b, 0x1f1a, 0x2223, 0x2528, 0x2826, 0x2b1f, 0x2e11, 0x30fb, 0x33df, 0x36ba, 0x398c, 0x3c56, 0x3f17, 0x41ce, 0x447a, 0x471c, 0x49b4, 0x4c3f, 0x4ebf, 0x5133, 0x539b, 0x55f5, 0x5842, 0x5a82, 0x5cb3, 0x5ed7, 0x60eb, 0x62f1, 0x64e8, 0x66cf, 0x68a6, 0x6a6d, 0x6c23, 0x6dc9, 0x6f5e, 0x70e2, 0x7254, 0x73b5, 0x7504, 0x7641, 0x776b, 0x7884, 0x7989, 0x7a7c, 0x7b5c, 0x7c29, 0x7ce3, 0x7d89, 0x7e1d, 0x7e9c, 0x7f09, 0x7f61, 0x7fa6, 0x7fd8, 0x7ff5, 0x7fff, 0x7ff5, 0x7fd8, 0x7fa6, 0x7f61, 0x7f09, 0x7e9c, 0x7e1d, 0x7d89, 0x7ce3, 0x7c29, 0x7b5c, 0x7a7c, 0x7989, 0x7884, 0x776b, 0x7641, 0x7504, 0x73b5, 0x7254, 0x70e2, 0x6f5e, 0x6dc9, 0x6c23, 0x6a6d, 0x68a6, 0x66cf, 0x64e8, 0x62f1, 0x60eb, 0x5ed7, 0x5cb3, 0x5a82, 0x5842, 0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4, 0x471c, 0x447a, 0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33df, 0x30fb, 0x2e11, 0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f1a, 0x1c0b, 0x18f8, 0x15e2, 0x12c8, 0x0fab, 0x0c8c, 0x096a, 0x0648, 0x0324, 0x0000, -0x0324, -0x0648, -0x096b, -0x0c8c, -0x0fab, -0x12c8, -0x15e2, -0x18f9, -0x1c0b, -0x1f1a, -0x2223, -0x2528, -0x2826, -0x2b1f, -0x2e11, -0x30fb, -0x33df, -0x36ba, -0x398d, -0x3c56, -0x3f17, -0x41ce, -0x447a, -0x471c, -0x49b4, -0x4c3f, -0x4ebf, -0x5133, -0x539b, -0x55f5, -0x5842, -0x5a82, -0x5cb3, -0x5ed7, -0x60ec, -0x62f1, -0x64e8, -0x66cf, -0x68a6, -0x6a6d, -0x6c23, -0x6dc9, -0x6f5e, -0x70e2, -0x7254, -0x73b5, -0x7504, -0x7641, -0x776b, -0x7884, -0x7989, -0x7a7c, -0x7b5c, -0x7c29, -0x7ce3, -0x7d89, -0x7e1d, -0x7e9c, -0x7f09, -0x7f61, -0x7fa6, -0x7fd8, -0x7ff5, -0x7fff, -0x7ff5, -0x7fd8, -0x7fa6, -0x7f61, -0x7f09, -0x7e9c, -0x7e1d, -0x7d89, -0x7ce3, -0x7c29, -0x7b5c, -0x7a7c, -0x7989, -0x7883, -0x776b, -0x7641, -0x7504, -0x73b5, -0x7254, -0x70e2, -0x6f5e, -0x6dc9, -0x6c23, -0x6a6d, -0x68a6, -0x66cf, -0x64e8, -0x62f1, -0x60eb, -0x5ed7, -0x5cb3, -0x5a82, -0x5842, -0x55f5, -0x539a, -0x5133, -0x4ebf, -0x4c3f, -0x49b3, -0x471c, -0x447a, -0x41cd, -0x3f17, -0x3c56, -0x398c, -0x36b9, -0x33de, -0x30fb, -0x2e10, -0x2b1f, -0x2826, -0x2527, -0x2223, -0x1f19, -0x1c0b, -0x18f8, -0x15e2, -0x12c8, -0x0fab, -0x0c8b, -0x096a, -0x0647, -0x0324 }; const int16 ST0010::mode7_scale[176] = { 0x0380, 0x0325, 0x02da, 0x029c, 0x0268, 0x023b, 0x0215, 0x01f3, 0x01d5, 0x01bb, 0x01a3, 0x018e, 0x017b, 0x016a, 0x015a, 0x014b, 0x013e, 0x0132, 0x0126, 0x011c, 0x0112, 0x0109, 0x0100, 0x00f8, 0x00f0, 0x00e9, 0x00e3, 0x00dc, 0x00d6, 0x00d1, 0x00cb, 0x00c6, 0x00c1, 0x00bd, 0x00b8, 0x00b4, 0x00b0, 0x00ac, 0x00a8, 0x00a5, 0x00a2, 0x009e, 0x009b, 0x0098, 0x0095, 0x0093, 0x0090, 0x008d, 0x008b, 0x0088, 0x0086, 0x0084, 0x0082, 0x0080, 0x007e, 0x007c, 0x007a, 0x0078, 0x0076, 0x0074, 0x0073, 0x0071, 0x006f, 0x006e, 0x006c, 0x006b, 0x0069, 0x0068, 0x0067, 0x0065, 0x0064, 0x0063, 0x0062, 0x0060, 0x005f, 0x005e, 0x005d, 0x005c, 0x005b, 0x005a, 0x0059, 0x0058, 0x0057, 0x0056, 0x0055, 0x0054, 0x0053, 0x0052, 0x0051, 0x0051, 0x0050, 0x004f, 0x004e, 0x004d, 0x004d, 0x004c, 0x004b, 0x004b, 0x004a, 0x0049, 0x0048, 0x0048, 0x0047, 0x0047, 0x0046, 0x0045, 0x0045, 0x0044, 0x0044, 0x0043, 0x0042, 0x0042, 0x0041, 0x0041, 0x0040, 0x0040, 0x003f, 0x003f, 0x003e, 0x003e, 0x003d, 0x003d, 0x003c, 0x003c, 0x003b, 0x003b, 0x003a, 0x003a, 0x003a, 0x0039, 0x0039, 0x0038, 0x0038, 0x0038, 0x0037, 0x0037, 0x0036, 0x0036, 0x0036, 0x0035, 0x0035, 0x0035, 0x0034, 0x0034, 0x0034, 0x0033, 0x0033, 0x0033, 0x0032, 0x0032, 0x0032, 0x0031, 0x0031, 0x0031, 0x0030, 0x0030, 0x0030, 0x0030, 0x002f, 0x002f, 0x002f, 0x002e, 0x002e, 0x002e, 0x002e, 0x002d, 0x002d, 0x002d, 0x002d, 0x002c, 0x002c, 0x002c, 0x002c, 0x002b, 0x002b, 0x002b }; const uint8 ST0010::arctan[32][32] = { { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, { 0x80, 0xa0, 0xad, 0xb3, 0xb6, 0xb8, 0xb9, 0xba, 0xbb, 0xbb, 0xbc, 0xbc, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbf, 0xbf, 0xbf, 0xbf }, { 0x80, 0x93, 0xa0, 0xa8, 0xad, 0xb0, 0xb3, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xb9, 0xba, 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd }, { 0x80, 0x8d, 0x98, 0xa0, 0xa6, 0xaa, 0xad, 0xb0, 0xb1, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb7, 0xb8, 0xb8, 0xb9, 0xb9, 0xba, 0xba, 0xba, 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbc, 0xbc, 0xbc, 0xbc }, { 0x80, 0x8a, 0x93, 0x9a, 0xa0, 0xa5, 0xa8, 0xab, 0xad, 0xaf, 0xb0, 0xb2, 0xb3, 0xb4, 0xb5, 0xb5, 0xb6, 0xb7, 0xb7, 0xb8, 0xb8, 0xb8, 0xb9, 0xb9, 0xb9, 0xba, 0xba, 0xba, 0xba, 0xba, 0xbb, 0xbb }, { 0x80, 0x88, 0x90, 0x96, 0x9b, 0xa0, 0xa4, 0xa7, 0xa9, 0xab, 0xad, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb4, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7, 0xb8, 0xb8, 0xb8, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9 }, { 0x80, 0x87, 0x8d, 0x93, 0x98, 0x9c, 0xa0, 0xa3, 0xa6, 0xa8, 0xaa, 0xac, 0xad, 0xae, 0xb0, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb4, 0xb5, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7, 0xb7, 0xb8, 0xb8, 0xb8 }, { 0x80, 0x86, 0x8b, 0x90, 0x95, 0x99, 0x9d, 0xa0, 0xa3, 0xa5, 0xa7, 0xa9, 0xaa, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb2, 0xb3, 0xb3, 0xb4, 0xb4, 0xb5, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7 }, { 0x80, 0x85, 0x8a, 0x8f, 0x93, 0x97, 0x9a, 0x9d, 0xa0, 0xa2, 0xa5, 0xa6, 0xa8, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb0, 0xb1, 0xb2, 0xb2, 0xb3, 0xb3, 0xb4, 0xb4, 0xb5, 0xb5, 0xb5, 0xb5 }, { 0x80, 0x85, 0x89, 0x8d, 0x91, 0x95, 0x98, 0x9b, 0x9e, 0xa0, 0xa0, 0xa4, 0xa6, 0xa7, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb0, 0xb1, 0xb1, 0xb2, 0xb2, 0xb3, 0xb3, 0xb4, 0xb4, 0xb4 }, { 0x80, 0x84, 0x88, 0x8c, 0x90, 0x93, 0x96, 0x99, 0x9b, 0x9e, 0xa0, 0xa2, 0xa4, 0xa5, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xaf, 0xb0, 0xb0, 0xb1, 0xb2, 0xb2, 0xb2, 0xb3, 0xb3 }, { 0x80, 0x84, 0x87, 0x8b, 0x8e, 0x91, 0x94, 0x97, 0x9a, 0x9c, 0x9e, 0xa0, 0xa2, 0xa3, 0xa5, 0xa6, 0xa7, 0xa9, 0xaa, 0xab, 0xac, 0xac, 0xad, 0xae, 0xae, 0xaf, 0xb0, 0xb0, 0xb1, 0xb1, 0xb2, 0xb2 }, { 0x80, 0x83, 0x87, 0x8a, 0x8d, 0x90, 0x93, 0x96, 0x98, 0x9a, 0x9c, 0x9e, 0xa0, 0xa2, 0xa3, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xac, 0xad, 0xae, 0xae, 0xaf, 0xb0, 0xb0, 0xb0, 0xb1 }, { 0x80, 0x83, 0x86, 0x89, 0x8c, 0x8f, 0x92, 0x94, 0x96, 0x99, 0x9b, 0x9d, 0x9e, 0xa0, 0xa2, 0xa3, 0xa4, 0xa5, 0xa7, 0xa8, 0xa9, 0xa9, 0xaa, 0xab, 0xac, 0xac, 0xad, 0xae, 0xae, 0xaf, 0xaf, 0xb0 }, { 0x80, 0x83, 0x86, 0x89, 0x8b, 0x8e, 0x90, 0x93, 0x95, 0x97, 0x99, 0x9b, 0x9d, 0x9e, 0xa0, 0xa1, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xaa, 0xab, 0xac, 0xad, 0xad, 0xae, 0xae, 0xaf }, { 0x80, 0x83, 0x85, 0x88, 0x8b, 0x8d, 0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9b, 0x9d, 0x9f, 0xa0, 0xa1, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa8, 0xa9, 0xaa, 0xab, 0xab, 0xac, 0xad, 0xad, 0xae }, { 0x80, 0x83, 0x85, 0x88, 0x8a, 0x8c, 0x8f, 0x91, 0x93, 0x95, 0x97, 0x99, 0x9a, 0x9c, 0x9d, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa5, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xaa, 0xab, 0xab, 0xac, 0xad }, { 0x80, 0x82, 0x85, 0x87, 0x89, 0x8c, 0x8e, 0x90, 0x92, 0x94, 0x96, 0x97, 0x99, 0x9b, 0x9c, 0x9d, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa8, 0xa9, 0xaa, 0xaa, 0xab, 0xac }, { 0x80, 0x82, 0x85, 0x87, 0x89, 0x8b, 0x8d, 0x8f, 0x91, 0x93, 0x95, 0x96, 0x98, 0x99, 0x9b, 0x9c, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa7, 0xa8, 0xa9, 0xa9, 0xaa, 0xab }, { 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e, 0x90, 0x92, 0x94, 0x95, 0x97, 0x98, 0x9a, 0x9b, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa6, 0xa7, 0xa8, 0xa8, 0xa9, 0xaa }, { 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e, 0x90, 0x91, 0x93, 0x94, 0x96, 0x97, 0x99, 0x9a, 0x9b, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5, 0xa6, 0xa7, 0xa7, 0xa8, 0xa9 }, { 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8b, 0x8d, 0x8f, 0x90, 0x92, 0x94, 0x95, 0x97, 0x98, 0x99, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa4, 0xa5, 0xa6, 0xa6, 0xa7, 0xa8 }, { 0x80, 0x82, 0x84, 0x86, 0x87, 0x89, 0x8b, 0x8d, 0x8e, 0x90, 0x91, 0x93, 0x94, 0x96, 0x97, 0x98, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa3, 0xa4, 0xa5, 0xa6, 0xa6, 0xa7 }, { 0x80, 0x82, 0x84, 0x85, 0x87, 0x89, 0x8a, 0x8c, 0x8e, 0x8f, 0x91, 0x92, 0x94, 0x95, 0x96, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5, 0xa6 }, { 0x80, 0x82, 0x83, 0x85, 0x87, 0x88, 0x8a, 0x8c, 0x8d, 0x8f, 0x90, 0x92, 0x93, 0x94, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5 }, { 0x80, 0x82, 0x83, 0x85, 0x86, 0x88, 0x8a, 0x8b, 0x8d, 0x8e, 0x90, 0x91, 0x92, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa2, 0xa3, 0xa4, 0xa4 }, { 0x80, 0x82, 0x83, 0x85, 0x86, 0x88, 0x89, 0x8b, 0x8c, 0x8e, 0x8f, 0x90, 0x92, 0x93, 0x94, 0x95, 0x96, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa2, 0xa3, 0xa4 }, { 0x80, 0x82, 0x83, 0x85, 0x86, 0x87, 0x89, 0x8a, 0x8c, 0x8d, 0x8e, 0x90, 0x91, 0x92, 0x93, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9e, 0x9f, 0xa0, 0xa1, 0xa1, 0xa2, 0xa3 }, { 0x80, 0x81, 0x83, 0x84, 0x86, 0x87, 0x89, 0x8a, 0x8b, 0x8d, 0x8e, 0x8f, 0x90, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9e, 0x9f, 0xa0, 0xa1, 0xa1, 0xa2 }, { 0x80, 0x81, 0x83, 0x84, 0x86, 0x87, 0x88, 0x8a, 0x8b, 0x8c, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0x9f, 0xa0, 0xa1, 0xa1 }, { 0x80, 0x81, 0x83, 0x84, 0x85, 0x87, 0x88, 0x89, 0x8b, 0x8c, 0x8d, 0x8e, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0x9f, 0xa0, 0xa1 }, { 0x80, 0x81, 0x83, 0x84, 0x85, 0x87, 0x88, 0x89, 0x8a, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9c, 0x9d, 0x9e, 0x9f, 0x9f, 0xa0 } }; #endif sfc/cartridge/serialization.cpp000664 001750 001750 00000000156 12651764221 020012 0ustar00sergiosergio000000 000000 #ifdef CARTRIDGE_CPP void Cartridge::serialize(serializer& s) { s.array(ram.data(), ram.size()); } #endif sfc/chip/sa1/bus/000700 001750 001750 00000000000 12656700342 014646 5ustar00sergiosergio000000 000000 processor/r65816/algorithms.cpp000664 001750 001750 00000016461 12651764221 017467 0ustar00sergiosergio000000 000000 inline void R65816::op_adc_b() { int result; if(!regs.p.d) { result = regs.a.l + rd.l + regs.p.c; } else { result = (regs.a.l & 0x0f) + (rd.l & 0x0f) + (regs.p.c << 0); if(result > 0x09) result += 0x06; regs.p.c = result > 0x0f; result = (regs.a.l & 0xf0) + (rd.l & 0xf0) + (regs.p.c << 4) + (result & 0x0f); } regs.p.v = ~(regs.a.l ^ rd.l) & (regs.a.l ^ result) & 0x80; if(regs.p.d && result > 0x9f) result += 0x60; regs.p.c = result > 0xff; regs.p.n = result & 0x80; regs.p.z = (uint8_t)result == 0; regs.a.l = result; } inline void R65816::op_adc_w() { int result; if(!regs.p.d) { result = regs.a.w + rd.w + regs.p.c; } else { result = (regs.a.w & 0x000f) + (rd.w & 0x000f) + (regs.p.c << 0); if(result > 0x0009) result += 0x0006; regs.p.c = result > 0x000f; result = (regs.a.w & 0x00f0) + (rd.w & 0x00f0) + (regs.p.c << 4) + (result & 0x000f); if(result > 0x009f) result += 0x0060; regs.p.c = result > 0x00ff; result = (regs.a.w & 0x0f00) + (rd.w & 0x0f00) + (regs.p.c << 8) + (result & 0x00ff); if(result > 0x09ff) result += 0x0600; regs.p.c = result > 0x0fff; result = (regs.a.w & 0xf000) + (rd.w & 0xf000) + (regs.p.c << 12) + (result & 0x0fff); } regs.p.v = ~(regs.a.w ^ rd.w) & (regs.a.w ^ result) & 0x8000; if(regs.p.d && result > 0x9fff) result += 0x6000; regs.p.c = result > 0xffff; regs.p.n = result & 0x8000; regs.p.z = (uint16_t)result == 0; regs.a.w = result; } inline void R65816::op_and_b() { regs.a.l &= rd.l; regs.p.n = regs.a.l & 0x80; regs.p.z = regs.a.l == 0; } inline void R65816::op_and_w() { regs.a.w &= rd.w; regs.p.n = regs.a.w & 0x8000; regs.p.z = regs.a.w == 0; } inline void R65816::op_bit_b() { regs.p.n = rd.l & 0x80; regs.p.v = rd.l & 0x40; regs.p.z = (rd.l & regs.a.l) == 0; } inline void R65816::op_bit_w() { regs.p.n = rd.w & 0x8000; regs.p.v = rd.w & 0x4000; regs.p.z = (rd.w & regs.a.w) == 0; } inline void R65816::op_cmp_b() { int r = regs.a.l - rd.l; regs.p.n = r & 0x80; regs.p.z = (uint8)r == 0; regs.p.c = r >= 0; } inline void R65816::op_cmp_w() { int r = regs.a.w - rd.w; regs.p.n = r & 0x8000; regs.p.z = (uint16)r == 0; regs.p.c = r >= 0; } inline void R65816::op_cpx_b() { int r = regs.x.l - rd.l; regs.p.n = r & 0x80; regs.p.z = (uint8)r == 0; regs.p.c = r >= 0; } inline void R65816::op_cpx_w() { int r = regs.x.w - rd.w; regs.p.n = r & 0x8000; regs.p.z = (uint16)r == 0; regs.p.c = r >= 0; } inline void R65816::op_cpy_b() { int r = regs.y.l - rd.l; regs.p.n = r & 0x80; regs.p.z = (uint8)r == 0; regs.p.c = r >= 0; } inline void R65816::op_cpy_w() { int r = regs.y.w - rd.w; regs.p.n = r & 0x8000; regs.p.z = (uint16)r == 0; regs.p.c = r >= 0; } inline void R65816::op_eor_b() { regs.a.l ^= rd.l; regs.p.n = regs.a.l & 0x80; regs.p.z = regs.a.l == 0; } inline void R65816::op_eor_w() { regs.a.w ^= rd.w; regs.p.n = regs.a.w & 0x8000; regs.p.z = regs.a.w == 0; } inline void R65816::op_lda_b() { regs.a.l = rd.l; regs.p.n = regs.a.l & 0x80; regs.p.z = regs.a.l == 0; } inline void R65816::op_lda_w() { regs.a.w = rd.w; regs.p.n = regs.a.w & 0x8000; regs.p.z = regs.a.w == 0; } inline void R65816::op_ldx_b() { regs.x.l = rd.l; regs.p.n = regs.x.l & 0x80; regs.p.z = regs.x.l == 0; } inline void R65816::op_ldx_w() { regs.x.w = rd.w; regs.p.n = regs.x.w & 0x8000; regs.p.z = regs.x.w == 0; } inline void R65816::op_ldy_b() { regs.y.l = rd.l; regs.p.n = regs.y.l & 0x80; regs.p.z = regs.y.l == 0; } inline void R65816::op_ldy_w() { regs.y.w = rd.w; regs.p.n = regs.y.w & 0x8000; regs.p.z = regs.y.w == 0; } inline void R65816::op_ora_b() { regs.a.l |= rd.l; regs.p.n = regs.a.l & 0x80; regs.p.z = regs.a.l == 0; } inline void R65816::op_ora_w() { regs.a.w |= rd.w; regs.p.n = regs.a.w & 0x8000; regs.p.z = regs.a.w == 0; } inline void R65816::op_sbc_b() { int result; rd.l ^= 0xff; if(!regs.p.d) { result = regs.a.l + rd.l + regs.p.c; } else { result = (regs.a.l & 0x0f) + (rd.l & 0x0f) + (regs.p.c << 0); if(result <= 0x0f) result -= 0x06; regs.p.c = result > 0x0f; result = (regs.a.l & 0xf0) + (rd.l & 0xf0) + (regs.p.c << 4) + (result & 0x0f); } regs.p.v = ~(regs.a.l ^ rd.l) & (regs.a.l ^ result) & 0x80; if(regs.p.d && result <= 0xff) result -= 0x60; regs.p.c = result > 0xff; regs.p.n = result & 0x80; regs.p.z = (uint8_t)result == 0; regs.a.l = result; } inline void R65816::op_sbc_w() { int result; rd.w ^= 0xffff; if(!regs.p.d) { result = regs.a.w + rd.w + regs.p.c; } else { result = (regs.a.w & 0x000f) + (rd.w & 0x000f) + (regs.p.c << 0); if(result <= 0x000f) result -= 0x0006; regs.p.c = result > 0x000f; result = (regs.a.w & 0x00f0) + (rd.w & 0x00f0) + (regs.p.c << 4) + (result & 0x000f); if(result <= 0x00ff) result -= 0x0060; regs.p.c = result > 0x00ff; result = (regs.a.w & 0x0f00) + (rd.w & 0x0f00) + (regs.p.c << 8) + (result & 0x00ff); if(result <= 0x0fff) result -= 0x0600; regs.p.c = result > 0x0fff; result = (regs.a.w & 0xf000) + (rd.w & 0xf000) + (regs.p.c << 12) + (result & 0x0fff); } regs.p.v = ~(regs.a.w ^ rd.w) & (regs.a.w ^ result) & 0x8000; if(regs.p.d && result <= 0xffff) result -= 0x6000; regs.p.c = result > 0xffff; regs.p.n = result & 0x8000; regs.p.z = (uint16_t)result == 0; regs.a.w = result; } inline void R65816::op_inc_b() { rd.l++; regs.p.n = rd.l & 0x80; regs.p.z = rd.l == 0; } inline void R65816::op_inc_w() { rd.w++; regs.p.n = rd.w & 0x8000; regs.p.z = rd.w == 0; } inline void R65816::op_dec_b() { rd.l--; regs.p.n = rd.l & 0x80; regs.p.z = rd.l == 0; } inline void R65816::op_dec_w() { rd.w--; regs.p.n = rd.w & 0x8000; regs.p.z = rd.w == 0; } inline void R65816::op_asl_b() { regs.p.c = rd.l & 0x80; rd.l <<= 1; regs.p.n = rd.l & 0x80; regs.p.z = rd.l == 0; } inline void R65816::op_asl_w() { regs.p.c = rd.w & 0x8000; rd.w <<= 1; regs.p.n = rd.w & 0x8000; regs.p.z = rd.w == 0; } inline void R65816::op_lsr_b() { regs.p.c = rd.l & 1; rd.l >>= 1; regs.p.n = rd.l & 0x80; regs.p.z = rd.l == 0; } inline void R65816::op_lsr_w() { regs.p.c = rd.w & 1; rd.w >>= 1; regs.p.n = rd.w & 0x8000; regs.p.z = rd.w == 0; } inline void R65816::op_rol_b() { unsigned carry = (unsigned)regs.p.c; regs.p.c = rd.l & 0x80; rd.l = (rd.l << 1) | carry; regs.p.n = rd.l & 0x80; regs.p.z = rd.l == 0; } inline void R65816::op_rol_w() { unsigned carry = (unsigned)regs.p.c; regs.p.c = rd.w & 0x8000; rd.w = (rd.w << 1) | carry; regs.p.n = rd.w & 0x8000; regs.p.z = rd.w == 0; } inline void R65816::op_ror_b() { unsigned carry = (unsigned)regs.p.c << 7; regs.p.c = rd.l & 1; rd.l = carry | (rd.l >> 1); regs.p.n = rd.l & 0x80; regs.p.z = rd.l == 0; } inline void R65816::op_ror_w() { unsigned carry = (unsigned)regs.p.c << 15; regs.p.c = rd.w & 1; rd.w = carry | (rd.w >> 1); regs.p.n = rd.w & 0x8000; regs.p.z = rd.w == 0; } inline void R65816::op_trb_b() { regs.p.z = (rd.l & regs.a.l) == 0; rd.l &= ~regs.a.l; } inline void R65816::op_trb_w() { regs.p.z = (rd.w & regs.a.w) == 0; rd.w &= ~regs.a.w; } inline void R65816::op_tsb_b() { regs.p.z = (rd.l & regs.a.l) == 0; rd.l |= regs.a.l; } inline void R65816::op_tsb_w() { regs.p.z = (rd.w & regs.a.w) == 0; rd.w |= regs.a.w; } phoenix/reference/widget/horizontal-slider.cpp000664 001750 001750 00000000340 12651764221 022755 0ustar00sergiosergio000000 000000 namespace phoenix { void pHorizontalSlider::setLength(unsigned length) { } void pHorizontalSlider::setPosition(unsigned position) { } void pHorizontalSlider::constructor() { } void pHorizontalSlider::destructor() { } } sfc/chip/sa1/memory/memory.hpp000664 001750 001750 00000001061 12651764221 017421 0ustar00sergiosergio000000 000000 uint8 bus_read(unsigned addr); void bus_write(unsigned addr, uint8 data); uint8 vbr_read(unsigned addr); alwaysinline void op_io(); alwaysinline uint8 op_read(unsigned addr); alwaysinline void op_write(unsigned addr, uint8 data); uint8 mmcrom_read(unsigned addr); void mmcrom_write(unsigned addr, uint8 data); uint8 mmcbwram_read(unsigned addr); void mmcbwram_write(unsigned addr, uint8 data); uint8 mmc_sa1_read(unsigned addr); void mmc_sa1_write(unsigned addr, uint8 data); uint8 bitmap_read(unsigned addr); void bitmap_write(unsigned addr, uint8 data); target-ethos/resource/resource.bml000664 001750 001750 00000001021 12651764221 020462 0ustar00sergiosergio000000 000000 resource name=resource binary id=advanced name=advanced.png binary id=audio name=audio.png binary id=cheatEditor name=cheat-editor.png binary id=folder name=folder.png binary id=game name=game.png binary id=home name=home.png binary id=hotkeys name=hotkeys.png binary id=input name=input.png binary id=server name=server.png binary id=stateManager name=state-manager.png binary id=timing name=timing.png binary id=unverified name=unverified.png binary id=up name=up.png binary id=video name=video.png phoenix/reference/widget/console.hpp000664 001750 001750 00000000357 12651764221 020763 0ustar00sergiosergio000000 000000 namespace phoenix { struct pConsole : public pWidget { Console& console; void print(string text); void reset(); pConsole(Console& console) : pWidget(console), console(console) {} void constructor(); void destructor(); }; } ananke/resource/file.png000664 001750 001750 00000001514 12651764221 016422 0ustar00sergiosergio000000 000000 PNG  IHDR szzsBIT|dIDATXOn08Q't$e]%.+\(RY$TL;,Z[g2;>Ɋx%{tCe7@BJskmh]ׅk_v]} q}qqQ=xy~uyyy ,nnooB W)%J)R!PJnZ}!i~2!Dh@X7NucFmMp΅ b&(0*<ι 1(Mrkmϱ)Zda $齵<)˒.[| 1EA]dYF2X{i7`mU_ `ʄ)#>ڶnqӣHB4 ZP\aҬ%]/*,CIe9?‹%MZ*auaq\̀2gK x@>)& վ{EiusnV !ȲsrxO(F@J CRjuYq( xҪ/6{:V"P%`P``1&0Ģ ,{`mێ$_Zkb cMš4 `%O<臇kRw?A>X$8_GRRYӹ(x) xsP.2 makestream(const string& path) { if(path.ibeginsWith("http://")) return std::unique_ptr(new httpstream(path, 80)); if(path.iendsWith(".gz")) return std::unique_ptr(new gzipstream(filestream{path})); if(path.iendsWith(".zip")) return std::unique_ptr(new zipstream(filestream{path})); return std::unique_ptr(new mmapstream(path)); } inline std::unique_ptr makestream(uint8_t* data, unsigned size) { return std::unique_ptr(new memorystream(data, size)); } inline std::unique_ptr makestream(const uint8_t* data, unsigned size) { return std::unique_ptr(new memorystream(data, size)); } } #endif sfc/chip/sharprtc/sharprtc.cpp000664 001750 001750 00000004717 12651764221 017577 0ustar00sergiosergio000000 000000 #include #define SHARPRTC_CPP namespace SuperFamicom { #include "memory.cpp" #include "time.cpp" #include "serialization.cpp" SharpRTC sharprtc; void SharpRTC::Enter() { sharprtc.enter(); } void SharpRTC::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } tick_second(); step(1); synchronize_cpu(); } } void SharpRTC::init() { } void SharpRTC::load() { return; second = 0; minute = 0; hour = 0; day = 0; month = 0; year = 0; weekday = 0; } void SharpRTC::unload() { } void SharpRTC::power() { } void SharpRTC::reset() { create(SharpRTC::Enter, 1); rtc_state = State::Read; rtc_index = -1; } void SharpRTC::sync() { time_t systime = time(0); tm* timeinfo = localtime(&systime); second = min(59, timeinfo->tm_sec); minute = timeinfo->tm_min; hour = timeinfo->tm_hour; day = timeinfo->tm_mday; month = 1 + timeinfo->tm_mon; year = 900 + timeinfo->tm_year; weekday = timeinfo->tm_wday; } uint8 SharpRTC::read(unsigned addr) { addr &= 1; if(addr == 0) { if(rtc_state != State::Read) return 0; if(rtc_index < 0) { rtc_index++; return 15; } else if(rtc_index > 12) { rtc_index = -1; return 15; } else { return rtc_read(rtc_index++); } } return cpu.regs.mdr; } void SharpRTC::write(unsigned addr, uint8 data) { addr &= 1, data &= 15; if(addr == 1) { if(data == 0x0d) { rtc_state = State::Read; rtc_index = -1; return; } if(data == 0x0e) { rtc_state = State::Command; return; } if(data == 0x0f) return; //unknown behavior if(rtc_state == State::Command) { if(data == 0) { rtc_state = State::Write; rtc_index = 0; } else if(data == 4) { rtc_state = State::Ready; rtc_index = -1; //reset time second = 0; minute = 0; hour = 0; day = 0; month = 0; year = 0; weekday = 0; } else { //unknown behavior rtc_state = State::Ready; } return; } if(rtc_state == State::Write) { if(rtc_index >= 0 && rtc_index < 12) { rtc_write(rtc_index++, data); if(rtc_index == 12) { //day of week is automatically calculated and written weekday = calculate_weekday(1000 + year, month, day); } } return; } } } } ruby/input/keyboard/xlib.cpp000664 001750 001750 00000011430 12651764221 017271 0ustar00sergiosergio000000 000000 #ifndef RUBY_INPUT_KEYBOARD_XLIB #define RUBY_INPUT_KEYBOARD_XLIB namespace ruby { struct InputKeyboardXlib { HID::Keyboard hid; Display* display = nullptr; struct Key { string name; unsigned keysym; unsigned keycode; }; vector keys; void assign(unsigned inputID, bool value) { auto& group = hid.group[HID::Keyboard::GroupID::Button]; if(group.input[inputID].value == value) return; if(input.onChange) input.onChange(hid, HID::Keyboard::GroupID::Button, inputID, group.input[inputID].value, value); group.input[inputID].value = value; } void poll(vector& devices) { char state[32]; XQueryKeymap(display, state); for(unsigned n = 0; n < keys.size(); n++) { bool value = state[keys[n].keycode >> 3] & (1 << (keys[n].keycode & 7)); assign(n, value); } devices.append(&hid); } bool init() { display = XOpenDisplay(0); keys.append({"Escape", XK_Escape}); keys.append({"F1", XK_F1}); keys.append({"F2", XK_F2}); keys.append({"F3", XK_F3}); keys.append({"F4", XK_F4}); keys.append({"F5", XK_F5}); keys.append({"F6", XK_F6}); keys.append({"F7", XK_F7}); keys.append({"F8", XK_F8}); keys.append({"F9", XK_F9}); keys.append({"F10", XK_F10}); keys.append({"F11", XK_F11}); keys.append({"F12", XK_F12}); keys.append({"ScrollLock", XK_Scroll_Lock}); keys.append({"Pause", XK_Pause}); keys.append({"Tilde", XK_asciitilde}); keys.append({"Num0", XK_0}); keys.append({"Num1", XK_1}); keys.append({"Num2", XK_2}); keys.append({"Num3", XK_3}); keys.append({"Num4", XK_4}); keys.append({"Num5", XK_5}); keys.append({"Num6", XK_6}); keys.append({"Num7", XK_7}); keys.append({"Num8", XK_8}); keys.append({"Num9", XK_9}); keys.append({"Dash", XK_minus}); keys.append({"Equal", XK_equal}); keys.append({"Backspace", XK_BackSpace}); keys.append({"Insert", XK_Insert}); keys.append({"Delete", XK_Delete}); keys.append({"Home", XK_Home}); keys.append({"End", XK_End}); keys.append({"PageUp", XK_Prior}); keys.append({"PageDown", XK_Next}); keys.append({"A", XK_A}); keys.append({"B", XK_B}); keys.append({"C", XK_C}); keys.append({"D", XK_D}); keys.append({"E", XK_E}); keys.append({"F", XK_F}); keys.append({"G", XK_G}); keys.append({"H", XK_H}); keys.append({"I", XK_I}); keys.append({"J", XK_J}); keys.append({"K", XK_K}); keys.append({"L", XK_L}); keys.append({"M", XK_M}); keys.append({"N", XK_N}); keys.append({"O", XK_O}); keys.append({"P", XK_P}); keys.append({"Q", XK_Q}); keys.append({"R", XK_R}); keys.append({"S", XK_S}); keys.append({"T", XK_T}); keys.append({"U", XK_U}); keys.append({"V", XK_V}); keys.append({"W", XK_W}); keys.append({"X", XK_X}); keys.append({"Y", XK_Y}); keys.append({"Z", XK_Z}); keys.append({"LeftBracket", XK_bracketleft}); keys.append({"RightBracket", XK_bracketright}); keys.append({"Backslash", XK_backslash}); keys.append({"Semicolon", XK_semicolon}); keys.append({"Apostrophe", XK_apostrophe}); keys.append({"Comma", XK_comma}); keys.append({"Period", XK_period}); keys.append({"Slash", XK_slash}); keys.append({"Keypad0", XK_KP_0}); keys.append({"Keypad1", XK_KP_1}); keys.append({"Keypad2", XK_KP_2}); keys.append({"Keypad3", XK_KP_3}); keys.append({"Keypad4", XK_KP_4}); keys.append({"Keypad5", XK_KP_5}); keys.append({"Keypad6", XK_KP_6}); keys.append({"Keypad7", XK_KP_7}); keys.append({"Keypad8", XK_KP_8}); keys.append({"Keypad9", XK_KP_9}); keys.append({"Add", XK_KP_Add}); keys.append({"Subtract", XK_KP_Subtract}); keys.append({"Multiply", XK_KP_Multiply}); keys.append({"Divide", XK_KP_Divide}); keys.append({"Enter", XK_KP_Enter}); keys.append({"Up", XK_Up}); keys.append({"Down", XK_Down}); keys.append({"Left", XK_Left}); keys.append({"Right", XK_Right}); keys.append({"Tab", XK_Tab}); keys.append({"Return", XK_Return}); keys.append({"Spacebar", XK_space}); keys.append({"LeftControl", XK_Control_L}); keys.append({"RightControl", XK_Control_R}); keys.append({"LeftAlt", XK_Alt_L}); keys.append({"RightAlt", XK_Alt_R}); keys.append({"LeftShift", XK_Shift_L}); keys.append({"RightShift", XK_Shift_R}); keys.append({"LeftSuper", XK_Super_L}); keys.append({"RightSuper", XK_Super_R}); keys.append({"Menu", XK_Menu}); hid.id = 1; for(unsigned n = 0; n < keys.size(); n++) { hid.button().append(keys[n].name); keys[n].keycode = XKeysymToKeycode(display, keys[n].keysym); } return true; } void term() { if(display) { XCloseDisplay(display); display = nullptr; } } }; } #endif phoenix/reference/desktop.hpp000664 001750 001750 00000000142 12651764221 017477 0ustar00sergiosergio000000 000000 namespace phoenix { struct pDesktop { static Size size(); static Geometry workspace(); }; } target-ethos/resource/folder.png000664 001750 001750 00000002230 12651764221 020123 0ustar00sergiosergio000000 000000 PNG  IHDR szzsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<IDATX=oE3w{90 V !SnZ:>@$>@JDhCH@ɊE(wޗ{:wrR(Kvvvy~<3" C^k_nܸ+~6ƼwBZÇ\@[J坛7oIZ 0?;wѣG+PJejtp-5!Gh,ĥKc֞ \̄jZ?<aTnH(sd<TZeDKȍE-n/D[ZT J>D%T/l,4> SzQJ  cѿBS^/| 6kd%5J_<^TR N R8ݝ;>3$!J WToV)iR $UziU*$AX;XhbggDbpdDC$v- xxQˡLgX?515k`mZt8)\ȍ1*Kky>:a[BH `|S@ 0 ,-27+IENDB`shaders/Curvature.shader/000700 001750 001750 00000000000 12656700342 016551 5ustar00sergiosergio000000 000000 target-ethos/000700 001750 001750 00000000000 12656700342 014301 5ustar00sergiosergio000000 000000 gb/cpu/memory.cpp000664 001750 001750 00000002004 12651764221 015077 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP void CPU::op_io() { cycle_edge(); add_clocks(4); } uint8 CPU::op_read(uint16 addr) { cycle_edge(); add_clocks(4); if(oamdma.active && (addr < 0xff80 || addr == 0xffff)) return 0x00; return bus.read(addr); } void CPU::op_write(uint16 addr, uint8 data) { cycle_edge(); add_clocks(4); if(oamdma.active && (addr < 0xff80 || addr == 0xffff)) return; bus.write(addr, data); } void CPU::cycle_edge() { if(r.ei) { r.ei = false; r.ime = 1; } } //VRAM DMA source can only be ROM or RAM uint8 CPU::dma_read(uint16 addr) { if(addr < 0x8000) return bus.read(addr); //0000-7fff if(addr < 0xa000) return 0x00; //8000-9fff if(addr < 0xe000) return bus.read(addr); //a000-dfff return 0x00; //e000-ffff } //VRAM DMA target is always VRAM void CPU::dma_write(uint16 addr, uint8 data) { addr = 0x8000 | (addr & 0x1fff); //8000-9fff return bus.write(addr, data); } uint8 CPU::debugger_read(uint16 addr) { return bus.read(addr); } #endif gb/cartridge/huc3/huc3.cpp000664 001750 001750 00000002163 12651764221 016456 0ustar00sergiosergio000000 000000 #ifdef CARTRIDGE_CPP uint8 Cartridge::HuC3::mmio_read(uint16 addr) { if((addr & 0xc000) == 0x0000) { //$0000-3fff return cartridge.rom_read(addr); } if((addr & 0xc000) == 0x4000) { //$4000-7fff return cartridge.rom_read((rom_select << 14) | (addr & 0x3fff)); } if((addr & 0xe000) == 0xa000) { //$a000-bfff if(ram_enable) return cartridge.ram_read((ram_select << 13) | (addr & 0x1fff)); return 0x00; } return 0x00; } void Cartridge::HuC3::mmio_write(uint16 addr, uint8 data) { if((addr & 0xe000) == 0x0000) { //$0000-1fff ram_enable = (data & 0x0f) == 0x0a; return; } if((addr & 0xe000) == 0x2000) { //$2000-3fff rom_select = data; return; } if((addr & 0xe000) == 0x4000) { //$4000-5fff ram_select = data; return; } if((addr & 0xe000) == 0x6000) { //$6000-7fff //unknown purpose return; } if((addr & 0xe000) == 0xa000) { //$a000-bfff if(ram_enable) cartridge.ram_write((ram_select << 13) | (addr & 0x1fff), data); return; } } void Cartridge::HuC3::power() { ram_enable = false; rom_select = 0x01; ram_select = 0x00; } #endif sfc/chip/dsp1/dsp1emu.cpp000664 001750 001750 00000166424 12651764221 016354 0ustar00sergiosergio000000 000000 #ifdef DSP1_CPP // DSP-1's emulation code // // Based on research by Overload, The Dumper, Neviksti and Andreas Naive // Date: June 2006 ////////////////////////////////////////////////////////////////// Dsp1::Dsp1() { reset(); } ////////////////////////////////////////////////////////////////// uint8 Dsp1::getSr() { mSrLowByteAccess = ~mSrLowByteAccess; if (mSrLowByteAccess) return 0; else return mSr; } ////////////////////////////////////////////////////////////////// uint8 Dsp1::getDr() { uint8 oDr; fsmStep(true, oDr); return oDr; } ////////////////////////////////////////////////////////////////// void Dsp1::setDr(uint8 iDr) { fsmStep(false, iDr); } ////////////////////////////////////////////////////////////////// void Dsp1::reset() { mSr = DRC|RQM; mSrLowByteAccess = false; mDr = 0x0080; // Only a supposition. Is this correct? mFreeze = false; mFsmMajorState = WAIT_COMMAND; memset(&shared, 0, sizeof(SharedData)); // another supposition } ////////////////////////////////////////////////////////////////// // Though the DSP-1 is unaware of the type of operation (read or write) // we need to know what is being done by the program, as the class // is responsible for maintaining the binding between the // "external" and "internal" representations of the DR (data register). void Dsp1::fsmStep(bool read, uint8 &data) { if (0 == (mSr&RQM)) return; // Now RQM would be cleared; however, as this code is not to be used in // a multithread environment, we will simply fake RQM operation. // (The only exception would be Op1A's freeze.) // binding if (read) { if (mSr&DRS) data = static_cast(mDr>>8); else data = static_cast(mDr); } else { if (mSr&DRS) { mDr &= 0x00ff; mDr |= data<<8; } else { mDr &= 0xff00; mDr |= data; } } switch (mFsmMajorState) { case WAIT_COMMAND: mCommand = static_cast(mDr); if (!(mCommand & 0xc0)) // valid command? { switch(mCommand) { // freeze cases case 0x1a: case 0x2a: case 0x3a: mFreeze = true; break; // normal cases default: mDataCounter=0; mFsmMajorState = READ_DATA; mSr &= ~DRC; break; } } break; case READ_DATA: mSr ^= DRS; if (!(mSr&DRS)) { mReadBuffer[mDataCounter++] = static_cast(mDr); if (mDataCounter >= mCommandTable[mCommand].reads) { (this->*mCommandTable[mCommand].callback)(mReadBuffer, mWriteBuffer); if (0 != mCommandTable[mCommand].writes) // any output? { mDataCounter = 0; mDr = static_cast(mWriteBuffer[mDataCounter]); mFsmMajorState = WRITE_DATA; } else { mDr = 0x0080; // valid command completion mFsmMajorState = WAIT_COMMAND; mSr |= DRC; } } } break; case WRITE_DATA: mSr ^= DRS; if (!(mSr&DRS)) { ++mDataCounter; if (mDataCounter >= mCommandTable[mCommand].writes) { if ((mCommand == 0x0a)&&(mDr != 0x8000)) { // works in continuous mode mReadBuffer[0]++; // next raster line (this->*mCommandTable[mCommand].callback)(mReadBuffer, mWriteBuffer); mDataCounter = 0; mDr = static_cast(mWriteBuffer[mDataCounter]); } else { mDr = 0x0080; // valid command completion mFsmMajorState = WAIT_COMMAND; mSr |= DRC; } } else { mDr = static_cast(mWriteBuffer[mDataCounter]); } } break; } // Now RQM would be set (except when executing Op1A -command equals 0x1a, 0x2a or 0x3a-). if (mFreeze) mSr &= ~RQM; } ////////////////////////////////////////////////////////////////// // The info on this table follows Overload's docs. const Dsp1::Command Dsp1::mCommandTable[0x40] = { {&Dsp1::multiply, 2, 1}, //0x00 {&Dsp1::attitudeA, 4, 0}, //0x01 {&Dsp1::parameter, 7, 4}, //0x02 {&Dsp1::subjectiveA, 3, 3}, //0x03 {&Dsp1::triangle, 2, 2}, //0x04 {&Dsp1::attitudeA, 4, 0}, //0x01 {&Dsp1::project, 3, 3}, //0x06 {&Dsp1::memoryTest, 1, 1}, //0x0f {&Dsp1::radius, 3, 2}, //0x08 {&Dsp1::objectiveA, 3, 3}, //0x0d {&Dsp1::raster, 1, 4}, // 0x0a. This will normally work in continuous mode {&Dsp1::scalarA, 3, 1}, //0x0b {&Dsp1::rotate, 3, 2}, //0x0c {&Dsp1::objectiveA, 3, 3}, //0x0d {&Dsp1::target, 2, 2}, //0x0e {&Dsp1::memoryTest, 1, 1}, //0x0f {&Dsp1::inverse, 2, 2}, //0x10 {&Dsp1::attitudeB, 4, 0}, //0x11 {&Dsp1::parameter, 7, 4}, //0x02 {&Dsp1::subjectiveB, 3, 3}, //0x13 {&Dsp1::gyrate, 6, 3}, //0x14 {&Dsp1::attitudeB, 4, 0}, //0x11 {&Dsp1::project, 3, 3}, //0x06 {&Dsp1::memoryDump, 1, 1024}, //0x1f {&Dsp1::range, 4, 1}, //0x18 {&Dsp1::objectiveB, 3, 3}, //0x1d {0, 0, 0}, // 0x1a; the chip freezes {&Dsp1::scalarB, 3, 1}, //0x1b {&Dsp1::polar, 6, 3}, //0x1c {&Dsp1::objectiveB, 3, 3}, //0x1d {&Dsp1::target, 2, 2}, //0x0e {&Dsp1::memoryDump, 1, 1024}, //0x1f {&Dsp1::multiply2, 2, 1}, //0x20 {&Dsp1::attitudeC, 4, 0}, //0x21 {&Dsp1::parameter, 7, 4}, //0x02 {&Dsp1::subjectiveC, 3, 3}, //0x23 {&Dsp1::triangle, 2, 2}, //0x04 {&Dsp1::attitudeC, 4, 0}, //0x21 {&Dsp1::project, 3, 3}, //0x06 {&Dsp1::memorySize, 1, 1}, //0x2f {&Dsp1::distance, 3, 1}, //0x28 {&Dsp1::objectiveC, 3, 3}, //0x2d {0, 0, 0}, // 0x1a; the chip freezes {&Dsp1::scalarC, 3, 1}, //0x2b {&Dsp1::rotate, 3, 2}, //0x0c {&Dsp1::objectiveC, 3, 3}, //0x2d {&Dsp1::target, 2, 2}, //0x0e {&Dsp1::memorySize, 1, 1}, //0x2f {&Dsp1::inverse, 2, 2}, //0x10 {&Dsp1::attitudeA, 4, 0}, //0x01 {&Dsp1::parameter, 7, 4}, //0x02 {&Dsp1::subjectiveA, 3, 3}, //0x03 {&Dsp1::gyrate, 6, 3}, //0x14 {&Dsp1::attitudeA, 4, 0}, //0x01 {&Dsp1::project, 3, 3}, //0x06 {&Dsp1::memoryDump, 1, 1024}, //0x1f {&Dsp1::range2, 4, 1}, //0x38 {&Dsp1::objectiveA, 3, 3}, //0x0d {0, 0, 0}, // 0x1a; the chip freezes {&Dsp1::scalarA, 3, 1}, //0x0b {&Dsp1::polar, 6, 3}, //0x1c {&Dsp1::objectiveA, 3, 3}, //0x0d {&Dsp1::target, 2, 2}, //0x0e {&Dsp1::memoryDump, 1, 1024}, //0x1f }; ////////////////////////////////////////////////////////////////// void Dsp1::memoryTest(int16 *input, int16 *output) { int16& Size = input[0]; int16& Result = output[0]; Result = 0x0000; } ////////////////////////////////////////////////////////////////// void Dsp1::memoryDump(int16 *input, int16 *output) { memcpy(output, DataRom, 1024); } ////////////////////////////////////////////////////////////////// void Dsp1::memorySize(int16 *input, int16 *output) { int16& Size = output[0]; Size = 0x0100; } ////////////////////////////////////////////////////////////////// // 16-bit multiplication void Dsp1::multiply(int16 *input, int16 *output) { int16& Multiplicand = input[0]; int16& Multiplier = input[1]; int16& Product = output[0]; Product = Multiplicand * Multiplier >> 15; } ////////////////////////////////////////////////////////////////// // 16-bit multiplication. 'Alternative' method. Can anyone check this carefully? void Dsp1::multiply2(int16 *input, int16 *output) { int16& Multiplicand = input[0]; int16& Multiplier = input[1]; int16& Product = output[0]; Product = (Multiplicand * Multiplier >> 15)+1; } ////////////////////////////////////////////////////////////////// // This command determines the inverse of a floating point decimal number. void Dsp1::inverse(int16 *input, int16 *output) { int16& Coefficient = input[0]; int16& Exponent = input[1]; int16& iCoefficient = output[0]; int16& iExponent = output[1]; inverse(Coefficient, Exponent, iCoefficient, iExponent); } ////////////////////////////////////////////////////////////////// // Vector component calculation. Determines the X and Y components for a // two-dimensional vector whose size and direction is known. // Y = Radius * sin(Angle) // X = Radius * cos(Angle) void Dsp1::triangle(int16 *input, int16 *output) { int16& Angle = input[0]; int16& Radius = input[1]; int16& Y = output[0]; int16& X = output[1]; Y = sin(Angle) * Radius >> 15; X = cos(Angle) * Radius >> 15; } ////////////////////////////////////////////////////////////////// // Determines the squared norm of a vector (X,Y,Z) // The output is Radius = X^2+Y^2+Z^2 (double integer) void Dsp1::radius(int16 *input, int16 *output) { int16& X = input[0]; int16& Y = input[1]; int16& Z = input[2]; int16& RadiusLow = output[0]; int16& RadiusHigh = output[1]; int32 Radius; Radius = (X * X + Y * Y + Z * Z) << 1; RadiusLow = static_cast(Radius); RadiusHigh = static_cast(Radius>>16); } ////////////////////////////////////////////////////////////////// // Vector size comparison. This command compares the size of the vector (X,Y,Z) and the distance (R) // from a particular point, and so may be used to determine if a point is within the sphere or radius R. // The output is D = X^2+Y^2+Z^2-R^2 void Dsp1::range(int16 *input, int16 *output) { int16& X = input[0]; int16& Y = input[1]; int16& Z = input[2]; int16& Radius = input[3]; int16& Range = output[0]; Range = (X * X + Y * Y + Z * Z - Radius * Radius) >> 15; } ////////////////////////////////////////////////////////////////// // Vector size comparison. 'Alternative' method. void Dsp1::range2(int16 *input, int16 *output) { int16& X = input[0]; int16& Y = input[1]; int16& Z = input[2]; int16& Radius = input[3]; int16& Range = output[0]; Range = ((X * X + Y * Y + Z * Z - Radius * Radius) >> 15) + 1; } ////////////////////////////////////////////////////////////////// // This command calculates the norm of a (X,Y,Z) vector, or the distance from // the point (X,Y,Z) to (0,0,0), as you prefer to see it. // Distance = sqrt(X^2+Y^2+Z^2) // The square root of a number 'a' is calculated by doing this: you // write 'a' as b*2^2n, with 'b' between 1/4 and 1; then, you calculate // c=sqrt(b) by using lineal interpolation between points of a // look-up table and, finally, you output the result as c*2^n. void Dsp1::distance(int16 *input, int16 *output) { int16& X = input[0]; int16& Y = input[1]; int16& Z = input[2]; int16& Distance = output[0]; int32 Radius = X * X + Y * Y + Z * Z; if (Radius == 0) Distance = 0; else { int16 C, E; normalizeDouble(Radius, C, E); if (E & 1) C = C * 0x4000 >> 15; int16 Pos = C * 0x0040 >> 15; int16 Node1 = DataRom[0x00d5 + Pos]; int16 Node2 = DataRom[0x00d6 + Pos]; Distance = ((Node2 - Node1) * (C & 0x1ff) >> 9) + Node1; #if DSP1_VERSION < 0x0102 if (Pos & 1) Distance -= (Node2 - Node1); #endif Distance >>= (E >> 1); } } ////////////////////////////////////////////////////////////////// // Determines the (X2, Y2) coordinates obtained by rotating (X1, Y1) // clockwise for an angle 'Angle'. The official documentation says // 'counterclockwise', but it's obviously wrong (surprise! :P) // // In matrix notation: // |X2| |cos(Angle) sin(Angle)| |X1| // | | = | | | | // |Y2| |-sin(Angle cos(Angle)| |Y1| void Dsp1::rotate(int16 *input, int16 *output) { int16& Angle = input[0]; int16& X1 = input[1]; int16& Y1 = input[2]; int16& X2 = output[0]; int16& Y2 = output[1]; X2 = (Y1 * sin(Angle) >> 15) + (X1 * cos(Angle) >> 15); Y2 = (Y1 * cos(Angle) >> 15) - (X1 * sin(Angle) >> 15); } ////////////////////////////////////////////////////////////////// // Calculate the coordinates (X2, Y2, Z2) obtained when rotating (X1, Y1, Z1) // three-dimensionally. Rotation is done in the order of Az around the Z axis, // Ay around the Y axis and Ax around the X axis. As occur with the "attitude" commands // (see comments in the "gyrate" command), this doesn't match what explained in // the official documentation, but it's coherent with what it is done in the "attitude" // command (but not with the "gyrate" command). // // In matrix notation: // |X2| |1 0 0 | |cosRy 0 -sinRy| | cosRz sinRz 0| |X1| // |Y2| = |0 cosRx sinRx| | 0 1 0 | |-sinRz cosRz 0| |Y1| // |Z2| |0 -sinRx cosRx| |sinRy 0 cosRy| | 0 0 1| |Z1| void Dsp1::polar(int16 *input, int16 *output) { int16& Az = input[0]; int16& Ay = input[1]; int16& Ax = input[2]; int16& X1 = input[3]; int16& Y1 = input[4]; int16& Z1 = input[5]; int16& X2 = output[0]; int16& Y2 = output[1]; int16& Z2 = output[2]; int16 X, Y, Z; // Rotate Around Z X = (Y1 * sin(Az) >> 15) + (X1 * cos(Az) >> 15); Y = (Y1 * cos(Az) >> 15) - (X1 * sin(Az) >> 15); X1 = X; Y1 = Y; // Rotate Around Y Z = (X1 * sin(Ay) >> 15) + (Z1 * cos(Ay) >> 15); X = (X1 * cos(Ay) >> 15) - (Z1 * sin(Ay) >> 15); X2 = X; Z1 = Z; // Rotate Around X Y = (Z1 * sin(Ax) >> 15) + (Y1 * cos(Ax) >> 15); Z = (Z1 * cos(Ax) >> 15) - (Y1 * sin(Ax) >> 15); Y2 = Y; Z2 = Z; } ////////////////////////////////////////////////////////////////// // Set up the elements of an "attitude matrix" (there are other ones): // S | cosRz sinRz 0| |cosRy 0 -sinRy| |1 0 0 | // MatrixA = - |-sinRz cosRz 0| | 0 1 0 | |0 cosRx sinRx| // 2 | 0 0 1| |sinRy 0 cosRy| |0 -sinRx cosRx| // This matrix is thought to be used within the following framework: // let's suppose we define positive rotations around a system of orthogonal axes in this manner: // a rotation of +90 degrees around axis3 converts axis2 into axis1 // a rotation of +90 degrees around axis2 converts axis1 into axis3 // a rotation of +90 degrees around axis1 converts axis3 into axis2 // and let's suppose that we have defined a new orthonormal axes system (FLU) // by doing the following operations about the standard one (XYZ): // first rotating the XYZ system around Z by an angle Rz (obtaining X'Y'Z'), // then rotating the resulting system around Y by an angle Ry (obtaining X''Y''Z'') // and, finally, rotating the resulting system around X by an angle Rx (obtaining FLU) // This FLU (forward/left/up) system represents an "attitude" and, then, the matrix here defined // is the change of coordinates matrix that transform coordinates in the FLU // system (the "object coordinates") into the standard XYZ system (the "global coordinates"), // multiplied by a scale factor S/2, that is: // |x| S |f| // |y| * - = MatrixA * |l| // |z| 2 |u| // In a similar way, if we use the transpose of the matrix, we can transform global coordinates // into object coordinates: // |f| S |x| // |l| * - = MatrixA_transposed * |y| // |u| 2 |z| // // input[0]: S // input[1]: Rz // input[2]: Ry // input[3]: Rx void Dsp1::attitudeA(int16 *input, int16 *output) { int16& S = input[0]; int16& Rz = input[1]; int16& Ry = input[2]; int16& Rx = input[3]; int16 SinRz = sin(Rz); int16 CosRz = cos(Rz); int16 SinRy = sin(Ry); int16 CosRy = cos(Ry); int16 SinRx = sin(Rx); int16 CosRx = cos(Rx); S >>= 1; shared.MatrixA[0][0] = (S * CosRz >> 15) * CosRy >> 15; shared.MatrixA[0][1] = ((S * SinRz >> 15) * CosRx >> 15) + (((S * CosRz >> 15) * SinRx >> 15) * SinRy >> 15); shared.MatrixA[0][2] = ((S * SinRz >> 15) * SinRx >> 15) - (((S * CosRz >> 15) * CosRx >> 15) * SinRy >> 15); shared.MatrixA[1][0] = -((S * SinRz >> 15) * CosRy >> 15); shared.MatrixA[1][1] = ((S * CosRz >> 15) * CosRx >> 15) - (((S * SinRz >> 15) * SinRx >> 15) * SinRy >> 15); shared.MatrixA[1][2] = ((S * CosRz >> 15) * SinRx >> 15) + (((S * SinRz >> 15) * CosRx >> 15) * SinRy >> 15); shared.MatrixA[2][0] = S * SinRy >> 15; shared.MatrixA[2][1] = -((S * SinRx >> 15) * CosRy >> 15); shared.MatrixA[2][2] = (S * CosRx >> 15) * CosRy >> 15; } ////////////////////////////////////////////////////////////////// // Same than 'attitudeA', but with a difference attitude matrix (matrixB) void Dsp1::attitudeB(int16 *input, int16 *output) { int16& S = input[0]; int16& Rz = input[1]; int16& Ry = input[2]; int16& Rx = input[3]; int16 SinRz = sin(Rz); int16 CosRz = cos(Rz); int16 SinRy = sin(Ry); int16 CosRy = cos(Ry); int16 SinRx = sin(Rx); int16 CosRx = cos(Rx); S >>= 1; shared.MatrixB[0][0] = (S * CosRz >> 15) * CosRy >> 15; shared.MatrixB[0][1] = ((S * SinRz >> 15) * CosRx >> 15) + (((S * CosRz >> 15) * SinRx >> 15) * SinRy >> 15); shared.MatrixB[0][2] = ((S * SinRz >> 15) * SinRx >> 15) - (((S * CosRz >> 15) * CosRx >> 15) * SinRy >> 15); shared.MatrixB[1][0] = -((S * SinRz >> 15) * CosRy >> 15); shared.MatrixB[1][1] = ((S * CosRz >> 15) * CosRx >> 15) - (((S * SinRz >> 15) * SinRx >> 15) * SinRy >> 15); shared.MatrixB[1][2] = ((S * CosRz >> 15) * SinRx >> 15) + (((S * SinRz >> 15) * CosRx >> 15) * SinRy >> 15); shared.MatrixB[2][0] = S * SinRy >> 15; shared.MatrixB[2][1] = -((S * SinRx >> 15) * CosRy >> 15); shared.MatrixB[2][2] = (S * CosRx >> 15) * CosRy >> 15; } ////////////////////////////////////////////////////////////////// // Same than 'attitudeA', but with a difference attitude matrix (matrixC) void Dsp1::attitudeC(int16 *input, int16 *output) { int16& S = input[0]; int16& Rz = input[1]; int16& Ry = input[2]; int16& Rx = input[3]; int16 SinRz = sin(Rz); int16 CosRz = cos(Rz); int16 SinRy = sin(Ry); int16 CosRy = cos(Ry); int16 SinRx = sin(Rx); int16 CosRx = cos(Rx); S >>= 1; shared.MatrixC[0][0] = (S * CosRz >> 15) * CosRy >> 15; shared.MatrixC[0][1] = ((S * SinRz >> 15) * CosRx >> 15) + (((S * CosRz >> 15) * SinRx >> 15) * SinRy >> 15); shared.MatrixC[0][2] = ((S * SinRz >> 15) * SinRx >> 15) - (((S * CosRz >> 15) * CosRx >> 15) * SinRy >> 15); shared.MatrixC[1][0] = -((S * SinRz >> 15) * CosRy >> 15); shared.MatrixC[1][1] = ((S * CosRz >> 15) * CosRx >> 15) - (((S * SinRz >> 15) * SinRx >> 15) * SinRy >> 15); shared.MatrixC[1][2] = ((S * CosRz >> 15) * SinRx >> 15) + (((S * SinRz >> 15) * CosRx >> 15) * SinRy >> 15); shared.MatrixC[2][0] = S * SinRy >> 15; shared.MatrixC[2][1] = -((S * SinRx >> 15) * CosRy >> 15); shared.MatrixC[2][2] = (S * CosRx >> 15) * CosRy >> 15; } ////////////////////////////////////////////////////////////////// // Convert global coordinates (X,Y,Z) to object coordinates (F,L,U) // See the comment in "attitudeA" for a explanation about the calculation. // // input[0]: X ; input[1]: Y ; input[2]: Z // output[0]: F ; output[1]: L ; output[2]: U void Dsp1::objectiveA(int16 *input, int16 *output) { int16& X = input[0]; int16& Y = input[1]; int16& Z = input[2]; int16& F = output[0]; int16& L = output[1]; int16& U = output[2]; F = (shared.MatrixA[0][0] * X >> 15) + (shared.MatrixA[1][0] * Y >> 15) + (shared.MatrixA[2][0] * Z >> 15); L = (shared.MatrixA[0][1] * X >> 15) + (shared.MatrixA[1][1] * Y >> 15) + (shared.MatrixA[2][1] * Z >> 15); U = (shared.MatrixA[0][2] * X >> 15) + (shared.MatrixA[1][2] * Y >> 15) + (shared.MatrixA[2][2] * Z >> 15); } ////////////////////////////////////////////////////////////////// // Same than 'objectiveA', but for the 'B' attitude void Dsp1::objectiveB(int16 *input, int16 *output) { int16& X = input[0]; int16& Y = input[1]; int16& Z = input[2]; int16& F = output[0]; int16& L = output[1]; int16& U = output[2]; F = (shared.MatrixB[0][0] * X >> 15) + (shared.MatrixB[1][0] * Y >> 15) + (shared.MatrixB[2][0] * Z >> 15); L = (shared.MatrixB[0][1] * X >> 15) + (shared.MatrixB[1][1] * Y >> 15) + (shared.MatrixB[2][1] * Z >> 15); U = (shared.MatrixB[0][2] * X >> 15) + (shared.MatrixB[1][2] * Y >> 15) + (shared.MatrixB[2][2] * Z >> 15); } ////////////////////////////////////////////////////////////////// // Same than 'objectiveA', but for the 'C' attitude void Dsp1::objectiveC(int16 *input, int16 *output) { int16& X = input[0]; int16& Y = input[1]; int16& Z = input[2]; int16& F = output[0]; int16& L = output[1]; int16& U = output[2]; F = (shared.MatrixC[0][0] * X >> 15) + (shared.MatrixC[1][0] * Y >> 15) + (shared.MatrixC[2][0] * Z >> 15); L = (shared.MatrixC[0][1] * X >> 15) + (shared.MatrixC[1][1] * Y >> 15) + (shared.MatrixC[2][1] * Z >> 15); U = (shared.MatrixC[0][2] * X >> 15) + (shared.MatrixC[1][2] * Y >> 15) + (shared.MatrixC[2][2] * Z >> 15); } ////////////////////////////////////////////////////////////////// // Convert object coordinates (F,L,U) to object coordinates (X,Y,Z) // See the comment in "attitudeA" for a explanation about the calculation. // // input[0]: F ; input[1]: L ; input[2]: U // output[0]: X ; output[1]: Y ; output[2]: Z void Dsp1::subjectiveA(int16 *input, int16 *output) { int16& F = input[0]; int16& L = input[1]; int16& U = input[2]; int16& X = output[0]; int16& Y = output[1]; int16& Z = output[2]; X = (shared.MatrixA[0][0] * F >> 15) + (shared.MatrixA[0][1] * L >> 15) + (shared.MatrixA[0][2] * U >> 15); Y = (shared.MatrixA[1][0] * F >> 15) + (shared.MatrixA[1][1] * L >> 15) + (shared.MatrixA[1][2] * U >> 15); Z = (shared.MatrixA[2][0] * F >> 15) + (shared.MatrixA[2][1] * L >> 15) + (shared.MatrixA[2][2] * U >> 15); } ////////////////////////////////////////////////////////////////// // Same than 'subjectiveA', but for the 'B' attitude void Dsp1::subjectiveB(int16 *input, int16 *output) { int16& F = input[0]; int16& L = input[1]; int16& U = input[2]; int16& X = output[0]; int16& Y = output[1]; int16& Z = output[2]; X = (shared.MatrixB[0][0] * F >> 15) + (shared.MatrixB[0][1] * L >> 15) + (shared.MatrixB[0][2] * U >> 15); Y = (shared.MatrixB[1][0] * F >> 15) + (shared.MatrixB[1][1] * L >> 15) + (shared.MatrixB[1][2] * U >> 15); Z = (shared.MatrixB[2][0] * F >> 15) + (shared.MatrixB[2][1] * L >> 15) + (shared.MatrixB[2][2] * U >> 15); } ////////////////////////////////////////////////////////////////// // Same than 'subjectiveA', but for the 'C' attitude void Dsp1::subjectiveC(int16 *input, int16 *output) { int16& F = input[0]; int16& L = input[1]; int16& U = input[2]; int16& X = output[0]; int16& Y = output[1]; int16& Z = output[2]; X = (shared.MatrixC[0][0] * F >> 15) + (shared.MatrixC[0][1] * L >> 15) + (shared.MatrixC[0][2] * U >> 15); Y = (shared.MatrixC[1][0] * F >> 15) + (shared.MatrixC[1][1] * L >> 15) + (shared.MatrixC[1][2] * U >> 15); Z = (shared.MatrixC[2][0] * F >> 15) + (shared.MatrixC[2][1] * L >> 15) + (shared.MatrixC[2][2] * U >> 15); } ////////////////////////////////////////////////////////////////// // This command calculates the inner product (S) of a vector (X,Y,Z) and // the first column of MatrixA. It should be noted that that first column // represent the global coordinates of an unity vector in the forward // direction in the object coordinate system (coordinates (1,0,0) in the FLU // axes system). // // input[0]: X ; input[1]: Y ; input[2]: Z // output[0]: S void Dsp1::scalarA(int16 *input, int16 *output) { int16& X = input[0]; int16& Y = input[1]; int16& Z = input[2]; int16& S = output[0]; S = (X * shared.MatrixA[0][0] + Y * shared.MatrixA[1][0] + Z * shared.MatrixA[2][0]) >> 15; } ////////////////////////////////////////////////////////////////// // Same than 'scalarA', but for the 'B' attitude void Dsp1::scalarB(int16 *input, int16 *output) { int16& X = input[0]; int16& Y = input[1]; int16& Z = input[2]; int16& S = output[0]; S = (X * shared.MatrixB[0][0] + Y * shared.MatrixB[1][0] + Z * shared.MatrixB[2][0]) >> 15; } ////////////////////////////////////////////////////////////////// // Same than 'scalarA', but for the 'C' attitude void Dsp1::scalarC(int16 *input, int16 *output) { int16& X = input[0]; int16& Y = input[1]; int16& Z = input[2]; int16& S = output[0]; S = (X * shared.MatrixC[0][0] + Y * shared.MatrixC[1][0] + Z * shared.MatrixC[2][0]) >> 15; } ////////////////////////////////////////////////////////////////// // This command determines the final attitude angles after the body with attitude angles (Ax, Ay, Az) with // respect to the global coordinates is rotated by the minor angular displacements (DeltaF, DeltaL, DeltaU). // It means that the XYZ axes are rotated by (Ax, Ay, Az) to obtain the FLU axes and, then, these // are rotated by (DeltaF, DeltaL, DeltaU). The command calculates and return the new FLU angles respect to the // XYZ system (Rx, Ry, Rz) // The formulae are: // Rx = Ax + (DeltaU*sin(Ay)+DeltaF*cos(Ay)) // Ry = Ay + DeltaL - tan(Ax)*(DeltaU*cos(Ay)+DeltaF*sin(Ay)) // Rz = Az + sec(Ax)*(DeltaU*cos(Ay)-DeltaF*sin(Ay)) // // Now the discussion: according to the official documentation, as described in various commands, you pass from // XYZ to FLU by doing the rotations in the order Y, X, Z. In this command, the formulae are coherent with the // fact that Y is the first axis to do a rotation around it. However, in the "attitude" command, while the official // document describe it that way, we have discovered, when reverse engineering the command, that the calculated // matrix do the rotation around Y in the second place. This incoherent behaviour of various commands is, in my // opinion, a pretty severe implementation error. However, if you only use small "minor displacements", the error term // introduced by that incoherence should be almost negligible. void Dsp1::gyrate(int16 *input, int16 *output) { int16& Az = input[0]; int16& Ax = input[1]; int16& Ay = input[2]; int16& U = input[3]; int16& F = input[4]; int16& L = input[5]; int16& Rz = output[0]; int16& Rx = output[1]; int16& Ry = output[2]; int16 CSec, ESec, CSin, C, E; int16 SinAy = sin(Ay); int16 CosAy = cos(Ay); inverse(cos(Ax), 0, CSec, ESec); // Rotation Around Z normalizeDouble(U * CosAy - F * SinAy, C, E); E = ESec - E; normalize(C * CSec >> 15, C, E); Rz = Az + denormalizeAndClip(C, E); // Rotation Around X Rx = Ax + (U * SinAy >> 15) + (F * CosAy >> 15); // Rotation Around Y normalizeDouble(U * CosAy + F * SinAy, C, E); E = ESec - E; normalize(sin(Ax), CSin, E); normalize(-(C * (CSec * CSin >> 15) >> 15), C, E); Ry = Ay + denormalizeAndClip(C, E) + L; } ////////////////////////////////////////////////////////////////// const int16 Dsp1::MaxAZS_Exp[16] = { 0x38b4, 0x38b7, 0x38ba, 0x38be, 0x38c0, 0x38c4, 0x38c7, 0x38ca, 0x38ce, 0x38d0, 0x38d4, 0x38d7, 0x38da, 0x38dd, 0x38e0, 0x38e4 }; ////////////////////////////////////////////////////////////////// // Set-up the projection framework. Besides returning some values, it store in RAM some values that // will be used by the other three projection commands (raster, target an project) // Input: // (Fx, Fy, Fz)-> coordinates of base point (global coordinates) // Lfe-> distance between the base point and the viewpoint (center of projection) // Les-> distance between the base point and the screen // Aas-> azimuth angle (0 degrees is east; 90 degrees is north) // Azs-> zenith angle (0 degrees is zenith) // Output: // Vof-> raster line of imaginary center (whatever it means ;) ) // Vva-> raster line representing the horizon line // (Cx, Cy)-> coordinates of the projection of the center of the screen over the ground (ground coordinates) void Dsp1::parameter(int16 *input, int16 *output) { int16& Fx = input[0]; int16& Fy = input[1]; int16& Fz = input[2]; int16& Lfe = input[3]; int16& Les = input[4]; int16& Aas = input[5]; int16& Azs = input[6]; int16& Vof = output[0]; int16& Vva = output[1]; int16& Cx = output[2]; int16& Cy = output[3]; int16 CSec, C, E; int16 LfeNx, LfeNy, LfeNz; int16 LesNx, LesNy, LesNz; // Copy Zenith angle for clipping int16 AZS = Azs; // Store Les and his coefficient and exponent when normalized shared.Les = Les; shared.E_Les=0; normalize(Les, shared.C_Les, shared.E_Les); // Store Sine and Cosine of Azimuth and Zenith angle shared.SinAas = sin(Aas); shared.CosAas = cos(Aas); shared.SinAzs = sin(Azs); shared.CosAzs = cos(Azs); // normal vector to the screen (norm 1, points toward the center of projection) shared.Nx = shared.SinAzs * -shared.SinAas >> 15; shared.Ny = shared.SinAzs * shared.CosAas >> 15; shared.Nz = shared.CosAzs * 0x7fff >> 15; // horizontal vector of the screen (Hz=0, norm 1, points toward the right of the screen) shared.Hx = shared.CosAas*0x7fff>>15; shared.Hy = shared.SinAas*0x7fff>>15; // vertical vector of the screen (norm 1, points toward the top of the screen) shared.Vx = shared.CosAzs*-shared.SinAas>>15; shared.Vy = shared.CosAzs*shared.CosAas>>15; shared.Vz = -shared.SinAzs*0x7fff>>15; LfeNx = Lfe*shared.Nx>>15; LfeNy = Lfe*shared.Ny>>15; LfeNz = Lfe*shared.Nz>>15; // Center of Projection shared.CentreX = Fx+LfeNx; shared.CentreY = Fy+LfeNy; shared.CentreZ = Fz+LfeNz; LesNx = Les*shared.Nx>>15; LesNy = Les*shared.Ny>>15; LesNz = Les*shared.Nz>>15; // center of the screen (global coordinates) shared.Gx=shared.CentreX-LesNx; shared.Gy=shared.CentreY-LesNy; shared.Gz=shared.CentreZ-LesNz; E = 0; normalize(shared.CentreZ, C, E); shared.CentreZ_C = C; shared.CentreZ_E = E; // Determine clip boundary and clip Zenith angle if necessary // (Why to clip? Maybe to avoid the screen can only show sky with no ground? Only a guess...) int16 MaxAZS = MaxAZS_Exp[-E]; if (AZS < 0) { MaxAZS = -MaxAZS; if (AZS < MaxAZS + 1) AZS = MaxAZS + 1; } else { if (AZS > MaxAZS) AZS = MaxAZS; } // Store Sine and Cosine of clipped Zenith angle shared.SinAZS = sin(AZS); shared.CosAZS = cos(AZS); // calculate the separation of (cx, cy) from the projection of // the 'centre of projection' over the ground... (CentreZ*tg(AZS)) inverse(shared.CosAZS, 0, shared.SecAZS_C1, shared.SecAZS_E1); normalize(C * shared.SecAZS_C1 >> 15, C, E); E += shared.SecAZS_E1; C = denormalizeAndClip(C, E) * shared.SinAZS >> 15; // ... and then take into account the position of the centre of // projection and the azimuth angle shared.CentreX += C * shared.SinAas >> 15; shared.CentreY -= C * shared.CosAas >> 15; Cx = shared.CentreX; Cy = shared.CentreY; // Raster number of imaginary center and horizontal line Vof = 0; if ((Azs != AZS) || (Azs == MaxAZS)) { // correct vof and vva when Azs is outside the 'non-clipping interval' // we have only some few Taylor coefficients, so we cannot guess which ones // are the approximated functions and, what is worse, we don't know why // the own clipping stuff (and, particularly, this correction) is done if (Azs == -32768) Azs = -32767; C = Azs - MaxAZS; if (C >= 0) C--; int16 Aux = ~(C << 2); // Vof += x+(1/3)*x^3, where x ranges from 0 to PI/4 when Azs-MaxAZS goes from 0 to 0x2000 C = Aux * DataRom[0x0328] >> 15; C = (C * Aux >> 15) + DataRom[0x0327]; Vof -= (C * Aux >> 15) * Les >> 15; // CosAZS *= 1+(1/2)*x^2+(5/24)*x^24, where x ranges from 0 to PI/4 when Azs-MaxAZS goes from 0 to 0x2000 C = Aux * Aux >> 15; Aux = (C * DataRom[0x0324] >> 15) + DataRom[0x0325]; shared.CosAZS += (C * Aux >> 15) * shared.CosAZS >> 15; } // vertical offset of the screen with regard to the horizontal plane // containing the centre of projection shared.VOffset = Les * shared.CosAZS >> 15; // The horizon line (the line in the screen that is crossed by the horizon plane // -the horizontal plane containing the 'centre of projection'-), // will be at distance Les*cotg(AZS) from the centre of the screen. This is difficult // to explain but easily seen in a graph. To better see it, consider it in this way: // Les*tg(AZS-90), draw some lines and apply basic trigonometry. ;) inverse(shared.SinAZS, 0, CSec, E); normalize(shared.VOffset, C, E); normalize(C * CSec >> 15, C, E); if (C == -32768) { C >>= 1; E++; } Vva = denormalizeAndClip(-C, E); // Store Secant of clipped Zenith angle inverse(shared.CosAZS, 0, shared.SecAZS_C2, shared.SecAZS_E2); } ////////////////////////////////////////////////////////////////// // Calculates the matrix which transform an object situated on a raster line (Vs) into // his projection over the ground. The modified SecAZS is used here, so // i don't understand the fine details, but, basically, it's done // this way: The vertical offset between the point of projection and the // raster line is calculated (Vs*SinAzs>>15)+VOffset, then the height of // the center of projection is measured in that units (*CentreZ_C). If, now // you consider the "reference case" (center of projection at an unit of height), // the projection of a thin strip containing the raster line will have the same // width (as the raster line would be on the ground in this case, but will suffer a // change of scale in height (as the ground and the vertical axis would form an angle of 180-Azs degrees). // This scale factor, when the angle 'center of screen-center of projection-raster line' is small, // can be aproximated by the one of the center of the screen, 1/cos(Azs).(**) (Here is when it's used // SecAZS). By last, you have to consider the effect of the azimuth angle Aas, and you are done. // // Using matrix notation: // |A B| Centre_ZS | cos(Aas) -sin(Aas)| |1 0| // ProjectionMatrix = | | = ----------- * | | * | | // |C D| Vs*sin(Azs) |sin(Aas) cos(Aas)| |0 sec(Azs)| // // (**) // If Les=1, the vertical offset between the center // of projection and the center of the screen is Cos(Azs); then, if the vertical // offset is 1, the ratio of the projection over the ground respect to the // line on the screen is 1/cos(Azs). void Dsp1::raster(int16 *input, int16 *output) { int16& Vs = input[0]; int16& An = output[0]; int16& Bn = output[1]; int16& Cn = output[2]; int16& Dn = output[3]; int16 C, E, C1, E1; inverse((Vs * shared.SinAzs >> 15) + shared.VOffset, 7, C, E); E += shared.CentreZ_E; C1 = C * shared.CentreZ_C >> 15; E1 = E + shared.SecAZS_E2; normalize(C1, C, E); C = denormalizeAndClip(C, E); An = C * shared.CosAas >> 15; Cn = C * shared.SinAas >> 15; normalize(C1 * shared.SecAZS_C2 >> 15, C, E1); C = denormalizeAndClip(C, E1); Bn = C * -shared.SinAas >> 15; Dn = C * shared.CosAas >> 15; } ////////////////////////////////////////////////////////////////// // Calculate the projection over the ground of a selected point of screen // It simply apply the projection matrix described in the "Raster" command // to the vector (H,V) transposed, and add the result to the position of // the centre of projection. // The only special point to take into account is the directions on the screen: // H is positive rightward, but V is positive downward; this is why // the signs take that configuration void Dsp1::target(int16 *input, int16 *output) { int16& H = input[0]; int16& V = input[1]; int16& X = output[0]; int16& Y = output[1]; int16 C, E, C1, E1; inverse((V * shared.SinAzs >> 15) + shared.VOffset, 8, C, E); E += shared.CentreZ_E; C1 = C * shared.CentreZ_C >> 15; E1 = E + shared.SecAZS_E1; H <<= 8; normalize(C1, C, E); C = denormalizeAndClip(C, E) * H >> 15; X = shared.CentreX + (C * shared.CosAas >> 15); Y = shared.CentreY - (C * shared.SinAas >> 15); V <<= 8; normalize(C1 * shared.SecAZS_C1 >> 15, C, E1); C = denormalizeAndClip(C, E1) * V >> 15; X += C * -shared.SinAas >> 15; Y += C * shared.CosAas >> 15; } ////////////////////////////////////////////////////////////////// // Calculation of the projection over the screen (H,V) of an object (X,Y,Z) and his // 'enlargement ratio' (M). The positive directions on the screen are as described // in the targe command. M is scaled down by 2^-7, that is, M==0x0100 means ratio 1:1 void Dsp1::project(int16 *input, int16 *output) { int16& X = input[0]; int16& Y = input[1]; int16& Z = input[2]; int16& H = output[0]; int16& V = output[1]; int16& M = output[2]; int32 aux, aux4; int16 E, E2, E3, E4, E5, refE, E6, E7; int16 C2, C4, C6, C8, C9, C10, C11, C12, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26; int16 Px, Py, Pz; E4 = E3 = E2 = E = E5 = 0; normalizeDouble(int32(X) - shared.Gx, Px, E4); normalizeDouble(int32(Y) - shared.Gy, Py, E); normalizeDouble(int32(Z) - shared.Gz, Pz, E3); Px>>=1; E4--; // to avoid overflows when calculating the scalar products Py>>=1; E--; Pz>>=1; E3--; refE = (E < E3) ? E : E3; refE = (refE < E4) ? refE : E4; Px=shiftR(Px,E4 - refE); // normalize them to the same exponent Py=shiftR(Py,E - refE); Pz=shiftR(Pz,E3 - refE); C11 = -(Px*shared.Nx>>15); C8 = -(Py*shared.Ny>>15); C9 = -(Pz*shared.Nz>>15); C12 = C11 + C8 + C9; // this cannot overflow! aux4=C12; // de-normalization with 32-bits arithmetic refE = 16 - refE; // refE can be up to 3 if (refE >= 0) aux4 <<= (refE); else aux4 >>= -(refE); if (aux4 == -1) aux4 = 0; // why? aux4 >>= 1; aux = static_cast(shared.Les) + aux4; // Les - the scalar product of P with the normal vector of the screen normalizeDouble(aux, C10, E2); E2 = 15 - E2; inverse(C10, 0, C4, E4); C2=C4*shared.C_Les >> 15; // scale factor // H E7 = 0; C16 = (Px*shared.Hx>>15); C20 = (Py*shared.Hy>>15); C17 = C16 + C20; // scalar product of P with the normalized horizontal vector of the screen... C18 = C17 * C2>>15; // ... multiplied by the scale factor normalize(C18, C19, E7); H=denormalizeAndClip(C19, shared.E_Les - E2 + refE + E7); // V E6 = 0; C21 = Px*shared.Vx>>15; C22 = Py*shared.Vy>>15; C23 = Pz*shared.Vz>>15; C24 = C21 + C22 + C23; // scalar product of P with the normalized vertical vector of the screen... C26 = C24 * C2>>15; // ... multiplied by the scale factor normalize(C26, C25, E6); V=denormalizeAndClip(C25, shared.E_Les - E2 + refE + E6); // M normalize(C2, C6, E4); M=denormalizeAndClip(C6, E4+shared.E_Les - E2 - 7); // M is the scale factor divided by 2^7 } ////////////////////////////////////////////////////////////////// // Calculate the sine of the input parameter // this is done by linear interpolation between // the points of a look-up table int16 Dsp1::sin(int16 Angle) { if (Angle < 0) { if (Angle == -32768) return 0; return -sin(-Angle); } int32 S = SinTable[Angle >> 8] + (MulTable[Angle & 0xff] * SinTable[0x40 + (Angle >> 8)] >> 15); if (S > 32767) S = 32767; return (int16) S; } ////////////////////////////////////////////////////////////////// // Calculate the cosine of the input parameter. // It's used the same method than in sin(int16) int16 Dsp1::cos(int16 Angle) { if (Angle < 0) { if (Angle == -32768) return -32768; Angle = -Angle; } int32 S = SinTable[0x40 + (Angle >> 8)] - (MulTable[Angle & 0xff] * SinTable[Angle >> 8] >> 15); if (S < -32768) S = -32767; return (int16) S; } ////////////////////////////////////////////////////////////////// // Determines the inverse of a floating point decimal number // iCoefficient*2^iExponent = 1/(Coefficient*2^Exponent), with the output // normalized (iCoefficient represents a number whose absolute value is between 1/2 and 1) // To invert 'Coefficient' a first initial guess is taken from a look-up table // and, then, two iterations of the Newton method (applied to the function // f(x)=1/(2*x)-Coefficient) are done. This results in a close approximation (iCoefficient) to a number 'y' // that verify Coefficient*y=1/2. This is why you have to correct the exponent by one // unit at the end. void Dsp1::inverse(int16 Coefficient, int16 Exponent, int16 &iCoefficient, int16 &iExponent) { // Step One: Division by Zero if (Coefficient == 0x0000) { iCoefficient = 0x7fff; iExponent = 0x002f; } else { int16 Sign = 1; // Step Two: Remove Sign if (Coefficient < 0) { if (Coefficient < -32767) Coefficient = -32767; Coefficient = -Coefficient; Sign = -1; } // Step Three: Normalize while (Coefficient < 0x4000) { Coefficient <<= 1; Exponent--; } // Step Four: Special Case if (Coefficient == 0x4000) if (Sign == 1) iCoefficient = 0x7fff; else { iCoefficient = -0x4000; Exponent--; } else { // Step Five: Initial Guess int16 i = DataRom[((Coefficient - 0x4000) >> 7) + 0x0065]; // Step Six: Iterate Newton's Method i = (i + (-i * (Coefficient * i >> 15) >> 15)) << 1; i = (i + (-i * (Coefficient * i >> 15) >> 15)) << 1; iCoefficient = i * Sign; } iExponent = 1 - Exponent; } } ////////////////////////////////////////////////////////////////// int16 Dsp1::denormalizeAndClip(int16 C, int16 E) { if (E > 0) { if (C > 0) return 32767; else if (C < 0) return -32767; } else { if (E < 0) return C * DataRom[0x0031 + E] >> 15; } return C; } ////////////////////////////////////////////////////////////////// // Normalize the input number (m), understood as ranging from -1 to 1, // to the form: Coefficient*2^Exponent, // where the absolute value of Coefficient is >= 1/2 // (Coefficient>=0x4000 or Coefficient <= (int16)0xc001) void Dsp1::normalize(int16 m, int16 &Coefficient, int16 &Exponent) { int16 i = 0x4000; int16 e = 0; if (m < 0) while ((m & i) && i) { i >>= 1; e++; } else while (!(m & i) && i) { i >>= 1; e++; } if (e > 0) Coefficient = m * DataRom[0x21 + e] << 1; else Coefficient = m; Exponent -= e; } ////////////////////////////////////////////////////////////////// // Same than 'normalize' but with an int32 input void Dsp1::normalizeDouble(int32 Product, int16 &Coefficient, int16 &Exponent) { int16 n = Product & 0x7fff; int16 m = Product >> 15; int16 i = 0x4000; int16 e = 0; if (m < 0) while ((m & i) && i) { i >>= 1; e++; } else while (!(m & i) && i) { i >>= 1; e++; } if (e > 0) { Coefficient = m * DataRom[0x0021 + e] << 1; if (e < 15) Coefficient += n * DataRom[0x0040 - e] >> 15; else { i = 0x4000; if (m < 0) while ((n & i) && i) { i >>= 1; e++; } else while (!(n & i) && i) { i >>= 1; e++; } if (e > 15) Coefficient = n * DataRom[0x0012 + e] << 1; else Coefficient += n; } } else Coefficient = m; Exponent = e; } ////////////////////////////////////////////////////////////////// // Shift to the right int16 Dsp1::shiftR(int16 C, int16 E) { return (C * DataRom[0x0031 + E] >> 15); } ////////////////////////////////////////////////////////////////// // this is, indeed, only part of the Data ROM const int16 Dsp1::SinTable[256] = { 0x0000, 0x0324, 0x0647, 0x096a, 0x0c8b, 0x0fab, 0x12c8, 0x15e2, 0x18f8, 0x1c0b, 0x1f19, 0x2223, 0x2528, 0x2826, 0x2b1f, 0x2e11, 0x30fb, 0x33de, 0x36ba, 0x398c, 0x3c56, 0x3f17, 0x41ce, 0x447a, 0x471c, 0x49b4, 0x4c3f, 0x4ebf, 0x5133, 0x539b, 0x55f5, 0x5842, 0x5a82, 0x5cb4, 0x5ed7, 0x60ec, 0x62f2, 0x64e8, 0x66cf, 0x68a6, 0x6a6d, 0x6c24, 0x6dca, 0x6f5f, 0x70e2, 0x7255, 0x73b5, 0x7504, 0x7641, 0x776c, 0x7884, 0x798a, 0x7a7d, 0x7b5d, 0x7c29, 0x7ce3, 0x7d8a, 0x7e1d, 0x7e9d, 0x7f09, 0x7f62, 0x7fa7, 0x7fd8, 0x7ff6, 0x7fff, 0x7ff6, 0x7fd8, 0x7fa7, 0x7f62, 0x7f09, 0x7e9d, 0x7e1d, 0x7d8a, 0x7ce3, 0x7c29, 0x7b5d, 0x7a7d, 0x798a, 0x7884, 0x776c, 0x7641, 0x7504, 0x73b5, 0x7255, 0x70e2, 0x6f5f, 0x6dca, 0x6c24, 0x6a6d, 0x68a6, 0x66cf, 0x64e8, 0x62f2, 0x60ec, 0x5ed7, 0x5cb4, 0x5a82, 0x5842, 0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4, 0x471c, 0x447a, 0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33de, 0x30fb, 0x2e11, 0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f19, 0x1c0b, 0x18f8, 0x15e2, 0x12c8, 0x0fab, 0x0c8b, 0x096a, 0x0647, 0x0324, -0x0000, -0x0324, -0x0647, -0x096a, -0x0c8b, -0x0fab, -0x12c8, -0x15e2, -0x18f8, -0x1c0b, -0x1f19, -0x2223, -0x2528, -0x2826, -0x2b1f, -0x2e11, -0x30fb, -0x33de, -0x36ba, -0x398c, -0x3c56, -0x3f17, -0x41ce, -0x447a, -0x471c, -0x49b4, -0x4c3f, -0x4ebf, -0x5133, -0x539b, -0x55f5, -0x5842, -0x5a82, -0x5cb4, -0x5ed7, -0x60ec, -0x62f2, -0x64e8, -0x66cf, -0x68a6, -0x6a6d, -0x6c24, -0x6dca, -0x6f5f, -0x70e2, -0x7255, -0x73b5, -0x7504, -0x7641, -0x776c, -0x7884, -0x798a, -0x7a7d, -0x7b5d, -0x7c29, -0x7ce3, -0x7d8a, -0x7e1d, -0x7e9d, -0x7f09, -0x7f62, -0x7fa7, -0x7fd8, -0x7ff6, -0x7fff, -0x7ff6, -0x7fd8, -0x7fa7, -0x7f62, -0x7f09, -0x7e9d, -0x7e1d, -0x7d8a, -0x7ce3, -0x7c29, -0x7b5d, -0x7a7d, -0x798a, -0x7884, -0x776c, -0x7641, -0x7504, -0x73b5, -0x7255, -0x70e2, -0x6f5f, -0x6dca, -0x6c24, -0x6a6d, -0x68a6, -0x66cf, -0x64e8, -0x62f2, -0x60ec, -0x5ed7, -0x5cb4, -0x5a82, -0x5842, -0x55f5, -0x539b, -0x5133, -0x4ebf, -0x4c3f, -0x49b4, -0x471c, -0x447a, -0x41ce, -0x3f17, -0x3c56, -0x398c, -0x36ba, -0x33de, -0x30fb, -0x2e11, -0x2b1f, -0x2826, -0x2528, -0x2223, -0x1f19, -0x1c0b, -0x18f8, -0x15e2, -0x12c8, -0x0fab, -0x0c8b, -0x096a, -0x0647, -0x0324}; ////////////////////////////////////////////////////////////////// // Optimised for Performance const int16 Dsp1::MulTable[256] = { 0x0000, 0x0003, 0x0006, 0x0009, 0x000c, 0x000f, 0x0012, 0x0015, 0x0019, 0x001c, 0x001f, 0x0022, 0x0025, 0x0028, 0x002b, 0x002f, 0x0032, 0x0035, 0x0038, 0x003b, 0x003e, 0x0041, 0x0045, 0x0048, 0x004b, 0x004e, 0x0051, 0x0054, 0x0057, 0x005b, 0x005e, 0x0061, 0x0064, 0x0067, 0x006a, 0x006d, 0x0071, 0x0074, 0x0077, 0x007a, 0x007d, 0x0080, 0x0083, 0x0087, 0x008a, 0x008d, 0x0090, 0x0093, 0x0096, 0x0099, 0x009d, 0x00a0, 0x00a3, 0x00a6, 0x00a9, 0x00ac, 0x00af, 0x00b3, 0x00b6, 0x00b9, 0x00bc, 0x00bf, 0x00c2, 0x00c5, 0x00c9, 0x00cc, 0x00cf, 0x00d2, 0x00d5, 0x00d8, 0x00db, 0x00df, 0x00e2, 0x00e5, 0x00e8, 0x00eb, 0x00ee, 0x00f1, 0x00f5, 0x00f8, 0x00fb, 0x00fe, 0x0101, 0x0104, 0x0107, 0x010b, 0x010e, 0x0111, 0x0114, 0x0117, 0x011a, 0x011d, 0x0121, 0x0124, 0x0127, 0x012a, 0x012d, 0x0130, 0x0133, 0x0137, 0x013a, 0x013d, 0x0140, 0x0143, 0x0146, 0x0149, 0x014d, 0x0150, 0x0153, 0x0156, 0x0159, 0x015c, 0x015f, 0x0163, 0x0166, 0x0169, 0x016c, 0x016f, 0x0172, 0x0175, 0x0178, 0x017c, 0x017f, 0x0182, 0x0185, 0x0188, 0x018b, 0x018e, 0x0192, 0x0195, 0x0198, 0x019b, 0x019e, 0x01a1, 0x01a4, 0x01a8, 0x01ab, 0x01ae, 0x01b1, 0x01b4, 0x01b7, 0x01ba, 0x01be, 0x01c1, 0x01c4, 0x01c7, 0x01ca, 0x01cd, 0x01d0, 0x01d4, 0x01d7, 0x01da, 0x01dd, 0x01e0, 0x01e3, 0x01e6, 0x01ea, 0x01ed, 0x01f0, 0x01f3, 0x01f6, 0x01f9, 0x01fc, 0x0200, 0x0203, 0x0206, 0x0209, 0x020c, 0x020f, 0x0212, 0x0216, 0x0219, 0x021c, 0x021f, 0x0222, 0x0225, 0x0228, 0x022c, 0x022f, 0x0232, 0x0235, 0x0238, 0x023b, 0x023e, 0x0242, 0x0245, 0x0248, 0x024b, 0x024e, 0x0251, 0x0254, 0x0258, 0x025b, 0x025e, 0x0261, 0x0264, 0x0267, 0x026a, 0x026e, 0x0271, 0x0274, 0x0277, 0x027a, 0x027d, 0x0280, 0x0284, 0x0287, 0x028a, 0x028d, 0x0290, 0x0293, 0x0296, 0x029a, 0x029d, 0x02a0, 0x02a3, 0x02a6, 0x02a9, 0x02ac, 0x02b0, 0x02b3, 0x02b6, 0x02b9, 0x02bc, 0x02bf, 0x02c2, 0x02c6, 0x02c9, 0x02cc, 0x02cf, 0x02d2, 0x02d5, 0x02d8, 0x02db, 0x02df, 0x02e2, 0x02e5, 0x02e8, 0x02eb, 0x02ee, 0x02f1, 0x02f5, 0x02f8, 0x02fb, 0x02fe, 0x0301, 0x0304, 0x0307, 0x030b, 0x030e, 0x0311, 0x0314, 0x0317, 0x031a, 0x031d, 0x0321}; ////////////////////////////////////////////////////////////////// // Data ROM, as logged from a DSP-1B with the 0x1f command; // it contains the tables and constants used by the commands. // The tables used are: two shift tables (0x022-0x031 and 0x031-0x040 -this last one // with an error in 0x03c which has survived to all the DSP-1 revisions-); a inverse // table (used as initial guess) at 0x065-0x0e4; a square root table (used also // as initial guess) at 0x0e5-0x115; two sin and cos tables (used as nodes to construct // a interpolation curve) at, respectively, 0x116-0x197 and 0x196-0x215. // As a curiosity, in the positions 0x21c-0x31c it's contained a // 257-points arccos table that, apparently, have been not used anywhere // (maybe for the MaxAZS_Exp table?). const uint16 Dsp1::DataRom[1024] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x7fff, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, 0x0100, 0x0080, 0x0040, 0x0020, 0x0001, 0x0008, 0x0004, 0x0002, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0xffe5, 0x0100, 0x7fff, 0x7f02, 0x7e08, 0x7d12, 0x7c1f, 0x7b30, 0x7a45, 0x795d, 0x7878, 0x7797, 0x76ba, 0x75df, 0x7507, 0x7433, 0x7361, 0x7293, 0x71c7, 0x70fe, 0x7038, 0x6f75, 0x6eb4, 0x6df6, 0x6d3a, 0x6c81, 0x6bca, 0x6b16, 0x6a64, 0x69b4, 0x6907, 0x685b, 0x67b2, 0x670b, 0x6666, 0x65c4, 0x6523, 0x6484, 0x63e7, 0x634c, 0x62b3, 0x621c, 0x6186, 0x60f2, 0x6060, 0x5fd0, 0x5f41, 0x5eb5, 0x5e29, 0x5d9f, 0x5d17, 0x5c91, 0x5c0c, 0x5b88, 0x5b06, 0x5a85, 0x5a06, 0x5988, 0x590b, 0x5890, 0x5816, 0x579d, 0x5726, 0x56b0, 0x563b, 0x55c8, 0x5555, 0x54e4, 0x5474, 0x5405, 0x5398, 0x532b, 0x52bf, 0x5255, 0x51ec, 0x5183, 0x511c, 0x50b6, 0x5050, 0x4fec, 0x4f89, 0x4f26, 0x4ec5, 0x4e64, 0x4e05, 0x4da6, 0x4d48, 0x4cec, 0x4c90, 0x4c34, 0x4bda, 0x4b81, 0x4b28, 0x4ad0, 0x4a79, 0x4a23, 0x49cd, 0x4979, 0x4925, 0x48d1, 0x487f, 0x482d, 0x47dc, 0x478c, 0x473c, 0x46ed, 0x469f, 0x4651, 0x4604, 0x45b8, 0x456c, 0x4521, 0x44d7, 0x448d, 0x4444, 0x43fc, 0x43b4, 0x436d, 0x4326, 0x42e0, 0x429a, 0x4255, 0x4211, 0x41cd, 0x4189, 0x4146, 0x4104, 0x40c2, 0x4081, 0x4040, 0x3fff, 0x41f7, 0x43e1, 0x45bd, 0x478d, 0x4951, 0x4b0b, 0x4cbb, 0x4e61, 0x4fff, 0x5194, 0x5322, 0x54a9, 0x5628, 0x57a2, 0x5914, 0x5a81, 0x5be9, 0x5d4a, 0x5ea7, 0x5fff, 0x6152, 0x62a0, 0x63ea, 0x6530, 0x6672, 0x67b0, 0x68ea, 0x6a20, 0x6b53, 0x6c83, 0x6daf, 0x6ed9, 0x6fff, 0x7122, 0x7242, 0x735f, 0x747a, 0x7592, 0x76a7, 0x77ba, 0x78cb, 0x79d9, 0x7ae5, 0x7bee, 0x7cf5, 0x7dfa, 0x7efe, 0x7fff, 0x0000, 0x0324, 0x0647, 0x096a, 0x0c8b, 0x0fab, 0x12c8, 0x15e2, 0x18f8, 0x1c0b, 0x1f19, 0x2223, 0x2528, 0x2826, 0x2b1f, 0x2e11, 0x30fb, 0x33de, 0x36ba, 0x398c, 0x3c56, 0x3f17, 0x41ce, 0x447a, 0x471c, 0x49b4, 0x4c3f, 0x4ebf, 0x5133, 0x539b, 0x55f5, 0x5842, 0x5a82, 0x5cb4, 0x5ed7, 0x60ec, 0x62f2, 0x64e8, 0x66cf, 0x68a6, 0x6a6d, 0x6c24, 0x6dca, 0x6f5f, 0x70e2, 0x7255, 0x73b5, 0x7504, 0x7641, 0x776c, 0x7884, 0x798a, 0x7a7d, 0x7b5d, 0x7c29, 0x7ce3, 0x7d8a, 0x7e1d, 0x7e9d, 0x7f09, 0x7f62, 0x7fa7, 0x7fd8, 0x7ff6, 0x7fff, 0x7ff6, 0x7fd8, 0x7fa7, 0x7f62, 0x7f09, 0x7e9d, 0x7e1d, 0x7d8a, 0x7ce3, 0x7c29, 0x7b5d, 0x7a7d, 0x798a, 0x7884, 0x776c, 0x7641, 0x7504, 0x73b5, 0x7255, 0x70e2, 0x6f5f, 0x6dca, 0x6c24, 0x6a6d, 0x68a6, 0x66cf, 0x64e8, 0x62f2, 0x60ec, 0x5ed7, 0x5cb4, 0x5a82, 0x5842, 0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4, 0x471c, 0x447a, 0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33de, 0x30fb, 0x2e11, 0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f19, 0x1c0b, 0x18f8, 0x15e2, 0x12c8, 0x0fab, 0x0c8b, 0x096a, 0x0647, 0x0324, 0x7fff, 0x7ff6, 0x7fd8, 0x7fa7, 0x7f62, 0x7f09, 0x7e9d, 0x7e1d, 0x7d8a, 0x7ce3, 0x7c29, 0x7b5d, 0x7a7d, 0x798a, 0x7884, 0x776c, 0x7641, 0x7504, 0x73b5, 0x7255, 0x70e2, 0x6f5f, 0x6dca, 0x6c24, 0x6a6d, 0x68a6, 0x66cf, 0x64e8, 0x62f2, 0x60ec, 0x5ed7, 0x5cb4, 0x5a82, 0x5842, 0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4, 0x471c, 0x447a, 0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33de, 0x30fb, 0x2e11, 0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f19, 0x1c0b, 0x18f8, 0x15e2, 0x12c8, 0x0fab, 0x0c8b, 0x096a, 0x0647, 0x0324, 0x0000, 0xfcdc, 0xf9b9, 0xf696, 0xf375, 0xf055, 0xed38, 0xea1e, 0xe708, 0xe3f5, 0xe0e7, 0xdddd, 0xdad8, 0xd7da, 0xd4e1, 0xd1ef, 0xcf05, 0xcc22, 0xc946, 0xc674, 0xc3aa, 0xc0e9, 0xbe32, 0xbb86, 0xb8e4, 0xb64c, 0xb3c1, 0xb141, 0xaecd, 0xac65, 0xaa0b, 0xa7be, 0xa57e, 0xa34c, 0xa129, 0x9f14, 0x9d0e, 0x9b18, 0x9931, 0x975a, 0x9593, 0x93dc, 0x9236, 0x90a1, 0x8f1e, 0x8dab, 0x8c4b, 0x8afc, 0x89bf, 0x8894, 0x877c, 0x8676, 0x8583, 0x84a3, 0x83d7, 0x831d, 0x8276, 0x81e3, 0x8163, 0x80f7, 0x809e, 0x8059, 0x8028, 0x800a, 0x6488, 0x0080, 0x03ff, 0x0116, 0x0002, 0x0080, 0x4000, 0x3fd7, 0x3faf, 0x3f86, 0x3f5d, 0x3f34, 0x3f0c, 0x3ee3, 0x3eba, 0x3e91, 0x3e68, 0x3e40, 0x3e17, 0x3dee, 0x3dc5, 0x3d9c, 0x3d74, 0x3d4b, 0x3d22, 0x3cf9, 0x3cd0, 0x3ca7, 0x3c7f, 0x3c56, 0x3c2d, 0x3c04, 0x3bdb, 0x3bb2, 0x3b89, 0x3b60, 0x3b37, 0x3b0e, 0x3ae5, 0x3abc, 0x3a93, 0x3a69, 0x3a40, 0x3a17, 0x39ee, 0x39c5, 0x399c, 0x3972, 0x3949, 0x3920, 0x38f6, 0x38cd, 0x38a4, 0x387a, 0x3851, 0x3827, 0x37fe, 0x37d4, 0x37aa, 0x3781, 0x3757, 0x372d, 0x3704, 0x36da, 0x36b0, 0x3686, 0x365c, 0x3632, 0x3609, 0x35df, 0x35b4, 0x358a, 0x3560, 0x3536, 0x350c, 0x34e1, 0x34b7, 0x348d, 0x3462, 0x3438, 0x340d, 0x33e3, 0x33b8, 0x338d, 0x3363, 0x3338, 0x330d, 0x32e2, 0x32b7, 0x328c, 0x3261, 0x3236, 0x320b, 0x31df, 0x31b4, 0x3188, 0x315d, 0x3131, 0x3106, 0x30da, 0x30ae, 0x3083, 0x3057, 0x302b, 0x2fff, 0x2fd2, 0x2fa6, 0x2f7a, 0x2f4d, 0x2f21, 0x2ef4, 0x2ec8, 0x2e9b, 0x2e6e, 0x2e41, 0x2e14, 0x2de7, 0x2dba, 0x2d8d, 0x2d60, 0x2d32, 0x2d05, 0x2cd7, 0x2ca9, 0x2c7b, 0x2c4d, 0x2c1f, 0x2bf1, 0x2bc3, 0x2b94, 0x2b66, 0x2b37, 0x2b09, 0x2ada, 0x2aab, 0x2a7c, 0x2a4c, 0x2a1d, 0x29ed, 0x29be, 0x298e, 0x295e, 0x292e, 0x28fe, 0x28ce, 0x289d, 0x286d, 0x283c, 0x280b, 0x27da, 0x27a9, 0x2777, 0x2746, 0x2714, 0x26e2, 0x26b0, 0x267e, 0x264c, 0x2619, 0x25e7, 0x25b4, 0x2581, 0x254d, 0x251a, 0x24e6, 0x24b2, 0x247e, 0x244a, 0x2415, 0x23e1, 0x23ac, 0x2376, 0x2341, 0x230b, 0x22d6, 0x229f, 0x2269, 0x2232, 0x21fc, 0x21c4, 0x218d, 0x2155, 0x211d, 0x20e5, 0x20ad, 0x2074, 0x203b, 0x2001, 0x1fc7, 0x1f8d, 0x1f53, 0x1f18, 0x1edd, 0x1ea1, 0x1e66, 0x1e29, 0x1ded, 0x1db0, 0x1d72, 0x1d35, 0x1cf6, 0x1cb8, 0x1c79, 0x1c39, 0x1bf9, 0x1bb8, 0x1b77, 0x1b36, 0x1af4, 0x1ab1, 0x1a6e, 0x1a2a, 0x19e6, 0x19a1, 0x195c, 0x1915, 0x18ce, 0x1887, 0x183f, 0x17f5, 0x17ac, 0x1761, 0x1715, 0x16c9, 0x167c, 0x162e, 0x15df, 0x158e, 0x153d, 0x14eb, 0x1497, 0x1442, 0x13ec, 0x1395, 0x133c, 0x12e2, 0x1286, 0x1228, 0x11c9, 0x1167, 0x1104, 0x109e, 0x1036, 0x0fcc, 0x0f5f, 0x0eef, 0x0e7b, 0x0e04, 0x0d89, 0x0d0a, 0x0c86, 0x0bfd, 0x0b6d, 0x0ad6, 0x0a36, 0x098d, 0x08d7, 0x0811, 0x0736, 0x063e, 0x0519, 0x039a, 0x0000, 0x7fff, 0x0100, 0x0080, 0x021d, 0x00c8, 0x00ce, 0x0048, 0x0a26, 0x277a, 0x00ce, 0x6488, 0x14ac, 0x0001, 0x00f9, 0x00fc, 0x00ff, 0x00fc, 0x00f9, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}; ////////////////////////////////////////////////////////////////// #endif ruby/video/cgl.cpp000664 001750 001750 00000010676 12651764221 015262 0ustar00sergiosergio000000 000000 #include "opengl/opengl.hpp" namespace ruby { class pVideoCGL; } @interface RubyVideoCGL : NSOpenGLView { @public ruby::pVideoCGL* video; } -(id) initWith:(ruby::pVideoCGL*)video pixelFormat:(NSOpenGLPixelFormat*)pixelFormat; -(void) reshape; @end namespace ruby { struct pVideoCGL : OpenGL { RubyVideoCGL* view; struct { NSView* handle; bool synchronize; unsigned filter; string shader; } settings; bool cap(const string& name) { if(name == Video::Handle) return true; if(name == Video::Synchronize) return true; if(name == Video::Filter) return true; if(name == Video::Shader) return true; return false; } any get(const string& name) { if(name == Video::Handle) return (uintptr_t)settings.handle; if(name == Video::Synchronize) return settings.synchronize; if(name == Video::Filter) return settings.filter; return false; } bool set(const string& name, const any& value) { if(name == Video::Handle) { settings.handle = (NSView*)any_cast(value); return true; } if(name == Video::Synchronize) { if(settings.synchronize != any_cast(value)) { settings.synchronize = any_cast(value); if(view) { @autoreleasepool { [[view openGLContext] makeCurrentContext]; int synchronize = settings.synchronize; [[view openGLContext] setValues:&synchronize forParameter:NSOpenGLCPSwapInterval]; } } } return true; } if(name == Video::Filter) { settings.filter = any_cast(value); if(settings.shader.empty()) OpenGL::filter = settings.filter ? GL_LINEAR : GL_NEAREST; return true; } if(name == Video::Shader) { settings.shader = any_cast(value); @autoreleasepool { [[view openGLContext] makeCurrentContext]; } OpenGL::shader(settings.shader); if(settings.shader.empty()) OpenGL::filter = settings.filter ? GL_LINEAR : GL_NEAREST; return true; } return false; } bool lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) { OpenGL::size(width, height); return OpenGL::lock(data, pitch); } void unlock() { } void clear() { @autoreleasepool { [view lockFocus]; OpenGL::clear(); [[view openGLContext] flushBuffer]; [view unlockFocus]; } } void refresh() { @autoreleasepool { if([view lockFocusIfCanDraw]) { auto area = [view frame]; outputWidth = area.size.width, outputHeight = area.size.height; OpenGL::refresh(); [[view openGLContext] flushBuffer]; [view unlockFocus]; } } } bool init() { term(); @autoreleasepool { NSOpenGLPixelFormatAttribute attributes[] = { NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, NSOpenGLPFAColorSize, 24, NSOpenGLPFAAlphaSize, 8, NSOpenGLPFADoubleBuffer, 0 }; auto size = [settings.handle frame].size; auto format = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease]; auto context = [[[NSOpenGLContext alloc] initWithFormat:format shareContext:nil] autorelease]; view = [[RubyVideoCGL alloc] initWith:this pixelFormat:format]; [view setOpenGLContext:context]; [view setFrame:NSMakeRect(0, 0, size.width, size.height)]; [view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [settings.handle addSubview:view]; [context setView:view]; [view lockFocus]; OpenGL::init(); //print((const char*)glGetString(GL_VERSION), "\n"); int synchronize = settings.synchronize; [[view openGLContext] setValues:&synchronize forParameter:NSOpenGLCPSwapInterval]; [view unlockFocus]; } clear(); return true; } void term() { OpenGL::term(); @autoreleasepool { [view removeFromSuperview]; [view release]; view = nil; } } pVideoCGL() { view = nil; settings.handle = nil; settings.synchronize = false; settings.filter = 0; } ~pVideoCGL() { term(); } }; DeclareVideo(CGL) } @implementation RubyVideoCGL : NSOpenGLView -(id) initWith:(ruby::pVideoCGL*)videoPointer pixelFormat:(NSOpenGLPixelFormat*)pixelFormat { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0) pixelFormat:pixelFormat]) { video = videoPointer; } return self; } -(void) reshape { video->refresh(); } @end sfc/alt/ppu-balanced/render/line.cpp000664 001750 001750 00000005733 12651764221 020520 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP inline uint16 PPU::get_palette(uint8 index) { const unsigned addr = index << 1; return cgram[addr] + (cgram[addr + 1] << 8); } //p = 00000bgr //t = BBGGGRRR //r = 0BBb00GGGg0RRRr0 inline uint16 PPU::get_direct_color(uint8 p, uint8 t) { return ((t & 7) << 2) | ((p & 1) << 1) | (((t >> 3) & 7) << 7) | (((p >> 1) & 1) << 6) | ((t >> 6) << 13) | ((p >> 2) << 12); } inline uint16 PPU::get_pixel_normal(uint32 x) { pixel_t& p = pixel_cache[x]; uint16 src_main, src_sub; uint8 bg_sub; src_main = p.src_main; if(!regs.addsub_mode) { bg_sub = BACK; src_sub = regs.color_rgb; } else { bg_sub = p.bg_sub; src_sub = p.src_sub; } if(!window[COL].main[x]) { if(!window[COL].sub[x]) { return 0x0000; } src_main = 0x0000; } if(!p.ce_main && regs.color_enabled[p.bg_main] && window[COL].sub[x]) { bool halve = false; if(regs.color_halve && window[COL].main[x]) { if(regs.addsub_mode && bg_sub == BACK); else { halve = true; } } return addsub(src_main, src_sub, halve); } return src_main; } inline uint16 PPU::get_pixel_swap(uint32 x) { pixel_t& p = pixel_cache[x]; uint16 src_main, src_sub; uint8 bg_sub; src_main = p.src_sub; if(!regs.addsub_mode) { bg_sub = BACK; src_sub = regs.color_rgb; } else { bg_sub = p.bg_main; src_sub = p.src_main; } if(!window[COL].main[x]) { if(!window[COL].sub[x]) { return 0x0000; } src_main = 0x0000; } if(!p.ce_sub && regs.color_enabled[p.bg_sub] && window[COL].sub[x]) { bool halve = false; if(regs.color_halve && window[COL].main[x]) { if(regs.addsub_mode && bg_sub == BACK); else { halve = true; } } return addsub(src_main, src_sub, halve); } return src_main; } inline void PPU::render_line_output() { uint32* ptr = (uint32*)output + (line * 1024) + ((interlace() && field()) ? 512 : 0); uint32 curr, prev; if(!regs.pseudo_hires && regs.bg_mode != 5 && regs.bg_mode != 6) { for(unsigned x = 0; x < 256; x++) { curr = (regs.display_brightness << 15) | get_pixel_normal(x); *ptr++ = curr; } } else { for(unsigned x = 0, prev = 0; x < 256; x++) { //blending is disabled below, as this should be done via video filtering //blending code is left for reference purposes curr = (regs.display_brightness << 15) | get_pixel_swap(x); *ptr++ = curr; //(prev + curr - ((prev ^ curr) & 0x0421)) >> 1; //prev = curr; curr = (regs.display_brightness << 15) | get_pixel_normal(x); *ptr++ = curr; //(prev + curr - ((prev ^ curr) & 0x0421)) >> 1; //prev = curr; } } } inline void PPU::render_line_clear() { uint32* ptr = (uint32*)output + (line * 1024) + ((interlace() && field()) ? 512 : 0); unsigned width = (!regs.pseudo_hires && regs.bg_mode != 5 && regs.bg_mode != 6) ? 256 : 512; memset(ptr, 0, width * 2 * sizeof(uint32)); } #endif ruby/audio/oss.cpp000664 001750 001750 00000005072 12651764221 015306 0ustar00sergiosergio000000 000000 /* audio.oss (2007-12-26) author: Nach */ #include #include #include #include //OSS4 soundcard.h includes below SNDCTL defines, but OSS3 does not //However, OSS4 soundcard.h does not reside in //Therefore, attempt to manually define SNDCTL values if using OSS3 header //Note that if the defines below fail to work on any specific platform, one can point soundcard.h //above to the correct location for OSS4 (usually /usr/lib/oss/include/sys/soundcard.h) //Failing that, one can disable OSS4 ioctl calls inside init() and remove the below defines #ifndef SNDCTL_DSP_COOKEDMODE #define SNDCTL_DSP_COOKEDMODE _IOW('P', 30, int) #endif #ifndef SNDCTL_DSP_POLICY #define SNDCTL_DSP_POLICY _IOW('P', 45, int) #endif namespace ruby { class pAudioOSS { public: struct { int fd; int format; int channels; const char* name; } device; struct { unsigned frequency; } settings; bool cap(const string& name) { if(name == Audio::Frequency) return true; return false; } any get(const string& name) { if(name == Audio::Frequency) return settings.frequency; return false; } bool set(const string& name, const any& value) { if(name == Audio::Frequency) { settings.frequency = any_cast(value); if(device.fd > 0) init(); return true; } return false; } void sample(uint16_t sl, uint16_t sr) { uint32_t sample = sl + (sr << 16); unsigned unused = write(device.fd, &sample, 4); } void clear() { } bool init() { term(); device.fd = open(device.name, O_WRONLY, O_NONBLOCK); if(device.fd < 0) return false; #if 1 //SOUND_VERSION >= 0x040000 //attempt to enable OSS4-specific features regardless of version //OSS3 ioctl calls will silently fail, but sound will still work int cooked = 1, policy = 4; //policy should be 0 - 10, lower = less latency, more CPU usage ioctl(device.fd, SNDCTL_DSP_COOKEDMODE, &cooked); ioctl(device.fd, SNDCTL_DSP_POLICY, &policy); #endif int freq = settings.frequency; ioctl(device.fd, SNDCTL_DSP_CHANNELS, &device.channels); ioctl(device.fd, SNDCTL_DSP_SETFMT, &device.format); ioctl(device.fd, SNDCTL_DSP_SPEED, &freq); return true; } void term() { if(device.fd > 0) { close(device.fd); device.fd = -1; } } pAudioOSS() { device.fd = -1; device.format = AFMT_S16_LE; device.channels = 2; device.name = "/dev/dsp"; settings.frequency = 22050; } ~pAudioOSS() { term(); } }; DeclareAudio(OSS) }; sfc/alt/smp/core/op_read.cpp000664 001750 001750 00000027117 12651764221 017117 0ustar00sergiosergio000000 000000 case 0x88: { rd = op_readpc(); regs.a = op_adc(regs.a, rd); break; } case 0x28: { rd = op_readpc(); regs.a = op_and(regs.a, rd); break; } case 0x68: { rd = op_readpc(); regs.a = op_cmp(regs.a, rd); break; } case 0xc8: { rd = op_readpc(); regs.x = op_cmp(regs.x, rd); break; } case 0xad: { rd = op_readpc(); regs.y = op_cmp(regs.y, rd); break; } case 0x48: { rd = op_readpc(); regs.a = op_eor(regs.a, rd); break; } case 0x08: { rd = op_readpc(); regs.a = op_or(regs.a, rd); break; } case 0xa8: { rd = op_readpc(); regs.a = op_sbc(regs.a, rd); break; } case 0x86: { op_io(); rd = op_readdp(regs.x); regs.a = op_adc(regs.a, rd); break; } case 0x26: { op_io(); rd = op_readdp(regs.x); regs.a = op_and(regs.a, rd); break; } case 0x66: { op_io(); rd = op_readdp(regs.x); regs.a = op_cmp(regs.a, rd); break; } case 0x46: { op_io(); rd = op_readdp(regs.x); regs.a = op_eor(regs.a, rd); break; } case 0x06: { op_io(); rd = op_readdp(regs.x); regs.a = op_or(regs.a, rd); break; } case 0xa6: { op_io(); rd = op_readdp(regs.x); regs.a = op_sbc(regs.a, rd); break; } case 0x84: { dp = op_readpc(); rd = op_readdp(dp); regs.a = op_adc(regs.a, rd); break; } case 0x24: { dp = op_readpc(); rd = op_readdp(dp); regs.a = op_and(regs.a, rd); break; } case 0x64: { dp = op_readpc(); rd = op_readdp(dp); regs.a = op_cmp(regs.a, rd); break; } case 0x3e: { dp = op_readpc(); rd = op_readdp(dp); regs.x = op_cmp(regs.x, rd); break; } case 0x7e: { dp = op_readpc(); rd = op_readdp(dp); regs.y = op_cmp(regs.y, rd); break; } case 0x44: { dp = op_readpc(); rd = op_readdp(dp); regs.a = op_eor(regs.a, rd); break; } case 0x04: { dp = op_readpc(); rd = op_readdp(dp); regs.a = op_or(regs.a, rd); break; } case 0xa4: { dp = op_readpc(); rd = op_readdp(dp); regs.a = op_sbc(regs.a, rd); break; } case 0x94: { dp = op_readpc(); op_io(); rd = op_readdp(dp + regs.x); regs.a = op_adc(regs.a, rd); break; } case 0x34: { dp = op_readpc(); op_io(); rd = op_readdp(dp + regs.x); regs.a = op_and(regs.a, rd); break; } case 0x74: { dp = op_readpc(); op_io(); rd = op_readdp(dp + regs.x); regs.a = op_cmp(regs.a, rd); break; } case 0x54: { dp = op_readpc(); op_io(); rd = op_readdp(dp + regs.x); regs.a = op_eor(regs.a, rd); break; } case 0x14: { dp = op_readpc(); op_io(); rd = op_readdp(dp + regs.x); regs.a = op_or(regs.a, rd); break; } case 0xb4: { dp = op_readpc(); op_io(); rd = op_readdp(dp + regs.x); regs.a = op_sbc(regs.a, rd); break; } case 0x85: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); regs.a = op_adc(regs.a, rd); break; } case 0x25: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); regs.a = op_and(regs.a, rd); break; } case 0x65: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); regs.a = op_cmp(regs.a, rd); break; } case 0x1e: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); regs.x = op_cmp(regs.x, rd); break; } case 0x5e: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); regs.y = op_cmp(regs.y, rd); break; } case 0x45: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); regs.a = op_eor(regs.a, rd); break; } case 0x05: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); regs.a = op_or(regs.a, rd); break; } case 0xa5: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); regs.a = op_sbc(regs.a, rd); break; } case 0x95: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); rd = op_readaddr(dp + regs.x); regs.a = op_adc(regs.a, rd); break; } case 0x96: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); rd = op_readaddr(dp + regs.y); regs.a = op_adc(regs.a, rd); break; } case 0x35: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); rd = op_readaddr(dp + regs.x); regs.a = op_and(regs.a, rd); break; } case 0x36: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); rd = op_readaddr(dp + regs.y); regs.a = op_and(regs.a, rd); break; } case 0x75: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); rd = op_readaddr(dp + regs.x); regs.a = op_cmp(regs.a, rd); break; } case 0x76: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); rd = op_readaddr(dp + regs.y); regs.a = op_cmp(regs.a, rd); break; } case 0x55: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); rd = op_readaddr(dp + regs.x); regs.a = op_eor(regs.a, rd); break; } case 0x56: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); rd = op_readaddr(dp + regs.y); regs.a = op_eor(regs.a, rd); break; } case 0x15: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); rd = op_readaddr(dp + regs.x); regs.a = op_or(regs.a, rd); break; } case 0x16: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); rd = op_readaddr(dp + regs.y); regs.a = op_or(regs.a, rd); break; } case 0xb5: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); rd = op_readaddr(dp + regs.x); regs.a = op_sbc(regs.a, rd); break; } case 0xb6: { dp = op_readpc(); dp |= op_readpc() << 8; op_io(); rd = op_readaddr(dp + regs.y); regs.a = op_sbc(regs.a, rd); break; } case 0x87: { dp = op_readpc() + regs.x; op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; rd = op_readaddr(sp); regs.a = op_adc(regs.a, rd); break; } case 0x27: { dp = op_readpc() + regs.x; op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; rd = op_readaddr(sp); regs.a = op_and(regs.a, rd); break; } case 0x67: { dp = op_readpc() + regs.x; op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; rd = op_readaddr(sp); regs.a = op_cmp(regs.a, rd); break; } case 0x47: { dp = op_readpc() + regs.x; op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; rd = op_readaddr(sp); regs.a = op_eor(regs.a, rd); break; } case 0x07: { dp = op_readpc() + regs.x; op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; rd = op_readaddr(sp); regs.a = op_or(regs.a, rd); break; } case 0xa7: { dp = op_readpc() + regs.x; op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; rd = op_readaddr(sp); regs.a = op_sbc(regs.a, rd); break; } case 0x97: { dp = op_readpc(); op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; rd = op_readaddr(sp + regs.y); regs.a = op_adc(regs.a, rd); break; } case 0x37: { dp = op_readpc(); op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; rd = op_readaddr(sp + regs.y); regs.a = op_and(regs.a, rd); break; } case 0x77: { dp = op_readpc(); op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; rd = op_readaddr(sp + regs.y); regs.a = op_cmp(regs.a, rd); break; } case 0x57: { dp = op_readpc(); op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; rd = op_readaddr(sp + regs.y); regs.a = op_eor(regs.a, rd); break; } case 0x17: { dp = op_readpc(); op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; rd = op_readaddr(sp + regs.y); regs.a = op_or(regs.a, rd); break; } case 0xb7: { dp = op_readpc(); op_io(); sp = op_readdp(dp); sp |= op_readdp(dp + 1) << 8; rd = op_readaddr(sp + regs.y); regs.a = op_sbc(regs.a, rd); break; } case 0x99: { op_io(); rd = op_readdp(regs.y); wr = op_readdp(regs.x); wr = op_adc(wr, rd); (1) ? op_writedp(regs.x, wr) : op_io(); break; } case 0x39: { op_io(); rd = op_readdp(regs.y); wr = op_readdp(regs.x); wr = op_and(wr, rd); (1) ? op_writedp(regs.x, wr) : op_io(); break; } case 0x79: { op_io(); rd = op_readdp(regs.y); wr = op_readdp(regs.x); wr = op_cmp(wr, rd); (0) ? op_writedp(regs.x, wr) : op_io(); break; } case 0x59: { op_io(); rd = op_readdp(regs.y); wr = op_readdp(regs.x); wr = op_eor(wr, rd); (1) ? op_writedp(regs.x, wr) : op_io(); break; } case 0x19: { op_io(); rd = op_readdp(regs.y); wr = op_readdp(regs.x); wr = op_or(wr, rd); (1) ? op_writedp(regs.x, wr) : op_io(); break; } case 0xb9: { op_io(); rd = op_readdp(regs.y); wr = op_readdp(regs.x); wr = op_sbc(wr, rd); (1) ? op_writedp(regs.x, wr) : op_io(); break; } case 0x89: { sp = op_readpc(); rd = op_readdp(sp); dp = op_readpc(); wr = op_readdp(dp); wr = op_adc(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); break; } case 0x29: { sp = op_readpc(); rd = op_readdp(sp); dp = op_readpc(); wr = op_readdp(dp); wr = op_and(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); break; } case 0x69: { sp = op_readpc(); rd = op_readdp(sp); dp = op_readpc(); wr = op_readdp(dp); wr = op_cmp(wr, rd); (0) ? op_writedp(dp, wr) : op_io(); break; } case 0x49: { sp = op_readpc(); rd = op_readdp(sp); dp = op_readpc(); wr = op_readdp(dp); wr = op_eor(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); break; } case 0x09: { sp = op_readpc(); rd = op_readdp(sp); dp = op_readpc(); wr = op_readdp(dp); wr = op_or(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); break; } case 0xa9: { sp = op_readpc(); rd = op_readdp(sp); dp = op_readpc(); wr = op_readdp(dp); wr = op_sbc(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); break; } case 0x98: { rd = op_readpc(); dp = op_readpc(); wr = op_readdp(dp); wr = op_adc(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); break; } case 0x38: { rd = op_readpc(); dp = op_readpc(); wr = op_readdp(dp); wr = op_and(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); break; } case 0x78: { rd = op_readpc(); dp = op_readpc(); wr = op_readdp(dp); wr = op_cmp(wr, rd); (0) ? op_writedp(dp, wr) : op_io(); break; } case 0x58: { rd = op_readpc(); dp = op_readpc(); wr = op_readdp(dp); wr = op_eor(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); break; } case 0x18: { rd = op_readpc(); dp = op_readpc(); wr = op_readdp(dp); wr = op_or(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); break; } case 0xb8: { rd = op_readpc(); dp = op_readpc(); wr = op_readdp(dp); wr = op_sbc(wr, rd); (1) ? op_writedp(dp, wr) : op_io(); break; } case 0x7a: { dp = op_readpc(); rd = op_readdp(dp); op_io(); rd |= op_readdp(dp + 1) << 8; regs.ya = op_addw(regs.ya, rd); break; } case 0x9a: { dp = op_readpc(); rd = op_readdp(dp); op_io(); rd |= op_readdp(dp + 1) << 8; regs.ya = op_subw(regs.ya, rd); break; } case 0x5a: { dp = op_readpc(); rd = op_readdp(dp); rd |= op_readdp(dp + 1) << 8; op_cmpw(regs.ya, rd); break; } case 0x4a: { dp = op_readpc(); dp |= op_readpc() << 8; bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); regs.p.c = regs.p.c & !!(rd & (1 << bit)); break; } case 0x6a: { dp = op_readpc(); dp |= op_readpc() << 8; bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); regs.p.c = regs.p.c & !(rd & (1 << bit)); break; } case 0x8a: { dp = op_readpc(); dp |= op_readpc() << 8; bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); op_io(); regs.p.c = regs.p.c ^ !!(rd & (1 << bit)); break; } case 0xea: { dp = op_readpc(); dp |= op_readpc() << 8; bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); rd ^= (1 << bit); op_writeaddr(dp, rd); break; } case 0x0a: { dp = op_readpc(); dp |= op_readpc() << 8; bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); op_io(); regs.p.c = regs.p.c | !!(rd & (1 << bit)); break; } case 0x2a: { dp = op_readpc(); dp |= op_readpc() << 8; bit = dp >> 13; dp &= 0x1fff; rd = op_readaddr(dp); op_io(); regs.p.c = regs.p.c | !(rd & (1 << bit)); break; } gba/apu/square2.cpp000664 001750 001750 00000002550 12651764221 015316 0ustar00sergiosergio000000 000000 uint8 APU::Square2::read(unsigned addr) const { switch(addr) { case 1: return (length << 0) | (duty << 6); case 2: return (envelope.frequency << 0) | (envelope.direction << 3) | (envelope.volume << 4); case 3: return (frequency >> 0); case 4: return (frequency >> 8) | (counter << 6) | (initialize << 7); } } void APU::Square2::write(unsigned addr, uint8 byte) { switch(addr) { case 1: //NR21 length = byte >> 0; duty = byte >> 6; break; case 2: //NR22 envelope.frequency = byte >> 0; envelope.direction = byte >> 3; envelope.volume = byte >> 4; if(envelope.dacenable() == false) enable = false; break; case 3: //NR23 frequency = (frequency & 0xff00) | (byte << 0); break; case 4: //NR24 frequency = (frequency & 0x00ff) | (byte << 8); counter = byte >> 6; initialize = byte >> 7; if(initialize) { enable = envelope.dacenable(); period = 2 * (2048 - frequency); envelope.period = envelope.frequency; volume = envelope.volume; } break; } } void APU::Square2::power() { envelope.frequency = 0; envelope.direction = 0; envelope.direction = 0; envelope.period = 0; enable = 0; length = 0; duty = 0; frequency = 0; counter = 0; initialize = 0; shadowfrequency = 0; signal = 0; output = 0; period = 0; phase = 0; volume = 0; } nall/windows/guid.hpp000664 001750 001750 00000001407 12651764221 015773 0ustar00sergiosergio000000 000000 #ifndef NALL_WINDOWS_GUID_HPP #define NALL_WINDOWS_GUID_HPP #include #include namespace nall { //generate unique GUID inline string guid() { random_lfsr lfsr; lfsr.seed(time(nullptr)); for(unsigned n = 0; n < 256; n++) lfsr(); string output; for(unsigned n = 0; n < 4; n++) output.append(hex<2>(lfsr())); output.append("-"); for(unsigned n = 0; n < 2; n++) output.append(hex<2>(lfsr())); output.append("-"); for(unsigned n = 0; n < 2; n++) output.append(hex<2>(lfsr())); output.append("-"); for(unsigned n = 0; n < 2; n++) output.append(hex<2>(lfsr())); output.append("-"); for(unsigned n = 0; n < 6; n++) output.append(hex<2>(lfsr())); return {"{", output, "}"}; } } #endif gba/player/player.cpp000664 001750 001750 00000004453 12651764221 015743 0ustar00sergiosergio000000 000000 #include namespace GameBoyAdvance { //Game Boy Player emulation #include "serialization.cpp" Player player; void Player::power() { status.enable = false; status.rumble = false; status.logoDetected = false; status.logoCounter = 0; status.packet = 0; status.send = 0; status.recv = 0; } void Player::frame() { uint32 hash = crc32_calculate((const uint8*)ppu.output, 240 * 160 * sizeof(uint32)); status.logoDetected = (hash == 0x7776eb55); if(status.logoDetected) { status.enable = true; status.logoCounter = (status.logoCounter + 1) % 3; status.packet = 0; } if(status.enable == false) return; if(cpu.regs.joybus.settings == 0x0000 && cpu.regs.serial.control == 0x5088) { status.packet = (status.packet + 1) % 17; switch(status.packet) { case 0: status.send = 0x0000494e; break; case 1: status.send = 0xb6b1494e; break; case 2: status.send = 0xb6b1494e; break; case 3: status.send = 0xb6b1544e; break; case 4: status.send = 0xabb1544e; break; case 5: status.send = 0xabb14e45; break; case 6: status.send = 0xb1ba4e45; break; case 7: status.send = 0xb1ba4f44; break; case 8: status.send = 0xb0bb4f44; break; case 9: status.send = 0xb0bb8002; break; case 10: status.send = 0x10000010; break; case 11: status.send = 0x20000013; break; case 12: status.send = 0x30000003; break; case 13: status.send = 0x30000003; break; case 14: status.send = 0x30000003; break; case 15: status.send = 0x30000003; break; case 16: status.send = 0x30000003; break; } cpu.regs.irq.flag.serial = true; } } optional Player::keyinput() { if(status.logoDetected == false) return false; switch(status.logoCounter) { case 0: return {true, 0x03ff}; case 1: return {true, 0x03ff}; case 2: return {true, 0x030f}; } unreachable; } optional Player::read() { if(status.enable == false) return false; return {true, status.send}; } void Player::write(uint8 byte, uint2 addr) { if(status.enable == false) return; unsigned shift = addr << 3; status.recv &= ~(255 << shift); status.recv |= byte << shift; if(addr == 3 && status.packet == 15) { status.rumble = (status.recv & 0xff) == 0x26; //on = 0x26, off = 0x04 interface->inputRumble(0, 0, 10, status.rumble); } } } gb/cartridge/mbc5/000700 001750 001750 00000000000 12656700342 015055 5ustar00sergiosergio000000 000000 processor/r65816/opcode_rmw.cpp000664 001750 001750 00000007230 12651764221 017446 0ustar00sergiosergio000000 000000 template void R65816::op_adjust_imm_b() { L op_io_irq(); regs.r[n].l += adjust; regs.p.n = (regs.r[n].l & 0x80); regs.p.z = (regs.r[n].l == 0); } template void R65816::op_adjust_imm_w() { L op_io_irq(); regs.r[n].w += adjust; regs.p.n = (regs.r[n].w & 0x8000); regs.p.z = (regs.r[n].w == 0); } void R65816::op_asl_imm_b() { L op_io_irq(); regs.p.c = (regs.a.l & 0x80); regs.a.l <<= 1; regs.p.n = (regs.a.l & 0x80); regs.p.z = (regs.a.l == 0); } void R65816::op_asl_imm_w() { L op_io_irq(); regs.p.c = (regs.a.w & 0x8000); regs.a.w <<= 1; regs.p.n = (regs.a.w & 0x8000); regs.p.z = (regs.a.w == 0); } void R65816::op_lsr_imm_b() { L op_io_irq(); regs.p.c = (regs.a.l & 0x01); regs.a.l >>= 1; regs.p.n = (regs.a.l & 0x80); regs.p.z = (regs.a.l == 0); } void R65816::op_lsr_imm_w() { L op_io_irq(); regs.p.c = (regs.a.w & 0x0001); regs.a.w >>= 1; regs.p.n = (regs.a.w & 0x8000); regs.p.z = (regs.a.w == 0); } void R65816::op_rol_imm_b() { L op_io_irq(); bool carry = regs.p.c; regs.p.c = (regs.a.l & 0x80); regs.a.l = (regs.a.l << 1) | carry; regs.p.n = (regs.a.l & 0x80); regs.p.z = (regs.a.l == 0); } void R65816::op_rol_imm_w() { L op_io_irq(); bool carry = regs.p.c; regs.p.c = (regs.a.w & 0x8000); regs.a.w = (regs.a.w << 1) | carry; regs.p.n = (regs.a.w & 0x8000); regs.p.z = (regs.a.w == 0); } void R65816::op_ror_imm_b() { L op_io_irq(); bool carry = regs.p.c; regs.p.c = (regs.a.l & 0x01); regs.a.l = (carry << 7) | (regs.a.l >> 1); regs.p.n = (regs.a.l & 0x80); regs.p.z = (regs.a.l == 0); } void R65816::op_ror_imm_w() { L op_io_irq(); bool carry = regs.p.c; regs.p.c = (regs.a.w & 0x0001); regs.a.w = (carry << 15) | (regs.a.w >> 1); regs.p.n = (regs.a.w & 0x8000); regs.p.z = (regs.a.w == 0); } template void R65816::op_adjust_addr_b() { aa.l = op_readpc(); aa.h = op_readpc(); rd.l = op_readdbr(aa.w); op_io(); call(op); L op_writedbr(aa.w, rd.l); } template void R65816::op_adjust_addr_w() { aa.l = op_readpc(); aa.h = op_readpc(); rd.l = op_readdbr(aa.w + 0); rd.h = op_readdbr(aa.w + 1); op_io(); call(op); op_writedbr(aa.w + 1, rd.h); L op_writedbr(aa.w + 0, rd.l); } template void R65816::op_adjust_addrx_b() { aa.l = op_readpc(); aa.h = op_readpc(); op_io(); rd.l = op_readdbr(aa.w + regs.x.w); op_io(); call(op); L op_writedbr(aa.w + regs.x.w, rd.l); } template void R65816::op_adjust_addrx_w() { aa.l = op_readpc(); aa.h = op_readpc(); op_io(); rd.l = op_readdbr(aa.w + regs.x.w + 0); rd.h = op_readdbr(aa.w + regs.x.w + 1); op_io(); call(op); op_writedbr(aa.w + regs.x.w + 1, rd.h); L op_writedbr(aa.w + regs.x.w + 0, rd.l); } template void R65816::op_adjust_dp_b() { dp = op_readpc(); op_io_cond2(); rd.l = op_readdp(dp); op_io(); call(op); L op_writedp(dp, rd.l); } template void R65816::op_adjust_dp_w() { dp = op_readpc(); op_io_cond2(); rd.l = op_readdp(dp + 0); rd.h = op_readdp(dp + 1); op_io(); call(op); op_writedp(dp + 1, rd.h); L op_writedp(dp + 0, rd.l); } template void R65816::op_adjust_dpx_b() { dp = op_readpc(); op_io_cond2(); op_io(); rd.l = op_readdp(dp + regs.x.w); op_io(); call(op); L op_writedp(dp + regs.x.w, rd.l); } template void R65816::op_adjust_dpx_w() { dp = op_readpc(); op_io_cond2(); op_io(); rd.l = op_readdp(dp + regs.x.w + 0); rd.h = op_readdp(dp + regs.x.w + 1); op_io(); call(op); op_writedp(dp + regs.x.w + 1, rd.h); L op_writedp(dp + regs.x.w + 0, rd.l); } gb/cartridge/mbc3/000700 001750 001750 00000000000 12656700342 015053 5ustar00sergiosergio000000 000000 fc/apu/noise.cpp000664 001750 001750 00000002101 12651764221 014700 0ustar00sergiosergio000000 000000 void APU::Noise::clock_length() { if(envelope.loop_mode == 0) { if(length_counter > 0) length_counter--; } } uint8 APU::Noise::clock() { if(length_counter == 0) return 0; uint8 result = (lfsr & 1) ? envelope.volume() : 0; if(--period_counter == 0) { unsigned feedback; if(short_mode) { feedback = ((lfsr >> 0) & 1) ^ ((lfsr >> 6) & 1); } else { feedback = ((lfsr >> 0) & 1) ^ ((lfsr >> 1) & 1); } lfsr = (lfsr >> 1) | (feedback << 14); period_counter = apu.ntsc_noise_period_table[period]; } return result; } void APU::Noise::power() { } void APU::Noise::reset() { length_counter = 0; envelope.speed = 0; envelope.use_speed_as_volume = 0; envelope.loop_mode = 0; envelope.reload_decay = 0; envelope.decay_counter = 0; envelope.decay_volume = 0; period = 0; period_counter = 1; short_mode = 0; lfsr = 1; } void APU::Noise::serialize(serializer& s) { s.integer(length_counter); envelope.serialize(s); s.integer(period); s.integer(period_counter); s.integer(short_mode); s.integer(lfsr); } gb/cartridge/mbc2/000700 001750 001750 00000000000 12656700342 015052 5ustar00sergiosergio000000 000000 gb/cartridge/mbc1/000700 001750 001750 00000000000 12656700342 015051 5ustar00sergiosergio000000 000000 gb/cartridge/mbc0/000700 001750 001750 00000000000 12656700342 015050 5ustar00sergiosergio000000 000000 processor/arm/disassembler.cpp000664 001750 001750 00000057357 12651764221 017710 0ustar00sergiosergio000000 000000 #ifdef PROCESSOR_ARM_HPP string ARM::disassemble_arm_instruction(uint32 pc) { static string conditions[] = { "eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc", "hi", "ls", "ge", "lt", "gt", "le", "", "nv", }; static string opcodes[] = { "and", "eor", "sub", "rsb", "add", "adc", "sbc", "rsc", "tst", "teq", "cmp", "cmn", "orr", "mov", "bic", "mvn", }; static string registers[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "sp", "lr", "pc", }; static string indices[] = { "da", "ia", "db", "ib", }; static auto is_move = [](uint4 opcode) { return opcode == 13 || opcode == 15; }; static auto is_comp = [](uint4 opcode) { return opcode >= 8 && opcode <= 11; }; static auto is_math = [](uint4 opcode) { return opcode < 8 || opcode == 12 || opcode == 14; }; string output{hex<8>(pc), " "}; uint32 instruction = read(pc & ~3, Word); output.append(hex<8>(instruction), " "); //multiply() //mul{condition}{s} rd,rm,rs //mla{condition}{s} rd,rm,rs,rn if((instruction & 0x0fc000f0) == 0x00000090) { uint4 condition = instruction >> 28; uint1 accumulate = instruction >> 21; uint1 save = instruction >> 20; uint4 rd = instruction >> 16; uint4 rn = instruction >> 12; uint4 rs = instruction >> 8; uint4 rm = instruction; output.append(accumulate ? "mla" : "mul", conditions[condition], save ? "s " : " "); output.append(registers[rd], ",", registers[rm], ",", registers[rs]); if(accumulate) output.append(",", registers[rn]); return output; } //multiply_long() //(u,s)mull{condition}{s} rdlo,rdhi,rm,rs //(u,s)mlal{condition}{s} rdlo,rdhi,rm,rs if((instruction & 0x0f8000f0) == 0x00800090) { uint4 condition = instruction >> 28; uint1 signextend = instruction >> 22; uint1 accumulate = instruction >> 21; uint1 save = instruction >> 20; uint4 rdhi = instruction >> 16; uint4 rdlo = instruction >> 12; uint4 rs = instruction >> 8; uint4 rm = instruction; output.append(signextend ? "s" : "u", accumulate ? "mlal" : "mull", conditions[condition], save ? "s " : " "); output.append(registers[rdlo], ",", registers[rdhi], ",", registers[rm], ",", registers[rs]); return output; } //memory_swap() //swp{condition}{b} rd,rm,[rn] if((instruction & 0x0fb000f0) == 0x01000090) { uint4 condition = instruction >> 28; uint1 byte = instruction >> 22; uint4 rn = instruction >> 16; uint4 rd = instruction >> 12; uint4 rm = instruction; output.append("swp", conditions[condition], byte ? "b " : " "); output.append(registers[rd], ",", registers[rm], "[", registers[rn], "]"); return output; } //move_half_register() //(ldr,str){condition}h rd,[rn,rm]{!} //(ldr,str){condition}h rd,[rn],rm if((instruction & 0x0e4000f0) == 0x000000b0) { uint4 condition = instruction >> 28; uint1 pre = instruction >> 24; uint1 up = instruction >> 23; uint1 writeback = instruction >> 21; uint1 load = instruction >> 20; uint4 rn = instruction >> 16; uint4 rd = instruction >> 12; uint4 rm = instruction; output.append(load ? "ldr" : "str", conditions[condition], "h "); output.append(registers[rd], ",[", registers[rn]); if(pre == 0) output.append("]"); output.append(",", up ? "+" : "-", registers[rm]); if(pre == 1) output.append("]"); if(pre == 0 || writeback == 1) output.append("!"); return output; } //move_half_immediate() //(ldr,str){condition}h rd,[rd{,+/-offset}]{!} //(ldr,str){condition}h rd,[rn]{,+/-offset} if((instruction & 0x0e4000f0) == 0x004000b0) { uint4 condition = instruction >> 28; uint1 pre = instruction >> 24; uint1 up = instruction >> 23; uint1 writeback = instruction >> 21; uint1 load = instruction >> 20; uint4 rn = instruction >> 16; uint4 rd = instruction >> 12; uint4 ih = instruction >> 8; uint4 il = instruction >> 0; uint8 immediate = (ih << 4) + (il << 0); output.append(load ? "ldr" : "str", conditions[condition], "h "); output.append(registers[rd], ",[", registers[rn]); if(pre == 0) output.append("]"); if(immediate) output.append(",", up ? "+" : "-", "0x", hex<2>(immediate)); if(pre == 1) output.append("]"); if(pre == 0 || writeback == 1) output.append("!"); if(rn == 15) output.append(" =0x", hex<4>(read(pc + 8 + (up ? +immediate : -immediate), Half))); return output; } //load_register() //ldr{condition}s(h,b) rd,[rn,rm]{!} //ldr{condition}s(h,b) rd,[rn],rm if((instruction & 0x0e5000d0) == 0x001000b0) { uint4 condition = instruction >> 28; uint1 pre = instruction >> 24; uint1 up = instruction >> 23; uint1 writeback = instruction >> 21; uint4 rn = instruction >> 16; uint4 rd = instruction >> 12; uint1 half = instruction >> 5; uint4 rm = instruction; output.append("ldr", conditions[condition], half ? "sh " : "sb "); output.append(registers[rd], ",[", registers[rn]); if(pre == 0) output.append("]"); output.append(",", up ? "+" : "-", registers[rm]); if(pre == 1) output.append("]"); if(pre == 0 || writeback == 1) output.append("!"); return output; } //load_immediate() //ldr{condition}s(h,b) rd,[rn{,+/-offset}]{!} //ldr{condition}s(h,b) rd,[rn]{,+/-offset} if((instruction & 0x0e5000b0) == 0x005000b0) { uint4 condition = instruction >> 28; uint1 pre = instruction >> 24; uint1 up = instruction >> 23; uint1 writeback = instruction >> 21; uint4 rn = instruction >> 16; uint4 rd = instruction >> 12; uint4 ih = instruction >> 8; uint1 half = instruction >> 5; uint4 il = instruction; uint8 immediate = (ih << 4) + (il << 0); output.append("ldr", conditions[condition], half ? "sh " : "sb "); output.append(registers[rd], ",[", registers[rn]); if(pre == 0) output.append("]"); if(immediate) output.append(",", up ? "+" : "-", "0x", hex<2>(immediate)); if(pre == 1) output.append("]"); if(pre == 0 || writeback == 1) output.append("!"); if(rn == 15 && half == 1) output.append(" =0x", hex<4>(read(pc + 8 + (up ? +immediate : -immediate), Half))); if(rn == 15 && half == 0) output.append(" =0x", hex<2>(read(pc + 8 + (up ? +immediate : -immediate), Byte))); return output; } //move_to_register_from_status() //mrs{condition} rd,(c,s)psr if((instruction & 0x0fb000f0) == 0x01000000) { uint4 condition = instruction >> 28; uint1 psr = instruction >> 22; uint4 rd = instruction >> 12; output.append("mrs", conditions[condition], " "); output.append(registers[rd], ",", psr ? "spsr" : "cpsr"); return output; } //move_to_status_from_register() //msr{condition} (c,s)psr:{fields},rm if((instruction & 0x0fb000f0) == 0x01200000) { uint4 condition = instruction >> 28; uint1 psr = instruction >> 22; uint4 field = instruction >> 16; uint4 rm = instruction; output.append("msr", conditions[condition], " "); output.append(psr ? "spsr:" : "cpsr:"); output.append( field & 1 ? "c" : "", field & 2 ? "x" : "", field & 4 ? "s" : "", field & 8 ? "f" : "" ); output.append(",", registers[rm]); return output; } //branch_exchange_register() //bx{condition} rm if((instruction & 0x0ff000f0) == 0x01200010) { uint4 condition = instruction >> 28; uint4 rm = instruction; output.append("bx", conditions[condition], " "); output.append(registers[rm]); return output; } //move_to_status_from_immediate() //msr{condition} (c,s)psr:{fields},#immediate if((instruction & 0x0fb00000) == 0x03200000) { uint4 condition = instruction >> 28; uint1 psr = instruction >> 22; uint4 field = instruction >> 16; uint4 rotate = instruction >> 8; uint8 immediate = instruction; uint32 rm = (immediate >> (rotate * 2)) | (immediate << (32 - (rotate * 2))); output.append("msr", conditions[condition], " "); output.append(psr ? "spsr:" : "cpsr:"); output.append( field & 1 ? "c" : "", field & 2 ? "x" : "", field & 4 ? "s" : "", field & 8 ? "f" : "" ); output.append(",#0x", hex<8>(immediate)); return output; } //data_immediate_shift() //{opcode}{condition}{s} rd,rm {shift} #immediate //{opcode}{condition} rn,rm {shift} #immediate //{opcode}{condition}{s} rd,rn,rm {shift} #immediate if((instruction & 0x0e000010) == 0x00000000) { uint4 condition = instruction >> 28; uint4 opcode = instruction >> 21; uint1 save = instruction >> 20; uint4 rn = instruction >> 16; uint4 rd = instruction >> 12; uint5 shift = instruction >> 7; uint2 op = instruction >> 5; uint4 rm = instruction; output.append(opcodes[opcode], conditions[condition]); if(is_move(opcode)) output.append(save ? "s " : " ", registers[rd]); if(is_comp(opcode)) output.append(" ", registers[rn]); if(is_math(opcode)) output.append(save ? "s " : " ", registers[rd], ",", registers[rn]); output.append(",", registers[rm]); if(op == 0 && shift != 0) output.append(" lsl #", shift); if(op == 1) output.append(" lsr #", shift == 0 ? 32u : (unsigned)shift); if(op == 2) output.append(" asr #", shift == 0 ? 32u : (unsigned)shift); if(op == 3 && shift != 0) output.append(" ror #", shift); if(op == 3 && shift == 0) output.append(" rrx"); return output; } //data_register_shift() //{opcode}{condition}{s} rd,rm {shift} rs //{opcode}{condition} rn,rm {shift} rs //{opcode}{condition}{s} rd,rn,rm {shift} rs if((instruction & 0x0e000090) == 0x00000010) { uint4 condition = instruction >> 28; uint4 opcode = instruction >> 21; uint1 save = instruction >> 20; uint4 rn = instruction >> 16; uint4 rd = instruction >> 12; uint4 rs = instruction >> 8; uint2 mode = instruction >> 5; uint4 rm = instruction; output.append(opcodes[opcode], conditions[condition]); if(is_move(opcode)) output.append(save ? "s " : " ", registers[rd], ","); if(is_comp(opcode)) output.append(registers[rn], ","); if(is_math(opcode)) output.append(save ? "s " : " ", registers[rd], ",", registers[rn], ","); output.append(registers[rm]); if(mode == 0) output.append(" lsl "); if(mode == 1) output.append(" lsr "); if(mode == 2) output.append(" asr "); if(mode == 3) output.append(" ror "); output.append(registers[rs]); return output; } //data_immediate() //{opcode}{condition}{s} rd,#immediate //{opcode}{condition} rn,#immediate //{opcode}{condition}{s} rd,rn,#immediate if((instruction & 0x0e000000) == 0x02000000) { uint4 condition = instruction >> 28; uint4 opcode = instruction >> 21; uint1 save = instruction >> 20; uint4 rn = instruction >> 16; uint4 rd = instruction >> 12; uint4 rotate = instruction >> 8; uint8 immediate = instruction; uint32 rm = (immediate >> (rotate << 1)) | (immediate << (32 - (rotate << 1))); output.append(opcodes[opcode], conditions[condition]); if(is_move(opcode)) output.append(save ? "s " : " ", registers[rd]); if(is_comp(opcode)) output.append(" ", registers[rn]); if(is_math(opcode)) output.append(save ? "s " : " ", registers[rd], ",", registers[rn]); output.append(",#0x", hex<8>(rm)); return output; } //move_immediate_offset() //(ldr,str){condition}{b} rd,[rn{,+/-offset}]{!} //(ldr,str){condition}{b} rd,[rn]{,+/-offset} if((instruction & 0x0e000000) == 0x04000000) { uint4 condition = instruction >> 28; uint1 pre = instruction >> 24; uint1 up = instruction >> 23; uint1 byte = instruction >> 22; uint1 writeback = instruction >> 21; uint1 load = instruction >> 20; uint4 rn = instruction >> 16; uint4 rd = instruction >> 12; uint12 immediate = instruction; output.append(load ? "ldr" : "str", conditions[condition], byte ? "b " : " "); output.append(registers[rd], ",[", registers[rn]); if(pre == 0) output.append("]"); if(immediate) output.append(",", up ? "+" : "-", "0x", hex<3>(immediate)); if(pre == 1) output.append("]"); if(pre == 0 || writeback == 1) output.append("!"); if(rn == 15) output.append(" =0x", hex<8>(read(pc + 8 + (up ? +immediate : -immediate), byte ? Byte : Word))); return output; } //move_register_offset() //(ldr,str){condition}{b} rd,[rn,rm {mode} #immediate]{1} //(ldr,str){condition}{b} rd,[rn],rm {mode} #immediate if((instruction & 0x0e000010) == 0x06000000) { uint4 condition = instruction >> 28; uint1 pre = instruction >> 24; uint1 up = instruction >> 23; uint1 byte = instruction >> 22; uint1 writeback = instruction >> 21; uint1 load = instruction >> 20; uint4 rn = instruction >> 16; uint4 rd = instruction >> 12; uint5 shift = instruction >> 7; uint2 mode = instruction >> 5; uint4 rm = instruction; output.append(load ? "ldr" : "str", conditions[condition], byte ? "b " : " "); output.append(registers[rd], ",[", registers[rn]); if(pre == 0) output.append("]"); output.append(",", up ? "+" : "-", registers[rm]); if(mode == 0 && shift != 0) output.append(" lsl #", shift); if(mode == 1) output.append(" lsr #", shift == 0 ? 32u : (unsigned)shift); if(mode == 2) output.append(" asr #", shift == 0 ? 32u : (unsigned)shift); if(mode == 3 && shift != 0) output.append(" ror #", shift); if(mode == 3 && shift == 0) output.append(" rrx"); if(pre == 1) output.append("]"); if(pre == 0 || writeback == 1) output.append("!"); return output; } //move_multiple() //(ldm,stm) {condition}{mode} rn{!},{r...}{^} if((instruction & 0x0e000000) == 0x08000000) { uint4 condition = instruction >> 28; uint2 index = instruction >> 23; uint1 s = instruction >> 22; uint1 writeback = instruction >> 21; uint1 load = instruction >> 20; uint4 rn = instruction >> 16; uint16 list = instruction; output.append(load ? "ldm" : "stm", conditions[condition], indices[index], " "); output.append(registers[rn], writeback ? "!" : "", ",{"); for(unsigned n = 0; n < 16; n++) if(list & (1 << n)) output.append(registers[n], ","); output.rtrim<1>(","); output.append("}", s ? "^" : ""); return output; } //branch() //b{l}{condition} address if((instruction & 0x0e000000) == 0x0a000000) { uint4 condition = instruction >> 28; uint1 link = instruction >> 24; output.append("b", link ? "l" : "", conditions[condition], " "); output.append("0x", hex<8>(pc + 8 + (int24)instruction * 4)); return output; } //software_interrupt() //swi #immediate if((instruction & 0x0f000000) == 0x0f000000) { uint24 immediate = instruction; output.append("swi #0x", hex<6>(immediate)); return output; } output.append("???"); return output; } string ARM::disassemble_thumb_instruction(uint32 pc) { static string conditions[] = { "eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc", "hi", "ls", "ge", "lt", "gt", "le", "", "", }; static string registers[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "sp", "lr", "pc", }; string output{hex<8>(pc), " "}; uint16 instruction = read(pc & ~1, Half); output.append(hex<4>(instruction), " "); //adjust_register() //(add,sub) rd,rn,rm if((instruction & 0xfc00) == 0x1800) { uint1 opcode = instruction >> 9; uint3 rm = instruction >> 6; uint3 rn = instruction >> 3; uint3 rd = instruction >> 0; output.append(opcode == 0 ? "add" : "sub", " ", registers[rd], ",", registers[rn], ",", registers[rm]); return output; } //adjust_immediate() //(add,sub) rd,rn,#immediate if((instruction & 0xfc00) == 0x1c00) { uint1 opcode = instruction >> 9; uint3 immediate = instruction >> 6; uint3 rn = instruction >> 3; uint3 rd = instruction >> 0; output.append(opcode == 0 ? "add" : "sub", " ", registers[rd], ",", registers[rn], ",#", hex<1>(immediate)); return output; } //shift_immediate() //(lsl,lsr,asar) rd,rm,#immmediate if((instruction & 0xe000) == 0x0000) { static string opcodes[] = { "lsl", "lsr", "asr", "" }; uint2 opcode = instruction >> 11; uint5 immediate = instruction >> 6; uint3 rm = instruction >> 3; uint3 rd = instruction >> 0; output.append(opcodes[opcode], " ", registers[rd], ",", registers[rm], ",#", immediate); return output; } //immediate() //(mov,cmp,add,sub) (rd,rn),#immediate if((instruction & 0xe000) == 0x2000) { static string opcodes[] = { "mov", "cmp", "add", "sub" }; uint2 opcode = instruction >> 11; uint3 rd = instruction >> 8; uint8 immediate = instruction; output.append(opcodes[opcode], " ", registers[rd], ",#0x", hex<2>(immediate)); return output; } //alu() //{opcode} rd,rm if((instruction & 0xfc00) == 0x4000) { static string opcodes[] = { "and", "eor", "lsl", "lsr", "asr", "adc", "sbc", "ror", "tst", "neg", "cmp", "cmn", "orr", "mul", "bic", "mvn", }; uint4 opcode = instruction >> 6; uint3 rm = instruction >> 3; uint3 rd = instruction >> 0; output.append(opcodes[opcode], " ", registers[rd], ",", registers[rm]); return output; } //branch_exchange() //bx rm if((instruction & 0xff80) == 0x4700) { uint4 rm = instruction >> 3; output.append("bx ", registers[rm]); return output; } //alu_hi() //{opcode} rd,rm if((instruction & 0xfc00) == 0x4400) { static string opcodes[] = { "add", "sub", "mov", "" }; uint2 opcode = instruction >> 8; uint4 rm = instruction >> 3; uint4 rd = ((uint1)(instruction >> 7) << 3) + (uint3)instruction; if(opcode == 2 && rm == 8 && rd == 8) { output.append("nop"); return output; } output.append(opcodes[opcode], " ", registers[rd], ",", registers[rm]); return output; } //load_literal() //ldr rd,[pc,#+/-offset] if((instruction & 0xf800) == 0x4800) { uint3 rd = instruction >> 8; uint8 displacement = instruction; unsigned rm = ((pc + 4) & ~3) + displacement * 4; output.append("ldr ", registers[rd], ",[pc,#0x", hex<3>(rm), "]"); output.append(" =0x", hex<8>(read(rm, Word))); return output; } //move_register_offset() //(ld(r,s),str){b,h} rd,[rn,rm] if((instruction & 0xf000) == 0x5000) { static string opcodes[] = { "str", "strh", "strb", "ldsb", "ldr", "ldrh", "ldrb", "ldsh", }; uint3 opcode = instruction >> 9; uint3 rm = instruction >> 6; uint3 rn = instruction >> 3; uint3 rd = instruction >> 0; output.append(opcodes[opcode], " ", registers[rd], ",[", registers[rn], ",", registers[rm], "]"); return output; } //move_word_immediate() //(ldr,str) rd,[rn,#offset] if((instruction & 0xf000) == 0x6000) { uint1 load = instruction >> 11; uint5 offset = instruction >> 6; uint3 rn = instruction >> 3; uint3 rd = instruction >> 0; output.append(load ? "ldr " : "str ", registers[rd], ",[", registers[rn], ",#0x", hex<2>(offset * 4), "]"); return output; } //move_byte_immediate() //(ldr,str)b rd,[rn,#offset] if((instruction & 0xf000) == 0x7000) { uint1 load = instruction >> 11; uint5 offset = instruction >> 6; uint3 rn = instruction >> 3; uint3 rd = instruction >> 0; output.append(load ? "ldrb " : "strb ", registers[rd], ",[", registers[rn], ",#0x", hex<2>(offset), "]"); return output; } //move_half_immediate() //(ldr,str)h rd,[rn,#offset] if((instruction & 0xf000) == 0x8000) { uint1 load = instruction >> 11; uint5 offset = instruction >> 6; uint3 rn = instruction >> 3; uint3 rd = instruction >> 0; output.append(load ? "ldrh " : "strh ", registers[rd], ",[", registers[rn], ",#0x", hex<2>(offset * 2), "]"); return output; } //move_stack() //(ldr,str) rd,[sp,#relative] if((instruction & 0xf000) == 0x9000) { uint1 opcode = instruction >> 11; uint3 rd = instruction >> 8; int8 relative = instruction; output.append(opcode ? "ldr" : "str", " ", registers[rd], ",[sp,#0x", hex<3>(relative * 4), "]"); return output; } //add_register_hi() //add rd,{pc,sp},#immediate if((instruction & 0xf000) == 0xa000) { uint1 sp = instruction >> 11; uint3 rd = instruction >> 8; uint8 immediate = instruction; output.append("add ", registers[rd], ",", sp ? "sp" : "pc", ",#0x", hex<2>(immediate)); return output; } //adjust_stack() //(add,sub) sp,#immediate if((instruction & 0xff00) == 0xb000) { uint1 opcode = instruction >> 7; uint7 immediate = instruction; output.append(opcode == 0 ? "add" : "sub", " sp,#0x", hex<3>(immediate * 4)); return output; } //stack_multiple() //push {r...{,lr}} //pop {r...{,pc}} if((instruction & 0xf600) == 0xb400) { uint1 load = instruction >> 11; uint1 branch = instruction >> 8; uint8 list = instruction; output.append(load == 0 ? "push" : "pop", " {"); for(unsigned l = 0; l < 8; l++) { if(list & (1 << l)) output.append(registers[l], ","); } if(branch) output.append(load == 0 ? "lr," : "pc,"); output.rtrim<1>(","); output.append("}"); return output; } //move_multiple() //(ldmia,stmia) rn,{r...} if((instruction & 0xf000) == 0xc000) { uint1 load = instruction >> 11; uint3 rn = instruction >> 8; uint8 list = instruction; output.append(load ? "ldmia " : "stmia ", registers[rn], "!,{"); for(unsigned l = 0; l < 8; l++) { if(list & (1 << l)) output.append(registers[l], ","); } output.rtrim<1>(","); output.append("}"); return output; } //software_interrupt() //swi #immediate if((instruction & 0xff00) == 0xdf00) { uint8 immediate = instruction; output.append("swi #0x", hex<2>(immediate)); return output; } //branch_conditional() //b{condition} address if((instruction & 0xf000) == 0xd000) { uint4 condition = instruction >> 8; int8 displacement = instruction; uint32 offset = pc + 4 + displacement * 2; output.append("b", conditions[condition], " 0x", hex<8>(offset)); return output; } //branch_short() //b address if((instruction & 0xf800) == 0xe000) { int11 displacement = instruction; output.append("b 0x", hex<8>(pc + 4 + displacement * 2)); return output; } //branch_long_prefix() //bl address if((instruction & 0xf800) == 0xf000) { uint11 offsethi = instruction; instruction = read((pc & ~1) + 2, Half); uint11 offsetlo = instruction; int22 displacement = (offsethi << 11) | (offsetlo << 0); output.append("bl 0x", hex<8>(pc + 4 + displacement * 2)); return output; } //branch_long_suffix() //bl address if((instruction & 0xf800) == 0xf800) { output.append("..."); return output; } output.append("???"); return output; } string ARM::disassemble_registers() { string output; output.append( "r0:", hex<8>(r( 0)), " r1:", hex<8>(r( 1)), " r2:", hex<8>(r( 2)), " r3:", hex<8>(r( 3)), " "); output.append( "r4:", hex<8>(r( 4)), " r5:", hex<8>(r( 5)), " r6:", hex<8>(r( 6)), " r7:", hex<8>(r( 7)), " "); output.append("cpsr:", cpsr().n ? "N" : "n", cpsr().z ? "Z" : "z", cpsr().c ? "C" : "c", cpsr().v ? "V" : "v"); output.append("/", cpsr().i ? "I" : "i", cpsr().f ? "F" : "f", cpsr().t ? "T" : "t"); output.append("/", hex<2>(cpsr().m), "\n"); output.append( "r8:", hex<8>(r( 8)), " r9:", hex<8>(r( 9)), " r10:", hex<8>(r(10)), " r11:", hex<8>(r(11)), " "); output.append("r12:", hex<8>(r(12)), " sp:", hex<8>(r(13)), " lr:", hex<8>(r(14)), " pc:", hex<8>(r(15)), " "); output.append("spsr:"); if(mode() == Processor::Mode::USR || mode() == Processor::Mode::SYS) { output.append("----/---/--"); return output; } output.append( spsr().n ? "N" : "n", spsr().z ? "Z" : "z", spsr().c ? "C" : "c", spsr().v ? "V" : "v"); output.append("/", spsr().i ? "I" : "i", spsr().f ? "F" : "f", spsr().t ? "T" : "t"); output.append("/", hex<2>(spsr().m)); return output; } #endif fc/cartridge/cartridge.hpp000664 001750 001750 00000001502 12651764221 016717 0ustar00sergiosergio000000 000000 #include "chip/chip.hpp" #include "board/board.hpp" struct Cartridge : Thread, property { static void Main(); void main(); void load(); void unload(); void power(); void reset(); readonly loaded; readonly sha256; struct Information { string markup; string title; } information; string title(); struct Memory { unsigned id; string name; }; vector memory; void serialize(serializer&); Cartridge(); //privileged: Board *board; uint8 prg_read(unsigned addr); void prg_write(unsigned addr, uint8 data); uint8 chr_read(unsigned addr); void chr_write(unsigned addr, uint8 data); //scanline() is for debugging purposes only: //boards must detect scanline edges on their own void scanline(unsigned y); }; extern Cartridge cartridge; gba/player/000700 001750 001750 00000000000 12656700342 013720 5ustar00sergiosergio000000 000000 target-ethos/interface/000700 001750 001750 00000000000 12656700342 016241 5ustar00sergiosergio000000 000000 phoenix/qt/widget/radio-label.cpp000664 001750 001750 00000003014 12651764221 020146 0ustar00sergiosergio000000 000000 namespace phoenix { Size pRadioLabel::minimumSize() { Size size = pFont::size(qtWidget->font(), radioLabel.state.text); return {size.width + 26, size.height + 6}; } void pRadioLabel::setChecked() { parent().locked = true; for(auto& item : radioLabel.state.group) { bool checked = &item == &radioLabel; item.p.qtRadioLabel->setChecked(item.state.checked = checked); } parent().locked = false; } void pRadioLabel::setGroup(const group& group) { parent().locked = true; for(auto& item : radioLabel.state.group) { item.p.qtRadioLabel->setChecked(item.state.checked); } parent().locked = false; } void pRadioLabel::setText(string text) { qtRadioLabel->setText(QString::fromUtf8(text)); } pRadioLabel& pRadioLabel::parent() { if(radioLabel.state.group.size()) return radioLabel.state.group.first().p; return *this; } void pRadioLabel::constructor() { qtWidget = qtRadioLabel = new QRadioButton; qtRadioLabel->setAutoExclusive(false); connect(qtRadioLabel, SIGNAL(toggled(bool)), SLOT(onActivate())); pWidget::synchronizeState(); setGroup(radioLabel.state.group); setText(radioLabel.state.text); } void pRadioLabel::destructor() { if(qtRadioLabel) delete qtRadioLabel; qtWidget = qtRadioLabel = nullptr; } void pRadioLabel::orphan() { destructor(); constructor(); } void pRadioLabel::onActivate() { if(parent().locked) return; bool wasChecked = radioLabel.state.checked; setChecked(); if(!wasChecked) { if(radioLabel.onActivate) radioLabel.onActivate(); } } } sfc/scheduler/000700 001750 001750 00000000000 12656700342 014424 5ustar00sergiosergio000000 000000 gb/apu/apu.cpp000664 001750 001750 00000007001 12651764221 014354 0ustar00sergiosergio000000 000000 #include #define APU_CPP namespace GameBoy { #include "square1/square1.cpp" #include "square2/square2.cpp" #include "wave/wave.cpp" #include "noise/noise.cpp" #include "master/master.cpp" #include "serialization.cpp" APU apu; void APU::Main() { apu.main(); } void APU::main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(sequencer_base == 0) { //512hz if(sequencer_step == 0 || sequencer_step == 2 || sequencer_step == 4 || sequencer_step == 6) { //256hz square1.clock_length(); square2.clock_length(); wave.clock_length(); noise.clock_length(); } if(sequencer_step == 2 || sequencer_step == 6) { //128hz square1.clock_sweep(); } if(sequencer_step == 7) { //64hz square1.clock_envelope(); square2.clock_envelope(); noise.clock_envelope(); } sequencer_step++; } sequencer_base++; square1.run(); square2.run(); wave.run(); noise.run(); master.run(); hipass(master.center, master.center_bias); hipass(master.left, master.left_bias); hipass(master.right, master.right_bias); interface->audioSample(master.left, master.right); clock += cpu.frequency; if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(scheduler.active_thread = cpu.thread); } } void APU::hipass(int16& sample, int64& bias) { bias += ((((int64)sample << 16) - (bias >> 16)) * 57593) >> 16; sample = sclamp<16>(sample - (bias >> 32)); } void APU::power() { create(Main, 2 * 1024 * 1024); for(unsigned n = 0xff10; n <= 0xff3f; n++) bus.mmio[n] = this; for(auto& n : mmio_data) n = 0x00; sequencer_base = 0; sequencer_step = 0; square1.power(); square2.power(); wave.power(); noise.power(); master.power(); } uint8 APU::mmio_read(uint16 addr) { static const uint8 table[48] = { 0x80, 0x3f, 0x00, 0xff, 0xbf, //square1 0xff, 0x3f, 0x00, 0xff, 0xbf, //square2 0x7f, 0xff, 0x9f, 0xff, 0xbf, //wave 0xff, 0xff, 0x00, 0x00, 0xbf, //noise 0x00, 0x00, 0x70, //master 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //unmapped 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //wave pattern 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //wave pattern }; if(addr == 0xff26) { uint8 data = master.enable << 7; if(square1.enable) data |= 0x01; if(square2.enable) data |= 0x02; if( wave.enable) data |= 0x04; if( noise.enable) data |= 0x08; return data | table[addr - 0xff10]; } if(addr >= 0xff10 && addr <= 0xff3f) return mmio_data[addr - 0xff10] | table[addr - 0xff10]; return 0xff; } void APU::mmio_write(uint16 addr, uint8 data) { if(addr >= 0xff10 && addr <= 0xff3f) mmio_data[addr - 0xff10] = data; if(addr >= 0xff10 && addr <= 0xff14) return square1.write (addr - 0xff10, data); if(addr >= 0xff15 && addr <= 0xff19) return square2.write (addr - 0xff15, data); if(addr >= 0xff1a && addr <= 0xff1e) return wave.write (addr - 0xff1a, data); if(addr >= 0xff1f && addr <= 0xff23) return noise.write (addr - 0xff1f, data); if(addr >= 0xff24 && addr <= 0xff26) return master.write (addr - 0xff24, data); if(addr >= 0xff30 && addr <= 0xff3f) return wave.write_pattern(addr - 0xff30, data); } } sfc/chip/sgb-external/sgb-external.hpp000664 001750 001750 00000001650 12651764221 021107 0ustar00sergiosergio000000 000000 struct SGBExternal : Coprocessor, library { unsigned revision; static void Enter(); void enter(); bool load_library(const char * name); void init(); void load(); void unload(); void power(); void reset(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); void serialize(serializer&); private: function sgb_rom; function sgb_ram; function sgb_rtc; function sgb_init; function sgb_term; function sgb_power; function sgb_reset; function sgb_row; function sgb_read; function sgb_write; function sgb_run; function sgb_save; function sgb_serialize; unsigned row; uint32_t samplebuffer[4096]; }; extern SGBExternal sgbExternal; processor/spc700/serialization.cpp000664 001750 001750 00000000725 12651764221 020330 0ustar00sergiosergio000000 000000 void SPC700::serialize(serializer& s) { s.integer(regs.pc); s.integer(regs.a); s.integer(regs.x); s.integer(regs.y); s.integer(regs.s); s.integer(regs.p.n); s.integer(regs.p.v); s.integer(regs.p.p); s.integer(regs.p.b); s.integer(regs.p.h); s.integer(regs.p.i); s.integer(regs.p.z); s.integer(regs.p.c); s.integer(opcode); s.integer(dp.w); s.integer(sp.w); s.integer(rd.w); s.integer(wr.w); s.integer(bit.w); s.integer(ya.w); } nall/image/blend.hpp000664 001750 001750 00000004571 12651764221 015524 0ustar00sergiosergio000000 000000 #ifndef NALL_IMAGE_BLEND_HPP #define NALL_IMAGE_BLEND_HPP namespace nall { void image::impose(blend mode, unsigned targetX, unsigned targetY, image source, unsigned sourceX, unsigned sourceY, unsigned sourceWidth, unsigned sourceHeight) { source.transform(endian, depth, alpha.mask, red.mask, green.mask, blue.mask); for(unsigned y = 0; y < sourceHeight; y++) { const uint8_t* sp = source.data + source.pitch * (sourceY + y) + source.stride * sourceX; uint8_t* dp = data + pitch * (targetY + y) + stride * targetX; for(unsigned x = 0; x < sourceWidth; x++) { uint64_t sourceColor = source.read(sp); uint64_t targetColor = read(dp); int64_t sa = (sourceColor & alpha.mask) >> alpha.shift; int64_t sr = (sourceColor & red.mask ) >> red.shift; int64_t sg = (sourceColor & green.mask) >> green.shift; int64_t sb = (sourceColor & blue.mask ) >> blue.shift; int64_t da = (targetColor & alpha.mask) >> alpha.shift; int64_t dr = (targetColor & red.mask ) >> red.shift; int64_t dg = (targetColor & green.mask) >> green.shift; int64_t db = (targetColor & blue.mask ) >> blue.shift; uint64_t a, r, g, b; switch(mode) { case blend::add: a = max(sa, da); r = min(red.mask >> red.shift, ((sr * sa) >> alpha.depth) + ((dr * da) >> alpha.depth)); g = min(green.mask >> green.shift, ((sg * sa) >> alpha.depth) + ((dg * da) >> alpha.depth)); b = min(blue.mask >> blue.shift, ((sb * sa) >> alpha.depth) + ((db * da) >> alpha.depth)); break; case blend::sourceAlpha: a = max(sa, da); r = dr + (((sr - dr) * sa) >> alpha.depth); g = dg + (((sg - dg) * sa) >> alpha.depth); b = db + (((sb - db) * sa) >> alpha.depth); break; case blend::sourceColor: a = sa; r = sr; g = sg; b = sb; break; case blend::targetAlpha: a = max(sa, da); r = sr + (((dr - sr) * da) >> alpha.depth); g = sg + (((dg - sg) * da) >> alpha.depth); b = sb + (((db - sb) * da) >> alpha.depth); break; case blend::targetColor: a = da; r = dr; g = dg; b = db; break; } write(dp, (a << alpha.shift) | (r << red.shift) | (g << green.shift) | (b << blue.shift)); sp += source.stride; dp += stride; } } } } #endif fc/apu/envelope.cpp000664 001750 001750 00000001366 12651764221 015414 0ustar00sergiosergio000000 000000 unsigned APU::Envelope::volume() const { return use_speed_as_volume ? speed : decay_volume; } void APU::Envelope::clock() { if(reload_decay) { reload_decay = false; decay_volume = 0x0f; decay_counter = speed + 1; return; } if(--decay_counter == 0) { decay_counter = speed + 1; if(decay_volume || loop_mode) decay_volume--; } } void APU::Envelope::power() { } void APU::Envelope::reset() { speed = 0; use_speed_as_volume = 0; loop_mode = 0; reload_decay = 0; decay_counter = 0; decay_volume = 0; } void APU::Envelope::serialize(serializer& s) { s.integer(speed); s.integer(use_speed_as_volume); s.integer(loop_mode); s.integer(reload_decay); s.integer(decay_counter); s.integer(decay_volume); } sfc/alt/ppu-performance/ppu.cpp000664 001750 001750 00000007160 12651764221 017662 0ustar00sergiosergio000000 000000 #include #define PPU_CPP namespace SuperFamicom { PPU ppu; #include "mmio/mmio.cpp" #include "window/window.cpp" #include "cache/cache.cpp" #include "background/background.cpp" #include "sprite/sprite.cpp" #include "screen/screen.cpp" #include "serialization.cpp" void PPU::step(unsigned clocks) { clock += clocks; } void PPU::synchronize_cpu() { if(CPU::Threaded == true) { if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cpu.thread); } else { while(clock >= 0) cpu.enter(); } } void PPU::Enter() { ppu.enter(); } void PPU::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } scanline(); if(vcounter() < display.height && vcounter()) { add_clocks(512); render_scanline(); add_clocks(lineclocks() - 512); } else { add_clocks(lineclocks()); } } } void PPU::add_clocks(unsigned clocks) { tick(clocks); step(clocks); synchronize_cpu(); } void PPU::render_scanline() { if(display.framecounter) return; //skip this frame? bg1.scanline(); bg2.scanline(); bg3.scanline(); bg4.scanline(); if(regs.display_disable) return screen.render_black(); screen.scanline(); bg1.render(); bg2.render(); bg3.render(); bg4.render(); sprite.render(); screen.render(); } void PPU::scanline() { display.width = !hires() ? 256 : 512; display.height = !overscan() ? 225 : 240; if(vcounter() == 0) frame(); if(vcounter() == display.height && regs.display_disable == false) sprite.address_reset(); } void PPU::frame() { sprite.frame(); system.frame(); display.interlace = regs.interlace; display.overscan = regs.overscan; display.framecounter = display.frameskip == 0 ? 0 : (display.framecounter + 1) % display.frameskip; } void PPU::enable() { function reader = {&PPU::mmio_read, (PPU*)&ppu}; function writer = {&PPU::mmio_write, (PPU*)&ppu}; bus.map(reader, writer, 0x00, 0x3f, 0x2100, 0x213f); bus.map(reader, writer, 0x80, 0xbf, 0x2100, 0x213f); } void PPU::power() { for(auto& n : vram) n = 0; for(auto& n : oam) n = 0; for(auto& n : cgram) n = 0; reset(); } void PPU::reset() { create(Enter, system.cpu_frequency()); PPUcounter::reset(); memset(surface, 0, 512 * 512 * sizeof(uint32)); mmio_reset(); display.interlace = false; display.overscan = false; } void PPU::layer_enable(unsigned layer, unsigned priority, bool enable) { switch(layer * 4 + priority) { case 0: bg1.priority0_enable = enable; break; case 1: bg1.priority1_enable = enable; break; case 4: bg2.priority0_enable = enable; break; case 5: bg2.priority1_enable = enable; break; case 8: bg3.priority0_enable = enable; break; case 9: bg3.priority1_enable = enable; break; case 12: bg4.priority0_enable = enable; break; case 13: bg4.priority1_enable = enable; break; case 16: sprite.priority0_enable = enable; break; case 17: sprite.priority1_enable = enable; break; case 18: sprite.priority2_enable = enable; break; case 19: sprite.priority3_enable = enable; break; } } void PPU::set_frameskip(unsigned frameskip) { display.frameskip = frameskip; display.framecounter = 0; } PPU::PPU() : cache(*this), bg1(*this, Background::ID::BG1), bg2(*this, Background::ID::BG2), bg3(*this, Background::ID::BG3), bg4(*this, Background::ID::BG4), sprite(*this), screen(*this) { surface = new uint32[512 * 512]; output = surface + 16 * 512; display.width = 256; display.height = 224; display.frameskip = 0; display.framecounter = 0; } PPU::~PPU() { delete[] surface; } } sfc/chip/obc1/serialization.cpp000664 001750 001750 00000000272 12651764221 017614 0ustar00sergiosergio000000 000000 #ifdef OBC1_CPP void OBC1::serialize(serializer& s) { s.array(ram.data(), ram.size()); s.integer(status.address); s.integer(status.baseptr); s.integer(status.shift); } #endif ruby/video/opengl/opengl.hpp000664 001750 001750 00000004651 12651764221 017266 0ustar00sergiosergio000000 000000 #if defined(PLATFORM_X) #include #include #define glGetProcAddress(name) (*glXGetProcAddress)((const GLubyte*)(name)) #elif defined(PLATFORM_MACOSX) #include #include #elif defined(PLATFORM_WINDOWS) #include #include #define glGetProcAddress(name) wglGetProcAddress(name) #else #error "ruby::OpenGL: unsupported platform" #endif namespace ruby { #include "bind.hpp" #include "shaders.hpp" #include "utility.hpp" struct OpenGL; struct OpenGLTexture { GLuint texture = 0; unsigned width = 0; unsigned height = 0; GLuint format = GL_RGBA8; GLuint filter = GL_LINEAR; GLuint wrap = GL_CLAMP_TO_BORDER; GLuint getFormat() const; GLuint getType() const; }; struct OpenGLSurface : OpenGLTexture { GLuint program = 0; GLuint framebuffer = 0; GLuint vao = 0; GLuint vbo[3] = {0, 0, 0}; GLuint vertex = 0; GLuint geometry = 0; GLuint fragment = 0; uint32_t* buffer = nullptr; void allocate(); void size(unsigned width, unsigned height); void release(); void render(unsigned sourceWidth, unsigned sourceHeight, unsigned targetWidth, unsigned targetHeight); }; struct OpenGLProgram : OpenGLSurface { unsigned phase = 0; //frame counter unsigned modulo = 0; //frame counter modulus unsigned absoluteWidth = 0; unsigned absoluteHeight = 0; double relativeWidth = 0; double relativeHeight = 0; vector pixmaps; void bind(OpenGL* instance, const Markup::Node& node, const string& pathname); void parse(OpenGL* instance, string& source); void release(); }; struct OpenGL : OpenGLProgram { vector programs; vector history; GLuint inputFormat = GL_RGBA8; unsigned outputWidth = 0; unsigned outputHeight = 0; struct Setting { string name; string value; bool operator< (const Setting& source) { return name < source.name; } bool operator==(const Setting& source) { return name == source.name; } Setting() {} Setting(const string& name) : name(name) {} Setting(const string& name, const string& value) : name(name), value(value) {} }; set settings; void shader(const char* pathname); void allocateHistory(unsigned size); bool lock(uint32_t*& data, unsigned& pitch); void clear(); void refresh(); bool init(); void term(); }; #include "texture.hpp" #include "surface.hpp" #include "program.hpp" #include "main.hpp" } phoenix/windows/widget/radio-button.cpp000664 001750 001750 00000005457 12651764221 021465 0ustar00sergiosergio000000 000000 namespace phoenix { Size pRadioButton::minimumSize() { Size size = pFont::size(hfont, radioButton.state.text); if(radioButton.state.orientation == Orientation::Horizontal) { size.width += radioButton.state.image.width; size.height = max(radioButton.state.image.height, size.height); } if(radioButton.state.orientation == Orientation::Vertical) { size.width = max(radioButton.state.image.width, size.width); size.height += radioButton.state.image.height; } return {size.width + 20, size.height + 10}; } void pRadioButton::setChecked() { for(auto& item : radioButton.state.group) { SendMessage(item.p.hwnd, BM_SETCHECK, (WPARAM)(&item == &radioButton), 0); } } void pRadioButton::setGroup(const group& group) { } void pRadioButton::setImage(const image& image, Orientation orientation) { nall::image nallImage = image; nallImage.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0); if(hbitmap) { DeleteObject(hbitmap); hbitmap = 0; } if(himagelist) { ImageList_Destroy(himagelist); himagelist = 0; } if(OsVersion() < WindowsVista) nallImage.alphaBlend(GetSysColor(COLOR_BTNFACE)); hbitmap = CreateBitmap(nallImage); himagelist = ImageList_Create(nallImage.width, nallImage.height, ILC_COLOR32, 1, 0); ImageList_Add(himagelist, hbitmap, NULL); BUTTON_IMAGELIST list; list.himl = himagelist; switch(orientation) { case Orientation::Horizontal: SetRect(&list.margin, 5, 0, 0, 0); list.uAlign = BUTTON_IMAGELIST_ALIGN_LEFT; break; case Orientation::Vertical: SetRect(&list.margin, 0, 5, 0, 0); list.uAlign = BUTTON_IMAGELIST_ALIGN_TOP; break; } Button_SetImageList(hwnd, &list); setText(radioButton.state.text); } void pRadioButton::setText(string text) { if(text.empty()) { SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | BS_BITMAP); } else { SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~BS_BITMAP); } SetWindowText(hwnd, utf16_t(text)); } void pRadioButton::constructor() { hwnd = CreateWindow(L"BUTTON", L"", WS_CHILD | WS_TABSTOP | BS_CHECKBOX | BS_PUSHLIKE, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&radioButton); setDefaultFont(); if(radioButton.state.checked) setChecked(); setImage(radioButton.state.image, radioButton.state.orientation); //setText(radioButton.state.text); synchronize(); } void pRadioButton::destructor() { if(hbitmap) { DeleteObject(hbitmap); hbitmap = 0; } if(himagelist) { ImageList_Destroy(himagelist); himagelist = 0; } DestroyWindow(hwnd); } void pRadioButton::orphan() { destructor(); constructor(); } void pRadioButton::onActivate() { if(radioButton.state.checked) return; radioButton.setChecked(); if(radioButton.onActivate) radioButton.onActivate(); } } processor/r65816/disassembler.hpp000664 001750 001750 00000001442 12651764221 017771 0ustar00sergiosergio000000 000000 enum : unsigned { OPTYPE_DP = 0, //dp OPTYPE_DPX, //dp,x OPTYPE_DPY, //dp,y OPTYPE_IDP, //(dp) OPTYPE_IDPX, //(dp,x) OPTYPE_IDPY, //(dp),y OPTYPE_ILDP, //[dp] OPTYPE_ILDPY, //[dp],y OPTYPE_ADDR, //addr OPTYPE_ADDRX, //addr,x OPTYPE_ADDRY, //addr,y OPTYPE_IADDRX, //(addr,x) OPTYPE_ILADDR, //[addr] OPTYPE_LONG, //long OPTYPE_LONGX, //long, x OPTYPE_SR, //sr,s OPTYPE_ISRY, //(sr,s),y OPTYPE_ADDR_PC, //pbr:addr OPTYPE_IADDR_PC, //pbr:(addr) OPTYPE_RELB, //relb OPTYPE_RELW, //relw }; void disassemble_opcode(char* output, uint32 addr); uint8 dreadb(uint32 addr); uint16 dreadw(uint32 addr); uint32 dreadl(uint32 addr); uint32 decode(uint8 offset_type, uint32 addr); ruby/video/direct3d.cpp000664 001750 001750 00000032627 12651764221 016216 0ustar00sergiosergio000000 000000 #undef interface #define interface struct #include #include #undef interface #define D3DVERTEX (D3DFVF_XYZRHW | D3DFVF_TEX1) typedef HRESULT (__stdcall* EffectProc)(LPDIRECT3DDEVICE9, LPCVOID, UINT, D3DXMACRO const*, LPD3DXINCLUDE, DWORD, LPD3DXEFFECTPOOL, LPD3DXEFFECT*, LPD3DXBUFFER*); typedef HRESULT (__stdcall* TextureProc)(LPDIRECT3DDEVICE9, LPCTSTR, LPDIRECT3DTEXTURE9*); namespace ruby { class pVideoD3D { public: LPDIRECT3D9 lpd3d; LPDIRECT3DDEVICE9 device; LPDIRECT3DVERTEXBUFFER9 vertex_buffer; LPDIRECT3DVERTEXBUFFER9* vertex_ptr; D3DPRESENT_PARAMETERS presentation; D3DSURFACE_DESC d3dsd; D3DLOCKED_RECT d3dlr; D3DRASTER_STATUS d3drs; D3DCAPS9 d3dcaps; LPDIRECT3DTEXTURE9 texture; LPDIRECT3DSURFACE9 surface; LPD3DXEFFECT effect; string shader_source_markup; bool lost; unsigned iwidth, iheight; struct d3dvertex { float x, y, z, rhw; //screen coords float u, v; //texture coords }; struct { uint32_t t_usage, v_usage; uint32_t t_pool, v_pool; uint32_t lock; uint32_t filter; } flags; struct { bool dynamic; //device supports dynamic textures bool shader; //device supports pixel shaders } caps; struct { HWND handle; bool synchronize; unsigned filter; unsigned width; unsigned height; } settings; struct { unsigned width; unsigned height; } state; bool cap(const string& name) { if(name == Video::Handle) return true; if(name == Video::Synchronize) return true; if(name == Video::Filter) return true; if(name == Video::Shader) return false; return false; } any get(const string& name) { if(name == Video::Handle) return (uintptr_t)settings.handle; if(name == Video::Synchronize) return settings.synchronize; if(name == Video::Filter) return settings.filter; return false; } bool set(const string& name, const any& value) { if(name == Video::Handle) { settings.handle = (HWND)any_cast(value); return true; } if(name == Video::Synchronize) { settings.synchronize = any_cast(value); return true; } if(name == Video::Filter) { settings.filter = any_cast(value); if(lpd3d) update_filter(); return true; } if(name == Video::Shader) { return false; set_shader(any_cast(value)); return true; } return false; } bool recover() { if(!device) return false; if(lost) { release_resources(); if(device->Reset(&presentation) != D3D_OK) return false; } lost = false; device->SetDialogBoxMode(false); device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); device->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE); device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); device->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE); device->SetRenderState(D3DRS_LIGHTING, false); device->SetRenderState(D3DRS_ZENABLE, false); device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); device->SetRenderState(D3DRS_ALPHABLENDENABLE, false); device->SetVertexShader(NULL); device->SetFVF(D3DVERTEX); device->CreateVertexBuffer(sizeof(d3dvertex) * 4, flags.v_usage, D3DVERTEX, (D3DPOOL)flags.v_pool, &vertex_buffer, NULL); iwidth = 0; iheight = 0; resize(settings.width = 256, settings.height = 256); update_filter(); clear(); return true; } unsigned rounded_power_of_two(unsigned n) { n--; n |= n >> 1; n |= n >> 2; n |= n >> 4; n |= n >> 8; n |= n >> 16; return n + 1; } void resize(unsigned width, unsigned height) { if(iwidth >= width && iheight >= height) return; iwidth = rounded_power_of_two(max(width, iwidth )); iheight = rounded_power_of_two(max(height, iheight)); if(d3dcaps.MaxTextureWidth < iwidth || d3dcaps.MaxTextureWidth < iheight) { //TODO: attempt to handle this more gracefully return; } if(texture) texture->Release(); device->CreateTexture(iwidth, iheight, 1, flags.t_usage, D3DFMT_X8R8G8B8, (D3DPOOL)flags.t_pool, &texture, NULL); } void update_filter() { if(!device) return; if(lost && !recover()) return; flags.filter = (settings.filter == Video::FilterNearest ? D3DTEXF_POINT : D3DTEXF_LINEAR); device->SetSamplerState(0, D3DSAMP_MINFILTER, flags.filter); device->SetSamplerState(0, D3DSAMP_MAGFILTER, flags.filter); } // Vertex format: // // 0----------1 // | /| // | / | // | / | // | / | // | / | // 2----------3 // // (x,y) screen coords, in pixels // (u,v) texture coords, betweeen 0.0 (top, left) to 1.0 (bottom, right) void set_vertex( uint32_t px, uint32_t py, uint32_t pw, uint32_t ph, uint32_t tw, uint32_t th, uint32_t x, uint32_t y, uint32_t w, uint32_t h ) { d3dvertex vertex[4]; vertex[0].x = vertex[2].x = (double)(x - 0.5); vertex[1].x = vertex[3].x = (double)(x + w - 0.5); vertex[0].y = vertex[1].y = (double)(y - 0.5); vertex[2].y = vertex[3].y = (double)(y + h - 0.5); //Z-buffer and RHW are unused for 2D blit, set to normal values vertex[0].z = vertex[1].z = vertex[2].z = vertex[3].z = 0.0; vertex[0].rhw = vertex[1].rhw = vertex[2].rhw = vertex[3].rhw = 1.0; double rw = (double)w / (double)pw * (double)tw; double rh = (double)h / (double)ph * (double)th; vertex[0].u = vertex[2].u = (double)(px ) / rw; vertex[1].u = vertex[3].u = (double)(px + w) / rw; vertex[0].v = vertex[1].v = (double)(py ) / rh; vertex[2].v = vertex[3].v = (double)(py + h) / rh; vertex_buffer->Lock(0, sizeof(d3dvertex) * 4, (void**)&vertex_ptr, 0); memcpy(vertex_ptr, vertex, sizeof(d3dvertex) * 4); vertex_buffer->Unlock(); device->SetStreamSource(0, vertex_buffer, 0, sizeof(d3dvertex)); } void clear() { if(lost && !recover()) return; texture->GetLevelDesc(0, &d3dsd); texture->GetSurfaceLevel(0, &surface); if(surface) { device->ColorFill(surface, 0, D3DCOLOR_XRGB(0x00, 0x00, 0x00)); surface->Release(); surface = nullptr; } //clear primary display and all backbuffers for(unsigned i = 0; i < 3; i++) { device->Clear(0, 0, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0x00, 0x00, 0x00), 1.0f, 0); device->Present(0, 0, 0, 0); } } bool lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) { if(lost && !recover()) return false; if(width != settings.width || height != settings.height) { resize(settings.width = width, settings.height = height); } texture->GetLevelDesc(0, &d3dsd); texture->GetSurfaceLevel(0, &surface); surface->LockRect(&d3dlr, 0, flags.lock); pitch = d3dlr.Pitch; return data = (uint32_t*)d3dlr.pBits; } void unlock() { surface->UnlockRect(); surface->Release(); surface = nullptr; } void refresh() { if(lost && !recover()) return; RECT rd, rs; //dest, source rectangles GetClientRect(settings.handle, &rd); SetRect(&rs, 0, 0, settings.width, settings.height); //if output size changed, driver must be re-initialized. //failure to do so causes scaling issues on some video drivers. if(state.width != rd.right || state.height != rd.bottom) { init(); set_shader(shader_source_markup); return; } if(caps.shader && effect) { device->BeginScene(); set_vertex(0, 0, settings.width, settings.height, iwidth, iheight, 0, 0, rd.right, rd.bottom); D3DXVECTOR4 rubyTextureSize; rubyTextureSize.x = iwidth; rubyTextureSize.y = iheight; rubyTextureSize.z = 1.0 / iheight; rubyTextureSize.w = 1.0 / iwidth; effect->SetVector("rubyTextureSize", &rubyTextureSize); D3DXVECTOR4 rubyInputSize; rubyInputSize.x = settings.width; rubyInputSize.y = settings.height; rubyInputSize.z = 1.0 / settings.height; rubyInputSize.w = 1.0 / settings.width; effect->SetVector("rubyInputSize", &rubyInputSize); D3DXVECTOR4 rubyOutputSize; rubyOutputSize.x = rd.right; rubyOutputSize.y = rd.bottom; rubyOutputSize.z = 1.0 / rd.bottom; rubyOutputSize.w = 1.0 / rd.right; effect->SetVector("rubyOutputSize", &rubyOutputSize); UINT passes; effect->Begin(&passes, 0); effect->SetTexture("rubyTexture", texture); device->SetTexture(0, texture); for(unsigned pass = 0; pass < passes; pass++) { effect->BeginPass(pass); device->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); effect->EndPass(); } effect->End(); device->EndScene(); } else { device->BeginScene(); set_vertex(0, 0, settings.width, settings.height, iwidth, iheight, 0, 0, rd.right, rd.bottom); device->SetTexture(0, texture); device->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); device->EndScene(); } if(settings.synchronize) { D3DRASTER_STATUS status; //wait for a previous vblank to finish, if necessary while(true) { device->GetRasterStatus(0, &status); if(status.InVBlank == false) break; } //wait for next vblank to begin while(true) { device->GetRasterStatus(0, &status); if(status.InVBlank == true) break; } } if(device->Present(0, 0, 0, 0) == D3DERR_DEVICELOST) lost = true; } void set_shader(const char* source) { if(!caps.shader) return; if(effect) { effect->Release(); effect = NULL; } if(!source || !*source) { shader_source_markup = ""; return; } shader_source_markup = source; XML::Document document(shader_source_markup); bool is_hlsl = document["shader"]["language"].data == "HLSL"; string shader_source = document["shader"]["source"].data; if(shader_source == "") return; HMODULE d3dx; for(unsigned i = 0; i < 256; i++) { char t[256]; sprintf(t, "d3dx9_%u.dll", i); d3dx = LoadLibraryW(utf16_t(t)); if(d3dx) break; } if(!d3dx) d3dx = LoadLibraryW(L"d3dx9.dll"); if(!d3dx) return; EffectProc effectProc = (EffectProc)GetProcAddress(d3dx, "D3DXCreateEffect"); TextureProc textureProc = (TextureProc)GetProcAddress(d3dx, "D3DXCreateTextureFromFileA"); LPD3DXBUFFER pBufferErrors = NULL; effectProc(device, shader_source, lstrlenA(shader_source), NULL, NULL, 0, NULL, &effect, &pBufferErrors); D3DXHANDLE hTech; effect->FindNextValidTechnique(NULL, &hTech); effect->SetTechnique(hTech); } bool init() { term(); RECT rd; GetClientRect(settings.handle, &rd); state.width = rd.right; state.height = rd.bottom; lpd3d = Direct3DCreate9(D3D_SDK_VERSION); if(!lpd3d) return false; memset(&presentation, 0, sizeof(presentation)); presentation.Flags = D3DPRESENTFLAG_VIDEO; presentation.SwapEffect = D3DSWAPEFFECT_FLIP; presentation.hDeviceWindow = settings.handle; presentation.BackBufferCount = 1; presentation.MultiSampleType = D3DMULTISAMPLE_NONE; presentation.MultiSampleQuality = 0; presentation.EnableAutoDepthStencil = false; presentation.AutoDepthStencilFormat = D3DFMT_UNKNOWN; presentation.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; presentation.Windowed = true; presentation.BackBufferFormat = D3DFMT_UNKNOWN; presentation.BackBufferWidth = 0; presentation.BackBufferHeight = 0; if(lpd3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, settings.handle, D3DCREATE_FPU_PRESERVE | D3DCREATE_SOFTWARE_VERTEXPROCESSING, &presentation, &device) != D3D_OK) { return false; } device->GetDeviceCaps(&d3dcaps); caps.dynamic = bool(d3dcaps.Caps2 & D3DCAPS2_DYNAMICTEXTURES); caps.shader = d3dcaps.PixelShaderVersion > D3DPS_VERSION(1, 4); if(caps.dynamic == true) { flags.t_usage = D3DUSAGE_DYNAMIC; flags.v_usage = D3DUSAGE_WRITEONLY | D3DUSAGE_DYNAMIC; flags.t_pool = D3DPOOL_DEFAULT; flags.v_pool = D3DPOOL_DEFAULT; flags.lock = D3DLOCK_NOSYSLOCK | D3DLOCK_DISCARD; } else { flags.t_usage = 0; flags.v_usage = D3DUSAGE_WRITEONLY; flags.t_pool = D3DPOOL_MANAGED; flags.v_pool = D3DPOOL_MANAGED; flags.lock = D3DLOCK_NOSYSLOCK | D3DLOCK_DISCARD; } lost = false; recover(); return true; } void release_resources() { if(effect) { effect->Release(); effect = 0; } if(vertex_buffer) { vertex_buffer->Release(); vertex_buffer = 0; } if(surface) { surface->Release(); surface = 0; } if(texture) { texture->Release(); texture = 0; } } void term() { release_resources(); if(device) { device->Release(); device = 0; } if(lpd3d) { lpd3d->Release(); lpd3d = 0; } } pVideoD3D() { effect = 0; vertex_buffer = 0; surface = 0; texture = 0; device = 0; lpd3d = 0; lost = true; settings.handle = 0; settings.synchronize = false; settings.filter = Video::FilterLinear; } }; DeclareVideo(D3D) }; #undef D3DVERTEX target-ethos/settings/settings.hpp000664 001750 001750 00000000520 12651764221 020524 0ustar00sergiosergio000000 000000 struct SettingsLayout : VerticalLayout { SettingsLayout(); }; #include "video.hpp" #include "audio.hpp" #include "input.hpp" #include "hotkey.hpp" #include "timing.hpp" #include "server.hpp" #include "advanced.hpp" struct Settings : Window { VerticalLayout layout; TabFrame panels; Settings(); }; extern Settings* settings; sfc/chip/event/000700 001750 001750 00000000000 12656700342 014512 5ustar00sergiosergio000000 000000 phoenix/windows/platform.cpp000664 001750 001750 00000002343 12651764221 017406 0ustar00sergiosergio000000 000000 #include "platform.hpp" #include "utility.cpp" #include "settings.cpp" #include "desktop.cpp" #include "monitor.cpp" #include "keyboard.cpp" #include "mouse.cpp" #include "browser-window.cpp" #include "message-window.cpp" #include "object.cpp" #include "font.cpp" #include "timer.cpp" #include "window.cpp" #include "action/action.cpp" #include "action/menu.cpp" #include "action/separator.cpp" #include "action/item.cpp" #include "action/check-item.cpp" #include "action/radio-item.cpp" #include "widget/widget.cpp" #include "widget/button.cpp" #include "widget/canvas.cpp" #include "widget/check-button.cpp" #include "widget/check-label.cpp" #include "widget/combo-button.cpp" #include "widget/console.cpp" #include "widget/frame.cpp" #include "widget/hex-edit.cpp" #include "widget/horizontal-scroller.cpp" #include "widget/horizontal-slider.cpp" #include "widget/label.cpp" #include "widget/line-edit.cpp" #include "widget/list-view.cpp" #include "widget/progress-bar.cpp" #include "widget/radio-button.cpp" #include "widget/radio-label.cpp" #include "widget/tab-frame.cpp" #include "widget/text-edit.cpp" #include "widget/vertical-scroller.cpp" #include "widget/vertical-slider.cpp" #include "widget/viewport.cpp" #include "application.cpp" phoenix/reference/window.hpp000664 001750 001750 00000001721 12651764221 017341 0ustar00sergiosergio000000 000000 namespace phoenix { struct pWindow : public pObject { Window& window; static Window& none(); void append(Layout& layout); void append(Menu& menu); void append(Widget& widget); bool focused(); Geometry frameMargin(); Geometry geometry(); void remove(Layout& layout); void remove(Menu& menu); void remove(Widget& widget); void setBackgroundColor(Color color); void setDroppable(bool droppable); void setFocused(); void setFullScreen(bool fullScreen); void setGeometry(Geometry geometry); void setMenuFont(string font); void setMenuVisible(bool visible); void setModal(bool modal); void setResizable(bool resizable); void setStatusFont(string font); void setStatusText(string text); void setStatusVisible(bool visible); void setTitle(string text); void setVisible(bool visible); void setWidgetFont(string font); pWindow(Window& window) : pObject(window), window(window) {} void constructor(); void destructor(); }; } target-ethos/utility/utility.hpp000664 001750 001750 00000002003 12651764221 020230 0ustar00sergiosergio000000 000000 struct Utility { void setInterface(Emulator::Interface* emulator); void loadMedia(string pathname); void loadMedia(Emulator::Interface* emulator, Emulator::Interface::Media& media, string pathname); void loadRequest(unsigned id, string name, string type); void loadRequest(unsigned id, string path); void saveRequest(unsigned id, string path); void connect(unsigned port, unsigned device); void power(); void reset(); void load(); void unload(); void saveState(unsigned slot); void loadState(unsigned slot); void tracerToggle(); void synchronizeDSP(); void synchronizeRuby(); void updatePalette(); void updateShader(); void resize(bool resizeWindow = false); void toggleFullScreen(); void updateStatus(); void setStatusText(string text); void showMessage(string message); string libraryPath(); Utility(); lstring path; lstring pathname; private: bool tracerEnable; string statusText; string statusMessage; time_t statusTime; }; extern Utility* utility; sfc/ppu/sprite/sprite.hpp000664 001750 001750 00000002670 12651764221 016621 0ustar00sergiosergio000000 000000 struct Sprite { struct SpriteItem { uint16 x; uint16 y; uint8 character; bool nameselect; bool vflip; bool hflip; uint8 priority; uint8 palette; bool size; unsigned width() const; unsigned height() const; } list[128]; struct TileItem { uint16 x; uint16 priority; uint16 palette; bool hflip; uint8 d0, d1, d2, d3; }; struct State { unsigned x; unsigned y; unsigned item_count; unsigned tile_count; bool active; uint8 item[2][32]; TileItem tile[2][34]; } t; struct Regs { bool main_enable; bool sub_enable; bool interlace; uint3 base_size; uint2 nameselect; uint16 tiledata_addr; uint8 first_sprite; unsigned priority0; unsigned priority1; unsigned priority2; unsigned priority3; bool time_over; bool range_over; } regs; struct Output { struct Pixel { unsigned priority; //0 = none (transparent) uint8 palette; } main, sub; } output; //list.cpp inline void update(unsigned addr, uint8 data); inline void synchronize(); //sprite.cpp inline void address_reset(); inline void set_first_sprite(); inline void frame(); inline void scanline(); inline void run(); inline void tilefetch(); inline void reset(); inline bool on_scanline(SpriteItem&); inline void serialize(serializer&); inline Sprite(PPU& self); PPU& self; friend class PPU; }; ruby/audio.hpp000664 001750 001750 00000001041 12651764221 014477 0ustar00sergiosergio000000 000000 struct Audio { static const char* Handle; static const char* Synchronize; static const char* Frequency; static const char* Latency; virtual bool cap(const nall::string& name) { return false; } virtual nall::any get(const nall::string& name) { return false; } virtual bool set(const nall::string& name, const nall::any& value) { return false; } virtual void sample(uint16_t left, uint16_t right) {} virtual void clear() {} virtual bool init() { return true; } virtual void term() {} Audio() {} virtual ~Audio() {} }; fc/system/system.cpp000664 001750 001750 00000003226 12651764221 015657 0ustar00sergiosergio000000 000000 #include namespace Famicom { #include "serialization.cpp" System system; void System::run() { scheduler.enter(); if(scheduler.exit_reason() == Scheduler::ExitReason::FrameEvent) { interface->videoRefresh(video.palette, ppu.buffer, 4 * 256, 256, 240); } } void System::runtosave() { scheduler.sync = Scheduler::SynchronizeMode::PPU; runthreadtosave(); scheduler.sync = Scheduler::SynchronizeMode::All; scheduler.thread = cpu.thread; runthreadtosave(); scheduler.sync = Scheduler::SynchronizeMode::All; scheduler.thread = apu.thread; runthreadtosave(); scheduler.sync = Scheduler::SynchronizeMode::All; scheduler.thread = cartridge.thread; runthreadtosave(); scheduler.sync = Scheduler::SynchronizeMode::None; } void System::runthreadtosave() { while(true) { scheduler.enter(); if(scheduler.exit_reason() == Scheduler::ExitReason::SynchronizeEvent) break; if(scheduler.exit_reason() == Scheduler::ExitReason::FrameEvent) { interface->videoRefresh(video.palette, ppu.buffer, 4 * 256, 256, 240); } } } void System::load() { string manifest = string::read({interface->path(ID::System), "manifest.bml"}); auto document = Markup::Document(manifest); serialize_init(); } void System::power() { cartridge.power(); cpu.power(); apu.power(); ppu.power(); input.reset(); scheduler.power(); reset(); } void System::reset() { cartridge.reset(); cpu.reset(); apu.reset(); ppu.reset(); input.reset(); scheduler.reset(); } void System::init() { assert(interface != 0); input.connect(0, Input::Device::Joypad); input.connect(1, Input::Device::None); } void System::term() { } } ananke/file-dialog.cpp000664 001750 001750 00000005617 12651764221 016036 0ustar00sergiosergio000000 000000 struct FileDialog : Window { VerticalLayout layout; HorizontalLayout pathLayout; LineEdit pathEdit; Button homeButton; Button upButton; ListView fileList; HorizontalLayout controlLayout; Label filterLabel; Button openButton; string open() { setVisible(); fileList.setFocused(); filename = ""; setModal(); return filename; } void setPath(const string &path) { pathname = string{path}.transform("\\", "/"); if(pathname.empty()) pathname = userpath(); if(pathname.endsWith("/") == false) pathname.append("/"); pathEdit.setText(pathname); fileList.reset(); filenameList.reset(); lstring folders = directory::ifolders(pathname); for(auto &folder : folders) { fileList.append(string{folder}.rtrim<1>("/")); fileList.setImage(filenameList.size(), 0, {resource::folder, sizeof resource::folder}); filenameList.append({pathname, folder}); } lstring files = directory::ifiles(pathname); for(auto &file : files) { if(Ananke::supported(file) == false) continue; //ignore unsupported extensions fileList.append(file); if(extension(file) == "zip") { fileList.setImage(filenameList.size(), 0, {resource::archive, sizeof resource::archive}); } else { fileList.setImage(filenameList.size(), 0, {resource::file, sizeof resource::file}); } filenameList.append({pathname, file}); } fileList.setSelection(0); fileList.setSelected(); fileList.setFocused(); } FileDialog() { setTitle("Load Image"); layout.setMargin(5); homeButton.setImage({resource::home, sizeof resource::home}); upButton.setImage({resource::up, sizeof resource::up}); filterLabel.setText("Filter: *.fc, *.sfc, *.st, *.bs, *.gb, *.gbc, *.gba, *.nes, *.smc, *.zip"); openButton.setText("Open"); append(layout); layout.append(pathLayout, {~0, 0}, 5); pathLayout.append(pathEdit, {~0, 0}, 5); pathLayout.append(homeButton, {28, 28}, 5); pathLayout.append(upButton, {28, 28}); layout.append(fileList, {~0, ~0}, 5); layout.append(controlLayout, {~0, 0}); controlLayout.append(filterLabel, {~0, 0}, 5); controlLayout.append(openButton, {80, 0}); pathEdit.onActivate = [&] { string path = pathEdit.text(); setPath(path); }; homeButton.onActivate = [&] { setPath(userpath()); }; upButton.onActivate = [&] { setPath(parentdir(pathname)); }; fileList.onActivate = openButton.onActivate = [&] { if(fileList.selected() == false) return; string name = filenameList(fileList.selection()); if(name.empty()) return; if(name.endsWith("/")) return setPath(name); filename = name; onClose(); }; onClose = [&] { setModal(false); setVisible(false); }; } private: string pathname; string filename; lstring filenameList; }; phoenix/reference/widget/progress-bar.cpp000664 001750 001750 00000000231 12651764221 021711 0ustar00sergiosergio000000 000000 namespace phoenix { void pProgressBar::setPosition(unsigned position) { } void pProgressBar::constructor() { } void pProgressBar::destructor() { } } gb/apu/wave/000700 001750 001750 00000000000 12656700342 014012 5ustar00sergiosergio000000 000000 ananke/resource/resource.bml000664 001750 001750 00000000270 12651764221 017316 0ustar00sergiosergio000000 000000 resource name=resource binary id=home name=home.png binary id=up name=up.png binary id=folder name=folder.png binary id=file name=file.png binary id=archive name=archive.png sfc/alt/ppu-performance/cache/cache.cpp000664 001750 001750 00000006506 12651764221 021167 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP uint8* PPU::Cache::tile_2bpp(unsigned tile) { if(tilevalid[0][tile] == 0) { tilevalid[0][tile] = 1; uint8* output = (uint8*)tiledata[0] + (tile << 6); unsigned offset = tile << 4; unsigned y = 8; unsigned color, d0, d1; while(y--) { d0 = ppu.vram[offset + 0]; d1 = ppu.vram[offset + 1]; #define render_line(mask) \ color = !!(d0 & mask) << 0; \ color |= !!(d1 & mask) << 1; \ *output++ = color render_line(0x80); render_line(0x40); render_line(0x20); render_line(0x10); render_line(0x08); render_line(0x04); render_line(0x02); render_line(0x01); #undef render_line offset += 2; } } return tiledata[0] + (tile << 6); } uint8* PPU::Cache::tile_4bpp(unsigned tile) { if(tilevalid[1][tile] == 0) { tilevalid[1][tile] = 1; uint8* output = (uint8*)tiledata[1] + (tile << 6); unsigned offset = tile << 5; unsigned y = 8; unsigned color, d0, d1, d2, d3; while(y--) { d0 = ppu.vram[offset + 0]; d1 = ppu.vram[offset + 1]; d2 = ppu.vram[offset + 16]; d3 = ppu.vram[offset + 17]; #define render_line(mask) \ color = !!(d0 & mask) << 0; \ color |= !!(d1 & mask) << 1; \ color |= !!(d2 & mask) << 2; \ color |= !!(d3 & mask) << 3; \ *output++ = color render_line(0x80); render_line(0x40); render_line(0x20); render_line(0x10); render_line(0x08); render_line(0x04); render_line(0x02); render_line(0x01); #undef render_line offset += 2; } } return tiledata[1] + (tile << 6); } uint8* PPU::Cache::tile_8bpp(unsigned tile) { if(tilevalid[2][tile] == 0) { tilevalid[2][tile] = 1; uint8* output = (uint8*)tiledata[2] + (tile << 6); unsigned offset = tile << 6; unsigned y = 8; unsigned color, d0, d1, d2, d3, d4, d5, d6, d7; while(y--) { d0 = ppu.vram[offset + 0]; d1 = ppu.vram[offset + 1]; d2 = ppu.vram[offset + 16]; d3 = ppu.vram[offset + 17]; d4 = ppu.vram[offset + 32]; d5 = ppu.vram[offset + 33]; d6 = ppu.vram[offset + 48]; d7 = ppu.vram[offset + 49]; #define render_line(mask) \ color = !!(d0 & mask) << 0; \ color |= !!(d1 & mask) << 1; \ color |= !!(d2 & mask) << 2; \ color |= !!(d3 & mask) << 3; \ color |= !!(d4 & mask) << 4; \ color |= !!(d5 & mask) << 5; \ color |= !!(d6 & mask) << 6; \ color |= !!(d7 & mask) << 7; \ *output++ = color render_line(0x80); render_line(0x40); render_line(0x20); render_line(0x10); render_line(0x08); render_line(0x04); render_line(0x02); render_line(0x01); #undef render_line offset += 2; } } return tiledata[2] + (tile << 6); } uint8* PPU::Cache::tile(unsigned bpp, unsigned tile) { switch(bpp) { case 0: return tile_2bpp(tile); case 1: return tile_4bpp(tile); case 2: return tile_8bpp(tile); } // NOT REACHED return 0; } PPU::Cache::Cache(PPU& self) : self(self) { tiledata[0] = new uint8[262144](); tiledata[1] = new uint8[131072](); tiledata[2] = new uint8[ 65536](); tilevalid[0] = new uint8[ 4096](); tilevalid[1] = new uint8[ 2048](); tilevalid[2] = new uint8[ 1024](); } #endif ruby/audio/000700 001750 001750 00000000000 12656700342 013755 5ustar00sergiosergio000000 000000 gba/apu/sequencer.cpp000664 001750 001750 00000003623 12651764221 015730 0ustar00sergiosergio000000 000000 void APU::runsequencer() { auto& r = sequencer; if(r.base == 0) { //512hz if(r.step == 0 || r.step == 2 || r.step == 4 || r.step == 6) { //256hz square1.clocklength(); square2.clocklength(); wave.clocklength(); noise.clocklength(); } if(r.step == 2 || r.step == 6) { //128hz square1.clocksweep(); } if(r.step == 7) { //64hz square1.clockenvelope(); square2.clockenvelope(); noise.clockenvelope(); } r.step++; } r.base++; if(r.enable[0]) square1.run(); if(r.enable[1]) square2.run(); if(r.enable[2]) wave.run(); if(r.enable[3]) noise.run(); } uint8 APU::Sequencer::read(unsigned addr) const { switch(addr) { case 0: return (rvolume << 0) | (lvolume << 4); case 1: return ( (renable[0] << 0) | (renable[1] << 1) | (renable[2] << 2) | (renable[3] << 3) | (lenable[0] << 4) | (lenable[1] << 5) | (lenable[2] << 6) | (lenable[3] << 7) ); case 2: return ( (enable[0] << 0) | (enable[1] << 1) | (enable[2] << 2) | (enable[3] << 3) | (masterenable << 7) ); } } void APU::Sequencer::write(unsigned addr, uint8 byte) { switch(addr) { case 0: //NR50 rvolume = byte >> 0; lvolume = byte >> 4; break; case 1: //NR51 renable[0] = byte >> 0; renable[1] = byte >> 1; renable[2] = byte >> 2; renable[3] = byte >> 3; lenable[0] = byte >> 4; lenable[1] = byte >> 5; lenable[2] = byte >> 6; lenable[3] = byte >> 7; break; case 2: //NR52 enable[0] = byte >> 0; enable[1] = byte >> 1; enable[2] = byte >> 2; enable[3] = byte >> 3; masterenable = byte >> 7; break; } } void APU::Sequencer::power() { lvolume = 0; rvolume = 0; for(auto& n : lenable) n = 0; for(auto& n : renable) n = 0; for(auto& n : enable) n = 0; masterenable = 0; base = 0; step = 0; lsample = 0; rsample = 0; } ruby/input/mouse/rawinput.cpp000664 001750 001750 00000007006 12651764221 017540 0ustar00sergiosergio000000 000000 #ifndef RUBY_INPUT_MOUSE_RAWINPUT #define RUBY_INPUT_MOUSE_RAWINPUT namespace ruby { struct InputMouseRawInput { uintptr_t handle = 0; bool mouseAcquired = false; struct Mouse { HID::Mouse hid; signed relativeX = 0; signed relativeY = 0; signed relativeZ = 0; bool buttons[5] = {0}; } ms; bool acquire() { if(mouseAcquired == false) { mouseAcquired = true; ShowCursor(false); } return true; } bool unacquire() { if(mouseAcquired == true) { mouseAcquired = false; ReleaseCapture(); ClipCursor(NULL); ShowCursor(true); } return true; } bool acquired() { if(mouseAcquired == true) { SetFocus((HWND)handle); SetCapture((HWND)handle); RECT rc; GetWindowRect((HWND)handle, &rc); ClipCursor(&rc); } return GetCapture() == (HWND)handle; } void update(RAWINPUT* input) { if((input->data.mouse.usFlags & 1) == MOUSE_MOVE_RELATIVE) { ms.relativeX += input->data.mouse.lLastX; ms.relativeY += input->data.mouse.lLastY; } if(input->data.mouse.usButtonFlags & RI_MOUSE_WHEEL) { ms.relativeZ += (int16_t)input->data.mouse.usButtonData; } if(input->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_1_DOWN) ms.buttons[0] = 1; if(input->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_1_UP ) ms.buttons[0] = 0; if(input->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_2_DOWN) ms.buttons[1] = 1; if(input->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_2_UP ) ms.buttons[1] = 0; if(input->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_3_DOWN) ms.buttons[2] = 1; if(input->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_3_UP ) ms.buttons[2] = 0; if(input->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_4_DOWN) ms.buttons[3] = 1; if(input->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_4_UP ) ms.buttons[3] = 0; if(input->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_5_DOWN) ms.buttons[4] = 1; if(input->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_5_UP ) ms.buttons[4] = 0; } void assign(unsigned groupID, unsigned inputID, int16_t value) { auto& group = ms.hid.group[groupID]; if(group.input[inputID].value == value) return; if(input.onChange) input.onChange(ms.hid, groupID, inputID, group.input[inputID].value, value); group.input[inputID].value = value; } void poll(vector& devices) { assign(HID::Mouse::GroupID::Axis, 0, ms.relativeX); assign(HID::Mouse::GroupID::Axis, 1, ms.relativeY); assign(HID::Mouse::GroupID::Axis, 2, ms.relativeZ); //keys are intentionally reordered below: //in ruby, button order is {left, middle, right, up, down} assign(HID::Mouse::GroupID::Button, 0, ms.buttons[0]); assign(HID::Mouse::GroupID::Button, 2, ms.buttons[1]); assign(HID::Mouse::GroupID::Button, 1, ms.buttons[2]); assign(HID::Mouse::GroupID::Button, 4, ms.buttons[3]); assign(HID::Mouse::GroupID::Button, 3, ms.buttons[4]); ms.relativeX = 0; ms.relativeY = 0; ms.relativeZ = 0; devices.append(&ms.hid); } bool init(uintptr_t handle) { this->handle = handle; ms.hid.id = 2; ms.hid.axis().append({"X"}); ms.hid.axis().append({"Y"}); ms.hid.axis().append({"Z"}); ms.hid.button().append({"Left"}); ms.hid.button().append({"Middle"}); ms.hid.button().append({"Right"}); ms.hid.button().append({"Up"}); ms.hid.button().append({"Down"}); rawinput.updateMouse = {&InputMouseRawInput::update, this}; return true; } void term() { unacquire(); } }; } #endif nall/stream/vector.hpp000664 001750 001750 00000002201 12651764221 016137 0ustar00sergiosergio000000 000000 #ifndef NALL_STREAM_VECTOR_HPP #define NALL_STREAM_VECTOR_HPP #include #include namespace nall { struct vectorstream : stream { using stream::read; using stream::write; bool seekable() const { return true; } bool readable() const { return true; } bool writable() const { return pwritable; } bool randomaccess() const { return true; } uint8_t* data() const { return memory.data(); } unsigned size() const { return memory.size(); } unsigned offset() const { return poffset; } void seek(unsigned offset) const { poffset = offset; } uint8_t read() const { return memory[poffset++]; } void write(uint8_t data) const { memory[poffset++] = data; } uint8_t read(unsigned offset) const { return memory[offset]; } void write(unsigned offset, uint8_t data) const { memory[offset] = data; } vectorstream(vector& memory) : memory(memory), poffset(0), pwritable(true) {} vectorstream(const vector& memory) : memory((vector&)memory), poffset(0), pwritable(false) {} protected: vector& memory; mutable unsigned poffset, pwritable; }; } #endif gb/apu/square2/000700 001750 001750 00000000000 12656700342 014432 5ustar00sergiosergio000000 000000 nall/string/datetime.hpp000664 001750 001750 00000001142 12651764221 016447 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { string string::date() { time_t timestamp = ::time(nullptr); tm* info = localtime(×tamp); return { format<4, '0'>(1900 + info->tm_year), "-", format<2, '0'>(1 + info->tm_mon), "-", format<2, '0'>(info->tm_mday) }; } string string::time() { time_t timestamp = ::time(nullptr); tm* info = localtime(×tamp); return { format<2, '0'>(info->tm_hour), ":", format<2, '0'>(info->tm_min), ":", format<2, '0'>(info->tm_sec) }; } string string::datetime() { return {string::date(), " ", string::time()}; } } #endif gb/apu/square1/000700 001750 001750 00000000000 12656700342 014431 5ustar00sergiosergio000000 000000 phoenix/reference/action/radio-item.cpp000664 001750 001750 00000000352 12651764221 021333 0ustar00sergiosergio000000 000000 namespace phoenix { void pRadioItem::setChecked() { } void pRadioItem::setGroup(const group& group) { } void pRadioItem::setText(string text) { } void pRadioItem::constructor() { } void pRadioItem::destructor() { } } processor/gsu/gsu.cpp000664 001750 001750 00000001105 12651764221 016024 0ustar00sergiosergio000000 000000 #include #include "gsu.hpp" namespace Processor { #include "instructions.cpp" #include "table.cpp" #include "serialization.cpp" void GSU::power() { } void GSU::reset() { for(auto& r : regs.r) r = 0x0000; regs.sfr = 0x0000; regs.pbr = 0x00; regs.rombr = 0x00; regs.rambr = 0; regs.cbr = 0x0000; regs.scbr = 0x00; regs.scmr = 0x00; regs.colr = 0x00; regs.por = 0x00; regs.bramr = 0; regs.vcr = 0x04; regs.cfgr = 0x00; regs.clsr = 0; regs.pipeline = 0x01; //nop regs.ramaddr = 0x0000; regs.reset(); } } sfc/alt/cpu/dma.cpp000664 001750 001750 00000013704 12651764221 015304 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP bool CPU::dma_transfer_valid(uint8 bbus, unsigned abus) { //transfers from WRAM to WRAM are invalid; chip only has one address bus if(bbus == 0x80 && ((abus & 0xfe0000) == 0x7e0000 || (abus & 0x40e000) == 0x0000)) return false; return true; } bool CPU::dma_addr_valid(unsigned abus) { //A-bus access to B-bus or S-CPU registers are invalid if((abus & 0x40ff00) == 0x2100) return false; //$[00-3f|80-bf]:[2100-21ff] if((abus & 0x40fe00) == 0x4000) return false; //$[00-3f|80-bf]:[4000-41ff] if((abus & 0x40ffe0) == 0x4200) return false; //$[00-3f|80-bf]:[4200-421f] if((abus & 0x40ff80) == 0x4300) return false; //$[00-3f|80-bf]:[4300-437f] return true; } uint8 CPU::dma_read(unsigned abus) { if(dma_addr_valid(abus) == false) return 0x00; return bus.read(abus); } void CPU::dma_write(bool valid, unsigned addr, uint8 data) { if(valid) bus.write(addr, data); } void CPU::dma_transfer(bool direction, uint8 bbus, unsigned abus) { if(direction == 0) { uint8 data = dma_read(abus); add_clocks(8); dma_write(dma_transfer_valid(bbus, abus), 0x2100 | bbus, data); } else { uint8 data = dma_transfer_valid(bbus, abus) ? bus.read(0x2100 | bbus) : 0x00; add_clocks(8); dma_write(dma_addr_valid(abus), abus, data); } } uint8 CPU::dma_bbus(unsigned i, unsigned index) { switch(channel[i].transfer_mode) { default: case 0: return (channel[i].dest_addr); //0 case 1: return (channel[i].dest_addr + (index & 1)); //0,1 case 2: return (channel[i].dest_addr); //0,0 case 3: return (channel[i].dest_addr + ((index >> 1) & 1)); //0,0,1,1 case 4: return (channel[i].dest_addr + (index & 3)); //0,1,2,3 case 5: return (channel[i].dest_addr + (index & 1)); //0,1,0,1 case 6: return (channel[i].dest_addr); //0,0 [2] case 7: return (channel[i].dest_addr + ((index >> 1) & 1)); //0,0,1,1 [3] } } unsigned CPU::dma_addr(unsigned i) { unsigned result = (channel[i].source_bank << 16) | (channel[i].source_addr); if(channel[i].fixed_transfer == false) { if(channel[i].reverse_transfer == false) { channel[i].source_addr++; } else { channel[i].source_addr--; } } return result; } unsigned CPU::hdma_addr(unsigned i) { return (channel[i].source_bank << 16) | (channel[i].hdma_addr++); } unsigned CPU::hdma_iaddr(unsigned i) { return (channel[i].indirect_bank << 16) | (channel[i].indirect_addr++); } void CPU::dma_run() { add_clocks(16); for(unsigned i = 0; i < 8; i++) { if(channel[i].dma_enabled == false) continue; add_clocks(8); unsigned index = 0; do { dma_transfer(channel[i].direction, dma_bbus(i, index++), dma_addr(i)); } while(channel[i].dma_enabled && --channel[i].transfer_size); channel[i].dma_enabled = false; } status.irq_lock = true; } bool CPU::hdma_active_after(unsigned i) { for(unsigned n = i + 1; i < 8; i++) { if(channel[i].hdma_enabled && !channel[i].hdma_completed) return true; } return false; } void CPU::hdma_update(unsigned i) { if((channel[i].line_counter & 0x7f) == 0) { channel[i].line_counter = dma_read(hdma_addr(i)); channel[i].hdma_completed = (channel[i].line_counter == 0); channel[i].hdma_do_transfer = !channel[i].hdma_completed; add_clocks(8); if(channel[i].indirect) { channel[i].indirect_addr = dma_read(hdma_addr(i)) << 8; add_clocks(8); //emulating this glitch causes a slight slowdown; only enable if needed //if(!channel[i].hdma_completed || hdma_active_after(i)) { channel[i].indirect_addr >>= 8; channel[i].indirect_addr |= dma_read(hdma_addr(i)) << 8; add_clocks(8); //} } } } void CPU::hdma_run() { unsigned channels = 0; for(unsigned i = 0; i < 8; i++) { if(channel[i].hdma_enabled) channels++; } if(channels == 0) return; add_clocks(16); for(unsigned i = 0; i < 8; i++) { if(channel[i].hdma_enabled == false || channel[i].hdma_completed == true) continue; channel[i].dma_enabled = false; if(channel[i].hdma_do_transfer) { static const unsigned transfer_length[] = { 1, 2, 2, 4, 4, 4, 2, 4 }; unsigned length = transfer_length[channel[i].transfer_mode]; for(unsigned index = 0; index < length; index++) { unsigned addr = channel[i].indirect == false ? hdma_addr(i) : hdma_iaddr(i); dma_transfer(channel[i].direction, dma_bbus(i, index), addr); } } } for(unsigned i = 0; i < 8; i++) { if(channel[i].hdma_enabled == false || channel[i].hdma_completed == true) continue; channel[i].line_counter--; channel[i].hdma_do_transfer = channel[i].line_counter & 0x80; hdma_update(i); } status.irq_lock = true; } void CPU::hdma_init() { unsigned channels = 0; for(unsigned i = 0; i < 8; i++) { channel[i].hdma_completed = false; channel[i].hdma_do_transfer = false; if(channel[i].hdma_enabled) channels++; } if(channels == 0) return; add_clocks(16); for(unsigned i = 0; i < 8; i++) { if(!channel[i].hdma_enabled) continue; channel[i].dma_enabled = false; channel[i].hdma_addr = channel[i].source_addr; channel[i].line_counter = 0; hdma_update(i); } status.irq_lock = true; } void CPU::dma_reset() { for(unsigned i = 0; i < 8; i++) { channel[i].dma_enabled = false; channel[i].hdma_enabled = false; channel[i].direction = 1; channel[i].indirect = true; channel[i].unused = true; channel[i].reverse_transfer = true; channel[i].fixed_transfer = true; channel[i].transfer_mode = 0x07; channel[i].dest_addr = 0xff; channel[i].source_addr = 0xffff; channel[i].source_bank = 0xff; channel[i].transfer_size = 0xffff; channel[i].indirect_addr = 0xffff; channel[i].indirect_bank = 0xff; channel[i].hdma_addr = 0xff; channel[i].line_counter = 0xff; channel[i].unknown = 0xff; channel[i].hdma_completed = false; channel[i].hdma_do_transfer = false; } } #endif phoenix/windows/widget/horizontal-slider.cpp000664 001750 001750 00000002475 12651764221 022524 0ustar00sergiosergio000000 000000 namespace phoenix { Size pHorizontalSlider::minimumSize() { return {0, 25}; } void pHorizontalSlider::setLength(unsigned length) { length += (length == 0); SendMessage(hwnd, TBM_SETRANGE, (WPARAM)true, (LPARAM)MAKELONG(0, length - 1)); SendMessage(hwnd, TBM_SETPAGESIZE, 0, (LPARAM)(length >> 3)); horizontalSlider.setPosition(0); } void pHorizontalSlider::setPosition(unsigned position) { SendMessage(hwnd, TBM_SETPOS, (WPARAM)true, (LPARAM)position); } void pHorizontalSlider::constructor() { hwnd = CreateWindow( TRACKBAR_CLASS, L"", WS_CHILD | WS_TABSTOP | TBS_TRANSPARENTBKGND | TBS_NOTICKS | TBS_BOTH | TBS_HORZ, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&horizontalSlider); unsigned position = horizontalSlider.state.position; setLength(horizontalSlider.state.length); horizontalSlider.setPosition(position); synchronize(); } void pHorizontalSlider::destructor() { DestroyWindow(hwnd); } void pHorizontalSlider::orphan() { destructor(); constructor(); } void pHorizontalSlider::onChange() { unsigned position = SendMessage(hwnd, TBM_GETPOS, 0, 0); if(position == horizontalSlider.state.position) return; horizontalSlider.state.position = position; if(horizontalSlider.onChange) horizontalSlider.onChange(); } } phoenix/gtk/message-window.cpp000664 001750 001750 00000004743 12651764221 017614 0ustar00sergiosergio000000 000000 namespace phoenix { static MessageWindow::Response Message(MessageWindow::State& state, GtkMessageType messageStyle) { GtkWidget* dialog = gtk_message_dialog_new( state.parent ? GTK_WINDOW(state.parent->p.widget) : (GtkWindow*)nullptr, GTK_DIALOG_MODAL, messageStyle, GTK_BUTTONS_NONE, "%s", (const char*)state.text ); if(state.title) gtk_window_set_title(GTK_WINDOW(dialog), state.title); else if(applicationState.name) gtk_window_set_title(GTK_WINDOW(dialog), applicationState.name); switch(state.buttons) { case MessageWindow::Buttons::Ok: gtk_dialog_add_buttons(GTK_DIALOG(dialog), "Ok", GTK_RESPONSE_OK, nullptr); break; case MessageWindow::Buttons::OkCancel: gtk_dialog_add_buttons(GTK_DIALOG(dialog), "Ok", GTK_RESPONSE_OK, "Cancel", GTK_RESPONSE_CANCEL, nullptr); break; case MessageWindow::Buttons::YesNo: gtk_dialog_add_buttons(GTK_DIALOG(dialog), "Yes", GTK_RESPONSE_YES, "No", GTK_RESPONSE_NO, nullptr); break; case MessageWindow::Buttons::YesNoCancel: gtk_dialog_add_buttons(GTK_DIALOG(dialog), "Yes", GTK_RESPONSE_YES, "No", GTK_RESPONSE_NO, "Cancel", GTK_RESPONSE_CANCEL, nullptr); break; } auto response = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); if(response == GTK_RESPONSE_OK) return MessageWindow::Response::Ok; if(response == GTK_RESPONSE_CANCEL) return MessageWindow::Response::Cancel; if(response == GTK_RESPONSE_YES) return MessageWindow::Response::Yes; if(response == GTK_RESPONSE_NO) return MessageWindow::Response::No; //if dialog was closed without choosing a button, choose the most appropriate response if(state.buttons == MessageWindow::Buttons::Ok) return MessageWindow::Response::Ok; if(state.buttons == MessageWindow::Buttons::OkCancel) return MessageWindow::Response::Cancel; if(state.buttons == MessageWindow::Buttons::YesNo) return MessageWindow::Response::No; if(state.buttons == MessageWindow::Buttons::YesNoCancel) return MessageWindow::Response::Cancel; throw; } MessageWindow::Response pMessageWindow::error(MessageWindow::State& state) { return Message(state, GTK_MESSAGE_ERROR); } MessageWindow::Response pMessageWindow::information(MessageWindow::State& state) { return Message(state, GTK_MESSAGE_INFO); } MessageWindow::Response pMessageWindow::question(MessageWindow::State& state) { return Message(state, GTK_MESSAGE_QUESTION); } MessageWindow::Response pMessageWindow::warning(MessageWindow::State& state) { return Message(state, GTK_MESSAGE_WARNING); } } processor/spc700/spc700.hpp000664 001750 001750 00000005770 12651764221 016501 0ustar00sergiosergio000000 000000 #ifndef PROCESSOR_SPC700_HPP #define PROCESSOR_SPC700_HPP namespace Processor { struct SPC700 { virtual void op_io() = 0; virtual uint8 op_read(uint16 addr) = 0; virtual void op_write(uint16 addr, uint8 data) = 0; void op_step(); virtual uint8 disassembler_read(uint16 addr) = 0; #include "registers.hpp" #include "memory.hpp" regs_t regs; word_t dp, sp, rd, wr, bit, ya; uint8 opcode; void serialize(serializer&); string disassemble_opcode(uint16 addr); protected: uint8 op_adc(uint8, uint8); uint8 op_and(uint8, uint8); uint8 op_asl(uint8); uint8 op_cmp(uint8, uint8); uint8 op_dec(uint8); uint8 op_eor(uint8, uint8); uint8 op_inc(uint8); uint8 op_ld (uint8, uint8); uint8 op_lsr(uint8); uint8 op_or (uint8, uint8); uint8 op_rol(uint8); uint8 op_ror(uint8); uint8 op_sbc(uint8, uint8); uint8 op_st (uint8, uint8); uint16 op_adw(uint16, uint16); uint16 op_cpw(uint16, uint16); uint16 op_ldw(uint16, uint16); uint16 op_sbw(uint16, uint16); template void op_adjust(uint8&); template void op_adjust_addr(); template void op_adjust_dp(); void op_adjust_dpw(signed); template void op_adjust_dpx(); void op_branch(bool); void op_branch_bit(); void op_pull(uint8&); void op_push(uint8); template void op_read_addr(uint8&); template void op_read_addri(uint8&); template void op_read_const(uint8&); template void op_read_dp(uint8&); template void op_read_dpi(uint8&, uint8&); template void op_read_dpw(); template void op_read_idpx(); template void op_read_idpy(); template void op_read_ix(); void op_set_addr_bit(); void op_set_bit(); void op_set_flag(bool&, bool); void op_test_addr(bool); void op_transfer(uint8&, uint8&); void op_write_addr(uint8&); void op_write_addri(uint8&); void op_write_dp(uint8&); void op_write_dpi(uint8&, uint8&); template void op_write_dp_const(); template void op_write_dp_dp(); template void op_write_ix_iy(); void op_bne_dp(); void op_bne_dpdec(); void op_bne_dpx(); void op_bne_ydec(); void op_brk(); void op_clv(); void op_cmc(); void op_daa(); void op_das(); void op_div_ya_x(); void op_jmp_addr(); void op_jmp_iaddrx(); void op_jsp_dp(); void op_jsr_addr(); void op_jst(); void op_lda_ixinc(); void op_mul_ya(); void op_nop(); void op_plp(); void op_rti(); void op_rts(); void op_sta_idpx(); void op_sta_idpy(); void op_sta_ix(); void op_sta_ixinc(); void op_stw_dp(); void op_wait(); void op_xcn(); }; } #endif sfc/chip/obc1/000700 001750 001750 00000000000 12656700342 014215 5ustar00sergiosergio000000 000000 sfc/chip/sa1/sa1.hpp000664 001750 001750 00000001250 12651764221 015265 0ustar00sergiosergio000000 000000 struct SA1 : Processor::R65816, public Coprocessor { MappedRAM rom; MappedRAM iram; MappedRAM bwram; #include "bus/bus.hpp" #include "dma/dma.hpp" #include "memory/memory.hpp" #include "mmio/mmio.hpp" struct Status { uint8 tick_counter; bool interrupt_pending; uint16 scanlines; uint16 vcounter; uint16 hcounter; } status; static void Enter(); void enter(); void tick(); void op_irq(); alwaysinline void trigger_irq(); alwaysinline void last_cycle(); alwaysinline bool interrupt_pending(); void init(); void load(); void unload(); void power(); void reset(); void serialize(serializer&); }; extern SA1 sa1; gb/apu/noise/000700 001750 001750 00000000000 12656700342 014165 5ustar00sergiosergio000000 000000 sfc/alt/ppu-performance/000700 001750 001750 00000000000 12656700342 016331 5ustar00sergiosergio000000 000000 sfc/chip/hsu1/000700 001750 001750 00000000000 12656700342 014251 5ustar00sergiosergio000000 000000 sfc/dsp/brr.cpp000664 001750 001750 00000002764 12651764221 014553 0ustar00sergiosergio000000 000000 #ifdef DSP_CPP void DSP::brr_decode(voice_t& v) { //state.t_brr_byte = ram[v.brr_addr + v.brr_offset] cached from previous clock cycle int nybbles = (state.t_brr_byte << 8) + smp.apuram[(uint16)(v.brr_addr + v.brr_offset + 1)]; const int filter = (state.t_brr_header >> 2) & 3; const int scale = (state.t_brr_header >> 4); //decode four samples for(unsigned i = 0; i < 4; i++) { //bits 12-15 = current nybble; sign extend, then shift right to 4-bit precision //result: s = 4-bit sign-extended sample value int s = (int16)nybbles >> 12; nybbles <<= 4; //slide nybble so that on next loop iteration, bits 12-15 = current nybble if(scale <= 12) { s <<= scale; s >>= 1; } else { s &= ~0x7ff; } //apply IIR filter (2 is the most commonly used) const int p1 = v.buffer[v.buf_pos - 1]; const int p2 = v.buffer[v.buf_pos - 2] >> 1; switch(filter) { case 0: break; case 1: //s += p1 * 0.46875 s += p1 >> 1; s += (-p1) >> 5; break; case 2: //s += p1 * 0.953125 - p2 * 0.46875 s += p1; s -= p2; s += p2 >> 4; s += (p1 * -3) >> 6; break; case 3: //s += p1 * 0.8984375 - p2 * 0.40625 s += p1; s -= p2; s += (p1 * -13) >> 7; s += (p2 * 3) >> 4; break; } //adjust and write sample s = sclamp<16>(s); s = (int16)(s << 1); v.buffer.write(v.buf_pos++, s); if(v.buf_pos >= brr_buf_size) v.buf_pos = 0; } } #endif sfc/chip/obc1/obc1.hpp000664 001750 001750 00000000626 12651764221 015573 0ustar00sergiosergio000000 000000 struct OBC1 { MappedRAM ram; void init(); void load(); void unload(); void power(); void reset(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); void serialize(serializer&); private: uint8 ram_read(unsigned addr); void ram_write(unsigned addr, uint8 data); struct { uint16 address; uint16 baseptr; uint16 shift; } status; }; extern OBC1 obc1; sfc/chip/dsp1/serialization.cpp000664 001750 001750 00000002417 12651764221 017642 0ustar00sergiosergio000000 000000 #ifdef DSP1_CPP void DSP1::serialize(serializer &s) { dsp1.serialize(s); } void Dsp1::serialize(serializer &s) { for(unsigned i = 0; i < 3; i++) { s.array(shared.MatrixA[i]); s.array(shared.MatrixB[i]); s.array(shared.MatrixC[i]); } s.integer(shared.CentreX); s.integer(shared.CentreY); s.integer(shared.CentreZ); s.integer(shared.CentreZ_C); s.integer(shared.CentreZ_E); s.integer(shared.VOffset); s.integer(shared.Les); s.integer(shared.C_Les); s.integer(shared.E_Les); s.integer(shared.SinAas); s.integer(shared.CosAas); s.integer(shared.SinAzs); s.integer(shared.CosAzs); s.integer(shared.SinAZS); s.integer(shared.CosAZS); s.integer(shared.SecAZS_C1); s.integer(shared.SecAZS_E1); s.integer(shared.SecAZS_C2); s.integer(shared.SecAZS_E2); s.integer(shared.Nx); s.integer(shared.Ny); s.integer(shared.Nz); s.integer(shared.Gx); s.integer(shared.Gy); s.integer(shared.Gz); s.integer(shared.Hx); s.integer(shared.Hy); s.integer(shared.Vx); s.integer(shared.Vy); s.integer(shared.Vz); s.integer(mSr); s.integer(mSrLowByteAccess); s.integer(mDr); s.integer(mFsmMajorState); s.integer(mCommand); s.integer(mDataCounter); s.array(mReadBuffer); s.array(mWriteBuffer); s.integer(mFreeze); } #endif processor/r65816/opcode_read.cpp000664 001750 001750 00000014404 12651764221 017555 0ustar00sergiosergio000000 000000 template void R65816::op_read_const_b() { L rd.l = op_readpc(); call(op); } template void R65816::op_read_const_w() { rd.l = op_readpc(); L rd.h = op_readpc(); call(op); } void R65816::op_read_bit_const_b() { L rd.l = op_readpc(); regs.p.z = ((rd.l & regs.a.l) == 0); } void R65816::op_read_bit_const_w() { rd.l = op_readpc(); L rd.h = op_readpc(); regs.p.z = ((rd.w & regs.a.w) == 0); } template void R65816::op_read_addr_b() { aa.l = op_readpc(); aa.h = op_readpc(); L rd.l = op_readdbr(aa.w); call(op); } template void R65816::op_read_addr_w() { aa.l = op_readpc(); aa.h = op_readpc(); rd.l = op_readdbr(aa.w + 0); L rd.h = op_readdbr(aa.w + 1); call(op); } template void R65816::op_read_addrx_b() { aa.l = op_readpc(); aa.h = op_readpc(); op_io_cond4(aa.w, aa.w + regs.x.w); L rd.l = op_readdbr(aa.w + regs.x.w); call(op); } template void R65816::op_read_addrx_w() { aa.l = op_readpc(); aa.h = op_readpc(); op_io_cond4(aa.w, aa.w + regs.x.w); rd.l = op_readdbr(aa.w + regs.x.w + 0); L rd.h = op_readdbr(aa.w + regs.x.w + 1); call(op); } template void R65816::op_read_addry_b() { aa.l = op_readpc(); aa.h = op_readpc(); op_io_cond4(aa.w, aa.w + regs.y.w); L rd.l = op_readdbr(aa.w + regs.y.w); call(op); } template void R65816::op_read_addry_w() { aa.l = op_readpc(); aa.h = op_readpc(); op_io_cond4(aa.w, aa.w + regs.y.w); rd.l = op_readdbr(aa.w + regs.y.w + 0); L rd.h = op_readdbr(aa.w + regs.y.w + 1); call(op); } template void R65816::op_read_long_b() { aa.l = op_readpc(); aa.h = op_readpc(); aa.b = op_readpc(); L rd.l = op_readlong(aa.d); call(op); } template void R65816::op_read_long_w() { aa.l = op_readpc(); aa.h = op_readpc(); aa.b = op_readpc(); rd.l = op_readlong(aa.d + 0); L rd.h = op_readlong(aa.d + 1); call(op); } template void R65816::op_read_longx_b() { aa.l = op_readpc(); aa.h = op_readpc(); aa.b = op_readpc(); L rd.l = op_readlong(aa.d + regs.x.w); call(op); } template void R65816::op_read_longx_w() { aa.l = op_readpc(); aa.h = op_readpc(); aa.b = op_readpc(); rd.l = op_readlong(aa.d + regs.x.w + 0); L rd.h = op_readlong(aa.d + regs.x.w + 1); call(op); } template void R65816::op_read_dp_b() { dp = op_readpc(); op_io_cond2(); L rd.l = op_readdp(dp); call(op); } template void R65816::op_read_dp_w() { dp = op_readpc(); op_io_cond2(); rd.l = op_readdp(dp + 0); L rd.h = op_readdp(dp + 1); call(op); } template void R65816::op_read_dpr_b() { dp = op_readpc(); op_io_cond2(); op_io(); L rd.l = op_readdp(dp + regs.r[n].w); call(op); } template void R65816::op_read_dpr_w() { dp = op_readpc(); op_io_cond2(); op_io(); rd.l = op_readdp(dp + regs.r[n].w + 0); L rd.h = op_readdp(dp + regs.r[n].w + 1); call(op); } template void R65816::op_read_idp_b() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); L rd.l = op_readdbr(aa.w); call(op); } template void R65816::op_read_idp_w() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); rd.l = op_readdbr(aa.w + 0); L rd.h = op_readdbr(aa.w + 1); call(op); } template void R65816::op_read_idpx_b() { dp = op_readpc(); op_io_cond2(); op_io(); aa.l = op_readdp(dp + regs.x.w + 0); aa.h = op_readdp(dp + regs.x.w + 1); L rd.l = op_readdbr(aa.w); call(op); } template void R65816::op_read_idpx_w() { dp = op_readpc(); op_io_cond2(); op_io(); aa.l = op_readdp(dp + regs.x.w + 0); aa.h = op_readdp(dp + regs.x.w + 1); rd.l = op_readdbr(aa.w + 0); L rd.h = op_readdbr(aa.w + 1); call(op); } template void R65816::op_read_idpy_b() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); op_io_cond4(aa.w, aa.w + regs.y.w); L rd.l = op_readdbr(aa.w + regs.y.w); call(op); } template void R65816::op_read_idpy_w() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); op_io_cond4(aa.w, aa.w + regs.y.w); rd.l = op_readdbr(aa.w + regs.y.w + 0); L rd.h = op_readdbr(aa.w + regs.y.w + 1); call(op); } template void R65816::op_read_ildp_b() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); aa.b = op_readdp(dp + 2); L rd.l = op_readlong(aa.d); call(op); } template void R65816::op_read_ildp_w() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); aa.b = op_readdp(dp + 2); rd.l = op_readlong(aa.d + 0); L rd.h = op_readlong(aa.d + 1); call(op); } template void R65816::op_read_ildpy_b() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); aa.b = op_readdp(dp + 2); L rd.l = op_readlong(aa.d + regs.y.w); call(op); } template void R65816::op_read_ildpy_w() { dp = op_readpc(); op_io_cond2(); aa.l = op_readdp(dp + 0); aa.h = op_readdp(dp + 1); aa.b = op_readdp(dp + 2); rd.l = op_readlong(aa.d + regs.y.w + 0); L rd.h = op_readlong(aa.d + regs.y.w + 1); call(op); } template void R65816::op_read_sr_b() { sp = op_readpc(); op_io(); L rd.l = op_readsp(sp); call(op); } template void R65816::op_read_sr_w() { sp = op_readpc(); op_io(); rd.l = op_readsp(sp + 0); L rd.h = op_readsp(sp + 1); call(op); } template void R65816::op_read_isry_b() { sp = op_readpc(); op_io(); aa.l = op_readsp(sp + 0); aa.h = op_readsp(sp + 1); op_io(); L rd.l = op_readdbr(aa.w + regs.y.w); call(op); } template void R65816::op_read_isry_w() { sp = op_readpc(); op_io(); aa.l = op_readsp(sp + 0); aa.h = op_readsp(sp + 1); op_io(); rd.l = op_readdbr(aa.w + regs.y.w + 0); L rd.h = op_readdbr(aa.w + regs.y.w + 1); call(op); } sfc/memory/memory-inline.hpp000664 001750 001750 00000005473 12651764221 017301 0ustar00sergiosergio000000 000000 //Memory unsigned Memory::size() const { return 0; } //StaticRAM uint8* StaticRAM::data() { return data_; } unsigned StaticRAM::size() const { return size_; } uint8 StaticRAM::read(unsigned addr) { return data_[addr]; } void StaticRAM::write(unsigned addr, uint8 n) { data_[addr] = n; } uint8& StaticRAM::operator[](unsigned addr) { return data_[addr]; } const uint8& StaticRAM::operator[](unsigned addr) const { return data_[addr]; } StaticRAM::StaticRAM(unsigned n) : size_(n) { data_ = new uint8[size_]; } StaticRAM::~StaticRAM() { delete[] data_; } //MappedRAM void MappedRAM::reset() { if(data_) { delete[] data_; data_ = nullptr; } size_ = 0; write_protect_ = false; } void MappedRAM::map(uint8* source, unsigned length) { reset(); data_ = source; size_ = data_ ? length : 0; } void MappedRAM::copy(const stream& memory) { if(data_) delete[] data_; //round size up to multiple of 256-bytes size_ = (memory.size() & ~255) + ((bool)(memory.size() & 255) << 8); data_ = new uint8[size_](); memory.read(data_, memory.size()); } void MappedRAM::read(const stream& memory) { memory.read(data_, min(memory.size(), size_)); } void MappedRAM::write_protect(bool status) { write_protect_ = status; } uint8* MappedRAM::data() { return data_; } unsigned MappedRAM::size() const { return size_; } uint8 MappedRAM::read(unsigned addr) { return data_[addr]; } void MappedRAM::write(unsigned addr, uint8 n) { if(!write_protect_) data_[addr] = n; } const uint8& MappedRAM::operator[](unsigned addr) const { return data_[addr]; } MappedRAM::MappedRAM() : data_(nullptr), size_(0), write_protect_(false) {} //Bus unsigned Bus::mirror(unsigned addr, unsigned size) { unsigned base = 0; if(size) { unsigned mask = 1 << 23; while(addr >= size) { while(!(addr & mask)) mask >>= 1; addr -= mask; if(size > mask) { size -= mask; base += mask; } mask >>= 1; } base += addr; } return base; } unsigned Bus::reduce(unsigned addr, unsigned mask) { while (mask) { //extract the bits to keep //set everything below the lowest set bit; 0x018000 -> 0x007FFF unsigned tmp=((mask-1)&(~mask)); //shift everything above that addr=(addr&tmp)|((addr>>1)&~tmp); //adjust the mask mask=(mask&(mask-1))>>1; } return addr; } uint8 Bus::read(unsigned addr) { uint8 data; if (fast_read[addr>>fast_page_size_bits]) data = fast_read[addr>>fast_page_size_bits][addr]; else data = reader[lookup[addr]](target[addr]); #ifndef __LIBRETRO__ if(cheat.enable()) { if(auto result = cheat.find(addr, data)) return result(); } #endif return data; } void Bus::write(unsigned addr, uint8 data) { if (fast_write[addr>>fast_page_size_bits]) fast_write[addr>>fast_page_size_bits][addr] = data; else writer[lookup[addr]](target[addr], data); } nall/gzip.hpp000664 001750 001750 00000003254 12651764221 014324 0ustar00sergiosergio000000 000000 #ifndef NALL_GZIP_HPP #define NALL_GZIP_HPP #include #include namespace nall { struct gzip { string filename; uint8_t* data = nullptr; unsigned size = 0; inline bool decompress(const string& filename); inline bool decompress(const uint8_t* data, unsigned size); inline gzip(); inline ~gzip(); }; bool gzip::decompress(const string& filename) { if(auto memory = file::read(filename)) { return decompress(memory.data(), memory.size()); } return false; } bool gzip::decompress(const uint8_t* data, unsigned size) { if(size < 18) return false; if(data[0] != 0x1f) return false; if(data[1] != 0x8b) return false; unsigned cm = data[2]; unsigned flg = data[3]; unsigned mtime = data[4]; mtime |= data[5] << 8; mtime |= data[6] << 16; mtime |= data[7] << 24; unsigned xfl = data[8]; unsigned os = data[9]; unsigned p = 10; unsigned isize = data[size - 4]; isize |= data[size - 3] << 8; isize |= data[size - 2] << 16; isize |= data[size - 1] << 24; filename = ""; if(flg & 0x04) { //FEXTRA unsigned xlen = data[p + 0]; xlen |= data[p + 1] << 8; p += 2 + xlen; } if(flg & 0x08) { //FNAME char buffer[PATH_MAX]; for(unsigned n = 0; n < PATH_MAX; n++, p++) { buffer[n] = data[p]; if(data[p] == 0) break; } if(data[p++]) return false; filename = buffer; } if(flg & 0x10) { //FCOMMENT while(data[p++]); } if(flg & 0x02) { //FHCRC p += 2; } this->size = isize; this->data = new uint8_t[this->size]; return inflate(this->data, this->size, data + p, size - p - 8); } gzip::gzip() { } gzip::~gzip() { if(data) delete[] data; } } #endif nall/stream.hpp000664 001750 001750 00000001133 12651764221 014640 0ustar00sergiosergio000000 000000 #ifndef NALL_STREAM_HPP #define NALL_STREAM_HPP #include #include #include #include #include #include #include #include #include #define NALL_STREAM_INTERNAL_HPP #include #include #include #include #include #include #include #include #undef NALL_STREAM_INTERNAL_HPP #endif nall/function.hpp000664 001750 001750 00000004346 12651764221 015203 0ustar00sergiosergio000000 000000 #ifndef NALL_FUNCTION_HPP #define NALL_FUNCTION_HPP namespace nall { template class function; template class function { struct container { virtual R operator()(P... p) const = 0; virtual container* copy() const = 0; virtual ~container() {} }; container* callback = nullptr; struct global : container { R (*function)(P...); R operator()(P... p) const { return function(std::forward

(p)...); } container* copy() const { return new global(function); } global(R (*function)(P...)) : function(function) {} }; template struct member : container { R (C::*function)(P...); C* object; R operator()(P... p) const { return (object->*function)(std::forward

(p)...); } container* copy() const { return new member(function, object); } member(R (C::*function)(P...), C* object) : function(function), object(object) {} }; template struct lambda : container { mutable L object; R operator()(P... p) const { return object(std::forward

(p)...); } container* copy() const { return new lambda(object); } lambda(const L& object) : object(object) {} }; public: explicit operator bool() const { return callback; } R operator()(P... p) const { return (*callback)(std::forward

(p)...); } void reset() { if(callback) { delete callback; callback = nullptr; } } function& operator=(const function& source) { if(this != &source) { if(callback) { delete callback; callback = nullptr; } if(source.callback) callback = source.callback->copy(); } return *this; } function() = default; function(const function &source) { operator=(source); } function(void* function) { if(function) callback = new global((R (*)(P...))function); } function(R (*function)(P...)) { callback = new global(function); } template function(R (C::*function)(P...), C* object) { callback = new member(function, object); } template function(R (C::*function)(P...) const, C* object) { callback = new member((R (C::*)(P...))function, object); } template function(const L& object) { callback = new lambda(object); } ~function() { if(callback) delete callback; } }; } #endif sfc/chip/sa1/000700 001750 001750 00000000000 12656700342 014055 5ustar00sergiosergio000000 000000 obj/000700 001750 001750 00000000000 12656700342 012445 5ustar00sergiosergio000000 000000 nall/image/fill.hpp000664 001750 001750 00000005761 12651764221 015370 0ustar00sergiosergio000000 000000 #ifndef NALL_IMAGE_FILL_HPP #define NALL_IMAGE_FILL_HPP namespace nall { void image::fill(uint64_t color) { uint8_t* dp = data; for(unsigned y = 0; y < height; y++) { uint8_t* dp = data + pitch * y; for(unsigned x = 0; x < width; x++) { write(dp, color); dp += stride; } } } void image::gradient(uint64_t a, uint64_t b, uint64_t c, uint64_t d) { for(unsigned y = 0; y < height; y++) { uint8_t* dp = data + pitch * y; double muY = (double)y / (double)height; for(unsigned x = 0; x < width; x++) { double muX = (double)x / (double)width; write(dp, interpolate4f(a, b, c, d, muX, muY)); dp += stride; } } } void image::gradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY, function callback) { for(signed y = 0; y < height; y++) { uint8_t* dp = data + pitch * y; double py = max(-radiusY, min(+radiusY, y - centerY)) * 1.0 / radiusY; for(signed x = 0; x < width; x++) { double px = max(-radiusX, min(+radiusX, x - centerX)) * 1.0 / radiusX; double mu = max(0.0, min(1.0, callback(px, py))); if(mu != mu) mu = 1.0; //NaN write(dp, interpolate4f(a, b, mu)); dp += stride; } } } void image::crossGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY) { return gradient(a, b, radiusX, radiusY, centerX, centerY, [](double x, double y) -> double { x = fabs(x), y = fabs(y); return min(x, y) * min(x, y); }); } void image::diamondGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY) { return gradient(a, b, radiusX, radiusY, centerX, centerY, [](double x, double y) -> double { return fabs(x) + fabs(y); }); } void image::horizontalGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY) { return gradient(a, b, radiusX, radiusY, centerX, centerY, [](double x, double y) -> double { return fabs(x); }); } void image::radialGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY) { return gradient(a, b, radiusX, radiusY, centerX, centerY, [](double x, double y) -> double { return sqrt(x * x + y * y); }); } void image::sphericalGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY) { return gradient(a, b, radiusX, radiusY, centerX, centerY, [](double x, double y) -> double { return x * x + y * y; }); } void image::squareGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY) { return gradient(a, b, radiusX, radiusY, centerX, centerY, [](double x, double y) -> double { return max(fabs(x), fabs(y)); }); } void image::verticalGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY) { return gradient(a, b, radiusX, radiusY, centerX, centerY, [](double x, double y) -> double { return fabs(y); }); } } #endif gba/cpu/cpu.cpp000664 001750 001750 00000011023 12651764221 014520 0ustar00sergiosergio000000 000000 #include namespace GameBoyAdvance { #include "registers.cpp" #include "mmio.cpp" #include "memory.cpp" #include "dma.cpp" #include "timer.cpp" #include "serialization.cpp" CPU cpu; void CPU::Enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::CPU) { scheduler.sync = Scheduler::SynchronizeMode::All; scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } cpu.main(); } } void CPU::main() { #if defined(DEBUG) if(crash) { print(cpsr().t ? disassemble_thumb_instruction(pipeline.execute.address) : disassemble_arm_instruction(pipeline.execute.address), "\n"); print(disassemble_registers(), "\n"); print("Executed: ", instructions, "\n"); while(true) step(frequency); } #endif processor.irqline = regs.ime && (regs.irq.enable & regs.irq.flag); if(regs.mode == Registers::Mode::Stop) { if((regs.irq.enable.keypad & regs.irq.flag.keypad) == 0) { sync_step(16); //STOP does not advance timers } else { regs.mode = Registers::Mode::Normal; } return; } dma_run(); if(regs.mode == Registers::Mode::Halt) { if((regs.irq.enable & regs.irq.flag) == 0) { step(16); } else { regs.mode = Registers::Mode::Normal; } return; } exec(); } void CPU::step(unsigned clocks) { timer_step(clocks); sync_step(clocks); } void CPU::sync_step(unsigned clocks) { ppu.clock -= clocks; if(ppu.clock < 0) co_switch(ppu.thread); apu.clock -= clocks; if(apu.clock < 0) co_switch(apu.thread); } void CPU::bus_idle(uint32 addr) { step(1); return bus.idle(addr); } uint32 CPU::bus_read(uint32 addr, uint32 size) { step(bus.speed(addr, size)); return bus.read(addr, size); } void CPU::bus_write(uint32 addr, uint32 size, uint32 word) { step(bus.speed(addr, size)); return bus.write(addr, size, word); } void CPU::keypad_run() { if(regs.keypad.control.enable == false) return; bool test = regs.keypad.control.condition; //0 = OR, 1 = AND for(unsigned n = 0; n < 10; n++) { if(regs.keypad.control.flag[n] == false) continue; bool input = interface->inputPoll(0, 0, n); if(regs.keypad.control.condition == 0) test |= input; if(regs.keypad.control.condition == 1) test &= input; } if(test) regs.irq.flag.keypad = true; } void CPU::power() { create(CPU::Enter, 16777216); ARM::power(); for(unsigned n = 0; n < 32 * 1024; n++) iwram[n] = 0; for(unsigned n = 0; n < 256 * 1024; n++) ewram[n] = 0; for(auto& dma : regs.dma) { dma.source = 0; dma.target = 0; dma.length = 0; dma.control = 0; dma.pending = 0; dma.run.target = 0; dma.run.source = 0; dma.run.length = 0; } for(auto& timer : regs.timer) { timer.period = 0; timer.reload = 0; timer.control = 0; } regs.keypad.control = 0; regs.ime = 0; regs.irq.enable = 0; regs.irq.flag = 0; regs.wait.control = 0; regs.postboot = 0; regs.mode = Registers::Mode::Normal; regs.clock = 0; regs.memory.control = 0x0d000020; pending.dma.vblank = 0; pending.dma.hblank = 0; pending.dma.hdma = 0; for(unsigned n = 0x0b0; n <= 0x0df; n++) bus.mmio[n] = this; //DMA for(unsigned n = 0x100; n <= 0x10f; n++) bus.mmio[n] = this; //Timers for(unsigned n = 0x120; n <= 0x12b; n++) bus.mmio[n] = this; //Serial for(unsigned n = 0x130; n <= 0x133; n++) bus.mmio[n] = this; //Keypad for(unsigned n = 0x134; n <= 0x159; n++) bus.mmio[n] = this; //Serial for(unsigned n = 0x200; n <= 0x209; n++) bus.mmio[n] = this; //System for(unsigned n = 0x300; n <= 0x301; n++) bus.mmio[n] = this; //System //0x080-0x083 mirrored via gba/memory/memory.cpp //System } CPU::CPU() { iwram = new uint8[ 32 * 1024]; ewram = new uint8[256 * 1024]; regs.dma[0].source.bits(27); regs.dma[0].run.source.bits(27); regs.dma[0].target.bits(27); regs.dma[0].run.target.bits(27); regs.dma[0].length.bits(14); regs.dma[0].run.length.bits(14); regs.dma[1].source.bits(28); regs.dma[1].run.source.bits(28); regs.dma[1].target.bits(27); regs.dma[1].run.target.bits(27); regs.dma[1].length.bits(14); regs.dma[1].run.length.bits(14); regs.dma[2].source.bits(28); regs.dma[2].run.source.bits(28); regs.dma[2].target.bits(27); regs.dma[2].run.target.bits(27); regs.dma[2].length.bits(14); regs.dma[2].run.length.bits(14); regs.dma[3].source.bits(28); regs.dma[3].run.source.bits(28); regs.dma[3].target.bits(28); regs.dma[3].run.target.bits(28); regs.dma[3].length.bits(16); regs.dma[3].run.length.bits(16); } CPU::~CPU() { delete[] iwram; delete[] ewram; } } phoenix/cocoa/widget/vertical-slider.cpp000664 001750 001750 00000002453 12651764221 021532 0ustar00sergiosergio000000 000000 @implementation CocoaVerticalSlider : NSSlider -(id) initWith:(phoenix::VerticalSlider&)verticalSliderReference { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 1)]) { verticalSlider = &verticalSliderReference; [self setTarget:self]; [self setAction:@selector(activate:)]; [self setMinValue:0]; } return self; } -(IBAction) activate:(id)sender { verticalSlider->state.position = [self doubleValue]; if(verticalSlider->onChange) verticalSlider->onChange(); } @end namespace phoenix { Size pVerticalSlider::minimumSize() { return {20, 48}; } void pVerticalSlider::setGeometry(Geometry geometry) { pWidget::setGeometry({ geometry.x, geometry.y - 2, geometry.width, geometry.height + 4 }); } void pVerticalSlider::setLength(unsigned length) { @autoreleasepool { [cocoaView setMaxValue:length]; } } void pVerticalSlider::setPosition(unsigned position) { @autoreleasepool { [cocoaView setDoubleValue:position]; } } void pVerticalSlider::constructor() { @autoreleasepool { cocoaView = cocoaVerticalSlider = [[CocoaVerticalSlider alloc] initWith:verticalSlider]; setLength(verticalSlider.state.length); setPosition(verticalSlider.state.position); } } void pVerticalSlider::destructor() { @autoreleasepool { [cocoaView release]; } } } phoenix/gtk/000700 001750 001750 00000000000 12656700342 014132 5ustar00sergiosergio000000 000000 fc/cartridge/chip/mmc6.cpp000664 001750 001750 00000011545 12651764221 016543 0ustar00sergiosergio000000 000000 struct MMC6 : Chip { bool chr_mode; bool prg_mode; bool ram_enable; uint3 bank_select; uint8 prg_bank[2]; uint8 chr_bank[6]; bool mirror; bool ram_readable[2]; bool ram_writable[2]; uint8 irq_latch; uint8 irq_counter; bool irq_enable; unsigned irq_delay; bool irq_line; uint16 chr_abus; void main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(irq_delay) irq_delay--; cpu.set_irq_line(irq_line); tick(); } } void irq_test(unsigned addr) { if(!(chr_abus & 0x1000) && (addr & 0x1000)) { if(irq_delay == 0) { if(irq_counter == 0) { irq_counter = irq_latch; } else if(--irq_counter == 0) { if(irq_enable) irq_line = 1; } } irq_delay = 6; } chr_abus = addr; } unsigned prg_addr(unsigned addr) const { switch((addr >> 13) & 3) { case 0: if(prg_mode == 1) return (0x3e << 13) | (addr & 0x1fff); return (prg_bank[0] << 13) | (addr & 0x1fff); case 1: return (prg_bank[1] << 13) | (addr & 0x1fff); case 2: if(prg_mode == 0) return (0x3e << 13) | (addr & 0x1fff); return (prg_bank[0] << 13) | (addr & 0x1fff); case 3: return (0x3f << 13) | (addr & 0x1fff); } } unsigned chr_addr(unsigned addr) const { if(chr_mode == 0) { if(addr <= 0x07ff) return (chr_bank[0] << 10) | (addr & 0x07ff); if(addr <= 0x0fff) return (chr_bank[1] << 10) | (addr & 0x07ff); if(addr <= 0x13ff) return (chr_bank[2] << 10) | (addr & 0x03ff); if(addr <= 0x17ff) return (chr_bank[3] << 10) | (addr & 0x03ff); if(addr <= 0x1bff) return (chr_bank[4] << 10) | (addr & 0x03ff); if(addr <= 0x1fff) return (chr_bank[5] << 10) | (addr & 0x03ff); } else { if(addr <= 0x03ff) return (chr_bank[2] << 10) | (addr & 0x03ff); if(addr <= 0x07ff) return (chr_bank[3] << 10) | (addr & 0x03ff); if(addr <= 0x0bff) return (chr_bank[4] << 10) | (addr & 0x03ff); if(addr <= 0x0fff) return (chr_bank[5] << 10) | (addr & 0x03ff); if(addr <= 0x17ff) return (chr_bank[0] << 10) | (addr & 0x07ff); if(addr <= 0x1fff) return (chr_bank[1] << 10) | (addr & 0x07ff); } } unsigned ciram_addr(unsigned addr) const { if(mirror == 0) return ((addr & 0x0400) >> 0) | (addr & 0x03ff); if(mirror == 1) return ((addr & 0x0800) >> 1) | (addr & 0x03ff); } uint8 ram_read(unsigned addr) { if(ram_enable == false) return cpu.mdr(); if(ram_readable[0] == false && ram_readable[1] == false) return cpu.mdr(); bool region = addr & 0x0200; if(ram_readable[region] == false) return 0x00; return board.prgram.read((region * 0x0200) + (addr & 0x01ff)); } void ram_write(unsigned addr, uint8 data) { if(ram_enable == false) return; bool region = addr & 0x0200; if(ram_writable[region] == false) return; return board.prgram.write((region * 0x0200) + (addr & 0x01ff), data); } void reg_write(unsigned addr, uint8 data) { switch(addr & 0xe001) { case 0x8000: chr_mode = data & 0x80; prg_mode = data & 0x40; ram_enable = data & 0x20; bank_select = data & 0x07; if(ram_enable == false) { for(auto &n : ram_readable) n = false; for(auto &n : ram_writable) n = false; } break; case 0x8001: switch(bank_select) { case 0: chr_bank[0] = data & ~1; break; case 1: chr_bank[1] = data & ~1; break; case 2: chr_bank[2] = data; break; case 3: chr_bank[3] = data; break; case 4: chr_bank[4] = data; break; case 5: chr_bank[5] = data; break; case 6: prg_bank[0] = data & 0x3f; break; case 7: prg_bank[1] = data & 0x3f; break; } break; case 0xa000: mirror = data & 0x01; break; case 0xa001: if(ram_enable == false) break; ram_readable[1] = data & 0x80; ram_writable[1] = data & 0x40; ram_readable[0] = data & 0x20; ram_writable[0] = data & 0x10; break; case 0xc000: irq_latch = data; break; case 0xc001: irq_counter = 0; break; case 0xe000: irq_enable = false; irq_line = 0; break; case 0xe001: irq_enable = true; break; } } void power() { } void reset() { chr_mode = 0; prg_mode = 0; ram_enable = 0; bank_select = 0; for(auto& n : prg_bank) n = 0; for(auto& n : chr_bank) n = 0; mirror = 0; for(auto& n : ram_readable) n = 0; for(auto& n : ram_writable) n = 0; irq_latch = 0; irq_counter = 0; irq_enable = 0; irq_delay = 0; irq_line = 0; chr_abus = 0; } void serialize(serializer& s) { s.integer(chr_mode); s.integer(prg_mode); s.integer(ram_enable); s.integer(bank_select); for(auto& n : prg_bank) s.integer(n); for(auto& n : chr_bank) s.integer(n); s.integer(mirror); for(auto& n : ram_readable) s.integer(n); for(auto& n : ram_writable) s.integer(n); s.integer(irq_latch); s.integer(irq_counter); s.integer(irq_enable); s.integer(irq_delay); s.integer(irq_line); s.integer(chr_abus); } MMC6(Board& board) : Chip(board) { } }; phoenix/qt/widget/check-label.cpp000664 001750 001750 00000001672 12651764221 020135 0ustar00sergiosergio000000 000000 namespace phoenix { Size pCheckLabel::minimumSize() { Size size = pFont::size(qtWidget->font(), checkLabel.state.text); return {size.width + 26, size.height + 6}; } void pCheckLabel::setChecked(bool checked) { locked = true; qtCheckLabel->setChecked(checked); locked = false; } void pCheckLabel::setText(string text) { qtCheckLabel->setText(QString::fromUtf8(text)); } void pCheckLabel::constructor() { qtWidget = qtCheckLabel = new QCheckBox; connect(qtCheckLabel, SIGNAL(stateChanged(int)), SLOT(onToggle())); pWidget::synchronizeState(); setChecked(checkLabel.state.checked); setText(checkLabel.state.text); } void pCheckLabel::destructor() { delete qtCheckLabel; qtWidget = qtCheckLabel = nullptr; } void pCheckLabel::orphan() { destructor(); constructor(); } void pCheckLabel::onToggle() { checkLabel.state.checked = qtCheckLabel->isChecked(); if(!locked && checkLabel.onToggle) checkLabel.onToggle(); } } sfc/alt/smp/000700 001750 001750 00000000000 12656700342 014025 5ustar00sergiosergio000000 000000 sfc/chip/sa1/memory/000700 001750 001750 00000000000 12656700342 015365 5ustar00sergiosergio000000 000000 fc/memory/000700 001750 001750 00000000000 12656700342 013573 5ustar00sergiosergio000000 000000 nall/string/replace.hpp000664 001750 001750 00000003440 12651764221 016271 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { template string& string::ureplace(rstring key, rstring token) { if(key.size() == 0) return *this; enum : unsigned { limit = Limit ? Limit : ~0u }; const char* p = data(); unsigned counter = 0; while(*p) { if(quoteskip(p)) continue; for(unsigned n = 0;; n++) { if(key[n] == 0) { counter++; p += n; break; } if(!chrequal(key[n], p[n])) { p++; break; } } } if(counter == 0) return *this; if(Limit) counter = min(counter, Limit); char* t = data(); char* base = nullptr; signed displacement = token.size() - key.size(); signed displacementSize = displacement * counter; if(token.size() > key.size()) { t = base = strduplicate(data()); reserve((unsigned)(p - data()) + displacementSize); } char* o = data(); while(*t && counter) { if(quotecopy(o, t)) continue; for(unsigned n = 0;; n++) { if(key[n] == 0) { counter--; memcpy(o, token, token.size()); t += key.size(); o += token.size(); break; } if(!chrequal(key[n], t[n])) { *o++ = *t++; break; } } } do *o++ = *t; while(*t++); if(base) free(base); resize(_size + displacementSize); return *this; } template string& string::replace(rstring key, rstring token) { return ureplace(key, token); } template string& string::ireplace(rstring key, rstring token) { return ureplace(key, token); } template string& string::qreplace(rstring key, rstring token) { return ureplace(key, token); } template string& string::iqreplace(rstring key, rstring token) { return ureplace(key, token); } }; #endif sfc/cpu/timing/000700 001750 001750 00000000000 12656700342 014524 5ustar00sergiosergio000000 000000 fc/cpu/cpu.cpp000664 001750 001750 00000004224 12651764221 014364 0ustar00sergiosergio000000 000000 #include namespace Famicom { #include "timing.cpp" #include "serialization.cpp" CPU cpu; void CPU::Enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } cpu.main(); } } void CPU::main() { if(status.interrupt_pending) { interrupt(); return; } exec(); } void CPU::add_clocks(unsigned clocks) { apu.clock -= clocks; if(apu.clock < 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(apu.thread); ppu.clock -= clocks; if(ppu.clock < 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(ppu.thread); cartridge.clock -= clocks; if(cartridge.clock < 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cartridge.thread); } void CPU::power() { R6502::power(); for(unsigned addr = 0; addr < 0x0800; addr++) ram[addr] = 0xff; ram[0x0008] = 0xf7; ram[0x0009] = 0xef; ram[0x000a] = 0xdf; ram[0x000f] = 0xbf; } void CPU::reset() { R6502::reset(); create(CPU::Enter, 21477272); regs.pc = bus.read(0xfffc) << 0; regs.pc |= bus.read(0xfffd) << 8; status.interrupt_pending = false; status.nmi_pending = false; status.nmi_line = 0; status.irq_line = 0; status.irq_apu_line = 0; status.rdy_line = 1; status.rdy_addr_valid = false; status.rdy_addr_value = 0x0000; status.oam_dma_pending = false; status.oam_dma_page = 0x00; status.controller_latch = false; status.controller_port0 = 0; status.controller_port1 = 0; } uint8 CPU::debugger_read(uint16 addr) { return bus.read(addr); } uint8 CPU::ram_read(uint16 addr) { return ram[addr & 0x07ff]; } void CPU::ram_write(uint16 addr, uint8 data) { ram[addr & 0x07ff] = data; } uint8 CPU::read(uint16 addr) { if(addr == 0x4016) { return (mdr() & 0xc0) | input.data(0); } if(addr == 0x4017) { return (mdr() & 0xc0) | input.data(1); } return apu.read(addr); } void CPU::write(uint16 addr, uint8 data) { if(addr == 0x4014) { status.oam_dma_page = data; status.oam_dma_pending = true; } if(addr == 0x4016) { input.latch(data & 0x01); } return apu.write(addr, data); } } processor/arm/arm.cpp000664 001750 001750 00000003261 12651764221 015773 0ustar00sergiosergio000000 000000 #include #include "arm.hpp" namespace Processor { #include "registers.cpp" #include "algorithms.cpp" #include "instructions-arm.cpp" #include "instructions-thumb.cpp" #include "disassembler.cpp" #include "serialization.cpp" void ARM::power() { processor.power(); vector(0x00000000, Processor::Mode::SVC); pipeline.reload = true; crash = false; r(15).modify = [&] { pipeline.reload = true; }; trace = false; instructions = 0; } void ARM::exec() { cpsr().t ? thumb_step() : arm_step(); } void ARM::idle() { bus_idle(r(15)); } uint32 ARM::read(uint32 addr, uint32 size) { uint32 word = bus_read(addr, size); sequential() = true; return word; } uint32 ARM::load(uint32 addr, uint32 size) { sequential() = false; uint32 word = read(addr, size); if(size == Half) { word &= 0xffff; word |= word << 16; } if(size == Byte) { word &= 0xff; word |= word << 8; word |= word << 16; } word = ror(word, 8 * (addr & 3)); idle(); if(size == Half) word &= 0xffff; if(size == Byte) word &= 0xff; return word; } void ARM::write(uint32 addr, uint32 size, uint32 word) { bus_write(addr, size, word); sequential() = true; } void ARM::store(uint32 addr, uint32 size, uint32 word) { if(size == Half) { word &= 0xffff; word |= word << 16; } if(size == Byte) { word &= 0xff; word |= word << 8; word |= word << 16; } sequential() = false; write(addr, size, word); sequential() = false; } void ARM::vector(uint32 addr, Processor::Mode mode) { auto psr = cpsr(); processor.setMode(mode); spsr() = psr; cpsr().i = 1; cpsr().f |= mode == Processor::Mode::FIQ; cpsr().t = 0; r(14) = pipeline.decode.address; r(15) = addr; } } target-libretro/Makefile000664 001750 001750 00000005740 12651764221 016464 0ustar00sergiosergio000000 000000 processors := arm hg51b upd96050 gsu r65816 spc700 lr35902 include processor/Makefile include sfc/Makefile include gb/Makefile output := libretro ifeq ($(platform),linux) flags += -fPIC ifeq ($(arch),arm) flags += -marm endif else ifeq ($(platform),bsd) flags += -fPIC else ifeq ($(platform),macosx) flags += -fPIC else ifneq (,$(findstring ios,$(platform))) ifeq ($(IOSSDK),) IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path) endif flags += -arch armv7 -fPIC -isysroot $(IOSSDK) -marm -DHAVE_POSIX_MEMALIGN=1 -DIOS -w ifeq ($(platform),ios9) flags += -miphoneos-version-min=8.0 else flags += -miphoneos-version-min=5.0 endif endif flags += -D__LIBRETRO__ #rules objects := $(patsubst %,obj/%.o,$(objects)) sfc_objects += libretro sfc_objects := $(patsubst %,obj/%-$(profile).o,$(sfc_objects)) objects += $(sfc_objects) obj/libretro-$(profile).o: $(ui)/libretro.cpp $(ui)/* #targets build: $(objects) ifeq ($(platform),linux) $(compiler) -o out/bsnes_mercury_$(profile)_libretro.so -shared $(objects) -ldl -Wl,--no-undefined -Wl,--version-script=$(ui)/link.T $(link) else ifeq ($(platform),bsd) $(compiler) -o out/bsnes_mercury_$(profile)_libretro.so -shared $(objects) -ldl -Wl,--no-undefined -Wl,--version-script=$(ui)/link.T $(link) else ifneq (,$(findstring ios,$(platform))) $(compiler) -o out/bsnes_mercury_$(profile)_libretro_ios.dylib -dynamiclib $(objects) -isysroot $(IOSSDK) -arch armv7 $(link) else ifeq ($(platform),macosx) ifdef ($(NOUNIVERSAL)) $(compiler) -o out/bsnes_mercury_$(profile)_libretro.dylib -dynamiclib $(objects) $(link) else $(compiler) $(ARCHFLAGS) -o out/bsnes_mercury_$(profile)_libretro.dylib -dynamiclib $(objects) $(link) endif else ifeq ($(platform),windows) $(compiler) -o out/bsnes_mercury_$(profile)_libretro.dll -shared $(objects) -Wl,--no-undefined -Wl,--version-script=$(ui)/link.T -static-libgcc -static-libstdc++ -lws2_32 $(link) else $(error invalid platform: $(platform). valid platforms are: windows linux macosx ios bsd) endif install: ifeq ($(platform),linux) install -D -m 755 out/bsnes_mercury_$(profile)_libretro.so $(DESTDIR)$(prefix)/lib/bsnes_mercury_$(profile)_libretro.so else ifeq ($(platform),bsd) install -D -m 755 out/bsnes_mercury_$(profile)_libretro.so $(DESTDIR)$(prefix)/lib/bsnes_mercury_$(profile)_libretro.so else ifeq ($(platform),macosx) cp out/bsnes_mercury_$(profile)_libretro.dylib $(DESTDIR)$(prefix)/lib/bsnes_mercury_$(profile)_libretro.dylib else ifneq (,$(findstring ios,$(platform))) cp out/bsnes_mercury_$(profile)_libretro_ios.dylib $(DESTDIR)$(prefix)/lib/bsnes_mercury_$(profile)_libretro_ios.dylib endif uninstall: ifeq ($(platform),linux) rm $(DESTDIR)$(prefix)/lib/bsnes_mercury_$(profile)_libretro.so else ifeq ($(platform),bsd) rm $(DESTDIR)$(prefix)/lib/bsnes_mercury_$(profile)_libretro.so else ifeq ($(platform),macosx) rm /usr/local/lib/bsnes_mercury_$(profile)_libretro.dylib else ifneq (,$(findstring ios,$(platform))) rm /usr/local/lib/bsnes_mercury_$(profile)_libretro_ios.dylib endif nall/image/interpolation.hpp000664 001750 001750 00000004321 12651764221 017320 0ustar00sergiosergio000000 000000 #ifndef NALL_IMAGE_INTERPOLATION_HPP #define NALL_IMAGE_INTERPOLATION_HPP namespace nall { void image::isplit(uint64_t* c, uint64_t color) { c[0] = (color & alpha.mask) >> alpha.shift; c[1] = (color & red.mask ) >> red.shift; c[2] = (color & green.mask) >> green.shift; c[3] = (color & blue.mask ) >> blue.shift; } uint64_t image::imerge(const uint64_t* c) { return c[0] << alpha.shift | c[1] << red.shift | c[2] << green.shift | c[3] << blue.shift; } uint64_t image::interpolate1f(uint64_t a, uint64_t b, double x) { return a * (1.0 - x) + b * x; } uint64_t image::interpolate1f(uint64_t a, uint64_t b, uint64_t c, uint64_t d, double x, double y) { return a * (1.0 - x) * (1.0 - y) + b * x * (1.0 - y) + c * (1.0 - x) * y + d * x * y; } uint64_t image::interpolate1i(int64_t a, int64_t b, uint32_t x) { return a + (((b - a) * x) >> 32); //a + (b - a) * x } uint64_t image::interpolate1i(int64_t a, int64_t b, int64_t c, int64_t d, uint32_t x, uint32_t y) { a = a + (((b - a) * x) >> 32); //a + (b - a) * x c = c + (((d - c) * x) >> 32); //c + (d - c) * x return a + (((c - a) * y) >> 32); //a + (c - a) * y } uint64_t image::interpolate4f(uint64_t a, uint64_t b, double x) { uint64_t o[4], pa[4], pb[4]; isplit(pa, a), isplit(pb, b); for(unsigned n = 0; n < 4; n++) o[n] = interpolate1f(pa[n], pb[n], x); return imerge(o); } uint64_t image::interpolate4f(uint64_t a, uint64_t b, uint64_t c, uint64_t d, double x, double y) { uint64_t o[4], pa[4], pb[4], pc[4], pd[4]; isplit(pa, a), isplit(pb, b), isplit(pc, c), isplit(pd, d); for(unsigned n = 0; n < 4; n++) o[n] = interpolate1f(pa[n], pb[n], pc[n], pd[n], x, y); return imerge(o); } uint64_t image::interpolate4i(uint64_t a, uint64_t b, uint32_t x) { uint64_t o[4], pa[4], pb[4]; isplit(pa, a), isplit(pb, b); for(unsigned n = 0; n < 4; n++) o[n] = interpolate1i(pa[n], pb[n], x); return imerge(o); } uint64_t image::interpolate4i(uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint32_t x, uint32_t y) { uint64_t o[4], pa[4], pb[4], pc[4], pd[4]; isplit(pa, a), isplit(pb, b), isplit(pc, c), isplit(pd, d); for(unsigned n = 0; n < 4; n++) o[n] = interpolate1i(pa[n], pb[n], pc[n], pd[n], x, y); return imerge(o); } } #endif phoenix/cocoa/timer.cpp000664 001750 001750 00000002074 12651764221 016275 0ustar00sergiosergio000000 000000 @implementation CocoaTimer : NSObject -(id) initWith:(phoenix::Timer&)timerReference { if(self = [super init]) { timer = &timerReference; instance = nil; } return self; } -(NSTimer*) instance { return instance; } -(void) update { if(instance) { [instance invalidate]; instance = nil; } if(timer->state.enabled == false) return; instance = [NSTimer scheduledTimerWithTimeInterval:timer->state.interval / 1000.0 target:self selector:@selector(run:) userInfo:nil repeats:YES ]; } -(void) run:(NSTimer*)instance { if(timer->onActivate) timer->onActivate(); } @end namespace phoenix { void pTimer::setEnabled(bool enabled) { @autoreleasepool { [cocoaTimer update]; } } void pTimer::setInterval(unsigned interval) { @autoreleasepool { [cocoaTimer update]; } } void pTimer::constructor() { @autoreleasepool { cocoaTimer = [[CocoaTimer alloc] initWith:timer]; } } void pTimer::destructor() { @autoreleasepool { if([cocoaTimer instance]) [[cocoaTimer instance] invalidate]; [cocoaTimer release]; } } } sfc/chip/sa1/dma/000700 001750 001750 00000000000 12656700342 014616 5ustar00sergiosergio000000 000000 ananke/heuristics/sufami-turbo.hpp000664 001750 001750 00000001607 12651764221 020461 0ustar00sergiosergio000000 000000 #ifndef NALL_EMULATION_SUFAMI_TURBO_HPP #define NALL_EMULATION_SUFAMI_TURBO_HPP #include #include namespace nall { struct SufamiTurboCartridge { string markup; inline SufamiTurboCartridge(const uint8_t *data, unsigned size); }; SufamiTurboCartridge::SufamiTurboCartridge(const uint8_t *data, unsigned size) { markup = ""; if(size < 0x20000) return; //too small to be a valid game? if(memcmp(data, "BANDAI SFC-ADX", 14)) return; //missing required header? unsigned romsize = data[0x36] * 0x20000; //128KB unsigned ramsize = data[0x37] * 0x800; //2KB bool linkable = data[0x35] != 0x00; //TODO: unconfirmed markup.append("cartridge", linkable ? " linkable" : "", "\n"); markup.append(" rom name=program.rom size=0x", hex(romsize), "\n"); if(ramsize) markup.append(" ram name=save.ram size=0x", hex(ramsize), "\n"); } } #endif phoenix/reference/widget/check-button.cpp000664 001750 001750 00000000416 12651764221 021676 0ustar00sergiosergio000000 000000 namespace phoenix { void pCheckButton::setChecked(bool checked) { } void pCheckButton::setImage(const image& image, Orientation orientation) { } void pCheckButton::setText(string text) { } void pCheckButton::constructor() { } void pCheckButton::destructor() { } } sfc/chip/msu1/msu1.hpp000664 001750 001750 00000001472 12651764221 015675 0ustar00sergiosergio000000 000000 struct MSU1 : Coprocessor { static void Enter(); void enter(); void init(); void load(); void unload(); void power(); void reset(); void data_open(); void audio_open(); uint8 mmio_read(unsigned addr); void mmio_write(unsigned addr, uint8 data); void serialize(serializer&); private: bool boot; file datafile; file audiofile; enum Flag { DataBusy = 0x80, AudioBusy = 0x40, AudioRepeating = 0x20, AudioPlaying = 0x10, AudioError = 0x08, Revision = 0x01, }; struct MMIO { uint32 data_offset; uint32 audio_offset; uint32 audio_loop_offset; uint16 audio_track; uint8 audio_volume; bool data_busy; bool audio_busy; bool audio_repeat; bool audio_play; bool audio_error; } mmio; }; extern MSU1 msu1; gb/system/serialization.cpp000664 001750 001750 00000002370 12651764221 017207 0ustar00sergiosergio000000 000000 #ifdef SYSTEM_CPP serializer System::serialize() { serializer s(serialize_size); unsigned signature = 0x31545342, version = Info::SerializerVersion; char hash[64], description[512]; memcpy(&hash, (const char*)cartridge.sha256(), 64); memset(&description, 0, sizeof description); s.integer(signature); s.integer(version); s.array(hash); s.array(description); serialize_all(s); return s; } bool System::unserialize(serializer& s) { unsigned signature, version; char hash[64], description[512]; s.integer(signature); s.integer(version); s.array(hash); s.array(description); if(signature != 0x31545342) return false; if(version != Info::SerializerVersion) return false; power(); serialize_all(s); return true; } void System::serialize(serializer& s) { s.integer(clocks_executed); } void System::serialize_all(serializer& s) { cartridge.serialize(s); system.serialize(s); cpu.serialize(s); ppu.serialize(s); apu.serialize(s); } void System::serialize_init() { serializer s; unsigned signature = 0, version = 0, crc32 = 0; char hash[64], description[512]; s.integer(signature); s.integer(version); s.array(hash); s.array(description); serialize_all(s); serialize_size = s.size(); } #endif phoenix/cocoa/widget/viewport.hpp000664 001750 001750 00000001250 12651764221 020317 0ustar00sergiosergio000000 000000 @interface CocoaViewport : NSView { @public phoenix::Viewport* viewport; } -(id) initWith:(phoenix::Viewport&)viewport; -(void) drawRect:(NSRect)rect; -(BOOL) acceptsFirstResponder; -(NSDragOperation) draggingEntered:(id)sender; -(BOOL) performDragOperation:(id)sender; -(void) keyDown:(NSEvent*)event; -(void) keyUp:(NSEvent*)event; @end namespace phoenix { struct pViewport : public pWidget { Viewport& viewport; CocoaViewport* cocoaViewport = nullptr; uintptr_t handle(); void setDroppable(bool droppable); pViewport(Viewport& viewport) : pWidget(viewport), viewport(viewport) {} void constructor(); void destructor(); }; } gba/scheduler/000700 001750 001750 00000000000 12656700342 014402 5ustar00sergiosergio000000 000000 sfc/alt/ppu-balanced/mmio/mmio.cpp000664 001750 001750 00000044200 12651764221 020204 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP //INIDISP void PPU::mmio_w2100(uint8 value) { if(regs.display_disabled == true && cpu.vcounter() == (!overscan() ? 225 : 240)) { regs.oam_addr = regs.oam_baseaddr << 1; regs.oam_firstsprite = (regs.oam_priority == false) ? 0 : (regs.oam_addr >> 2) & 127; } regs.display_disabled = !!(value & 0x80); regs.display_brightness = value & 15; } //OBSEL void PPU::mmio_w2101(uint8 value) { regs.oam_basesize = (value >> 5) & 7; regs.oam_nameselect = (value >> 3) & 3; regs.oam_tdaddr = (value & 3) << 14; } //OAMADDL void PPU::mmio_w2102(uint8 data) { regs.oam_baseaddr = (regs.oam_baseaddr & ~0xff) | (data << 0); regs.oam_baseaddr &= 0x01ff; regs.oam_addr = regs.oam_baseaddr << 1; regs.oam_firstsprite = (regs.oam_priority == false) ? 0 : (regs.oam_addr >> 2) & 127; } //OAMADDH void PPU::mmio_w2103(uint8 data) { regs.oam_priority = !!(data & 0x80); regs.oam_baseaddr = (regs.oam_baseaddr & 0xff) | (data << 8); regs.oam_baseaddr &= 0x01ff; regs.oam_addr = regs.oam_baseaddr << 1; regs.oam_firstsprite = (regs.oam_priority == false) ? 0 : (regs.oam_addr >> 2) & 127; } //OAMDATA void PPU::mmio_w2104(uint8 data) { if((regs.oam_addr & 1) == 0) regs.oam_latchdata = data; if(regs.oam_addr & 0x0200) { oam_mmio_write(regs.oam_addr, data); } else if((regs.oam_addr & 1) == 1) { oam_mmio_write((regs.oam_addr & ~1) + 0, regs.oam_latchdata); oam_mmio_write((regs.oam_addr & ~1) + 1, data); } regs.oam_addr++; regs.oam_addr &= 0x03ff; regs.oam_firstsprite = (regs.oam_priority == false) ? 0 : (regs.oam_addr >> 2) & 127; } //BGMODE void PPU::mmio_w2105(uint8 value) { regs.bg_tilesize[BG4] = !!(value & 0x80); regs.bg_tilesize[BG3] = !!(value & 0x40); regs.bg_tilesize[BG2] = !!(value & 0x20); regs.bg_tilesize[BG1] = !!(value & 0x10); regs.bg3_priority = !!(value & 0x08); regs.bg_mode = (value & 7); } //MOSAIC void PPU::mmio_w2106(uint8 value) { regs.mosaic_size = (value >> 4) & 15; regs.mosaic_enabled[BG4] = !!(value & 0x08); regs.mosaic_enabled[BG3] = !!(value & 0x04); regs.mosaic_enabled[BG2] = !!(value & 0x02); regs.mosaic_enabled[BG1] = !!(value & 0x01); } //BG1SC void PPU::mmio_w2107(uint8 value) { regs.bg_scaddr[BG1] = (value & 0x7c) << 9; regs.bg_scsize[BG1] = value & 3; } //BG2SC void PPU::mmio_w2108(uint8 value) { regs.bg_scaddr[BG2] = (value & 0x7c) << 9; regs.bg_scsize[BG2] = value & 3; } //BG3SC void PPU::mmio_w2109(uint8 value) { regs.bg_scaddr[BG3] = (value & 0x7c) << 9; regs.bg_scsize[BG3] = value & 3; } //BG4SC void PPU::mmio_w210a(uint8 value) { regs.bg_scaddr[BG4] = (value & 0x7c) << 9; regs.bg_scsize[BG4] = value & 3; } //BG12NBA void PPU::mmio_w210b(uint8 value) { regs.bg_tdaddr[BG1] = (value & 0x07) << 13; regs.bg_tdaddr[BG2] = (value & 0x70) << 9; } //BG34NBA void PPU::mmio_w210c(uint8 value) { regs.bg_tdaddr[BG3] = (value & 0x07) << 13; regs.bg_tdaddr[BG4] = (value & 0x70) << 9; } //BG1HOFS void PPU::mmio_w210d(uint8 value) { regs.m7_hofs = (value << 8) | regs.m7_latch; regs.m7_latch = value; regs.bg_hofs[BG1] = (value << 8) | (regs.bg_ofslatch & ~7) | ((regs.bg_hofs[BG1] >> 8) & 7); regs.bg_ofslatch = value; } //BG1VOFS void PPU::mmio_w210e(uint8 value) { regs.m7_vofs = (value << 8) | regs.m7_latch; regs.m7_latch = value; regs.bg_vofs[BG1] = (value << 8) | (regs.bg_ofslatch); regs.bg_ofslatch = value; } //BG2HOFS void PPU::mmio_w210f(uint8 value) { regs.bg_hofs[BG2] = (value << 8) | (regs.bg_ofslatch & ~7) | ((regs.bg_hofs[BG2] >> 8) & 7); regs.bg_ofslatch = value; } //BG2VOFS void PPU::mmio_w2110(uint8 value) { regs.bg_vofs[BG2] = (value << 8) | (regs.bg_ofslatch); regs.bg_ofslatch = value; } //BG3HOFS void PPU::mmio_w2111(uint8 value) { regs.bg_hofs[BG3] = (value << 8) | (regs.bg_ofslatch & ~7) | ((regs.bg_hofs[BG3] >> 8) & 7); regs.bg_ofslatch = value; } //BG3VOFS void PPU::mmio_w2112(uint8 value) { regs.bg_vofs[BG3] = (value << 8) | (regs.bg_ofslatch); regs.bg_ofslatch = value; } //BG4HOFS void PPU::mmio_w2113(uint8 value) { regs.bg_hofs[BG4] = (value << 8) | (regs.bg_ofslatch & ~7) | ((regs.bg_hofs[BG4] >> 8) & 7); regs.bg_ofslatch = value; } //BG4VOFS void PPU::mmio_w2114(uint8 value) { regs.bg_vofs[BG4] = (value << 8) | (regs.bg_ofslatch); regs.bg_ofslatch = value; } //VMAIN void PPU::mmio_w2115(uint8 value) { regs.vram_incmode = !!(value & 0x80); regs.vram_mapping = (value >> 2) & 3; switch(value & 3) { case 0: regs.vram_incsize = 1; break; case 1: regs.vram_incsize = 32; break; case 2: regs.vram_incsize = 128; break; case 3: regs.vram_incsize = 128; break; } } //VMADDL void PPU::mmio_w2116(uint8 value) { regs.vram_addr = (regs.vram_addr & 0xff00) | value; uint16 addr = get_vram_address(); regs.vram_readbuffer = vram_mmio_read(addr + 0); regs.vram_readbuffer |= vram_mmio_read(addr + 1) << 8; } //VMADDH void PPU::mmio_w2117(uint8 value) { regs.vram_addr = (value << 8) | (regs.vram_addr & 0x00ff); uint16 addr = get_vram_address(); regs.vram_readbuffer = vram_mmio_read(addr + 0); regs.vram_readbuffer |= vram_mmio_read(addr + 1) << 8; } //VMDATAL void PPU::mmio_w2118(uint8 value) { uint16 addr = get_vram_address(); vram_mmio_write(addr, value); bg_tiledata_state[TILE_2BIT][(addr >> 4)] = 1; bg_tiledata_state[TILE_4BIT][(addr >> 5)] = 1; bg_tiledata_state[TILE_8BIT][(addr >> 6)] = 1; if(regs.vram_incmode == 0) { regs.vram_addr += regs.vram_incsize; } } //VMDATAH void PPU::mmio_w2119(uint8 value) { uint16 addr = get_vram_address() + 1; vram_mmio_write(addr, value); bg_tiledata_state[TILE_2BIT][(addr >> 4)] = 1; bg_tiledata_state[TILE_4BIT][(addr >> 5)] = 1; bg_tiledata_state[TILE_8BIT][(addr >> 6)] = 1; if(regs.vram_incmode == 1) { regs.vram_addr += regs.vram_incsize; } } //M7SEL void PPU::mmio_w211a(uint8 value) { regs.mode7_repeat = (value >> 6) & 3; regs.mode7_vflip = !!(value & 0x02); regs.mode7_hflip = !!(value & 0x01); } //M7A void PPU::mmio_w211b(uint8 value) { regs.m7a = (value << 8) | regs.m7_latch; regs.m7_latch = value; } //M7B void PPU::mmio_w211c(uint8 value) { regs.m7b = (value << 8) | regs.m7_latch; regs.m7_latch = value; } //M7C void PPU::mmio_w211d(uint8 value) { regs.m7c = (value << 8) | regs.m7_latch; regs.m7_latch = value; } //M7D void PPU::mmio_w211e(uint8 value) { regs.m7d = (value << 8) | regs.m7_latch; regs.m7_latch = value; } //M7X void PPU::mmio_w211f(uint8 value) { regs.m7x = (value << 8) | regs.m7_latch; regs.m7_latch = value; } //M7Y void PPU::mmio_w2120(uint8 value) { regs.m7y = (value << 8) | regs.m7_latch; regs.m7_latch = value; } //CGADD void PPU::mmio_w2121(uint8 value) { regs.cgram_addr = value << 1; } //CGDATA //note: CGRAM palette data format is 15-bits //(0,bbbbb,ggggg,rrrrr). Highest bit is ignored, //as evidenced by $213b CGRAM data reads. // //anomie indicates writes to CGDATA work the same //as writes to OAMDATA's low table. need to verify //this on hardware. void PPU::mmio_w2122(uint8 value) { if(!(regs.cgram_addr & 1)) { regs.cgram_latchdata = value; } else { cgram_mmio_write((regs.cgram_addr & 0x01fe), regs.cgram_latchdata); cgram_mmio_write((regs.cgram_addr & 0x01fe) + 1, value & 0x7f); } regs.cgram_addr++; regs.cgram_addr &= 0x01ff; } //W12SEL void PPU::mmio_w2123(uint8 value) { regs.window2_enabled[BG2] = !!(value & 0x80); regs.window2_invert [BG2] = !!(value & 0x40); regs.window1_enabled[BG2] = !!(value & 0x20); regs.window1_invert [BG2] = !!(value & 0x10); regs.window2_enabled[BG1] = !!(value & 0x08); regs.window2_invert [BG1] = !!(value & 0x04); regs.window1_enabled[BG1] = !!(value & 0x02); regs.window1_invert [BG1] = !!(value & 0x01); } //W34SEL void PPU::mmio_w2124(uint8 value) { regs.window2_enabled[BG4] = !!(value & 0x80); regs.window2_invert [BG4] = !!(value & 0x40); regs.window1_enabled[BG4] = !!(value & 0x20); regs.window1_invert [BG4] = !!(value & 0x10); regs.window2_enabled[BG3] = !!(value & 0x08); regs.window2_invert [BG3] = !!(value & 0x04); regs.window1_enabled[BG3] = !!(value & 0x02); regs.window1_invert [BG3] = !!(value & 0x01); } //WOBJSEL void PPU::mmio_w2125(uint8 value) { regs.window2_enabled[COL] = !!(value & 0x80); regs.window2_invert [COL] = !!(value & 0x40); regs.window1_enabled[COL] = !!(value & 0x20); regs.window1_invert [COL] = !!(value & 0x10); regs.window2_enabled[OAM] = !!(value & 0x08); regs.window2_invert [OAM] = !!(value & 0x04); regs.window1_enabled[OAM] = !!(value & 0x02); regs.window1_invert [OAM] = !!(value & 0x01); } //WH0 void PPU::mmio_w2126(uint8 value) { regs.window1_left = value; } //WH1 void PPU::mmio_w2127(uint8 value) { regs.window1_right = value; } //WH2 void PPU::mmio_w2128(uint8 value) { regs.window2_left = value; } //WH3 void PPU::mmio_w2129(uint8 value) { regs.window2_right = value; } //WBGLOG void PPU::mmio_w212a(uint8 value) { regs.window_mask[BG4] = (value >> 6) & 3; regs.window_mask[BG3] = (value >> 4) & 3; regs.window_mask[BG2] = (value >> 2) & 3; regs.window_mask[BG1] = (value ) & 3; } //WOBJLOG void PPU::mmio_w212b(uint8 value) { regs.window_mask[COL] = (value >> 2) & 3; regs.window_mask[OAM] = (value ) & 3; } //TM void PPU::mmio_w212c(uint8 value) { regs.bg_enabled[OAM] = !!(value & 0x10); regs.bg_enabled[BG4] = !!(value & 0x08); regs.bg_enabled[BG3] = !!(value & 0x04); regs.bg_enabled[BG2] = !!(value & 0x02); regs.bg_enabled[BG1] = !!(value & 0x01); } //TS void PPU::mmio_w212d(uint8 value) { regs.bgsub_enabled[OAM] = !!(value & 0x10); regs.bgsub_enabled[BG4] = !!(value & 0x08); regs.bgsub_enabled[BG3] = !!(value & 0x04); regs.bgsub_enabled[BG2] = !!(value & 0x02); regs.bgsub_enabled[BG1] = !!(value & 0x01); } //TMW void PPU::mmio_w212e(uint8 value) { regs.window_enabled[OAM] = !!(value & 0x10); regs.window_enabled[BG4] = !!(value & 0x08); regs.window_enabled[BG3] = !!(value & 0x04); regs.window_enabled[BG2] = !!(value & 0x02); regs.window_enabled[BG1] = !!(value & 0x01); } //TSW void PPU::mmio_w212f(uint8 value) { regs.sub_window_enabled[OAM] = !!(value & 0x10); regs.sub_window_enabled[BG4] = !!(value & 0x08); regs.sub_window_enabled[BG3] = !!(value & 0x04); regs.sub_window_enabled[BG2] = !!(value & 0x02); regs.sub_window_enabled[BG1] = !!(value & 0x01); } //CGWSEL void PPU::mmio_w2130(uint8 value) { regs.color_mask = (value >> 6) & 3; regs.colorsub_mask = (value >> 4) & 3; regs.addsub_mode = !!(value & 0x02); regs.direct_color = !!(value & 0x01); } //CGADDSUB void PPU::mmio_w2131(uint8 value) { regs.color_mode = !!(value & 0x80); regs.color_halve = !!(value & 0x40); regs.color_enabled[BACK] = !!(value & 0x20); regs.color_enabled[OAM] = !!(value & 0x10); regs.color_enabled[BG4] = !!(value & 0x08); regs.color_enabled[BG3] = !!(value & 0x04); regs.color_enabled[BG2] = !!(value & 0x02); regs.color_enabled[BG1] = !!(value & 0x01); } //COLDATA void PPU::mmio_w2132(uint8 value) { if(value & 0x80) regs.color_b = value & 0x1f; if(value & 0x40) regs.color_g = value & 0x1f; if(value & 0x20) regs.color_r = value & 0x1f; regs.color_rgb = (regs.color_r) | (regs.color_g << 5) | (regs.color_b << 10); } //SETINI void PPU::mmio_w2133(uint8 value) { regs.mode7_extbg = !!(value & 0x40); regs.pseudo_hires = !!(value & 0x08); regs.overscan = !!(value & 0x04); regs.oam_interlace = !!(value & 0x02); regs.interlace = !!(value & 0x01); display.overscan = regs.overscan; sprite_list_valid = false; } //MPYL uint8 PPU::mmio_r2134() { uint32 r; r = ((int16)regs.m7a * (int8)(regs.m7b >> 8)); regs.ppu1_mdr = r; return regs.ppu1_mdr; } //MPYM uint8 PPU::mmio_r2135() { uint32 r; r = ((int16)regs.m7a * (int8)(regs.m7b >> 8)); regs.ppu1_mdr = r >> 8; return regs.ppu1_mdr; } //MPYH uint8 PPU::mmio_r2136() { uint32 r; r = ((int16)regs.m7a * (int8)(regs.m7b >> 8)); regs.ppu1_mdr = r >> 16; return regs.ppu1_mdr; } //SLHV uint8 PPU::mmio_r2137() { if(cpu.pio() & 0x80) { latch_counters(); } return cpu.regs.mdr; } //OAMDATAREAD uint8 PPU::mmio_r2138() { regs.ppu1_mdr = oam_mmio_read(regs.oam_addr); regs.oam_addr++; regs.oam_addr &= 0x03ff; regs.oam_firstsprite = (regs.oam_priority == false) ? 0 : (regs.oam_addr >> 2) & 127; return regs.ppu1_mdr; } //VMDATALREAD uint8 PPU::mmio_r2139() { uint16 addr = get_vram_address(); regs.ppu1_mdr = regs.vram_readbuffer; if(regs.vram_incmode == 0) { addr &= 0xfffe; regs.vram_readbuffer = vram_mmio_read(addr + 0); regs.vram_readbuffer |= vram_mmio_read(addr + 1) << 8; regs.vram_addr += regs.vram_incsize; } return regs.ppu1_mdr; } //VMDATAHREAD uint8 PPU::mmio_r213a() { uint16 addr = get_vram_address() + 1; regs.ppu1_mdr = regs.vram_readbuffer >> 8; if(regs.vram_incmode == 1) { addr &= 0xfffe; regs.vram_readbuffer = vram_mmio_read(addr + 0); regs.vram_readbuffer |= vram_mmio_read(addr + 1) << 8; regs.vram_addr += regs.vram_incsize; } return regs.ppu1_mdr; } //CGDATAREAD //note: CGRAM palette data is 15-bits (0,bbbbb,ggggg,rrrrr) //therefore, the high byte read from each color does not //update bit 7 of the PPU2 MDR. uint8 PPU::mmio_r213b() { if(!(regs.cgram_addr & 1)) { regs.ppu2_mdr = cgram_mmio_read(regs.cgram_addr) & 0xff; } else { regs.ppu2_mdr &= 0x80; regs.ppu2_mdr |= cgram_mmio_read(regs.cgram_addr) & 0x7f; } regs.cgram_addr++; regs.cgram_addr &= 0x01ff; return regs.ppu2_mdr; } //OPHCT uint8 PPU::mmio_r213c() { if(!regs.latch_hcounter) { regs.ppu2_mdr = regs.hcounter & 0xff; } else { regs.ppu2_mdr &= 0xfe; regs.ppu2_mdr |= (regs.hcounter >> 8) & 1; } regs.latch_hcounter ^= 1; return regs.ppu2_mdr; } //OPVCT uint8 PPU::mmio_r213d() { if(!regs.latch_vcounter) { regs.ppu2_mdr = regs.vcounter & 0xff; } else { regs.ppu2_mdr &= 0xfe; regs.ppu2_mdr |= (regs.vcounter >> 8) & 1; } regs.latch_vcounter ^= 1; return regs.ppu2_mdr; } //STAT77 uint8 PPU::mmio_r213e() { uint8 r = 0x00; r |= (regs.time_over) ? 0x80 : 0x00; r |= (regs.range_over) ? 0x40 : 0x00; r |= (regs.ppu1_mdr & 0x10); r |= (ppu1_version & 0x0f); regs.ppu1_mdr = r; return regs.ppu1_mdr; } //STAT78 uint8 PPU::mmio_r213f() { uint8 r = 0x00; regs.latch_hcounter = 0; regs.latch_vcounter = 0; r |= cpu.field() << 7; if(!(cpu.pio() & 0x80)) { r |= 0x40; } else if(regs.counters_latched == true) { r |= 0x40; regs.counters_latched = false; } r |= (regs.ppu2_mdr & 0x20); r |= (region << 4); //0 = NTSC, 1 = PAL r |= (ppu2_version & 0x0f); regs.ppu2_mdr = r; return regs.ppu2_mdr; } uint8 PPU::mmio_read(unsigned addr) { cpu.synchronize_ppu(); switch(addr & 0xffff) { case 0x2104: case 0x2105: case 0x2106: case 0x2108: case 0x2109: case 0x210a: case 0x2114: case 0x2115: case 0x2116: case 0x2118: case 0x2119: case 0x211a: case 0x2124: case 0x2125: case 0x2126: case 0x2128: case 0x2129: case 0x212a: return regs.ppu1_mdr; case 0x2134: return mmio_r2134(); //MPYL case 0x2135: return mmio_r2135(); //MPYM case 0x2136: return mmio_r2136(); //MPYH case 0x2137: return mmio_r2137(); //SLHV case 0x2138: return mmio_r2138(); //OAMDATAREAD case 0x2139: return mmio_r2139(); //VMDATALREAD case 0x213a: return mmio_r213a(); //VMDATAHREAD case 0x213b: return mmio_r213b(); //CGDATAREAD case 0x213c: return mmio_r213c(); //OPHCT case 0x213d: return mmio_r213d(); //OPVCT case 0x213e: return mmio_r213e(); //STAT77 case 0x213f: return mmio_r213f(); //STAT78 } return cpu.regs.mdr; } void PPU::mmio_write(unsigned addr, uint8 data) { cpu.synchronize_ppu(); switch(addr & 0xffff) { case 0x2100: return mmio_w2100(data); //INIDISP case 0x2101: return mmio_w2101(data); //OBSEL case 0x2102: return mmio_w2102(data); //OAMADDL case 0x2103: return mmio_w2103(data); //OAMADDH case 0x2104: return mmio_w2104(data); //OAMDATA case 0x2105: return mmio_w2105(data); //BGMODE case 0x2106: return mmio_w2106(data); //MOSAIC case 0x2107: return mmio_w2107(data); //BG1SC case 0x2108: return mmio_w2108(data); //BG2SC case 0x2109: return mmio_w2109(data); //BG3SC case 0x210a: return mmio_w210a(data); //BG4SC case 0x210b: return mmio_w210b(data); //BG12NBA case 0x210c: return mmio_w210c(data); //BG34NBA case 0x210d: return mmio_w210d(data); //BG1HOFS case 0x210e: return mmio_w210e(data); //BG1VOFS case 0x210f: return mmio_w210f(data); //BG2HOFS case 0x2110: return mmio_w2110(data); //BG2VOFS case 0x2111: return mmio_w2111(data); //BG3HOFS case 0x2112: return mmio_w2112(data); //BG3VOFS case 0x2113: return mmio_w2113(data); //BG4HOFS case 0x2114: return mmio_w2114(data); //BG4VOFS case 0x2115: return mmio_w2115(data); //VMAIN case 0x2116: return mmio_w2116(data); //VMADDL case 0x2117: return mmio_w2117(data); //VMADDH case 0x2118: return mmio_w2118(data); //VMDATAL case 0x2119: return mmio_w2119(data); //VMDATAH case 0x211a: return mmio_w211a(data); //M7SEL case 0x211b: return mmio_w211b(data); //M7A case 0x211c: return mmio_w211c(data); //M7B case 0x211d: return mmio_w211d(data); //M7C case 0x211e: return mmio_w211e(data); //M7D case 0x211f: return mmio_w211f(data); //M7X case 0x2120: return mmio_w2120(data); //M7Y case 0x2121: return mmio_w2121(data); //CGADD case 0x2122: return mmio_w2122(data); //CGDATA case 0x2123: return mmio_w2123(data); //W12SEL case 0x2124: return mmio_w2124(data); //W34SEL case 0x2125: return mmio_w2125(data); //WOBJSEL case 0x2126: return mmio_w2126(data); //WH0 case 0x2127: return mmio_w2127(data); //WH1 case 0x2128: return mmio_w2128(data); //WH2 case 0x2129: return mmio_w2129(data); //WH3 case 0x212a: return mmio_w212a(data); //WBGLOG case 0x212b: return mmio_w212b(data); //WOBJLOG case 0x212c: return mmio_w212c(data); //TM case 0x212d: return mmio_w212d(data); //TS case 0x212e: return mmio_w212e(data); //TMW case 0x212f: return mmio_w212f(data); //TSW case 0x2130: return mmio_w2130(data); //CGWSEL case 0x2131: return mmio_w2131(data); //CGADDSUB case 0x2132: return mmio_w2132(data); //COLDATA case 0x2133: return mmio_w2133(data); //SETINI } } #endif sfc/alt/smp/core/op_rmw.cpp000664 001750 001750 00000007323 12651764221 017006 0ustar00sergiosergio000000 000000 case 0xbc: { op_io(); regs.a = op_inc(regs.a); break; } case 0x3d: { op_io(); regs.x = op_inc(regs.x); break; } case 0xfc: { op_io(); regs.y = op_inc(regs.y); break; } case 0x9c: { op_io(); regs.a = op_dec(regs.a); break; } case 0x1d: { op_io(); regs.x = op_dec(regs.x); break; } case 0xdc: { op_io(); regs.y = op_dec(regs.y); break; } case 0x1c: { op_io(); regs.a = op_asl(regs.a); break; } case 0x5c: { op_io(); regs.a = op_lsr(regs.a); break; } case 0x3c: { op_io(); regs.a = op_rol(regs.a); break; } case 0x7c: { op_io(); regs.a = op_ror(regs.a); break; } case 0xab: { dp = op_readpc(); rd = op_readdp(dp); rd = op_inc(rd); op_writedp(dp, rd); break; } case 0x8b: { dp = op_readpc(); rd = op_readdp(dp); rd = op_dec(rd); op_writedp(dp, rd); break; } case 0x0b: { dp = op_readpc(); rd = op_readdp(dp); rd = op_asl(rd); op_writedp(dp, rd); break; } case 0x4b: { dp = op_readpc(); rd = op_readdp(dp); rd = op_lsr(rd); op_writedp(dp, rd); break; } case 0x2b: { dp = op_readpc(); rd = op_readdp(dp); rd = op_rol(rd); op_writedp(dp, rd); break; } case 0x6b: { dp = op_readpc(); rd = op_readdp(dp); rd = op_ror(rd); op_writedp(dp, rd); break; } case 0xbb: { dp = op_readpc(); op_io(); rd = op_readdp(dp + regs.x); rd = op_inc(rd); op_writedp(dp + regs.x, rd); break; } case 0x9b: { dp = op_readpc(); op_io(); rd = op_readdp(dp + regs.x); rd = op_dec(rd); op_writedp(dp + regs.x, rd); break; } case 0x1b: { dp = op_readpc(); op_io(); rd = op_readdp(dp + regs.x); rd = op_asl(rd); op_writedp(dp + regs.x, rd); break; } case 0x5b: { dp = op_readpc(); op_io(); rd = op_readdp(dp + regs.x); rd = op_lsr(rd); op_writedp(dp + regs.x, rd); break; } case 0x3b: { dp = op_readpc(); op_io(); rd = op_readdp(dp + regs.x); rd = op_rol(rd); op_writedp(dp + regs.x, rd); break; } case 0x7b: { dp = op_readpc(); op_io(); rd = op_readdp(dp + regs.x); rd = op_ror(rd); op_writedp(dp + regs.x, rd); break; } case 0xac: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); rd = op_inc(rd); op_writeaddr(dp, rd); break; } case 0x8c: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); rd = op_dec(rd); op_writeaddr(dp, rd); break; } case 0x0c: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); rd = op_asl(rd); op_writeaddr(dp, rd); break; } case 0x4c: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); rd = op_lsr(rd); op_writeaddr(dp, rd); break; } case 0x2c: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); rd = op_rol(rd); op_writeaddr(dp, rd); break; } case 0x6c: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); rd = op_ror(rd); op_writeaddr(dp, rd); break; } case 0x0e: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); regs.p.n = !!((regs.a - rd) & 0x80); regs.p.z = ((regs.a - rd) == 0); op_readaddr(dp); op_writeaddr(dp, rd | regs.a); break; } case 0x4e: { dp = op_readpc(); dp |= op_readpc() << 8; rd = op_readaddr(dp); regs.p.n = !!((regs.a - rd) & 0x80); regs.p.z = ((regs.a - rd) == 0); op_readaddr(dp); op_writeaddr(dp, rd &~ regs.a); break; } case 0x3a: { dp = op_readpc(); rd = op_readdp(dp); rd++; op_writedp(dp++, rd); rd += op_readdp(dp) << 8; op_writedp(dp, rd >> 8); regs.p.n = !!(rd & 0x8000); regs.p.z = (rd == 0); break; } case 0x1a: { dp = op_readpc(); rd = op_readdp(dp); rd--; op_writedp(dp++, rd); rd += op_readdp(dp) << 8; op_writedp(dp, rd >> 8); regs.p.n = !!(rd & 0x8000); regs.p.z = (rd == 0); break; } target-libretro/libretro.h000664 001750 001750 00000257402 12651764221 017023 0ustar00sergiosergio000000 000000 /* Copyright (C) 2010-2014 The RetroArch team * * --------------------------------------------------------------------------------------- * The following license statement only applies to this libretro API header (libretro.h). * --------------------------------------------------------------------------------------- * * Permission is hereby granted, free of charge, * to any person obtaining a copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef LIBRETRO_H__ #define LIBRETRO_H__ #include #include #include #ifdef __cplusplus extern "C" { #endif #ifndef __cplusplus #if defined(_MSC_VER) && !defined(SN_TARGET_PS3) /* Hack applied for MSVC when compiling in C89 mode * as it isn't C99-compliant. */ #define bool unsigned char #define true 1 #define false 0 #else #include #endif #endif /* Used for checking API/ABI mismatches that can break libretro * implementations. * It is not incremented for compatible changes to the API. */ #define RETRO_API_VERSION 1 /* * Libretro's fundamental device abstractions. * * Libretro's input system consists of some standardized device types, * such as a joypad (with/without analog), mouse, keyboard, lightgun * and a pointer. * * The functionality of these devices are fixed, and individual cores * map their own concept of a controller to libretro's abstractions. * This makes it possible for frontends to map the abstract types to a * real input device, and not having to worry about binding input * correctly to arbitrary controller layouts. */ #define RETRO_DEVICE_TYPE_SHIFT 8 #define RETRO_DEVICE_MASK ((1 << RETRO_DEVICE_TYPE_SHIFT) - 1) #define RETRO_DEVICE_SUBCLASS(base, id) (((id + 1) << RETRO_DEVICE_TYPE_SHIFT) | base) /* Input disabled. */ #define RETRO_DEVICE_NONE 0 /* The JOYPAD is called RetroPad. It is essentially a Super Nintendo * controller, but with additional L2/R2/L3/R3 buttons, similar to a * PS1 DualShock. */ #define RETRO_DEVICE_JOYPAD 1 /* The mouse is a simple mouse, similar to Super Nintendo's mouse. * X and Y coordinates are reported relatively to last poll (poll callback). * It is up to the libretro implementation to keep track of where the mouse * pointer is supposed to be on the screen. * The frontend must make sure not to interfere with its own hardware * mouse pointer. */ #define RETRO_DEVICE_MOUSE 2 /* KEYBOARD device lets one poll for raw key pressed. * It is poll based, so input callback will return with the current * pressed state. * For event/text based keyboard input, see * RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK. */ #define RETRO_DEVICE_KEYBOARD 3 /* Lightgun X/Y coordinates are reported relatively to last poll, * similar to mouse. */ #define RETRO_DEVICE_LIGHTGUN 4 /* The ANALOG device is an extension to JOYPAD (RetroPad). * Similar to DualShock it adds two analog sticks. * This is treated as a separate device type as it returns values in the * full analog range of [-0x8000, 0x7fff]. Positive X axis is right. * Positive Y axis is down. * Only use ANALOG type when polling for analog values of the axes. */ #define RETRO_DEVICE_ANALOG 5 /* Abstracts the concept of a pointing mechanism, e.g. touch. * This allows libretro to query in absolute coordinates where on the * screen a mouse (or something similar) is being placed. * For a touch centric device, coordinates reported are the coordinates * of the press. * * Coordinates in X and Y are reported as: * [-0x7fff, 0x7fff]: -0x7fff corresponds to the far left/top of the screen, * and 0x7fff corresponds to the far right/bottom of the screen. * The "screen" is here defined as area that is passed to the frontend and * later displayed on the monitor. * * The frontend is free to scale/resize this screen as it sees fit, however, * (X, Y) = (-0x7fff, -0x7fff) will correspond to the top-left pixel of the * game image, etc. * * To check if the pointer coordinates are valid (e.g. a touch display * actually being touched), PRESSED returns 1 or 0. * * If using a mouse on a desktop, PRESSED will usually correspond to the * left mouse button, but this is a frontend decision. * PRESSED will only return 1 if the pointer is inside the game screen. * * For multi-touch, the index variable can be used to successively query * more presses. * If index = 0 returns true for _PRESSED, coordinates can be extracted * with _X, _Y for index = 0. One can then query _PRESSED, _X, _Y with * index = 1, and so on. * Eventually _PRESSED will return false for an index. No further presses * are registered at this point. */ #define RETRO_DEVICE_POINTER 6 /* Buttons for the RetroPad (JOYPAD). * The placement of these is equivalent to placements on the * Super Nintendo controller. * L2/R2/L3/R3 buttons correspond to the PS1 DualShock. */ #define RETRO_DEVICE_ID_JOYPAD_B 0 #define RETRO_DEVICE_ID_JOYPAD_Y 1 #define RETRO_DEVICE_ID_JOYPAD_SELECT 2 #define RETRO_DEVICE_ID_JOYPAD_START 3 #define RETRO_DEVICE_ID_JOYPAD_UP 4 #define RETRO_DEVICE_ID_JOYPAD_DOWN 5 #define RETRO_DEVICE_ID_JOYPAD_LEFT 6 #define RETRO_DEVICE_ID_JOYPAD_RIGHT 7 #define RETRO_DEVICE_ID_JOYPAD_A 8 #define RETRO_DEVICE_ID_JOYPAD_X 9 #define RETRO_DEVICE_ID_JOYPAD_L 10 #define RETRO_DEVICE_ID_JOYPAD_R 11 #define RETRO_DEVICE_ID_JOYPAD_L2 12 #define RETRO_DEVICE_ID_JOYPAD_R2 13 #define RETRO_DEVICE_ID_JOYPAD_L3 14 #define RETRO_DEVICE_ID_JOYPAD_R3 15 /* Index / Id values for ANALOG device. */ #define RETRO_DEVICE_INDEX_ANALOG_LEFT 0 #define RETRO_DEVICE_INDEX_ANALOG_RIGHT 1 #define RETRO_DEVICE_ID_ANALOG_X 0 #define RETRO_DEVICE_ID_ANALOG_Y 1 /* Id values for MOUSE. */ #define RETRO_DEVICE_ID_MOUSE_X 0 #define RETRO_DEVICE_ID_MOUSE_Y 1 #define RETRO_DEVICE_ID_MOUSE_LEFT 2 #define RETRO_DEVICE_ID_MOUSE_RIGHT 3 #define RETRO_DEVICE_ID_MOUSE_WHEELUP 4 #define RETRO_DEVICE_ID_MOUSE_WHEELDOWN 5 #define RETRO_DEVICE_ID_MOUSE_MIDDLE 6 /* Id values for LIGHTGUN types. */ #define RETRO_DEVICE_ID_LIGHTGUN_X 0 #define RETRO_DEVICE_ID_LIGHTGUN_Y 1 #define RETRO_DEVICE_ID_LIGHTGUN_TRIGGER 2 #define RETRO_DEVICE_ID_LIGHTGUN_CURSOR 3 #define RETRO_DEVICE_ID_LIGHTGUN_TURBO 4 #define RETRO_DEVICE_ID_LIGHTGUN_PAUSE 5 #define RETRO_DEVICE_ID_LIGHTGUN_START 6 /* Id values for POINTER. */ #define RETRO_DEVICE_ID_POINTER_X 0 #define RETRO_DEVICE_ID_POINTER_Y 1 #define RETRO_DEVICE_ID_POINTER_PRESSED 2 /* Returned from retro_get_region(). */ #define RETRO_REGION_NTSC 0 #define RETRO_REGION_PAL 1 /* Id values for LANGUAGE */ enum retro_language { RETRO_LANGUAGE_ENGLISH = 0, RETRO_LANGUAGE_JAPANESE = 1, RETRO_LANGUAGE_FRENCH = 2, RETRO_LANGUAGE_SPANISH = 3, RETRO_LANGUAGE_GERMAN = 4, RETRO_LANGUAGE_ITALIAN = 5, RETRO_LANGUAGE_DUTCH = 6, RETRO_LANGUAGE_PORTUGUESE = 7, RETRO_LANGUAGE_RUSSIAN = 8, RETRO_LANGUAGE_KOREAN = 9, RETRO_LANGUAGE_CHINESE_TRADITIONAL = 10, RETRO_LANGUAGE_CHINESE_SIMPLIFIED = 11, RETRO_LANGUAGE_LAST, /* Ensure sizeof(enum) == sizeof(int) */ RETRO_LANGUAGE_DUMMY = INT_MAX }; /* Passed to retro_get_memory_data/size(). * If the memory type doesn't apply to the * implementation NULL/0 can be returned. */ #define RETRO_MEMORY_MASK 0xff /* Regular save RAM. This RAM is usually found on a game cartridge, * backed up by a battery. * If save game data is too complex for a single memory buffer, * the SAVE_DIRECTORY (preferably) or SYSTEM_DIRECTORY environment * callback can be used. */ #define RETRO_MEMORY_SAVE_RAM 0 /* Some games have a built-in clock to keep track of time. * This memory is usually just a couple of bytes to keep track of time. */ #define RETRO_MEMORY_RTC 1 /* System ram lets a frontend peek into a game systems main RAM. */ #define RETRO_MEMORY_SYSTEM_RAM 2 /* Video ram lets a frontend peek into a game systems video RAM (VRAM). */ #define RETRO_MEMORY_VIDEO_RAM 3 /* Keysyms used for ID in input state callback when polling RETRO_KEYBOARD. */ enum retro_key { RETROK_UNKNOWN = 0, RETROK_FIRST = 0, RETROK_BACKSPACE = 8, RETROK_TAB = 9, RETROK_CLEAR = 12, RETROK_RETURN = 13, RETROK_PAUSE = 19, RETROK_ESCAPE = 27, RETROK_SPACE = 32, RETROK_EXCLAIM = 33, RETROK_QUOTEDBL = 34, RETROK_HASH = 35, RETROK_DOLLAR = 36, RETROK_AMPERSAND = 38, RETROK_QUOTE = 39, RETROK_LEFTPAREN = 40, RETROK_RIGHTPAREN = 41, RETROK_ASTERISK = 42, RETROK_PLUS = 43, RETROK_COMMA = 44, RETROK_MINUS = 45, RETROK_PERIOD = 46, RETROK_SLASH = 47, RETROK_0 = 48, RETROK_1 = 49, RETROK_2 = 50, RETROK_3 = 51, RETROK_4 = 52, RETROK_5 = 53, RETROK_6 = 54, RETROK_7 = 55, RETROK_8 = 56, RETROK_9 = 57, RETROK_COLON = 58, RETROK_SEMICOLON = 59, RETROK_LESS = 60, RETROK_EQUALS = 61, RETROK_GREATER = 62, RETROK_QUESTION = 63, RETROK_AT = 64, RETROK_LEFTBRACKET = 91, RETROK_BACKSLASH = 92, RETROK_RIGHTBRACKET = 93, RETROK_CARET = 94, RETROK_UNDERSCORE = 95, RETROK_BACKQUOTE = 96, RETROK_a = 97, RETROK_b = 98, RETROK_c = 99, RETROK_d = 100, RETROK_e = 101, RETROK_f = 102, RETROK_g = 103, RETROK_h = 104, RETROK_i = 105, RETROK_j = 106, RETROK_k = 107, RETROK_l = 108, RETROK_m = 109, RETROK_n = 110, RETROK_o = 111, RETROK_p = 112, RETROK_q = 113, RETROK_r = 114, RETROK_s = 115, RETROK_t = 116, RETROK_u = 117, RETROK_v = 118, RETROK_w = 119, RETROK_x = 120, RETROK_y = 121, RETROK_z = 122, RETROK_DELETE = 127, RETROK_KP0 = 256, RETROK_KP1 = 257, RETROK_KP2 = 258, RETROK_KP3 = 259, RETROK_KP4 = 260, RETROK_KP5 = 261, RETROK_KP6 = 262, RETROK_KP7 = 263, RETROK_KP8 = 264, RETROK_KP9 = 265, RETROK_KP_PERIOD = 266, RETROK_KP_DIVIDE = 267, RETROK_KP_MULTIPLY = 268, RETROK_KP_MINUS = 269, RETROK_KP_PLUS = 270, RETROK_KP_ENTER = 271, RETROK_KP_EQUALS = 272, RETROK_UP = 273, RETROK_DOWN = 274, RETROK_RIGHT = 275, RETROK_LEFT = 276, RETROK_INSERT = 277, RETROK_HOME = 278, RETROK_END = 279, RETROK_PAGEUP = 280, RETROK_PAGEDOWN = 281, RETROK_F1 = 282, RETROK_F2 = 283, RETROK_F3 = 284, RETROK_F4 = 285, RETROK_F5 = 286, RETROK_F6 = 287, RETROK_F7 = 288, RETROK_F8 = 289, RETROK_F9 = 290, RETROK_F10 = 291, RETROK_F11 = 292, RETROK_F12 = 293, RETROK_F13 = 294, RETROK_F14 = 295, RETROK_F15 = 296, RETROK_NUMLOCK = 300, RETROK_CAPSLOCK = 301, RETROK_SCROLLOCK = 302, RETROK_RSHIFT = 303, RETROK_LSHIFT = 304, RETROK_RCTRL = 305, RETROK_LCTRL = 306, RETROK_RALT = 307, RETROK_LALT = 308, RETROK_RMETA = 309, RETROK_LMETA = 310, RETROK_LSUPER = 311, RETROK_RSUPER = 312, RETROK_MODE = 313, RETROK_COMPOSE = 314, RETROK_HELP = 315, RETROK_PRINT = 316, RETROK_SYSREQ = 317, RETROK_BREAK = 318, RETROK_MENU = 319, RETROK_POWER = 320, RETROK_EURO = 321, RETROK_UNDO = 322, RETROK_LAST, RETROK_DUMMY = INT_MAX /* Ensure sizeof(enum) == sizeof(int) */ }; enum retro_mod { RETROKMOD_NONE = 0x0000, RETROKMOD_SHIFT = 0x01, RETROKMOD_CTRL = 0x02, RETROKMOD_ALT = 0x04, RETROKMOD_META = 0x08, RETROKMOD_NUMLOCK = 0x10, RETROKMOD_CAPSLOCK = 0x20, RETROKMOD_SCROLLOCK = 0x40, RETROKMOD_DUMMY = INT_MAX /* Ensure sizeof(enum) == sizeof(int) */ }; /* If set, this call is not part of the public libretro API yet. It can * change or be removed at any time. */ #define RETRO_ENVIRONMENT_EXPERIMENTAL 0x10000 /* Environment callback to be used internally in frontend. */ #define RETRO_ENVIRONMENT_PRIVATE 0x20000 /* Environment commands. */ #define RETRO_ENVIRONMENT_SET_ROTATION 1 /* const unsigned * -- * Sets screen rotation of graphics. * Is only implemented if rotation can be accelerated by hardware. * Valid values are 0, 1, 2, 3, which rotates screen by 0, 90, 180, * 270 degrees counter-clockwise respectively. */ #define RETRO_ENVIRONMENT_GET_OVERSCAN 2 /* bool * -- * Boolean value whether or not the implementation should use overscan, * or crop away overscan. */ #define RETRO_ENVIRONMENT_GET_CAN_DUPE 3 /* bool * -- * Boolean value whether or not frontend supports frame duping, * passing NULL to video frame callback. */ /* Environ 4, 5 are no longer supported (GET_VARIABLE / SET_VARIABLES), * and reserved to avoid possible ABI clash. */ #define RETRO_ENVIRONMENT_SET_MESSAGE 6 /* const struct retro_message * -- * Sets a message to be displayed in implementation-specific manner * for a certain amount of 'frames'. * Should not be used for trivial messages, which should simply be * logged via RETRO_ENVIRONMENT_GET_LOG_INTERFACE (or as a * fallback, stderr). */ #define RETRO_ENVIRONMENT_SHUTDOWN 7 /* N/A (NULL) -- * Requests the frontend to shutdown. * Should only be used if game has a specific * way to shutdown the game from a menu item or similar. */ #define RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL 8 /* const unsigned * -- * Gives a hint to the frontend how demanding this implementation * is on a system. E.g. reporting a level of 2 means * this implementation should run decently on all frontends * of level 2 and up. * * It can be used by the frontend to potentially warn * about too demanding implementations. * * The levels are "floating". * * This function can be called on a per-game basis, * as certain games an implementation can play might be * particularly demanding. * If called, it should be called in retro_load_game(). */ #define RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY 9 /* const char ** -- * Returns the "system" directory of the frontend. * This directory can be used to store system specific * content such as BIOSes, configuration data, etc. * The returned value can be NULL. * If so, no such directory is defined, * and it's up to the implementation to find a suitable directory. * * NOTE: Some cores used this folder also for "save" data such as * memory cards, etc, for lack of a better place to put it. * This is now discouraged, and if possible, cores should try to * use the new GET_SAVE_DIRECTORY. */ #define RETRO_ENVIRONMENT_SET_PIXEL_FORMAT 10 /* const enum retro_pixel_format * -- * Sets the internal pixel format used by the implementation. * The default pixel format is RETRO_PIXEL_FORMAT_0RGB1555. * This pixel format however, is deprecated (see enum retro_pixel_format). * If the call returns false, the frontend does not support this pixel * format. * * This function should be called inside retro_load_game() or * retro_get_system_av_info(). */ #define RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS 11 /* const struct retro_input_descriptor * -- * Sets an array of retro_input_descriptors. * It is up to the frontend to present this in a usable way. * The array is terminated by retro_input_descriptor::description * being set to NULL. * This function can be called at any time, but it is recommended * to call it as early as possible. */ #define RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK 12 /* const struct retro_keyboard_callback * -- * Sets a callback function used to notify core about keyboard events. */ #define RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE 13 /* const struct retro_disk_control_callback * -- * Sets an interface which frontend can use to eject and insert * disk images. * This is used for games which consist of multiple images and * must be manually swapped out by the user (e.g. PSX). */ #define RETRO_ENVIRONMENT_SET_HW_RENDER 14 /* struct retro_hw_render_callback * -- * Sets an interface to let a libretro core render with * hardware acceleration. * Should be called in retro_load_game(). * If successful, libretro cores will be able to render to a * frontend-provided framebuffer. * The size of this framebuffer will be at least as large as * max_width/max_height provided in get_av_info(). * If HW rendering is used, pass only RETRO_HW_FRAME_BUFFER_VALID or * NULL to retro_video_refresh_t. */ #define RETRO_ENVIRONMENT_GET_VARIABLE 15 /* struct retro_variable * -- * Interface to acquire user-defined information from environment * that cannot feasibly be supported in a multi-system way. * 'key' should be set to a key which has already been set by * SET_VARIABLES. * 'data' will be set to a value or NULL. */ #define RETRO_ENVIRONMENT_SET_VARIABLES 16 /* const struct retro_variable * -- * Allows an implementation to signal the environment * which variables it might want to check for later using * GET_VARIABLE. * This allows the frontend to present these variables to * a user dynamically. * This should be called as early as possible (ideally in * retro_set_environment). * * 'data' points to an array of retro_variable structs * terminated by a { NULL, NULL } element. * retro_variable::key should be namespaced to not collide * with other implementations' keys. E.g. A core called * 'foo' should use keys named as 'foo_option'. * retro_variable::value should contain a human readable * description of the key as well as a '|' delimited list * of expected values. * * The number of possible options should be very limited, * i.e. it should be feasible to cycle through options * without a keyboard. * * First entry should be treated as a default. * * Example entry: * { "foo_option", "Speed hack coprocessor X; false|true" } * * Text before first ';' is description. This ';' must be * followed by a space, and followed by a list of possible * values split up with '|'. * * Only strings are operated on. The possible values will * generally be displayed and stored as-is by the frontend. */ #define RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE 17 /* bool * -- * Result is set to true if some variables are updated by * frontend since last call to RETRO_ENVIRONMENT_GET_VARIABLE. * Variables should be queried with GET_VARIABLE. */ #define RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME 18 /* const bool * -- * If true, the libretro implementation supports calls to * retro_load_game() with NULL as argument. * Used by cores which can run without particular game data. * This should be called within retro_set_environment() only. */ #define RETRO_ENVIRONMENT_GET_LIBRETRO_PATH 19 /* const char ** -- * Retrieves the absolute path from where this libretro * implementation was loaded. * NULL is returned if the libretro was loaded statically * (i.e. linked statically to frontend), or if the path cannot be * determined. * Mostly useful in cooperation with SET_SUPPORT_NO_GAME as assets can * be loaded without ugly hacks. */ /* Environment 20 was an obsolete version of SET_AUDIO_CALLBACK. * It was not used by any known core at the time, * and was removed from the API. */ #define RETRO_ENVIRONMENT_SET_AUDIO_CALLBACK 22 /* const struct retro_audio_callback * -- * Sets an interface which is used to notify a libretro core about audio * being available for writing. * The callback can be called from any thread, so a core using this must * have a thread safe audio implementation. * It is intended for games where audio and video are completely * asynchronous and audio can be generated on the fly. * This interface is not recommended for use with emulators which have * highly synchronous audio. * * The callback only notifies about writability; the libretro core still * has to call the normal audio callbacks * to write audio. The audio callbacks must be called from within the * notification callback. * The amount of audio data to write is up to the implementation. * Generally, the audio callback will be called continously in a loop. * * Due to thread safety guarantees and lack of sync between audio and * video, a frontend can selectively disallow this interface based on * internal configuration. A core using this interface must also * implement the "normal" audio interface. * * A libretro core using SET_AUDIO_CALLBACK should also make use of * SET_FRAME_TIME_CALLBACK. */ #define RETRO_ENVIRONMENT_SET_FRAME_TIME_CALLBACK 21 /* const struct retro_frame_time_callback * -- * Lets the core know how much time has passed since last * invocation of retro_run(). * The frontend can tamper with the timing to fake fast-forward, * slow-motion, frame stepping, etc. * In this case the delta time will use the reference value * in frame_time_callback.. */ #define RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE 23 /* struct retro_rumble_interface * -- * Gets an interface which is used by a libretro core to set * state of rumble motors in controllers. * A strong and weak motor is supported, and they can be * controlled indepedently. */ #define RETRO_ENVIRONMENT_GET_INPUT_DEVICE_CAPABILITIES 24 /* uint64_t * -- * Gets a bitmask telling which device type are expected to be * handled properly in a call to retro_input_state_t. * Devices which are not handled or recognized always return * 0 in retro_input_state_t. * Example bitmask: caps = (1 << RETRO_DEVICE_JOYPAD) | (1 << RETRO_DEVICE_ANALOG). * Should only be called in retro_run(). */ #define RETRO_ENVIRONMENT_GET_SENSOR_INTERFACE (25 | RETRO_ENVIRONMENT_EXPERIMENTAL) /* struct retro_sensor_interface * -- * Gets access to the sensor interface. * The purpose of this interface is to allow * setting state related to sensors such as polling rate, * enabling/disable it entirely, etc. * Reading sensor state is done via the normal * input_state_callback API. */ #define RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE (26 | RETRO_ENVIRONMENT_EXPERIMENTAL) /* struct retro_camera_callback * -- * Gets an interface to a video camera driver. * A libretro core can use this interface to get access to a * video camera. * New video frames are delivered in a callback in same * thread as retro_run(). * * GET_CAMERA_INTERFACE should be called in retro_load_game(). * * Depending on the camera implementation used, camera frames * will be delivered as a raw framebuffer, * or as an OpenGL texture directly. * * The core has to tell the frontend here which types of * buffers can be handled properly. * An OpenGL texture can only be handled when using a * libretro GL core (SET_HW_RENDER). * It is recommended to use a libretro GL core when * using camera interface. * * The camera is not started automatically. The retrieved start/stop * functions must be used to explicitly * start and stop the camera driver. */ #define RETRO_ENVIRONMENT_GET_LOG_INTERFACE 27 /* struct retro_log_callback * -- * Gets an interface for logging. This is useful for * logging in a cross-platform way * as certain platforms cannot use use stderr for logging. * It also allows the frontend to * show logging information in a more suitable way. * If this interface is not used, libretro cores should * log to stderr as desired. */ #define RETRO_ENVIRONMENT_GET_PERF_INTERFACE 28 /* struct retro_perf_callback * -- * Gets an interface for performance counters. This is useful * for performance logging in a cross-platform way and for detecting * architecture-specific features, such as SIMD support. */ #define RETRO_ENVIRONMENT_GET_LOCATION_INTERFACE 29 /* struct retro_location_callback * -- * Gets access to the location interface. * The purpose of this interface is to be able to retrieve * location-based information from the host device, * such as current latitude / longitude. */ #define RETRO_ENVIRONMENT_GET_CONTENT_DIRECTORY 30 /* const char ** -- * Returns the "content" directory of the frontend. * This directory can be used to store specific assets that the * core relies upon, such as art assets, * input data, etc etc. * The returned value can be NULL. * If so, no such directory is defined, * and it's up to the implementation to find a suitable directory. */ #define RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY 31 /* const char ** -- * Returns the "save" directory of the frontend. * This directory can be used to store SRAM, memory cards, * high scores, etc, if the libretro core * cannot use the regular memory interface (retro_get_memory_data()). * * NOTE: libretro cores used to check GET_SYSTEM_DIRECTORY for * similar things before. * They should still check GET_SYSTEM_DIRECTORY if they want to * be backwards compatible. * The path here can be NULL. It should only be non-NULL if the * frontend user has set a specific save path. */ #define RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO 32 /* const struct retro_system_av_info * -- * Sets a new av_info structure. This can only be called from * within retro_run(). * This should *only* be used if the core is completely altering the * internal resolutions, aspect ratios, timings, sampling rate, etc. * Calling this can require a full reinitialization of video/audio * drivers in the frontend, * * so it is important to call it very sparingly, and usually only with * the users explicit consent. * An eventual driver reinitialize will happen so that video and * audio callbacks * happening after this call within the same retro_run() call will * target the newly initialized driver. * * This callback makes it possible to support configurable resolutions * in games, which can be useful to * avoid setting the "worst case" in max_width/max_height. * * ***HIGHLY RECOMMENDED*** Do not call this callback every time * resolution changes in an emulator core if it's * expected to be a temporary change, for the reasons of possible * driver reinitialization. * This call is not a free pass for not trying to provide * correct values in retro_get_system_av_info(). If you need to change * things like aspect ratio or nominal width/height, * use RETRO_ENVIRONMENT_SET_GEOMETRY, which is a softer variant * of SET_SYSTEM_AV_INFO. * * If this returns false, the frontend does not acknowledge a * changed av_info struct. */ #define RETRO_ENVIRONMENT_SET_PROC_ADDRESS_CALLBACK 33 /* const struct retro_get_proc_address_interface * -- * Allows a libretro core to announce support for the * get_proc_address() interface. * This interface allows for a standard way to extend libretro where * use of environment calls are too indirect, * e.g. for cases where the frontend wants to call directly into the core. * * If a core wants to expose this interface, SET_PROC_ADDRESS_CALLBACK * **MUST** be called from within retro_set_environment(). */ #define RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO 34 /* const struct retro_subsystem_info * -- * This environment call introduces the concept of libretro "subsystems". * A subsystem is a variant of a libretro core which supports * different kinds of games. * The purpose of this is to support e.g. emulators which might * have special needs, e.g. Super Nintendo's Super GameBoy, Sufami Turbo. * It can also be used to pick among subsystems in an explicit way * if the libretro implementation is a multi-system emulator itself. * * Loading a game via a subsystem is done with retro_load_game_special(), * and this environment call allows a libretro core to expose which * subsystems are supported for use with retro_load_game_special(). * A core passes an array of retro_game_special_info which is terminated * with a zeroed out retro_game_special_info struct. * * If a core wants to use this functionality, SET_SUBSYSTEM_INFO * **MUST** be called from within retro_set_environment(). */ #define RETRO_ENVIRONMENT_SET_CONTROLLER_INFO 35 /* const struct retro_controller_info * -- * This environment call lets a libretro core tell the frontend * which controller types are recognized in calls to * retro_set_controller_port_device(). * * Some emulators such as Super Nintendo * support multiple lightgun types which must be specifically * selected from. * It is therefore sometimes necessary for a frontend to be able * to tell the core about a special kind of input device which is * not covered by the libretro input API. * * In order for a frontend to understand the workings of an input device, * it must be a specialized type * of the generic device types already defined in the libretro API. * * Which devices are supported can vary per input port. * The core must pass an array of const struct retro_controller_info which * is terminated with a blanked out struct. Each element of the struct * corresponds to an ascending port index to * retro_set_controller_port_device(). * Even if special device types are set in the libretro core, * libretro should only poll input based on the base input device types. */ #define RETRO_ENVIRONMENT_SET_MEMORY_MAPS (36 | RETRO_ENVIRONMENT_EXPERIMENTAL) /* const struct retro_memory_map * -- * This environment call lets a libretro core tell the frontend * about the memory maps this core emulates. * This can be used to implement, for example, cheats in a core-agnostic way. * * Should only be used by emulators; it doesn't make much sense for * anything else. * It is recommended to expose all relevant pointers through * retro_get_memory_* as well. * * Can be called from retro_init and retro_load_game. */ #define RETRO_ENVIRONMENT_SET_GEOMETRY 37 /* const struct retro_game_geometry * -- * This environment call is similar to SET_SYSTEM_AV_INFO for changing * video parameters, but provides a guarantee that drivers will not be * reinitialized. * This can only be called from within retro_run(). * * The purpose of this call is to allow a core to alter nominal * width/heights as well as aspect ratios on-the-fly, which can be * useful for some emulators to change in run-time. * * max_width/max_height arguments are ignored and cannot be changed * with this call as this could potentially require a reinitialization or a * non-constant time operation. * If max_width/max_height are to be changed, SET_SYSTEM_AV_INFO is required. * * A frontend must guarantee that this environment call completes in * constant time. */ #define RETRO_ENVIRONMENT_GET_USERNAME 38 /* const char ** * Returns the specified username of the frontend, if specified by the user. * This username can be used as a nickname for a core that has online facilities * or any other mode where personalization of the user is desirable. * The returned value can be NULL. * If this environ callback is used by a core that requires a valid username, * a default username should be specified by the core. */ #define RETRO_ENVIRONMENT_GET_LANGUAGE 39 /* unsigned * -- * Returns the specified language of the frontend, if specified by the user. * It can be used by the core for localization purposes. */ #define RETRO_MEMDESC_CONST (1 << 0) /* The frontend will never change this memory area once retro_load_game has returned. */ #define RETRO_MEMDESC_BIGENDIAN (1 << 1) /* The memory area contains big endian data. Default is little endian. */ #define RETRO_MEMDESC_ALIGN_2 (1 << 16) /* All memory access in this area is aligned to their own size, or 2, whichever is smaller. */ #define RETRO_MEMDESC_ALIGN_4 (2 << 16) #define RETRO_MEMDESC_ALIGN_8 (3 << 16) #define RETRO_MEMDESC_MINSIZE_2 (1 << 24) /* All memory in this region is accessed at least 2 bytes at the time. */ #define RETRO_MEMDESC_MINSIZE_4 (2 << 24) #define RETRO_MEMDESC_MINSIZE_8 (3 << 24) struct retro_memory_descriptor { uint64_t flags; /* Pointer to the start of the relevant ROM or RAM chip. * It's strongly recommended to use 'offset' if possible, rather than * doing math on the pointer. * * If the same byte is mapped my multiple descriptors, their descriptors * must have the same pointer. * If 'start' does not point to the first byte in the pointer, put the * difference in 'offset' instead. * * May be NULL if there's nothing usable here (e.g. hardware registers and * open bus). No flags should be set if the pointer is NULL. * It's recommended to minimize the number of descriptors if possible, * but not mandatory. */ void *ptr; size_t offset; /* This is the location in the emulated address space * where the mapping starts. */ size_t start; /* Which bits must be same as in 'start' for this mapping to apply. * The first memory descriptor to claim a certain byte is the one * that applies. * A bit which is set in 'start' must also be set in this. * Can be zero, in which case each byte is assumed mapped exactly once. * In this case, 'len' must be a power of two. */ size_t select; /* If this is nonzero, the set bits are assumed not connected to the * memory chip's address pins. */ size_t disconnect; /* This one tells the size of the current memory area. * If, after start+disconnect are applied, the address is higher than * this, the highest bit of the address is cleared. * * If the address is still too high, the next highest bit is cleared. * Can be zero, in which case it's assumed to be infinite (as limited * by 'select' and 'disconnect'). */ size_t len; /* To go from emulated address to physical address, the following * order applies: * Subtract 'start', pick off 'disconnect', apply 'len', add 'offset'. * * The address space name must consist of only a-zA-Z0-9_-, * should be as short as feasible (maximum length is 8 plus the NUL), * and may not be any other address space plus one or more 0-9A-F * at the end. * However, multiple memory descriptors for the same address space is * allowed, and the address space name can be empty. NULL is treated * as empty. * * Address space names are case sensitive, but avoid lowercase if possible. * The same pointer may exist in multiple address spaces. * * Examples: * blank+blank - valid (multiple things may be mapped in the same namespace) * 'Sp'+'Sp' - valid (multiple things may be mapped in the same namespace) * 'A'+'B' - valid (neither is a prefix of each other) * 'S'+blank - valid ('S' is not in 0-9A-F) * 'a'+blank - valid ('a' is not in 0-9A-F) * 'a'+'A' - valid (neither is a prefix of each other) * 'AR'+blank - valid ('R' is not in 0-9A-F) * 'ARB'+blank - valid (the B can't be part of the address either, because * there is no namespace 'AR') * blank+'B' - not valid, because it's ambigous which address space B1234 * would refer to. * The length can't be used for that purpose; the frontend may want * to append arbitrary data to an address, without a separator. */ const char *addrspace; }; /* The frontend may use the largest value of 'start'+'select' in a * certain namespace to infer the size of the address space. * * If the address space is larger than that, a mapping with .ptr=NULL * should be at the end of the array, with .select set to all ones for * as long as the address space is big. * * Sample descriptors (minus .ptr, and RETRO_MEMFLAG_ on the flags): * SNES WRAM: * .start=0x7E0000, .len=0x20000 * (Note that this must be mapped before the ROM in most cases; some of the * ROM mappers * try to claim $7E0000, or at least $7E8000.) * SNES SPC700 RAM: * .addrspace="S", .len=0x10000 * SNES WRAM mirrors: * .flags=MIRROR, .start=0x000000, .select=0xC0E000, .len=0x2000 * .flags=MIRROR, .start=0x800000, .select=0xC0E000, .len=0x2000 * SNES WRAM mirrors, alternate equivalent descriptor: * .flags=MIRROR, .select=0x40E000, .disconnect=~0x1FFF * (Various similar constructions can be created by combining parts of * the above two.) * SNES LoROM (512KB, mirrored a couple of times): * .flags=CONST, .start=0x008000, .select=0x408000, .disconnect=0x8000, .len=512*1024 * .flags=CONST, .start=0x400000, .select=0x400000, .disconnect=0x8000, .len=512*1024 * SNES HiROM (4MB): * .flags=CONST, .start=0x400000, .select=0x400000, .len=4*1024*1024 * .flags=CONST, .offset=0x8000, .start=0x008000, .select=0x408000, .len=4*1024*1024 * SNES ExHiROM (8MB): * .flags=CONST, .offset=0, .start=0xC00000, .select=0xC00000, .len=4*1024*1024 * .flags=CONST, .offset=4*1024*1024, .start=0x400000, .select=0xC00000, .len=4*1024*1024 * .flags=CONST, .offset=0x8000, .start=0x808000, .select=0xC08000, .len=4*1024*1024 * .flags=CONST, .offset=4*1024*1024+0x8000, .start=0x008000, .select=0xC08000, .len=4*1024*1024 * Clarify the size of the address space: * .ptr=NULL, .select=0xFFFFFF * .len can be implied by .select in many of them, but was included for clarity. */ struct retro_memory_map { const struct retro_memory_descriptor *descriptors; unsigned num_descriptors; }; struct retro_controller_description { /* Human-readable description of the controller. Even if using a generic * input device type, this can be set to the particular device type the * core uses. */ const char *desc; /* Device type passed to retro_set_controller_port_device(). If the device * type is a sub-class of a generic input device type, use the * RETRO_DEVICE_SUBCLASS macro to create an ID. * * E.g. RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 1). */ unsigned id; }; struct retro_controller_info { const struct retro_controller_description *types; unsigned num_types; }; struct retro_subsystem_memory_info { /* The extension associated with a memory type, e.g. "psram". */ const char *extension; /* The memory type for retro_get_memory(). This should be at * least 0x100 to avoid conflict with standardized * libretro memory types. */ unsigned type; }; struct retro_subsystem_rom_info { /* Describes what the content is (SGB BIOS, GB ROM, etc). */ const char *desc; /* Same definition as retro_get_system_info(). */ const char *valid_extensions; /* Same definition as retro_get_system_info(). */ bool need_fullpath; /* Same definition as retro_get_system_info(). */ bool block_extract; /* This is set if the content is required to load a game. * If this is set to false, a zeroed-out retro_game_info can be passed. */ bool required; /* Content can have multiple associated persistent * memory types (retro_get_memory()). */ const struct retro_subsystem_memory_info *memory; unsigned num_memory; }; struct retro_subsystem_info { /* Human-readable string of the subsystem type, e.g. "Super GameBoy" */ const char *desc; /* A computer friendly short string identifier for the subsystem type. * This name must be [a-z]. * E.g. if desc is "Super GameBoy", this can be "sgb". * This identifier can be used for command-line interfaces, etc. */ const char *ident; /* Infos for each content file. The first entry is assumed to be the * "most significant" content for frontend purposes. * E.g. with Super GameBoy, the first content should be the GameBoy ROM, * as it is the most "significant" content to a user. * If a frontend creates new file paths based on the content used * (e.g. savestates), it should use the path for the first ROM to do so. */ const struct retro_subsystem_rom_info *roms; /* Number of content files associated with a subsystem. */ unsigned num_roms; /* The type passed to retro_load_game_special(). */ unsigned id; }; typedef void (*retro_proc_address_t)(void); /* libretro API extension functions: * (None here so far). * * Get a symbol from a libretro core. * Cores should only return symbols which are actual * extensions to the libretro API. * * Frontends should not use this to obtain symbols to standard * libretro entry points (static linking or dlsym). * * The symbol name must be equal to the function name, * e.g. if void retro_foo(void); exists, the symbol must be called "retro_foo". * The returned function pointer must be cast to the corresponding type. */ typedef retro_proc_address_t (*retro_get_proc_address_t)(const char *sym); struct retro_get_proc_address_interface { retro_get_proc_address_t get_proc_address; }; enum retro_log_level { RETRO_LOG_DEBUG = 0, RETRO_LOG_INFO, RETRO_LOG_WARN, RETRO_LOG_ERROR, RETRO_LOG_DUMMY = INT_MAX }; /* Logging function. Takes log level argument as well. */ typedef void (*retro_log_printf_t)(enum retro_log_level level, const char *fmt, ...); struct retro_log_callback { retro_log_printf_t log; }; /* Performance related functions */ /* ID values for SIMD CPU features */ #define RETRO_SIMD_SSE (1 << 0) #define RETRO_SIMD_SSE2 (1 << 1) #define RETRO_SIMD_VMX (1 << 2) #define RETRO_SIMD_VMX128 (1 << 3) #define RETRO_SIMD_AVX (1 << 4) #define RETRO_SIMD_NEON (1 << 5) #define RETRO_SIMD_SSE3 (1 << 6) #define RETRO_SIMD_SSSE3 (1 << 7) #define RETRO_SIMD_MMX (1 << 8) #define RETRO_SIMD_MMXEXT (1 << 9) #define RETRO_SIMD_SSE4 (1 << 10) #define RETRO_SIMD_SSE42 (1 << 11) #define RETRO_SIMD_AVX2 (1 << 12) #define RETRO_SIMD_VFPU (1 << 13) #define RETRO_SIMD_PS (1 << 14) #define RETRO_SIMD_AES (1 << 15) typedef uint64_t retro_perf_tick_t; typedef int64_t retro_time_t; struct retro_perf_counter { const char *ident; retro_perf_tick_t start; retro_perf_tick_t total; retro_perf_tick_t call_cnt; bool registered; }; /* Returns current time in microseconds. * Tries to use the most accurate timer available. */ typedef retro_time_t (*retro_perf_get_time_usec_t)(void); /* A simple counter. Usually nanoseconds, but can also be CPU cycles. * Can be used directly if desired (when creating a more sophisticated * performance counter system). * */ typedef retro_perf_tick_t (*retro_perf_get_counter_t)(void); /* Returns a bit-mask of detected CPU features (RETRO_SIMD_*). */ typedef uint64_t (*retro_get_cpu_features_t)(void); /* Asks frontend to log and/or display the state of performance counters. * Performance counters can always be poked into manually as well. */ typedef void (*retro_perf_log_t)(void); /* Register a performance counter. * ident field must be set with a discrete value and other values in * retro_perf_counter must be 0. * Registering can be called multiple times. To avoid calling to * frontend redundantly, you can check registered field first. */ typedef void (*retro_perf_register_t)(struct retro_perf_counter *counter); /* Starts a registered counter. */ typedef void (*retro_perf_start_t)(struct retro_perf_counter *counter); /* Stops a registered counter. */ typedef void (*retro_perf_stop_t)(struct retro_perf_counter *counter); /* For convenience it can be useful to wrap register, start and stop in macros. * E.g.: * #ifdef LOG_PERFORMANCE * #define RETRO_PERFORMANCE_INIT(perf_cb, name) static struct retro_perf_counter name = {#name}; if (!name.registered) perf_cb.perf_register(&(name)) * #define RETRO_PERFORMANCE_START(perf_cb, name) perf_cb.perf_start(&(name)) * #define RETRO_PERFORMANCE_STOP(perf_cb, name) perf_cb.perf_stop(&(name)) * #else * ... Blank macros ... * #endif * * These can then be used mid-functions around code snippets. * * extern struct retro_perf_callback perf_cb; * Somewhere in the core. * * void do_some_heavy_work(void) * { * RETRO_PERFORMANCE_INIT(cb, work_1; * RETRO_PERFORMANCE_START(cb, work_1); * heavy_work_1(); * RETRO_PERFORMANCE_STOP(cb, work_1); * * RETRO_PERFORMANCE_INIT(cb, work_2); * RETRO_PERFORMANCE_START(cb, work_2); * heavy_work_2(); * RETRO_PERFORMANCE_STOP(cb, work_2); * } * * void retro_deinit(void) * { * perf_cb.perf_log(); * Log all perf counters here for example. * } */ struct retro_perf_callback { retro_perf_get_time_usec_t get_time_usec; retro_get_cpu_features_t get_cpu_features; retro_perf_get_counter_t get_perf_counter; retro_perf_register_t perf_register; retro_perf_start_t perf_start; retro_perf_stop_t perf_stop; retro_perf_log_t perf_log; }; /* FIXME: Document the sensor API and work out behavior. * It will be marked as experimental until then. */ enum retro_sensor_action { RETRO_SENSOR_ACCELEROMETER_ENABLE = 0, RETRO_SENSOR_ACCELEROMETER_DISABLE, RETRO_SENSOR_DUMMY = INT_MAX }; /* Id values for SENSOR types. */ #define RETRO_SENSOR_ACCELEROMETER_X 0 #define RETRO_SENSOR_ACCELEROMETER_Y 1 #define RETRO_SENSOR_ACCELEROMETER_Z 2 typedef bool (*retro_set_sensor_state_t)(unsigned port, enum retro_sensor_action action, unsigned rate); typedef float (*retro_sensor_get_input_t)(unsigned port, unsigned id); struct retro_sensor_interface { retro_set_sensor_state_t set_sensor_state; retro_sensor_get_input_t get_sensor_input; }; enum retro_camera_buffer { RETRO_CAMERA_BUFFER_OPENGL_TEXTURE = 0, RETRO_CAMERA_BUFFER_RAW_FRAMEBUFFER, RETRO_CAMERA_BUFFER_DUMMY = INT_MAX }; /* Starts the camera driver. Can only be called in retro_run(). */ typedef bool (*retro_camera_start_t)(void); /* Stops the camera driver. Can only be called in retro_run(). */ typedef void (*retro_camera_stop_t)(void); /* Callback which signals when the camera driver is initialized * and/or deinitialized. * retro_camera_start_t can be called in initialized callback. */ typedef void (*retro_camera_lifetime_status_t)(void); /* A callback for raw framebuffer data. buffer points to an XRGB8888 buffer. * Width, height and pitch are similar to retro_video_refresh_t. * First pixel is top-left origin. */ typedef void (*retro_camera_frame_raw_framebuffer_t)(const uint32_t *buffer, unsigned width, unsigned height, size_t pitch); /* A callback for when OpenGL textures are used. * * texture_id is a texture owned by camera driver. * Its state or content should be considered immutable, except for things like * texture filtering and clamping. * * texture_target is the texture target for the GL texture. * These can include e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE, and possibly * more depending on extensions. * * affine points to a packed 3x3 column-major matrix used to apply an affine * transform to texture coordinates. (affine_matrix * vec3(coord_x, coord_y, 1.0)) * After transform, normalized texture coord (0, 0) should be bottom-left * and (1, 1) should be top-right (or (width, height) for RECTANGLE). * * GL-specific typedefs are avoided here to avoid relying on gl.h in * the API definition. */ typedef void (*retro_camera_frame_opengl_texture_t)(unsigned texture_id, unsigned texture_target, const float *affine); struct retro_camera_callback { /* Set by libretro core. * Example bitmask: caps = (1 << RETRO_CAMERA_BUFFER_OPENGL_TEXTURE) | (1 << RETRO_CAMERA_BUFFER_RAW_FRAMEBUFFER). */ uint64_t caps; unsigned width; /* Desired resolution for camera. Is only used as a hint. */ unsigned height; retro_camera_start_t start; /* Set by frontend. */ retro_camera_stop_t stop; /* Set by frontend. */ /* Set by libretro core if raw framebuffer callbacks will be used. */ retro_camera_frame_raw_framebuffer_t frame_raw_framebuffer; /* Set by libretro core if OpenGL texture callbacks will be used. */ retro_camera_frame_opengl_texture_t frame_opengl_texture; /* Set by libretro core. Called after camera driver is initialized and * ready to be started. * Can be NULL, in which this callback is not called. */ retro_camera_lifetime_status_t initialized; /* Set by libretro core. Called right before camera driver is * deinitialized. * Can be NULL, in which this callback is not called. */ retro_camera_lifetime_status_t deinitialized; }; /* Sets the interval of time and/or distance at which to update/poll * location-based data. * * To ensure compatibility with all location-based implementations, * values for both interval_ms and interval_distance should be provided. * * interval_ms is the interval expressed in milliseconds. * interval_distance is the distance interval expressed in meters. */ typedef void (*retro_location_set_interval_t)(unsigned interval_ms, unsigned interval_distance); /* Start location services. The device will start listening for changes to the * current location at regular intervals (which are defined with * retro_location_set_interval_t). */ typedef bool (*retro_location_start_t)(void); /* Stop location services. The device will stop listening for changes * to the current location. */ typedef void (*retro_location_stop_t)(void); /* Get the position of the current location. Will set parameters to * 0 if no new location update has happened since the last time. */ typedef bool (*retro_location_get_position_t)(double *lat, double *lon, double *horiz_accuracy, double *vert_accuracy); /* Callback which signals when the location driver is initialized * and/or deinitialized. * retro_location_start_t can be called in initialized callback. */ typedef void (*retro_location_lifetime_status_t)(void); struct retro_location_callback { retro_location_start_t start; retro_location_stop_t stop; retro_location_get_position_t get_position; retro_location_set_interval_t set_interval; retro_location_lifetime_status_t initialized; retro_location_lifetime_status_t deinitialized; }; enum retro_rumble_effect { RETRO_RUMBLE_STRONG = 0, RETRO_RUMBLE_WEAK = 1, RETRO_RUMBLE_DUMMY = INT_MAX }; /* Sets rumble state for joypad plugged in port 'port'. * Rumble effects are controlled independently, * and setting e.g. strong rumble does not override weak rumble. * Strength has a range of [0, 0xffff]. * * Returns true if rumble state request was honored. * Calling this before first retro_run() is likely to return false. */ typedef bool (*retro_set_rumble_state_t)(unsigned port, enum retro_rumble_effect effect, uint16_t strength); struct retro_rumble_interface { retro_set_rumble_state_t set_rumble_state; }; /* Notifies libretro that audio data should be written. */ typedef void (*retro_audio_callback_t)(void); /* True: Audio driver in frontend is active, and callback is * expected to be called regularily. * False: Audio driver in frontend is paused or inactive. * Audio callback will not be called until set_state has been * called with true. * Initial state is false (inactive). */ typedef void (*retro_audio_set_state_callback_t)(bool enabled); struct retro_audio_callback { retro_audio_callback_t callback; retro_audio_set_state_callback_t set_state; }; /* Notifies a libretro core of time spent since last invocation * of retro_run() in microseconds. * * It will be called right before retro_run() every frame. * The frontend can tamper with timing to support cases like * fast-forward, slow-motion and framestepping. * * In those scenarios the reference frame time value will be used. */ typedef int64_t retro_usec_t; typedef void (*retro_frame_time_callback_t)(retro_usec_t usec); struct retro_frame_time_callback { retro_frame_time_callback_t callback; /* Represents the time of one frame. It is computed as * 1000000 / fps, but the implementation will resolve the * rounding to ensure that framestepping, etc is exact. */ retro_usec_t reference; }; /* Pass this to retro_video_refresh_t if rendering to hardware. * Passing NULL to retro_video_refresh_t is still a frame dupe as normal. * */ #define RETRO_HW_FRAME_BUFFER_VALID ((void*)-1) /* Invalidates the current HW context. * Any GL state is lost, and must not be deinitialized explicitly. * If explicit deinitialization is desired by the libretro core, * it should implement context_destroy callback. * If called, all GPU resources must be reinitialized. * Usually called when frontend reinits video driver. * Also called first time video driver is initialized, * allowing libretro core to initialize resources. */ typedef void (*retro_hw_context_reset_t)(void); /* Gets current framebuffer which is to be rendered to. * Could change every frame potentially. */ typedef uintptr_t (*retro_hw_get_current_framebuffer_t)(void); /* Get a symbol from HW context. */ typedef retro_proc_address_t (*retro_hw_get_proc_address_t)(const char *sym); enum retro_hw_context_type { RETRO_HW_CONTEXT_NONE = 0, /* OpenGL 2.x. Driver can choose to use latest compatibility context. */ RETRO_HW_CONTEXT_OPENGL = 1, /* OpenGL ES 2.0. */ RETRO_HW_CONTEXT_OPENGLES2 = 2, /* Modern desktop core GL context. Use version_major/ * version_minor fields to set GL version. */ RETRO_HW_CONTEXT_OPENGL_CORE = 3, /* OpenGL ES 3.0 */ RETRO_HW_CONTEXT_OPENGLES3 = 4, /* OpenGL ES 3.1+. Set version_major/version_minor. For GLES2 and GLES3, * use the corresponding enums directly. */ RETRO_HW_CONTEXT_OPENGLES_VERSION = 5, RETRO_HW_CONTEXT_DUMMY = INT_MAX }; struct retro_hw_render_callback { /* Which API to use. Set by libretro core. */ enum retro_hw_context_type context_type; /* Called when a context has been created or when it has been reset. * An OpenGL context is only valid after context_reset() has been called. * * When context_reset is called, OpenGL resources in the libretro * implementation are guaranteed to be invalid. * * It is possible that context_reset is called multiple times during an * application lifecycle. * If context_reset is called without any notification (context_destroy), * the OpenGL context was lost and resources should just be recreated * without any attempt to "free" old resources. */ retro_hw_context_reset_t context_reset; /* Set by frontend. */ retro_hw_get_current_framebuffer_t get_current_framebuffer; /* Set by frontend. */ retro_hw_get_proc_address_t get_proc_address; /* Set if render buffers should have depth component attached. */ bool depth; /* Set if stencil buffers should be attached. */ bool stencil; /* If depth and stencil are true, a packed 24/8 buffer will be added. * Only attaching stencil is invalid and will be ignored. */ /* Use conventional bottom-left origin convention. If false, * standard libretro top-left origin semantics are used. */ bool bottom_left_origin; /* Major version number for core GL context or GLES 3.1+. */ unsigned version_major; /* Minor version number for core GL context or GLES 3.1+. */ unsigned version_minor; /* If this is true, the frontend will go very far to avoid * resetting context in scenarios like toggling fullscreen, etc. */ bool cache_context; /* The reset callback might still be called in extreme situations * such as if the context is lost beyond recovery. * * For optimal stability, set this to false, and allow context to be * reset at any time. */ /* A callback to be called before the context is destroyed in a * controlled way by the frontend. */ retro_hw_context_reset_t context_destroy; /* OpenGL resources can be deinitialized cleanly at this step. * context_destroy can be set to NULL, in which resources will * just be destroyed without any notification. * * Even when context_destroy is non-NULL, it is possible that * context_reset is called without any destroy notification. * This happens if context is lost by external factors (such as * notified by GL_ARB_robustness). * * In this case, the context is assumed to be already dead, * and the libretro implementation must not try to free any OpenGL * resources in the subsequent context_reset. */ /* Creates a debug context. */ bool debug_context; }; /* Callback type passed in RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK. * Called by the frontend in response to keyboard events. * down is set if the key is being pressed, or false if it is being released. * keycode is the RETROK value of the char. * character is the text character of the pressed key. (UTF-32). * key_modifiers is a set of RETROKMOD values or'ed together. * * The pressed/keycode state can be indepedent of the character. * It is also possible that multiple characters are generated from a * single keypress. * Keycode events should be treated separately from character events. * However, when possible, the frontend should try to synchronize these. * If only a character is posted, keycode should be RETROK_UNKNOWN. * * Similarily if only a keycode event is generated with no corresponding * character, character should be 0. */ typedef void (*retro_keyboard_event_t)(bool down, unsigned keycode, uint32_t character, uint16_t key_modifiers); struct retro_keyboard_callback { retro_keyboard_event_t callback; }; /* Callbacks for RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE. * Should be set for implementations which can swap out multiple disk * images in runtime. * * If the implementation can do this automatically, it should strive to do so. * However, there are cases where the user must manually do so. * * Overview: To swap a disk image, eject the disk image with * set_eject_state(true). * Set the disk index with set_image_index(index). Insert the disk again * with set_eject_state(false). */ /* If ejected is true, "ejects" the virtual disk tray. * When ejected, the disk image index can be set. */ typedef bool (*retro_set_eject_state_t)(bool ejected); /* Gets current eject state. The initial state is 'not ejected'. */ typedef bool (*retro_get_eject_state_t)(void); /* Gets current disk index. First disk is index 0. * If return value is >= get_num_images(), no disk is currently inserted. */ typedef unsigned (*retro_get_image_index_t)(void); /* Sets image index. Can only be called when disk is ejected. * The implementation supports setting "no disk" by using an * index >= get_num_images(). */ typedef bool (*retro_set_image_index_t)(unsigned index); /* Gets total number of images which are available to use. */ typedef unsigned (*retro_get_num_images_t)(void); struct retro_game_info; /* Replaces the disk image associated with index. * Arguments to pass in info have same requirements as retro_load_game(). * Virtual disk tray must be ejected when calling this. * * Replacing a disk image with info = NULL will remove the disk image * from the internal list. * As a result, calls to get_image_index() can change. * * E.g. replace_image_index(1, NULL), and previous get_image_index() * returned 4 before. * Index 1 will be removed, and the new index is 3. */ typedef bool (*retro_replace_image_index_t)(unsigned index, const struct retro_game_info *info); /* Adds a new valid index (get_num_images()) to the internal disk list. * This will increment subsequent return values from get_num_images() by 1. * This image index cannot be used until a disk image has been set * with replace_image_index. */ typedef bool (*retro_add_image_index_t)(void); struct retro_disk_control_callback { retro_set_eject_state_t set_eject_state; retro_get_eject_state_t get_eject_state; retro_get_image_index_t get_image_index; retro_set_image_index_t set_image_index; retro_get_num_images_t get_num_images; retro_replace_image_index_t replace_image_index; retro_add_image_index_t add_image_index; }; enum retro_pixel_format { /* 0RGB1555, native endian. * 0 bit must be set to 0. * This pixel format is default for compatibility concerns only. * If a 15/16-bit pixel format is desired, consider using RGB565. */ RETRO_PIXEL_FORMAT_0RGB1555 = 0, /* XRGB8888, native endian. * X bits are ignored. */ RETRO_PIXEL_FORMAT_XRGB8888 = 1, /* RGB565, native endian. * This pixel format is the recommended format to use if a 15/16-bit * format is desired as it is the pixel format that is typically * available on a wide range of low-power devices. * * It is also natively supported in APIs like OpenGL ES. */ RETRO_PIXEL_FORMAT_RGB565 = 2, /* Ensure sizeof() == sizeof(int). */ RETRO_PIXEL_FORMAT_UNKNOWN = INT_MAX }; struct retro_message { const char *msg; /* Message to be displayed. */ unsigned frames; /* Duration in frames of message. */ }; /* Describes how the libretro implementation maps a libretro input bind * to its internal input system through a human readable string. * This string can be used to better let a user configure input. */ struct retro_input_descriptor { /* Associates given parameters with a description. */ unsigned port; unsigned device; unsigned index; unsigned id; /* Human readable description for parameters. * The pointer must remain valid until * retro_unload_game() is called. */ const char *description; }; struct retro_system_info { /* All pointers are owned by libretro implementation, and pointers must * remain valid until retro_deinit() is called. */ const char *library_name; /* Descriptive name of library. Should not * contain any version numbers, etc. */ const char *library_version; /* Descriptive version of core. */ const char *valid_extensions; /* A string listing probably content * extensions the core will be able to * load, separated with pipe. * I.e. "bin|rom|iso". * Typically used for a GUI to filter * out extensions. */ /* If true, retro_load_game() is guaranteed to provide a valid pathname * in retro_game_info::path. * ::data and ::size are both invalid. * * If false, ::data and ::size are guaranteed to be valid, but ::path * might not be valid. * * This is typically set to true for libretro implementations that must * load from file. * Implementations should strive for setting this to false, as it allows * the frontend to perform patching, etc. */ bool need_fullpath; /* If true, the frontend is not allowed to extract any archives before * loading the real content. * Necessary for certain libretro implementations that load games * from zipped archives. */ bool block_extract; }; struct retro_game_geometry { unsigned base_width; /* Nominal video width of game. */ unsigned base_height; /* Nominal video height of game. */ unsigned max_width; /* Maximum possible width of game. */ unsigned max_height; /* Maximum possible height of game. */ float aspect_ratio; /* Nominal aspect ratio of game. If * aspect_ratio is <= 0.0, an aspect ratio * of base_width / base_height is assumed. * A frontend could override this setting, * if desired. */ }; struct retro_system_timing { double fps; /* FPS of video content. */ double sample_rate; /* Sampling rate of audio. */ }; struct retro_system_av_info { struct retro_game_geometry geometry; struct retro_system_timing timing; }; struct retro_variable { /* Variable to query in RETRO_ENVIRONMENT_GET_VARIABLE. * If NULL, obtains the complete environment string if more * complex parsing is necessary. * The environment string is formatted as key-value pairs * delimited by semicolons as so: * "key1=value1;key2=value2;..." */ const char *key; /* Value to be obtained. If key does not exist, it is set to NULL. */ const char *value; }; struct retro_game_info { const char *path; /* Path to game, UTF-8 encoded. * Usually used as a reference. * May be NULL if rom was loaded from stdin * or similar. * retro_system_info::need_fullpath guaranteed * that this path is valid. */ const void *data; /* Memory buffer of loaded game. Will be NULL * if need_fullpath was set. */ size_t size; /* Size of memory buffer. */ const char *meta; /* String of implementation specific meta-data. */ }; /* Callbacks */ /* Environment callback. Gives implementations a way of performing * uncommon tasks. Extensible. */ typedef bool (*retro_environment_t)(unsigned cmd, void *data); /* Render a frame. Pixel format is 15-bit 0RGB1555 native endian * unless changed (see RETRO_ENVIRONMENT_SET_PIXEL_FORMAT). * * Width and height specify dimensions of buffer. * Pitch specifices length in bytes between two lines in buffer. * * For performance reasons, it is highly recommended to have a frame * that is packed in memory, i.e. pitch == width * byte_per_pixel. * Certain graphic APIs, such as OpenGL ES, do not like textures * that are not packed in memory. */ typedef void (*retro_video_refresh_t)(const void *data, unsigned width, unsigned height, size_t pitch); /* Renders a single audio frame. Should only be used if implementation * generates a single sample at a time. * Format is signed 16-bit native endian. */ typedef void (*retro_audio_sample_t)(int16_t left, int16_t right); /* Renders multiple audio frames in one go. * * One frame is defined as a sample of left and right channels, interleaved. * I.e. int16_t buf[4] = { l, r, l, r }; would be 2 frames. * Only one of the audio callbacks must ever be used. */ typedef size_t (*retro_audio_sample_batch_t)(const int16_t *data, size_t frames); /* Polls input. */ typedef void (*retro_input_poll_t)(void); /* Queries for input for player 'port'. device will be masked with * RETRO_DEVICE_MASK. * * Specialization of devices such as RETRO_DEVICE_JOYPAD_MULTITAP that * have been set with retro_set_controller_port_device() * will still use the higher level RETRO_DEVICE_JOYPAD to request input. */ typedef int16_t (*retro_input_state_t)(unsigned port, unsigned device, unsigned index, unsigned id); /* Sets callbacks. retro_set_environment() is guaranteed to be called * before retro_init(). * * The rest of the set_* functions are guaranteed to have been called * before the first call to retro_run() is made. */ void retro_set_environment(retro_environment_t); void retro_set_video_refresh(retro_video_refresh_t); void retro_set_audio_sample(retro_audio_sample_t); void retro_set_audio_sample_batch(retro_audio_sample_batch_t); void retro_set_input_poll(retro_input_poll_t); void retro_set_input_state(retro_input_state_t); /* Library global initialization/deinitialization. */ void retro_init(void); void retro_deinit(void); /* Must return RETRO_API_VERSION. Used to validate ABI compatibility * when the API is revised. */ unsigned retro_api_version(void); /* Gets statically known system info. Pointers provided in *info * must be statically allocated. * Can be called at any time, even before retro_init(). */ void retro_get_system_info(struct retro_system_info *info); /* Gets information about system audio/video timings and geometry. * Can be called only after retro_load_game() has successfully completed. * NOTE: The implementation of this function might not initialize every * variable if needed. * E.g. geom.aspect_ratio might not be initialized if core doesn't * desire a particular aspect ratio. */ void retro_get_system_av_info(struct retro_system_av_info *info); /* Sets device to be used for player 'port'. * By default, RETRO_DEVICE_JOYPAD is assumed to be plugged into all * available ports. * Setting a particular device type is not a guarantee that libretro cores * will only poll input based on that particular device type. It is only a * hint to the libretro core when a core cannot automatically detect the * appropriate input device type on its own. It is also relevant when a * core can change its behavior depending on device type. */ void retro_set_controller_port_device(unsigned port, unsigned device); /* Resets the current game. */ void retro_reset(void); /* Runs the game for one video frame. * During retro_run(), input_poll callback must be called at least once. * * If a frame is not rendered for reasons where a game "dropped" a frame, * this still counts as a frame, and retro_run() should explicitly dupe * a frame if GET_CAN_DUPE returns true. * In this case, the video callback can take a NULL argument for data. */ void retro_run(void); /* Returns the amount of data the implementation requires to serialize * internal state (save states). * Between calls to retro_load_game() and retro_unload_game(), the * returned size is never allowed to be larger than a previous returned * value, to ensure that the frontend can allocate a save state buffer once. */ size_t retro_serialize_size(void); /* Serializes internal state. If failed, or size is lower than * retro_serialize_size(), it should return false, true otherwise. */ bool retro_serialize(void *data, size_t size); bool retro_unserialize(const void *data, size_t size); void retro_cheat_reset(void); void retro_cheat_set(unsigned index, bool enabled, const char *code); /* Loads a game. */ bool retro_load_game(const struct retro_game_info *game); /* Loads a "special" kind of game. Should not be used, * except in extreme cases. */ bool retro_load_game_special( unsigned game_type, const struct retro_game_info *info, size_t num_info ); /* Unloads a currently loaded game. */ void retro_unload_game(void); /* Gets region of game. */ unsigned retro_get_region(void); /* Gets region of memory. */ void *retro_get_memory_data(unsigned id); size_t retro_get_memory_size(unsigned id); #ifdef __cplusplus } #endif #endif sfc/chip/dsp2/dsp2.hpp000664 001750 001750 00000002002 12651764221 015631 0ustar00sergiosergio000000 000000 class DSP2 { public: void init(); void load(); void unload(); void power(); void reset(); uint8 read(unsigned addr); void write(unsigned addr, uint8 data); void serialize(serializer&); unsigned Select; struct { bool waiting_for_command; unsigned command; unsigned in_count, in_index; unsigned out_count, out_index; uint8 parameters[512]; uint8 output[512]; uint8 op05transparent; bool op05haslen; int op05len; bool op06haslen; int op06len; uint16 op09word1; uint16 op09word2; bool op0dhaslen; int op0doutlen; int op0dinlen; } status; protected: void op01(); void op03(); void op05(); void op06(); void op09(); void op0d(); }; class DSP2DR : public Memory { uint8 read(unsigned addr); void write(unsigned addr, uint8 data); }; class DSP2SR : public Memory { uint8 read(unsigned addr); void write(unsigned addr, uint8 data); }; extern DSP2 dsp2; extern DSP2DR dsp2dr; extern DSP2SR dsp2sr; sfc/cpu/memory/memory.hpp000664 001750 001750 00000000253 12651764221 016603 0ustar00sergiosergio000000 000000 void op_io(); uint8 op_read(uint32 addr); void op_write(uint32 addr, uint8 data); alwaysinline unsigned speed(unsigned addr) const; uint8 disassembler_read(uint32 addr); sfc/chip/sgb-external/000700 001750 001750 00000000000 12656700342 015764 5ustar00sergiosergio000000 000000 sfc/chip/hitachidsp/hitachidsp.cpp000664 001750 001750 00000002251 12651764221 020352 0ustar00sergiosergio000000 000000 #include #define HITACHIDSP_CPP namespace SuperFamicom { #include "memory.cpp" #include "serialization.cpp" HitachiDSP hitachidsp; void HitachiDSP::Enter() { hitachidsp.enter(); } void HitachiDSP::enter() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(mmio.dma) { for(unsigned n = 0; n < mmio.dma_length; n++) { bus.write(mmio.dma_target + n, bus.read(mmio.dma_source + n)); step(2); } mmio.dma = false; } exec(mmio.program_offset); step(1); synchronize_cpu(); } } void HitachiDSP::init() { } void HitachiDSP::load() { } void HitachiDSP::unload() { rom.reset(); ram.reset(); } void HitachiDSP::power() { mmio.dma = false; mmio.dma_source = 0x000000; mmio.dma_length = 0x0000; mmio.dma_target = 0x000000; mmio.r1f48 = 0x00; mmio.program_offset = 0x000000; mmio.r1f4c = 0x00; mmio.page_number = 0x0000; mmio.program_counter = 0x00; mmio.r1f50 = 0x33; mmio.r1f51 = 0x00; mmio.r1f52 = 0x01; } void HitachiDSP::reset() { create(HitachiDSP::Enter, Frequency); HG51B::power(); } } fc/apu/serialization.cpp000664 001750 001750 00000001027 12651764221 016446 0ustar00sergiosergio000000 000000 void APU::serialize(serializer& s) { Thread::serialize(s); filter.serialize(s); pulse[0].serialize(s); pulse[1].serialize(s); triangle.serialize(s); dmc.serialize(s); frame.serialize(s); s.integer(enabled_channels); s.integer(cartridge_sample); } void APU::Filter::serialize(serializer& s) { s.integer(hipass_strong); s.integer(hipass_weak); s.integer(lopass); } void APU::FrameCounter::serialize(serializer& s) { s.integer(irq_pending); s.integer(mode); s.integer(counter); s.integer(divider); } target-libretro/jni/Application.mk000664 001750 001750 00000000150 12651764221 020366 0ustar00sergiosergio000000 000000 NDK_TOOLCHAIN_VERSION := 4.8 APP_ABI := armeabi-v7a APP_STL := gnustl_static APP_PLATFORM := android-9 phoenix/gtk/widget/viewport.cpp000664 001750 001750 00000005545 12651764221 020026 0ustar00sergiosergio000000 000000 namespace phoenix { static void Viewport_dropEvent(GtkWidget* widget, GdkDragContext* context, gint x, gint y, GtkSelectionData* data, guint type, guint timestamp, Viewport* viewport) { if(viewport->state.droppable == false) return; lstring paths = DropPaths(data); if(paths.empty()) return; if(viewport->onDrop) viewport->onDrop(paths); } static gboolean Viewport_mouseLeave(GtkWidget* widget, GdkEventButton* event, pViewport* self) { if(self->viewport.onMouseLeave) self->viewport.onMouseLeave(); return true; } static gboolean Viewport_mouseMove(GtkWidget* widget, GdkEventButton* event, pViewport* self) { if(self->viewport.onMouseMove) self->viewport.onMouseMove({(signed)event->x, (signed)event->y}); return true; } static gboolean Viewport_mousePress(GtkWidget* widget, GdkEventButton* event, pViewport* self) { if(self->viewport.onMousePress) switch(event->button) { case 1: self->viewport.onMousePress(Mouse::Button::Left); break; case 2: self->viewport.onMousePress(Mouse::Button::Middle); break; case 3: self->viewport.onMousePress(Mouse::Button::Right); break; } return true; } static gboolean Viewport_mouseRelease(GtkWidget* widget, GdkEventButton* event, pViewport* self) { if(self->viewport.onMouseRelease) switch(event->button) { case 1: self->viewport.onMouseRelease(Mouse::Button::Left); break; case 2: self->viewport.onMouseRelease(Mouse::Button::Middle); break; case 3: self->viewport.onMouseRelease(Mouse::Button::Right); break; } return true; } uintptr_t pViewport::handle() { return GDK_WINDOW_XID(gtk_widget_get_window(gtkWidget)); } void pViewport::setDroppable(bool droppable) { gtk_drag_dest_set(gtkWidget, GTK_DEST_DEFAULT_ALL, nullptr, 0, GDK_ACTION_COPY); if(droppable) gtk_drag_dest_add_uri_targets(gtkWidget); } void pViewport::constructor() { gtkWidget = gtk_drawing_area_new(); //gtk_widget_set_double_buffered(gtkWidget, false); gtk_widget_add_events(gtkWidget, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK); g_signal_connect(G_OBJECT(gtkWidget), "drag-data-received", G_CALLBACK(Viewport_dropEvent), (gpointer)&viewport); g_signal_connect(G_OBJECT(gtkWidget), "button-press-event", G_CALLBACK(Viewport_mousePress), (gpointer)this); g_signal_connect(G_OBJECT(gtkWidget), "button-release-event", G_CALLBACK(Viewport_mouseRelease), (gpointer)this); g_signal_connect(G_OBJECT(gtkWidget), "leave-notify-event", G_CALLBACK(Viewport_mouseLeave), (gpointer)this); g_signal_connect(G_OBJECT(gtkWidget), "motion-notify-event", G_CALLBACK(Viewport_mouseMove), (gpointer)this); GdkColor color; color.pixel = 0; color.red = 0; color.green = 0; color.blue = 0; gtk_widget_modify_bg(gtkWidget, GTK_STATE_NORMAL, &color); } void pViewport::destructor() { gtk_widget_destroy(gtkWidget); } void pViewport::orphan() { destructor(); constructor(); } } ruby/video/glx.cpp000664 001750 001750 00000017114 12651764221 015301 0ustar00sergiosergio000000 000000 #include "opengl/opengl.hpp" #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 namespace ruby { struct pVideoGLX : OpenGL { GLXContext (*glXCreateContextAttribs)(Display*, GLXFBConfig, GLXContext, int, const int*) = nullptr; int (*glXSwapInterval)(int) = nullptr; Display* display; int screen; Window xwindow; Colormap colormap; GLXContext glxcontext; GLXWindow glxwindow; struct { int version_major, version_minor; bool double_buffer; bool is_direct; } glx; struct { Window handle; bool synchronize; unsigned depth; unsigned filter; string shader; } settings; bool cap(const string& name) { if(name == Video::Handle) return true; if(name == Video::Synchronize) return true; if(name == Video::Depth) return true; if(name == Video::Filter) return true; if(name == Video::Shader) return true; return false; } any get(const string& name) { if(name == Video::Handle) return (uintptr_t)settings.handle; if(name == Video::Synchronize) return settings.synchronize; if(name == Video::Depth) return settings.depth; if(name == Video::Filter) return settings.filter; return false; } bool set(const string& name, const any& value) { if(name == Video::Handle) { settings.handle = any_cast(value); return true; } if(name == Video::Synchronize) { if(settings.synchronize != any_cast(value)) { settings.synchronize = any_cast(value); if(glXSwapInterval) glXSwapInterval(settings.synchronize); return true; } } if(name == Video::Depth) { unsigned depth = any_cast(value); if(depth > DefaultDepth(display, screen)) return false; switch(depth) { case 24: inputFormat = GL_RGBA8; break; case 30: inputFormat = GL_RGB10_A2; break; default: return false; } settings.depth = depth; return true; } if(name == Video::Filter) { settings.filter = any_cast(value); if(settings.shader.empty()) OpenGL::filter = settings.filter ? GL_LINEAR : GL_NEAREST; return true; } if(name == Video::Shader) { settings.shader = any_cast(value); OpenGL::shader(settings.shader); if(settings.shader.empty()) OpenGL::filter = settings.filter ? GL_LINEAR : GL_NEAREST; return true; } return false; } bool lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) { OpenGL::size(width, height); return OpenGL::lock(data, pitch); } void unlock() { } void clear() { OpenGL::clear(); if(glx.double_buffer) glXSwapBuffers(display, glxwindow); } void refresh() { //we must ensure that the child window is the same size as the parent window. //unfortunately, we cannot hook the parent window resize event notification, //as we did not create the parent window, nor have any knowledge of the toolkit used. //therefore, inelegant as it may be, we query each window size and resize as needed. XWindowAttributes parent, child; XGetWindowAttributes(display, settings.handle, &parent); XGetWindowAttributes(display, xwindow, &child); if(child.width != parent.width || child.height != parent.height) { XResizeWindow(display, xwindow, parent.width, parent.height); } outputWidth = parent.width, outputHeight = parent.height; OpenGL::refresh(); if(glx.double_buffer) glXSwapBuffers(display, glxwindow); } bool init() { term(); glXQueryVersion(display, &glx.version_major, &glx.version_minor); //require GLX 1.2+ API if(glx.version_major < 1 || (glx.version_major == 1 && glx.version_minor < 2)) return false; XWindowAttributes window_attributes; XGetWindowAttributes(display, settings.handle, &window_attributes); //let GLX determine the best Visual to use for GL output; provide a few hints //note: some video drivers will override double buffering attribute int attributeList[] = { GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_DOUBLEBUFFER, True, GLX_RED_SIZE, (signed)(settings.depth / 3), GLX_GREEN_SIZE, (signed)(settings.depth / 3) + (signed)(settings.depth % 3), GLX_BLUE_SIZE, (signed)(settings.depth / 3), None }; int fbCount; GLXFBConfig* fbConfig = glXChooseFBConfig(display, screen, attributeList, &fbCount); if(fbCount == 0) return false; XVisualInfo* vi = glXGetVisualFromFBConfig(display, fbConfig[0]); //Window settings.handle has already been realized, most likely with DefaultVisual. //GLX requires that the GL output window has the same Visual as the GLX context. //it is not possible to change the Visual of an already realized (created) window. //therefore a new child window, using the same GLX Visual, must be created and binded to settings.handle. colormap = XCreateColormap(display, RootWindow(display, vi->screen), vi->visual, AllocNone); XSetWindowAttributes attributes; attributes.colormap = colormap; attributes.border_pixel = 0; xwindow = XCreateWindow(display, /* parent = */ settings.handle, /* x = */ 0, /* y = */ 0, window_attributes.width, window_attributes.height, /* border_width = */ 0, vi->depth, InputOutput, vi->visual, CWColormap | CWBorderPixel, &attributes); XSetWindowBackground(display, xwindow, /* color = */ 0); XMapWindow(display, xwindow); XFlush(display); //window must be realized (appear onscreen) before we make the context current while(XPending(display)) { XEvent event; XNextEvent(display, &event); } glxcontext = glXCreateContext(display, vi, /* sharelist = */ 0, /* direct = */ GL_TRUE); glXMakeCurrent(display, glxwindow = xwindow, glxcontext); glXCreateContextAttribs = (GLXContext (*)(Display*, GLXFBConfig, GLXContext, int, const int*))glGetProcAddress("glXCreateContextAttribsARB"); glXSwapInterval = (int (*)(int))glGetProcAddress("glXSwapIntervalSGI"); if(!glXSwapInterval) glXSwapInterval = (int (*)(int))glGetProcAddress("glXSwapIntervalMESA"); if(glXCreateContextAttribs) { int attributes[] = { GLX_CONTEXT_MAJOR_VERSION_ARB, 3, GLX_CONTEXT_MINOR_VERSION_ARB, 2, None }; GLXContext context = glXCreateContextAttribs(display, fbConfig[0], nullptr, true, attributes); if(context) { glXMakeCurrent(display, 0, nullptr); glXDestroyContext(display, glxcontext); glXMakeCurrent(display, glxwindow, glxcontext = context); } } if(glXSwapInterval) { glXSwapInterval(settings.synchronize); } //read attributes of frame buffer for later use, as requested attributes from above are not always granted int value = 0; glXGetConfig(display, vi, GLX_DOUBLEBUFFER, &value); glx.double_buffer = value; glx.is_direct = glXIsDirect(display, glxcontext); OpenGL::init(); return true; } void term() { OpenGL::term(); if(glxcontext) { glXDestroyContext(display, glxcontext); glxcontext = nullptr; } if(xwindow) { XUnmapWindow(display, xwindow); xwindow = 0; } if(colormap) { XFreeColormap(display, colormap); colormap = 0; } } pVideoGLX() { display = XOpenDisplay(0); screen = DefaultScreen(display); settings.handle = 0; settings.synchronize = false; settings.depth = 24; settings.filter = 1; //linear xwindow = 0; colormap = 0; glxcontext = nullptr; glxwindow = 0; } ~pVideoGLX() { term(); XCloseDisplay(display); } }; DeclareVideo(GLX) }; sfc/chip/superfx/serialization.cpp000664 001750 001750 00000000462 12651764221 020465 0ustar00sergiosergio000000 000000 #ifdef SUPERFX_CPP void SuperFX::serialize(serializer& s) { GSU::serialize(s); Thread::serialize(s); s.array(ram.data(), ram.size()); s.integer(clockmode); s.integer(instruction_counter); s.integer(cache_access_speed); s.integer(memory_access_speed); s.integer(r15_modified); } #endif sfc/ppu/window/window.cpp000664 001750 001750 00000011237 12651764221 016615 0ustar00sergiosergio000000 000000 #ifdef PPU_CPP void PPU::Window::scanline() { x = 0; } void PPU::Window::run() { bool main, sub; one = (x >= regs.one_left && x <= regs.one_right); two = (x >= regs.two_left && x <= regs.two_right); x++; test( main, sub, regs.bg1_one_enable, regs.bg1_one_invert, regs.bg1_two_enable, regs.bg1_two_invert, regs.bg1_mask, regs.bg1_main_enable, regs.bg1_sub_enable ); if(main) self.bg1.output.main.priority = 0; if(sub) self.bg1.output.sub.priority = 0; test( main, sub, regs.bg2_one_enable, regs.bg2_one_invert, regs.bg2_two_enable, regs.bg2_two_invert, regs.bg2_mask, regs.bg2_main_enable, regs.bg2_sub_enable ); if(main) self.bg2.output.main.priority = 0; if(sub) self.bg2.output.sub.priority = 0; test( main, sub, regs.bg3_one_enable, regs.bg3_one_invert, regs.bg3_two_enable, regs.bg3_two_invert, regs.bg3_mask, regs.bg3_main_enable, regs.bg3_sub_enable ); if(main) self.bg3.output.main.priority = 0; if(sub) self.bg3.output.sub.priority = 0; test( main, sub, regs.bg4_one_enable, regs.bg4_one_invert, regs.bg4_two_enable, regs.bg4_two_invert, regs.bg4_mask, regs.bg4_main_enable, regs.bg4_sub_enable ); if(main) self.bg4.output.main.priority = 0; if(sub) self.bg4.output.sub.priority = 0; test( main, sub, regs.oam_one_enable, regs.oam_one_invert, regs.oam_two_enable, regs.oam_two_invert, regs.oam_mask, regs.oam_main_enable, regs.oam_sub_enable ); if(main) self.sprite.output.main.priority = 0; if(sub) self.sprite.output.sub.priority = 0; test( main, sub, regs.col_one_enable, regs.col_one_invert, regs.col_two_enable, regs.col_two_invert, regs.col_mask, true, true ); switch(regs.col_main_mask) { case 0: main = true; break; case 1: break; case 2: main = !main; break; case 3: main = false; break; } switch(regs.col_sub_mask) { case 0: sub = true; break; case 1: break; case 2: sub = !sub; break; case 3: sub = false; break; } output.main.color_enable = main; output.sub.color_enable = sub; } void PPU::Window::test( bool& main, bool& sub, bool one_enable, bool one_invert, bool two_enable, bool two_invert, uint8 mask, bool main_enable, bool sub_enable ) { bool one = Window::one ^ one_invert; bool two = Window::two ^ two_invert; bool output; if(one_enable == false && two_enable == false) { output = false; } else if(one_enable == true && two_enable == false) { output = one; } else if(one_enable == false && two_enable == true) { output = two; } else { switch(mask) { case 0: output = (one | two) == 1; break; case 1: output = (one & two) == 1; break; case 2: output = (one ^ two) == 1; break; case 3: output = (one ^ two) == 0; break; } } main = main_enable ? output : false; sub = sub_enable ? output : false; } void PPU::Window::reset() { regs.bg1_one_enable = random(false); regs.bg1_one_invert = random(false); regs.bg1_two_enable = random(false); regs.bg1_two_invert = random(false); regs.bg2_one_enable = random(false); regs.bg2_one_invert = random(false); regs.bg2_two_enable = random(false); regs.bg2_two_invert = random(false); regs.bg3_one_enable = random(false); regs.bg3_one_invert = random(false); regs.bg3_two_enable = random(false); regs.bg3_two_invert = random(false); regs.bg4_one_enable = random(false); regs.bg4_one_invert = random(false); regs.bg4_two_enable = random(false); regs.bg4_two_invert = random(false); regs.oam_one_enable = random(false); regs.oam_one_invert = random(false); regs.oam_two_enable = random(false); regs.oam_two_invert = random(false); regs.col_one_enable = random(false); regs.col_one_invert = random(false); regs.col_two_enable = random(false); regs.col_two_invert = random(false); regs.one_left = random(0x00); regs.one_right = random(0x00); regs.two_left = random(0x00); regs.two_right = random(0x00); regs.bg1_mask = random(0); regs.bg2_mask = random(0); regs.bg3_mask = random(0); regs.bg4_mask = random(0); regs.oam_mask = random(0); regs.col_mask = random(0); regs.bg1_main_enable = random(false); regs.bg1_sub_enable = random(false); regs.bg2_main_enable = random(false); regs.bg2_sub_enable = random(false); regs.bg3_main_enable = random(false); regs.bg3_sub_enable = random(false); regs.bg4_main_enable = random(false); regs.bg4_sub_enable = random(false); regs.oam_main_enable = random(false); regs.oam_sub_enable = random(false); regs.col_main_mask = random(0); regs.col_sub_mask = random(0); output.main.color_enable = 0; output.sub.color_enable = 0; x = 0; one = 0; two = 0; } PPU::Window::Window(PPU& self) : self(self) { } #endif phoenix/cocoa/desktop.hpp000664 001750 001750 00000000142 12651764221 016625 0ustar00sergiosergio000000 000000 namespace phoenix { struct pDesktop { static Size size(); static Geometry workspace(); }; } ananke/bsx-satellaview.cpp000664 001750 001750 00000004402 12651764221 016763 0ustar00sergiosergio000000 000000 string Ananke::createBsxSatellaviewDatabase(vector &buffer, Markup::Node &document, const string &manifest) { string pathname = { libraryPath, "BS-X Satellaview/", document["release/information/name"].text(), " (", document["release/information/region"].text(), ")", " (", document["release/information/revision"].text(), ")", ".bs/" }; directory::create(pathname); //strip "release" root node from database entry (since a single game manifest isn't part of a database) string markup = manifest; markup.replace("\n ", "\n"); markup.replace("information", "\ninformation"); markup.ltrim<1>("release\n"); file::write({pathname, "manifest.bml"}, markup); file::write({pathname, "program.rom"}, buffer); return pathname; } string Ananke::createBsxSatellaviewHeuristic(vector &buffer) { string pathname = { libraryPath, "BS-X Satellaview/", nall::basename(information.name), ".bs/" }; directory::create(pathname); file::write({pathname, "manifest.bml"}, { "unverified\n", "\n", "cartridge\n", " rom name=program.rom size=0x", hex(buffer.size()), " type=FlashROM\n", "\n", "information\n", " title: ", nall::basename(information.name), "\n" }); file::write({pathname, "program.rom"}, buffer); return pathname; } string Ananke::openBsxSatellaview(vector &buffer) { string sha256 = nall::sha256(buffer.data(), buffer.size()); string databaseText = string::read({configpath(), "ananke/database/BS-X Satellaview.bml"}).strip(); if(databaseText.empty()) databaseText = string{Database::BsxSatellaview}.strip(); lstring databaseItem = databaseText.split("\n\n"); for(auto &item : databaseItem) { item.append("\n"); auto document = Markup::Document(item); if(document["release/information/sha256"].text() == sha256) { return createBsxSatellaviewDatabase(buffer, document, item); } } return createBsxSatellaviewHeuristic(buffer); } string Ananke::syncBsxSatellaview(const string &pathname) { auto buffer = file::read({pathname, "program.rom"}); if(buffer.size() == 0) return ""; directory::remove(pathname); information.path = pathname; information.name = notdir(string{pathname}.rtrim<1>("/")); return openBsxSatellaview(buffer); } ruby/Makefile000664 001750 001750 00000002714 12651764221 014335 0ustar00sergiosergio000000 000000 ifeq ($(platform),macosx) rubyflags = $(objcppflags) $(flags) else rubyflags = $(cppflags) $(flags) endif rubyflags += $(foreach c,$(subst .,_,$(call strupper,$(ruby))),-D$c) rubyflags += $(if $(findstring .sdl,$(ruby)),`sdl-config --cflags`) rubylink = rubylink += $(if $(findstring video.cgl,$(ruby)),-framework OpenGL) rubylink += $(if $(findstring video.direct3d,$(ruby)),-ld3d9) rubylink += $(if $(findstring video.directdraw,$(ruby)),-lddraw) rubylink += $(if $(findstring video.glx,$(ruby)),-lGL) rubylink += $(if $(findstring video.wgl,$(ruby)),-lopengl32) rubylink += $(if $(findstring video.xv,$(ruby)),-lXv) rubylink += $(if $(findstring audio.alsa,$(ruby)),-lasound) rubylink += $(if $(findstring audio.ao,$(ruby)),-lao) rubylink += $(if $(findstring audio.directsound,$(ruby)),-ldsound) rubylink += $(if $(findstring audio.pulseaudio,$(ruby)),-lpulse) rubylink += $(if $(findstring audio.pulseaudiosimple,$(ruby)),-lpulse-simple) rubylink += $(if $(findstring audio.xaudio2,$(ruby)),-lole32) rubylink += $(if $(findstring input.udev,$(ruby)),-ludev) rubylink += $(if $(findstring input.windows,$(ruby)),-ldinput8 -ldxguid) rubylink += $(if $(findstring .sdl,$(ruby)),`sdl-config --libs`) ifeq ($(platform),windows) rubylink += $(if $(findstring audio.openal,$(ruby)),-lopenal32) else ifeq ($(platform),macosx) rubylink += $(if $(findstring audio.openal,$(ruby)),-framework OpenAL) else rubylink += $(if $(findstring audio.openal,$(ruby)),-lopenal) endif gb/cartridge/mbc5/mbc5.hpp000664 001750 001750 00000000360 12651764221 016430 0ustar00sergiosergio000000 000000 struct MBC5 : MMIO { bool ram_enable; //$0000-1fff uint16 rom_select; //$2000-2fff + $3000-3fff uint8 ram_select; //$4000-5fff uint8 mmio_read(uint16 addr); void mmio_write(uint16 addr, uint8 data); void power(); } mbc5; profile/Super Famicom.sys/000700 001750 001750 00000000000 12656700342 016602 5ustar00sergiosergio000000 000000 phoenix/gtk/widget/widget.cpp000664 001750 001750 00000002777 12651764221 017436 0ustar00sergiosergio000000 000000 namespace phoenix { GtkWidget* pWidget::container(Widget& widget) { return nullptr; } bool pWidget::focused() { return GTK_WIDGET_HAS_FOCUS(gtkWidget); } Size pWidget::minimumSize() { return {0, 0}; } void pWidget::setEnabled(bool enabled) { if(!widget.parent()) enabled = false; if(widget.state.abstract) enabled = false; if(!widget.enabledToAll()) enabled = false; gtk_widget_set_sensitive(gtkWidget, enabled); } void pWidget::setFocused() { gtk_widget_grab_focus(gtkWidget); } void pWidget::setFont(string font) { pFont::setFont(gtkWidget, font); } void pWidget::setGeometry(Geometry geometry) { Position displacement = GetDisplacement(&widget); geometry.x -= displacement.x; geometry.y -= displacement.y; if(gtkParent) gtk_fixed_move(GTK_FIXED(gtkParent), gtkWidget, geometry.x, geometry.y); unsigned width = (signed)geometry.width <= 0 ? 1u : geometry.width; unsigned height = (signed)geometry.height <= 0 ? 1u : geometry.height; gtk_widget_set_size_request(gtkWidget, width, height); if(widget.onSize) widget.onSize(); } void pWidget::setVisible(bool visible) { if(!widget.parent()) visible = false; if(widget.state.abstract) visible = false; if(!widget.visibleToAll()) visible = false; gtk_widget_set_visible(gtkWidget, visible); } void pWidget::constructor() { if(widget.state.abstract) gtkWidget = gtk_fixed_new(); } void pWidget::destructor() { if(widget.state.abstract) gtk_widget_destroy(gtkWidget); } void pWidget::orphan() { destructor(); constructor(); } } processor/Makefile000664 001750 001750 00000002644 12651764221 015375 0ustar00sergiosergio000000 000000 processor_objects := processor_objects += $(if $(findstring arm,$(processors)),processor-arm) processor_objects += $(if $(findstring gsu,$(processors)),processor-gsu) processor_objects += $(if $(findstring hg51b,$(processors)),processor-hg51b) processor_objects += $(if $(findstring lr35902,$(processors)),processor-lr35902) processor_objects += $(if $(findstring r6502,$(processors)),processor-r6502) processor_objects += $(if $(findstring r65816,$(processors)),processor-r65816) processor_objects += $(if $(findstring spc700,$(processors)),processor-spc700) processor_objects += $(if $(findstring upd96050,$(processors)),processor-upd96050) objects += $(processor_objects) processor := processor obj/processor-arm.o: $(processor)/arm/arm.cpp $(call rwildcard,$(processor)/arm) obj/processor-gsu.o: $(processor)/gsu/gsu.cpp $(call rwildcard,$(processor)/gsu) obj/processor-hg51b.o: $(processor)/hg51b/hg51b.cpp $(call rwildcard,$(processor)/hg51b) obj/processor-lr35902.o: $(processor)/lr35902/lr35902.cpp $(call rwildcard,$(processor)/lr35902) obj/processor-r6502.o: $(processor)/r6502/r6502.cpp $(call rwildcard,$(processor)/r6502) obj/processor-r65816.o: $(processor)/r65816/r65816.cpp $(call rwildcard,$(processor)/r65816) obj/processor-spc700.o: $(processor)/spc700/spc700.cpp $(call rwildcard,$(processor)/spc700) obj/processor-upd96050.o: $(processor)/upd96050/upd96050.cpp $(call rwildcard,$(processor)/upd96050) nall/string/eval/literal.hpp000664 001750 001750 00000005065 12651764221 017246 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { namespace Eval { inline bool isLiteral(const char*& s) { char n = s[0]; return (n >= 'A' && n <= 'Z') || (n >= 'a' && n <= 'z') || (n >= '0' && n <= '9') || (n == '%' || n == '$' || n == '_' || n == '.') || (n == '\'' || n == '\"'); } inline string literalNumber(const char*& s) { const char* p = s; //binary if(p[0] == '%' || (p[0] == '0' && p[1] == 'b')) { unsigned prefix = 1 + (p[0] == '0'); p += prefix; while(p[0] == '\'' || p[0] == '0' || p[0] == '1') p++; if(p - s <= prefix) throw "invalid binary literal"; string result = substr(s, 0, p - s); s = p; return result; } //octal if(p[0] == '0' && p[1] == 'o') { unsigned prefix = 1 + (p[0] == '0'); p += prefix; while(p[0] == '\'' || (p[0] >= '0' && p[0] <= '7')) p++; if(p - s <= prefix) throw "invalid octal literal"; string result = substr(s, 0, p - s); s = p; return result; } //hex if(p[0] == '$' || (p[0] == '0' && p[1] == 'x')) { unsigned prefix = 1 + (p[0] == '0'); p += prefix; while(p[0] == '\'' || (p[0] >= '0' && p[0] <= '9') || (p[0] >= 'A' && p[0] <= 'F') || (p[0] >= 'a' && p[0] <= 'f')) p++; if(p - s <= prefix) throw "invalid hex literal"; string result = substr(s, 0, p - s); s = p; return result; } //decimal while(p[0] == '\'' || (p[0] >= '0' && p[0] <= '9')) p++; if(p[0] != '.') { string result = substr(s, 0, p - s); s = p; return result; } //floating-point p++; while(p[0] == '\'' || (p[0] >= '0' && p[0] <= '9')) p++; string result = substr(s, 0, p - s); s = p; return result; } inline string literalString(const char*& s) { const char* p = s; char escape = *p++; while(p[0] && p[0] != escape) p++; if(*p++ != escape) throw "unclosed string literal"; string result = substr(s, 0, p - s); s = p; return result; } inline string literalVariable(const char*& s) { const char* p = s; while(p[0] == '_' || p[0] == '.' || (p[0] >= 'A' && p[0] <= 'Z') || (p[0] >= 'a' && p[0] <= 'z') || (p[0] >= '0' && p[0] <= '9')) p++; string result = substr(s, 0, p - s); s = p; return result; } inline string literal(const char*& s) { const char* p = s; if(p[0] >= '0' && p[0] <= '9') return literalNumber(s); if(p[0] == '%' || p[0] == '$') return literalNumber(s); if(p[0] == '\'' || p[0] == '\"') return literalString(s); if(p[0] == '_' || p[0] == '.' || (p[0] >= 'A' && p[0] <= 'Z') || (p[0] >= 'a' && p[0] <= 'z')) return literalVariable(s); throw "invalid literal"; } } } #endif nall/png.hpp000664 001750 001750 00000022103 12651764221 014131 0ustar00sergiosergio000000 000000 #ifndef NALL_PNG_HPP #define NALL_PNG_HPP //PNG image decoder //author: byuu #include #include namespace nall { struct png { struct Info { unsigned width; unsigned height; unsigned bitDepth; //colorType: //0 = L (luma) //2 = R,G,B //3 = P (palette) //4 = L,A //6 = R,G,B,A unsigned colorType; unsigned compressionMethod; unsigned filterType; unsigned interlaceMethod; unsigned bytesPerPixel; unsigned pitch; uint8_t palette[256][3]; } info; uint8_t* data = nullptr; unsigned size = 0; inline bool decode(const string& filename); inline bool decode(const uint8_t* sourceData, unsigned sourceSize); inline unsigned readbits(const uint8_t*& data); unsigned bitpos = 0; inline png(); inline ~png(); protected: enum class FourCC : unsigned { IHDR = 0x49484452, PLTE = 0x504c5445, IDAT = 0x49444154, IEND = 0x49454e44, }; inline unsigned interlace(unsigned pass, unsigned index); inline unsigned inflateSize(); inline bool deinterlace(const uint8_t*& inputData, unsigned pass); inline bool filter(uint8_t* outputData, const uint8_t* inputData, unsigned width, unsigned height); inline unsigned read(const uint8_t* data, unsigned length); }; bool png::decode(const string& filename) { if(auto memory = file::read(filename)) { return decode(memory.data(), memory.size()); } return false; } bool png::decode(const uint8_t* sourceData, unsigned sourceSize) { if(sourceSize < 8) return false; if(read(sourceData + 0, 4) != 0x89504e47) return false; if(read(sourceData + 4, 4) != 0x0d0a1a0a) return false; uint8_t* compressedData = nullptr; unsigned compressedSize = 0; unsigned offset = 8; while(offset < sourceSize) { unsigned length = read(sourceData + offset + 0, 4); unsigned fourCC = read(sourceData + offset + 4, 4); unsigned checksum = read(sourceData + offset + 8 + length, 4); if(fourCC == (unsigned)FourCC::IHDR) { info.width = read(sourceData + offset + 8, 4); info.height = read(sourceData + offset + 12, 4); info.bitDepth = read(sourceData + offset + 16, 1); info.colorType = read(sourceData + offset + 17, 1); info.compressionMethod = read(sourceData + offset + 18, 1); info.filterType = read(sourceData + offset + 19, 1); info.interlaceMethod = read(sourceData + offset + 20, 1); if(info.bitDepth == 0 || info.bitDepth > 16) return false; if(info.bitDepth & (info.bitDepth - 1)) return false; //not a power of two if(info.compressionMethod != 0) return false; if(info.filterType != 0) return false; if(info.interlaceMethod != 0 && info.interlaceMethod != 1) return false; switch(info.colorType) { case 0: info.bytesPerPixel = info.bitDepth * 1; break; //L case 2: info.bytesPerPixel = info.bitDepth * 3; break; //R,G,B case 3: info.bytesPerPixel = info.bitDepth * 1; break; //P case 4: info.bytesPerPixel = info.bitDepth * 2; break; //L,A case 6: info.bytesPerPixel = info.bitDepth * 4; break; //R,G,B,A default: return false; } if(info.colorType == 2 || info.colorType == 4 || info.colorType == 6) { if(info.bitDepth != 8 && info.bitDepth != 16) return false; } if(info.colorType == 3 && info.bitDepth == 16) return false; info.bytesPerPixel = (info.bytesPerPixel + 7) / 8; info.pitch = (int)info.width * info.bytesPerPixel; } if(fourCC == (unsigned)FourCC::PLTE) { if(length % 3) return false; for(unsigned n = 0, p = offset + 8; n < length / 3; n++) { info.palette[n][0] = sourceData[p++]; info.palette[n][1] = sourceData[p++]; info.palette[n][2] = sourceData[p++]; } } if(fourCC == (unsigned)FourCC::IDAT) { compressedData = (uint8_t*)realloc(compressedData, compressedSize + length); memcpy(compressedData + compressedSize, sourceData + offset + 8, length); compressedSize += length; } if(fourCC == (unsigned)FourCC::IEND) { break; } offset += 4 + 4 + length + 4; } unsigned interlacedSize = inflateSize(); uint8_t *interlacedData = new uint8_t[interlacedSize]; bool result = inflate(interlacedData, interlacedSize, compressedData + 2, compressedSize - 6); free(compressedData); if(result == false) { delete[] interlacedData; return false; } size = info.width * info.height * info.bytesPerPixel; data = new uint8_t[size]; if(info.interlaceMethod == 0) { if(filter(data, interlacedData, info.width, info.height) == false) { delete[] interlacedData; delete[] data; data = nullptr; return false; } } else { const uint8_t *passData = interlacedData; for(unsigned pass = 0; pass < 7; pass++) { if(deinterlace(passData, pass) == false) { delete[] interlacedData; delete[] data; data = nullptr; return false; } } } delete[] interlacedData; return true; } unsigned png::interlace(unsigned pass, unsigned index) { static const unsigned data[7][4] = { //x-distance, y-distance, x-origin, y-origin {8, 8, 0, 0}, {8, 8, 4, 0}, {4, 8, 0, 4}, {4, 4, 2, 0}, {2, 4, 0, 2}, {2, 2, 1, 0}, {1, 2, 0, 1}, }; return data[pass][index]; } unsigned png::inflateSize() { if(info.interlaceMethod == 0) { return info.width * info.height * info.bytesPerPixel + info.height; } unsigned size = 0; for(unsigned pass = 0; pass < 7; pass++) { unsigned xd = interlace(pass, 0), yd = interlace(pass, 1); unsigned xo = interlace(pass, 2), yo = interlace(pass, 3); unsigned width = (info.width + (xd - xo - 1)) / xd; unsigned height = (info.height + (yd - yo - 1)) / yd; if(width == 0 || height == 0) continue; size += width * height * info.bytesPerPixel + height; } return size; } bool png::deinterlace(const uint8_t*& inputData, unsigned pass) { unsigned xd = interlace(pass, 0), yd = interlace(pass, 1); unsigned xo = interlace(pass, 2), yo = interlace(pass, 3); unsigned width = (info.width + (xd - xo - 1)) / xd; unsigned height = (info.height + (yd - yo - 1)) / yd; if(width == 0 || height == 0) return true; unsigned outputSize = width * height * info.bytesPerPixel; uint8_t* outputData = new uint8_t[outputSize]; bool result = filter(outputData, inputData, width, height); const uint8_t* rd = outputData; for(unsigned y = yo; y < info.height; y += yd) { uint8_t* wr = data + y * info.pitch; for(unsigned x = xo; x < info.width; x += xd) { for(unsigned b = 0; b < info.bytesPerPixel; b++) { wr[x * info.bytesPerPixel + b] = *rd++; } } } inputData += outputSize + height; delete[] outputData; return result; } bool png::filter(uint8_t* outputData, const uint8_t* inputData, unsigned width, unsigned height) { uint8_t* wr = outputData; const uint8_t* rd = inputData; int bpp = info.bytesPerPixel, pitch = width * bpp; for(int y = 0; y < height; y++) { uint8_t filter = *rd++; switch(filter) { case 0x00: //None for(int x = 0; x < pitch; x++) { wr[x] = rd[x]; } break; case 0x01: //Subtract for(int x = 0; x < pitch; x++) { wr[x] = rd[x] + (x - bpp < 0 ? 0 : wr[x - bpp]); } break; case 0x02: //Above for(int x = 0; x < pitch; x++) { wr[x] = rd[x] + (y - 1 < 0 ? 0 : wr[x - pitch]); } break; case 0x03: //Average for(int x = 0; x < pitch; x++) { short a = x - bpp < 0 ? 0 : wr[x - bpp]; short b = y - 1 < 0 ? 0 : wr[x - pitch]; wr[x] = rd[x] + (uint8_t)((a + b) / 2); } break; case 0x04: //Paeth for(int x = 0; x < pitch; x++) { short a = x - bpp < 0 ? 0 : wr[x - bpp]; short b = y - 1 < 0 ? 0 : wr[x - pitch]; short c = x - bpp < 0 || y - 1 < 0 ? 0 : wr[x - pitch - bpp]; short p = a + b - c; short pa = p > a ? p - a : a - p; short pb = p > b ? p - b : b - p; short pc = p > c ? p - c : c - p; uint8_t paeth = (uint8_t)((pa <= pb && pa <= pc) ? a : (pb <= pc) ? b : c); wr[x] = rd[x] + paeth; } break; default: //Invalid return false; } rd += pitch; wr += pitch; } return true; } unsigned png::read(const uint8_t* data, unsigned length) { unsigned result = 0; while(length--) result = (result << 8) | (*data++); return result; } unsigned png::readbits(const uint8_t*& data) { unsigned result = 0; switch(info.bitDepth) { case 1: result = (*data >> bitpos) & 1; bitpos++; if(bitpos == 8) { data++; bitpos = 0; } break; case 2: result = (*data >> bitpos) & 3; bitpos += 2; if(bitpos == 8) { data++; bitpos = 0; } break; case 4: result = (*data >> bitpos) & 15; bitpos += 4; if(bitpos == 8) { data++; bitpos = 0; } break; case 8: result = *data++; break; case 16: result = (data[0] << 8) | (data[1] << 0); data += 2; break; } return result; } png::png() { } png::~png() { if(data) delete[] data; } } #endif gba/cpu/registers.hpp000664 001750 001750 00000007110 12651764221 015747 0ustar00sergiosergio000000 000000 struct Registers { struct DMAControl { uint2 targetmode; uint2 sourcemode; uint1 repeat; uint1 size; uint1 drq; uint2 timingmode; uint1 irq; uint1 enable; operator uint16() const; uint16 operator=(uint16 source); DMAControl& operator=(const DMAControl&) = delete; }; struct DMA { varuint source; varuint target; varuint length; DMAControl control; //internal bool pending; struct Run { varuint target; varuint source; varuint length; } run; } dma[4]; struct TimerControl { uint2 frequency; uint1 cascade; uint1 irq; uint1 enable; operator uint16() const; uint16 operator=(uint16 source); TimerControl& operator=(const TimerControl&) = delete; }; struct Timer { uint16 period; uint16 reload; TimerControl control; } timer[4]; struct SerialControl { uint1 shiftclockselect; uint1 shiftclockfrequency; uint1 transferenablereceive; uint1 transferenablesend; uint1 startbit; uint1 transferlength; uint1 irqenable; operator uint16() const; uint16 operator=(uint16 source); SerialControl& operator=(const SerialControl&) = delete; }; struct Serial { uint16 data[4]; SerialControl control; uint8 data8; } serial; struct KeypadControl { uint1 flag[10]; uint1 enable; uint1 condition; operator uint16() const; uint16 operator=(uint16 source); KeypadControl& operator=(const KeypadControl&) = delete; }; struct Keypad { KeypadControl control; } keypad; struct JoybusSettings { uint1 sc; uint1 sd; uint1 si; uint1 so; uint1 scmode; uint1 sdmode; uint1 simode; uint1 somode; uint1 irqenable; uint2 mode; operator uint16() const; uint16 operator=(uint16 source); JoybusSettings& operator=(const JoybusSettings&) = delete; }; struct JoybusControl { uint1 resetsignal; uint1 receivecomplete; uint1 sendcomplete; uint1 irqenable; operator uint16() const; uint16 operator=(uint16 source); JoybusControl& operator=(const JoybusControl&) = delete; }; struct JoybusStatus { uint1 receiveflag; uint1 sendflag; uint2 generalflag; operator uint16() const; uint16 operator=(uint16 source); JoybusStatus& operator=(const JoybusStatus&) = delete; }; struct Joybus { JoybusSettings settings; JoybusControl control; uint32 receive; uint32 transmit; JoybusStatus status; } joybus; uint1 ime; struct Interrupt { uint1 vblank; uint1 hblank; uint1 vcoincidence; uint1 timer[4]; uint1 serial; uint1 dma[4]; uint1 keypad; uint1 cartridge; operator uint16() const; uint16 operator=(uint16 source); Interrupt& operator=(const Interrupt&) = delete; }; struct IRQ { Interrupt enable; Interrupt flag; } irq; struct WaitControl { uint2 nwait[4]; uint2 swait[4]; uint2 phi; uint1 prefetch; uint1 gametype; operator uint16() const; uint16 operator=(uint16 source); WaitControl& operator=(const WaitControl&) = delete; }; struct Wait { WaitControl control; } wait; struct MemoryControl { uint1 disable; uint3 unknown1; uint1 ewram; uint4 ewramwait; uint4 unknown2; operator uint32() const; uint32 operator=(uint32 source); MemoryControl& operator=(const MemoryControl&) = delete; }; struct Memory { MemoryControl control; } memory; uint1 postboot; enum class Mode : unsigned { Normal, Halt, Stop } mode; unsigned clock; } regs; nall/xorg/guard.hpp000664 001750 001750 00000001025 12651764221 015426 0ustar00sergiosergio000000 000000 #ifndef NALL_XORG_GUARD_HPP #define NALL_XORG_GUARD_HPP #define None #undef XlibNone #define XlibNone 0L #define Bool XlibBool #define Button1 XlibButton1 #define Button2 XlibButton2 #define Button3 XlibButton3 #define Button4 XlibButton4 #define Button5 XlibButton5 #define Display XlibDisplay #define Screen XlibScreen #define Window XlibWindow #else #undef NALL_XORG_GUARD_HPP #undef None #undef Bool #undef Button1 #undef Button2 #undef Button3 #undef Button4 #undef Button5 #undef Display #undef Screen #undef Window #endif fc/cartridge/chip/vrc6.cpp000664 001750 001750 00000014576 12651764221 016570 0ustar00sergiosergio000000 000000 struct VRC6 : Chip { uint8 prg_bank[2]; uint8 chr_bank[8]; uint2 mirror; uint8 irq_latch; bool irq_mode; bool irq_enable; bool irq_acknowledge; uint8 irq_counter; signed irq_scalar; bool irq_line; struct Pulse { bool mode; uint3 duty; uint4 volume; bool enable; uint12 frequency; uint12 divider; uint4 cycle; uint4 output; void clock() { if(--divider == 0) { divider = frequency + 1; cycle++; output = (mode == 1 || cycle > duty) ? volume : (uint4)0; } if(enable == false) output = 0; } void serialize(serializer& s) { s.integer(mode); s.integer(duty); s.integer(volume); s.integer(enable); s.integer(frequency); s.integer(divider); s.integer(cycle); s.integer(output); } } pulse1, pulse2; struct Sawtooth { uint6 rate; bool enable; uint12 frequency; uint12 divider; uint1 phase; uint3 stage; uint8 accumulator; uint5 output; void clock() { if(--divider == 0) { divider = frequency + 1; if(++phase == 0) { accumulator += rate; if(++stage == 7) { stage = 0; accumulator = 0; } } } output = accumulator >> 3; if(enable == false) output = 0; } void serialize(serializer& s) { s.integer(rate); s.integer(enable); s.integer(frequency); s.integer(divider); s.integer(phase); s.integer(stage); s.integer(accumulator); s.integer(output); } } sawtooth; void main() { while(true) { if(scheduler.sync == Scheduler::SynchronizeMode::All) { scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(irq_enable) { if(irq_mode == 0) { irq_scalar -= 3; if(irq_scalar <= 0) { irq_scalar += 341; if(irq_counter == 0xff) { irq_counter = irq_latch; irq_line = 1; } else { irq_counter++; } } } if(irq_mode == 1) { if(irq_counter == 0xff) { irq_counter = irq_latch; irq_line = 1; } else { irq_counter++; } } } cpu.set_irq_line(irq_line); pulse1.clock(); pulse2.clock(); sawtooth.clock(); signed output = (pulse1.output + pulse2.output + sawtooth.output) << 7; apu.set_sample(-output); tick(); } } unsigned prg_addr(unsigned addr) const { if((addr & 0xc000) == 0x8000) return (prg_bank[0] << 14) | (addr & 0x3fff); if((addr & 0xe000) == 0xc000) return (prg_bank[1] << 13) | (addr & 0x1fff); if((addr & 0xe000) == 0xe000) return ( 0xff << 13) | (addr & 0x1fff); } unsigned chr_addr(unsigned addr) const { unsigned bank = chr_bank[(addr >> 10) & 7]; return (bank << 10) | (addr & 0x03ff); } unsigned ciram_addr(unsigned addr) const { switch(mirror) { case 0: return ((addr & 0x0400) >> 0) | (addr & 0x03ff); //vertical mirroring case 1: return ((addr & 0x0800) >> 1) | (addr & 0x03ff); //horizontal mirroring case 2: return 0x0000 | (addr & 0x03ff); //one-screen mirroring (first) case 3: return 0x0400 | (addr & 0x03ff); //one-screen mirroring (second) } } uint8 ram_read(unsigned addr) { return board.prgram.data[addr & 0x1fff]; } void ram_write(unsigned addr, uint8 data) { board.prgram.data[addr & 0x1fff] = data; } void reg_write(unsigned addr, uint8 data) { switch(addr) { case 0x8000: case 0x8001: case 0x8002: case 0x8003: prg_bank[0] = data; break; case 0x9000: pulse1.mode = data & 0x80; pulse1.duty = (data & 0x70) >> 4; pulse1.volume = data & 0x0f; break; case 0x9001: pulse1.frequency = (pulse1.frequency & 0x0f00) | ((data & 0xff) << 0); break; case 0x9002: pulse1.frequency = (pulse1.frequency & 0x00ff) | ((data & 0x0f) << 8); pulse1.enable = data & 0x80; break; case 0xa000: pulse2.mode = data & 0x80; pulse2.duty = (data & 0x70) >> 4; pulse2.volume = data & 0x0f; break; case 0xa001: pulse2.frequency = (pulse2.frequency & 0x0f00) | ((data & 0xff) << 0); break; case 0xa002: pulse2.frequency = (pulse2.frequency & 0x00ff) | ((data & 0x0f) << 8); pulse2.enable = data & 0x80; break; case 0xb000: sawtooth.rate = data & 0x3f; break; case 0xb001: sawtooth.frequency = (sawtooth.frequency & 0x0f00) | ((data & 0xff) << 0); break; case 0xb002: sawtooth.frequency = (sawtooth.frequency & 0x00ff) | ((data & 0x0f) << 8); sawtooth.enable = data & 0x80; break; case 0xb003: mirror = (data >> 2) & 3; break; case 0xc000: case 0xc001: case 0xc002: case 0xc003: prg_bank[1] = data; break; case 0xd000: case 0xd001: case 0xd002: case 0xd003: chr_bank[0 + (addr & 3)] = data; break; case 0xe000: case 0xe001: case 0xe002: case 0xe003: chr_bank[4 + (addr & 3)] = data; break; case 0xf000: irq_latch = data; break; case 0xf001: irq_mode = data & 0x04; irq_enable = data & 0x02; irq_acknowledge = data & 0x01; if(irq_enable) { irq_counter = irq_latch; irq_scalar = 341; } irq_line = 0; break; case 0xf002: irq_enable = irq_acknowledge; irq_line = 0; break; } } void power() { } void reset() { prg_bank[0] = 0; prg_bank[1] = 0; chr_bank[0] = 0; chr_bank[1] = 0; chr_bank[2] = 0; chr_bank[3] = 0; chr_bank[4] = 0; chr_bank[5] = 0; chr_bank[6] = 0; chr_bank[7] = 0; mirror = 0; irq_latch = 0; irq_mode = 0; irq_enable = 0; irq_acknowledge = 0; irq_counter = 0; irq_scalar = 0; irq_line = 0; pulse1.mode = 0; pulse1.duty = 0; pulse1.volume = 0; pulse1.enable = 0; pulse1.frequency = 0; pulse1.divider = 1; pulse1.cycle = 0; pulse1.output = 0; pulse2.mode = 0; pulse2.duty = 0; pulse2.volume = 0; pulse2.enable = 0; pulse2.frequency = 0; pulse2.divider = 1; pulse2.cycle = 0; pulse2.output = 0; sawtooth.rate = 0; sawtooth.enable = 0; sawtooth.frequency = 0; sawtooth.divider = 1; sawtooth.phase = 0; sawtooth.stage = 0; sawtooth.accumulator = 0; sawtooth.output = 0; } void serialize(serializer& s) { pulse1.serialize(s); pulse2.serialize(s); sawtooth.serialize(s); s.array(prg_bank); s.array(chr_bank); s.integer(mirror); s.integer(irq_latch); s.integer(irq_mode); s.integer(irq_enable); s.integer(irq_acknowledge); s.integer(irq_counter); s.integer(irq_scalar); s.integer(irq_line); } VRC6(Board& board) : Chip(board) { } }; sfc/alt/ppu-performance/screen/000700 001750 001750 00000000000 12656700342 017610 5ustar00sergiosergio000000 000000 phoenix/qt/window.cpp000664 001750 001750 00000024120 12651764221 016020 0ustar00sergiosergio000000 000000 namespace phoenix { void pWindow::append(Layout& layout) { Geometry geometry = window.state.geometry; geometry.x = geometry.y = 0; layout.setGeometry(geometry); } void pWindow::append(Menu& menu) { if(window.state.menuFont != "") menu.p.setFont(window.state.menuFont); else menu.p.setFont(Font::sans(8)); qtMenu->addMenu(menu.p.qtMenu); } void pWindow::append(Widget& widget) { if(widget.font().empty() && !window.state.widgetFont.empty()) { widget.setFont(window.state.widgetFont); } if(widget.font().empty()) widget.p.setFont(Font::sans(8)); if(GetParentWidget(&widget)) { widget.p.qtWidget->setParent(GetParentWidget(&widget)->p.container(widget)); } else { widget.p.qtWidget->setParent(qtContainer); } widget.setVisible(widget.visible()); } Geometry pWindow::frameMargin() { unsigned menuHeight = window.state.menuVisible ? settings->geometry.menuHeight : 0; unsigned statusHeight = window.state.statusVisible ? settings->geometry.statusHeight : 0; if(window.state.fullScreen) return {0, menuHeight, 0, menuHeight + statusHeight}; return { settings->geometry.frameX, settings->geometry.frameY + menuHeight, settings->geometry.frameWidth, settings->geometry.frameHeight + menuHeight + statusHeight }; } bool pWindow::focused() { return qtWindow->isActiveWindow() && !qtWindow->isMinimized(); } Geometry pWindow::geometry() { if(window.state.fullScreen) { unsigned menuHeight = window.state.menuVisible ? qtMenu->height() : 0; unsigned statusHeight = window.state.statusVisible ? qtStatus->height() : 0; QRect geometry = qtWindow->geometry(); //frameGeometry() includes frame even though it's not visible in fullscreen mode return {geometry.x(), geometry.y() + menuHeight, geometry.width(), geometry.height() - menuHeight - statusHeight}; } return window.state.geometry; } void pWindow::remove(Layout& layout) { } void pWindow::remove(Menu& menu) { //QMenuBar::removeMenu() does not exist qtMenu->clear(); for(auto& menu : window.state.menu) append(menu); } void pWindow::remove(Widget& widget) { //orphan() destroys and recreates widgets (to disassociate them from their parent); //attempting to create widget again after QApplication::quit() crashes libQtGui if(qtApplication) widget.p.orphan(); } void pWindow::setBackgroundColor(Color color) { QPalette palette; palette.setColor(QPalette::Background, QColor(color.red, color.green, color.blue /*, color.alpha */)); qtContainer->setPalette(palette); qtContainer->setAutoFillBackground(true); //translucency results are very unpleasant without a compositor; so disable for now //qtWindow->setAttribute(Qt::WA_TranslucentBackground, color.alpha != 255); } void pWindow::setDroppable(bool droppable) { qtWindow->setAcceptDrops(droppable); } void pWindow::setFocused() { qtWindow->raise(); qtWindow->activateWindow(); } void pWindow::setFullScreen(bool fullScreen) { if(fullScreen == false) { setResizable(window.state.resizable); qtWindow->showNormal(); qtWindow->adjustSize(); } else { qtLayout->setSizeConstraint(QLayout::SetDefaultConstraint); qtContainer->setFixedSize(Desktop::size().width - frameMargin().width, Desktop::size().height - frameMargin().height); qtWindow->showFullScreen(); } } void pWindow::setGeometry(Geometry geometry) { locked = true; Application::processEvents(); QApplication::syncX(); Geometry margin = frameMargin(); setResizable(window.state.resizable); qtWindow->move(geometry.x - frameMargin().x, geometry.y - frameMargin().y); //qtWindow->adjustSize() fails if larger than 2/3rds screen size qtWindow->resize(qtWindow->sizeHint()); if(window.state.resizable) { //required to allow shrinking window from default size qtWindow->setMinimumSize(1, 1); qtContainer->setMinimumSize(1, 1); } for(auto& layout : window.state.layout) { geometry.x = geometry.y = 0; layout.setGeometry(geometry); } locked = false; } void pWindow::setMenuFont(string font) { qtMenu->setFont(pFont::create(font)); for(auto& item : window.state.menu) item.p.setFont(font); } void pWindow::setMenuVisible(bool visible) { qtMenu->setVisible(visible); setGeometry(window.state.geometry); } void pWindow::setModal(bool modal) { if(modal == true) { //windowModality can only be enabled while window is invisible setVisible(false); qtWindow->setWindowModality(Qt::ApplicationModal); setVisible(true); while(window.state.modal) { Application::processEvents(); usleep(20 * 1000); } qtWindow->setWindowModality(Qt::NonModal); } } void pWindow::setResizable(bool resizable) { if(resizable) { qtLayout->setSizeConstraint(QLayout::SetDefaultConstraint); qtContainer->setMinimumSize(window.state.geometry.width, window.state.geometry.height); } else { qtLayout->setSizeConstraint(QLayout::SetFixedSize); qtContainer->setFixedSize(window.state.geometry.width, window.state.geometry.height); } qtStatus->setSizeGripEnabled(resizable); } void pWindow::setStatusFont(string font) { qtStatus->setFont(pFont::create(font)); } void pWindow::setStatusText(string text) { qtStatus->showMessage(QString::fromUtf8(text), 0); } void pWindow::setStatusVisible(bool visible) { qtStatus->setVisible(visible); setGeometry(window.state.geometry); } void pWindow::setTitle(string text) { qtWindow->setWindowTitle(QString::fromUtf8(text)); } void pWindow::setVisible(bool visible) { locked = true; qtWindow->setVisible(visible); if(visible) { updateFrameGeometry(); setGeometry(window.state.geometry); } locked = false; } void pWindow::setWidgetFont(string font) { } void pWindow::constructor() { qtWindow = new QtWindow(*this); qtWindow->setWindowTitle(" "); //if program was given a name, try and set the window taskbar icon to a matching pixmap image if(applicationState.name.empty() == false) { if(file::exists({"/usr/share/pixmaps/", applicationState.name, ".png"})) { qtWindow->setWindowIcon(QIcon(string{"/usr/share/pixmaps/", applicationState.name, ".png"})); } else if(file::exists({"/usr/local/share/pixmaps/", applicationState.name, ".png"})) { qtWindow->setWindowIcon(QIcon(string{"/usr/local/share/pixmaps/", applicationState.name, ".png"})); } } qtLayout = new QVBoxLayout(qtWindow); qtLayout->setMargin(0); qtLayout->setSpacing(0); qtWindow->setLayout(qtLayout); qtMenu = new QMenuBar(qtWindow); qtMenu->setVisible(false); qtLayout->addWidget(qtMenu); qtContainer = new QWidget(qtWindow); qtContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); qtContainer->setVisible(true); qtLayout->addWidget(qtContainer); qtStatus = new QStatusBar(qtWindow); qtStatus->setSizeGripEnabled(true); qtStatus->setVisible(false); qtLayout->addWidget(qtStatus); setGeometry(window.state.geometry); setMenuFont(Font::sans(8)); setStatusFont(Font::sans(8)); QColor color = qtWindow->palette().color(QPalette::ColorRole::Window); window.state.backgroundColor = Color((uint8_t)color.red(), (uint8_t)color.green(), (uint8_t)color.blue(), (uint8_t)color.alpha()); } void pWindow::destructor() { delete qtStatus; delete qtContainer; delete qtMenu; delete qtLayout; delete qtWindow; } void pWindow::updateFrameGeometry() { pApplication::syncX(); QRect border = qtWindow->frameGeometry(); QRect client = qtWindow->geometry(); settings->geometry.frameX = client.x() - border.x(); settings->geometry.frameY = client.y() - border.y(); settings->geometry.frameWidth = border.width() - client.width(); settings->geometry.frameHeight = border.height() - client.height(); if(window.state.menuVisible) { pApplication::syncX(); settings->geometry.menuHeight = qtMenu->height(); } if(window.state.statusVisible) { pApplication::syncX(); settings->geometry.statusHeight = qtStatus->height(); } settings->save(); } void pWindow::QtWindow::closeEvent(QCloseEvent* event) { event->ignore(); if(self.window.onClose) self.window.onClose(); else self.window.setVisible(false); if(self.window.state.modal && !self.window.visible()) self.window.setModal(false); } void pWindow::QtWindow::moveEvent(QMoveEvent* event) { if(self.locked == false && self.window.state.fullScreen == false && self.qtWindow->isVisible() == true) { self.window.state.geometry.x += event->pos().x() - event->oldPos().x(); self.window.state.geometry.y += event->pos().y() - event->oldPos().y(); } if(self.locked == false) { if(self.window.onMove) self.window.onMove(); } } void pWindow::QtWindow::dragEnterEvent(QDragEnterEvent* event) { if(event->mimeData()->hasUrls()) { event->acceptProposedAction(); } } void pWindow::QtWindow::dropEvent(QDropEvent* event) { lstring paths = DropPaths(event); if(paths.empty()) return; if(self.window.onDrop) self.window.onDrop(paths); } void pWindow::QtWindow::keyPressEvent(QKeyEvent* event) { Keyboard::Keycode sym = Keysym(event->nativeVirtualKey()); if(sym != Keyboard::Keycode::None && self.window.onKeyPress) self.window.onKeyPress(sym); } void pWindow::QtWindow::keyReleaseEvent(QKeyEvent* event) { Keyboard::Keycode sym = Keysym(event->nativeVirtualKey()); if(sym != Keyboard::Keycode::None && self.window.onKeyRelease) self.window.onKeyRelease(sym); } void pWindow::QtWindow::resizeEvent(QResizeEvent*) { if(self.locked == false && self.window.state.fullScreen == false && self.qtWindow->isVisible() == true) { self.window.state.geometry.width = self.qtContainer->geometry().width(); self.window.state.geometry.height = self.qtContainer->geometry().height(); } for(auto& layout : self.window.state.layout) { Geometry geometry = self.geometry(); geometry.x = geometry.y = 0; layout.setGeometry(geometry); } if(self.locked == false) { if(self.window.onSize) self.window.onSize(); } } QSize pWindow::QtWindow::sizeHint() const { unsigned width = self.window.state.geometry.width; unsigned height = self.window.state.geometry.height; if(self.window.state.menuVisible) height += settings->geometry.menuHeight; if(self.window.state.statusVisible) height += settings->geometry.statusHeight; return QSize(width, height); } } fc/cheat/cheat.hpp000664 001750 001750 00000000642 12651764221 015163 0ustar00sergiosergio000000 000000 struct Cheat { struct Code { unsigned addr; unsigned comp; unsigned data; }; vector codes; enum : unsigned { Unused = ~0u }; alwaysinline bool enable() const { return codes.size() > 0; } void reset(); void append(unsigned addr, unsigned data); void append(unsigned addr, unsigned comp, unsigned data); optional find(unsigned addr, unsigned comp); }; extern Cheat cheat; phoenix/cocoa/object.hpp000664 001750 001750 00000000317 12651764221 016426 0ustar00sergiosergio000000 000000 namespace phoenix { struct pObject { Object& object; bool locked; pObject(Object& object) : object(object), locked(false) {} virtual ~pObject() {} void constructor(); void destructor(); }; } processor/upd96050/upd96050.cpp000664 001750 001750 00000001525 12651764221 017026 0ustar00sergiosergio000000 000000 #include #include "upd96050.hpp" namespace Processor { #include "instructions.cpp" #include "memory.cpp" #include "disassembler.cpp" #include "serialization.cpp" void uPD96050::power() { if(revision == Revision::uPD7725) { regs.pc.bits(11); regs.rp.bits(10); regs.dp.bits( 8); } if(revision == Revision::uPD96050) { regs.pc.bits(14); regs.rp.bits(11); regs.dp.bits(11); } for(unsigned n = 0; n < 16; n++) regs.stack[n] = 0x0000; regs.pc = 0x0000; regs.rp = 0x0000; regs.dp = 0x0000; regs.sp = 0x0; regs.k = 0x0000; regs.l = 0x0000; regs.m = 0x0000; regs.n = 0x0000; regs.a = 0x0000; regs.b = 0x0000; regs.flaga = 0x00; regs.flagb = 0x00; regs.tr = 0x0000; regs.trb = 0x0000; regs.sr = 0x0000; regs.dr = 0x0000; regs.si = 0x0000; regs.so = 0x0000; } } gba/cpu/timer.cpp000664 001750 001750 00000002163 12651764221 015056 0ustar00sergiosergio000000 000000 void CPU::timer_step(unsigned clocks) { for(unsigned c = 0; c < clocks; c++) { for(unsigned n = 0; n < 4; n++) { auto& timer = regs.timer[n]; if(timer.control.enable == false || timer.control.cascade == true) continue; static unsigned mask[] = {0, 63, 255, 1023}; if((regs.clock & mask[timer.control.frequency]) == 0) { timer_increment(n); } } regs.clock++; } } void CPU::timer_increment(unsigned n) { auto& timer = regs.timer[n]; if(++timer.period == 0) { timer.period = timer.reload; if(timer.control.irq) regs.irq.flag.timer[n] = 1; if(apu.fifo[0].timer == n) timer_fifo_run(0); if(apu.fifo[1].timer == n) timer_fifo_run(1); if(n < 3 && regs.timer[n + 1].control.enable && regs.timer[n + 1].control.cascade) { timer_increment(n + 1); } } } void CPU::timer_fifo_run(unsigned n) { apu.fifo[n].read(); if(apu.fifo[n].size > 16) return; auto& dma = regs.dma[1 + n]; if(dma.control.enable && dma.control.timingmode == 3) { dma.pending = true; dma.control.targetmode = 2; dma.control.size = 1; dma.run.length = 4; } } nall/ups.hpp000664 001750 001750 00000015515 12651764221 014165 0ustar00sergiosergio000000 000000 #ifndef NALL_UPS_HPP #define NALL_UPS_HPP #include #include #include #include namespace nall { struct ups { enum class result : unsigned { unknown, success, patch_unwritable, patch_invalid, source_invalid, target_invalid, target_too_small, patch_checksum_invalid, source_checksum_invalid, target_checksum_invalid, }; function progress; result create( const uint8_t* sourcedata, unsigned sourcelength, const uint8_t* targetdata, unsigned targetlength, const char* patchfilename ) { source_data = (uint8_t*)sourcedata, target_data = (uint8_t*)targetdata; source_length = sourcelength, target_length = targetlength; source_offset = target_offset = 0; source_checksum = target_checksum = patch_checksum = ~0; if(patch_file.open(patchfilename, file::mode::write) == false) return result::patch_unwritable; patch_write('U'); patch_write('P'); patch_write('S'); patch_write('1'); encode(source_length); encode(target_length); unsigned output_length = source_length > target_length ? source_length : target_length; unsigned relative = 0; for(unsigned offset = 0; offset < output_length;) { uint8_t x = source_read(); uint8_t y = target_read(); if(x == y) { offset++; continue; } encode(offset++ - relative); patch_write(x ^ y); while(true) { if(offset >= output_length) { patch_write(0x00); break; } x = source_read(); y = target_read(); offset++; patch_write(x ^ y); if(x == y) break; } relative = offset; } source_checksum = ~source_checksum; target_checksum = ~target_checksum; for(unsigned i = 0; i < 4; i++) patch_write(source_checksum >> (i * 8)); for(unsigned i = 0; i < 4; i++) patch_write(target_checksum >> (i * 8)); uint32_t patch_result_checksum = ~patch_checksum; for(unsigned i = 0; i < 4; i++) patch_write(patch_result_checksum >> (i * 8)); patch_file.close(); return result::success; } result apply( const uint8_t* patchdata, unsigned patchlength, const uint8_t* sourcedata, unsigned sourcelength, uint8_t* targetdata, unsigned& targetlength ) { patch_data = (uint8_t*)patchdata, source_data = (uint8_t*)sourcedata, target_data = targetdata; patch_length = patchlength, source_length = sourcelength, target_length = targetlength; patch_offset = source_offset = target_offset = 0; patch_checksum = source_checksum = target_checksum = ~0; if(patch_length < 18) return result::patch_invalid; if(patch_read() != 'U') return result::patch_invalid; if(patch_read() != 'P') return result::patch_invalid; if(patch_read() != 'S') return result::patch_invalid; if(patch_read() != '1') return result::patch_invalid; unsigned source_read_length = decode(); unsigned target_read_length = decode(); if(source_length != source_read_length && source_length != target_read_length) return result::source_invalid; targetlength = (source_length == source_read_length ? target_read_length : source_read_length); if(target_length < targetlength) return result::target_too_small; target_length = targetlength; while(patch_offset < patch_length - 12) { unsigned length = decode(); while(length--) target_write(source_read()); while(true) { uint8_t patch_xor = patch_read(); target_write(patch_xor ^ source_read()); if(patch_xor == 0) break; } } while(source_offset < source_length) target_write(source_read()); while(target_offset < target_length) target_write(source_read()); uint32_t patch_read_checksum = 0, source_read_checksum = 0, target_read_checksum = 0; for(unsigned i = 0; i < 4; i++) source_read_checksum |= patch_read() << (i * 8); for(unsigned i = 0; i < 4; i++) target_read_checksum |= patch_read() << (i * 8); uint32_t patch_result_checksum = ~patch_checksum; source_checksum = ~source_checksum; target_checksum = ~target_checksum; for(unsigned i = 0; i < 4; i++) patch_read_checksum |= patch_read() << (i * 8); if(patch_result_checksum != patch_read_checksum) return result::patch_invalid; if(source_checksum == source_read_checksum && source_length == source_read_length) { if(target_checksum == target_read_checksum && target_length == target_read_length) return result::success; return result::target_invalid; } else if(source_checksum == target_read_checksum && source_length == target_read_length) { if(target_checksum == source_read_checksum && target_length == source_read_length) return result::success; return result::target_invalid; } else { return result::source_invalid; } } private: uint8_t* patch_data = nullptr; uint8_t* source_data = nullptr; uint8_t* target_data = nullptr; unsigned patch_length, source_length, target_length; unsigned patch_offset, source_offset, target_offset; unsigned patch_checksum, source_checksum, target_checksum; file patch_file; uint8_t patch_read() { if(patch_offset < patch_length) { uint8_t n = patch_data[patch_offset++]; patch_checksum = crc32_adjust(patch_checksum, n); return n; } return 0x00; } uint8_t source_read() { if(source_offset < source_length) { uint8_t n = source_data[source_offset++]; source_checksum = crc32_adjust(source_checksum, n); return n; } return 0x00; } uint8_t target_read() { uint8_t result = 0x00; if(target_offset < target_length) { result = target_data[target_offset]; target_checksum = crc32_adjust(target_checksum, result); } if(((target_offset++ & 255) == 0) && progress) { progress(target_offset, source_length > target_length ? source_length : target_length); } return result; } void patch_write(uint8_t n) { patch_file.write(n); patch_checksum = crc32_adjust(patch_checksum, n); } void target_write(uint8_t n) { if(target_offset < target_length) { target_data[target_offset] = n; target_checksum = crc32_adjust(target_checksum, n); } if(((target_offset++ & 255) == 0) && progress) { progress(target_offset, source_length > target_length ? source_length : target_length); } } void encode(uint64_t offset) { while(true) { uint64_t x = offset & 0x7f; offset >>= 7; if(offset == 0) { patch_write(0x80 | x); break; } patch_write(x); offset--; } } uint64_t decode() { uint64_t offset = 0, shift = 1; while(true) { uint8_t x = patch_read(); offset += (x & 0x7f) * shift; if(x & 0x80) break; shift <<= 7; offset += shift; } return offset; } }; } #endif phoenix/gtk/widget/000700 001750 001750 00000000000 12656700342 015415 5ustar00sergiosergio000000 000000 phoenix/reference/widget/radio-button.cpp000664 001750 001750 00000000504 12651764221 021715 0ustar00sergiosergio000000 000000 namespace phoenix { void pRadioButton::setChecked() { } void pRadioButton::setGroup(const group& group) { } void pRadioButton::setImage(const image& image, Orientation orientation) { } void pRadioButton::setText(string text) { } void pRadioButton::constructor() { } void pRadioButton::destructor() { } } phoenix/cocoa/action/000700 001750 001750 00000000000 12656700342 015706 5ustar00sergiosergio000000 000000 phoenix/core/layout/horizontal-layout.cpp000664 001750 001750 00000007777 12651764221 022061 0ustar00sergiosergio000000 000000 void HorizontalLayout::append(Sizable& sizable, Size size, unsigned spacing) { for(auto& child : children) if(child.sizable == &sizable) return; children.append({&sizable, size.width, size.height, spacing}); synchronizeLayout(); if(window()) window()->synchronizeLayout(); } void HorizontalLayout::append(Sizable& sizable) { for(auto& child : children) if(child.sizable == &sizable) return; Layout::append(sizable); if(window()) window()->synchronizeLayout(); } Size HorizontalLayout::minimumSize() { unsigned width = 0, height = 0; for(auto& child : children) { width += child.spacing; if(child.width == Size::Minimum || child.width == Size::Maximum) { width += child.sizable->minimumSize().width; continue; } width += child.width; } for(auto& child : children) { if(child.height == Size::Minimum || child.height == Size::Maximum) { height = max(height, child.sizable->minimumSize().height); continue; } height = max(height, child.height); } return {state.margin * 2 + width, state.margin * 2 + height}; } void HorizontalLayout::remove(Sizable& sizable) { for(unsigned n = 0; n < children.size(); n++) { if(children[n].sizable == &sizable) { if(dynamic_cast(children[n].sizable)) { Layout* layout = (Layout*)children[n].sizable; layout->reset(); } children.remove(n); Layout::remove(sizable); if(window()) window()->synchronizeLayout(); break; } } } void HorizontalLayout::reset() { for(auto& child : children) { if(window() && dynamic_cast(child.sizable)) ((Layout*)child.sizable)->reset(); if(window() && dynamic_cast(child.sizable)) window()->remove((Widget&)*child.sizable); } } void HorizontalLayout::setAlignment(double alignment) { state.alignment = max(0.0, min(1.0, alignment)); } void HorizontalLayout::setEnabled(bool enabled) { Sizable::state.enabled = enabled; for(auto& child : children) { child.sizable->setEnabled(child.sizable->enabled()); } } void HorizontalLayout::setGeometry(Geometry containerGeometry) { auto children = this->children; for(auto& child : children) { if(child.width == Size::Minimum) child.width = child.sizable->minimumSize().width; if(child.height == Size::Minimum) child.height = child.sizable->minimumSize().height; } Geometry geometry = containerGeometry; geometry.x += state.margin; geometry.y += state.margin; geometry.width -= state.margin * 2; geometry.height -= state.margin * 2; unsigned minimumWidth = 0, maximumWidthCounter = 0; for(auto& child : children) { if(child.width == Size::Maximum) maximumWidthCounter++; if(child.width != Size::Maximum) minimumWidth += child.width; minimumWidth += child.spacing; } for(auto& child : children) { if(child.width == Size::Maximum) child.width = (geometry.width - minimumWidth) / maximumWidthCounter; if(child.height == Size::Maximum) child.height = geometry.height; } unsigned maximumHeight = 0; for(auto& child : children) maximumHeight = max(maximumHeight, child.height); for(auto& child : children) { unsigned pivot = (maximumHeight - child.height) * state.alignment; Geometry childGeometry = {geometry.x, geometry.y + pivot, child.width, child.height}; if((signed)childGeometry.width < 1) childGeometry.width = 1; if((signed)childGeometry.height < 1) childGeometry.height = 1; child.sizable->setGeometry(childGeometry); geometry.x += child.width + child.spacing; geometry.width -= child.width + child.spacing; } } void HorizontalLayout::setMargin(unsigned margin) { state.margin = margin; } void HorizontalLayout::setVisible(bool visible) { Sizable::state.visible = visible; for(auto& child : children) { child.sizable->setVisible(child.sizable->visible()); } } void HorizontalLayout::synchronizeLayout() { for(auto& child : children) Layout::append(*child.sizable); } HorizontalLayout::~HorizontalLayout() { while(children.size()) remove(*children[0].sizable); } sfc/interface/000700 001750 001750 00000000000 12656700342 014406 5ustar00sergiosergio000000 000000 phoenix/reference/timer.hpp000664 001750 001750 00000000372 12651764221 017153 0ustar00sergiosergio000000 000000 namespace phoenix { struct pTimer : public pObject { Timer& timer; void setEnabled(bool enabled); void setInterval(unsigned interval); pTimer(Timer& timer) : pObject(timer), timer(timer) {} void constructor(); void destructor(); }; } phoenix/gtk/application.cpp000664 001750 001750 00000002443 12651764221 017161 0ustar00sergiosergio000000 000000 namespace phoenix { XlibDisplay* pApplication::display = nullptr; void pApplication::run() { if(Application::main) { while(applicationState.quit == false) { processEvents(); Application::main(); } } else { gtk_main(); } } bool pApplication::pendingEvents() { return gtk_events_pending(); } void pApplication::processEvents() { while(pendingEvents()) gtk_main_iteration_do(false); } void pApplication::quit() { //if gtk_main() was invoked, call gtk_main_quit() if(gtk_main_level()) gtk_main_quit(); } void pApplication::initialize() { display = XOpenDisplay(nullptr); settings = new Settings; settings->load(); int argc = 1; char* argv[] = {new char[8], nullptr}; strcpy(argv[0], "phoenix"); char** argvp = argv; gtk_init(&argc, &argvp); GtkSettings* gtkSettings = gtk_settings_get_default(); //g_object_set(gtkSettings, "gtk-button-images", true, nullptr); gtk_rc_parse_string(R"( style "phoenix-gtk" { GtkWindow::resize-grip-width = 0 GtkWindow::resize-grip-height = 0 GtkTreeView::vertical-separator = 0 GtkComboBox::appears-as-list = 1 } class "GtkWindow" style "phoenix-gtk" class "GtkTreeView" style "phoenix-gtk" # class "GtkComboBox" style "phoenix-gtk" )"); pKeyboard::initialize(); } } nall/utility.hpp000664 001750 001750 00000006437 12651764221 015064 0ustar00sergiosergio000000 000000 #ifndef NALL_UTILITY_HPP #define NALL_UTILITY_HPP #include #include #include namespace nall { template struct base_from_member { T value; base_from_member(T value) : value(value) {} }; template struct ref { T& operator*() { if(type == Type::Reference) return *any_cast(value); return any_cast(value); } operator T&() { return operator*(); } ref(T& value) : type(Type::Reference), value(&value) {} ref(T&& value) : type(Type::Temporary), value(value) {} protected: enum class Type : unsigned { Reference, Temporary } type; any value; }; template struct optional { typedef typename std::remove_reference::type T; static const bool isConst = std::is_const::value; static const bool isReference = std::is_reference::value; struct optional_value_not_valid{}; bool valid = false; T* value = nullptr; operator bool() const { return valid; } void reset() { valid = false; if(value) { if(!isReference) delete value; value = nullptr; } } template::type> T& operator*() { if(!valid) throw optional_value_not_valid{}; return *value; } template::type> T& operator()() { if(!valid) throw optional_value_not_valid{}; return *value; } const T& operator*() const { if(!valid) throw optional_value_not_valid{}; return *value; } const T& operator()() const { if(!valid) throw optional_value_not_valid{}; return *value; } const T& operator()(const T& alternate) const { if(!valid) return alternate; return *value; } const bool operator==(const optional& source) const { if(valid && source.valid) return *value == *source.value; if(!valid && !source.valid) return true; return false; } const bool operator!=(const optional& source) const { return !operator==(source); } optional& operator=(const T& source) { reset(); valid = true; if(isReference) value = (T*)&source; else value = new T(source); return *this; } optional& operator=(T&& source) { reset(); valid = true; if(isReference) value = &source; else value = new T(std::move(source)); return *this; } optional& operator=(const optional& source) { reset(); valid = source.valid; if(valid) operator=(source); return *this; } optional& operator=(optional&& source) { reset(); valid = source.valid; value = source.value; source.valid = false; source.value = nullptr; return *this; } optional() = default; optional(bool valid) : valid(valid) {} optional(const T& value) { operator=(value); } optional(T&& value) { operator=(std::move(value)); } optional(bool valid, const T& value) : valid(valid) { if(valid) operator=(value); } optional(bool valid, T&& value) : valid(valid) { if(valid) operator=(std::move(value)); } optional(const optional& source) { operator=(source); } optional(optional&& source) { operator=(std::move(source)); } ~optional() { reset(); } }; template inline T* allocate(unsigned size, const T& value) { T* array = new T[size]; for(unsigned i = 0; i < size; i++) array[i] = value; return array; } } #endif phoenix/gtk/widget/tab-frame.cpp000664 001750 001750 00000007000 12651764221 017771 0ustar00sergiosergio000000 000000 namespace phoenix { static void TabFrame_change(GtkNotebook* notebook, GtkWidget* page, unsigned selection, TabFrame* self) { self->state.selection = selection; self->p.synchronizeLayout(); if(!self->p.locked && self->onChange) self->onChange(); } void pTabFrame::append(string text, const image& image) { unsigned selection = tabFrame.state.text.size() - 1; Tab tab; tab.child = gtk_fixed_new(); tab.container = gtk_hbox_new(false, 0); tab.image = gtk_image_new(); tab.title = gtk_label_new(text); tabs.append(tab); gtk_widget_show(tab.child); gtk_widget_show(tab.container); gtk_widget_show(tab.image); gtk_widget_show(tab.title); gtk_box_pack_start(GTK_BOX(tab.container), tab.image, false, false, 0); gtk_box_pack_start(GTK_BOX(tab.container), tab.title, false, false, 2); gtk_notebook_append_page(GTK_NOTEBOOK(gtkWidget), tab.child, tab.container); setFont(widget.state.font); if(!image.empty()) setImage(selection, image); } GtkWidget* pTabFrame::container(Widget& widget) { Layout* widgetLayout = GetParentWidgetLayout(&widget); unsigned selection = 0; for(auto& layout : tabFrame.state.layout) { if(layout == widgetLayout) return tabs[selection].child; selection++; } return nullptr; } Position pTabFrame::displacement() { return {6, 31}; } void pTabFrame::remove(unsigned selection) { tabs.remove(selection); gtk_notebook_remove_page(GTK_NOTEBOOK(gtkWidget), selection); } void pTabFrame::setEnabled(bool enabled) { for(auto& layout : tabFrame.state.layout) { if(layout) layout->setEnabled(layout->enabled()); } pWidget::setEnabled(enabled); } void pTabFrame::setGeometry(Geometry geometry) { pWidget::setGeometry(geometry); geometry.x += 1, geometry.width -= 5; geometry.y += 26, geometry.height -= 31; for(auto& layout : tabFrame.state.layout) { if(layout) layout->setGeometry(geometry); } synchronizeLayout(); } void pTabFrame::setImage(unsigned selection, const image& image) { if(image.empty() == false) { nall::image copy = image; unsigned size = pFont::size(widget.state.font, " ").height; copy.scale(size, size); GdkPixbuf* pixbuf = CreatePixbuf(copy); gtk_image_set_from_pixbuf(GTK_IMAGE(tabs[selection].image), pixbuf); } else { gtk_image_clear(GTK_IMAGE(tabs[selection].image)); } } void pTabFrame::setSelection(unsigned selection) { locked = true; gtk_notebook_set_current_page(GTK_NOTEBOOK(gtkWidget), selection); locked = false; } void pTabFrame::setText(unsigned selection, string text) { gtk_label_set_text(GTK_LABEL(tabs[selection].title), text); } void pTabFrame::setVisible(bool visible) { for(auto& layout : tabFrame.state.layout) { if(layout) layout->setVisible(layout->visible()); } pWidget::setVisible(visible); } void pTabFrame::constructor() { gtkWidget = gtk_notebook_new(); gtk_notebook_set_show_border(GTK_NOTEBOOK(gtkWidget), false); gtk_notebook_set_tab_pos(GTK_NOTEBOOK(gtkWidget), GTK_POS_TOP); g_signal_connect(G_OBJECT(gtkWidget), "switch-page", G_CALLBACK(TabFrame_change), (gpointer)&tabFrame); setSelection(tabFrame.state.selection); } void pTabFrame::destructor() { gtk_widget_destroy(gtkWidget); } void pTabFrame::orphan() { destructor(); constructor(); } void pTabFrame::setFont(string font) { for(auto& tab : tabs) pFont::setFont(tab.title, font); } void pTabFrame::synchronizeLayout() { unsigned selection = 0; for(auto& layout : tabFrame.state.layout) { if(layout) layout->setVisible(selection == tabFrame.state.selection); selection++; } } } sfc/slot/slot.hpp000664 001750 001750 00000000140 12651764221 015131 0ustar00sergiosergio000000 000000 #include #include phoenix/reference/header.hpp000664 001750 001750 00000000000 12651764221 017247 0ustar00sergiosergio000000 000000 sfc/chip/hitachidsp/memory.cpp000664 001750 001750 00000012104 12651764221 017540 0ustar00sergiosergio000000 000000 #ifdef HITACHIDSP_CPP uint8 HitachiDSP::bus_read(uint24 addr) { if((addr & 0x408000) == 0x008000) return bus.read(addr); //$00-3f,80-bf:6000-7fff if((addr & 0xf88000) == 0x700000) return bus.read(addr); //$70-77:0000-7fff return 0x00; } void HitachiDSP::bus_write(uint24 addr, uint8 data) { if((addr & 0x40e000) == 0x006000) return bus.write(addr, data); //$00-3f,80-bf:6000-7fff if((addr & 0xf88000) == 0x700000) return bus.write(addr, data); //$70-77:0000-7fff } uint8 HitachiDSP::rom_read(unsigned addr) { if(co_active() == hitachidsp.thread || regs.halt) { addr = bus.mirror(addr, rom.size()); //if(Roms == 2 && mmio.r1f52 == 1 && addr >= (bit::round(rom.size()) >> 1)) return 0x00; return rom.read(addr); } if((addr & 0x40ffe0) == 0x00ffe0) return mmio.vector[addr & 0x1f]; return cpu.regs.mdr; } void HitachiDSP::rom_write(unsigned addr, uint8 data) { } uint8 HitachiDSP::ram_read(unsigned addr) { if(ram.size() == 0) return 0x00; //not open bus return ram.read(bus.mirror(addr, ram.size())); } void HitachiDSP::ram_write(unsigned addr, uint8 data) { if(ram.size() == 0) return; return ram.write(bus.mirror(addr, ram.size()), data); } uint8 HitachiDSP::dsp_read(unsigned addr) { addr &= 0x1fff; //Data RAM if(addr <= 0x0bff || (addr >= 0x1000 && addr <= 0x1bff)) { return dataRAM[addr & 0x0fff]; } //MMIO switch(addr) { case 0x1f40: return mmio.dma_source >> 0; case 0x1f41: return mmio.dma_source >> 8; case 0x1f42: return mmio.dma_source >> 16; case 0x1f43: return mmio.dma_length >> 0; case 0x1f44: return mmio.dma_length >> 8; case 0x1f45: return mmio.dma_target >> 0; case 0x1f46: return mmio.dma_target >> 8; case 0x1f47: return mmio.dma_target >> 16; case 0x1f48: return mmio.r1f48; case 0x1f49: return mmio.program_offset >> 0; case 0x1f4a: return mmio.program_offset >> 8; case 0x1f4b: return mmio.program_offset >> 16; case 0x1f4c: return mmio.r1f4c; case 0x1f4d: return mmio.page_number >> 0; case 0x1f4e: return mmio.page_number >> 8; case 0x1f4f: return mmio.program_counter; case 0x1f50: return mmio.r1f50; case 0x1f51: return mmio.r1f51; case 0x1f52: return mmio.r1f52; case 0x1f53: case 0x1f54: case 0x1f55: case 0x1f56: case 0x1f57: case 0x1f58: case 0x1f59: case 0x1f5a: case 0x1f5b: case 0x1f5c: case 0x1f5d: case 0x1f5e: case 0x1f5f: return ((regs.halt == false) << 6) | ((regs.halt == true) << 1); } //Vector if(addr >= 0x1f60 && addr <= 0x1f7f) { return mmio.vector[addr & 0x1f]; } //GPRs if((addr >= 0x1f80 && addr <= 0x1faf) || (addr >= 0x1fc0 && addr <= 0x1fef)) { unsigned index = (addr & 0x3f) / 3; //0..15 unsigned shift = ((addr & 0x3f) % 3) * 8; //0, 8, 16 return regs.gpr[index] >> shift; } return 0x00; } void HitachiDSP::dsp_write(unsigned addr, uint8 data) { addr &= 0x1fff; //Data RAM if(addr <= 0x0bff || (addr >= 0x1000 && addr <= 0x1bff)) { dataRAM[addr & 0x0fff] = data; return; } //MMIO switch(addr) { case 0x1f40: mmio.dma_source = (mmio.dma_source & 0xffff00) | (data << 0); return; case 0x1f41: mmio.dma_source = (mmio.dma_source & 0xff00ff) | (data << 8); return; case 0x1f42: mmio.dma_source = (mmio.dma_source & 0x00ffff) | (data << 16); return; case 0x1f43: mmio.dma_length = (mmio.dma_length & 0xff00) | (data << 0); return; case 0x1f44: mmio.dma_length = (mmio.dma_length & 0x00ff) | (data << 8); return; case 0x1f45: mmio.dma_target = (mmio.dma_target & 0xffff00) | (data << 0); return; case 0x1f46: mmio.dma_target = (mmio.dma_target & 0xff00ff) | (data << 8); return; case 0x1f47: mmio.dma_target = (mmio.dma_target & 0x00ffff) | (data << 16); if(regs.halt) mmio.dma = true; return; case 0x1f48: mmio.r1f48 = data & 0x01; return; case 0x1f49: mmio.program_offset = (mmio.program_offset & 0xffff00) | (data << 0); return; case 0x1f4a: mmio.program_offset = (mmio.program_offset & 0xff00ff) | (data << 8); return; case 0x1f4b: mmio.program_offset = (mmio.program_offset & 0x00ffff) | (data << 16); return; case 0x1f4c: mmio.r1f4c = data & 0x03; return; case 0x1f4d: mmio.page_number = (mmio.page_number & 0x7f00) | ((data & 0xff) << 0); return; case 0x1f4e: mmio.page_number = (mmio.page_number & 0x00ff) | ((data & 0x7f) << 8); return; case 0x1f4f: mmio.program_counter = data; if(regs.halt) { regs.pc = mmio.page_number * 256 + mmio.program_counter; regs.halt = false; } return; case 0x1f50: mmio.r1f50 = data & 0x77; return; case 0x1f51: mmio.r1f51 = data & 0x01; return; case 0x1f52: mmio.r1f52 = data & 0x01; return; } //Vector if(addr >= 0x1f60 && addr <= 0x1f7f) { mmio.vector[addr & 0x1f] = data; return; } //GPRs if((addr >= 0x1f80 && addr <= 0x1faf) || (addr >= 0x1fc0 && addr <= 0x1fef)) { unsigned index = (addr & 0x3f) / 3; switch((addr & 0x3f) % 3) { case 0: regs.gpr[index] = (regs.gpr[index] & 0xffff00) | (data << 0); return; case 1: regs.gpr[index] = (regs.gpr[index] & 0xff00ff) | (data << 8); return; case 2: regs.gpr[index] = (regs.gpr[index] & 0x00ffff) | (data << 16); return; } } } #endif gba/scheduler/scheduler.hpp000664 001750 001750 00000000564 12651764221 017113 0ustar00sergiosergio000000 000000 struct Scheduler : property { enum class SynchronizeMode : unsigned { None, CPU, All } sync; enum class ExitReason : unsigned { UnknownEvent, FrameEvent, SynchronizeEvent }; readonly exit_reason; cothread_t host; cothread_t active; void enter(); void exit(ExitReason); void power(); Scheduler(); }; extern Scheduler scheduler; shaders/Curvature.shader/curvature.fs000664 001750 001750 00000000573 12651764221 021145 0ustar00sergiosergio000000 000000 #version 150 #define distortion 0.2 uniform sampler2D source[]; uniform vec4 sourceSize[]; in Vertex { vec2 texCoord; }; out vec4 fragColor; vec2 radialDistortion(vec2 coord) { vec2 cc = coord - vec2(0.5); float dist = dot(cc, cc) * distortion; return coord + cc * (1.0 - dist) * dist; } void main() { fragColor = texture(source[0], radialDistortion(texCoord)); } fc/cheat/000700 001750 001750 00000000000 12656700342 013347 5ustar00sergiosergio000000 000000 sfc/alt/ppu-performance/sprite/sprite.hpp000664 001750 001750 00000002350 12651764221 021673 0ustar00sergiosergio000000 000000 class Sprite { bool priority0_enable; bool priority1_enable; bool priority2_enable; bool priority3_enable; struct Regs { unsigned priority0; unsigned priority1; unsigned priority2; unsigned priority3; unsigned base_size; unsigned nameselect; unsigned tiledata_addr; unsigned first_sprite; bool main_enable; bool sub_enable; bool interlace; bool time_over; bool range_over; } regs; struct List { unsigned width; unsigned height; unsigned x; unsigned y; unsigned character; bool use_nameselect; bool vflip; bool hflip; unsigned palette; unsigned priority; bool size; } list[128]; bool list_valid; uint8 itemlist[32]; struct TileList { unsigned x; unsigned y; unsigned priority; unsigned palette; unsigned tile; bool hflip; } tilelist[34]; struct Output { uint8 palette[256]; uint8 priority[256]; } output; LayerWindow window; void frame(); void update_list(unsigned addr, uint8 data); void address_reset(); void set_first(); alwaysinline bool on_scanline(unsigned sprite); void render(); void serialize(serializer&); Sprite(PPU& self); PPU& self; friend class PPU; }; gba/interface/interface.cpp000664 001750 001750 00000006367 12651764221 017061 0ustar00sergiosergio000000 000000 #include namespace GameBoyAdvance { Interface* interface = nullptr; string Interface::title() { return cartridge.title(); } double Interface::videoFrequency() { return 16777216.0 / (228.0 * 1232.0); } double Interface::audioFrequency() { return 16777216.0 / 512.0; } bool Interface::loaded() { return cartridge.loaded(); } unsigned Interface::group(unsigned id) { switch(id) { case ID::BIOS: return ID::System; case ID::Manifest: case ID::ROM: case ID::RAM: case ID::EEPROM: case ID::FlashROM: return ID::GameBoyAdvance; } throw; } void Interface::load(unsigned id) { cartridge.load(); } void Interface::save() { for(auto& memory : cartridge.memory) { interface->saveRequest(memory.id, memory.name); } } void Interface::load(unsigned id, const stream& stream) { if(id == ID::BIOS) { stream.read(bios.data, min(bios.size, stream.size())); } if(id == ID::Manifest) cartridge.information.markup = stream.text(); if(id == ID::ROM) { stream.read(cartridge.rom.data, min(cartridge.rom.size, stream.size())); } if(id == ID::RAM) { stream.read(cartridge.ram.data, min(cartridge.ram.size, stream.size())); } if(id == ID::EEPROM) { stream.read(cartridge.eeprom.data, min(cartridge.eeprom.size, stream.size())); } if(id == ID::FlashROM) { stream.read(cartridge.flashrom.data, min(cartridge.flashrom.size, stream.size())); } } void Interface::save(unsigned id, const stream& stream) { if(id == ID::RAM) { stream.write(cartridge.ram.data, cartridge.ram.size); } if(id == ID::EEPROM) { stream.write(cartridge.eeprom.data, cartridge.eeprom.size); } if(id == ID::FlashROM) { stream.write(cartridge.flashrom.data, cartridge.flashrom.size); } } void Interface::unload() { save(); cartridge.unload(); } void Interface::power() { system.power(); } void Interface::reset() { system.power(); } void Interface::run() { system.run(); } serializer Interface::serialize() { system.runtosave(); return system.serialize(); } bool Interface::unserialize(serializer& s) { return system.unserialize(s); } void Interface::paletteUpdate(PaletteMode mode) { video.generate_palette(mode); } Interface::Interface() { interface = this; information.name = "Game Boy Advance"; information.width = 240; information.height = 160; information.overscan = false; information.aspectRatio = 1.0; information.resettable = false; information.capability.states = true; information.capability.cheats = false; media.append({ID::GameBoyAdvance, "Game Boy Advance", "gba", true}); { Device device{0, ID::Device, "Controller"}; device.input.append({ 0, 0, "A" }); device.input.append({ 1, 0, "B" }); device.input.append({ 2, 0, "Select"}); device.input.append({ 3, 0, "Start" }); device.input.append({ 4, 0, "Right" }); device.input.append({ 5, 0, "Left" }); device.input.append({ 6, 0, "Up" }); device.input.append({ 7, 0, "Down" }); device.input.append({ 8, 0, "R" }); device.input.append({ 9, 0, "L" }); device.input.append({10, 2, "Rumble"}); device.order = {6, 7, 5, 4, 1, 0, 9, 8, 2, 3, 10}; this->device.append(device); } port.append({0, "Device", {device[0]}}); } } phoenix/cocoa/message-window.cpp000664 001750 001750 00000006100 12651764221 020100 0ustar00sergiosergio000000 000000 namespace phoenix { enum class MessageWindowType : unsigned { Error, Information, Question, Warning }; MessageWindow::Response MessageWindow_dialog(MessageWindow::State& state, MessageWindowType type) { @autoreleasepool { NSAlert* alert = [[[NSAlert alloc] init] autorelease]; if(state.title) [alert setMessageText:[NSString stringWithUTF8String:state.title]]; [alert setInformativeText:[NSString stringWithUTF8String:state.text]]; switch(state.buttons) { case MessageWindow::Buttons::Ok: [alert addButtonWithTitle:@"Ok"]; break; case MessageWindow::Buttons::OkCancel: [alert addButtonWithTitle:@"Ok"]; [alert addButtonWithTitle:@"Cancel"]; break; case MessageWindow::Buttons::YesNo: [alert addButtonWithTitle:@"Yes"]; [alert addButtonWithTitle:@"No"]; break; case MessageWindow::Buttons::YesNoCancel: [alert addButtonWithTitle:@"Yes"]; [alert addButtonWithTitle:@"No"]; [alert addButtonWithTitle:@"Cancel"]; break; } switch(type) { case MessageWindowType::Error: [alert setAlertStyle:NSCriticalAlertStyle]; break; case MessageWindowType::Information: [alert setAlertStyle:NSInformationalAlertStyle]; break; case MessageWindowType::Question: [alert setAlertStyle:NSInformationalAlertStyle]; break; case MessageWindowType::Warning: [alert setAlertStyle:NSWarningAlertStyle]; break; } NSInteger response = [alert runModal]; //[alert beginSheetModalForWindow:parent.p.cocoaWindow modalDelegate:self didEndSelector:@selector(...) contextInfo:nil]; switch(state.buttons) { case MessageWindow::Buttons::Ok: if(response == NSAlertFirstButtonReturn) return MessageWindow::Response::Ok; break; case MessageWindow::Buttons::OkCancel: if(response == NSAlertFirstButtonReturn) return MessageWindow::Response::Ok; if(response == NSAlertSecondButtonReturn) return MessageWindow::Response::Cancel; break; case MessageWindow::Buttons::YesNo: if(response == NSAlertFirstButtonReturn) return MessageWindow::Response::Yes; if(response == NSAlertSecondButtonReturn) return MessageWindow::Response::No; break; case MessageWindow::Buttons::YesNoCancel: if(response == NSAlertFirstButtonReturn) return MessageWindow::Response::Yes; if(response == NSAlertSecondButtonReturn) return MessageWindow::Response::No; if(response == NSAlertThirdButtonReturn) return MessageWindow::Response::Cancel; break; } } throw; } MessageWindow::Response pMessageWindow::error(MessageWindow::State& state) { return MessageWindow_dialog(state, MessageWindowType::Error); } MessageWindow::Response pMessageWindow::information(MessageWindow::State& state) { return MessageWindow_dialog(state, MessageWindowType::Information); } MessageWindow::Response pMessageWindow::question(MessageWindow::State& state) { return MessageWindow_dialog(state, MessageWindowType::Question); } MessageWindow::Response pMessageWindow::warning(MessageWindow::State& state) { return MessageWindow_dialog(state, MessageWindowType::Warning); } } fc/cartridge/board/konami-vrc4.cpp000664 001750 001750 00000002515 12651764221 020174 0ustar00sergiosergio000000 000000 struct KonamiVRC4 : Board { struct Settings { struct Pinout { unsigned a0; unsigned a1; } pinout; } settings; VRC4 vrc4; void main() { return vrc4.main(); } uint8 prg_read(unsigned addr) { if(addr < 0x6000) return cpu.mdr(); if(addr < 0x8000) return prgram.read(addr); return prgrom.read(vrc4.prg_addr(addr)); } void prg_write(unsigned addr, uint8 data) { if(addr < 0x6000) return; if(addr < 0x8000) return prgram.write(addr, data); bool a0 = (addr & settings.pinout.a0); bool a1 = (addr & settings.pinout.a1); addr &= 0xfff0; addr |= (a1 << 1) | (a0 << 0); return vrc4.reg_write(addr, data); } uint8 chr_read(unsigned addr) { if(addr & 0x2000) return ppu.ciram_read(vrc4.ciram_addr(addr)); return Board::chr_read(vrc4.chr_addr(addr)); } void chr_write(unsigned addr, uint8 data) { if(addr & 0x2000) return ppu.ciram_write(vrc4.ciram_addr(addr), data); return Board::chr_write(vrc4.chr_addr(addr), data); } void power() { vrc4.power(); } void reset() { vrc4.reset(); } void serialize(serializer& s) { Board::serialize(s); vrc4.serialize(s); } KonamiVRC4(Markup::Node& document) : Board(document), vrc4(*this) { settings.pinout.a0 = 1 << decimal(document["cartridge"]["chip"]["pinout"]["a0"].data); settings.pinout.a1 = 1 << decimal(document["cartridge"]["chip"]["pinout"]["a1"].data); } }; target-ethos/resource/state-manager.png000664 001750 001750 00000000572 12651764221 021407 0ustar00sergiosergio000000 000000 PNG  IHDRabKGDC pHYs B(xtIME)0,C]ZIDAT8˽JAEI,|h%"h pNxZh{k%^R8; }IgN.I{Z!$Q }ӗ0ƙ17:#;֔v/Fٷ՗R^;Zא FrS(ҿs痔#\Q4<˕ZGڂOG,@0!`+c{R>8'Z;k LT_Ze҆IENDB`phoenix/gtk/widget/horizontal-scroller.cpp000664 001750 001750 00000002265 12651764221 022157 0ustar00sergiosergio000000 000000 namespace phoenix { static void HorizontalScroller_change(GtkRange* gtkRange, HorizontalScroller* self) { unsigned position = (unsigned)gtk_range_get_value(gtkRange); if(self->state.position == position) return; self->state.position = position; if(!self->p.locked && self->onChange) self->onChange(); } Size pHorizontalScroller::minimumSize() { return {0, 20}; } void pHorizontalScroller::setLength(unsigned length) { locked = true; length += length == 0; gtk_range_set_range(GTK_RANGE(gtkWidget), 0, max(1u, length - 1)); gtk_range_set_increments(GTK_RANGE(gtkWidget), 1, length >> 3); locked = false; } void pHorizontalScroller::setPosition(unsigned position) { gtk_range_set_value(GTK_RANGE(gtkWidget), position); } void pHorizontalScroller::constructor() { gtkWidget = gtk_hscrollbar_new(0); g_signal_connect(G_OBJECT(gtkWidget), "value-changed", G_CALLBACK(HorizontalScroller_change), (gpointer)&horizontalScroller); setLength(horizontalScroller.state.length); setPosition(horizontalScroller.state.position); } void pHorizontalScroller::destructor() { gtk_widget_destroy(gtkWidget); } void pHorizontalScroller::orphan() { destructor(); constructor(); } } sfc/alt/cpu/serialization.cpp000664 001750 001750 00000003723 12651764221 017420 0ustar00sergiosergio000000 000000 #ifdef CPU_CPP void CPU::serialize(serializer& s) { R65816::serialize(s); Thread::serialize(s); PPUcounter::serialize(s); s.array(wram); queue.serialize(s); s.array(port_data); for(unsigned i = 0; i < 8; i++) { s.integer(channel[i].dma_enabled); s.integer(channel[i].hdma_enabled); s.integer(channel[i].direction); s.integer(channel[i].indirect); s.integer(channel[i].unused); s.integer(channel[i].reverse_transfer); s.integer(channel[i].fixed_transfer); s.integer(channel[i].transfer_mode); s.integer(channel[i].dest_addr); s.integer(channel[i].source_addr); s.integer(channel[i].source_bank); s.integer(channel[i].transfer_size); s.integer(channel[i].indirect_bank); s.integer(channel[i].hdma_addr); s.integer(channel[i].line_counter); s.integer(channel[i].unknown); s.integer(channel[i].hdma_completed); s.integer(channel[i].hdma_do_transfer); } s.integer(status.nmi_valid); s.integer(status.nmi_line); s.integer(status.nmi_transition); s.integer(status.nmi_pending); s.integer(status.irq_valid); s.integer(status.irq_line); s.integer(status.irq_transition); s.integer(status.irq_pending); s.integer(status.irq_lock); s.integer(status.hdma_pending); s.integer(status.wram_addr); s.integer(status.joypad_strobe_latch); s.integer(status.nmi_enabled); s.integer(status.virq_enabled); s.integer(status.hirq_enabled); s.integer(status.auto_joypad_poll_enabled); s.integer(status.pio); s.integer(status.wrmpya); s.integer(status.wrmpyb); s.integer(status.wrdiva); s.integer(status.wrdivb); s.integer(status.htime); s.integer(status.vtime); s.integer(status.rom_speed); s.integer(status.rddiv); s.integer(status.rdmpy); s.integer(status.joy1l); s.integer(status.joy1h); s.integer(status.joy2l); s.integer(status.joy2h); s.integer(status.joy3l); s.integer(status.joy3h); s.integer(status.joy4l); s.integer(status.joy4h); } #endif phoenix/reference/platform.cpp000664 001750 001750 00000002263 12651764221 017653 0ustar00sergiosergio000000 000000 #include "platform.hpp" #include "font.cpp" #include "desktop.cpp" #include "monitor.cpp" #include "keyboard.cpp" #include "mouse.cpp" #include "browser-window.cpp" #include "message-window.cpp" #include "object.cpp" #include "timer.cpp" #include "window.cpp" #include "action/action.cpp" #include "action/menu.cpp" #include "action/separator.cpp" #include "action/item.cpp" #include "action/check-item.cpp" #include "action/radio-item.cpp" #include "widget/widget.cpp" #include "widget/button.cpp" #include "widget/canvas.cpp" #include "widget/check-button.cpp" #include "widget/check-label.cpp" #include "widget/combo-button.cpp" #include "widget/console.cpp" #include "widget/frame.cpp" #include "widget/hex-edit.cpp" #include "widget/horizontal-scroller.cpp" #include "widget/horizontal-slider.cpp" #include "widget/label.cpp" #include "widget/line-edit.cpp" #include "widget/list-view.cpp" #include "widget/progress-bar.cpp" #include "widget/radio-button.cpp" #include "widget/radio-label.cpp" #include "widget/tab-frame.cpp" #include "widget/text-edit.cpp" #include "widget/vertical-scroller.cpp" #include "widget/vertical-slider.cpp" #include "widget/viewport.cpp" #include "application.cpp" nall/stream/mmap.hpp000664 001750 001750 00000002120 12651764221 015567 0ustar00sergiosergio000000 000000 #ifndef NALL_STREAM_MMAP_HPP #define NALL_STREAM_MMAP_HPP #include namespace nall { struct mmapstream : stream { using stream::read; using stream::write; bool seekable() const { return true; } bool readable() const { return true; } bool writable() const { return pwritable; } bool randomaccess() const { return true; } unsigned size() const { return pmmap.size(); } unsigned offset() const { return poffset; } void seek(unsigned offset) const { poffset = offset; } uint8_t read() const { return pdata[poffset++]; } void write(uint8_t data) const { pdata[poffset++] = data; } uint8_t read(unsigned offset) const { return pdata[offset]; } void write(unsigned offset, uint8_t data) const { pdata[offset] = data; } mmapstream(const string& filename) { pmmap.open(filename, filemap::mode::readwrite); pwritable = pmmap.open(); if(!pwritable) pmmap.open(filename, filemap::mode::read); pdata = pmmap.data(), poffset = 0; } private: mutable filemap pmmap; mutable uint8_t* pdata; mutable unsigned pwritable, poffset; }; } #endif nall/image/base.hpp000664 001750 001750 00000011742 12651764221 015350 0ustar00sergiosergio000000 000000 #ifndef NALL_IMAGE_BASE_HPP #define NALL_IMAGE_BASE_HPP namespace nall { struct image { uint8_t* data = nullptr; unsigned width = 0; unsigned height = 0; unsigned pitch = 0; unsigned size = 0; bool endian = 0; //0 = lsb, 1 = msb unsigned depth = 32; unsigned stride = 4; struct channel { uint64_t mask; unsigned depth; unsigned shift; inline bool operator==(const channel& source) { return mask == source.mask && depth == source.depth && shift == source.shift; } inline bool operator!=(const channel& source) { return !operator==(source); } }; channel alpha = {255u << 24, 8u, 24u}; channel red = {255u << 16, 8u, 16u}; channel green = {255u << 8, 8u, 8u}; channel blue = {255u << 0, 8u, 0u}; enum class blend : unsigned { add, sourceAlpha, //color = sourceColor * sourceAlpha + targetColor * (1 - sourceAlpha) sourceColor, //color = sourceColor targetAlpha, //color = targetColor * targetAlpha + sourceColor * (1 - targetAlpha) targetColor, //color = targetColor }; //static.hpp static inline unsigned bitDepth(uint64_t color); static inline unsigned bitShift(uint64_t color); static inline uint64_t normalize(uint64_t color, unsigned sourceDepth, unsigned targetDepth); //core.hpp inline bool operator==(const image& source); inline bool operator!=(const image& source); inline image& operator=(const image& source); inline image& operator=(image&& source); inline image(const image& source); inline image(image&& source); inline image(bool endian, unsigned depth, uint64_t alphaMask, uint64_t redMask, uint64_t greenMask, uint64_t blueMask); inline image(const string& filename); inline image(const uint8_t* data, unsigned size); inline image(); inline ~image(); inline uint64_t read(const uint8_t* data) const; inline void write(uint8_t* data, uint64_t value) const; inline void free(); inline bool empty() const; inline bool load(const string& filename); inline void allocate(unsigned width, unsigned height); //fill.hpp inline void fill(uint64_t color = 0); inline void gradient(uint64_t a, uint64_t b, uint64_t c, uint64_t d); inline void gradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY, function callback); inline void crossGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY); inline void diamondGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY); inline void horizontalGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY); inline void radialGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY); inline void sphericalGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY); inline void squareGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY); inline void verticalGradient(uint64_t a, uint64_t b, signed radiusX, signed radiusY, signed centerX, signed centerY); //scale.hpp inline void scale(unsigned width, unsigned height, bool linear = true); //blend.hpp inline void impose(blend mode, unsigned targetX, unsigned targetY, image source, unsigned x, unsigned y, unsigned width, unsigned height); //utility.hpp inline bool crop(unsigned x, unsigned y, unsigned width, unsigned height); inline void alphaBlend(uint64_t alphaColor); inline void transform(bool endian, unsigned depth, uint64_t alphaMask, uint64_t redMask, uint64_t greenMask, uint64_t blueMask); protected: //core.hpp inline uint8_t* allocate(unsigned width, unsigned height, unsigned stride); //scale.hpp inline void scaleLinearWidth(unsigned width); inline void scaleLinearHeight(unsigned height); inline void scaleLinear(unsigned width, unsigned height); inline void scaleNearest(unsigned width, unsigned height); //load.hpp inline bool loadBMP(const string& filename); inline bool loadPNG(const string& filename); inline bool loadPNG(const uint8_t* data, unsigned size); //interpolation.hpp alwaysinline void isplit(uint64_t* component, uint64_t color); alwaysinline uint64_t imerge(const uint64_t* component); alwaysinline uint64_t interpolate1f(uint64_t a, uint64_t b, double x); alwaysinline uint64_t interpolate1f(uint64_t a, uint64_t b, uint64_t c, uint64_t d, double x, double y); alwaysinline uint64_t interpolate1i(int64_t a, int64_t b, uint32_t x); alwaysinline uint64_t interpolate1i(int64_t a, int64_t b, int64_t c, int64_t d, uint32_t x, uint32_t y); inline uint64_t interpolate4f(uint64_t a, uint64_t b, double x); inline uint64_t interpolate4f(uint64_t a, uint64_t b, uint64_t c, uint64_t d, double x, double y); inline uint64_t interpolate4i(uint64_t a, uint64_t b, uint32_t x); inline uint64_t interpolate4i(uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint32_t x, uint32_t y); }; } #endif nall/nall.hpp000664 001750 001750 00000003023 12651764221 014273 0ustar00sergiosergio000000 000000 #ifndef NALL_HPP #define NALL_HPP //include the most common nall headers with one statement //does not include the most obscure components with high cost and low usage #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(PLATFORM_WINDOWS) #include #include #endif #if defined(PLATFORM_X) #include #endif #endif nall/string/wrapper.hpp000664 001750 001750 00000010033 12651764221 016332 0ustar00sergiosergio000000 000000 #ifdef NALL_STRING_INTERNAL_HPP namespace nall { template lstring string::split(rstring key) const { lstring result; result.split(key, data()); return result; } template lstring string::isplit(rstring key) const { lstring result; result.isplit(key, data()); return result; } template lstring string::qsplit(rstring key) const { lstring result; result.qsplit(key, data()); return result; } template lstring string::iqsplit(rstring key) const { lstring result; result.iqsplit(key, data()); return result; } bool string::match(rstring source) const { return nall::strmatch(data(), source); } bool string::imatch(rstring source) const { return nall::istrmatch(data(), source); } signed string::compare(rstring source) const { return strcmp(data(), source.data()); } signed string::icompare(rstring source) const { return istrcmp(data(), source.data()); } bool string::equals(rstring source) const { if(size() != source.size()) return false; return compare(source) == 0; } bool string::iequals(rstring source) const { if(size() != source.size()) return false; return icompare(source) == 0; } bool string::beginsWith(rstring source) const { if(source.size() > size()) return false; return memcmp(data(), source.data(), source.size()) == 0; } bool string::ibeginsWith(rstring source) const { if(source.size() > size()) return false; return imemcmp(data(), source.data(), source.size()) == 0; } bool string::endsWith(rstring source) const { if(source.size() > size()) return false; return memcmp(data() + size() - source.size(), source.data(), source.size()) == 0; } bool string::iendsWith(rstring source) const { if(source.size() > size()) return false; return imemcmp(data() + size() - source.size(), source.data(), source.size()) == 0; } string string::slice(unsigned offset, unsigned length) const { if(offset >= size()) return ""; if(length == ~0u) length = size() - offset; return substr(data(), offset, length); } string& string::lower() { nall::strlower(data()); return *this; } string& string::upper() { nall::strupper(data()); return *this; } string& string::qlower() { nall::qstrlower(data()); return *this; } string& string::qupper() { nall::qstrupper(data()); return *this; } string& string::transform(rstring before, rstring after) { nall::strtr(data(), before, after); return *this; } string& string::reverse() { unsigned length = size(), pivot = length >> 1; for(signed x = 0, y = length - 1; x < pivot && y >= 0; x++, y--) std::swap(data()[x], data()[y]); return *this; } template string& string::ltrim(rstring key) { if(key.size() == 0) return *this; unsigned limit = Limit ? Limit : ~0u, offset = 0; while(limit && size() - offset >= key.size()) { if(memcmp(data() + offset, key.data(), key.size())) break; offset += key.size(); limit--; } if(offset) memmove(data(), data() + offset, size() - offset); resize(size() - offset); return *this; } template string& string::rtrim(rstring key) { if(key.size() == 0) return *this; unsigned limit = Limit ? Limit : ~0u, offset = 0; while(limit && size() - offset >= key.size()) { if(memcmp(data() + size() - key.size() - offset, key.data(), key.size())) break; offset += key.size(); limit--; } resize(size() - offset); return *this; } template string& string::trim(rstring key) { rtrim(key); ltrim(key); return *this; } template string& string::trim(rstring lkey, rstring rkey) { rtrim(rkey); ltrim(lkey); return *this; } string& string::strip() { nall::strip(data()); resize(length()); return *this; } optional string::find(rstring key) const { return strpos(data(), key); } optional string::ifind(rstring key) const { return istrpos(data(), key); } optional string::qfind(rstring key) const { return qstrpos(data(), key); } optional string::iqfind(rstring key) const { return iqstrpos(data(), key); } } #endif target-ethos/settings/video.hpp000664 001750 001750 00000000715 12651764221 020000 0ustar00sergiosergio000000 000000 struct VideoSlider : HorizontalLayout { Label name; Label value; HorizontalSlider slider; VideoSlider(); }; struct VideoSettings : SettingsLayout { Label colorAdjustment; VideoSlider saturation; VideoSlider gamma; VideoSlider luminance; CheckLabel colorEmulation; Label overscanAdjustment; VideoSlider overscanHorizontal; VideoSlider overscanVertical; void synchronize(); VideoSettings(); }; extern VideoSettings* videoSettings; target-ethos/resource/up.png000664 001750 001750 00000001214 12651764221 017275 0ustar00sergiosergio000000 000000 PNG  IHDRasBIT|dtEXtSoftwarewww.inkscape.org<IDAT8OhAƿ73ٍzhLт@*ՊhDbE-rkJIbREOBM*^DPC)*4&Q!|ߛ!5ɛ|fvn<IuL:.O <WLFfG ฼ʼns֖ǖ% Ep74HK: ]"GJ a2Wk =<؎Ql*eh :}6.N_ +XR"K(u@AVqE؟~ԋ+U?cjJZۆ25|I=/b1 lܺ?n%&Fs'0۶К"IENDB`target-ethos/window/window.hpp000664 001750 001750 00000000517 12651764221 017650 0ustar00sergiosergio000000 000000 struct WindowManager { struct WindowList { Window* window; string name; string geometry; }; vector windowList; void append(Window* window, string name); void loadGeometry(); void saveGeometry(); void hideAll(); private: Configuration::Document config; }; extern WindowManager* windowManager; data/000700 001750 001750 00000000000 12656700342 012604 5ustar00sergiosergio000000 000000 processor/spc700/algorithms.cpp000664 001750 001750 00000004402 12651764221 017620 0ustar00sergiosergio000000 000000 uint8 SPC700::op_adc(uint8 x, uint8 y) { int r = x + y + regs.p.c; regs.p.n = r & 0x80; regs.p.v = ~(x ^ y) & (x ^ r) & 0x80; regs.p.h = (x ^ y ^ r) & 0x10; regs.p.z = (uint8)r == 0; regs.p.c = r > 0xff; return r; } uint8 SPC700::op_and(uint8 x, uint8 y) { x &= y; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SPC700::op_asl(uint8 x) { regs.p.c = x & 0x80; x <<= 1; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SPC700::op_cmp(uint8 x, uint8 y) { int r = x - y; regs.p.n = r & 0x80; regs.p.z = (uint8)r == 0; regs.p.c = r >= 0; return x; } uint8 SPC700::op_dec(uint8 x) { x--; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SPC700::op_eor(uint8 x, uint8 y) { x ^= y; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SPC700::op_inc(uint8 x) { x++; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SPC700::op_ld(uint8 x, uint8 y) { regs.p.n = y & 0x80; regs.p.z = y == 0; return y; } uint8 SPC700::op_lsr(uint8 x) { regs.p.c = x & 0x01; x >>= 1; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SPC700::op_or(uint8 x, uint8 y) { x |= y; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SPC700::op_rol(uint8 x) { unsigned carry = regs.p.c << 0; regs.p.c = x & 0x80; x = (x << 1) | carry; regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SPC700::op_ror(uint8 x) { unsigned carry = regs.p.c << 7; regs.p.c = x & 0x01; x = carry | (x >> 1); regs.p.n = x & 0x80; regs.p.z = x == 0; return x; } uint8 SPC700::op_sbc(uint8 x, uint8 y) { return op_adc(x, ~y); } uint8 SPC700::op_st(uint8 x, uint8 y) { return y; } // uint16 SPC700::op_adw(uint16 x, uint16 y) { uint16 r; regs.p.c = 0; r = op_adc(x, y); r |= op_adc(x >> 8, y >> 8) << 8; regs.p.z = r == 0; return r; } uint16 SPC700::op_cpw(uint16 x, uint16 y) { int r = x - y; regs.p.n = r & 0x8000; regs.p.z = (uint16)r == 0; regs.p.c = r >= 0; return x; } uint16 SPC700::op_ldw(uint16 x, uint16 y) { regs.p.n = y & 0x8000; regs.p.z = y == 0; return y; } uint16 SPC700::op_sbw(uint16 x, uint16 y) { uint16 r; regs.p.c = 1; r = op_sbc(x, y); r |= op_sbc(x >> 8, y >> 8) << 8; regs.p.z = r == 0; return r; }